@ninebone/table 0.0.688 β 0.0.690
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 +159 -160
- package/dist/nine-table.js.map +1 -1
- package/dist/nine-table.umd.js +6 -6
- package/dist/nine-table.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/nine-table.js
CHANGED
|
@@ -55,11 +55,11 @@ const $e = class $e extends HTMLElement {
|
|
|
55
55
|
if (l <= 0) return;
|
|
56
56
|
const f = Math.max(Math.min(l * (a / c), l), 20);
|
|
57
57
|
n.style.width = `${f}px`;
|
|
58
|
-
const
|
|
59
|
-
let
|
|
60
|
-
b > 0 && (
|
|
58
|
+
const g = e.scrollLeft, b = c - a;
|
|
59
|
+
let u = 0;
|
|
60
|
+
b > 0 && (u = parseInt(g / b * (l - f), 10)), u < 0 && (u = 0);
|
|
61
61
|
const v = l - f;
|
|
62
|
-
|
|
62
|
+
u > v && (u = v), n.style.left = `${u}px`, t(this, S).left.disabled = u === 0, t(this, S).right.disabled = u >= v - 1;
|
|
63
63
|
}, "refresh"));
|
|
64
64
|
d(this, G, /* @__PURE__ */ h((e) => {
|
|
65
65
|
if (!t(this, S)) return !1;
|
|
@@ -70,8 +70,8 @@ const $e = class $e extends HTMLElement {
|
|
|
70
70
|
a < 0 && (a = 0);
|
|
71
71
|
const c = n.width - o;
|
|
72
72
|
a > c && (a = c), a = parseInt(a, 10), t(this, S).thumb.style.left = `${a}px`, t(this, S).left.disabled = a === 0, t(this, S).right.disabled = a >= c - 1;
|
|
73
|
-
const l = s.clientWidth,
|
|
74
|
-
return c > 0 &&
|
|
73
|
+
const l = s.clientWidth, g = i.scrollWidth - l;
|
|
74
|
+
return c > 0 && g > 0 && (s.scrollLeft = a / c * g), a > 0 && a < c - 1;
|
|
75
75
|
}, "#thumbMoveTo"));
|
|
76
76
|
d(this, Nt, /* @__PURE__ */ h(() => {
|
|
77
77
|
const e = /* @__PURE__ */ h((i) => {
|
|
@@ -201,19 +201,19 @@ const $e = class $e extends HTMLElement {
|
|
|
201
201
|
z = new WeakMap(), j = new WeakMap(), S = new WeakMap(), X = new WeakMap(), K = new WeakMap(), Z = new WeakMap(), _t = new WeakMap(), G = new WeakMap(), Nt = new WeakMap(), h($e, "NineTableHScrollBar");
|
|
202
202
|
let ae = $e;
|
|
203
203
|
customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar", ae);
|
|
204
|
-
var F,
|
|
204
|
+
var F, ot, at, k, vt, xt, Wt;
|
|
205
205
|
const Me = class Me extends HTMLElement {
|
|
206
206
|
constructor() {
|
|
207
207
|
super();
|
|
208
208
|
d(this, F);
|
|
209
|
-
d(this,
|
|
210
|
-
d(this,
|
|
209
|
+
d(this, ot);
|
|
210
|
+
d(this, at, !1);
|
|
211
211
|
d(this, k);
|
|
212
212
|
d(this, vt, 0);
|
|
213
213
|
d(this, xt, 0);
|
|
214
214
|
E(this, "refresh", /* @__PURE__ */ h(() => {
|
|
215
|
-
if (R.log("vscrollbar.refresh"),
|
|
216
|
-
const e = t(this, k).container, s = t(this, k).track, i = t(this, k).thumb, n = e.clientHeight, o = t(this, F).data.length, a = t(this,
|
|
215
|
+
if (R.log("vscrollbar.refresh"), !t(this, F) || !t(this, k)) return;
|
|
216
|
+
const e = t(this, k).container, s = t(this, k).track, i = t(this, k).thumb, n = e.clientHeight, o = t(this, F).data.length, a = t(this, ot).getRowHeight(), c = o * a;
|
|
217
217
|
if (c <= n || o === 0) {
|
|
218
218
|
this.style.display = "none";
|
|
219
219
|
return;
|
|
@@ -223,43 +223,42 @@ const Me = class Me extends HTMLElement {
|
|
|
223
223
|
if (l <= 0) return;
|
|
224
224
|
const f = Math.max(Math.min(l * (n / c), l), 20);
|
|
225
225
|
i.style.height = `${f}px`;
|
|
226
|
-
const
|
|
227
|
-
|
|
228
|
-
|
|
226
|
+
const g = e.scrollTop, b = Math.max(c - n, 1);
|
|
227
|
+
R.log(l, f, g, b);
|
|
228
|
+
let u = 0;
|
|
229
|
+
b > 0 && (u = g / b * (l - f));
|
|
229
230
|
const v = l - f;
|
|
230
|
-
|
|
231
|
+
u < 0 && (u = 0), u > v && (u = v), i.style.top = `${u}px`, t(this, k).top.disabled = g <= 0, t(this, k).bottom.disabled = g >= b - 1;
|
|
231
232
|
}, "refresh"));
|
|
232
233
|
d(this, Wt, /* @__PURE__ */ h(() => {
|
|
233
234
|
R.log("nine-table-vscrollbar.#init");
|
|
234
235
|
const e = t(this, k).container, s = /* @__PURE__ */ h(() => {
|
|
235
|
-
const n = (t(this, F).data.get() || []).length, o = t(this,
|
|
236
|
+
const n = (t(this, F).data.get() || []).length, o = t(this, ot).getRowHeight();
|
|
236
237
|
return n * o;
|
|
237
238
|
}, "getContentHeight");
|
|
238
|
-
|
|
239
|
-
t(this, J) || this.refresh();
|
|
240
|
-
}), t(this, k).thumb.addEventListener("mousedown", (i) => {
|
|
239
|
+
t(this, k).thumb.addEventListener("mousedown", (i) => {
|
|
241
240
|
if (i.button !== 0) return;
|
|
242
|
-
i.stopPropagation(), i.preventDefault(), y(this,
|
|
241
|
+
i.stopPropagation(), i.preventDefault(), y(this, at, !0), y(this, vt, i.clientY), y(this, xt, e.scrollTop);
|
|
243
242
|
const n = /* @__PURE__ */ h((a) => {
|
|
244
|
-
if (!t(this,
|
|
245
|
-
const c = t(this, k).track.getBoundingClientRect(), l = t(this, k).thumb.clientHeight,
|
|
246
|
-
if (
|
|
247
|
-
const A = b /
|
|
243
|
+
if (!t(this, at)) return;
|
|
244
|
+
const c = t(this, k).track.getBoundingClientRect(), l = t(this, k).thumb.clientHeight, g = c.height - l, b = a.clientY - t(this, vt), u = e.clientHeight, v = s(), w = Math.max(v - u, 1);
|
|
245
|
+
if (g > 0 && w > 0) {
|
|
246
|
+
const A = b / g * w;
|
|
248
247
|
let m = t(this, xt) + A;
|
|
249
|
-
const W = Math.max(0, v -
|
|
248
|
+
const W = Math.max(0, v - u);
|
|
250
249
|
m < 0 && (m = 0), m > W && (m = W), e.scrollTop = m;
|
|
251
250
|
}
|
|
252
251
|
this.refresh();
|
|
253
252
|
}, "onMouseMove"), o = /* @__PURE__ */ h(() => {
|
|
254
|
-
y(this,
|
|
253
|
+
y(this, at, !1), document.removeEventListener("mousemove", n), document.removeEventListener("mouseup", o), this.refresh();
|
|
255
254
|
}, "onMouseUp");
|
|
256
255
|
document.addEventListener("mousemove", n), document.addEventListener("mouseup", o);
|
|
257
256
|
}), t(this, k).track.addEventListener("mousedown", (i) => {
|
|
258
257
|
if (i.button !== 0 || i.target === t(this, k).thumb) return;
|
|
259
|
-
const n = t(this, k).track.getBoundingClientRect(), o = t(this, k).thumb.clientHeight, a = i.clientY - n.top - o / 2, l = n.height - o, f = e.clientHeight,
|
|
258
|
+
const n = t(this, k).track.getBoundingClientRect(), o = t(this, k).thumb.clientHeight, a = i.clientY - n.top - o / 2, l = n.height - o, f = e.clientHeight, g = s(), b = Math.max(g - f, 1);
|
|
260
259
|
if (l > 0 && b > 0) {
|
|
261
|
-
const
|
|
262
|
-
e.scrollTop =
|
|
260
|
+
const u = Math.max(0, Math.min(1, a / l));
|
|
261
|
+
e.scrollTop = u * b;
|
|
263
262
|
}
|
|
264
263
|
this.refresh();
|
|
265
264
|
}), t(this, k).top.addEventListener("click", () => {
|
|
@@ -270,7 +269,7 @@ const Me = class Me extends HTMLElement {
|
|
|
270
269
|
}, "#init"));
|
|
271
270
|
}
|
|
272
271
|
connectedCallback() {
|
|
273
|
-
y(this, F, this.getRootNode().host), y(this,
|
|
272
|
+
y(this, F, this.getRootNode().host), y(this, ot, this.closest("nine-table-sheet")), this.innerHTML = `
|
|
274
273
|
<style>
|
|
275
274
|
nine-table-vscrollbar {
|
|
276
275
|
display: flex;
|
|
@@ -351,19 +350,19 @@ const Me = class Me extends HTMLElement {
|
|
|
351
350
|
e();
|
|
352
351
|
}
|
|
353
352
|
};
|
|
354
|
-
F = new WeakMap(),
|
|
353
|
+
F = new WeakMap(), ot = new WeakMap(), at = new WeakMap(), k = new WeakMap(), vt = new WeakMap(), xt = new WeakMap(), Wt = new WeakMap(), h(Me, "NineTableVScrollBar");
|
|
355
354
|
let le = Me;
|
|
356
355
|
customElements.get("nine-table-vscrollbar") || customElements.define("nine-table-vscrollbar", le);
|
|
357
|
-
var P, x,
|
|
356
|
+
var P, x, J, D, I, V, Q, wt, Se, Ee, Ot, Bt, St, Et, At, zt, Dt, qt, Ae, lt, Rt, Pt;
|
|
358
357
|
const Ie = class Ie {
|
|
359
358
|
constructor(r) {
|
|
360
359
|
d(this, P);
|
|
361
360
|
d(this, x);
|
|
362
|
-
d(this,
|
|
361
|
+
d(this, J);
|
|
363
362
|
d(this, D, /* @__PURE__ */ new Map());
|
|
364
|
-
d(this,
|
|
363
|
+
d(this, I, null);
|
|
365
364
|
d(this, V, null);
|
|
366
|
-
d(this,
|
|
365
|
+
d(this, Q, 0);
|
|
367
366
|
d(this, wt, 40);
|
|
368
367
|
d(this, Se, !1);
|
|
369
368
|
d(this, Ee, !1);
|
|
@@ -376,31 +375,32 @@ const Ie = class Ie {
|
|
|
376
375
|
r && (t(this, St).call(this), t(this, Et).call(this), t(this, lt).call(this, r.scrollTop), (e = t(this, x).querySelector("nine-table-vscrollbar")) == null || e.refresh());
|
|
377
376
|
}, "refresh"));
|
|
378
377
|
E(this, "initialize", /* @__PURE__ */ h(() => {
|
|
379
|
-
R.log("rowManager.initialize"), y(this,
|
|
378
|
+
R.log("rowManager.initialize"), y(this, J, {
|
|
380
379
|
scrollTables: t(this, x).querySelectorAll(".ng-part-body table"),
|
|
381
380
|
firstTr: t(this, x).querySelector(".ng-container-body .ng-part-body tbody.bindable-tbody tr:not(.nodata)")
|
|
382
|
-
}), y(this,
|
|
381
|
+
}), y(this, I, null), t(this, D).clear(), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((o) => {
|
|
383
382
|
const a = t(this, x).querySelector(o);
|
|
384
383
|
if (!a) return;
|
|
385
384
|
const c = a.querySelector(".ng-part-body table");
|
|
386
385
|
if (!c) return;
|
|
387
386
|
const l = c.querySelector("tbody.bindable-tbody");
|
|
388
387
|
if (!l) return;
|
|
389
|
-
const
|
|
390
|
-
t(this, D).set(o,
|
|
388
|
+
const g = Array.from(l.querySelectorAll("tr")).map((b) => b.cloneNode(!0));
|
|
389
|
+
t(this, D).set(o, g);
|
|
391
390
|
});
|
|
392
391
|
const r = t(this, x).querySelector(".ng-container-body .ng-part-body"), e = t(this, x).querySelector(".ng-container-left .ng-part-body"), s = t(this, x).querySelector(".ng-container-right .ng-part-body"), i = t(this, x).querySelector(".ng-container-body .ng-part-header"), n = t(this, x).querySelector(".ng-container-body .ng-part-footer");
|
|
393
392
|
if (r) {
|
|
394
393
|
t(this, St).call(this), t(this, qt).call(this), t(this, Et).call(this), t(this, lt).call(this, r.scrollTop);
|
|
395
394
|
let o = !1;
|
|
396
395
|
const a = /* @__PURE__ */ h((c) => {
|
|
396
|
+
var g;
|
|
397
397
|
if (o) return;
|
|
398
398
|
o = !0;
|
|
399
399
|
const l = c.scrollTop, f = c.scrollLeft;
|
|
400
|
-
r && r.scrollTop !== l && (r.scrollTop = l), e && e.scrollTop !== l && (e.scrollTop = l), s && s.scrollTop !== l && (s.scrollTop = l), i && i.scrollLeft !== f && (i.scrollLeft = f), n && n.scrollLeft !== f && (n.scrollLeft = f), t(this, lt).call(this, l), o = !1;
|
|
400
|
+
r && r.scrollTop !== l && (r.scrollTop = l), e && e.scrollTop !== l && (e.scrollTop = l), s && s.scrollTop !== l && (s.scrollTop = l), i && i.scrollLeft !== f && (i.scrollLeft = f), n && n.scrollLeft !== f && (n.scrollLeft = f), t(this, lt).call(this, l), (g = t(this, x).querySelector("nine-table-vscrollbar")) == null || g.refresh(), o = !1;
|
|
401
401
|
}, "handleContainerScroll");
|
|
402
402
|
[r, e, s].forEach((c) => {
|
|
403
|
-
|
|
403
|
+
c == null || c.addEventListener("scroll", () => {
|
|
404
404
|
a(c);
|
|
405
405
|
});
|
|
406
406
|
});
|
|
@@ -418,11 +418,11 @@ const Ie = class Ie {
|
|
|
418
418
|
s.forEach((c) => {
|
|
419
419
|
o.appendChild(c.cloneNode(!0));
|
|
420
420
|
});
|
|
421
|
-
n ? n.before(o) : i.appendChild(o), e === ".ng-container-body" && (t(this,
|
|
421
|
+
n ? n.before(o) : i.appendChild(o), e === ".ng-container-body" && (t(this, J).firstTr = i.querySelector("tr:not(.nodata)"));
|
|
422
422
|
}, "#renderRows"));
|
|
423
423
|
d(this, St, /* @__PURE__ */ h(() => {
|
|
424
|
-
if (t(this,
|
|
425
|
-
return t(this,
|
|
424
|
+
if (t(this, I) !== null && t(this, I) > 0)
|
|
425
|
+
return t(this, I);
|
|
426
426
|
const r = t(this, x).querySelector(".ng-container-body .ng-part-body");
|
|
427
427
|
R.log("rowManager.#measureAndCacheHeight");
|
|
428
428
|
const e = t(this, D).get(".ng-container-body");
|
|
@@ -437,19 +437,19 @@ const Ie = class Ie {
|
|
|
437
437
|
const o = t(this, x), a = o.style.display, c = o.style.visibility, l = o.style.position;
|
|
438
438
|
(a === "none" || window.getComputedStyle(o).display === "none") && (o.style.display = "block", o.style.visibility = "hidden", o.style.position = "absolute");
|
|
439
439
|
let f = 0;
|
|
440
|
-
const
|
|
441
|
-
return
|
|
442
|
-
let
|
|
443
|
-
if (
|
|
440
|
+
const g = s.querySelectorAll("tr");
|
|
441
|
+
return g.forEach((b) => {
|
|
442
|
+
let u = b.offsetHeight || b.getBoundingClientRect().height;
|
|
443
|
+
if (u === 0) {
|
|
444
444
|
const v = window.getComputedStyle(b);
|
|
445
|
-
|
|
445
|
+
u = parseFloat(v.height) || parseFloat(v.minHeight) || 0;
|
|
446
446
|
}
|
|
447
|
-
f +=
|
|
448
|
-
}),
|
|
447
|
+
f += u;
|
|
448
|
+
}), g.forEach((b) => b.remove()), o.style.display = a, o.style.visibility = c, o.style.position = l, f <= 0 ? -1 : (y(this, I, f), t(this, At).call(this), t(this, I));
|
|
449
449
|
}, "#measureAndCacheHeight"));
|
|
450
450
|
d(this, Et, /* @__PURE__ */ h(() => {
|
|
451
451
|
R.log("rowManager.#updateVirtualScrollHeight");
|
|
452
|
-
const e = (t(this, P).data.get() || []).length, s = t(this,
|
|
452
|
+
const e = (t(this, P).data.get() || []).length, s = t(this, I), i = e * s;
|
|
453
453
|
R.log("π [VirtualHeight]", { totalCount: e, rowHeight: s, totalVirtualHeight: i }), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((n) => {
|
|
454
454
|
const o = t(this, x).querySelector(n);
|
|
455
455
|
if (!o) return;
|
|
@@ -458,35 +458,35 @@ const Ie = class Ie {
|
|
|
458
458
|
});
|
|
459
459
|
}, "#updateVirtualScrollHeight"));
|
|
460
460
|
d(this, At, /* @__PURE__ */ h(() => {
|
|
461
|
-
if (t(this,
|
|
462
|
-
const r = Math.ceil(t(this,
|
|
461
|
+
if (t(this, Q) > 0 && t(this, I) > 0) {
|
|
462
|
+
const r = Math.ceil(t(this, Q) / t(this, I));
|
|
463
463
|
y(this, wt, r + t(this, Ot));
|
|
464
464
|
}
|
|
465
465
|
}, "#updateRowCount"));
|
|
466
466
|
d(this, zt, /* @__PURE__ */ h(() => {
|
|
467
|
-
var a, c, l, f,
|
|
467
|
+
var a, c, l, f, g, b;
|
|
468
468
|
const r = t(this, x).querySelector(".ng-container-left .ng-part-body table"), e = t(this, x).querySelector(".ng-container-body .ng-part-body table"), s = t(this, x).querySelector(".ng-container-right .ng-part-body table");
|
|
469
469
|
if (e) {
|
|
470
|
-
const
|
|
470
|
+
const u = r ? Array.from(r.querySelectorAll("tbody tr")) : [], v = Array.from(e.querySelectorAll("tbody tr")), w = s ? Array.from(s.querySelectorAll("tbody tr")) : [], A = Math.max(u.length, v.length, w.length);
|
|
471
471
|
for (let m = 0; m < A; m++) {
|
|
472
472
|
const W = [
|
|
473
|
-
((a =
|
|
473
|
+
((a = u[m]) == null ? void 0 : a.getBoundingClientRect().height) || 0,
|
|
474
474
|
((c = v[m]) == null ? void 0 : c.getBoundingClientRect().height) || 0,
|
|
475
475
|
((l = w[m]) == null ? void 0 : l.getBoundingClientRect().height) || 0
|
|
476
476
|
], T = Math.max(...W);
|
|
477
|
-
T > 0 && (
|
|
477
|
+
T > 0 && (u[m] && (u[m].style.height = `${T}px`), v[m] && (v[m].style.height = `${T}px`), w[m] && (w[m].style.height = `${T}px`));
|
|
478
478
|
}
|
|
479
479
|
}
|
|
480
480
|
const i = t(this, x).querySelector(".ng-container-left .ng-part-footer table"), n = t(this, x).querySelector(".ng-container-body .ng-part-footer table"), o = t(this, x).querySelector(".ng-container-right .ng-part-footer table");
|
|
481
481
|
if (n) {
|
|
482
|
-
const
|
|
482
|
+
const u = i ? Array.from(i.querySelectorAll("tfoot tr")) : [], v = Array.from(n.querySelectorAll("tfoot tr")), w = o ? Array.from(o.querySelectorAll("tfoot tr")) : [], A = Math.max(u.length, v.length, w.length);
|
|
483
483
|
for (let m = 0; m < A; m++) {
|
|
484
484
|
const W = [
|
|
485
|
-
((f =
|
|
486
|
-
((
|
|
485
|
+
((f = u[m]) == null ? void 0 : f.getBoundingClientRect().height) || 0,
|
|
486
|
+
((g = v[m]) == null ? void 0 : g.getBoundingClientRect().height) || 0,
|
|
487
487
|
((b = w[m]) == null ? void 0 : b.getBoundingClientRect().height) || 0
|
|
488
488
|
], T = Math.max(...W);
|
|
489
|
-
T > 0 && (
|
|
489
|
+
T > 0 && (u[m] && (u[m].style.height = `${T}px`), v[m] && (v[m].style.height = `${T}px`), w[m] && (w[m].style.height = `${T}px`));
|
|
490
490
|
}
|
|
491
491
|
}
|
|
492
492
|
}, "#syncRowHeights"));
|
|
@@ -501,7 +501,7 @@ const Ie = class Ie {
|
|
|
501
501
|
const o = s.querySelector(".ng-part-header"), a = s.querySelector(".ng-part-footer");
|
|
502
502
|
o && (n += o.offsetHeight), a && (n += a.offsetHeight);
|
|
503
503
|
const c = Math.max(i - n, 100);
|
|
504
|
-
t(this,
|
|
504
|
+
t(this, Q) !== c && (y(this, Q, c), t(this, At).call(this), t(this, I) !== null && (t(this, qt).call(this), this.refresh()));
|
|
505
505
|
}
|
|
506
506
|
}
|
|
507
507
|
})), t(this, V).observe(t(this, x)));
|
|
@@ -520,34 +520,33 @@ const Ie = class Ie {
|
|
|
520
520
|
const i = s.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
521
521
|
if (!i) return;
|
|
522
522
|
const n = 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;
|
|
523
|
-
n.forEach((f,
|
|
524
|
-
const b = r + Math.floor(
|
|
523
|
+
n.forEach((f, g) => {
|
|
524
|
+
const b = r + Math.floor(g / o);
|
|
525
525
|
if (b >= c) {
|
|
526
526
|
f.style.visibility = "hidden";
|
|
527
527
|
return;
|
|
528
528
|
}
|
|
529
|
-
const
|
|
530
|
-
f.style.display = "", t(this, Rt).call(this, f,
|
|
529
|
+
const u = t(this, P).data.get(b);
|
|
530
|
+
f.style.display = "", t(this, Rt).call(this, f, u, b);
|
|
531
531
|
});
|
|
532
532
|
});
|
|
533
533
|
}, "#adjustBufferRows"));
|
|
534
534
|
d(this, lt, /* @__PURE__ */ h((r) => {
|
|
535
|
-
var
|
|
536
|
-
|
|
537
|
-
const e = t(this, M);
|
|
535
|
+
var g, b;
|
|
536
|
+
const e = t(this, I);
|
|
538
537
|
if (!e || e <= 0) return;
|
|
539
538
|
const s = t(this, P).data.length;
|
|
540
539
|
if (s === 0) return;
|
|
541
|
-
const i = ((
|
|
540
|
+
const i = ((g = t(this, D).get(".ng-container-body")) == null ? void 0 : g.length) || 1, n = t(this, x).querySelector(".ng-container-body .ng-part-body");
|
|
542
541
|
R.log("bodyContainer.clientHeight", n.clientHeight);
|
|
543
542
|
const o = Math.max(0, s - Math.floor(n.clientHeight / e)), a = Math.min(o, Math.max(0, Math.floor(r / e)));
|
|
544
543
|
let c = Math.floor(a * e);
|
|
545
544
|
R.log(`π [Scroll Calc] maxStartIndex: ${o}, startIndex: ${a}, offsetY: ${c}`), a === o && R.log(`π [Scroll Inspect] scrollTop: ${r}, rowHeight: ${e}, maxStartIndex: ${o}, startIndex: ${a}, offsetY: ${c}`);
|
|
546
|
-
const l = t(this,
|
|
547
|
-
(b = t(this,
|
|
548
|
-
|
|
549
|
-
}), f !== a && (R.log(`π [Row Bind Trigger] currentStartIndex(${f}) !== startIndex(${a})`), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((
|
|
550
|
-
const v = t(this, x).querySelector(
|
|
545
|
+
const l = t(this, J).firstTr, f = l && l.dataset.row !== void 0 ? parseInt(l.dataset.row, 10) : -1;
|
|
546
|
+
(b = t(this, J)) == null || b.scrollTables.forEach((u) => {
|
|
547
|
+
u.style.transform = `translate3d(0, ${c}px, 0)`;
|
|
548
|
+
}), f !== a && (R.log(`π [Row Bind Trigger] currentStartIndex(${f}) !== startIndex(${a})`), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((u) => {
|
|
549
|
+
const v = t(this, x).querySelector(u);
|
|
551
550
|
if (!v) return;
|
|
552
551
|
const w = v.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
553
552
|
if (!w) return;
|
|
@@ -589,13 +588,13 @@ const Ie = class Ie {
|
|
|
589
588
|
const r = t(this, x).querySelector(".ng-container-left .ng-part-header table"), e = t(this, x).querySelector(".ng-container-body .ng-part-header table"), s = t(this, x).querySelector(".ng-container-right .ng-part-header table");
|
|
590
589
|
if (!e) return;
|
|
591
590
|
const i = r ? Array.from(r.querySelectorAll("tr")) : [], n = Array.from(e.querySelectorAll("tr")), o = s ? Array.from(s.querySelectorAll("tr")) : [], a = Math.max(i.length, n.length, o.length);
|
|
592
|
-
for (let
|
|
591
|
+
for (let g = 0; g < a; g++) {
|
|
593
592
|
const b = [
|
|
594
|
-
((c = i[
|
|
595
|
-
((l = n[
|
|
596
|
-
((f = o[
|
|
597
|
-
],
|
|
598
|
-
|
|
593
|
+
((c = i[g]) == null ? void 0 : c.getBoundingClientRect().height) || 0,
|
|
594
|
+
((l = n[g]) == null ? void 0 : l.getBoundingClientRect().height) || 0,
|
|
595
|
+
((f = o[g]) == null ? void 0 : f.getBoundingClientRect().height) || 0
|
|
596
|
+
], u = Math.max(...b);
|
|
597
|
+
u > 0 && (i[g] && (i[g].style.height = `${u}px`), n[g] && (n[g].style.height = `${u}px`), o[g] && (o[g].style.height = `${u}px`));
|
|
599
598
|
}
|
|
600
599
|
}, "#syncHeaderHeights"));
|
|
601
600
|
E(this, "destroy", /* @__PURE__ */ h(() => {
|
|
@@ -604,14 +603,14 @@ const Ie = class Ie {
|
|
|
604
603
|
y(this, P, r.getRootNode().host), y(this, x, r), t(this, Dt).call(this);
|
|
605
604
|
}
|
|
606
605
|
getRowHeight() {
|
|
607
|
-
return t(this,
|
|
606
|
+
return t(this, I);
|
|
608
607
|
}
|
|
609
608
|
templateLength(r = ".ng-container-body") {
|
|
610
609
|
var e;
|
|
611
610
|
return ((e = t(this, D).get(r)) == null ? void 0 : e.length) || 1;
|
|
612
611
|
}
|
|
613
612
|
};
|
|
614
|
-
P = new WeakMap(), x = new WeakMap(),
|
|
613
|
+
P = new WeakMap(), x = new WeakMap(), J = new WeakMap(), D = new WeakMap(), I = new WeakMap(), V = new WeakMap(), Q = new WeakMap(), wt = new WeakMap(), Se = new WeakMap(), Ee = new WeakMap(), Ot = new WeakMap(), Bt = new WeakMap(), St = new WeakMap(), Et = new WeakMap(), At = new WeakMap(), zt = new WeakMap(), Dt = new WeakMap(), qt = new WeakMap(), Ae = new WeakMap(), lt = new WeakMap(), Rt = new WeakMap(), Pt = new WeakMap(), h(Ie, "RowManager");
|
|
615
614
|
let ce = Ie;
|
|
616
615
|
const jt = class jt {
|
|
617
616
|
/**
|
|
@@ -629,17 +628,17 @@ const jt = class jt {
|
|
|
629
628
|
a.querySelectorAll("tbody td, tbody th, tfoot td, tfoot th").forEach((l) => {
|
|
630
629
|
const f = l.getAttribute("cell-type") || "renderer";
|
|
631
630
|
if (l.children.length > 0 && l.firstElementChild.tagName.includes("-")) return;
|
|
632
|
-
let
|
|
633
|
-
const b = l.getAttribute("data-bind"),
|
|
631
|
+
let g = `cell-${f}`;
|
|
632
|
+
const b = l.getAttribute("data-bind"), u = l.getAttribute("data-expr"), v = l.getAttribute("maxbyte"), w = l.getAttribute("type");
|
|
634
633
|
let A = [];
|
|
635
|
-
b && A.push(`data-bind="${b}"`),
|
|
634
|
+
b && A.push(`data-bind="${b}"`), u && A.push(`data-expr="${u}"`), v && A.push(`maxbyte="${v}"`), w && A.push(`type="${w}"`), l.innerHTML = `<${g} ${A.join(" ")}></${g}>`;
|
|
636
635
|
});
|
|
637
636
|
}, "processCellTypes"), s = /* @__PURE__ */ h((a) => {
|
|
638
637
|
if (!a.querySelector("colgroup")) {
|
|
639
|
-
const c = a.querySelector("tbody tr") || a.querySelector("tr"), l = c ? c.querySelectorAll("th, td").length : 1, f = document.createElement("colgroup"),
|
|
638
|
+
const c = a.querySelector("tbody tr") || a.querySelector("tr"), l = c ? c.querySelectorAll("th, td").length : 1, f = document.createElement("colgroup"), g = Math.max(Math.floor(a.clientWidth / l), 100);
|
|
640
639
|
for (let b = 0; b < l; b++) {
|
|
641
|
-
const
|
|
642
|
-
|
|
640
|
+
const u = document.createElement("col");
|
|
641
|
+
u.setAttribute("width", g), f.appendChild(u);
|
|
643
642
|
}
|
|
644
643
|
a.prepend(f);
|
|
645
644
|
}
|
|
@@ -649,33 +648,33 @@ const jt = class jt {
|
|
|
649
648
|
}
|
|
650
649
|
a.classList.add("nine-table-element");
|
|
651
650
|
}, "ensureTableStructure"), i = /* @__PURE__ */ h((a, c) => {
|
|
652
|
-
const l = Array.from(a.querySelectorAll(c + " tr")), f = Array.from(a.querySelectorAll(c + " th," + c + " td")),
|
|
653
|
-
if (
|
|
651
|
+
const l = Array.from(a.querySelectorAll(c + " tr")), f = Array.from(a.querySelectorAll(c + " th," + c + " td")), g = l.length;
|
|
652
|
+
if (g === 0 || f.length === 0) return;
|
|
654
653
|
let b = 0;
|
|
655
654
|
f.forEach((v) => {
|
|
656
655
|
b += v.colSpan || 1;
|
|
657
656
|
});
|
|
658
|
-
const
|
|
657
|
+
const u = Array.from(Array(g), () => Array(b).fill(null));
|
|
659
658
|
l.forEach((v) => {
|
|
660
659
|
const w = v.sectionRowIndex;
|
|
661
660
|
let A = 0;
|
|
662
661
|
Array.from(v.querySelectorAll("th,td")).forEach((m) => {
|
|
663
|
-
for (let O = 0; O <
|
|
664
|
-
if (
|
|
662
|
+
for (let O = 0; O < u[w].length; O++)
|
|
663
|
+
if (u[w][O] === null) {
|
|
665
664
|
A = O;
|
|
666
665
|
break;
|
|
667
666
|
}
|
|
668
667
|
const W = m.rowSpan || 1, T = m.colSpan || 1;
|
|
669
668
|
for (let O = 0; O < W; O++)
|
|
670
669
|
for (let yt = 0; yt < T; yt++)
|
|
671
|
-
w + O <
|
|
670
|
+
w + O < g && A + yt < b && (u[w + O][A + yt] = O === 0 && yt === 0 ? "1" : "0");
|
|
672
671
|
});
|
|
673
672
|
}), l.forEach((v) => {
|
|
674
673
|
const w = v.sectionRowIndex;
|
|
675
674
|
Array.from(v.querySelectorAll("th,td")).forEach((A) => {
|
|
676
|
-
for (let m = 0; m <
|
|
677
|
-
if (
|
|
678
|
-
A.dataset.col = m,
|
|
675
|
+
for (let m = 0; m < u[w].length; m++)
|
|
676
|
+
if (u[w][m] === "1") {
|
|
677
|
+
A.dataset.col = m, u[w][m] = "0";
|
|
679
678
|
break;
|
|
680
679
|
}
|
|
681
680
|
});
|
|
@@ -692,21 +691,21 @@ const jt = class jt {
|
|
|
692
691
|
};
|
|
693
692
|
h(jt, "TableCompiler");
|
|
694
693
|
let he = jt;
|
|
695
|
-
var Ft,
|
|
694
|
+
var Ft, tt, et, Vt, Yt, ct, Ut, Xt;
|
|
696
695
|
const pt = class pt extends HTMLElement {
|
|
697
696
|
constructor() {
|
|
698
697
|
super();
|
|
699
698
|
d(this, Ft);
|
|
700
|
-
d(this,
|
|
701
|
-
d(this,
|
|
699
|
+
d(this, tt, null);
|
|
700
|
+
d(this, et);
|
|
702
701
|
E(this, "invalidate", /* @__PURE__ */ h(() => {
|
|
703
|
-
R.log("sheet.invalidate()"), t(this,
|
|
702
|
+
R.log("sheet.invalidate()"), t(this, et).refresh();
|
|
704
703
|
}, "invalidate"));
|
|
705
704
|
E(this, "generate", /* @__PURE__ */ h((e) => {
|
|
706
705
|
if (R.log("sheet.generate()"), !e) return;
|
|
707
|
-
y(this,
|
|
706
|
+
y(this, tt, he.compile(e)), t(this, Vt).call(this), t(this, Yt).call(this);
|
|
708
707
|
const s = this.querySelector(".ng-container-body .ng-part-header"), i = this.querySelector(".ng-container-body .ng-part-footer"), n = this.querySelector(".ng-nodata-overlay");
|
|
709
|
-
s && n && (n.style.top = `${s.offsetHeight}px`), i && n && (n.style.bottom = `${i.offsetHeight}px`), t(this,
|
|
708
|
+
s && n && (n.style.top = `${s.offsetHeight}px`), i && n && (n.style.bottom = `${i.offsetHeight}px`), t(this, et).initialize(), setTimeout(() => {
|
|
710
709
|
var o;
|
|
711
710
|
(o = this.querySelector("nine-table-hscrollbar")) == null || o.refresh();
|
|
712
711
|
}, 0);
|
|
@@ -718,7 +717,7 @@ const pt = class pt extends HTMLElement {
|
|
|
718
717
|
{ selector: ".ng-container-right", type: "right" }
|
|
719
718
|
].forEach(({ selector: s, type: i }) => {
|
|
720
719
|
var n, o, a;
|
|
721
|
-
(n = this.querySelector(`${s} .ng-part-header`)) == null || n.appendChild(t(this, ct).call(this, t(this,
|
|
720
|
+
(n = this.querySelector(`${s} .ng-part-header`)) == null || n.appendChild(t(this, ct).call(this, t(this, tt), i, "header")), (o = this.querySelector(`${s} .ng-virtual-spacer`)) == null || o.before(t(this, ct).call(this, t(this, tt), i, "body")), (a = this.querySelector(`${s} .ng-part-footer`)) == null || a.appendChild(t(this, ct).call(this, t(this, tt), i, "footer"));
|
|
722
721
|
});
|
|
723
722
|
}, "#renderSplitContainers"));
|
|
724
723
|
d(this, Yt, /* @__PURE__ */ h(() => {
|
|
@@ -748,7 +747,7 @@ const pt = class pt extends HTMLElement {
|
|
|
748
747
|
l.remove();
|
|
749
748
|
}), n;
|
|
750
749
|
}, "#createSplitTable"));
|
|
751
|
-
E(this, "getRowHeight", /* @__PURE__ */ h(() => t(this,
|
|
750
|
+
E(this, "getRowHeight", /* @__PURE__ */ h(() => t(this, et).getRowHeight(), "getRowHeight"));
|
|
752
751
|
E(this, "scrollToX", /* @__PURE__ */ h((e) => {
|
|
753
752
|
const s = this.querySelector(".ng-container-body .ng-part-body");
|
|
754
753
|
s && (s.scrollLeft = e);
|
|
@@ -951,7 +950,7 @@ const pt = class pt extends HTMLElement {
|
|
|
951
950
|
</div>
|
|
952
951
|
`;
|
|
953
952
|
}, "#render"));
|
|
954
|
-
y(this,
|
|
953
|
+
y(this, et, new ce(this)), y(this, Ft, this.getRootNode().host);
|
|
955
954
|
}
|
|
956
955
|
connectedCallback() {
|
|
957
956
|
t(this, Ut).call(this);
|
|
@@ -960,7 +959,7 @@ const pt = class pt extends HTMLElement {
|
|
|
960
959
|
this.innerHTML = "", R.log("NineTableSheet destroyed.");
|
|
961
960
|
}
|
|
962
961
|
};
|
|
963
|
-
Ft = new WeakMap(),
|
|
962
|
+
Ft = new WeakMap(), tt = new WeakMap(), et = new WeakMap(), Vt = new WeakMap(), Yt = new WeakMap(), ct = new WeakMap(), Ut = new WeakMap(), Xt = new WeakMap(), h(pt, "NineTableSheet"), E(pt, "SCROLLBAR_SIZE", 16);
|
|
964
963
|
let It = pt;
|
|
965
964
|
customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet", It);
|
|
966
965
|
var Kt, Tt;
|
|
@@ -978,24 +977,24 @@ const _e = class _e extends HTMLElement {
|
|
|
978
977
|
d(this, Tt, /* @__PURE__ */ h((e, s = !1) => {
|
|
979
978
|
const i = /* @__PURE__ */ h(() => {
|
|
980
979
|
const f = Array.from(this.querySelectorAll("nine-table-sheet"));
|
|
981
|
-
Array.from(this.querySelectorAll("nine-splitter")).forEach((
|
|
982
|
-
const b = f.filter((
|
|
983
|
-
b.length < 2 || b.forEach((
|
|
984
|
-
const v = parseInt(
|
|
980
|
+
Array.from(this.querySelectorAll("nine-splitter")).forEach((u) => u.style.setProperty("display", "none"));
|
|
981
|
+
const b = f.filter((u) => u.classList.contains("active"));
|
|
982
|
+
b.length < 2 || b.forEach((u) => {
|
|
983
|
+
const v = parseInt(u.getAttribute("data-index"), 10), w = this.querySelector(`nine-splitter[data-split-index="${v}"]`), A = f[v + 1];
|
|
985
984
|
w && A && A.classList.contains("active") && w.style.setProperty("display", "flex");
|
|
986
985
|
});
|
|
987
986
|
}, "updateSplitters"), n = this.querySelector(".nine-tab-bar"), o = this.querySelector("nine-table-sheets-body"), a = n.querySelectorAll(".nine-tab-item"), c = o.querySelectorAll("nine-table-sheet");
|
|
988
987
|
if (!a[e]) return;
|
|
989
988
|
if (!s)
|
|
990
|
-
a.forEach((f,
|
|
991
|
-
f.classList.toggle("active",
|
|
992
|
-
}), c.forEach((f,
|
|
993
|
-
const b =
|
|
989
|
+
a.forEach((f, g) => {
|
|
990
|
+
f.classList.toggle("active", g === e);
|
|
991
|
+
}), c.forEach((f, g) => {
|
|
992
|
+
const b = g === e;
|
|
994
993
|
f.classList.toggle("active", b), f.style.flex = b ? "1 1 100%" : "";
|
|
995
994
|
});
|
|
996
995
|
else {
|
|
997
|
-
const f = a[e],
|
|
998
|
-
if (f.classList.contains("active") &&
|
|
996
|
+
const f = a[e], g = n.querySelectorAll(".nine-tab-item.active");
|
|
997
|
+
if (f.classList.contains("active") && g.length <= 1)
|
|
999
998
|
return;
|
|
1000
999
|
f.classList.toggle("active");
|
|
1001
1000
|
const b = o.querySelector(`nine-table-sheet[data-index="${e}"]`);
|
|
@@ -1014,29 +1013,29 @@ const _e = class _e extends HTMLElement {
|
|
|
1014
1013
|
Kt = new WeakMap(), Tt = new WeakMap(), h(_e, "NineTableSheets");
|
|
1015
1014
|
let de = _e;
|
|
1016
1015
|
customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets", de);
|
|
1017
|
-
var
|
|
1016
|
+
var M, Zt, kt, Gt;
|
|
1018
1017
|
const Ne = class Ne {
|
|
1019
1018
|
constructor(r) {
|
|
1020
|
-
d(this,
|
|
1019
|
+
d(this, M);
|
|
1021
1020
|
d(this, Zt, /* @__PURE__ */ h(() => {
|
|
1022
1021
|
t(this, Gt).call(this), new ResizeObserver((r) => {
|
|
1023
1022
|
for (let e of r)
|
|
1024
|
-
t(this,
|
|
1025
|
-
}).observe(t(this,
|
|
1023
|
+
t(this, M).getAttribute("auto-height") === "true" && t(this, kt).call(this);
|
|
1024
|
+
}).observe(t(this, M));
|
|
1026
1025
|
}, "#init"));
|
|
1027
1026
|
d(this, kt, /* @__PURE__ */ h(() => {
|
|
1028
1027
|
var c, l;
|
|
1029
|
-
const r = Array.from(t(this,
|
|
1028
|
+
const r = Array.from(t(this, M).shadowRoot.querySelectorAll("nine-table-sheet.active"));
|
|
1030
1029
|
if (r.length === 0) return;
|
|
1031
|
-
const e = parseInt(t(this,
|
|
1032
|
-
t(this,
|
|
1030
|
+
const e = parseInt(t(this, M).getAttribute("max-display-row"), 10) || 10, s = Math.max(...r.map((f) => f.getRowHeight())), i = (c = t(this, M).shadowRoot.querySelector("nine-table-header")) == null ? void 0 : c.getBoundingClientRect().height, n = (l = t(this, M).shadowRoot.querySelector("nine-table-sheets-footer")) == null ? void 0 : l.getBoundingClientRect().height, o = It.SCROLLBAR_SIZE, a = e * s + i + n + o;
|
|
1031
|
+
t(this, M).style.height = `${a}px`;
|
|
1033
1032
|
}, "#applyAutoHeight"));
|
|
1034
1033
|
d(this, Gt, /* @__PURE__ */ h(() => {
|
|
1035
|
-
const e = Array.from(t(this,
|
|
1036
|
-
const
|
|
1037
|
-
return
|
|
1034
|
+
const e = Array.from(t(this, M).children).filter((c) => c.tagName === "TABLE"), s = t(this, M).getAttribute("auto-height") === "true", i = e.length, n = e.map((c, l) => {
|
|
1035
|
+
const g = `<nine-table-sheet class="${l === 0 ? "active" : ""}" data-index="${l}"></nine-table-sheet>`, b = l < i - 1 ? `<nine-splitter class="h" data-split-index="${l}"></nine-splitter>` : "";
|
|
1036
|
+
return g + b;
|
|
1038
1037
|
}).join(""), o = e.map((c, l) => `<div class="nine-tab-item ${l === 0 ? "active" : ""}" data-index="${l}">Sheet ${l + 1}</div>`).join("");
|
|
1039
|
-
t(this,
|
|
1038
|
+
t(this, M).shadowRoot.innerHTML = `
|
|
1040
1039
|
<style>
|
|
1041
1040
|
:host {
|
|
1042
1041
|
display: flex;
|
|
@@ -1156,18 +1155,18 @@ const Ne = class Ne {
|
|
|
1156
1155
|
<nine-table-analysis></nine-table-analysis>
|
|
1157
1156
|
</nine-table-body>
|
|
1158
1157
|
<nine-table-footer></nine-table-footer>
|
|
1159
|
-
`, t(this,
|
|
1160
|
-
const a = t(this,
|
|
1158
|
+
`, t(this, M).shadowRoot.querySelector("nine-table-sheets").classList.add("nodata");
|
|
1159
|
+
const a = t(this, M).shadowRoot.querySelectorAll("nine-table-sheet");
|
|
1161
1160
|
a == null || a.forEach((c, l) => {
|
|
1162
1161
|
e[l] && setTimeout(() => {
|
|
1163
1162
|
c.generate(e[l]), s && t(this, kt).call(this);
|
|
1164
1163
|
});
|
|
1165
1164
|
});
|
|
1166
1165
|
}, "#render"));
|
|
1167
|
-
y(this,
|
|
1166
|
+
y(this, M, r), t(this, Zt).call(this);
|
|
1168
1167
|
}
|
|
1169
1168
|
};
|
|
1170
|
-
|
|
1169
|
+
M = new WeakMap(), Zt = new WeakMap(), kt = new WeakMap(), Gt = new WeakMap(), h(Ne, "LayoutManager");
|
|
1171
1170
|
let fe = Ne;
|
|
1172
1171
|
var Ct, ht;
|
|
1173
1172
|
const We = class We {
|
|
@@ -1187,7 +1186,7 @@ const We = class We {
|
|
|
1187
1186
|
};
|
|
1188
1187
|
Ct = new WeakMap(), ht = new WeakMap(), h(We, "ngRow");
|
|
1189
1188
|
let ge = We;
|
|
1190
|
-
var _, C, N, dt, Jt, Y, Qt,
|
|
1189
|
+
var _, C, N, dt, Jt, Y, Qt, st, Lt, te, ee, ft;
|
|
1191
1190
|
const B = class B {
|
|
1192
1191
|
constructor(r, e) {
|
|
1193
1192
|
d(this, _);
|
|
@@ -1206,7 +1205,7 @@ const B = class B {
|
|
|
1206
1205
|
e.__ng || (e.__ng = t(this, Lt).call(this)), e.__ng.height = t(this, Y).slice();
|
|
1207
1206
|
});
|
|
1208
1207
|
}, "#initialize"));
|
|
1209
|
-
d(this,
|
|
1208
|
+
d(this, st, /* @__PURE__ */ h(() => {
|
|
1210
1209
|
const r = t(this, _).shadowRoot.querySelector("nine-table-sheets");
|
|
1211
1210
|
r == null || r.classList.toggle("nodata", this.length === 0), t(this, _).shadowRoot.querySelectorAll("nine-table-sheet").forEach((e) => {
|
|
1212
1211
|
e.invalidate();
|
|
@@ -1226,7 +1225,7 @@ const B = class B {
|
|
|
1226
1225
|
return t(this, ft).call(this, s[r]);
|
|
1227
1226
|
}, "get"));
|
|
1228
1227
|
E(this, "set", /* @__PURE__ */ h((r) => {
|
|
1229
|
-
this.clear(), this.add(r, !1), t(this,
|
|
1228
|
+
this.clear(), this.add(r, !1), t(this, st).call(this);
|
|
1230
1229
|
}, "set"));
|
|
1231
1230
|
d(this, Lt, /* @__PURE__ */ h(() => ({
|
|
1232
1231
|
rowState: B.ROW_STATE.EMPTY,
|
|
@@ -1238,7 +1237,7 @@ const B = class B {
|
|
|
1238
1237
|
_: [0, 0, 0, 0, B.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, t(this, Y).slice(), -1, {}, {}]
|
|
1239
1238
|
}), "#getDefaultMeta"));
|
|
1240
1239
|
E(this, "reset", /* @__PURE__ */ h(() => {
|
|
1241
|
-
y(this, N, []), y(this, dt, []), t(this,
|
|
1240
|
+
y(this, N, []), y(this, dt, []), t(this, st).call(this);
|
|
1242
1241
|
}, "reset"));
|
|
1243
1242
|
E(this, "clear", /* @__PURE__ */ h(() => {
|
|
1244
1243
|
var r;
|
|
@@ -1266,7 +1265,7 @@ const B = class B {
|
|
|
1266
1265
|
return e || s.forEach((n, o) => {
|
|
1267
1266
|
const a = t(this, C).rawRecords[i - o];
|
|
1268
1267
|
a && (a.__ng.rowState = B.ROW_STATE.EMPTY);
|
|
1269
|
-
}), t(this,
|
|
1268
|
+
}), t(this, st).call(this), i;
|
|
1270
1269
|
}, "add"));
|
|
1271
1270
|
E(this, "delete", /* @__PURE__ */ h((r) => {
|
|
1272
1271
|
let e = [];
|
|
@@ -1277,7 +1276,7 @@ const B = class B {
|
|
|
1277
1276
|
n.__ng.rowid === i && (n.__ng.deleted = !0, n.__ng.rowState = B.ROW_STATE.DELETE);
|
|
1278
1277
|
});
|
|
1279
1278
|
}
|
|
1280
|
-
}), this.resetRecords(), t(this,
|
|
1279
|
+
}), this.resetRecords(), t(this, st).call(this);
|
|
1281
1280
|
}, "delete"));
|
|
1282
1281
|
E(this, "setValue", /* @__PURE__ */ h((r, e, s) => {
|
|
1283
1282
|
var c;
|
|
@@ -1330,7 +1329,7 @@ const B = class B {
|
|
|
1330
1329
|
return this.length;
|
|
1331
1330
|
}
|
|
1332
1331
|
};
|
|
1333
|
-
_ = new WeakMap(), C = new WeakMap(), N = new WeakMap(), dt = new WeakMap(), Jt = new WeakMap(), Y = new WeakMap(), Qt = new WeakMap(),
|
|
1332
|
+
_ = new WeakMap(), C = new WeakMap(), N = new WeakMap(), dt = new WeakMap(), Jt = new WeakMap(), Y = new WeakMap(), Qt = new WeakMap(), st = new WeakMap(), Lt = new WeakMap(), te = new WeakMap(), ee = new WeakMap(), ft = new WeakMap(), h(B, "ngData"), // π― ν μν μ μ μμλ₯Ό ν΄λμ€ λ΄λΆλ‘ λ΄μ¬ν
|
|
1334
1333
|
E(B, "ROW_STATE", {
|
|
1335
1334
|
EMPTY: "EMPTY",
|
|
1336
1335
|
NORMAL: "NORMAL",
|
|
@@ -1339,13 +1338,13 @@ E(B, "ROW_STATE", {
|
|
|
1339
1338
|
DELETE: "DELETE"
|
|
1340
1339
|
});
|
|
1341
1340
|
let ue = B;
|
|
1342
|
-
var
|
|
1341
|
+
var rt;
|
|
1343
1342
|
const Oe = class Oe {
|
|
1344
1343
|
constructor(r) {
|
|
1345
|
-
d(this,
|
|
1346
|
-
y(this,
|
|
1344
|
+
d(this, rt);
|
|
1345
|
+
y(this, rt, r), this.row = new ge(this), this.data = new ue(t(this, rt), this), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.pageCnt = 25, this.viewRecords.reset = () => {
|
|
1347
1346
|
var e;
|
|
1348
|
-
(e = t(this,
|
|
1347
|
+
(e = t(this, rt).view) != null && e.redraw && t(this, rt).view.redraw();
|
|
1349
1348
|
}, this.setDataSource = (e) => {
|
|
1350
1349
|
this.data && this.data.reset(), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.data.set(e || []);
|
|
1351
1350
|
}, this.getRowState = (e) => {
|
|
@@ -1360,7 +1359,7 @@ const Oe = class Oe {
|
|
|
1360
1359
|
}, this.setDataSource([]);
|
|
1361
1360
|
}
|
|
1362
1361
|
};
|
|
1363
|
-
|
|
1362
|
+
rt = new WeakMap(), h(Oe, "ngDataManager");
|
|
1364
1363
|
let be = Oe;
|
|
1365
1364
|
var gt, H, Ht, se;
|
|
1366
1365
|
const Be = class Be {
|
|
@@ -1435,17 +1434,17 @@ const Be = class Be {
|
|
|
1435
1434
|
};
|
|
1436
1435
|
gt = new WeakMap(), H = new WeakMap(), Ht = new WeakMap(), se = new WeakMap(), h(Be, "ngFields");
|
|
1437
1436
|
let ye = Be;
|
|
1438
|
-
var
|
|
1437
|
+
var it, re, ie;
|
|
1439
1438
|
const ze = class ze extends HTMLElement {
|
|
1440
1439
|
constructor() {
|
|
1441
1440
|
super();
|
|
1442
1441
|
//#created = false;
|
|
1443
|
-
d(this,
|
|
1442
|
+
d(this, it);
|
|
1444
1443
|
d(this, re);
|
|
1445
1444
|
d(this, ie, /* @__PURE__ */ h(() => {
|
|
1446
1445
|
this.fields = new ye(this), y(this, re, new fe(this)), R.log("NineTable connected."), this.dispatchEvent(new CustomEvent("load", { bubbles: !0, detail: { target: this } }));
|
|
1447
1446
|
}, "#init"));
|
|
1448
|
-
this.attachShadow({ mode: "open" }), y(this,
|
|
1447
|
+
this.attachShadow({ mode: "open" }), y(this, it, new be(this));
|
|
1449
1448
|
}
|
|
1450
1449
|
connectedCallback() {
|
|
1451
1450
|
t(this, ie).call(this);
|
|
@@ -1455,18 +1454,18 @@ const ze = class ze extends HTMLElement {
|
|
|
1455
1454
|
}
|
|
1456
1455
|
// π― μΈλΆμμ grid.data.set(...) ννλ‘ μ κ·Όν μ μλλ‘ λ°μ΄ν° λ§€λμ μ€ν
|
|
1457
1456
|
get data() {
|
|
1458
|
-
return t(this,
|
|
1457
|
+
return t(this, it).data;
|
|
1459
1458
|
}
|
|
1460
1459
|
// π― ν(row) κ΄λ ¨ μ μ΄ μ κ·Όμ μ€ν
|
|
1461
1460
|
get row() {
|
|
1462
|
-
return t(this,
|
|
1461
|
+
return t(this, it).row;
|
|
1463
1462
|
}
|
|
1464
1463
|
// π― μ 체 λ°μ΄ν° λ§€λμ μ κ·Ό νμν κ²½μ°
|
|
1465
1464
|
get dataManager() {
|
|
1466
|
-
return t(this,
|
|
1465
|
+
return t(this, it);
|
|
1467
1466
|
}
|
|
1468
1467
|
};
|
|
1469
|
-
|
|
1468
|
+
it = new WeakMap(), re = new WeakMap(), ie = new WeakMap(), h(ze, "NineTable");
|
|
1470
1469
|
let pe = ze;
|
|
1471
1470
|
customElements.get("nine-table") || customElements.define("nine-table", pe);
|
|
1472
1471
|
const mt = class mt extends HTMLElement {
|
|
@@ -1528,8 +1527,8 @@ const De = class De extends me {
|
|
|
1528
1527
|
if (o > e) break;
|
|
1529
1528
|
var a = parseInt(t(this, p).dataset.row), c = a - 1, l = t(this, p).closest("tr").data, f = t(this, L).data.get(c);
|
|
1530
1529
|
t(this, p).dataset.matrixRow;
|
|
1531
|
-
var
|
|
1532
|
-
if (b !=
|
|
1530
|
+
var g = t(this, L).body.querySelector(`tbody.bindable [suppress="${o}"][data-matrix-row="${t(this, p).dataset.matrixRow}"]`), b = g.dataset.expr ? this.getExprValue(g.dataset.expr, l, a) : l[g.dataset.bind], u = g.dataset.expr ? this.getExprValue(g.dataset.expr, f, c) : f[g.dataset.bind];
|
|
1531
|
+
if (b != u) {
|
|
1533
1532
|
n = !0;
|
|
1534
1533
|
break;
|
|
1535
1534
|
}
|
|
@@ -1593,12 +1592,12 @@ const Pe = class Pe extends ve {
|
|
|
1593
1592
|
};
|
|
1594
1593
|
h(Pe, "EditableCellElement");
|
|
1595
1594
|
let xe = Pe;
|
|
1596
|
-
var Mt,
|
|
1595
|
+
var Mt, nt, ut, bt, ne, U, Le;
|
|
1597
1596
|
const je = class je extends xe {
|
|
1598
1597
|
constructor() {
|
|
1599
1598
|
super();
|
|
1600
1599
|
d(this, Mt);
|
|
1601
|
-
d(this,
|
|
1600
|
+
d(this, nt);
|
|
1602
1601
|
d(this, ut);
|
|
1603
1602
|
d(this, bt);
|
|
1604
1603
|
d(this, ne);
|
|
@@ -1639,7 +1638,7 @@ const je = class je extends xe {
|
|
|
1639
1638
|
*/
|
|
1640
1639
|
d(this, Le, /* @__PURE__ */ h((e) => {
|
|
1641
1640
|
if (!["Escape", "Enter", "Tab", "Home", "End", "ArrowLeft", "ArrowRight", "PageUp", "PageDown", "Backspace", "Delete"].includes(e.code)) {
|
|
1642
|
-
if (t(this,
|
|
1641
|
+
if (t(this, nt) == "number") {
|
|
1643
1642
|
let n = [];
|
|
1644
1643
|
if (t(this, U) && Number(t(this, U)) > 0 && n.push("."), t(this, bt) && Number(t(this, bt)) >= 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) {
|
|
1645
1644
|
var s = e.target.value, i = s.indexOf(".");
|
|
@@ -1652,7 +1651,7 @@ const je = class je extends xe {
|
|
|
1652
1651
|
t(this, ut) && ninegrid.getByteLength(e.target.value) >= Number(t(this, ut)) && e.target.selectionStart == e.target.selectionEnd && e.preventDefault();
|
|
1653
1652
|
}
|
|
1654
1653
|
}, "#onKeyDown"));
|
|
1655
|
-
if (this.applyBaseStyle(), y(this,
|
|
1654
|
+
if (this.applyBaseStyle(), y(this, nt, this.getAttribute("type") || "text"), y(this, ut, this.getAttribute("maxbyte")), y(this, bt, this.getAttribute("min")), y(this, ne, this.getAttribute("max")), y(this, U, this.getAttribute("scale")), !["text", "number"].includes(t(this, nt))) throw `invalid type : ${t(this, nt)}`;
|
|
1656
1655
|
}
|
|
1657
1656
|
connectedCallback() {
|
|
1658
1657
|
for (var e = [], s = 0; s < this.attributes.length; s++)
|
|
@@ -1665,7 +1664,7 @@ const je = class je extends xe {
|
|
|
1665
1664
|
`, super.connectedCallback(), y(this, Mt, this.querySelector("input"));
|
|
1666
1665
|
}
|
|
1667
1666
|
};
|
|
1668
|
-
Mt = new WeakMap(),
|
|
1667
|
+
Mt = new WeakMap(), nt = new WeakMap(), ut = new WeakMap(), bt = new WeakMap(), ne = new WeakMap(), U = new WeakMap(), Le = new WeakMap(), h(je, "CellInputText");
|
|
1669
1668
|
let we = je;
|
|
1670
1669
|
customElements.get("cell-input-text");
|
|
1671
1670
|
customElements.get("cell-input") || customElements.define("cell-input", we);
|