@ninebone/table 0.0.247 β 0.0.249
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 +124 -124
- package/dist/nine-table.js.map +1 -1
- package/dist/nine-table.umd.js +4 -4
- package/dist/nine-table.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/nine-table.js
CHANGED
|
@@ -4,7 +4,7 @@ var Oe = (m) => {
|
|
|
4
4
|
};
|
|
5
5
|
var Ne = (m, i, t) => i in m ? ze(m, i, { enumerable: !0, configurable: !0, writable: !0, value: t }) : m[i] = t;
|
|
6
6
|
var h = (m, i) => ze(m, "name", { value: i, configurable: !0 });
|
|
7
|
-
var
|
|
7
|
+
var x = (m, i, t) => Ne(m, typeof i != "symbol" ? i + "" : i, t), Be = (m, i, t) => i.has(m) || Oe("Cannot " + t);
|
|
8
8
|
var e = (m, i, t) => (Be(m, i, "read from private field"), t ? t.call(m) : i.get(m)), u = (m, i, t) => i.has(m) ? Oe("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(m) : i.set(m, t), y = (m, i, t, s) => (Be(m, i, "write to private field"), s ? s.call(m, t) : i.set(m, t), t);
|
|
9
9
|
var De = (m, i, t, s) => ({
|
|
10
10
|
set _(n) {
|
|
@@ -40,7 +40,7 @@ const ke = class ke extends HTMLElement {
|
|
|
40
40
|
this.refresh();
|
|
41
41
|
})), e(this, P).observe(t));
|
|
42
42
|
}, "#observeResize"));
|
|
43
|
-
|
|
43
|
+
x(this, "refresh", /* @__PURE__ */ h(() => {
|
|
44
44
|
if (!e(this, C) || !e(this, p) || e(this, B)) return;
|
|
45
45
|
const t = e(this, p).container, s = t.querySelector("table");
|
|
46
46
|
if (!s) return;
|
|
@@ -58,8 +58,8 @@ const ke = class ke extends HTMLElement {
|
|
|
58
58
|
const f = t.scrollLeft, g = d - a;
|
|
59
59
|
let b = 0;
|
|
60
60
|
g > 0 && (b = parseInt(f / g * (l - c), 10)), b < 0 && (b = 0);
|
|
61
|
-
const
|
|
62
|
-
b >
|
|
61
|
+
const S = l - c;
|
|
62
|
+
b > S && (b = S), r.style.left = `${b}px`, O.log(b), e(this, p).left.disabled = b === 0, e(this, p).right.disabled = b >= S - 1;
|
|
63
63
|
}, "refresh"));
|
|
64
64
|
u(this, V, /* @__PURE__ */ h((t) => {
|
|
65
65
|
if (!e(this, p)) return !1;
|
|
@@ -200,16 +200,16 @@ const ke = class ke extends HTMLElement {
|
|
|
200
200
|
C = new WeakMap(), B = new WeakMap(), p = new WeakMap(), D = new WeakMap(), N = new WeakMap(), P = new WeakMap(), ie = new WeakMap(), V = new WeakMap(), se = new WeakMap(), h(ke, "NineTableHScrollBar");
|
|
201
201
|
let we = ke;
|
|
202
202
|
customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar", we);
|
|
203
|
-
var M, _,
|
|
203
|
+
var M, _, R, $, I, H, ne, re, oe, le;
|
|
204
204
|
const Le = class Le {
|
|
205
205
|
constructor(i) {
|
|
206
206
|
u(this, M);
|
|
207
207
|
u(this, _, []);
|
|
208
|
-
u(this,
|
|
208
|
+
u(this, R, null);
|
|
209
209
|
u(this, $, null);
|
|
210
210
|
u(this, I, 0);
|
|
211
211
|
u(this, H, 0);
|
|
212
|
-
|
|
212
|
+
x(this, "getRowHeight", /* @__PURE__ */ h(() => e(this, R), "getRowHeight"));
|
|
213
213
|
u(this, ne, /* @__PURE__ */ h(() => {
|
|
214
214
|
e(this, re).call(this);
|
|
215
215
|
}, "#init"));
|
|
@@ -229,8 +229,8 @@ const Le = class Le {
|
|
|
229
229
|
const a = s.querySelector(".ng-container-body") || s, d = a.querySelector("thead"), l = a.querySelector("tfoot");
|
|
230
230
|
d && (o += d.offsetHeight || d.getBoundingClientRect().height), l && (o += l.offsetHeight || l.getBoundingClientRect().height);
|
|
231
231
|
const c = Math.max(r - o, 100);
|
|
232
|
-
if (e(this, I) !== c && (y(this, I, c), e(this,
|
|
233
|
-
const f = Math.ceil(e(this, I) / e(this,
|
|
232
|
+
if (e(this, I) !== c && (y(this, I, c), e(this, R) !== null)) {
|
|
233
|
+
const f = Math.ceil(e(this, I) / e(this, R));
|
|
234
234
|
y(this, H, f + 20), O.log(`[RowManager] Resized. Height: ${e(this, I)}px | Target Rows: ${e(this, H)}`), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((g) => {
|
|
235
235
|
const b = s.querySelector(g);
|
|
236
236
|
b && b.querySelector("tbody") && e(this, le).call(this, b);
|
|
@@ -241,14 +241,14 @@ const Le = class Le {
|
|
|
241
241
|
})), e(this, $).observe(e(this, M)));
|
|
242
242
|
}, "#initResizeObserver"));
|
|
243
243
|
// π― ν
νλ¦Ώ μΆμΆ, λμ΄ μΈ‘μ , μ΄κΈ° λ λλ§μ μμμ λ§κ² λ΄λΆμμ μΌκ΄ μ²λ¦¬
|
|
244
|
-
|
|
244
|
+
x(this, "initialize", /* @__PURE__ */ h((i) => {
|
|
245
245
|
O.log(i);
|
|
246
246
|
const t = e(this, M).querySelector(".ng-container-body"), s = i.querySelector("tbody"), n = Array.from(s.querySelectorAll("tr"));
|
|
247
|
-
y(this, _, n.map((r) => r.cloneNode(!0))), y(this,
|
|
247
|
+
y(this, _, n.map((r) => r.cloneNode(!0))), y(this, R, null), e(this, oe).call(this, t);
|
|
248
248
|
}, "initialize"));
|
|
249
249
|
u(this, oe, /* @__PURE__ */ h((i) => {
|
|
250
|
-
if (e(this,
|
|
251
|
-
return e(this,
|
|
250
|
+
if (e(this, R) !== null && e(this, R) > 0)
|
|
251
|
+
return e(this, R);
|
|
252
252
|
if (e(this, _).length === 0)
|
|
253
253
|
throw new Error("[RowManager] Template TRs are empty.");
|
|
254
254
|
const t = i.querySelector("tbody.bindable") || i.querySelector("tbody");
|
|
@@ -264,12 +264,12 @@ const Le = class Le {
|
|
|
264
264
|
const c = t.querySelectorAll("tr:not(.nodata)");
|
|
265
265
|
if (c.forEach((f, g) => {
|
|
266
266
|
l += f.offsetHeight || f.getBoundingClientRect().height;
|
|
267
|
-
}), c.forEach((f) => f.remove()), r && (r.style.display = o, r.style.visibility = a, r.style.position = d), y(this,
|
|
268
|
-
const f = Math.ceil(e(this, I) / e(this,
|
|
267
|
+
}), c.forEach((f) => f.remove()), r && (r.style.display = o, r.style.visibility = a, r.style.position = d), y(this, R, l), e(this, I) > 0) {
|
|
268
|
+
const f = Math.ceil(e(this, I) / e(this, R));
|
|
269
269
|
y(this, H, f + 20);
|
|
270
270
|
} else
|
|
271
271
|
y(this, H, 40);
|
|
272
|
-
return console.log(`[RowManager] Template Height Cached: ${e(this,
|
|
272
|
+
return console.log(`[RowManager] Template Height Cached: ${e(this, R)}px | RowCount: ${e(this, H)}`), e(this, R);
|
|
273
273
|
}, "#measureAndCacheHeight"));
|
|
274
274
|
/**
|
|
275
275
|
* π― μΊμλ ν κ°μ λ°ν (μμ λλ§ μ΅μνμ λ°©μ΄ μ°μ°)
|
|
@@ -299,7 +299,7 @@ const Le = class Le {
|
|
|
299
299
|
});
|
|
300
300
|
s ? s.before(n) : t.appendChild(n), console.log(`[RowManager] Rendered ${r} sets into DOM.`);
|
|
301
301
|
}, "#renderRows"));
|
|
302
|
-
|
|
302
|
+
x(this, "destroy", /* @__PURE__ */ h(() => {
|
|
303
303
|
e(this, $) && (e(this, $).disconnect(), y(this, $, null));
|
|
304
304
|
}, "destroy"));
|
|
305
305
|
y(this, M, i), e(this, ne).call(this);
|
|
@@ -308,13 +308,13 @@ const Le = class Le {
|
|
|
308
308
|
return e(this, _).length || 1;
|
|
309
309
|
}
|
|
310
310
|
};
|
|
311
|
-
M = new WeakMap(), _ = new WeakMap(),
|
|
311
|
+
M = new WeakMap(), _ = new WeakMap(), R = new WeakMap(), $ = new WeakMap(), I = new WeakMap(), H = new WeakMap(), ne = new WeakMap(), re = new WeakMap(), oe = new WeakMap(), le = new WeakMap(), h(Le, "RowManager");
|
|
312
312
|
let xe = Le;
|
|
313
|
-
var
|
|
313
|
+
var A, U, G, F, ae, ce;
|
|
314
314
|
const j = class j extends HTMLElement {
|
|
315
315
|
constructor() {
|
|
316
316
|
super();
|
|
317
|
-
u(this,
|
|
317
|
+
u(this, A, null);
|
|
318
318
|
u(this, U);
|
|
319
319
|
/**
|
|
320
320
|
* π― 2μ°¨μ μ
격μ μΈλ±μ€λ₯Ό κ³μ°νμ¬ λ³ν©(`rowSpan`/`colSpan`) μ
μ μ λ μ»¬λΌ μμΉλ₯Ό λΆμ¬
|
|
@@ -331,15 +331,15 @@ const j = class j extends HTMLElement {
|
|
|
331
331
|
const c = l.sectionRowIndex;
|
|
332
332
|
let f = 0;
|
|
333
333
|
Array.from(l.querySelectorAll("th,td")).forEach((g) => {
|
|
334
|
-
for (let
|
|
335
|
-
if (d[c][
|
|
336
|
-
f =
|
|
334
|
+
for (let v = 0; v < d[c].length; v++)
|
|
335
|
+
if (d[c][v] === null) {
|
|
336
|
+
f = v;
|
|
337
337
|
break;
|
|
338
338
|
}
|
|
339
|
-
const b = g.rowSpan || 1,
|
|
340
|
-
for (let
|
|
341
|
-
for (let
|
|
342
|
-
c +
|
|
339
|
+
const b = g.rowSpan || 1, S = g.colSpan || 1;
|
|
340
|
+
for (let v = 0; v < b; v++)
|
|
341
|
+
for (let L = 0; L < S; L++)
|
|
342
|
+
c + v < o && f + L < a && (d[c + v][f + L] = v === 0 && L === 0 ? "1" : "0");
|
|
343
343
|
});
|
|
344
344
|
}), n.forEach((l) => {
|
|
345
345
|
const c = l.sectionRowIndex;
|
|
@@ -371,37 +371,37 @@ const j = class j extends HTMLElement {
|
|
|
371
371
|
});
|
|
372
372
|
}), n;
|
|
373
373
|
}, "#createSplitTable"));
|
|
374
|
-
|
|
374
|
+
x(this, "generate", /* @__PURE__ */ h((t) => {
|
|
375
375
|
if (!t) return;
|
|
376
376
|
const s = /* @__PURE__ */ h((l) => {
|
|
377
377
|
const c = /* @__PURE__ */ h((g) => {
|
|
378
378
|
if (g.querySelector("colgroup")) return;
|
|
379
|
-
const b = g.querySelector("tbody tr") || g.querySelector("tr"),
|
|
380
|
-
for (let $e = 0; $e <
|
|
379
|
+
const b = g.querySelector("tbody tr") || g.querySelector("tr"), S = b ? b.querySelectorAll("th, td").length : 1, v = document.createElement("colgroup"), L = Math.max(Math.floor(g.clientWidth / S), 100);
|
|
380
|
+
for (let $e = 0; $e < S; $e++) {
|
|
381
381
|
const We = document.createElement("col");
|
|
382
|
-
We.setAttribute("width",
|
|
382
|
+
We.setAttribute("width", L), v.appendChild(We);
|
|
383
383
|
}
|
|
384
|
-
g.prepend(
|
|
384
|
+
g.prepend(v);
|
|
385
385
|
}, "ensureColgroup"), f = /* @__PURE__ */ h((g) => {
|
|
386
386
|
if (g.querySelector("thead")) return;
|
|
387
|
-
const b = document.createElement("thead"),
|
|
388
|
-
|
|
387
|
+
const b = document.createElement("thead"), S = g.querySelector("colgroup");
|
|
388
|
+
S ? S.after(b) : g.prepend(b);
|
|
389
389
|
}, "ensureThead");
|
|
390
390
|
return c(l), f(l), l.classList.add("nine-table-element"), l;
|
|
391
391
|
}, "initializeTable"), n = t.cloneNode(!0);
|
|
392
|
-
y(this,
|
|
392
|
+
y(this, A, s(n)), e(this, A).style.display = "table", e(this, G).call(this, e(this, A), "thead"), e(this, G).call(this, e(this, A), "tbody"), Array.from(e(this, A).querySelectorAll("colgroup col")).forEach((l, c) => {
|
|
393
393
|
const f = l.getAttribute("fixed");
|
|
394
|
-
f && e(this,
|
|
394
|
+
f && e(this, A).querySelectorAll(`[data-col="${c}"]`).forEach((g) => {
|
|
395
395
|
g.setAttribute("fixed", f);
|
|
396
396
|
});
|
|
397
|
-
}), O.log(e(this,
|
|
397
|
+
}), O.log(e(this, A));
|
|
398
398
|
const o = this.querySelector(".ng-container-left"), a = this.querySelector(".ng-container-body"), d = this.querySelector(".ng-container-right");
|
|
399
399
|
if (a) {
|
|
400
|
-
const l = e(this, F).call(this, e(this,
|
|
401
|
-
a.innerHTML = "", a.appendChild(l), e(this, U).initialize(e(this,
|
|
400
|
+
const l = e(this, F).call(this, e(this, A), null);
|
|
401
|
+
a.innerHTML = "", a.appendChild(l), e(this, U).initialize(e(this, A));
|
|
402
402
|
}
|
|
403
403
|
if (o) {
|
|
404
|
-
const l = e(this, F).call(this, e(this,
|
|
404
|
+
const l = e(this, F).call(this, e(this, A), "left");
|
|
405
405
|
let c = 0;
|
|
406
406
|
l.querySelectorAll("col").forEach((g) => {
|
|
407
407
|
const b = parseInt(g.getAttribute("width"), 10);
|
|
@@ -411,7 +411,7 @@ const j = class j extends HTMLElement {
|
|
|
411
411
|
o.style.flex = `0 0 ${f}px`, o.style.width = `${f}px`;
|
|
412
412
|
}
|
|
413
413
|
if (d) {
|
|
414
|
-
const l = e(this, F).call(this, e(this,
|
|
414
|
+
const l = e(this, F).call(this, e(this, A), "right");
|
|
415
415
|
let c = 0;
|
|
416
416
|
l.querySelectorAll("col").forEach((g) => {
|
|
417
417
|
const b = parseInt(g.getAttribute("width"), 10);
|
|
@@ -428,35 +428,35 @@ const j = class j extends HTMLElement {
|
|
|
428
428
|
(l = this.querySelector("nine-table-hscrollbar")) == null || l.refresh();
|
|
429
429
|
}, 0);
|
|
430
430
|
}, "generate"));
|
|
431
|
-
|
|
432
|
-
|
|
431
|
+
x(this, "getRowHeight", /* @__PURE__ */ h(() => e(this, U).getRowHeight(), "getRowHeight"));
|
|
432
|
+
x(this, "scrollToX", /* @__PURE__ */ h((t) => {
|
|
433
433
|
const s = this.querySelector(".ng-container-body");
|
|
434
434
|
s && (s.scrollLeft = t);
|
|
435
435
|
}, "scrollToX"));
|
|
436
|
-
|
|
436
|
+
x(this, "scrollToY", /* @__PURE__ */ h((t) => {
|
|
437
437
|
const s = this.querySelector(".ng-container-body");
|
|
438
438
|
s && (s.scrollTop = t);
|
|
439
439
|
}, "scrollToY"));
|
|
440
440
|
u(this, ae, /* @__PURE__ */ h(() => {
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
for (const n of
|
|
458
|
-
n.attributeName === "class" && this.classList.contains("active") &&
|
|
459
|
-
}).observe(this, { attributes: !0 })
|
|
441
|
+
const t = /* @__PURE__ */ h(() => {
|
|
442
|
+
var c, f, g;
|
|
443
|
+
O.log(":::::::::::::::");
|
|
444
|
+
const s = this.querySelector(".ng-container-left table"), n = this.querySelector(".ng-container-body table"), r = this.querySelector(".ng-container-right table");
|
|
445
|
+
if (!n) return;
|
|
446
|
+
const o = s ? Array.from(s.querySelectorAll("tr")) : [], a = Array.from(n.querySelectorAll("tr")), d = r ? Array.from(r.querySelectorAll("tr")) : [], l = Math.max(o.length, a.length, d.length);
|
|
447
|
+
for (let b = 0; b < l; b++) {
|
|
448
|
+
const S = [
|
|
449
|
+
((c = o[b]) == null ? void 0 : c.getBoundingClientRect().height) || 0,
|
|
450
|
+
((f = a[b]) == null ? void 0 : f.getBoundingClientRect().height) || 0,
|
|
451
|
+
((g = d[b]) == null ? void 0 : g.getBoundingClientRect().height) || 0
|
|
452
|
+
], v = Math.max(...S);
|
|
453
|
+
v > 0 && (o[b] && (o[b].style.height = `${v}px`), a[b] && (a[b].style.height = `${v}px`), d[b] && (d[b].style.height = `${v}px`));
|
|
454
|
+
}
|
|
455
|
+
}, "syncRowHeights");
|
|
456
|
+
e(this, ce).call(this), t(), new MutationObserver((s) => {
|
|
457
|
+
for (const n of s)
|
|
458
|
+
n.attributeName === "class" && this.classList.contains("active") && t();
|
|
459
|
+
}).observe(this, { attributes: !0 });
|
|
460
460
|
}, "#init"));
|
|
461
461
|
u(this, ce, /* @__PURE__ */ h(() => {
|
|
462
462
|
const t = j.SCROLLBAR_SIZE;
|
|
@@ -591,7 +591,7 @@ const j = class j extends HTMLElement {
|
|
|
591
591
|
this.innerHTML = "", O.log("NineTableSheet destroyed.");
|
|
592
592
|
}
|
|
593
593
|
};
|
|
594
|
-
|
|
594
|
+
A = new WeakMap(), U = new WeakMap(), G = new WeakMap(), F = new WeakMap(), ae = new WeakMap(), ce = new WeakMap(), h(j, "NineTableSheet"), x(j, "SCROLLBAR_SIZE", 16);
|
|
595
595
|
let te = j;
|
|
596
596
|
customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet", te);
|
|
597
597
|
var he, J;
|
|
@@ -612,8 +612,8 @@ const Ce = class Ce extends HTMLElement {
|
|
|
612
612
|
Array.from(this.querySelectorAll("nine-splitter")).forEach((b) => b.style.setProperty("display", "none"));
|
|
613
613
|
const g = c.filter((b) => b.classList.contains("active"));
|
|
614
614
|
g.length < 2 || g.forEach((b) => {
|
|
615
|
-
const
|
|
616
|
-
|
|
615
|
+
const S = parseInt(b.getAttribute("data-index"), 10), v = this.querySelector(`nine-splitter[data-split-index="${S}"]`), L = c[S + 1];
|
|
616
|
+
v && L && L.classList.contains("active") && v.style.setProperty("display", "flex");
|
|
617
617
|
});
|
|
618
618
|
}, "updateSplitters"), r = this.querySelector(".nine-tab-bar"), o = this.querySelector("nine-table-sheets-body"), a = r.querySelectorAll(".nine-tab-item"), d = o.querySelectorAll("nine-table-sheet");
|
|
619
619
|
if (!a[t]) return;
|
|
@@ -645,29 +645,29 @@ const Ce = class Ce extends HTMLElement {
|
|
|
645
645
|
he = new WeakMap(), J = new WeakMap(), h(Ce, "NineTableSheets");
|
|
646
646
|
let ve = Ce;
|
|
647
647
|
customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets", ve);
|
|
648
|
-
var
|
|
648
|
+
var E, de, Q, fe;
|
|
649
649
|
const _e = class _e {
|
|
650
650
|
constructor(i) {
|
|
651
|
-
u(this,
|
|
651
|
+
u(this, E);
|
|
652
652
|
u(this, de, /* @__PURE__ */ h(() => {
|
|
653
653
|
e(this, fe).call(this), new ResizeObserver((i) => {
|
|
654
654
|
for (let t of i)
|
|
655
|
-
e(this,
|
|
656
|
-
}).observe(e(this,
|
|
655
|
+
e(this, E).getAttribute("auto-height") === "true" && e(this, Q).call(this);
|
|
656
|
+
}).observe(e(this, E));
|
|
657
657
|
}, "#init"));
|
|
658
658
|
u(this, Q, /* @__PURE__ */ h(() => {
|
|
659
659
|
var d, l;
|
|
660
|
-
const i = Array.from(e(this,
|
|
660
|
+
const i = Array.from(e(this, E).shadowRoot.querySelectorAll("nine-table-sheet.active"));
|
|
661
661
|
if (i.length === 0) return;
|
|
662
|
-
const t = parseInt(e(this,
|
|
663
|
-
e(this,
|
|
662
|
+
const t = parseInt(e(this, E).getAttribute("max-display-row"), 10) || 10, s = Math.max(...i.map((c) => c.getRowHeight())), n = (d = e(this, E).shadowRoot.querySelector("nine-table-header")) == null ? void 0 : d.getBoundingClientRect().height, r = (l = e(this, E).shadowRoot.querySelector("nine-table-sheets-footer")) == null ? void 0 : l.getBoundingClientRect().height, o = te.SCROLLBAR_SIZE, a = t * s + n + r + o;
|
|
663
|
+
e(this, E).style.height = `${a}px`;
|
|
664
664
|
}, "#applyAutoHeight"));
|
|
665
665
|
u(this, fe, /* @__PURE__ */ h(() => {
|
|
666
|
-
const t = Array.from(e(this,
|
|
666
|
+
const t = Array.from(e(this, E).children).filter((d) => d.tagName === "TABLE"), s = e(this, E).getAttribute("auto-height") === "true", n = t.length, r = t.map((d, l) => {
|
|
667
667
|
const f = `<nine-table-sheet class="${l === 0 ? "active" : ""}" data-index="${l}"></nine-table-sheet>`, g = l < n - 1 ? `<nine-splitter class="h" data-split-index="${l}"></nine-splitter>` : "";
|
|
668
668
|
return f + g;
|
|
669
669
|
}).join(""), o = t.map((d, l) => `<div class="nine-tab-item ${l === 0 ? "active" : ""}" data-index="${l}">Sheet ${l + 1}</div>`).join("");
|
|
670
|
-
e(this,
|
|
670
|
+
e(this, E).shadowRoot.innerHTML = `
|
|
671
671
|
<style>
|
|
672
672
|
:host {
|
|
673
673
|
display: flex;
|
|
@@ -766,24 +766,24 @@ const _e = class _e {
|
|
|
766
766
|
</nine-table-body>
|
|
767
767
|
<nine-table-footer></nine-table-footer>
|
|
768
768
|
`;
|
|
769
|
-
const a = e(this,
|
|
769
|
+
const a = e(this, E).shadowRoot.querySelectorAll("nine-table-sheet");
|
|
770
770
|
a == null || a.forEach((d, l) => {
|
|
771
771
|
t[l] && setTimeout(() => {
|
|
772
772
|
d.generate(t[l]), s && e(this, Q).call(this);
|
|
773
773
|
});
|
|
774
774
|
});
|
|
775
775
|
}, "#render"));
|
|
776
|
-
y(this,
|
|
776
|
+
y(this, E, i), e(this, de).call(this);
|
|
777
777
|
}
|
|
778
778
|
};
|
|
779
|
-
|
|
779
|
+
E = new WeakMap(), de = new WeakMap(), Q = new WeakMap(), fe = new WeakMap(), h(_e, "LayoutManager");
|
|
780
780
|
let Se = _e;
|
|
781
781
|
var W, X;
|
|
782
782
|
const Ie = class Ie {
|
|
783
783
|
constructor(i) {
|
|
784
784
|
u(this, W);
|
|
785
785
|
u(this, X, -1);
|
|
786
|
-
|
|
786
|
+
x(this, "count", /* @__PURE__ */ h(() => e(this, W).rawRecords.length, "count"));
|
|
787
787
|
y(this, W, i);
|
|
788
788
|
}
|
|
789
789
|
get at() {
|
|
@@ -801,48 +801,48 @@ const Ie = class Ie {
|
|
|
801
801
|
};
|
|
802
802
|
W = new WeakMap(), X = new WeakMap(), h(Ie, "ngRow");
|
|
803
803
|
let Ee = Ie;
|
|
804
|
-
var
|
|
805
|
-
const
|
|
804
|
+
var T, w, q, K, ue, z, ge, ee, be, ye, Z;
|
|
805
|
+
const k = class k {
|
|
806
806
|
constructor(i, t) {
|
|
807
|
-
u(this,
|
|
808
|
-
u(this,
|
|
809
|
-
u(this,
|
|
807
|
+
u(this, T);
|
|
808
|
+
u(this, w);
|
|
809
|
+
u(this, q, []);
|
|
810
810
|
u(this, K, []);
|
|
811
811
|
u(this, ue, 0);
|
|
812
812
|
u(this, z, []);
|
|
813
813
|
u(this, ge, /* @__PURE__ */ h(() => {
|
|
814
814
|
y(this, z, []);
|
|
815
|
-
const i = e(this,
|
|
815
|
+
const i = e(this, T).template || [];
|
|
816
816
|
Array.from(i).forEach((t) => {
|
|
817
817
|
var s;
|
|
818
818
|
e(this, z).push(((s = t.getBoundingClientRect) == null ? void 0 : s.call(t).height) || 24);
|
|
819
|
-
}), (e(this,
|
|
819
|
+
}), (e(this, w).rawRecords || []).forEach((t) => {
|
|
820
820
|
t.__ng || (t.__ng = e(this, ee).call(this)), t.__ng.height = e(this, z).slice();
|
|
821
821
|
});
|
|
822
822
|
}, "#initialize"));
|
|
823
|
-
|
|
823
|
+
x(this, "set", /* @__PURE__ */ h((i) => {
|
|
824
824
|
this.clear(), this.add(i, !1);
|
|
825
825
|
}, "set"));
|
|
826
826
|
u(this, ee, /* @__PURE__ */ h(() => ({
|
|
827
|
-
rowState:
|
|
827
|
+
rowState: k.ROW_STATE.EMPTY,
|
|
828
828
|
deleted: !1,
|
|
829
829
|
filtered: !1,
|
|
830
830
|
height: e(this, z).slice(),
|
|
831
831
|
o: {},
|
|
832
832
|
c: {},
|
|
833
|
-
_: [0, 0, 0, 0,
|
|
833
|
+
_: [0, 0, 0, 0, k.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, e(this, z).slice(), -1, {}, {}]
|
|
834
834
|
}), "#getDefaultMeta"));
|
|
835
|
-
|
|
836
|
-
y(this,
|
|
835
|
+
x(this, "reset", /* @__PURE__ */ h(() => {
|
|
836
|
+
y(this, q, []), y(this, K, []);
|
|
837
837
|
}, "reset"));
|
|
838
|
-
|
|
838
|
+
x(this, "clear", /* @__PURE__ */ h(() => {
|
|
839
839
|
var i;
|
|
840
|
-
e(this,
|
|
840
|
+
e(this, w).rawRecords = [], y(this, q, []), y(this, K, []), (i = e(this, w).viewRecords) != null && i.reset && e(this, w).viewRecords.reset();
|
|
841
841
|
}, "clear"));
|
|
842
842
|
u(this, be, /* @__PURE__ */ h((i) => {
|
|
843
843
|
var n;
|
|
844
844
|
Array.isArray(i) || (i = [i]);
|
|
845
|
-
const t = typeof ((n = e(this,
|
|
845
|
+
const t = typeof ((n = e(this, T).fields) == null ? void 0 : n.get) == "function" ? e(this, T).fields.get() : Object.keys(i[0] || {}), s = [];
|
|
846
846
|
return i.forEach((r) => {
|
|
847
847
|
const o = { v: [] };
|
|
848
848
|
t.forEach((a) => {
|
|
@@ -851,53 +851,53 @@ const L = class L {
|
|
|
851
851
|
}), s;
|
|
852
852
|
}, "#json2Array"));
|
|
853
853
|
u(this, ye, /* @__PURE__ */ h((i) => (Array.isArray(i) || (i = [i]), i.forEach((t) => {
|
|
854
|
-
t.__ng = e(this, ee).call(this), t.__ng.rowid = this.nextId, t.__ng.rowState =
|
|
854
|
+
t.__ng = e(this, ee).call(this), t.__ng.rowid = this.nextId, t.__ng.rowState = k.ROW_STATE.INSERT, t.__ng._[0] = t.__ng.rowid;
|
|
855
855
|
}), i), "#defaultInsert"));
|
|
856
|
-
|
|
856
|
+
x(this, "add", /* @__PURE__ */ h((i, t = !0) => {
|
|
857
857
|
var r;
|
|
858
858
|
i === void 0 && (i = {});
|
|
859
859
|
const s = e(this, be).call(this, i);
|
|
860
|
-
e(this,
|
|
860
|
+
e(this, w).rawRecords = e(this, w).rawRecords.concat(e(this, ye).call(this, s)), this.resetRecords();
|
|
861
861
|
const n = this.count() - 1;
|
|
862
862
|
return t || s.forEach((o, a) => {
|
|
863
|
-
const d = e(this,
|
|
864
|
-
d && (d.__ng.rowState =
|
|
865
|
-
}), (r = e(this,
|
|
863
|
+
const d = e(this, w).rawRecords[n - a];
|
|
864
|
+
d && (d.__ng.rowState = k.ROW_STATE.EMPTY);
|
|
865
|
+
}), (r = e(this, w).viewRecords) != null && r.reset && e(this, w).viewRecords.reset(), n;
|
|
866
866
|
}, "add"));
|
|
867
|
-
|
|
867
|
+
x(this, "delete", /* @__PURE__ */ h((i) => {
|
|
868
868
|
var s;
|
|
869
869
|
let t = [];
|
|
870
|
-
Array.isArray(i) ? t = i : typeof i > "u" ? t = [e(this,
|
|
871
|
-
if (e(this,
|
|
872
|
-
const r = e(this,
|
|
873
|
-
e(this,
|
|
874
|
-
o.__ng.rowid === r && (o.__ng.deleted = !0, o.__ng.rowState =
|
|
870
|
+
Array.isArray(i) ? t = i : typeof i > "u" ? t = [e(this, w).owner.row.at] : t = [parseInt(i, 10)], t.sort((n, r) => r - n).forEach((n) => {
|
|
871
|
+
if (e(this, q)[n]) {
|
|
872
|
+
const r = e(this, q)[n].__ng.rowid;
|
|
873
|
+
e(this, q)[n].__ng.rowState === k.ROW_STATE.INSERT ? e(this, w).rawRecords = e(this, w).rawRecords.filter((o) => o.__ng.rowid !== r) : e(this, w).rawRecords.forEach((o) => {
|
|
874
|
+
o.__ng.rowid === r && (o.__ng.deleted = !0, o.__ng.rowState = k.ROW_STATE.DELETE);
|
|
875
875
|
});
|
|
876
876
|
}
|
|
877
|
-
}), this.resetRecords(), (s = e(this,
|
|
877
|
+
}), this.resetRecords(), (s = e(this, w).viewRecords) != null && s.reset && e(this, w).viewRecords.reset();
|
|
878
878
|
}, "delete"));
|
|
879
|
-
|
|
879
|
+
x(this, "setValue", /* @__PURE__ */ h((i, t, s) => {
|
|
880
880
|
var d;
|
|
881
881
|
i = parseInt(i, 10);
|
|
882
|
-
const r = (typeof ((d = e(this,
|
|
882
|
+
const r = (typeof ((d = e(this, T).fields) == null ? void 0 : d.get) == "function" ? e(this, T).fields.get() : []).indexOf(t);
|
|
883
883
|
if (r < 0) return;
|
|
884
884
|
const o = this.getValidData()[i];
|
|
885
885
|
if (!o) return;
|
|
886
886
|
const a = o.v[r];
|
|
887
|
-
a !== s && o.__ng.rowState !==
|
|
887
|
+
a !== s && o.__ng.rowState !== k.ROW_STATE.INSERT && (o.__ng.o.hasOwnProperty(t) || (o.__ng.o[t] = a), o.__ng.rowState = k.ROW_STATE.UPDATE), o.v[r] = s, e(this, w).owner.refreshData && e(this, w).owner.refreshData(i);
|
|
888
888
|
}, "setValue"));
|
|
889
|
-
|
|
890
|
-
y(this, K, e(this,
|
|
889
|
+
x(this, "resetRecords", /* @__PURE__ */ h(() => {
|
|
890
|
+
y(this, K, e(this, w).rawRecords.filter((i) => !i.__ng.deleted)), y(this, q, e(this, w).rawRecords.filter((i) => !i.__ng.deleted && !i.__ng.filtered)), e(this, w).rawRecords.forEach((i, t) => {
|
|
891
891
|
i.__ng.rowidx = t;
|
|
892
|
-
}), e(this,
|
|
892
|
+
}), e(this, q).forEach((i, t) => {
|
|
893
893
|
i.__ng.i = t;
|
|
894
894
|
});
|
|
895
895
|
}, "resetRecords"));
|
|
896
|
-
|
|
896
|
+
x(this, "getValidData", /* @__PURE__ */ h(() => (e(this, q).length === 0 && e(this, w).rawRecords.length > 0 && this.resetRecords(), e(this, q)), "getValidData"));
|
|
897
897
|
u(this, Z, /* @__PURE__ */ h((i) => {
|
|
898
898
|
var s;
|
|
899
899
|
if (!i) return i;
|
|
900
|
-
const t = typeof ((s = e(this,
|
|
900
|
+
const t = typeof ((s = e(this, T).fields) == null ? void 0 : s.get) == "function" ? e(this, T).fields.get() : [];
|
|
901
901
|
return Array.isArray(i) ? i.filter((n) => !n.__ng.deleted).map((n) => {
|
|
902
902
|
const r = {};
|
|
903
903
|
return t.forEach((o, a) => {
|
|
@@ -905,24 +905,24 @@ const L = class L {
|
|
|
905
905
|
}), r.__ng = n.__ng, r;
|
|
906
906
|
}) : i;
|
|
907
907
|
}, "#conv2"));
|
|
908
|
-
|
|
909
|
-
|
|
908
|
+
x(this, "count", /* @__PURE__ */ h(() => this.getValidData().length, "count"));
|
|
909
|
+
x(this, "get", /* @__PURE__ */ h((i, t) => {
|
|
910
910
|
var r;
|
|
911
911
|
const s = this.getValidData();
|
|
912
912
|
if (!s || s.length <= 0) return;
|
|
913
913
|
if (i == null) return e(this, Z).call(this, s);
|
|
914
914
|
if (i < 0 || i >= s.length) return null;
|
|
915
|
-
const n = typeof ((r = e(this,
|
|
915
|
+
const n = typeof ((r = e(this, T).fields) == null ? void 0 : r.get) == "function" ? e(this, T).fields.get() : [];
|
|
916
916
|
if (t != null) {
|
|
917
917
|
const o = n.indexOf(t);
|
|
918
918
|
return o >= 0 ? s[i].v[o] : null;
|
|
919
919
|
}
|
|
920
920
|
return e(this, Z).call(this, s[i]);
|
|
921
921
|
}, "get"));
|
|
922
|
-
y(this,
|
|
922
|
+
y(this, T, i), y(this, w, t), e(this, ge).call(this);
|
|
923
923
|
}
|
|
924
924
|
get source() {
|
|
925
|
-
return e(this, Z).call(this, e(this,
|
|
925
|
+
return e(this, Z).call(this, e(this, w).rawRecords);
|
|
926
926
|
}
|
|
927
927
|
set source(i) {
|
|
928
928
|
this.clear(), this.add(i, !1);
|
|
@@ -931,21 +931,21 @@ const L = class L {
|
|
|
931
931
|
return ++De(this, ue)._;
|
|
932
932
|
}
|
|
933
933
|
get length() {
|
|
934
|
-
return e(this,
|
|
934
|
+
return e(this, q).length;
|
|
935
935
|
}
|
|
936
936
|
getRowCount() {
|
|
937
937
|
return this.length;
|
|
938
938
|
}
|
|
939
939
|
};
|
|
940
|
-
|
|
941
|
-
|
|
940
|
+
T = new WeakMap(), w = new WeakMap(), q = new WeakMap(), K = new WeakMap(), ue = new WeakMap(), z = new WeakMap(), ge = new WeakMap(), ee = new WeakMap(), be = new WeakMap(), ye = new WeakMap(), Z = new WeakMap(), h(k, "ngData"), // π― ν μν μ μ μμλ₯Ό ν΄λμ€ λ΄λΆλ‘ λ΄μ¬ν
|
|
941
|
+
x(k, "ROW_STATE", {
|
|
942
942
|
EMPTY: "EMPTY",
|
|
943
943
|
NORMAL: "NORMAL",
|
|
944
944
|
INSERT: "INSERT",
|
|
945
945
|
UPDATE: "UPDATE",
|
|
946
946
|
DELETE: "DELETE"
|
|
947
947
|
});
|
|
948
|
-
let Re =
|
|
948
|
+
let Re = k;
|
|
949
949
|
const He = class He {
|
|
950
950
|
constructor(i) {
|
|
951
951
|
this.owner = i, this.row = new Ee(this), this.data = new Re(i, this), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.pageCnt = 25, this.viewRecords.reset = () => {
|