@ninebone/table 0.0.565 β 0.0.567
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 +291 -277
- package/dist/nine-table.js.map +1 -1
- package/dist/nine-table.umd.js +28 -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,30 @@ 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 {
|
|
1079
|
+
.ng-container-nodata {
|
|
1080
|
+
display: block;
|
|
1081
|
+
}
|
|
1082
|
+
.ng-part-body {
|
|
1083
|
+
display: none;
|
|
1084
|
+
}
|
|
1085
|
+
}
|
|
1086
|
+
|
|
1074
1087
|
</style>
|
|
1075
1088
|
|
|
1076
1089
|
<nine-table-header></nine-table-header>
|
|
1077
1090
|
<nine-table-body>
|
|
1078
1091
|
<nine-table-summary></nine-table-summary>
|
|
1079
1092
|
<nine-table-sheets>
|
|
1080
|
-
<nine-table-sheets-body>${
|
|
1093
|
+
<nine-table-sheets-body>${r}</nine-table-sheets-body>
|
|
1081
1094
|
<nine-table-sheets-footer>
|
|
1082
1095
|
<div class="nine-tab-bar">${o}</div>
|
|
1083
1096
|
<div class="sheets-counter">Total : <span id="row-count">0</span></div>
|
|
@@ -1086,40 +1099,40 @@ const Ne = class Ne {
|
|
|
1086
1099
|
<nine-table-analysis></nine-table-analysis>
|
|
1087
1100
|
</nine-table-body>
|
|
1088
1101
|
<nine-table-footer></nine-table-footer>
|
|
1089
|
-
|
|
1090
|
-
const a = t(this,
|
|
1102
|
+
`, t(this, H).shadowRoot.querySelector("nine-table-sheets").classList.add("nodata");
|
|
1103
|
+
const a = t(this, H).shadowRoot.querySelectorAll("nine-table-sheet");
|
|
1091
1104
|
a == null || a.forEach((c, l) => {
|
|
1092
1105
|
e[l] && setTimeout(() => {
|
|
1093
1106
|
c.generate(e[l]), s && t(this, Tt).call(this);
|
|
1094
1107
|
});
|
|
1095
1108
|
});
|
|
1096
1109
|
}, "#render"));
|
|
1097
|
-
p(this,
|
|
1110
|
+
p(this, H, n), t(this, Zt).call(this);
|
|
1098
1111
|
}
|
|
1099
1112
|
};
|
|
1100
|
-
|
|
1113
|
+
H = new WeakMap(), Zt = new WeakMap(), Tt = new WeakMap(), Gt = new WeakMap(), h(Ne, "LayoutManager");
|
|
1101
1114
|
let fe = Ne;
|
|
1102
1115
|
var kt, ht;
|
|
1103
1116
|
const We = class We {
|
|
1104
|
-
constructor(
|
|
1117
|
+
constructor(n) {
|
|
1105
1118
|
d(this, kt);
|
|
1106
1119
|
d(this, ht, -1);
|
|
1107
1120
|
A(this, "count", /* @__PURE__ */ h(() => t(this, kt).rawRecords.length, "count"));
|
|
1108
|
-
p(this, kt,
|
|
1121
|
+
p(this, kt, n);
|
|
1109
1122
|
}
|
|
1110
1123
|
get at() {
|
|
1111
1124
|
return t(this, ht);
|
|
1112
1125
|
}
|
|
1113
|
-
set at(
|
|
1114
|
-
p(this, ht, parseInt(
|
|
1126
|
+
set at(n) {
|
|
1127
|
+
p(this, ht, parseInt(n, 10)), body && !body.querySelector(`tbody.bindable tr[data-row="${t(this, ht)}"]`) && setTimeout(() => {
|
|
1115
1128
|
});
|
|
1116
1129
|
}
|
|
1117
1130
|
};
|
|
1118
1131
|
kt = new WeakMap(), ht = new WeakMap(), h(We, "ngRow");
|
|
1119
1132
|
let ue = We;
|
|
1120
|
-
var _, k, N, dt, Jt, Y, Qt,
|
|
1133
|
+
var _, k, N, dt, Jt, Y, Qt, nt, Ct, te, ee, ft;
|
|
1121
1134
|
const O = class O {
|
|
1122
|
-
constructor(
|
|
1135
|
+
constructor(n, e) {
|
|
1123
1136
|
d(this, _);
|
|
1124
1137
|
d(this, k);
|
|
1125
1138
|
d(this, N, []);
|
|
@@ -1128,34 +1141,35 @@ const O = class O {
|
|
|
1128
1141
|
d(this, Y, []);
|
|
1129
1142
|
d(this, Qt, /* @__PURE__ */ h(() => {
|
|
1130
1143
|
p(this, Y, []);
|
|
1131
|
-
const
|
|
1132
|
-
Array.from(
|
|
1144
|
+
const n = t(this, _).template || [];
|
|
1145
|
+
Array.from(n).forEach((e) => {
|
|
1133
1146
|
var s;
|
|
1134
1147
|
t(this, Y).push(((s = e.getBoundingClientRect) == null ? void 0 : s.call(e).height) || 24);
|
|
1135
1148
|
}), (t(this, k).rawRecords || []).forEach((e) => {
|
|
1136
1149
|
e.__ng || (e.__ng = t(this, Ct).call(this)), e.__ng.height = t(this, Y).slice();
|
|
1137
1150
|
});
|
|
1138
1151
|
}, "#initialize"));
|
|
1139
|
-
d(this,
|
|
1140
|
-
t(this, _).shadowRoot.
|
|
1141
|
-
|
|
1152
|
+
d(this, nt, /* @__PURE__ */ h(() => {
|
|
1153
|
+
const n = t(this, _).shadowRoot.querySelector("nine-table-sheets");
|
|
1154
|
+
n == null || n.classList.toggle("nodata", this.length === 0), t(this, _).shadowRoot.querySelectorAll("nine-table-sheet").forEach((e) => {
|
|
1155
|
+
e.invalidate();
|
|
1142
1156
|
});
|
|
1143
1157
|
}, "#invalidate"));
|
|
1144
|
-
A(this, "get", /* @__PURE__ */ h((
|
|
1145
|
-
var
|
|
1158
|
+
A(this, "get", /* @__PURE__ */ h((n, e) => {
|
|
1159
|
+
var r;
|
|
1146
1160
|
const s = this.getValidData();
|
|
1147
1161
|
if (!s || s.length <= 0) return;
|
|
1148
|
-
if (
|
|
1149
|
-
if (
|
|
1150
|
-
const i = typeof ((
|
|
1162
|
+
if (n == null) return t(this, ft).call(this, s);
|
|
1163
|
+
if (n < 0 || n >= s.length) return null;
|
|
1164
|
+
const i = typeof ((r = t(this, _).fields) == null ? void 0 : r.get) == "function" ? t(this, _).fields.get() : [];
|
|
1151
1165
|
if (e != null) {
|
|
1152
1166
|
const o = i.indexOf(e);
|
|
1153
|
-
return o >= 0 ? s[
|
|
1167
|
+
return o >= 0 ? s[n].v[o] : null;
|
|
1154
1168
|
}
|
|
1155
|
-
return t(this, ft).call(this, s[
|
|
1169
|
+
return t(this, ft).call(this, s[n]);
|
|
1156
1170
|
}, "get"));
|
|
1157
|
-
A(this, "set", /* @__PURE__ */ h((
|
|
1158
|
-
this.clear(), this.add(
|
|
1171
|
+
A(this, "set", /* @__PURE__ */ h((n) => {
|
|
1172
|
+
this.clear(), this.add(n, !1), t(this, nt).call(this);
|
|
1159
1173
|
}, "set"));
|
|
1160
1174
|
d(this, Ct, /* @__PURE__ */ h(() => ({
|
|
1161
1175
|
rowState: O.ROW_STATE.EMPTY,
|
|
@@ -1167,84 +1181,84 @@ const O = class O {
|
|
|
1167
1181
|
_: [0, 0, 0, 0, O.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, t(this, Y).slice(), -1, {}, {}]
|
|
1168
1182
|
}), "#getDefaultMeta"));
|
|
1169
1183
|
A(this, "reset", /* @__PURE__ */ h(() => {
|
|
1170
|
-
p(this, N, []), p(this, dt, []), t(this,
|
|
1184
|
+
p(this, N, []), p(this, dt, []), t(this, nt).call(this);
|
|
1171
1185
|
}, "reset"));
|
|
1172
1186
|
A(this, "clear", /* @__PURE__ */ h(() => {
|
|
1173
|
-
var
|
|
1174
|
-
t(this, k).rawRecords = [], p(this, N, []), p(this, dt, []), (
|
|
1187
|
+
var n;
|
|
1188
|
+
t(this, k).rawRecords = [], p(this, N, []), p(this, dt, []), (n = t(this, k).viewRecords) != null && n.reset && t(this, k).viewRecords.reset();
|
|
1175
1189
|
}, "clear"));
|
|
1176
|
-
d(this, te, /* @__PURE__ */ h((
|
|
1190
|
+
d(this, te, /* @__PURE__ */ h((n) => {
|
|
1177
1191
|
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
|
|
1192
|
+
Array.isArray(n) || (n = [n]);
|
|
1193
|
+
const e = typeof ((i = t(this, _).fields) == null ? void 0 : i.get) == "function" ? t(this, _).fields.get() : Object.keys(n[0] || {}), s = [];
|
|
1194
|
+
return n.forEach((r) => {
|
|
1181
1195
|
const o = { v: [] };
|
|
1182
1196
|
e.forEach((a) => {
|
|
1183
|
-
o.v.push(
|
|
1197
|
+
o.v.push(r[a] !== void 0 && r[a] !== null ? r[a] : "");
|
|
1184
1198
|
}), s.push(o);
|
|
1185
1199
|
}), s;
|
|
1186
1200
|
}, "#json2Array"));
|
|
1187
|
-
d(this, ee, /* @__PURE__ */ h((
|
|
1201
|
+
d(this, ee, /* @__PURE__ */ h((n) => (Array.isArray(n) || (n = [n]), n.forEach((e) => {
|
|
1188
1202
|
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,
|
|
1203
|
+
}), n), "#defaultInsert"));
|
|
1204
|
+
A(this, "add", /* @__PURE__ */ h((n, e = !0) => {
|
|
1205
|
+
n === void 0 && (n = {});
|
|
1206
|
+
const s = t(this, te).call(this, n);
|
|
1193
1207
|
t(this, k).rawRecords = t(this, k).rawRecords.concat(t(this, ee).call(this, s)), this.resetRecords();
|
|
1194
1208
|
const i = this.count() - 1;
|
|
1195
|
-
return e || s.forEach((
|
|
1209
|
+
return e || s.forEach((r, o) => {
|
|
1196
1210
|
const a = t(this, k).rawRecords[i - o];
|
|
1197
1211
|
a && (a.__ng.rowState = O.ROW_STATE.EMPTY);
|
|
1198
|
-
}), t(this,
|
|
1212
|
+
}), t(this, nt).call(this), i;
|
|
1199
1213
|
}, "add"));
|
|
1200
|
-
A(this, "delete", /* @__PURE__ */ h((
|
|
1214
|
+
A(this, "delete", /* @__PURE__ */ h((n) => {
|
|
1201
1215
|
let e = [];
|
|
1202
|
-
Array.isArray(
|
|
1216
|
+
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
1217
|
if (t(this, N)[s]) {
|
|
1204
1218
|
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
|
-
|
|
1219
|
+
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) => {
|
|
1220
|
+
r.__ng.rowid === i && (r.__ng.deleted = !0, r.__ng.rowState = O.ROW_STATE.DELETE);
|
|
1207
1221
|
});
|
|
1208
1222
|
}
|
|
1209
|
-
}), this.resetRecords(), t(this,
|
|
1223
|
+
}), this.resetRecords(), t(this, nt).call(this);
|
|
1210
1224
|
}, "delete"));
|
|
1211
|
-
A(this, "setValue", /* @__PURE__ */ h((
|
|
1225
|
+
A(this, "setValue", /* @__PURE__ */ h((n, e, s) => {
|
|
1212
1226
|
var c;
|
|
1213
|
-
|
|
1214
|
-
const
|
|
1215
|
-
if (
|
|
1216
|
-
const o = this.getValidData()[
|
|
1227
|
+
n = parseInt(n, 10);
|
|
1228
|
+
const r = (typeof ((c = t(this, _).fields) == null ? void 0 : c.get) == "function" ? t(this, _).fields.get() : []).indexOf(e);
|
|
1229
|
+
if (r < 0) return;
|
|
1230
|
+
const o = this.getValidData()[n];
|
|
1217
1231
|
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[
|
|
1232
|
+
const a = o.v[r];
|
|
1233
|
+
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
1234
|
}, "setValue"));
|
|
1221
1235
|
A(this, "resetRecords", /* @__PURE__ */ h(() => {
|
|
1222
|
-
p(this, dt, t(this, k).rawRecords.filter((
|
|
1223
|
-
|
|
1224
|
-
}), t(this, N).forEach((
|
|
1225
|
-
|
|
1236
|
+
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) => {
|
|
1237
|
+
n.__ng.rowidx = e;
|
|
1238
|
+
}), t(this, N).forEach((n, e) => {
|
|
1239
|
+
n.__ng.i = e;
|
|
1226
1240
|
});
|
|
1227
1241
|
}, "resetRecords"));
|
|
1228
1242
|
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((
|
|
1243
|
+
d(this, ft, /* @__PURE__ */ h((n) => {
|
|
1230
1244
|
var o;
|
|
1231
|
-
if (!
|
|
1232
|
-
const e = !Array.isArray(
|
|
1245
|
+
if (!n) return n;
|
|
1246
|
+
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
1247
|
const c = {};
|
|
1234
1248
|
return i.forEach((l, f) => {
|
|
1235
1249
|
c[l] = a.v ? a.v[f] : a[l];
|
|
1236
1250
|
}), c.__ng = a.__ng, c;
|
|
1237
1251
|
});
|
|
1238
|
-
return e ?
|
|
1252
|
+
return e ? r[0] : r;
|
|
1239
1253
|
}, "#conv"));
|
|
1240
1254
|
A(this, "count", /* @__PURE__ */ h(() => this.getValidData().length, "count"));
|
|
1241
|
-
p(this, _,
|
|
1255
|
+
p(this, _, n), p(this, k, e), t(this, Qt).call(this);
|
|
1242
1256
|
}
|
|
1243
1257
|
get source() {
|
|
1244
1258
|
return t(this, ft).call(this, t(this, k).rawRecords);
|
|
1245
1259
|
}
|
|
1246
|
-
set source(
|
|
1247
|
-
this.clear(), this.add(
|
|
1260
|
+
set source(n) {
|
|
1261
|
+
this.clear(), this.add(n, !1);
|
|
1248
1262
|
}
|
|
1249
1263
|
get nextId() {
|
|
1250
1264
|
return ++Ue(this, Jt)._;
|
|
@@ -1259,7 +1273,7 @@ const O = class O {
|
|
|
1259
1273
|
return this.length;
|
|
1260
1274
|
}
|
|
1261
1275
|
};
|
|
1262
|
-
_ = new WeakMap(), k = new WeakMap(), N = new WeakMap(), dt = new WeakMap(), Jt = new WeakMap(), Y = new WeakMap(), Qt = new WeakMap(),
|
|
1276
|
+
_ = 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
1277
|
A(O, "ROW_STATE", {
|
|
1264
1278
|
EMPTY: "EMPTY",
|
|
1265
1279
|
NORMAL: "NORMAL",
|
|
@@ -1270,18 +1284,18 @@ A(O, "ROW_STATE", {
|
|
|
1270
1284
|
let ge = O;
|
|
1271
1285
|
var it;
|
|
1272
1286
|
const Oe = class Oe {
|
|
1273
|
-
constructor(
|
|
1287
|
+
constructor(n) {
|
|
1274
1288
|
d(this, it);
|
|
1275
|
-
p(this, it,
|
|
1289
|
+
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
1290
|
var e;
|
|
1277
1291
|
(e = t(this, it).view) != null && e.redraw && t(this, it).view.redraw();
|
|
1278
1292
|
}, this.setDataSource = (e) => {
|
|
1279
1293
|
this.data && this.data.reset(), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.data.set(e || []);
|
|
1280
1294
|
}, this.getRowState = (e) => {
|
|
1281
|
-
var i,
|
|
1295
|
+
var i, r;
|
|
1282
1296
|
const s = parseInt(e, 10);
|
|
1283
1297
|
if (!(s >= this.data.count()))
|
|
1284
|
-
return (
|
|
1298
|
+
return (r = (i = this.data.getValidData()[s]) == null ? void 0 : i.__ng) == null ? void 0 : r.rowState;
|
|
1285
1299
|
}, this.getRowPosition = () => this.row.at, this.setRowPosition = (e) => {
|
|
1286
1300
|
this.row.at = e;
|
|
1287
1301
|
}, 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 +1308,31 @@ let be = Oe;
|
|
|
1294
1308
|
var ut, L, Lt, se;
|
|
1295
1309
|
const Be = class Be {
|
|
1296
1310
|
// π― μ΄μ { name: string, type: string } κ°μ²΄λ€μ λ°°μ΄λ‘ κ΄λ¦¬ν©λλ€.
|
|
1297
|
-
constructor(
|
|
1311
|
+
constructor(n) {
|
|
1298
1312
|
d(this, ut);
|
|
1299
1313
|
d(this, L, []);
|
|
1300
|
-
A(this, "add", /* @__PURE__ */ h((
|
|
1301
|
-
|
|
1314
|
+
A(this, "add", /* @__PURE__ */ h((n, e = "string") => {
|
|
1315
|
+
n.forEach((s) => {
|
|
1302
1316
|
t(this, L).some((i) => i.name === s) || t(this, L).push({ name: s, type: e });
|
|
1303
1317
|
}), t(this, Lt).call(this);
|
|
1304
1318
|
}, "add"));
|
|
1305
1319
|
d(this, Lt, /* @__PURE__ */ h(() => {
|
|
1306
|
-
const
|
|
1320
|
+
const n = /* @__PURE__ */ new Map();
|
|
1307
1321
|
t(this, L).forEach((e) => {
|
|
1308
|
-
|
|
1309
|
-
}), p(this, L, Array.from(
|
|
1322
|
+
n.set(e.name, e.type);
|
|
1323
|
+
}), 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
1324
|
}, "#adjust"));
|
|
1311
1325
|
d(this, se, /* @__PURE__ */ h(() => {
|
|
1312
1326
|
p(this, L, []), W.log(t(this, ut).querySelectorAll("table"));
|
|
1313
|
-
const
|
|
1314
|
-
if (!(!
|
|
1315
|
-
for (const e of
|
|
1327
|
+
const n = Array.from(t(this, ut).querySelectorAll("table"));
|
|
1328
|
+
if (!(!n || n.length === 0)) {
|
|
1329
|
+
for (const e of n)
|
|
1316
1330
|
W.log(e), $("[data-bind]", e).each((s, i) => {
|
|
1317
|
-
const
|
|
1318
|
-
|
|
1331
|
+
const r = i.dataset.bind, o = i.getAttribute("data-type") || "string";
|
|
1332
|
+
r && t(this, L).push({ name: r, type: o });
|
|
1319
1333
|
}), ["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 =
|
|
1334
|
+
$(`[${s}]`, e).each((i, r) => {
|
|
1335
|
+
var o = r.getAttribute(s);
|
|
1322
1336
|
if (o.indexOf("data.") < 0) {
|
|
1323
1337
|
const a = o.search(/[(]/g);
|
|
1324
1338
|
if (a > 0)
|
|
@@ -1340,41 +1354,41 @@ const Be = class Be {
|
|
|
1340
1354
|
t(this, Lt).call(this);
|
|
1341
1355
|
}
|
|
1342
1356
|
}, "#init"));
|
|
1343
|
-
p(this, ut,
|
|
1357
|
+
p(this, ut, n), t(this, se).call(this);
|
|
1344
1358
|
}
|
|
1345
1359
|
// π― κΈ°μ‘΄μ νλ μ΄λ¦λ§ μ°λ κ³³λ€κ³Όμ νΈνμ μν΄ μ΄λ¦ λ°°μ΄λ§ 리ν΄νλ λ©μλ μ μ§
|
|
1346
1360
|
get() {
|
|
1347
|
-
return t(this, L).map((
|
|
1361
|
+
return t(this, L).map((n) => n.name);
|
|
1348
1362
|
}
|
|
1349
1363
|
// π― λ΄λΆ κ°μ²΄ ν΅μ§Έλ‘ μ»κΈ°
|
|
1350
1364
|
getFields() {
|
|
1351
1365
|
return t(this, L);
|
|
1352
1366
|
}
|
|
1353
1367
|
// π― νΉμ νλμ λ°μ΄ν° νμ
μ‘°ν
|
|
1354
|
-
getType(
|
|
1355
|
-
const e = t(this, L).find((s) => s.name ===
|
|
1368
|
+
getType(n) {
|
|
1369
|
+
const e = t(this, L).find((s) => s.name === n);
|
|
1356
1370
|
return e ? e.type : "string";
|
|
1357
1371
|
}
|
|
1358
|
-
indexOf(
|
|
1359
|
-
return t(this, L).findIndex((e) => e.name ===
|
|
1372
|
+
indexOf(n) {
|
|
1373
|
+
return t(this, L).findIndex((e) => e.name === n);
|
|
1360
1374
|
}
|
|
1361
|
-
includes(
|
|
1362
|
-
return t(this, L).some((e) => e.name ===
|
|
1375
|
+
includes(n) {
|
|
1376
|
+
return t(this, L).some((e) => e.name === n);
|
|
1363
1377
|
}
|
|
1364
1378
|
};
|
|
1365
1379
|
ut = new WeakMap(), L = new WeakMap(), Lt = new WeakMap(), se = new WeakMap(), h(Be, "ngFields");
|
|
1366
1380
|
let pe = Be;
|
|
1367
|
-
var
|
|
1381
|
+
var rt, ne, ie;
|
|
1368
1382
|
const ze = class ze extends HTMLElement {
|
|
1369
1383
|
constructor() {
|
|
1370
1384
|
super();
|
|
1371
1385
|
//#created = false;
|
|
1372
|
-
d(this,
|
|
1373
|
-
d(this,
|
|
1386
|
+
d(this, rt);
|
|
1387
|
+
d(this, ne);
|
|
1374
1388
|
d(this, ie, /* @__PURE__ */ h(() => {
|
|
1375
|
-
this.fields = new pe(this), p(this,
|
|
1389
|
+
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
1390
|
}, "#init"));
|
|
1377
|
-
this.attachShadow({ mode: "open" }), p(this,
|
|
1391
|
+
this.attachShadow({ mode: "open" }), p(this, rt, new be(this));
|
|
1378
1392
|
}
|
|
1379
1393
|
connectedCallback() {
|
|
1380
1394
|
t(this, ie).call(this);
|
|
@@ -1384,18 +1398,18 @@ const ze = class ze extends HTMLElement {
|
|
|
1384
1398
|
}
|
|
1385
1399
|
// π― μΈλΆμμ grid.data.set(...) ννλ‘ μ κ·Όν μ μλλ‘ λ°μ΄ν° λ§€λμ μ€ν
|
|
1386
1400
|
get data() {
|
|
1387
|
-
return t(this,
|
|
1401
|
+
return t(this, rt).data;
|
|
1388
1402
|
}
|
|
1389
1403
|
// π― ν(row) κ΄λ ¨ μ μ΄ μ κ·Όμ μ€ν
|
|
1390
1404
|
get row() {
|
|
1391
|
-
return t(this,
|
|
1405
|
+
return t(this, rt).row;
|
|
1392
1406
|
}
|
|
1393
1407
|
// π― μ 체 λ°μ΄ν° λ§€λμ μ κ·Ό νμν κ²½μ°
|
|
1394
1408
|
get dataManager() {
|
|
1395
|
-
return t(this,
|
|
1409
|
+
return t(this, rt);
|
|
1396
1410
|
}
|
|
1397
1411
|
};
|
|
1398
|
-
|
|
1412
|
+
rt = new WeakMap(), ne = new WeakMap(), ie = new WeakMap(), h(ze, "NineTable");
|
|
1399
1413
|
let ye = ze;
|
|
1400
1414
|
customElements.get("nine-table") || customElements.define("nine-table", ye);
|
|
1401
1415
|
const mt = class mt extends HTMLElement {
|
|
@@ -1412,7 +1426,7 @@ const mt = class mt extends HTMLElement {
|
|
|
1412
1426
|
h(mt, "BasicCellElement"), A(mt, "_styleCache", /* @__PURE__ */ new Map()), A(mt, "_customStyleCache", /* @__PURE__ */ new Map());
|
|
1413
1427
|
let me = mt;
|
|
1414
1428
|
var C, Ht, y, Re, qe, Te, ke, Ce;
|
|
1415
|
-
const
|
|
1429
|
+
const De = class De extends me {
|
|
1416
1430
|
constructor() {
|
|
1417
1431
|
super();
|
|
1418
1432
|
d(this, C);
|
|
@@ -1447,11 +1461,11 @@ const Pe = class Pe extends me {
|
|
|
1447
1461
|
var e = ninegrid.j.querySelectorAll(t(this, y)).attr("suppress");
|
|
1448
1462
|
if (e && (e = parseInt(e)), e && !isNaN(e)) {
|
|
1449
1463
|
var s = t(this, y).closest("tr"), i = [];
|
|
1450
|
-
$("th,td", s).each((x,
|
|
1451
|
-
var T = ninegrid.j.querySelectorAll(
|
|
1452
|
-
T &&
|
|
1464
|
+
$("th,td", s).each((x, M) => {
|
|
1465
|
+
var T = ninegrid.j.querySelectorAll(M).attr("suppress");
|
|
1466
|
+
T && M.dataset.row && (T = parseInt(T), !isNaN(T) && T <= e && i.push(T));
|
|
1453
1467
|
}), i.sort();
|
|
1454
|
-
var
|
|
1468
|
+
var r = !1;
|
|
1455
1469
|
if (parseInt(s.sectionRowIndex / t(this, C).template.length) > 0)
|
|
1456
1470
|
for (var o of i) {
|
|
1457
1471
|
if (o > e) break;
|
|
@@ -1459,19 +1473,19 @@ const Pe = class Pe extends me {
|
|
|
1459
1473
|
t(this, y).dataset.matrixRow;
|
|
1460
1474
|
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
1475
|
if (g != b) {
|
|
1462
|
-
|
|
1476
|
+
r = !0;
|
|
1463
1477
|
break;
|
|
1464
1478
|
}
|
|
1465
1479
|
}
|
|
1466
1480
|
else
|
|
1467
|
-
|
|
1468
|
-
|
|
1481
|
+
r = !0;
|
|
1482
|
+
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
1483
|
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
1484
|
$(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
1485
|
}
|
|
1472
1486
|
}
|
|
1473
1487
|
}, "#resetSuppress"));
|
|
1474
|
-
A(this, "getExprValue", /* @__PURE__ */ h((e, s, i,
|
|
1488
|
+
A(this, "getExprValue", /* @__PURE__ */ h((e, s, i, r) => {
|
|
1475
1489
|
if (typeof e < "u")
|
|
1476
1490
|
try {
|
|
1477
1491
|
i = parseInt(i);
|
|
@@ -1507,9 +1521,9 @@ const Pe = class Pe extends me {
|
|
|
1507
1521
|
return parseInt(t(this, y).dataset.row), t(this, Ht).data[e];
|
|
1508
1522
|
}
|
|
1509
1523
|
};
|
|
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
|
|
1524
|
+
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");
|
|
1525
|
+
let xe = De;
|
|
1526
|
+
const Pe = class Pe extends xe {
|
|
1513
1527
|
constructor() {
|
|
1514
1528
|
super();
|
|
1515
1529
|
}
|
|
@@ -1520,9 +1534,9 @@ const De = class De extends xe {
|
|
|
1520
1534
|
return super.refresh();
|
|
1521
1535
|
}
|
|
1522
1536
|
};
|
|
1523
|
-
h(
|
|
1524
|
-
let ve =
|
|
1525
|
-
var Mt, ot, gt, bt,
|
|
1537
|
+
h(Pe, "EditableCellElement");
|
|
1538
|
+
let ve = Pe;
|
|
1539
|
+
var Mt, ot, gt, bt, re, U, Le;
|
|
1526
1540
|
const je = class je extends ve {
|
|
1527
1541
|
constructor() {
|
|
1528
1542
|
super();
|
|
@@ -1530,7 +1544,7 @@ const je = class je extends ve {
|
|
|
1530
1544
|
d(this, ot);
|
|
1531
1545
|
d(this, gt);
|
|
1532
1546
|
d(this, bt);
|
|
1533
|
-
d(this,
|
|
1547
|
+
d(this, re);
|
|
1534
1548
|
d(this, U);
|
|
1535
1549
|
A(this, "refresh", /* @__PURE__ */ h(() => {
|
|
1536
1550
|
const e = super.refresh();
|
|
@@ -1569,8 +1583,8 @@ const je = class je extends ve {
|
|
|
1569
1583
|
d(this, Le, /* @__PURE__ */ h((e) => {
|
|
1570
1584
|
if (!["Escape", "Enter", "Tab", "Home", "End", "ArrowLeft", "ArrowRight", "PageUp", "PageDown", "Backspace", "Delete"].includes(e.code)) {
|
|
1571
1585
|
if (t(this, ot) == "number") {
|
|
1572
|
-
let
|
|
1573
|
-
if (t(this, U) && Number(t(this, U)) > 0 &&
|
|
1586
|
+
let r = [];
|
|
1587
|
+
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
1588
|
var s = e.target.value, i = s.indexOf(".");
|
|
1575
1589
|
if (i >= 0) {
|
|
1576
1590
|
var s = s.substr(i + 1, s.length);
|
|
@@ -1581,7 +1595,7 @@ const je = class je extends ve {
|
|
|
1581
1595
|
t(this, gt) && ninegrid.getByteLength(e.target.value) >= Number(t(this, gt)) && e.target.selectionStart == e.target.selectionEnd && e.preventDefault();
|
|
1582
1596
|
}
|
|
1583
1597
|
}, "#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,
|
|
1598
|
+
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
1599
|
}
|
|
1586
1600
|
connectedCallback() {
|
|
1587
1601
|
for (var e = [], s = 0; s < this.attributes.length; s++)
|
|
@@ -1594,7 +1608,7 @@ const je = class je extends ve {
|
|
|
1594
1608
|
`, super.connectedCallback(), p(this, Mt, this.querySelector("input"));
|
|
1595
1609
|
}
|
|
1596
1610
|
};
|
|
1597
|
-
Mt = new WeakMap(), ot = new WeakMap(), gt = new WeakMap(), bt = new WeakMap(),
|
|
1611
|
+
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
1612
|
let we = je;
|
|
1599
1613
|
customElements.get("cell-input-text");
|
|
1600
1614
|
customElements.get("cell-input") || customElements.define("cell-input", we);
|