@ninebone/table 0.0.532 β 0.0.533
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 +217 -216
- package/dist/nine-table.js.map +1 -1
- package/dist/nine-table.umd.js +7 -7
- package/dist/nine-table.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/nine-table.js
CHANGED
|
@@ -44,22 +44,22 @@ 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, n = t(this, w).thumb, a = t(this, z).querySelector(".ng-container-bottom"), o = e.clientWidth,
|
|
48
|
-
if (o !== 0 &&
|
|
47
|
+
const i = t(this, w).track, n = t(this, w).thumb, a = t(this, z).querySelector(".ng-container-bottom"), o = e.clientWidth, l = s.scrollWidth;
|
|
48
|
+
if (o !== 0 && l > o)
|
|
49
49
|
a && (a.style.display = "flex");
|
|
50
50
|
else {
|
|
51
51
|
a && (a.style.display = "none");
|
|
52
52
|
return;
|
|
53
53
|
}
|
|
54
|
-
const
|
|
55
|
-
if (
|
|
56
|
-
const f = Math.max(Math.min(
|
|
54
|
+
const c = i.clientWidth;
|
|
55
|
+
if (c <= 0) return;
|
|
56
|
+
const f = Math.max(Math.min(c * (o / l), c), 20);
|
|
57
57
|
n.style.width = `${f}px`;
|
|
58
|
-
const u = e.scrollLeft,
|
|
59
|
-
let
|
|
60
|
-
|
|
61
|
-
const m =
|
|
62
|
-
|
|
58
|
+
const u = e.scrollLeft, g = l - o;
|
|
59
|
+
let b = 0;
|
|
60
|
+
g > 0 && (b = parseInt(u / g * (c - f), 10)), b < 0 && (b = 0);
|
|
61
|
+
const m = c - f;
|
|
62
|
+
b > m && (b = m), n.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;
|
|
@@ -68,10 +68,10 @@ const Me = class Me extends HTMLElement {
|
|
|
68
68
|
const n = t(this, w).track.getBoundingClientRect(), a = t(this, w).thumb.clientWidth;
|
|
69
69
|
let o = e;
|
|
70
70
|
o < 0 && (o = 0);
|
|
71
|
-
const
|
|
72
|
-
o >
|
|
73
|
-
const
|
|
74
|
-
return
|
|
71
|
+
const l = n.width - a;
|
|
72
|
+
o > l && (o = l), o = parseInt(o, 10), t(this, w).thumb.style.left = `${o}px`, t(this, w).left.disabled = o === 0, t(this, w).right.disabled = o >= l - 1;
|
|
73
|
+
const c = s.clientWidth, u = i.scrollWidth - c;
|
|
74
|
+
return l > 0 && u > 0 && (s.scrollLeft = o / l * u), o > 0 && o < l - 1;
|
|
75
75
|
}, "#thumbMoveTo"));
|
|
76
76
|
d(this, Nt, /* @__PURE__ */ h(() => {
|
|
77
77
|
const e = /* @__PURE__ */ h((i) => {
|
|
@@ -102,8 +102,8 @@ const Me = class Me extends HTMLElement {
|
|
|
102
102
|
i.stopPropagation(), i.preventDefault(), y(this, j, !0), this.shiftX = i.clientX - t(this, w).thumb.getBoundingClientRect().left;
|
|
103
103
|
const n = /* @__PURE__ */ h((o) => {
|
|
104
104
|
if (!t(this, j)) return;
|
|
105
|
-
const
|
|
106
|
-
t(this, G).call(this, o.clientX -
|
|
105
|
+
const l = t(this, w).track.getBoundingClientRect();
|
|
106
|
+
t(this, G).call(this, o.clientX - l.left - this.shiftX);
|
|
107
107
|
}, "onMouseMove"), a = /* @__PURE__ */ h(() => {
|
|
108
108
|
y(this, j, !1), s(), document.removeEventListener("mousemove", n), document.removeEventListener("mouseup", a), this.refresh();
|
|
109
109
|
}, "onMouseUp");
|
|
@@ -201,7 +201,7 @@ const Me = class Me extends HTMLElement {
|
|
|
201
201
|
z = new WeakMap(), j = new WeakMap(), w = new WeakMap(), X = new WeakMap(), K = new WeakMap(), Z = new WeakMap(), _t = new WeakMap(), G = new WeakMap(), Nt = new WeakMap(), h(Me, "NineTableHScrollBar");
|
|
202
202
|
let le = Me;
|
|
203
203
|
customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar", le);
|
|
204
|
-
var F, ot, J, q,
|
|
204
|
+
var F, ot, J, q, vt, wt, Wt;
|
|
205
205
|
const $e = class $e extends HTMLElement {
|
|
206
206
|
constructor() {
|
|
207
207
|
super();
|
|
@@ -209,26 +209,26 @@ const $e = class $e extends HTMLElement {
|
|
|
209
209
|
d(this, ot);
|
|
210
210
|
d(this, J, !1);
|
|
211
211
|
d(this, q);
|
|
212
|
-
d(this, xt, 0);
|
|
213
212
|
d(this, vt, 0);
|
|
213
|
+
d(this, wt, 0);
|
|
214
214
|
A(this, "refresh", /* @__PURE__ */ h(() => {
|
|
215
215
|
if (!t(this, F) || !t(this, q)) return;
|
|
216
216
|
H.log("nine-table-vscrollbar.refresh");
|
|
217
|
-
const e = t(this, q).container, s = t(this, q).track, i = t(this, q).thumb, n = e.clientHeight, o = (t(this, F).data.get() || []).length,
|
|
218
|
-
if (
|
|
217
|
+
const e = t(this, q).container, s = t(this, q).track, i = t(this, q).thumb, n = e.clientHeight, o = (t(this, F).data.get() || []).length, l = t(this, ot).getRowHeight(), c = o * l;
|
|
218
|
+
if (c <= n) {
|
|
219
219
|
i.style.display = "none", t(this, q).top.disabled = !0, t(this, q).bottom.disabled = !0;
|
|
220
220
|
return;
|
|
221
221
|
} else
|
|
222
222
|
i.style.display = "block";
|
|
223
223
|
const f = s.clientHeight;
|
|
224
224
|
if (f <= 0) return;
|
|
225
|
-
const u = Math.max(Math.min(f * (n /
|
|
225
|
+
const u = Math.max(Math.min(f * (n / c), f), 20);
|
|
226
226
|
i.style.height = `${u}px`;
|
|
227
|
-
const
|
|
227
|
+
const g = e.scrollTop, b = Math.max(c - n, 1);
|
|
228
228
|
let m = 0;
|
|
229
|
-
|
|
229
|
+
b > 0 && (m = g / b * (f - u));
|
|
230
230
|
const v = f - u;
|
|
231
|
-
m < 0 && (m = 0), m > v && (m = v), i.style.top = `${m}px`, t(this, q).top.disabled =
|
|
231
|
+
m < 0 && (m = 0), m > v && (m = v), i.style.top = `${m}px`, t(this, q).top.disabled = g <= 0, t(this, q).bottom.disabled = g >= b - 1;
|
|
232
232
|
}, "refresh"));
|
|
233
233
|
d(this, Wt, /* @__PURE__ */ h(() => {
|
|
234
234
|
H.log("nine-table-vscrollbar.#init");
|
|
@@ -240,14 +240,14 @@ const $e = class $e extends HTMLElement {
|
|
|
240
240
|
t(this, J) || this.refresh();
|
|
241
241
|
}), t(this, q).thumb.addEventListener("mousedown", (i) => {
|
|
242
242
|
if (i.button !== 0) return;
|
|
243
|
-
i.stopPropagation(), i.preventDefault(), y(this, J, !0), y(this,
|
|
243
|
+
i.stopPropagation(), i.preventDefault(), y(this, J, !0), y(this, vt, i.clientY), y(this, wt, e.scrollTop);
|
|
244
244
|
const n = /* @__PURE__ */ h((o) => {
|
|
245
245
|
if (!t(this, J)) return;
|
|
246
|
-
const
|
|
246
|
+
const l = t(this, q).track.getBoundingClientRect(), c = t(this, q).thumb.clientHeight, u = l.height - c, g = o.clientY - t(this, vt), b = e.clientHeight, m = s(), v = Math.max(m - b, 1);
|
|
247
247
|
if (u > 0 && v > 0) {
|
|
248
|
-
const E =
|
|
249
|
-
let x = t(this,
|
|
250
|
-
const M = Math.max(0, m -
|
|
248
|
+
const E = g / u * v;
|
|
249
|
+
let x = t(this, wt) + E;
|
|
250
|
+
const M = Math.max(0, m - b);
|
|
251
251
|
x < 0 && (x = 0), x > M && (x = M), e.scrollTop = x;
|
|
252
252
|
}
|
|
253
253
|
this.refresh();
|
|
@@ -257,10 +257,10 @@ const $e = class $e extends HTMLElement {
|
|
|
257
257
|
document.addEventListener("mousemove", n), document.addEventListener("mouseup", a);
|
|
258
258
|
}), t(this, q).track.addEventListener("mousedown", (i) => {
|
|
259
259
|
if (i.button !== 0 || i.target === t(this, q).thumb) return;
|
|
260
|
-
const n = t(this, q).track.getBoundingClientRect(), a = t(this, q).thumb.clientHeight, o = i.clientY - n.top - a / 2,
|
|
261
|
-
if (
|
|
262
|
-
const
|
|
263
|
-
e.scrollTop =
|
|
260
|
+
const n = t(this, q).track.getBoundingClientRect(), a = t(this, q).thumb.clientHeight, o = i.clientY - n.top - a / 2, c = n.height - a, f = e.clientHeight, u = s(), g = Math.max(u - f, 1);
|
|
261
|
+
if (c > 0 && g > 0) {
|
|
262
|
+
const b = Math.max(0, Math.min(1, o / c));
|
|
263
|
+
e.scrollTop = b * g;
|
|
264
264
|
}
|
|
265
265
|
this.refresh();
|
|
266
266
|
}), t(this, q).top.addEventListener("click", () => {
|
|
@@ -352,55 +352,54 @@ const $e = class $e extends HTMLElement {
|
|
|
352
352
|
e();
|
|
353
353
|
}
|
|
354
354
|
};
|
|
355
|
-
F = new WeakMap(), ot = new WeakMap(), J = new WeakMap(), q = new WeakMap(),
|
|
355
|
+
F = new WeakMap(), ot = new WeakMap(), J = new WeakMap(), q = new WeakMap(), vt = new WeakMap(), wt = new WeakMap(), Wt = new WeakMap(), h($e, "NineTableVScrollBar");
|
|
356
356
|
let ce = $e;
|
|
357
357
|
customElements.get("nine-table-vscrollbar") || customElements.define("nine-table-vscrollbar", ce);
|
|
358
|
-
var P, S,
|
|
358
|
+
var P, S, at, D, I, V, Q, St, Ee, lt, Ot, Bt, zt, Et, At, Dt, Pt, Rt, Ae, ct, qt, jt;
|
|
359
359
|
const Ie = class Ie {
|
|
360
360
|
constructor(r) {
|
|
361
361
|
d(this, P);
|
|
362
362
|
d(this, S);
|
|
363
|
-
d(this,
|
|
363
|
+
d(this, at);
|
|
364
364
|
d(this, D, /* @__PURE__ */ new Map());
|
|
365
365
|
d(this, I, null);
|
|
366
366
|
d(this, V, null);
|
|
367
367
|
d(this, Q, 0);
|
|
368
368
|
d(this, St, 40);
|
|
369
369
|
d(this, Ee, !1);
|
|
370
|
-
d(this,
|
|
370
|
+
d(this, lt, !1);
|
|
371
371
|
d(this, Ot, 3);
|
|
372
372
|
A(this, "refresh", /* @__PURE__ */ h(() => {
|
|
373
373
|
H.log("rowManager.refresh");
|
|
374
374
|
const r = t(this, S).querySelector(".ng-container-body .ng-part-body");
|
|
375
|
-
r && (t(this, Et).call(this), t(this,
|
|
375
|
+
r && (t(this, Et).call(this), t(this, ct).call(this, r.scrollTop));
|
|
376
376
|
}, "refresh"));
|
|
377
377
|
A(this, "initialize", /* @__PURE__ */ h(() => {
|
|
378
|
-
H.log("rowManager.initialize")
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
378
|
+
H.log("rowManager.initialize"), y(this, at, {
|
|
379
|
+
scrollTables: t(this, S).querySelectorAll(".ng-part-body table"),
|
|
380
|
+
firstTr: t(this, S).querySelector(".ng-container-body .ng-part-body tbody.bindable-tbody tr:not(.nodata)")
|
|
381
|
+
}), y(this, I, null), t(this, D).clear(), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((a) => {
|
|
382
|
+
const o = t(this, S).querySelector(a);
|
|
383
|
+
if (!o) return;
|
|
384
|
+
const l = o.querySelector(".ng-part-body table");
|
|
384
385
|
if (!l) return;
|
|
385
|
-
const
|
|
386
|
-
if (!
|
|
387
|
-
const u =
|
|
388
|
-
|
|
389
|
-
const g = Array.from(u.querySelectorAll("tr")).map((m) => m.cloneNode(!0));
|
|
390
|
-
t(this, D).set(c, g);
|
|
386
|
+
const c = l.querySelector("tbody.bindable-tbody");
|
|
387
|
+
if (!c) return;
|
|
388
|
+
const u = Array.from(c.querySelectorAll("tr")).map((g) => g.cloneNode(!0));
|
|
389
|
+
t(this, D).set(a, u);
|
|
391
390
|
});
|
|
392
|
-
const
|
|
393
|
-
if (
|
|
394
|
-
t(this, zt).call(this,
|
|
395
|
-
let
|
|
396
|
-
const
|
|
397
|
-
var
|
|
398
|
-
|
|
391
|
+
const r = 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"), n = t(this, S).querySelector(".ng-container-body .ng-part-footer");
|
|
392
|
+
if (r) {
|
|
393
|
+
t(this, zt).call(this, r), t(this, Rt).call(this), t(this, Et).call(this), t(this, ct).call(this, r.scrollTop);
|
|
394
|
+
let a = !1;
|
|
395
|
+
const o = /* @__PURE__ */ h((l, c, f) => {
|
|
396
|
+
var u;
|
|
397
|
+
a || (a = !0, r && r.scrollTop !== l && (r.scrollTop = l), e && e.scrollTop !== l && (e.scrollTop = l), s && s.scrollTop !== l && (s.scrollTop = l), i && i.scrollLeft !== c && (i.scrollLeft = c), n && n.scrollLeft !== c && (n.scrollLeft = c), t(this, ct).call(this, l), (u = t(this, S).querySelector("nine-table-vscrollbar")) == null || u.refresh(), a = !1);
|
|
399
398
|
}, "syncScroll");
|
|
400
|
-
[
|
|
401
|
-
|
|
402
|
-
t(this,
|
|
403
|
-
l
|
|
399
|
+
[r, e, s].forEach((l) => {
|
|
400
|
+
l && l.addEventListener("scroll", () => {
|
|
401
|
+
t(this, lt) || (y(this, lt, !0), requestAnimationFrame(() => {
|
|
402
|
+
o(l.scrollTop, l.scrollLeft), y(this, lt, !1);
|
|
404
403
|
}));
|
|
405
404
|
});
|
|
406
405
|
});
|
|
@@ -415,8 +414,8 @@ const Ie = class Ie {
|
|
|
415
414
|
i.querySelectorAll("tr:not(.nodata)").forEach((o) => o.remove());
|
|
416
415
|
const n = i.querySelector("tr.nodata"), a = document.createDocumentFragment();
|
|
417
416
|
for (let o = 0; o < t(this, St); o++)
|
|
418
|
-
s.forEach((
|
|
419
|
-
a.appendChild(
|
|
417
|
+
s.forEach((l) => {
|
|
418
|
+
a.appendChild(l.cloneNode(!0));
|
|
420
419
|
});
|
|
421
420
|
n ? n.before(a) : i.appendChild(a);
|
|
422
421
|
}, "#renderRows"));
|
|
@@ -428,18 +427,18 @@ const Ie = class Ie {
|
|
|
428
427
|
if (!e || e.length === 0) return 24;
|
|
429
428
|
const s = r.querySelector("tbody.bindable-tbody");
|
|
430
429
|
if (!s) return 24;
|
|
431
|
-
s.querySelectorAll("tr:not(.nodata)").forEach((
|
|
430
|
+
s.querySelectorAll("tr:not(.nodata)").forEach((g) => g.remove());
|
|
432
431
|
const i = s.querySelector("tr.nodata"), n = document.createDocumentFragment();
|
|
433
|
-
e.forEach((
|
|
434
|
-
n.appendChild(
|
|
432
|
+
e.forEach((g) => {
|
|
433
|
+
n.appendChild(g.cloneNode(!0));
|
|
435
434
|
}), i ? i.before(n) : s.appendChild(n);
|
|
436
|
-
const a = t(this, S), o = a.style.display,
|
|
435
|
+
const a = t(this, S), o = a.style.display, l = a.style.visibility, c = a.style.position;
|
|
437
436
|
(o === "none" || window.getComputedStyle(a).display === "none") && (a.style.display = "block", a.style.visibility = "hidden", a.style.position = "absolute");
|
|
438
437
|
let f = 0;
|
|
439
438
|
const u = s.querySelectorAll("tr:not(.nodata)");
|
|
440
|
-
return u.forEach((
|
|
441
|
-
f +=
|
|
442
|
-
}), u.forEach((
|
|
439
|
+
return u.forEach((g) => {
|
|
440
|
+
f += g.offsetHeight || g.getBoundingClientRect().height;
|
|
441
|
+
}), u.forEach((g) => g.remove()), a.style.display = o, a.style.visibility = l, a.style.position = c, y(this, I, f > 0 ? f : 24), t(this, At).call(this), t(this, I);
|
|
443
442
|
}, "#measureAndCacheHeight"));
|
|
444
443
|
d(this, Et, /* @__PURE__ */ h(() => {
|
|
445
444
|
H.log("rowManager.#updateVirtualScrollHeight");
|
|
@@ -458,29 +457,29 @@ const Ie = class Ie {
|
|
|
458
457
|
}
|
|
459
458
|
}, "#updateRowCount"));
|
|
460
459
|
d(this, Dt, /* @__PURE__ */ h(() => {
|
|
461
|
-
var o,
|
|
460
|
+
var o, l, c, f, u, g;
|
|
462
461
|
const r = 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
462
|
if (e) {
|
|
464
|
-
const
|
|
463
|
+
const b = r ? Array.from(r.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
464
|
for (let x = 0; x < E; x++) {
|
|
466
465
|
const M = [
|
|
467
|
-
((o =
|
|
468
|
-
((
|
|
469
|
-
((
|
|
466
|
+
((o = b[x]) == null ? void 0 : o.getBoundingClientRect().height) || 0,
|
|
467
|
+
((l = m[x]) == null ? void 0 : l.getBoundingClientRect().height) || 0,
|
|
468
|
+
((c = v[x]) == null ? void 0 : c.getBoundingClientRect().height) || 0
|
|
470
469
|
], k = Math.max(...M);
|
|
471
|
-
k > 0 && (
|
|
470
|
+
k > 0 && (b[x] && (b[x].style.height = `${k}px`), m[x] && (m[x].style.height = `${k}px`), v[x] && (v[x].style.height = `${k}px`));
|
|
472
471
|
}
|
|
473
472
|
}
|
|
474
473
|
const i = t(this, S).querySelector(".ng-container-left .ng-part-footer table"), n = t(this, S).querySelector(".ng-container-body .ng-part-footer table"), a = t(this, S).querySelector(".ng-container-right .ng-part-footer table");
|
|
475
474
|
if (n) {
|
|
476
|
-
const
|
|
475
|
+
const b = i ? Array.from(i.querySelectorAll("tfoot tr")) : [], m = Array.from(n.querySelectorAll("tfoot tr")), v = a ? Array.from(a.querySelectorAll("tfoot tr")) : [], E = Math.max(b.length, m.length, v.length);
|
|
477
476
|
for (let x = 0; x < E; x++) {
|
|
478
477
|
const M = [
|
|
479
|
-
((f =
|
|
478
|
+
((f = b[x]) == null ? void 0 : f.getBoundingClientRect().height) || 0,
|
|
480
479
|
((u = m[x]) == null ? void 0 : u.getBoundingClientRect().height) || 0,
|
|
481
|
-
((
|
|
480
|
+
((g = v[x]) == null ? void 0 : g.getBoundingClientRect().height) || 0
|
|
482
481
|
], k = Math.max(...M);
|
|
483
|
-
k > 0 && (
|
|
482
|
+
k > 0 && (b[x] && (b[x].style.height = `${k}px`), m[x] && (m[x].style.height = `${k}px`), v[x] && (v[x].style.height = `${k}px`));
|
|
484
483
|
}
|
|
485
484
|
}
|
|
486
485
|
}, "#syncRowHeights"));
|
|
@@ -494,8 +493,8 @@ const Ie = class Ie {
|
|
|
494
493
|
let n = 0;
|
|
495
494
|
const a = s.querySelector(".ng-part-header"), o = s.querySelector(".ng-part-footer");
|
|
496
495
|
a && (n += a.offsetHeight), o && (n += o.offsetHeight);
|
|
497
|
-
const
|
|
498
|
-
t(this, Q) !==
|
|
496
|
+
const l = Math.max(i - n, 100);
|
|
497
|
+
t(this, Q) !== l && (y(this, Q, l), t(this, At).call(this), t(this, I) !== null && (t(this, Rt).call(this), this.refresh()));
|
|
499
498
|
}
|
|
500
499
|
}
|
|
501
500
|
})), t(this, V).observe(t(this, S)));
|
|
@@ -508,34 +507,36 @@ const Ie = class Ie {
|
|
|
508
507
|
}, "#renderAllContainers"));
|
|
509
508
|
d(this, Ae, /* @__PURE__ */ h((r) => {
|
|
510
509
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((e) => {
|
|
511
|
-
var
|
|
510
|
+
var c;
|
|
512
511
|
const s = t(this, S).querySelector(e);
|
|
513
512
|
if (!s) return;
|
|
514
513
|
const i = s.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
515
514
|
if (!i) return;
|
|
516
|
-
const n = Array.from(i.querySelectorAll("tr:not(.nodata)")), a = ((
|
|
515
|
+
const n = Array.from(i.querySelectorAll("tr:not(.nodata)")), a = ((c = t(this, D).get(e)) == null ? void 0 : c.length) || 1, l = (t(this, P).data.get() || []).length;
|
|
517
516
|
n.forEach((f, u) => {
|
|
518
|
-
const
|
|
519
|
-
if (
|
|
517
|
+
const g = r + Math.floor(u / a);
|
|
518
|
+
if (g >= l) {
|
|
520
519
|
f.style.display = "none";
|
|
521
520
|
return;
|
|
522
521
|
}
|
|
523
|
-
const
|
|
524
|
-
f.style.display = "", t(this, qt).call(this, f,
|
|
522
|
+
const b = t(this, P).data.get(g);
|
|
523
|
+
f.style.display = "", t(this, qt).call(this, f, b, g);
|
|
525
524
|
});
|
|
526
525
|
});
|
|
527
526
|
}, "#adjustBufferRows"));
|
|
528
|
-
d(this,
|
|
527
|
+
d(this, ct, /* @__PURE__ */ h((r) => {
|
|
529
528
|
var f, u;
|
|
530
529
|
const e = t(this, I);
|
|
531
530
|
if (!e || e <= 0) return;
|
|
532
|
-
const s = t(this, P).data.length, i = Math.max(0, Math.floor(r / e)), n = i * e, a = ((f = t(this, D).get(".ng-container-body")) == null ? void 0 : f.length) || 1, o = t(this, S).querySelector(".ng-container-body"),
|
|
533
|
-
(
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
const
|
|
531
|
+
const s = t(this, P).data.length, i = Math.max(0, Math.floor(r / e)), n = i * e, a = ((f = t(this, D).get(".ng-container-body")) == null ? void 0 : f.length) || 1, o = t(this, S).querySelector(".ng-container-body"), l = o == null ? void 0 : o.querySelector(".ng-part-body tbody.bindable-tbody tr:not(.nodata)");
|
|
532
|
+
H.log(t(this, at).firstTr.dataset.row);
|
|
533
|
+
const c = l && l.dataset.row !== void 0 ? parseInt(l.dataset.row, 10) : -1;
|
|
534
|
+
(u = t(this, at)) == null || u.scrollTables.forEach((g) => {
|
|
535
|
+
g.style.transform = `translateY(${n}px)`;
|
|
536
|
+
}), c !== i && [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((g) => {
|
|
537
|
+
const b = t(this, S).querySelector(g);
|
|
538
|
+
if (!b) return;
|
|
539
|
+
const m = b.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
539
540
|
if (!m) return;
|
|
540
541
|
Array.from(m.querySelectorAll("tr:not(.nodata)")).forEach((E, x) => {
|
|
541
542
|
const M = i + Math.floor(x / a);
|
|
@@ -570,18 +571,18 @@ const Ie = class Ie {
|
|
|
570
571
|
});
|
|
571
572
|
}, "#bindRowData"));
|
|
572
573
|
d(this, jt, /* @__PURE__ */ h(() => {
|
|
573
|
-
var
|
|
574
|
+
var l, c, f;
|
|
574
575
|
H.log("rowManager.#syncHeaderHeights");
|
|
575
576
|
const r = 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");
|
|
576
577
|
if (!e) return;
|
|
577
578
|
const i = r ? Array.from(r.querySelectorAll("tr")) : [], n = Array.from(e.querySelectorAll("tr")), a = s ? Array.from(s.querySelectorAll("tr")) : [], o = Math.max(i.length, n.length, a.length);
|
|
578
579
|
for (let u = 0; u < o; u++) {
|
|
579
|
-
const
|
|
580
|
-
((
|
|
581
|
-
((
|
|
580
|
+
const g = [
|
|
581
|
+
((l = i[u]) == null ? void 0 : l.getBoundingClientRect().height) || 0,
|
|
582
|
+
((c = n[u]) == null ? void 0 : c.getBoundingClientRect().height) || 0,
|
|
582
583
|
((f = a[u]) == null ? void 0 : f.getBoundingClientRect().height) || 0
|
|
583
|
-
],
|
|
584
|
-
|
|
584
|
+
], b = Math.max(...g);
|
|
585
|
+
b > 0 && (i[u] && (i[u].style.height = `${b}px`), n[u] && (n[u].style.height = `${b}px`), a[u] && (a[u].style.height = `${b}px`));
|
|
585
586
|
}
|
|
586
587
|
}, "#syncHeaderHeights"));
|
|
587
588
|
A(this, "destroy", /* @__PURE__ */ h(() => {
|
|
@@ -597,7 +598,7 @@ const Ie = class Ie {
|
|
|
597
598
|
return ((e = t(this, D).get(r)) == null ? void 0 : e.length) || 1;
|
|
598
599
|
}
|
|
599
600
|
};
|
|
600
|
-
P = new WeakMap(), S = new WeakMap(),
|
|
601
|
+
P = new WeakMap(), S = new WeakMap(), at = new WeakMap(), D = new WeakMap(), I = new WeakMap(), V = new WeakMap(), Q = new WeakMap(), St = new WeakMap(), Ee = new WeakMap(), lt = new WeakMap(), Ot = new WeakMap(), Bt = new WeakMap(), zt = new WeakMap(), Et = new WeakMap(), At = new WeakMap(), Dt = new WeakMap(), Pt = new WeakMap(), Rt = new WeakMap(), Ae = new WeakMap(), ct = new WeakMap(), qt = new WeakMap(), jt = new WeakMap(), h(Ie, "RowManager");
|
|
601
602
|
let he = Ie;
|
|
602
603
|
const Ft = class Ft {
|
|
603
604
|
/**
|
|
@@ -612,65 +613,65 @@ const Ft = class Ft {
|
|
|
612
613
|
static compile(r) {
|
|
613
614
|
if (!r) return null;
|
|
614
615
|
const e = /* @__PURE__ */ h((o) => {
|
|
615
|
-
o.querySelectorAll("tbody td, tbody th, tfoot td, tfoot th").forEach((
|
|
616
|
-
const f =
|
|
617
|
-
if (
|
|
616
|
+
o.querySelectorAll("tbody td, tbody th, tfoot td, tfoot th").forEach((c) => {
|
|
617
|
+
const f = c.getAttribute("cell-type") || "renderer";
|
|
618
|
+
if (c.children.length > 0 && c.firstElementChild.tagName.includes("-")) return;
|
|
618
619
|
let u = `cell-${f}`;
|
|
619
|
-
const
|
|
620
|
+
const g = c.getAttribute("data-bind"), b = c.getAttribute("data-expr"), m = c.getAttribute("maxbyte"), v = c.getAttribute("type");
|
|
620
621
|
let E = [];
|
|
621
|
-
|
|
622
|
+
g && E.push(`data-bind="${g}"`), b && E.push(`data-expr="${b}"`), m && E.push(`maxbyte="${m}"`), v && E.push(`type="${v}"`), c.innerHTML = `<${u} ${E.join(" ")}></${u}>`;
|
|
622
623
|
});
|
|
623
624
|
}, "processCellTypes"), s = /* @__PURE__ */ h((o) => {
|
|
624
625
|
if (!o.querySelector("colgroup")) {
|
|
625
|
-
const
|
|
626
|
-
for (let
|
|
627
|
-
const
|
|
628
|
-
|
|
626
|
+
const l = o.querySelector("tbody tr") || o.querySelector("tr"), c = l ? l.querySelectorAll("th, td").length : 1, f = document.createElement("colgroup"), u = Math.max(Math.floor(o.clientWidth / c), 100);
|
|
627
|
+
for (let g = 0; g < c; g++) {
|
|
628
|
+
const b = document.createElement("col");
|
|
629
|
+
b.setAttribute("width", u), f.appendChild(b);
|
|
629
630
|
}
|
|
630
631
|
o.prepend(f);
|
|
631
632
|
}
|
|
632
633
|
if (!o.querySelector("thead")) {
|
|
633
|
-
const
|
|
634
|
-
|
|
634
|
+
const l = document.createElement("thead"), c = o.querySelector("colgroup");
|
|
635
|
+
c ? c.after(l) : o.prepend(l);
|
|
635
636
|
}
|
|
636
637
|
o.classList.add("nine-table-element"), o.style.display = "table";
|
|
637
|
-
}, "ensureTableStructure"), i = /* @__PURE__ */ h((o,
|
|
638
|
-
const
|
|
638
|
+
}, "ensureTableStructure"), i = /* @__PURE__ */ h((o, l) => {
|
|
639
|
+
const c = Array.from(o.querySelectorAll(l + " tr")), f = Array.from(o.querySelectorAll(l + " th," + l + " td")), u = c.length;
|
|
639
640
|
if (u === 0 || f.length === 0) return;
|
|
640
|
-
let
|
|
641
|
+
let g = 0;
|
|
641
642
|
f.forEach((m) => {
|
|
642
|
-
|
|
643
|
+
g += m.colSpan || 1;
|
|
643
644
|
});
|
|
644
|
-
const
|
|
645
|
-
|
|
645
|
+
const b = Array.from(Array(u), () => Array(g).fill(null));
|
|
646
|
+
c.forEach((m) => {
|
|
646
647
|
const v = m.sectionRowIndex;
|
|
647
648
|
let E = 0;
|
|
648
649
|
Array.from(m.querySelectorAll("th,td")).forEach((x) => {
|
|
649
|
-
for (let B = 0; B <
|
|
650
|
-
if (
|
|
650
|
+
for (let B = 0; B < b[v].length; B++)
|
|
651
|
+
if (b[v][B] === null) {
|
|
651
652
|
E = B;
|
|
652
653
|
break;
|
|
653
654
|
}
|
|
654
655
|
const M = x.rowSpan || 1, k = x.colSpan || 1;
|
|
655
656
|
for (let B = 0; B < M; B++)
|
|
656
|
-
for (let
|
|
657
|
-
v + B < u && E +
|
|
657
|
+
for (let pt = 0; pt < k; pt++)
|
|
658
|
+
v + B < u && E + pt < g && (b[v + B][E + pt] = B === 0 && pt === 0 ? "1" : "0");
|
|
658
659
|
});
|
|
659
|
-
}),
|
|
660
|
+
}), c.forEach((m) => {
|
|
660
661
|
const v = m.sectionRowIndex;
|
|
661
662
|
Array.from(m.querySelectorAll("th,td")).forEach((E) => {
|
|
662
|
-
for (let x = 0; x <
|
|
663
|
-
if (
|
|
664
|
-
E.dataset.col = x,
|
|
663
|
+
for (let x = 0; x < b[v].length; x++)
|
|
664
|
+
if (b[v][x] === "1") {
|
|
665
|
+
E.dataset.col = x, b[v][x] = "0";
|
|
665
666
|
break;
|
|
666
667
|
}
|
|
667
668
|
});
|
|
668
669
|
});
|
|
669
670
|
}, "resetColIndex"), n = r.cloneNode(!0);
|
|
670
|
-
return s(n), e(n), i(n, "thead"), i(n, "tbody"), i(n, "tfoot"), Array.from(n.querySelectorAll("colgroup col")).forEach((o,
|
|
671
|
-
const
|
|
672
|
-
|
|
673
|
-
f.setAttribute("fixed",
|
|
671
|
+
return s(n), e(n), i(n, "thead"), i(n, "tbody"), i(n, "tfoot"), Array.from(n.querySelectorAll("colgroup col")).forEach((o, l) => {
|
|
672
|
+
const c = o.getAttribute("fixed");
|
|
673
|
+
c && n.querySelectorAll(`thead [data-col="${l}"], tbody [data-col="${l}"], tfoot [data-col="${l}"]`).forEach((f) => {
|
|
674
|
+
f.setAttribute("fixed", c);
|
|
674
675
|
});
|
|
675
676
|
}), n;
|
|
676
677
|
}
|
|
@@ -678,8 +679,8 @@ const Ft = class Ft {
|
|
|
678
679
|
};
|
|
679
680
|
h(Ft, "TableCompiler");
|
|
680
681
|
let de = Ft;
|
|
681
|
-
var Vt, tt, et, Yt, Ut,
|
|
682
|
-
const
|
|
682
|
+
var Vt, tt, et, Yt, Ut, ht, Xt, Kt;
|
|
683
|
+
const mt = class mt extends HTMLElement {
|
|
683
684
|
constructor() {
|
|
684
685
|
super();
|
|
685
686
|
d(this, Vt);
|
|
@@ -698,15 +699,15 @@ const pt = class pt extends HTMLElement {
|
|
|
698
699
|
if (!n) return;
|
|
699
700
|
n.innerHTML = "";
|
|
700
701
|
const a = document.createElement("div");
|
|
701
|
-
a.className = "ng-part-header", a.appendChild(t(this,
|
|
702
|
+
a.className = "ng-part-header", a.appendChild(t(this, ht).call(this, t(this, tt), i, "header"));
|
|
702
703
|
const o = document.createElement("div");
|
|
703
704
|
o.className = "ng-part-body";
|
|
704
|
-
const c = document.createElement("div");
|
|
705
|
-
c.className = "ng-scroll-content", c.style.position = "relative", c.style.width = "100%", c.appendChild(t(this, ct).call(this, t(this, tt), i, "body"));
|
|
706
705
|
const l = document.createElement("div");
|
|
707
|
-
l.className = "ng-
|
|
706
|
+
l.className = "ng-scroll-content", l.style.position = "relative", l.style.width = "100%", l.appendChild(t(this, ht).call(this, t(this, tt), i, "body"));
|
|
707
|
+
const c = document.createElement("div");
|
|
708
|
+
c.className = "ng-virtual-spacer", c.style.width = "100%", c.style.pointerEvents = "none", l.appendChild(c), o.appendChild(l);
|
|
708
709
|
const f = document.createElement("div");
|
|
709
|
-
f.className = "ng-part-footer", f.appendChild(t(this,
|
|
710
|
+
f.className = "ng-part-footer", f.appendChild(t(this, ht).call(this, t(this, tt), i, "footer")), n.appendChild(a), n.appendChild(o), n.appendChild(f);
|
|
710
711
|
});
|
|
711
712
|
}, "#renderSplitContainers"));
|
|
712
713
|
d(this, Ut, /* @__PURE__ */ h(() => {
|
|
@@ -726,20 +727,20 @@ const pt = class pt extends HTMLElement {
|
|
|
726
727
|
(s = this.querySelector("nine-table-hscrollbar")) == null || s.refresh();
|
|
727
728
|
}, 0));
|
|
728
729
|
}, "generate"));
|
|
729
|
-
d(this,
|
|
730
|
-
const n = e.cloneNode(!0), a = n.querySelector("thead"), o = n.querySelector("tbody"),
|
|
730
|
+
d(this, ht, /* @__PURE__ */ h((e, s, i) => {
|
|
731
|
+
const n = e.cloneNode(!0), a = n.querySelector("thead"), o = n.querySelector("tbody"), l = n.querySelector("tfoot");
|
|
731
732
|
if (i === "header") {
|
|
732
|
-
if (o && o.remove(),
|
|
733
|
+
if (o && o.remove(), l && l.remove(), e.querySelector("tbody")) {
|
|
733
734
|
const f = document.createElement("tbody");
|
|
734
735
|
f.className = "fixed-tbody", n.appendChild(f);
|
|
735
736
|
}
|
|
736
|
-
} else i === "body" ? (a && a.remove(),
|
|
737
|
-
return s === "left" ? n.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach((
|
|
738
|
-
|
|
739
|
-
}) : s === "right" ? n.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach((
|
|
740
|
-
|
|
741
|
-
}) : n.querySelectorAll("[fixed=left], [fixed=right]").forEach((
|
|
742
|
-
|
|
737
|
+
} else i === "body" ? (a && a.remove(), l && l.remove(), o && (o.className = "bindable-tbody")) : i === "footer" && (a && a.remove(), o && o.remove());
|
|
738
|
+
return s === "left" ? n.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach((c) => {
|
|
739
|
+
c.getAttribute("fixed") !== "left" && c.remove();
|
|
740
|
+
}) : s === "right" ? n.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach((c) => {
|
|
741
|
+
c.getAttribute("fixed") !== "right" && c.remove();
|
|
742
|
+
}) : n.querySelectorAll("[fixed=left], [fixed=right]").forEach((c) => {
|
|
743
|
+
c.remove();
|
|
743
744
|
}), n;
|
|
744
745
|
}, "#createSplitTable"));
|
|
745
746
|
A(this, "getRowHeight", /* @__PURE__ */ h(() => t(this, et).getRowHeight(), "getRowHeight"));
|
|
@@ -755,7 +756,7 @@ const pt = class pt extends HTMLElement {
|
|
|
755
756
|
t(this, Kt).call(this);
|
|
756
757
|
}, "#init"));
|
|
757
758
|
d(this, Kt, /* @__PURE__ */ h(() => {
|
|
758
|
-
const e =
|
|
759
|
+
const e = mt.SCROLLBAR_SIZE;
|
|
759
760
|
this.innerHTML = `
|
|
760
761
|
<style>
|
|
761
762
|
nine-table-sheet {
|
|
@@ -906,8 +907,8 @@ const pt = class pt extends HTMLElement {
|
|
|
906
907
|
this.innerHTML = "", H.log("NineTableSheet destroyed.");
|
|
907
908
|
}
|
|
908
909
|
};
|
|
909
|
-
Vt = new WeakMap(), tt = new WeakMap(), et = new WeakMap(), Yt = new WeakMap(), Ut = new WeakMap(),
|
|
910
|
-
let It =
|
|
910
|
+
Vt = new WeakMap(), tt = new WeakMap(), et = new WeakMap(), Yt = new WeakMap(), Ut = new WeakMap(), ht = new WeakMap(), Xt = new WeakMap(), Kt = new WeakMap(), h(mt, "NineTableSheet"), A(mt, "SCROLLBAR_SIZE", 16);
|
|
911
|
+
let It = mt;
|
|
911
912
|
customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet", It);
|
|
912
913
|
var Zt, kt;
|
|
913
914
|
const _e = class _e extends HTMLElement {
|
|
@@ -924,32 +925,32 @@ const _e = class _e extends HTMLElement {
|
|
|
924
925
|
d(this, kt, /* @__PURE__ */ h((e, s = !1) => {
|
|
925
926
|
const i = /* @__PURE__ */ h(() => {
|
|
926
927
|
const f = Array.from(this.querySelectorAll("nine-table-sheet"));
|
|
927
|
-
Array.from(this.querySelectorAll("nine-splitter")).forEach((
|
|
928
|
-
const
|
|
929
|
-
|
|
930
|
-
const m = parseInt(
|
|
928
|
+
Array.from(this.querySelectorAll("nine-splitter")).forEach((b) => b.style.setProperty("display", "none"));
|
|
929
|
+
const g = f.filter((b) => b.classList.contains("active"));
|
|
930
|
+
g.length < 2 || g.forEach((b) => {
|
|
931
|
+
const m = parseInt(b.getAttribute("data-index"), 10), v = this.querySelector(`nine-splitter[data-split-index="${m}"]`), E = f[m + 1];
|
|
931
932
|
v && E && E.classList.contains("active") && v.style.setProperty("display", "flex");
|
|
932
933
|
});
|
|
933
|
-
}, "updateSplitters"), n = this.querySelector(".nine-tab-bar"), a = this.querySelector("nine-table-sheets-body"), o = n.querySelectorAll(".nine-tab-item"),
|
|
934
|
+
}, "updateSplitters"), n = this.querySelector(".nine-tab-bar"), a = this.querySelector("nine-table-sheets-body"), o = n.querySelectorAll(".nine-tab-item"), l = a.querySelectorAll("nine-table-sheet");
|
|
934
935
|
if (!o[e]) return;
|
|
935
936
|
if (!s)
|
|
936
937
|
o.forEach((f, u) => {
|
|
937
938
|
f.classList.toggle("active", u === e);
|
|
938
|
-
}),
|
|
939
|
-
const
|
|
940
|
-
f.classList.toggle("active",
|
|
939
|
+
}), l.forEach((f, u) => {
|
|
940
|
+
const g = u === e;
|
|
941
|
+
f.classList.toggle("active", g), f.style.flex = g ? "1 1 100%" : "";
|
|
941
942
|
});
|
|
942
943
|
else {
|
|
943
944
|
const f = o[e], u = n.querySelectorAll(".nine-tab-item.active");
|
|
944
945
|
if (f.classList.contains("active") && u.length <= 1)
|
|
945
946
|
return;
|
|
946
947
|
f.classList.toggle("active");
|
|
947
|
-
const
|
|
948
|
-
|
|
948
|
+
const g = a.querySelector(`nine-table-sheet[data-index="${e}"]`);
|
|
949
|
+
g && (g.classList.toggle("active"), g.classList.contains("active") || (g.style.flex = ""));
|
|
949
950
|
}
|
|
950
|
-
const
|
|
951
|
-
|
|
952
|
-
f.style.flex =
|
|
951
|
+
const c = a.querySelectorAll("nine-table-sheet.active");
|
|
952
|
+
c == null || c.forEach((f) => {
|
|
953
|
+
f.style.flex = c.length > 1 ? "1 1 0%" : "1 1 100%";
|
|
953
954
|
}), i();
|
|
954
955
|
}, "#switchSheet"));
|
|
955
956
|
}
|
|
@@ -971,17 +972,17 @@ const Ne = class Ne {
|
|
|
971
972
|
}).observe(t(this, _));
|
|
972
973
|
}, "#init"));
|
|
973
974
|
d(this, Tt, /* @__PURE__ */ h(() => {
|
|
974
|
-
var
|
|
975
|
+
var l, c;
|
|
975
976
|
const r = Array.from(t(this, _).shadowRoot.querySelectorAll("nine-table-sheet.active"));
|
|
976
977
|
if (r.length === 0) return;
|
|
977
|
-
const e = parseInt(t(this, _).getAttribute("max-display-row"), 10) || 10, s = Math.max(...r.map((f) => f.getRowHeight())), i = (
|
|
978
|
+
const e = parseInt(t(this, _).getAttribute("max-display-row"), 10) || 10, s = Math.max(...r.map((f) => f.getRowHeight())), i = (l = t(this, _).shadowRoot.querySelector("nine-table-header")) == null ? void 0 : l.getBoundingClientRect().height, n = (c = t(this, _).shadowRoot.querySelector("nine-table-sheets-footer")) == null ? void 0 : c.getBoundingClientRect().height, a = It.SCROLLBAR_SIZE, o = e * s + i + n + a;
|
|
978
979
|
t(this, _).style.height = `${o}px`;
|
|
979
980
|
}, "#applyAutoHeight"));
|
|
980
981
|
d(this, Jt, /* @__PURE__ */ h(() => {
|
|
981
|
-
const e = Array.from(t(this, _).children).filter((
|
|
982
|
-
const u = `<nine-table-sheet class="${
|
|
983
|
-
return u +
|
|
984
|
-
}).join(""), a = e.map((
|
|
982
|
+
const e = Array.from(t(this, _).children).filter((l) => l.tagName === "TABLE"), s = t(this, _).getAttribute("auto-height") === "true", i = e.length, n = e.map((l, c) => {
|
|
983
|
+
const u = `<nine-table-sheet class="${c === 0 ? "active" : ""}" data-index="${c}"></nine-table-sheet>`, g = c < i - 1 ? `<nine-splitter class="h" data-split-index="${c}"></nine-splitter>` : "";
|
|
984
|
+
return u + g;
|
|
985
|
+
}).join(""), a = e.map((l, c) => `<div class="nine-tab-item ${c === 0 ? "active" : ""}" data-index="${c}">Sheet ${c + 1}</div>`).join("");
|
|
985
986
|
t(this, _).shadowRoot.innerHTML = `
|
|
986
987
|
<style>
|
|
987
988
|
:host {
|
|
@@ -1074,9 +1075,9 @@ const Ne = class Ne {
|
|
|
1074
1075
|
<nine-table-footer></nine-table-footer>
|
|
1075
1076
|
`;
|
|
1076
1077
|
const o = t(this, _).shadowRoot.querySelectorAll("nine-table-sheet");
|
|
1077
|
-
o == null || o.forEach((
|
|
1078
|
-
e[
|
|
1079
|
-
|
|
1078
|
+
o == null || o.forEach((l, c) => {
|
|
1079
|
+
e[c] && setTimeout(() => {
|
|
1080
|
+
l.generate(e[c]), s && t(this, Tt).call(this);
|
|
1080
1081
|
});
|
|
1081
1082
|
});
|
|
1082
1083
|
}, "#render"));
|
|
@@ -1085,31 +1086,31 @@ const Ne = class Ne {
|
|
|
1085
1086
|
};
|
|
1086
1087
|
_ = new WeakMap(), Gt = new WeakMap(), Tt = new WeakMap(), Jt = new WeakMap(), h(Ne, "LayoutManager");
|
|
1087
1088
|
let ue = Ne;
|
|
1088
|
-
var Ct,
|
|
1089
|
+
var Ct, dt;
|
|
1089
1090
|
const We = class We {
|
|
1090
1091
|
constructor(r) {
|
|
1091
1092
|
d(this, Ct);
|
|
1092
|
-
d(this,
|
|
1093
|
+
d(this, dt, -1);
|
|
1093
1094
|
A(this, "count", /* @__PURE__ */ h(() => t(this, Ct).rawRecords.length, "count"));
|
|
1094
1095
|
y(this, Ct, r);
|
|
1095
1096
|
}
|
|
1096
1097
|
get at() {
|
|
1097
|
-
return t(this,
|
|
1098
|
+
return t(this, dt);
|
|
1098
1099
|
}
|
|
1099
1100
|
set at(r) {
|
|
1100
|
-
y(this,
|
|
1101
|
+
y(this, dt, parseInt(r, 10)), body && !body.querySelector(`tbody.bindable tr[data-row="${t(this, dt)}"]`) && setTimeout(() => {
|
|
1101
1102
|
});
|
|
1102
1103
|
}
|
|
1103
1104
|
};
|
|
1104
|
-
Ct = new WeakMap(),
|
|
1105
|
+
Ct = new WeakMap(), dt = new WeakMap(), h(We, "ngRow");
|
|
1105
1106
|
let ge = We;
|
|
1106
|
-
var N, T, W,
|
|
1107
|
+
var N, T, W, ft, Qt, Y, te, st, Lt, ee, se, ut;
|
|
1107
1108
|
const O = class O {
|
|
1108
1109
|
constructor(r, e) {
|
|
1109
1110
|
d(this, N);
|
|
1110
1111
|
d(this, T);
|
|
1111
1112
|
d(this, W, []);
|
|
1112
|
-
d(this,
|
|
1113
|
+
d(this, ft, []);
|
|
1113
1114
|
d(this, Qt, 0);
|
|
1114
1115
|
d(this, Y, []);
|
|
1115
1116
|
d(this, te, /* @__PURE__ */ h(() => {
|
|
@@ -1131,14 +1132,14 @@ const O = class O {
|
|
|
1131
1132
|
var n;
|
|
1132
1133
|
const s = this.getValidData();
|
|
1133
1134
|
if (!s || s.length <= 0) return;
|
|
1134
|
-
if (r == null) return t(this,
|
|
1135
|
+
if (r == null) return t(this, ut).call(this, s);
|
|
1135
1136
|
if (r < 0 || r >= s.length) return null;
|
|
1136
1137
|
const i = typeof ((n = t(this, N).fields) == null ? void 0 : n.get) == "function" ? t(this, N).fields.get() : [];
|
|
1137
1138
|
if (e != null) {
|
|
1138
1139
|
const a = i.indexOf(e);
|
|
1139
1140
|
return a >= 0 ? s[r].v[a] : null;
|
|
1140
1141
|
}
|
|
1141
|
-
return t(this,
|
|
1142
|
+
return t(this, ut).call(this, s[r]);
|
|
1142
1143
|
}, "get"));
|
|
1143
1144
|
A(this, "set", /* @__PURE__ */ h((r) => {
|
|
1144
1145
|
this.clear(), this.add(r, !1), t(this, st).call(this);
|
|
@@ -1153,11 +1154,11 @@ const O = class O {
|
|
|
1153
1154
|
_: [0, 0, 0, 0, O.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, t(this, Y).slice(), -1, {}, {}]
|
|
1154
1155
|
}), "#getDefaultMeta"));
|
|
1155
1156
|
A(this, "reset", /* @__PURE__ */ h(() => {
|
|
1156
|
-
y(this, W, []), y(this,
|
|
1157
|
+
y(this, W, []), y(this, ft, []), t(this, st).call(this);
|
|
1157
1158
|
}, "reset"));
|
|
1158
1159
|
A(this, "clear", /* @__PURE__ */ h(() => {
|
|
1159
1160
|
var r;
|
|
1160
|
-
t(this, T).rawRecords = [], y(this, W, []), y(this,
|
|
1161
|
+
t(this, T).rawRecords = [], y(this, W, []), y(this, ft, []), (r = t(this, T).viewRecords) != null && r.reset && t(this, T).viewRecords.reset();
|
|
1161
1162
|
}, "clear"));
|
|
1162
1163
|
d(this, ee, /* @__PURE__ */ h((r) => {
|
|
1163
1164
|
var i;
|
|
@@ -1195,9 +1196,9 @@ const O = class O {
|
|
|
1195
1196
|
}), this.resetRecords(), t(this, st).call(this);
|
|
1196
1197
|
}, "delete"));
|
|
1197
1198
|
A(this, "setValue", /* @__PURE__ */ h((r, e, s) => {
|
|
1198
|
-
var
|
|
1199
|
+
var l;
|
|
1199
1200
|
r = parseInt(r, 10);
|
|
1200
|
-
const n = (typeof ((
|
|
1201
|
+
const n = (typeof ((l = t(this, N).fields) == null ? void 0 : l.get) == "function" ? t(this, N).fields.get() : []).indexOf(e);
|
|
1201
1202
|
if (n < 0) return;
|
|
1202
1203
|
const a = this.getValidData()[r];
|
|
1203
1204
|
if (!a) return;
|
|
@@ -1205,21 +1206,21 @@ const O = class O {
|
|
|
1205
1206
|
o !== s && a.__ng.rowState !== O.ROW_STATE.INSERT && (a.__ng.o.hasOwnProperty(e) || (a.__ng.o[e] = o), a.__ng.rowState = O.ROW_STATE.UPDATE), a.v[n] = s;
|
|
1206
1207
|
}, "setValue"));
|
|
1207
1208
|
A(this, "resetRecords", /* @__PURE__ */ h(() => {
|
|
1208
|
-
y(this,
|
|
1209
|
+
y(this, ft, t(this, T).rawRecords.filter((r) => !r.__ng.deleted)), y(this, W, t(this, T).rawRecords.filter((r) => !r.__ng.deleted && !r.__ng.filtered)), t(this, T).rawRecords.forEach((r, e) => {
|
|
1209
1210
|
r.__ng.rowidx = e;
|
|
1210
1211
|
}), t(this, W).forEach((r, e) => {
|
|
1211
1212
|
r.__ng.i = e;
|
|
1212
1213
|
});
|
|
1213
1214
|
}, "resetRecords"));
|
|
1214
1215
|
A(this, "getValidData", /* @__PURE__ */ h(() => (t(this, W).length === 0 && t(this, T).rawRecords.length > 0 && this.resetRecords(), t(this, W)), "getValidData"));
|
|
1215
|
-
d(this,
|
|
1216
|
+
d(this, ut, /* @__PURE__ */ h((r) => {
|
|
1216
1217
|
var a;
|
|
1217
1218
|
if (!r) return r;
|
|
1218
1219
|
const e = !Array.isArray(r), s = e ? [r] : r, i = typeof ((a = t(this, N).fields) == null ? void 0 : a.get) == "function" ? t(this, N).fields.get() : [], n = s.filter((o) => !o.__ng.deleted).map((o) => {
|
|
1219
|
-
const
|
|
1220
|
-
return i.forEach((
|
|
1221
|
-
c
|
|
1222
|
-
}),
|
|
1220
|
+
const l = {};
|
|
1221
|
+
return i.forEach((c, f) => {
|
|
1222
|
+
l[c] = o.v ? o.v[f] : o[c];
|
|
1223
|
+
}), l.__ng = o.__ng, l;
|
|
1223
1224
|
});
|
|
1224
1225
|
return e ? n[0] : n;
|
|
1225
1226
|
}, "#conv"));
|
|
@@ -1227,7 +1228,7 @@ const O = class O {
|
|
|
1227
1228
|
y(this, N, r), y(this, T, e), t(this, te).call(this);
|
|
1228
1229
|
}
|
|
1229
1230
|
get source() {
|
|
1230
|
-
return t(this,
|
|
1231
|
+
return t(this, ut).call(this, t(this, T).rawRecords);
|
|
1231
1232
|
}
|
|
1232
1233
|
set source(r) {
|
|
1233
1234
|
this.clear(), this.add(r, !1);
|
|
@@ -1245,7 +1246,7 @@ const O = class O {
|
|
|
1245
1246
|
return this.length;
|
|
1246
1247
|
}
|
|
1247
1248
|
};
|
|
1248
|
-
N = new WeakMap(), T = new WeakMap(), W = new WeakMap(),
|
|
1249
|
+
N = new WeakMap(), T = new WeakMap(), W = new WeakMap(), ft = new WeakMap(), Qt = new WeakMap(), Y = new WeakMap(), te = new WeakMap(), st = new WeakMap(), Lt = new WeakMap(), ee = new WeakMap(), se = new WeakMap(), ut = new WeakMap(), h(O, "ngData"), // π― ν μν μ μ μμλ₯Ό ν΄λμ€ λ΄λΆλ‘ λ΄μ¬ν
|
|
1249
1250
|
A(O, "ROW_STATE", {
|
|
1250
1251
|
EMPTY: "EMPTY",
|
|
1251
1252
|
NORMAL: "NORMAL",
|
|
@@ -1277,11 +1278,11 @@ const Oe = class Oe {
|
|
|
1277
1278
|
};
|
|
1278
1279
|
rt = new WeakMap(), h(Oe, "ngDataManager");
|
|
1279
1280
|
let ye = Oe;
|
|
1280
|
-
var
|
|
1281
|
+
var gt, L, Ht, re;
|
|
1281
1282
|
const Be = class Be {
|
|
1282
1283
|
// π― μ΄μ { name: string, type: string } κ°μ²΄λ€μ λ°°μ΄λ‘ κ΄λ¦¬ν©λλ€.
|
|
1283
1284
|
constructor(r) {
|
|
1284
|
-
d(this,
|
|
1285
|
+
d(this, gt);
|
|
1285
1286
|
d(this, L, []);
|
|
1286
1287
|
A(this, "add", /* @__PURE__ */ h((r, e = "string") => {
|
|
1287
1288
|
r.forEach((s) => {
|
|
@@ -1295,8 +1296,8 @@ const Be = class Be {
|
|
|
1295
1296
|
}), y(this, L, Array.from(r, ([e, s]) => ({ name: e, type: s }))), y(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);
|
|
1296
1297
|
}, "#adjust"));
|
|
1297
1298
|
d(this, re, /* @__PURE__ */ h(() => {
|
|
1298
|
-
y(this, L, []), H.log(t(this,
|
|
1299
|
-
const r = Array.from(t(this,
|
|
1299
|
+
y(this, L, []), H.log(t(this, gt).querySelectorAll("table"));
|
|
1300
|
+
const r = Array.from(t(this, gt).querySelectorAll("table"));
|
|
1300
1301
|
if (!(!r || r.length === 0)) {
|
|
1301
1302
|
for (const e of r)
|
|
1302
1303
|
H.log(e), $("[data-bind]", e).each((s, i) => {
|
|
@@ -1316,9 +1317,9 @@ const Be = class Be {
|
|
|
1316
1317
|
}
|
|
1317
1318
|
a.split("data.").forEach((o) => {
|
|
1318
1319
|
if (o.trim() != "") {
|
|
1319
|
-
const
|
|
1320
|
-
let
|
|
1321
|
-
|
|
1320
|
+
const l = o.search(/[^_A-Za-z0-9]/g);
|
|
1321
|
+
let c = "";
|
|
1322
|
+
l >= 0 ? c = o.substring(0, l) : a.startsWith("data.") && (c = o.replace("data.", "")), c && t(this, L).push({ name: c, type: "string" });
|
|
1322
1323
|
}
|
|
1323
1324
|
});
|
|
1324
1325
|
});
|
|
@@ -1326,7 +1327,7 @@ const Be = class Be {
|
|
|
1326
1327
|
t(this, Ht).call(this);
|
|
1327
1328
|
}
|
|
1328
1329
|
}, "#init"));
|
|
1329
|
-
y(this,
|
|
1330
|
+
y(this, gt, r), t(this, re).call(this);
|
|
1330
1331
|
}
|
|
1331
1332
|
// π― κΈ°μ‘΄μ νλ μ΄λ¦λ§ μ°λ κ³³λ€κ³Όμ νΈνμ μν΄ μ΄λ¦ λ°°μ΄λ§ 리ν΄νλ λ©μλ μ μ§
|
|
1332
1333
|
get() {
|
|
@@ -1348,7 +1349,7 @@ const Be = class Be {
|
|
|
1348
1349
|
return t(this, L).some((e) => e.name === r);
|
|
1349
1350
|
}
|
|
1350
1351
|
};
|
|
1351
|
-
|
|
1352
|
+
gt = new WeakMap(), L = new WeakMap(), Ht = new WeakMap(), re = new WeakMap(), h(Be, "ngFields");
|
|
1352
1353
|
let pe = Be;
|
|
1353
1354
|
var it, ie, ne;
|
|
1354
1355
|
const ze = class ze extends HTMLElement {
|
|
@@ -1384,7 +1385,7 @@ const ze = class ze extends HTMLElement {
|
|
|
1384
1385
|
it = new WeakMap(), ie = new WeakMap(), ne = new WeakMap(), h(ze, "NineTable");
|
|
1385
1386
|
let me = ze;
|
|
1386
1387
|
customElements.get("nine-table") || customElements.define("nine-table", me);
|
|
1387
|
-
const
|
|
1388
|
+
const xt = class xt extends HTMLElement {
|
|
1388
1389
|
// π 컀μ€ν
μ€νμΌμ© μΊμ μΆκ°
|
|
1389
1390
|
constructor() {
|
|
1390
1391
|
super();
|
|
@@ -1395,8 +1396,8 @@ const mt = class mt extends HTMLElement {
|
|
|
1395
1396
|
connectedCallback() {
|
|
1396
1397
|
}
|
|
1397
1398
|
};
|
|
1398
|
-
h(
|
|
1399
|
-
let xe =
|
|
1399
|
+
h(xt, "BasicCellElement"), A(xt, "_styleCache", /* @__PURE__ */ new Map()), A(xt, "_customStyleCache", /* @__PURE__ */ new Map());
|
|
1400
|
+
let xe = xt;
|
|
1400
1401
|
var C, Mt, p, Re, qe, ke, Te, Ce;
|
|
1401
1402
|
const De = class De extends xe {
|
|
1402
1403
|
constructor() {
|
|
@@ -1441,10 +1442,10 @@ const De = class De extends xe {
|
|
|
1441
1442
|
if (parseInt(s.sectionRowIndex / t(this, C).template.length) > 0)
|
|
1442
1443
|
for (var a of i) {
|
|
1443
1444
|
if (a > e) break;
|
|
1444
|
-
var o = parseInt(t(this, p).dataset.row),
|
|
1445
|
+
var o = parseInt(t(this, p).dataset.row), l = o - 1, c = t(this, p).closest("tr").data, f = t(this, C).data.get(l);
|
|
1445
1446
|
t(this, p).dataset.matrixRow;
|
|
1446
|
-
var u = t(this, C).body.querySelector(`tbody.bindable [suppress="${a}"][data-matrix-row="${t(this, p).dataset.matrixRow}"]`),
|
|
1447
|
-
if (
|
|
1447
|
+
var u = t(this, C).body.querySelector(`tbody.bindable [suppress="${a}"][data-matrix-row="${t(this, p).dataset.matrixRow}"]`), g = u.dataset.expr ? this.getExprValue(u.dataset.expr, c, o) : c[u.dataset.bind], b = u.dataset.expr ? this.getExprValue(u.dataset.expr, f, l) : f[u.dataset.bind];
|
|
1448
|
+
if (g != b) {
|
|
1448
1449
|
n = !0;
|
|
1449
1450
|
break;
|
|
1450
1451
|
}
|
|
@@ -1508,14 +1509,14 @@ const Pe = class Pe extends ve {
|
|
|
1508
1509
|
};
|
|
1509
1510
|
h(Pe, "EditableCellElement");
|
|
1510
1511
|
let we = Pe;
|
|
1511
|
-
var $t, nt,
|
|
1512
|
+
var $t, nt, bt, yt, oe, U, Le;
|
|
1512
1513
|
const je = class je extends we {
|
|
1513
1514
|
constructor() {
|
|
1514
1515
|
super();
|
|
1515
1516
|
d(this, $t);
|
|
1516
1517
|
d(this, nt);
|
|
1517
|
-
d(this, gt);
|
|
1518
1518
|
d(this, bt);
|
|
1519
|
+
d(this, yt);
|
|
1519
1520
|
d(this, oe);
|
|
1520
1521
|
d(this, U);
|
|
1521
1522
|
A(this, "refresh", /* @__PURE__ */ h(() => {
|
|
@@ -1556,7 +1557,7 @@ const je = class je extends we {
|
|
|
1556
1557
|
if (!["Escape", "Enter", "Tab", "Home", "End", "ArrowLeft", "ArrowRight", "PageUp", "PageDown", "Backspace", "Delete"].includes(e.code)) {
|
|
1557
1558
|
if (t(this, nt) == "number") {
|
|
1558
1559
|
let n = [];
|
|
1559
|
-
if (t(this, U) && Number(t(this, U)) > 0 && n.push("."), t(this,
|
|
1560
|
+
if (t(this, U) && Number(t(this, U)) > 0 && n.push("."), t(this, yt) && Number(t(this, yt)) >= 0 && n.push("-"), !(e.keyCode >= 48 && e.keyCode <= 57 || e.keyCode >= 96 && e.keyCode <= 105) && !n.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) {
|
|
1560
1561
|
var s = e.target.value, i = s.indexOf(".");
|
|
1561
1562
|
if (i >= 0) {
|
|
1562
1563
|
var s = s.substr(i + 1, s.length);
|
|
@@ -1564,10 +1565,10 @@ const je = class je extends we {
|
|
|
1564
1565
|
}
|
|
1565
1566
|
}
|
|
1566
1567
|
}
|
|
1567
|
-
t(this,
|
|
1568
|
+
t(this, bt) && ninegrid.getByteLength(e.target.value) >= Number(t(this, bt)) && e.target.selectionStart == e.target.selectionEnd && e.preventDefault();
|
|
1568
1569
|
}
|
|
1569
1570
|
}, "#onKeyDown"));
|
|
1570
|
-
if (this.applyBaseStyle(), y(this, nt, this.getAttribute("type") || "text"), y(this,
|
|
1571
|
+
if (this.applyBaseStyle(), y(this, nt, this.getAttribute("type") || "text"), y(this, bt, this.getAttribute("maxbyte")), y(this, yt, this.getAttribute("min")), y(this, oe, this.getAttribute("max")), y(this, U, this.getAttribute("scale")), !["text", "number"].includes(t(this, nt))) throw `invalid type : ${t(this, nt)}`;
|
|
1571
1572
|
}
|
|
1572
1573
|
connectedCallback() {
|
|
1573
1574
|
for (var e = [], s = 0; s < this.attributes.length; s++)
|
|
@@ -1580,7 +1581,7 @@ const je = class je extends we {
|
|
|
1580
1581
|
`, super.connectedCallback(), y(this, $t, this.querySelector("input"));
|
|
1581
1582
|
}
|
|
1582
1583
|
};
|
|
1583
|
-
$t = new WeakMap(), nt = new WeakMap(),
|
|
1584
|
+
$t = new WeakMap(), nt = new WeakMap(), bt = new WeakMap(), yt = new WeakMap(), oe = new WeakMap(), U = new WeakMap(), Le = new WeakMap(), h(je, "CellInputText");
|
|
1584
1585
|
let Se = je;
|
|
1585
1586
|
customElements.get("cell-input-text");
|
|
1586
1587
|
customElements.get("cell-input") || customElements.define("cell-input", Se);
|