@ninebone/table 0.0.368 β 0.0.369
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 +151 -150
- package/dist/nine-table.js.map +1 -1
- package/dist/nine-table.umd.js +5 -5
- package/dist/nine-table.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/nine-table.js
CHANGED
|
@@ -5,10 +5,10 @@ var ge = (m) => {
|
|
|
5
5
|
var me = (m, i, e) => i in m ? be(m, i, { enumerable: !0, configurable: !0, writable: !0, value: e }) : m[i] = e;
|
|
6
6
|
var a = (m, i) => be(m, "name", { value: i, configurable: !0 });
|
|
7
7
|
var x = (m, i, e) => me(m, typeof i != "symbol" ? i + "" : i, e), ye = (m, i, e) => i.has(m) || ge("Cannot " + e);
|
|
8
|
-
var t = (m, i, e) => (ye(m, i, "read from private field"), e ? e.call(m) : i.get(m)), c = (m, i, e) => i.has(m) ? ge("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(m) : i.set(m, e),
|
|
8
|
+
var t = (m, i, e) => (ye(m, i, "read from private field"), e ? e.call(m) : i.get(m)), c = (m, i, e) => i.has(m) ? ge("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(m) : i.set(m, e), g = (m, i, e, s) => (ye(m, i, "write to private field"), s ? s.call(m, e) : i.set(m, e), e);
|
|
9
9
|
var pe = (m, i, e, s) => ({
|
|
10
10
|
set _(o) {
|
|
11
|
-
|
|
11
|
+
g(m, i, o, e);
|
|
12
12
|
},
|
|
13
13
|
get _() {
|
|
14
14
|
return t(m, i, s);
|
|
@@ -36,7 +36,7 @@ const oe = class oe extends HTMLElement {
|
|
|
36
36
|
c(this, vt, /* @__PURE__ */ a(() => {
|
|
37
37
|
if (!t(this, _)) return;
|
|
38
38
|
const e = t(this, _).querySelector(".ng-container-body");
|
|
39
|
-
e && (
|
|
39
|
+
e && (g(this, Y, new ResizeObserver(() => {
|
|
40
40
|
this.refresh();
|
|
41
41
|
})), t(this, Y).observe(e));
|
|
42
42
|
}, "#observeResize"));
|
|
@@ -55,9 +55,9 @@ const oe = class oe extends HTMLElement {
|
|
|
55
55
|
if (d <= 0) return;
|
|
56
56
|
const f = Math.max(Math.min(d * (l / h), d), 20);
|
|
57
57
|
r.style.width = `${f}px`;
|
|
58
|
-
const u = e.scrollLeft,
|
|
58
|
+
const u = e.scrollLeft, b = h - l;
|
|
59
59
|
let y = 0;
|
|
60
|
-
|
|
60
|
+
b > 0 && (y = parseInt(u / b * (d - f), 10)), y < 0 && (y = 0);
|
|
61
61
|
const w = d - f;
|
|
62
62
|
y > w && (y = w), r.style.left = `${y}px`, W.log(y), t(this, p).left.disabled = y === 0, t(this, p).right.disabled = y >= w - 1;
|
|
63
63
|
}, "refresh"));
|
|
@@ -77,8 +77,8 @@ const oe = class oe extends HTMLElement {
|
|
|
77
77
|
const e = /* @__PURE__ */ a((o) => {
|
|
78
78
|
clearInterval(t(this, N)), clearInterval(t(this, P));
|
|
79
79
|
const r = parseInt(t(this, p).thumb.style.left || 0, 10);
|
|
80
|
-
t(this, V).call(this, r + o),
|
|
81
|
-
clearInterval(t(this, N)),
|
|
80
|
+
t(this, V).call(this, r + o), g(this, N, setInterval(() => {
|
|
81
|
+
clearInterval(t(this, N)), g(this, P, setInterval(() => {
|
|
82
82
|
const n = parseInt(t(this, p).thumb.style.left || 0, 10);
|
|
83
83
|
t(this, V).call(this, n + o) || clearInterval(t(this, P));
|
|
84
84
|
}, 50));
|
|
@@ -99,20 +99,20 @@ const oe = class oe extends HTMLElement {
|
|
|
99
99
|
t(this, V).call(this, o.clientX - r.left - n / 2);
|
|
100
100
|
}), t(this, p).thumb.addEventListener("mousedown", (o) => {
|
|
101
101
|
if (o.button !== 0) return;
|
|
102
|
-
o.stopPropagation(), o.preventDefault(),
|
|
102
|
+
o.stopPropagation(), o.preventDefault(), g(this, O, !0), this.shiftX = o.clientX - t(this, p).thumb.getBoundingClientRect().left;
|
|
103
103
|
const r = /* @__PURE__ */ a((l) => {
|
|
104
104
|
if (!t(this, O)) return;
|
|
105
105
|
const h = t(this, p).track.getBoundingClientRect();
|
|
106
106
|
t(this, V).call(this, l.clientX - h.left - this.shiftX);
|
|
107
107
|
}, "onMouseMove"), n = /* @__PURE__ */ a(() => {
|
|
108
|
-
|
|
108
|
+
g(this, O, !1), s(), document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", n), this.refresh();
|
|
109
109
|
}, "onMouseUp");
|
|
110
110
|
document.addEventListener("mousemove", r), document.addEventListener("mouseup", n);
|
|
111
111
|
});
|
|
112
112
|
}, "#init"));
|
|
113
113
|
}
|
|
114
114
|
connectedCallback() {
|
|
115
|
-
if (
|
|
115
|
+
if (g(this, _, this.closest("nine-table-sheet") || this.getRootNode().host), !t(this, _)) return;
|
|
116
116
|
this.innerHTML = `
|
|
117
117
|
<style>
|
|
118
118
|
nine-table-hscrollbar {
|
|
@@ -182,7 +182,7 @@ const oe = class oe extends HTMLElement {
|
|
|
182
182
|
setTimeout(e, 10);
|
|
183
183
|
return;
|
|
184
184
|
}
|
|
185
|
-
|
|
185
|
+
g(this, p, {
|
|
186
186
|
container: s,
|
|
187
187
|
track: this.querySelector(".ng-scroll-track"),
|
|
188
188
|
thumb: this.querySelector(".ng-scroll-thumb"),
|
|
@@ -228,10 +228,10 @@ const re = class re extends HTMLElement {
|
|
|
228
228
|
const d = Math.max(Math.min(h * (n / l), h), 20);
|
|
229
229
|
r.style.height = `${d}px`;
|
|
230
230
|
const f = e.scrollTop, u = l - n;
|
|
231
|
-
let
|
|
232
|
-
u > 0 && (
|
|
231
|
+
let b = 0;
|
|
232
|
+
u > 0 && (b = f / u * (h - d));
|
|
233
233
|
const y = h - d;
|
|
234
|
-
|
|
234
|
+
b < 0 && (b = 0), b > y && (b = y), r.style.top = `${b}px`, t(this, S).top.disabled = f <= 0, t(this, S).bottom.disabled = f >= u - 1;
|
|
235
235
|
}, "refresh"));
|
|
236
236
|
c(this, St, /* @__PURE__ */ a(() => {
|
|
237
237
|
const e = t(this, S).container;
|
|
@@ -239,27 +239,27 @@ const re = class re extends HTMLElement {
|
|
|
239
239
|
t(this, z) || this.refresh();
|
|
240
240
|
}), t(this, S).thumb.addEventListener("mousedown", (s) => {
|
|
241
241
|
if (s.button !== 0) return;
|
|
242
|
-
s.stopPropagation(), s.preventDefault(),
|
|
242
|
+
s.stopPropagation(), s.preventDefault(), g(this, z, !0), g(this, lt, s.clientY), g(this, at, e.scrollTop);
|
|
243
243
|
const o = /* @__PURE__ */ a((n) => {
|
|
244
244
|
if (!t(this, z)) return;
|
|
245
|
-
const l = t(this, S).track.getBoundingClientRect(), h = t(this, S).thumb.clientHeight, f = l.height - h, u = n.clientY - t(this, lt),
|
|
245
|
+
const l = t(this, S).track.getBoundingClientRect(), h = t(this, S).thumb.clientHeight, f = l.height - h, u = n.clientY - t(this, lt), b = e.clientHeight, y = e.querySelector("table");
|
|
246
246
|
W.log(y), W.log(y.scrollHeight);
|
|
247
|
-
const
|
|
248
|
-
if (f > 0 &&
|
|
249
|
-
const
|
|
250
|
-
e.scrollTop = t(this, at) +
|
|
247
|
+
const k = y.scrollHeight - b;
|
|
248
|
+
if (f > 0 && k > 0) {
|
|
249
|
+
const mt = u / f * k;
|
|
250
|
+
e.scrollTop = t(this, at) + mt;
|
|
251
251
|
}
|
|
252
252
|
this.refresh();
|
|
253
253
|
}, "onMouseMove"), r = /* @__PURE__ */ a(() => {
|
|
254
|
-
|
|
254
|
+
g(this, z, !1), document.removeEventListener("mousemove", o), document.removeEventListener("mouseup", r), this.refresh();
|
|
255
255
|
}, "onMouseUp");
|
|
256
256
|
document.addEventListener("mousemove", o), document.addEventListener("mouseup", r);
|
|
257
257
|
}), t(this, S).track.addEventListener("mousedown", (s) => {
|
|
258
258
|
if (s.button !== 0 || s.target === t(this, S).thumb) return;
|
|
259
259
|
const o = t(this, S).track.getBoundingClientRect(), r = t(this, S).thumb.clientHeight, n = s.clientY - o.top - r / 2, h = o.height - r, d = e.clientHeight, u = e.querySelector("table").scrollHeight - d;
|
|
260
260
|
if (h > 0 && u > 0) {
|
|
261
|
-
const
|
|
262
|
-
e.scrollTop =
|
|
261
|
+
const b = Math.max(0, Math.min(1, n / h));
|
|
262
|
+
e.scrollTop = b * u;
|
|
263
263
|
}
|
|
264
264
|
this.refresh();
|
|
265
265
|
}), t(this, S).top.addEventListener("click", () => {
|
|
@@ -270,7 +270,7 @@ const re = class re extends HTMLElement {
|
|
|
270
270
|
}, "#init"));
|
|
271
271
|
}
|
|
272
272
|
connectedCallback() {
|
|
273
|
-
if (
|
|
273
|
+
if (g(this, X, this.closest("nine-table-sheet") || this.getRootNode().host), !t(this, X)) return;
|
|
274
274
|
this.innerHTML = `
|
|
275
275
|
<style>
|
|
276
276
|
nine-table-vscrollbar {
|
|
@@ -340,7 +340,7 @@ const re = class re extends HTMLElement {
|
|
|
340
340
|
setTimeout(e, 10);
|
|
341
341
|
return;
|
|
342
342
|
}
|
|
343
|
-
|
|
343
|
+
g(this, S, {
|
|
344
344
|
container: s,
|
|
345
345
|
track: this.querySelector(".ng-scroll-track"),
|
|
346
346
|
thumb: this.querySelector(".ng-scroll-thumb"),
|
|
@@ -354,7 +354,7 @@ const re = class re extends HTMLElement {
|
|
|
354
354
|
X = new WeakMap(), z = new WeakMap(), S = new WeakMap(), lt = new WeakMap(), at = new WeakMap(), St = new WeakMap(), a(re, "NineTableVScrollBar");
|
|
355
355
|
let jt = re;
|
|
356
356
|
customElements.get("nine-table-vscrollbar") || customElements.define("nine-table-vscrollbar", jt);
|
|
357
|
-
var Et,
|
|
357
|
+
var Et, G;
|
|
358
358
|
const C = class C {
|
|
359
359
|
/**
|
|
360
360
|
* π― λ μ΄μμ λ΄μ μ¬λ¬ rawTables λ°°μ΄μ μΌκ΄λ‘ λ°μ λ¨μΌ λ§μ€ν° ν
νλ¦ΏμΌλ‘ μ¬μ μ»΄νμΌν©λλ€.
|
|
@@ -369,7 +369,7 @@ const C = class C {
|
|
|
369
369
|
var o, r, n, l;
|
|
370
370
|
if (!i) return null;
|
|
371
371
|
const e = i.cloneNode(!0);
|
|
372
|
-
return t(o = C, Et).call(o, e), t(r = C,
|
|
372
|
+
return t(o = C, Et).call(o, e), t(r = C, G).call(r, e, "thead"), t(n = C, G).call(n, e, "tbody"), t(l = C, G).call(l, e, "tfoot"), Array.from(e.querySelectorAll("colgroup col")).forEach((h, d) => {
|
|
373
373
|
const f = h.getAttribute("fixed");
|
|
374
374
|
f && e.querySelectorAll(`thead [data-col="${d}"], tbody [data-col="${d}"], tfoot [data-col="${d}"]`).forEach((u) => {
|
|
375
375
|
u.setAttribute("fixed", f);
|
|
@@ -377,7 +377,7 @@ const C = class C {
|
|
|
377
377
|
}), e;
|
|
378
378
|
}
|
|
379
379
|
};
|
|
380
|
-
Et = new WeakMap(),
|
|
380
|
+
Et = new WeakMap(), G = new WeakMap(), a(C, "TableCompiler"), c(C, Et, /* @__PURE__ */ a((i) => {
|
|
381
381
|
if (!i.querySelector("colgroup")) {
|
|
382
382
|
const e = i.querySelector("tbody tr") || i.querySelector("tr"), s = e ? e.querySelectorAll("th, td").length : 1, o = document.createElement("colgroup"), r = Math.max(Math.floor(i.clientWidth / s), 100);
|
|
383
383
|
for (let n = 0; n < s; n++) {
|
|
@@ -391,7 +391,7 @@ Et = new WeakMap(), J = new WeakMap(), a(C, "TableCompiler"), c(C, Et, /* @__PUR
|
|
|
391
391
|
s ? s.after(e) : i.prepend(e);
|
|
392
392
|
}
|
|
393
393
|
i.classList.add("nine-table-element"), i.style.display = "table";
|
|
394
|
-
}, "#ensureTableStructure")), c(C,
|
|
394
|
+
}, "#ensureTableStructure")), c(C, G, /* @__PURE__ */ a((i, e) => {
|
|
395
395
|
const s = Array.from(i.querySelectorAll(e + " tr")), o = Array.from(i.querySelectorAll(e + " th," + e + " td")), r = s.length;
|
|
396
396
|
if (r === 0 || o.length === 0) return;
|
|
397
397
|
let n = 0;
|
|
@@ -408,10 +408,10 @@ Et = new WeakMap(), J = new WeakMap(), a(C, "TableCompiler"), c(C, Et, /* @__PUR
|
|
|
408
408
|
f = w;
|
|
409
409
|
break;
|
|
410
410
|
}
|
|
411
|
-
const
|
|
412
|
-
for (let w = 0; w <
|
|
413
|
-
for (let
|
|
414
|
-
d + w < r && f +
|
|
411
|
+
const b = u.rowSpan || 1, y = u.colSpan || 1;
|
|
412
|
+
for (let w = 0; w < b; w++)
|
|
413
|
+
for (let k = 0; k < y; k++)
|
|
414
|
+
d + w < r && f + k < n && (l[d + w][f + k] = w === 0 && k === 0 ? "1" : "0");
|
|
415
415
|
});
|
|
416
416
|
}), s.forEach((h) => {
|
|
417
417
|
const d = h.sectionRowIndex;
|
|
@@ -425,25 +425,25 @@ Et = new WeakMap(), J = new WeakMap(), a(C, "TableCompiler"), c(C, Et, /* @__PUR
|
|
|
425
425
|
});
|
|
426
426
|
}, "#resetColIndex"));
|
|
427
427
|
let Kt = C;
|
|
428
|
-
var
|
|
428
|
+
var M, v, I, A, B, U, J, Q, Rt, At, qt, ct, ht, Tt, kt, dt, Lt, tt, ft;
|
|
429
429
|
const le = class le {
|
|
430
430
|
constructor(i) {
|
|
431
|
-
c(this,
|
|
431
|
+
c(this, M);
|
|
432
432
|
c(this, v);
|
|
433
|
-
c(this,
|
|
434
|
-
c(this,
|
|
433
|
+
c(this, I, /* @__PURE__ */ new Map());
|
|
434
|
+
c(this, A, null);
|
|
435
435
|
c(this, B, null);
|
|
436
436
|
c(this, U, 0);
|
|
437
|
-
c(this,
|
|
437
|
+
c(this, J, 40);
|
|
438
438
|
c(this, Q, !1);
|
|
439
439
|
c(this, Rt, 3);
|
|
440
440
|
x(this, "refresh", /* @__PURE__ */ a(() => {
|
|
441
441
|
var e;
|
|
442
442
|
const i = t(this, v).querySelector(".ng-container-body");
|
|
443
|
-
i && (t(this,
|
|
443
|
+
i && (t(this, ct).call(this), t(this, tt).call(this, i.scrollTop), (e = t(this, v).querySelector("nine-table-vscrollbar")) == null || e.refresh());
|
|
444
444
|
}, "refresh"));
|
|
445
445
|
x(this, "initialize", /* @__PURE__ */ a(() => {
|
|
446
|
-
|
|
446
|
+
g(this, A, null), t(this, I).clear(), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((o) => {
|
|
447
447
|
const r = t(this, v).querySelector(o);
|
|
448
448
|
if (!r) return;
|
|
449
449
|
const n = r.querySelector("table");
|
|
@@ -451,11 +451,11 @@ const le = class le {
|
|
|
451
451
|
const l = n.querySelector("tbody.bindable-tbody");
|
|
452
452
|
if (!l) return;
|
|
453
453
|
const d = Array.from(l.querySelectorAll("tr")).map((f) => f.cloneNode(!0));
|
|
454
|
-
t(this,
|
|
454
|
+
t(this, I).set(o, d);
|
|
455
455
|
});
|
|
456
456
|
const i = t(this, v).querySelector(".ng-container-body"), e = t(this, v).querySelector(".ng-container-left"), s = t(this, v).querySelector(".ng-container-right");
|
|
457
457
|
if (i) {
|
|
458
|
-
t(this, qt).call(this, i), t(this,
|
|
458
|
+
t(this, qt).call(this, i), t(this, dt).call(this), t(this, ct).call(this), t(this, tt).call(this, i.scrollTop);
|
|
459
459
|
let o = i.scrollTop;
|
|
460
460
|
const r = /* @__PURE__ */ a((n) => {
|
|
461
461
|
var l;
|
|
@@ -468,50 +468,51 @@ const le = class le {
|
|
|
468
468
|
}
|
|
469
469
|
}, "initialize"));
|
|
470
470
|
c(this, At, /* @__PURE__ */ a((i, e) => {
|
|
471
|
-
const s = t(this,
|
|
471
|
+
const s = t(this, I).get(e);
|
|
472
472
|
if (!s || s.length === 0) return;
|
|
473
473
|
const o = i.querySelector("tbody.bindable-tbody");
|
|
474
474
|
if (!o) return;
|
|
475
475
|
o.querySelectorAll("tr:not(.nodata)").forEach((l) => l.remove());
|
|
476
476
|
const r = o.querySelector("tr.nodata"), n = document.createDocumentFragment();
|
|
477
|
-
for (let l = 0; l < t(this,
|
|
477
|
+
for (let l = 0; l < t(this, J); l++)
|
|
478
478
|
s.forEach((h) => {
|
|
479
479
|
n.appendChild(h.cloneNode(!0));
|
|
480
480
|
});
|
|
481
481
|
r ? r.before(n) : o.appendChild(n);
|
|
482
482
|
}, "#renderRows"));
|
|
483
483
|
c(this, qt, /* @__PURE__ */ a((i) => {
|
|
484
|
-
if (t(this,
|
|
485
|
-
return t(this,
|
|
486
|
-
const e = t(this,
|
|
484
|
+
if (t(this, A) !== null && t(this, A) > 0)
|
|
485
|
+
return t(this, A);
|
|
486
|
+
const e = t(this, I).get(".ng-container-body");
|
|
487
487
|
if (!e || e.length === 0) return 24;
|
|
488
488
|
const s = i.querySelector("tbody.bindable-tbody") || i.querySelector("tbody.bindable-tbody:last-of-type");
|
|
489
489
|
if (!s) return 24;
|
|
490
|
-
s.querySelectorAll("tr:not(.nodata)").forEach((
|
|
490
|
+
s.querySelectorAll("tr:not(.nodata)").forEach((b) => b.remove());
|
|
491
491
|
const o = s.querySelector("tr.nodata"), r = document.createDocumentFragment();
|
|
492
|
-
e.forEach((
|
|
493
|
-
r.appendChild(
|
|
492
|
+
e.forEach((b) => {
|
|
493
|
+
r.appendChild(b.cloneNode(!0));
|
|
494
494
|
}), o ? o.before(r) : s.appendChild(r);
|
|
495
495
|
const n = t(this, v), l = n.style.display, h = n.style.visibility, d = n.style.position;
|
|
496
496
|
(l === "none" || window.getComputedStyle(n).display === "none") && (n.style.display = "block", n.style.visibility = "hidden", n.style.position = "absolute");
|
|
497
497
|
let f = 0;
|
|
498
498
|
const u = s.querySelectorAll("tr:not(.nodata)");
|
|
499
|
-
return u.forEach((
|
|
500
|
-
f +=
|
|
501
|
-
}), u.forEach((
|
|
499
|
+
return u.forEach((b) => {
|
|
500
|
+
f += b.offsetHeight || b.getBoundingClientRect().height;
|
|
501
|
+
}), u.forEach((b) => b.remove()), n.style.display = l, n.style.visibility = h, n.style.position = d, g(this, A, f > 0 ? f : 24), t(this, ht).call(this), t(this, A);
|
|
502
502
|
}, "#measureAndCacheHeight"));
|
|
503
|
-
c(this,
|
|
503
|
+
c(this, ct, /* @__PURE__ */ a(() => {
|
|
504
504
|
if (!t(this, v).querySelector(".ng-container-body")) return;
|
|
505
|
-
const e = t(this,
|
|
505
|
+
const e = t(this, M).data.get() || [], s = e.length > 0 ? e.length : 100, o = t(this, A), r = s * o;
|
|
506
506
|
W.log(":", s, r), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((n) => {
|
|
507
507
|
const l = t(this, v).querySelector(n), h = l == null ? void 0 : l.querySelector("table");
|
|
508
508
|
h && (h.style.height = `${r}px`);
|
|
509
509
|
});
|
|
510
510
|
}, "#updateVirtualScrollHeight"));
|
|
511
|
-
c(this,
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
511
|
+
c(this, ht, /* @__PURE__ */ a(() => {
|
|
512
|
+
const e = (t(this, M).data.get() || []).length;
|
|
513
|
+
if (t(this, U) > 0 && t(this, A) > 0) {
|
|
514
|
+
const s = Math.ceil(t(this, U) / t(this, A));
|
|
515
|
+
g(this, J, Math.min(e, s + t(this, Rt))), W.log(s, t(this, J));
|
|
515
516
|
}
|
|
516
517
|
}, "#updateRowCount"));
|
|
517
518
|
c(this, Tt, /* @__PURE__ */ a(() => {
|
|
@@ -520,16 +521,16 @@ const le = class le {
|
|
|
520
521
|
if (!e) return;
|
|
521
522
|
const o = i ? Array.from(i.querySelectorAll("tr")) : [], r = Array.from(e.querySelectorAll("tr")), n = s ? Array.from(s.querySelectorAll("tr")) : [], l = Math.max(o.length, r.length, n.length);
|
|
522
523
|
for (let u = 0; u < l; u++) {
|
|
523
|
-
const
|
|
524
|
+
const b = [
|
|
524
525
|
((h = o[u]) == null ? void 0 : h.getBoundingClientRect().height) || 0,
|
|
525
526
|
((d = r[u]) == null ? void 0 : d.getBoundingClientRect().height) || 0,
|
|
526
527
|
((f = n[u]) == null ? void 0 : f.getBoundingClientRect().height) || 0
|
|
527
|
-
], y = Math.max(...
|
|
528
|
+
], y = Math.max(...b);
|
|
528
529
|
y > 0 && (o[u] && (o[u].style.height = `${y}px`), r[u] && (r[u].style.height = `${y}px`), n[u] && (n[u].style.height = `${y}px`));
|
|
529
530
|
}
|
|
530
531
|
}, "#syncRowHeights"));
|
|
531
532
|
c(this, kt, /* @__PURE__ */ a(() => {
|
|
532
|
-
!t(this, v) || !(t(this, v) instanceof HTMLElement) || (
|
|
533
|
+
!t(this, v) || !(t(this, v) instanceof HTMLElement) || (g(this, B, new ResizeObserver((i) => {
|
|
533
534
|
for (const e of i) {
|
|
534
535
|
const s = e.target;
|
|
535
536
|
if (!s.classList.contains("active")) continue;
|
|
@@ -539,12 +540,12 @@ const le = class le {
|
|
|
539
540
|
const n = s.querySelector("thead");
|
|
540
541
|
n && (r += n.offsetHeight || n.getBoundingClientRect().height);
|
|
541
542
|
const l = Math.max(o - r, 100);
|
|
542
|
-
t(this, U) !== l && (
|
|
543
|
+
t(this, U) !== l && (g(this, U, l), t(this, ht).call(this), t(this, A) !== null && t(this, dt).call(this));
|
|
543
544
|
}
|
|
544
545
|
}
|
|
545
546
|
})), t(this, B).observe(t(this, v)));
|
|
546
547
|
}, "#initResizeObserver"));
|
|
547
|
-
c(this,
|
|
548
|
+
c(this, dt, /* @__PURE__ */ a(() => {
|
|
548
549
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((i) => {
|
|
549
550
|
const e = t(this, v).querySelector(i);
|
|
550
551
|
e && e.querySelector("tbody.bindable-tbody") && t(this, At).call(this, e, i);
|
|
@@ -557,61 +558,61 @@ const le = class le {
|
|
|
557
558
|
if (!s) return;
|
|
558
559
|
const o = s.querySelector("tbody.bindable-tbody");
|
|
559
560
|
if (!o) return;
|
|
560
|
-
const r = Array.from(o.querySelectorAll("tr:not(.nodata)")), n = ((d = t(this,
|
|
561
|
+
const r = Array.from(o.querySelectorAll("tr:not(.nodata)")), n = ((d = t(this, I).get(e)) == null ? void 0 : d.length) || 1, h = (t(this, M).data.get() || []).length;
|
|
561
562
|
r.forEach((f, u) => {
|
|
562
|
-
const
|
|
563
|
-
if (
|
|
563
|
+
const b = i + Math.floor(u / n);
|
|
564
|
+
if (b >= h) {
|
|
564
565
|
f.style.display = "none";
|
|
565
566
|
return;
|
|
566
567
|
}
|
|
567
|
-
const
|
|
568
|
-
f.style.display = "", t(this,
|
|
568
|
+
const y = t(this, M).data.get(b);
|
|
569
|
+
f.style.display = "", t(this, ft).call(this, f, y, b);
|
|
569
570
|
});
|
|
570
571
|
});
|
|
571
572
|
}, "#adjustBufferRows"));
|
|
572
573
|
c(this, tt, /* @__PURE__ */ a((i) => {
|
|
573
574
|
var l;
|
|
574
|
-
const e = t(this,
|
|
575
|
+
const e = t(this, A);
|
|
575
576
|
if (!e || e <= 0) return;
|
|
576
|
-
const s = Math.max(0, Math.floor(i / e)), o = ((l = t(this,
|
|
577
|
+
const s = Math.max(0, Math.floor(i / e)), o = ((l = t(this, I).get(".ng-container-body")) == null ? void 0 : l.length) || 1, n = (t(this, M).data.get() || []).length;
|
|
577
578
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((h) => {
|
|
578
579
|
const d = t(this, v).querySelector(h);
|
|
579
580
|
if (!d) return;
|
|
580
581
|
const f = d.querySelector("tbody.bindable-tbody");
|
|
581
582
|
if (!f) return;
|
|
582
|
-
Array.from(f.querySelectorAll("tr:not(.nodata)")).forEach((
|
|
583
|
-
const w = s + Math.floor(y / o)
|
|
584
|
-
if (
|
|
585
|
-
|
|
583
|
+
Array.from(f.querySelectorAll("tr:not(.nodata)")).forEach((b, y) => {
|
|
584
|
+
const w = s + Math.floor(y / o);
|
|
585
|
+
if (w >= n) {
|
|
586
|
+
b.style.display = "none";
|
|
586
587
|
return;
|
|
587
588
|
}
|
|
588
|
-
const
|
|
589
|
-
|
|
589
|
+
const k = t(this, M).data.get(w);
|
|
590
|
+
b.style.display = "", t(this, ft).call(this, b, k, w);
|
|
590
591
|
});
|
|
591
|
-
}), t(this, Q) || (
|
|
592
|
-
t(this, Lt).call(this, s),
|
|
592
|
+
}), t(this, Q) || (g(this, Q, !0), setTimeout(() => {
|
|
593
|
+
t(this, Lt).call(this, s), g(this, Q, !1);
|
|
593
594
|
}, 0));
|
|
594
595
|
}, "#handleScroll"));
|
|
595
|
-
c(this,
|
|
596
|
+
c(this, ft, /* @__PURE__ */ a((i, e, s) => {
|
|
596
597
|
i.dataset.row = s, Array.from(i.cells).forEach((o, r) => {
|
|
597
598
|
const n = o.dataset.bind;
|
|
598
599
|
n && e && e[n] !== void 0 ? o.textContent = e[n] : o.textContent = e ? e[Object.keys(e)[r]] ?? `R${s}C${r}` : `ν ${s + 1}`, o.dataset.row = s;
|
|
599
600
|
});
|
|
600
601
|
}, "#bindRowData"));
|
|
601
602
|
x(this, "destroy", /* @__PURE__ */ a(() => {
|
|
602
|
-
t(this, B) && (t(this, B).disconnect(),
|
|
603
|
+
t(this, B) && (t(this, B).disconnect(), g(this, B, null));
|
|
603
604
|
}, "destroy"));
|
|
604
|
-
|
|
605
|
+
g(this, M, i.getRootNode().host), g(this, v, i), t(this, kt).call(this);
|
|
605
606
|
}
|
|
606
607
|
getRowHeight() {
|
|
607
|
-
return t(this,
|
|
608
|
+
return t(this, A);
|
|
608
609
|
}
|
|
609
610
|
templateLength(i = ".ng-container-body") {
|
|
610
611
|
var e;
|
|
611
|
-
return ((e = t(this,
|
|
612
|
+
return ((e = t(this, I).get(i)) == null ? void 0 : e.length) || 1;
|
|
612
613
|
}
|
|
613
614
|
};
|
|
614
|
-
|
|
615
|
+
M = new WeakMap(), v = new WeakMap(), I = new WeakMap(), A = new WeakMap(), B = new WeakMap(), U = new WeakMap(), J = new WeakMap(), Q = new WeakMap(), Rt = new WeakMap(), At = new WeakMap(), qt = new WeakMap(), ct = new WeakMap(), ht = new WeakMap(), Tt = new WeakMap(), kt = new WeakMap(), dt = new WeakMap(), Lt = new WeakMap(), tt = new WeakMap(), ft = new WeakMap(), a(le, "RowManager");
|
|
615
616
|
let Zt = le;
|
|
616
617
|
var Ht, et, F, Ct, _t, Mt, It, $t;
|
|
617
618
|
const rt = class rt extends HTMLElement {
|
|
@@ -651,7 +652,7 @@ const rt = class rt extends HTMLElement {
|
|
|
651
652
|
});
|
|
652
653
|
}, "#updateContainerWidths"));
|
|
653
654
|
x(this, "generate", /* @__PURE__ */ a((e) => {
|
|
654
|
-
e && (
|
|
655
|
+
e && (g(this, et, Kt.compile(e)), t(this, et).style.display = "table", t(this, Ct).call(this), t(this, _t).call(this), requestAnimationFrame(() => {
|
|
655
656
|
var o;
|
|
656
657
|
const s = (o = this.querySelector("thead")) == null ? void 0 : o.getBoundingClientRect().height;
|
|
657
658
|
this.querySelectorAll("tbody.fixed-tbody").forEach((r) => {
|
|
@@ -838,7 +839,7 @@ const rt = class rt extends HTMLElement {
|
|
|
838
839
|
</div>
|
|
839
840
|
`;
|
|
840
841
|
}, "#render"));
|
|
841
|
-
|
|
842
|
+
g(this, F, new Zt(this)), g(this, Ht, this.getRootNode().host);
|
|
842
843
|
}
|
|
843
844
|
connectedCallback() {
|
|
844
845
|
t(this, It).call(this);
|
|
@@ -850,7 +851,7 @@ const rt = class rt extends HTMLElement {
|
|
|
850
851
|
Ht = new WeakMap(), et = new WeakMap(), F = new WeakMap(), Ct = new WeakMap(), _t = new WeakMap(), Mt = new WeakMap(), It = new WeakMap(), $t = new WeakMap(), a(rt, "NineTableSheet"), x(rt, "SCROLLBAR_SIZE", 16);
|
|
851
852
|
let xt = rt;
|
|
852
853
|
customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet", xt);
|
|
853
|
-
var Wt,
|
|
854
|
+
var Wt, ut;
|
|
854
855
|
const ae = class ae extends HTMLElement {
|
|
855
856
|
constructor() {
|
|
856
857
|
super();
|
|
@@ -859,17 +860,17 @@ const ae = class ae extends HTMLElement {
|
|
|
859
860
|
(e = this.querySelector(".nine-tab-bar")) == null || e.addEventListener("click", (s) => {
|
|
860
861
|
var n;
|
|
861
862
|
const o = s.ctrlKey || s.metaKey || s.shiftKey, r = parseInt((n = s.target.closest(".nine-tab-item")) == null ? void 0 : n.dataset.index, 10);
|
|
862
|
-
t(this,
|
|
863
|
-
}), t(this,
|
|
863
|
+
t(this, ut).call(this, r, o);
|
|
864
|
+
}), t(this, ut).call(this, 0, !1);
|
|
864
865
|
}, "#init"));
|
|
865
|
-
c(this,
|
|
866
|
+
c(this, ut, /* @__PURE__ */ a((e, s = !1) => {
|
|
866
867
|
const o = /* @__PURE__ */ a(() => {
|
|
867
868
|
const f = Array.from(this.querySelectorAll("nine-table-sheet"));
|
|
868
869
|
Array.from(this.querySelectorAll("nine-splitter")).forEach((y) => y.style.setProperty("display", "none"));
|
|
869
|
-
const
|
|
870
|
-
|
|
871
|
-
const w = parseInt(y.getAttribute("data-index"), 10),
|
|
872
|
-
|
|
870
|
+
const b = f.filter((y) => y.classList.contains("active"));
|
|
871
|
+
b.length < 2 || b.forEach((y) => {
|
|
872
|
+
const w = parseInt(y.getAttribute("data-index"), 10), k = this.querySelector(`nine-splitter[data-split-index="${w}"]`), mt = f[w + 1];
|
|
873
|
+
k && mt && mt.classList.contains("active") && k.style.setProperty("display", "flex");
|
|
873
874
|
});
|
|
874
875
|
}, "updateSplitters"), r = this.querySelector(".nine-tab-bar"), n = this.querySelector("nine-table-sheets-body"), l = r.querySelectorAll(".nine-tab-item"), h = n.querySelectorAll("nine-table-sheet");
|
|
875
876
|
if (!l[e]) return;
|
|
@@ -877,16 +878,16 @@ const ae = class ae extends HTMLElement {
|
|
|
877
878
|
l.forEach((f, u) => {
|
|
878
879
|
f.classList.toggle("active", u === e);
|
|
879
880
|
}), h.forEach((f, u) => {
|
|
880
|
-
const
|
|
881
|
-
f.classList.toggle("active",
|
|
881
|
+
const b = u === e;
|
|
882
|
+
f.classList.toggle("active", b), f.style.flex = b ? "1 1 100%" : "";
|
|
882
883
|
});
|
|
883
884
|
else {
|
|
884
885
|
const f = l[e], u = r.querySelectorAll(".nine-tab-item.active");
|
|
885
886
|
if (f.classList.contains("active") && u.length <= 1)
|
|
886
887
|
return;
|
|
887
888
|
f.classList.toggle("active");
|
|
888
|
-
const
|
|
889
|
-
|
|
889
|
+
const b = n.querySelector(`nine-table-sheet[data-index="${e}"]`);
|
|
890
|
+
b && (b.classList.toggle("active"), b.classList.contains("active") || (b.style.flex = ""));
|
|
890
891
|
}
|
|
891
892
|
const d = n.querySelectorAll("nine-table-sheet.active");
|
|
892
893
|
d == null || d.forEach((f) => {
|
|
@@ -898,32 +899,32 @@ const ae = class ae extends HTMLElement {
|
|
|
898
899
|
t(this, Wt).call(this);
|
|
899
900
|
}
|
|
900
901
|
};
|
|
901
|
-
Wt = new WeakMap(),
|
|
902
|
+
Wt = new WeakMap(), ut = new WeakMap(), a(ae, "NineTableSheets");
|
|
902
903
|
let Gt = ae;
|
|
903
904
|
customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets", Gt);
|
|
904
|
-
var
|
|
905
|
+
var q, Ot, bt, zt;
|
|
905
906
|
const ce = class ce {
|
|
906
907
|
constructor(i) {
|
|
907
|
-
c(this,
|
|
908
|
+
c(this, q);
|
|
908
909
|
c(this, Ot, /* @__PURE__ */ a(() => {
|
|
909
910
|
t(this, zt).call(this), new ResizeObserver((i) => {
|
|
910
911
|
for (let e of i)
|
|
911
|
-
t(this,
|
|
912
|
-
}).observe(t(this,
|
|
912
|
+
t(this, q).getAttribute("auto-height") === "true" && t(this, bt).call(this);
|
|
913
|
+
}).observe(t(this, q));
|
|
913
914
|
}, "#init"));
|
|
914
|
-
c(this,
|
|
915
|
+
c(this, bt, /* @__PURE__ */ a(() => {
|
|
915
916
|
var h, d;
|
|
916
|
-
const i = Array.from(t(this,
|
|
917
|
+
const i = Array.from(t(this, q).shadowRoot.querySelectorAll("nine-table-sheet.active"));
|
|
917
918
|
if (i.length === 0) return;
|
|
918
|
-
const e = parseInt(t(this,
|
|
919
|
-
t(this,
|
|
919
|
+
const e = parseInt(t(this, q).getAttribute("max-display-row"), 10) || 10, s = Math.max(...i.map((f) => f.getRowHeight())), o = (h = t(this, q).shadowRoot.querySelector("nine-table-header")) == null ? void 0 : h.getBoundingClientRect().height, r = (d = t(this, q).shadowRoot.querySelector("nine-table-sheets-footer")) == null ? void 0 : d.getBoundingClientRect().height, n = xt.SCROLLBAR_SIZE, l = e * s + o + r + n;
|
|
920
|
+
t(this, q).style.height = `${l}px`;
|
|
920
921
|
}, "#applyAutoHeight"));
|
|
921
922
|
c(this, zt, /* @__PURE__ */ a(() => {
|
|
922
|
-
const e = Array.from(t(this,
|
|
923
|
-
const u = `<nine-table-sheet class="${d === 0 ? "active" : ""}" data-index="${d}"></nine-table-sheet>`,
|
|
924
|
-
return u +
|
|
923
|
+
const e = Array.from(t(this, q).children).filter((h) => h.tagName === "TABLE"), s = t(this, q).getAttribute("auto-height") === "true", o = e.length, r = e.map((h, d) => {
|
|
924
|
+
const u = `<nine-table-sheet class="${d === 0 ? "active" : ""}" data-index="${d}"></nine-table-sheet>`, b = d < o - 1 ? `<nine-splitter class="h" data-split-index="${d}"></nine-splitter>` : "";
|
|
925
|
+
return u + b;
|
|
925
926
|
}).join(""), n = e.map((h, d) => `<div class="nine-tab-item ${d === 0 ? "active" : ""}" data-index="${d}">Sheet ${d + 1}</div>`).join("");
|
|
926
|
-
t(this,
|
|
927
|
+
t(this, q).shadowRoot.innerHTML = `
|
|
927
928
|
<style>
|
|
928
929
|
:host {
|
|
929
930
|
display: flex;
|
|
@@ -1022,57 +1023,57 @@ const ce = class ce {
|
|
|
1022
1023
|
</nine-table-body>
|
|
1023
1024
|
<nine-table-footer></nine-table-footer>
|
|
1024
1025
|
`;
|
|
1025
|
-
const l = t(this,
|
|
1026
|
+
const l = t(this, q).shadowRoot.querySelectorAll("nine-table-sheet");
|
|
1026
1027
|
l == null || l.forEach((h, d) => {
|
|
1027
1028
|
e[d] && setTimeout(() => {
|
|
1028
|
-
h.generate(e[d]), s && t(this,
|
|
1029
|
+
h.generate(e[d]), s && t(this, bt).call(this);
|
|
1029
1030
|
});
|
|
1030
1031
|
});
|
|
1031
1032
|
}, "#render"));
|
|
1032
|
-
|
|
1033
|
+
g(this, q, i), t(this, Ot).call(this);
|
|
1033
1034
|
}
|
|
1034
1035
|
};
|
|
1035
|
-
|
|
1036
|
+
q = new WeakMap(), Ot = new WeakMap(), bt = new WeakMap(), zt = new WeakMap(), a(ce, "LayoutManager");
|
|
1036
1037
|
let Jt = ce;
|
|
1037
|
-
var
|
|
1038
|
+
var gt, it;
|
|
1038
1039
|
const he = class he {
|
|
1039
1040
|
constructor(i) {
|
|
1040
|
-
c(this,
|
|
1041
|
+
c(this, gt);
|
|
1041
1042
|
c(this, it, -1);
|
|
1042
|
-
x(this, "count", /* @__PURE__ */ a(() => t(this,
|
|
1043
|
-
|
|
1043
|
+
x(this, "count", /* @__PURE__ */ a(() => t(this, gt).rawRecords.length, "count"));
|
|
1044
|
+
g(this, gt, i);
|
|
1044
1045
|
}
|
|
1045
1046
|
get at() {
|
|
1046
1047
|
return t(this, it);
|
|
1047
1048
|
}
|
|
1048
1049
|
set at(i) {
|
|
1049
|
-
|
|
1050
|
+
g(this, it, parseInt(i, 10)), body && !body.querySelector(`tbody.bindable tr[data-row="${t(this, it)}"]`) && setTimeout(() => {
|
|
1050
1051
|
});
|
|
1051
1052
|
}
|
|
1052
1053
|
};
|
|
1053
|
-
|
|
1054
|
+
gt = new WeakMap(), it = new WeakMap(), a(he, "ngRow");
|
|
1054
1055
|
let Qt = he;
|
|
1055
|
-
var
|
|
1056
|
+
var T, E, L, st, Bt, D, Dt, j, yt, Nt, Pt, nt;
|
|
1056
1057
|
const H = class H {
|
|
1057
1058
|
constructor(i, e) {
|
|
1058
|
-
c(this,
|
|
1059
|
+
c(this, T);
|
|
1059
1060
|
c(this, E);
|
|
1060
1061
|
c(this, L, []);
|
|
1061
1062
|
c(this, st, []);
|
|
1062
1063
|
c(this, Bt, 0);
|
|
1063
1064
|
c(this, D, []);
|
|
1064
1065
|
c(this, Dt, /* @__PURE__ */ a(() => {
|
|
1065
|
-
|
|
1066
|
-
const i = t(this,
|
|
1066
|
+
g(this, D, []);
|
|
1067
|
+
const i = t(this, T).template || [];
|
|
1067
1068
|
Array.from(i).forEach((e) => {
|
|
1068
1069
|
var s;
|
|
1069
1070
|
t(this, D).push(((s = e.getBoundingClientRect) == null ? void 0 : s.call(e).height) || 24);
|
|
1070
1071
|
}), (t(this, E).rawRecords || []).forEach((e) => {
|
|
1071
|
-
e.__ng || (e.__ng = t(this,
|
|
1072
|
+
e.__ng || (e.__ng = t(this, yt).call(this)), e.__ng.height = t(this, D).slice();
|
|
1072
1073
|
});
|
|
1073
1074
|
}, "#initialize"));
|
|
1074
1075
|
c(this, j, /* @__PURE__ */ a(() => {
|
|
1075
|
-
t(this,
|
|
1076
|
+
t(this, T).shadowRoot.querySelectorAll("nine-table-sheet").forEach((i) => {
|
|
1076
1077
|
i.invalidate();
|
|
1077
1078
|
});
|
|
1078
1079
|
}, "#invalidate"));
|
|
@@ -1082,7 +1083,7 @@ const H = class H {
|
|
|
1082
1083
|
if (!s || s.length <= 0) return;
|
|
1083
1084
|
if (i == null) return t(this, nt).call(this, s);
|
|
1084
1085
|
if (i < 0 || i >= s.length) return null;
|
|
1085
|
-
const o = typeof ((r = t(this,
|
|
1086
|
+
const o = typeof ((r = t(this, T).fields) == null ? void 0 : r.get) == "function" ? t(this, T).fields.get() : [];
|
|
1086
1087
|
if (e != null) {
|
|
1087
1088
|
const n = o.indexOf(e);
|
|
1088
1089
|
return n >= 0 ? s[i].v[n] : null;
|
|
@@ -1092,7 +1093,7 @@ const H = class H {
|
|
|
1092
1093
|
x(this, "set", /* @__PURE__ */ a((i) => {
|
|
1093
1094
|
this.clear(), this.add(i, !1), t(this, j).call(this);
|
|
1094
1095
|
}, "set"));
|
|
1095
|
-
c(this,
|
|
1096
|
+
c(this, yt, /* @__PURE__ */ a(() => ({
|
|
1096
1097
|
rowState: H.ROW_STATE.EMPTY,
|
|
1097
1098
|
deleted: !1,
|
|
1098
1099
|
filtered: !1,
|
|
@@ -1102,16 +1103,16 @@ const H = class H {
|
|
|
1102
1103
|
_: [0, 0, 0, 0, H.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, t(this, D).slice(), -1, {}, {}]
|
|
1103
1104
|
}), "#getDefaultMeta"));
|
|
1104
1105
|
x(this, "reset", /* @__PURE__ */ a(() => {
|
|
1105
|
-
|
|
1106
|
+
g(this, L, []), g(this, st, []), t(this, j).call(this);
|
|
1106
1107
|
}, "reset"));
|
|
1107
1108
|
x(this, "clear", /* @__PURE__ */ a(() => {
|
|
1108
1109
|
var i;
|
|
1109
|
-
t(this, E).rawRecords = [],
|
|
1110
|
+
t(this, E).rawRecords = [], g(this, L, []), g(this, st, []), (i = t(this, E).viewRecords) != null && i.reset && t(this, E).viewRecords.reset();
|
|
1110
1111
|
}, "clear"));
|
|
1111
1112
|
c(this, Nt, /* @__PURE__ */ a((i) => {
|
|
1112
1113
|
var o;
|
|
1113
1114
|
Array.isArray(i) || (i = [i]);
|
|
1114
|
-
const e = typeof ((o = t(this,
|
|
1115
|
+
const e = typeof ((o = t(this, T).fields) == null ? void 0 : o.get) == "function" ? t(this, T).fields.get() : Object.keys(i[0] || {}), s = [];
|
|
1115
1116
|
return i.forEach((r) => {
|
|
1116
1117
|
const n = { v: [] };
|
|
1117
1118
|
e.forEach((l) => {
|
|
@@ -1120,7 +1121,7 @@ const H = class H {
|
|
|
1120
1121
|
}), s;
|
|
1121
1122
|
}, "#json2Array"));
|
|
1122
1123
|
c(this, Pt, /* @__PURE__ */ a((i) => (Array.isArray(i) || (i = [i]), i.forEach((e) => {
|
|
1123
|
-
e.__ng = t(this,
|
|
1124
|
+
e.__ng = t(this, yt).call(this), e.__ng.rowid = this.nextId, e.__ng.rowState = H.ROW_STATE.INSERT, e.__ng._[0] = e.__ng.rowid;
|
|
1124
1125
|
}), i), "#defaultInsert"));
|
|
1125
1126
|
x(this, "add", /* @__PURE__ */ a((i, e = !0) => {
|
|
1126
1127
|
i === void 0 && (i = {});
|
|
@@ -1146,7 +1147,7 @@ const H = class H {
|
|
|
1146
1147
|
x(this, "setValue", /* @__PURE__ */ a((i, e, s) => {
|
|
1147
1148
|
var h;
|
|
1148
1149
|
i = parseInt(i, 10);
|
|
1149
|
-
const r = (typeof ((h = t(this,
|
|
1150
|
+
const r = (typeof ((h = t(this, T).fields) == null ? void 0 : h.get) == "function" ? t(this, T).fields.get() : []).indexOf(e);
|
|
1150
1151
|
if (r < 0) return;
|
|
1151
1152
|
const n = this.getValidData()[i];
|
|
1152
1153
|
if (!n) return;
|
|
@@ -1154,7 +1155,7 @@ const H = class H {
|
|
|
1154
1155
|
l !== s && n.__ng.rowState !== H.ROW_STATE.INSERT && (n.__ng.o.hasOwnProperty(e) || (n.__ng.o[e] = l), n.__ng.rowState = H.ROW_STATE.UPDATE), n.v[r] = s;
|
|
1155
1156
|
}, "setValue"));
|
|
1156
1157
|
x(this, "resetRecords", /* @__PURE__ */ a(() => {
|
|
1157
|
-
|
|
1158
|
+
g(this, st, t(this, E).rawRecords.filter((i) => !i.__ng.deleted)), g(this, L, t(this, E).rawRecords.filter((i) => !i.__ng.deleted && !i.__ng.filtered)), t(this, E).rawRecords.forEach((i, e) => {
|
|
1158
1159
|
i.__ng.rowidx = e;
|
|
1159
1160
|
}), t(this, L).forEach((i, e) => {
|
|
1160
1161
|
i.__ng.i = e;
|
|
@@ -1164,7 +1165,7 @@ const H = class H {
|
|
|
1164
1165
|
c(this, nt, /* @__PURE__ */ a((i) => {
|
|
1165
1166
|
var n;
|
|
1166
1167
|
if (!i) return i;
|
|
1167
|
-
const e = !Array.isArray(i), s = e ? [i] : i, o = typeof ((n = t(this,
|
|
1168
|
+
const e = !Array.isArray(i), s = e ? [i] : i, o = typeof ((n = t(this, T).fields) == null ? void 0 : n.get) == "function" ? t(this, T).fields.get() : [], r = s.filter((l) => !l.__ng.deleted).map((l) => {
|
|
1168
1169
|
const h = {};
|
|
1169
1170
|
return o.forEach((d, f) => {
|
|
1170
1171
|
h[d] = l.v ? l.v[f] : l[d];
|
|
@@ -1173,7 +1174,7 @@ const H = class H {
|
|
|
1173
1174
|
return e ? r[0] : r;
|
|
1174
1175
|
}, "#conv"));
|
|
1175
1176
|
x(this, "count", /* @__PURE__ */ a(() => this.getValidData().length, "count"));
|
|
1176
|
-
|
|
1177
|
+
g(this, T, i), g(this, E, e), t(this, Dt).call(this);
|
|
1177
1178
|
}
|
|
1178
1179
|
get source() {
|
|
1179
1180
|
return t(this, nt).call(this, t(this, E).rawRecords);
|
|
@@ -1191,7 +1192,7 @@ const H = class H {
|
|
|
1191
1192
|
return this.length;
|
|
1192
1193
|
}
|
|
1193
1194
|
};
|
|
1194
|
-
|
|
1195
|
+
T = new WeakMap(), E = new WeakMap(), L = new WeakMap(), st = new WeakMap(), Bt = new WeakMap(), D = new WeakMap(), Dt = new WeakMap(), j = new WeakMap(), yt = new WeakMap(), Nt = new WeakMap(), Pt = new WeakMap(), nt = new WeakMap(), a(H, "ngData"), // π― ν μν μ μ μμλ₯Ό ν΄λμ€ λ΄λΆλ‘ λ΄μ¬ν
|
|
1195
1196
|
x(H, "ROW_STATE", {
|
|
1196
1197
|
EMPTY: "EMPTY",
|
|
1197
1198
|
NORMAL: "NORMAL",
|
|
@@ -1204,7 +1205,7 @@ var K;
|
|
|
1204
1205
|
const de = class de {
|
|
1205
1206
|
constructor(i) {
|
|
1206
1207
|
c(this, K);
|
|
1207
|
-
|
|
1208
|
+
g(this, K, i), this.row = new Qt(this), this.data = new te(t(this, K), this), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.pageCnt = 25, this.viewRecords.reset = () => {
|
|
1208
1209
|
var e;
|
|
1209
1210
|
(e = t(this, K).view) != null && e.redraw && t(this, K).view.redraw();
|
|
1210
1211
|
}, this.setDataSource = (e) => {
|
|
@@ -1223,7 +1224,7 @@ const de = class de {
|
|
|
1223
1224
|
};
|
|
1224
1225
|
K = new WeakMap(), a(de, "ngDataManager");
|
|
1225
1226
|
let ee = de;
|
|
1226
|
-
var ot, R,
|
|
1227
|
+
var ot, R, pt, Yt;
|
|
1227
1228
|
const fe = class fe {
|
|
1228
1229
|
// π― μ΄μ { name: string, type: string } κ°μ²΄λ€μ λ°°μ΄λ‘ κ΄λ¦¬ν©λλ€.
|
|
1229
1230
|
constructor(i) {
|
|
@@ -1232,16 +1233,16 @@ const fe = class fe {
|
|
|
1232
1233
|
x(this, "add", /* @__PURE__ */ a((i, e = "string") => {
|
|
1233
1234
|
i.forEach((s) => {
|
|
1234
1235
|
t(this, R).some((o) => o.name === s) || t(this, R).push({ name: s, type: e });
|
|
1235
|
-
}), t(this,
|
|
1236
|
+
}), t(this, pt).call(this);
|
|
1236
1237
|
}, "add"));
|
|
1237
|
-
c(this,
|
|
1238
|
+
c(this, pt, /* @__PURE__ */ a(() => {
|
|
1238
1239
|
const i = /* @__PURE__ */ new Map();
|
|
1239
1240
|
t(this, R).forEach((e) => {
|
|
1240
1241
|
i.set(e.name, e.type);
|
|
1241
|
-
}),
|
|
1242
|
+
}), g(this, R, Array.from(i, ([e, s]) => ({ name: e, type: s }))), g(this, R, t(this, R).filter((e) => e.name !== "" && e.name !== "__ng")), t(this, R).sort((e, s) => e.name.length < s.name.length ? 1 : -1);
|
|
1242
1243
|
}, "#adjust"));
|
|
1243
1244
|
c(this, Yt, /* @__PURE__ */ a(() => {
|
|
1244
|
-
|
|
1245
|
+
g(this, R, []), W.log(t(this, ot).querySelectorAll("table"));
|
|
1245
1246
|
const i = Array.from(t(this, ot).querySelectorAll("table"));
|
|
1246
1247
|
if (!(!i || i.length === 0)) {
|
|
1247
1248
|
for (const e of i)
|
|
@@ -1269,10 +1270,10 @@ const fe = class fe {
|
|
|
1269
1270
|
});
|
|
1270
1271
|
});
|
|
1271
1272
|
});
|
|
1272
|
-
t(this,
|
|
1273
|
+
t(this, pt).call(this);
|
|
1273
1274
|
}
|
|
1274
1275
|
}, "#init"));
|
|
1275
|
-
|
|
1276
|
+
g(this, ot, i), t(this, Yt).call(this);
|
|
1276
1277
|
}
|
|
1277
1278
|
// π― κΈ°μ‘΄μ νλ μ΄λ¦λ§ μ°λ κ³³λ€κ³Όμ νΈνμ μν΄ μ΄λ¦ λ°°μ΄λ§ 리ν΄νλ λ©μλ μ μ§
|
|
1278
1279
|
get() {
|
|
@@ -1294,7 +1295,7 @@ const fe = class fe {
|
|
|
1294
1295
|
return t(this, R).some((e) => e.name === i);
|
|
1295
1296
|
}
|
|
1296
1297
|
};
|
|
1297
|
-
ot = new WeakMap(), R = new WeakMap(),
|
|
1298
|
+
ot = new WeakMap(), R = new WeakMap(), pt = new WeakMap(), Yt = new WeakMap(), a(fe, "ngFields");
|
|
1298
1299
|
let ie = fe;
|
|
1299
1300
|
var Z, Vt, Xt;
|
|
1300
1301
|
const ue = class ue extends HTMLElement {
|
|
@@ -1304,9 +1305,9 @@ const ue = class ue extends HTMLElement {
|
|
|
1304
1305
|
c(this, Z);
|
|
1305
1306
|
c(this, Vt);
|
|
1306
1307
|
c(this, Xt, /* @__PURE__ */ a(() => {
|
|
1307
|
-
this.fields = new ie(this),
|
|
1308
|
+
this.fields = new ie(this), g(this, Vt, new Jt(this)), W.log("NineTable connected."), this.dispatchEvent(new CustomEvent("load", { bubbles: !0, detail: { target: this } }));
|
|
1308
1309
|
}, "#init"));
|
|
1309
|
-
this.attachShadow({ mode: "open" }),
|
|
1310
|
+
this.attachShadow({ mode: "open" }), g(this, Z, new ee(this));
|
|
1310
1311
|
}
|
|
1311
1312
|
connectedCallback() {
|
|
1312
1313
|
t(this, Xt).call(this);
|