@ninebone/table 0.0.123 β 0.0.124
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 +91 -88
- 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
|
@@ -23,7 +23,7 @@ const me = class me extends Ie.constructor {
|
|
|
23
23
|
c(me, "Trace");
|
|
24
24
|
let ce = me;
|
|
25
25
|
const U = new ce();
|
|
26
|
-
var I, W, p, O, z,
|
|
26
|
+
var I, W, p, O, z, N, G, B, J;
|
|
27
27
|
const ve = class ve extends HTMLElement {
|
|
28
28
|
constructor() {
|
|
29
29
|
super();
|
|
@@ -32,20 +32,20 @@ const ve = class ve extends HTMLElement {
|
|
|
32
32
|
f(this, p);
|
|
33
33
|
f(this, O);
|
|
34
34
|
f(this, z);
|
|
35
|
-
f(this,
|
|
35
|
+
f(this, N);
|
|
36
36
|
f(this, G, /* @__PURE__ */ c(() => {
|
|
37
37
|
if (!e(this, I)) return;
|
|
38
38
|
const t = e(this, I).querySelector(".ng-container-body");
|
|
39
|
-
t && (y(this,
|
|
39
|
+
t && (y(this, N, new ResizeObserver(() => {
|
|
40
40
|
this.refresh();
|
|
41
|
-
})), e(this,
|
|
41
|
+
})), e(this, N).observe(t));
|
|
42
42
|
}, "#observeResize"));
|
|
43
43
|
v(this, "refresh", /* @__PURE__ */ c(() => {
|
|
44
44
|
if (!e(this, I) || !e(this, p) || e(this, W)) return;
|
|
45
45
|
const t = e(this, p).container, i = t.querySelector("table");
|
|
46
46
|
if (!i) return;
|
|
47
|
-
const n = e(this, p).track, o = e(this, p).thumb, r = e(this, I).querySelector(".ng-container-bottom"), l = t.clientWidth,
|
|
48
|
-
if (l !== 0 &&
|
|
47
|
+
const n = e(this, p).track, o = e(this, p).thumb, r = e(this, I).querySelector(".ng-container-bottom"), l = t.clientWidth, d = i.scrollWidth;
|
|
48
|
+
if (l !== 0 && d > l)
|
|
49
49
|
r && (r.style.display = "flex");
|
|
50
50
|
else {
|
|
51
51
|
r && (r.style.display = "none");
|
|
@@ -53,41 +53,41 @@ const ve = class ve extends HTMLElement {
|
|
|
53
53
|
}
|
|
54
54
|
const a = n.clientWidth;
|
|
55
55
|
if (a <= 0) return;
|
|
56
|
-
const g = Math.max(Math.min(a * (l /
|
|
56
|
+
const g = Math.max(Math.min(a * (l / d), a), 20);
|
|
57
57
|
o.style.width = `${g}px`;
|
|
58
|
-
let
|
|
58
|
+
let h = 0;
|
|
59
59
|
const u = i.style.transform;
|
|
60
60
|
if (u && u.includes("translateX")) {
|
|
61
61
|
const R = u.match(/translateX\(([-\d.]+)px\)/);
|
|
62
|
-
R && R[1] && (
|
|
62
|
+
R && R[1] && (h = parseFloat(R[1]));
|
|
63
63
|
} else
|
|
64
|
-
|
|
65
|
-
let b = parseInt(Math.abs(
|
|
64
|
+
h = parseInt(i.style.left || 0, 10);
|
|
65
|
+
let b = parseInt(Math.abs(h) * a / d, 10);
|
|
66
66
|
b < 0 && (b = 0);
|
|
67
67
|
const x = a - g;
|
|
68
68
|
b > x && (b = x), o.style.left = `${b}px`, e(this, p).left.disabled = b === 0, e(this, p).right.disabled = b >= x - 1;
|
|
69
69
|
}, "refresh"));
|
|
70
|
-
f(this,
|
|
70
|
+
f(this, B, /* @__PURE__ */ c((t) => {
|
|
71
71
|
if (!e(this, p)) return !1;
|
|
72
72
|
const i = e(this, p).container, n = i.querySelector("table");
|
|
73
73
|
if (!n) return !1;
|
|
74
74
|
const o = e(this, p).track.getBoundingClientRect(), r = e(this, p).thumb.clientWidth;
|
|
75
75
|
let l = t;
|
|
76
76
|
l < 0 && (l = 0);
|
|
77
|
-
const
|
|
78
|
-
l >
|
|
77
|
+
const d = o.width - r;
|
|
78
|
+
l > d && (l = d), l = parseInt(l, 10), e(this, p).thumb.style.left = `${l}px`, e(this, p).left.disabled = l === 0, e(this, p).right.disabled = l >= d - 1;
|
|
79
79
|
const a = i.clientWidth, g = n.scrollWidth;
|
|
80
|
-
let
|
|
81
|
-
return -
|
|
80
|
+
let h = d > 0 ? -l * (g - a) / d : 0;
|
|
81
|
+
return -h > g - a && (h = -(g - a)), -h + 5 > g - a && (h = -(g - a)), a >= g && (h = 0), n.style.transform = `translateX(${h}px)`, l > 0 && l < d - 1;
|
|
82
82
|
}, "#thumbMoveTo"));
|
|
83
83
|
f(this, J, /* @__PURE__ */ c(() => {
|
|
84
84
|
const t = /* @__PURE__ */ c((n) => {
|
|
85
85
|
clearInterval(e(this, O)), clearInterval(e(this, z));
|
|
86
86
|
const o = parseInt(e(this, p).thumb.style.left || 0, 10);
|
|
87
|
-
e(this,
|
|
87
|
+
e(this, B).call(this, o + n), y(this, O, setInterval(() => {
|
|
88
88
|
clearInterval(e(this, O)), y(this, z, setInterval(() => {
|
|
89
89
|
const r = parseInt(e(this, p).thumb.style.left || 0, 10);
|
|
90
|
-
e(this,
|
|
90
|
+
e(this, B).call(this, r + n) || clearInterval(e(this, z));
|
|
91
91
|
}, 50));
|
|
92
92
|
}, 500));
|
|
93
93
|
}, "delayScroll"), i = /* @__PURE__ */ c(() => {
|
|
@@ -103,14 +103,14 @@ const ve = class ve extends HTMLElement {
|
|
|
103
103
|
if (n.button !== 0) return;
|
|
104
104
|
n.preventDefault();
|
|
105
105
|
const o = e(this, p).track.getBoundingClientRect(), r = e(this, p).thumb.clientWidth;
|
|
106
|
-
e(this,
|
|
106
|
+
e(this, B).call(this, n.clientX - o.left - r / 2);
|
|
107
107
|
}), e(this, p).thumb.addEventListener("mousedown", (n) => {
|
|
108
108
|
if (n.button !== 0) return;
|
|
109
109
|
n.stopPropagation(), n.preventDefault(), y(this, W, !0), this.shiftX = n.clientX - e(this, p).thumb.getBoundingClientRect().left;
|
|
110
110
|
const o = /* @__PURE__ */ c((l) => {
|
|
111
111
|
if (!e(this, W)) return;
|
|
112
|
-
const
|
|
113
|
-
e(this,
|
|
112
|
+
const d = e(this, p).track.getBoundingClientRect();
|
|
113
|
+
e(this, B).call(this, l.clientX - d.left - this.shiftX);
|
|
114
114
|
}, "onMouseMove"), r = /* @__PURE__ */ c(() => {
|
|
115
115
|
y(this, W, !1), i(), document.removeEventListener("mousemove", o), document.removeEventListener("mouseup", r), this.refresh();
|
|
116
116
|
}, "onMouseUp");
|
|
@@ -200,16 +200,16 @@ const ve = class ve extends HTMLElement {
|
|
|
200
200
|
t();
|
|
201
201
|
}
|
|
202
202
|
disconnectedCallback() {
|
|
203
|
-
e(this,
|
|
203
|
+
e(this, N) && e(this, N).disconnect();
|
|
204
204
|
}
|
|
205
205
|
};
|
|
206
|
-
I = new WeakMap(), W = new WeakMap(), p = new WeakMap(), O = new WeakMap(), z = new WeakMap(),
|
|
206
|
+
I = new WeakMap(), W = new WeakMap(), p = new WeakMap(), O = new WeakMap(), z = new WeakMap(), N = new WeakMap(), G = new WeakMap(), B = new WeakMap(), J = new WeakMap(), c(ve, "NineTableHScrollBar");
|
|
207
207
|
let he = ve;
|
|
208
208
|
customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar", he);
|
|
209
|
-
var
|
|
209
|
+
var X, M, C;
|
|
210
210
|
const xe = class xe {
|
|
211
211
|
constructor(s) {
|
|
212
|
-
f(this,
|
|
212
|
+
f(this, X);
|
|
213
213
|
f(this, M, []);
|
|
214
214
|
f(this, C, null);
|
|
215
215
|
v(this, "initTemplate", /* @__PURE__ */ c((s) => {
|
|
@@ -231,19 +231,22 @@ const xe = class xe {
|
|
|
231
231
|
n.appendChild(l.cloneNode(!0));
|
|
232
232
|
}), i ? i.before(n) : t.appendChild(n);
|
|
233
233
|
let o = 0;
|
|
234
|
-
return t.querySelectorAll("tr:not(.nodata)").forEach((l,
|
|
234
|
+
return t.querySelectorAll("tr:not(.nodata)").forEach((l, d) => {
|
|
235
235
|
const a = l.offsetHeight;
|
|
236
236
|
if (a === 0)
|
|
237
|
-
throw new Error(`[RowManager] Rendered TR[${
|
|
238
|
-
o += a, U.log(`[RowManager] Measured TR[${
|
|
237
|
+
throw new Error(`[RowManager] Rendered TR[${d}] height is 0. Check CSS styles.`);
|
|
238
|
+
o += a, U.log(`[RowManager] Measured TR[${d}] height: ${a}px`);
|
|
239
239
|
}), y(this, C, o), console.log(`[RowManager] Template Height Cached Successfully: ${e(this, C)}px`), e(this, C);
|
|
240
240
|
}, "measureAndCacheHeight"));
|
|
241
241
|
/**
|
|
242
|
-
* π― nine-table-sheet
|
|
242
|
+
* π― μ΅μλ¨ nine-table-sheetμ λμ΄λ₯Ό κΈ°μ€μΌλ‘ νμν ν κ°―μ μ°μ
|
|
243
243
|
*/
|
|
244
244
|
v(this, "calculateRequiredRowCount", /* @__PURE__ */ c((s) => {
|
|
245
|
-
const t = e(this,
|
|
246
|
-
|
|
245
|
+
const t = e(this, X) instanceof HTMLElement ? e(this, X) : s;
|
|
246
|
+
let i = t.clientHeight || t.getBoundingClientRect().height;
|
|
247
|
+
(!i || i === 0) && (i = t.offsetHeight || (t.parentElement ? t.parentElement.clientHeight : 400));
|
|
248
|
+
const n = e(this, C) !== null ? e(this, C) : this.measureAndCacheHeight(s), l = Math.ceil(i / n) + 20;
|
|
249
|
+
return console.log(`[RowManager] NineTableSheet Height: ${i}px | Template Height: ${n}px | Target Rows: ${l}`), l;
|
|
247
250
|
}, "calculateRequiredRowCount"));
|
|
248
251
|
v(this, "renderRows", /* @__PURE__ */ c((s, t = null) => {
|
|
249
252
|
if (e(this, M).length === 0) return;
|
|
@@ -253,18 +256,18 @@ const xe = class xe {
|
|
|
253
256
|
const n = i.querySelector("tr.nodata"), o = document.createDocumentFragment(), r = t !== null ? t : this.calculateRequiredRowCount(s);
|
|
254
257
|
console.log(`[RowManager] Rendering ${r} row sets into container...`);
|
|
255
258
|
for (let l = 0; l < r; l++)
|
|
256
|
-
e(this, M).forEach((
|
|
257
|
-
o.appendChild(
|
|
259
|
+
e(this, M).forEach((d) => {
|
|
260
|
+
o.appendChild(d.cloneNode(!0));
|
|
258
261
|
});
|
|
259
262
|
n ? n.before(o) : i.appendChild(o), console.log(`[RowManager] Successfully rendered. Total DOM tr count: ${i.querySelectorAll("tr:not(.nodata)").length}`);
|
|
260
263
|
}, "renderRows"));
|
|
261
|
-
y(this,
|
|
264
|
+
y(this, X, s);
|
|
262
265
|
}
|
|
263
266
|
get templateLength() {
|
|
264
267
|
return e(this, M).length || 1;
|
|
265
268
|
}
|
|
266
269
|
};
|
|
267
|
-
|
|
270
|
+
X = new WeakMap(), M = new WeakMap(), C = new WeakMap(), c(xe, "RowManager");
|
|
268
271
|
let de = xe;
|
|
269
272
|
var k, L, Q;
|
|
270
273
|
const Y = class Y extends HTMLElement {
|
|
@@ -283,19 +286,19 @@ const Y = class Y extends HTMLElement {
|
|
|
283
286
|
ae.setAttribute("width", A), R.appendChild(ae);
|
|
284
287
|
}
|
|
285
288
|
u.prepend(R);
|
|
286
|
-
}, "ensureColgroup"),
|
|
289
|
+
}, "ensureColgroup"), h = /* @__PURE__ */ c((u) => {
|
|
287
290
|
if (u.querySelector("thead")) return;
|
|
288
291
|
const b = document.createElement("thead"), x = u.querySelector("colgroup");
|
|
289
292
|
x ? x.after(b) : u.prepend(b);
|
|
290
293
|
}, "ensureThead");
|
|
291
|
-
return g(a),
|
|
294
|
+
return g(a), h(a), a.classList.add("nine-table-element"), a;
|
|
292
295
|
}, "initializeTable"), n = t.cloneNode(!0);
|
|
293
296
|
y(this, k, i(n)), e(this, k).style.display = "table", e(this, L).initTemplate(e(this, k));
|
|
294
|
-
const o = this.querySelector(".ng-container-left"), r = this.querySelector(".ng-container-body"), l = this.querySelector(".ng-container-right"),
|
|
297
|
+
const o = this.querySelector(".ng-container-left"), r = this.querySelector(".ng-container-body"), l = this.querySelector(".ng-container-right"), d = /* @__PURE__ */ c((a, g, h = !1) => {
|
|
295
298
|
const u = a.cloneNode(!0), b = Array.from(u.querySelectorAll("colgroup col")), x = [];
|
|
296
299
|
return b.forEach((R, A) => {
|
|
297
300
|
const E = R.getAttribute("fixed");
|
|
298
|
-
(
|
|
301
|
+
(h ? !E || E === "" : E === g) || x.push(A);
|
|
299
302
|
}), x.reverse().forEach((R) => {
|
|
300
303
|
b[R] && b[R].remove(), u.querySelectorAll("tr").forEach((A) => {
|
|
301
304
|
const E = A.querySelectorAll("th, td");
|
|
@@ -304,30 +307,30 @@ const Y = class Y extends HTMLElement {
|
|
|
304
307
|
}), u;
|
|
305
308
|
}, "filterTableByFixed");
|
|
306
309
|
if (r) {
|
|
307
|
-
const a =
|
|
310
|
+
const a = d(e(this, k), null, !0);
|
|
308
311
|
r.innerHTML = "", r.appendChild(a), e(this, L).measureAndCacheHeight(r), e(this, L).renderRows(r);
|
|
309
312
|
}
|
|
310
313
|
if (o) {
|
|
311
|
-
const a =
|
|
314
|
+
const a = d(e(this, k), "left", !1);
|
|
312
315
|
let g = 0;
|
|
313
316
|
a.querySelectorAll("col").forEach((b) => {
|
|
314
317
|
const x = parseInt(b.getAttribute("width"), 10);
|
|
315
318
|
isNaN(x) || (g += x);
|
|
316
319
|
}), o.innerHTML = "", o.appendChild(a);
|
|
317
|
-
const
|
|
318
|
-
e(this, L).renderRows(o,
|
|
320
|
+
const h = e(this, L).calculateRequiredRowCount(o);
|
|
321
|
+
e(this, L).renderRows(o, h);
|
|
319
322
|
const u = g > 0 ? g : 0;
|
|
320
323
|
o.style.flex = `0 0 ${u}px`, o.style.width = `${u}px`;
|
|
321
324
|
}
|
|
322
325
|
if (l) {
|
|
323
|
-
const a =
|
|
326
|
+
const a = d(e(this, k), "right", !1);
|
|
324
327
|
let g = 0;
|
|
325
328
|
a.querySelectorAll("col").forEach((b) => {
|
|
326
329
|
const x = parseInt(b.getAttribute("width"), 10);
|
|
327
330
|
isNaN(x) || (g += x);
|
|
328
331
|
}), l.innerHTML = "", l.appendChild(a);
|
|
329
|
-
const
|
|
330
|
-
e(this, L).renderRows(l,
|
|
332
|
+
const h = e(this, L).calculateRequiredRowCount(l);
|
|
333
|
+
e(this, L).renderRows(l, h);
|
|
331
334
|
const u = g > 0 ? g : 0;
|
|
332
335
|
l.style.flex = `0 0 ${u}px`, l.style.width = `${u}px`;
|
|
333
336
|
}
|
|
@@ -496,44 +499,44 @@ const Re = class Re extends HTMLElement {
|
|
|
496
499
|
}, "#init"));
|
|
497
500
|
v(this, "switchSheet", /* @__PURE__ */ c((t, i = !1) => {
|
|
498
501
|
const n = /* @__PURE__ */ c(() => {
|
|
499
|
-
const
|
|
500
|
-
|
|
501
|
-
const x = parseInt(b.dataset.splitIndex, 10), R =
|
|
502
|
+
const h = this.querySelector("nine-table-sheets-body");
|
|
503
|
+
h.querySelectorAll("nine-splitter").forEach((b) => {
|
|
504
|
+
const x = parseInt(b.dataset.splitIndex, 10), R = h.querySelector(`nine-table-sheet[data-index="${x - 1}"]`), A = h.querySelector(`nine-table-sheet[data-index="${x}"]`);
|
|
502
505
|
R && A && R.classList.contains("active") && A.classList.contains("active") ? b.classList.add("active") : b.classList.remove("active");
|
|
503
506
|
});
|
|
504
|
-
}, "updateSplitters"), o = this.querySelector(".nine-tab-bar"), r = this.querySelector("nine-table-sheets-body"), l = o.querySelectorAll(".nine-tab-item"),
|
|
507
|
+
}, "updateSplitters"), o = this.querySelector(".nine-tab-bar"), r = this.querySelector("nine-table-sheets-body"), l = o.querySelectorAll(".nine-tab-item"), d = r.querySelectorAll("nine-table-sheet");
|
|
505
508
|
if (!l[t]) return;
|
|
506
509
|
if (!i)
|
|
507
|
-
l.forEach((
|
|
508
|
-
|
|
510
|
+
l.forEach((h, u) => {
|
|
511
|
+
h.classList.toggle("active", u === t);
|
|
509
512
|
const b = r.querySelector(`nine-table-sheet[data-index="${u}"]`);
|
|
510
513
|
b && (b.style.flex = "");
|
|
511
|
-
}),
|
|
512
|
-
|
|
514
|
+
}), d.forEach((h, u) => {
|
|
515
|
+
h.classList.toggle("active", u === t);
|
|
513
516
|
});
|
|
514
517
|
else {
|
|
515
|
-
const
|
|
516
|
-
if (
|
|
518
|
+
const h = l[t], u = o.querySelectorAll(".nine-tab-item.active");
|
|
519
|
+
if (h.classList.contains("active") && u.length <= 1)
|
|
517
520
|
return;
|
|
518
|
-
|
|
521
|
+
h.classList.toggle("active");
|
|
519
522
|
const b = r.querySelector(`nine-table-sheet[data-index="${t}"]`);
|
|
520
523
|
b && (b.classList.toggle("active"), b.classList.contains("active") || (b.style.flex = ""));
|
|
521
524
|
}
|
|
522
525
|
const a = Array.from(r.querySelectorAll("nine-table-sheet.active"));
|
|
523
526
|
if (a.length > 1) {
|
|
524
|
-
const
|
|
527
|
+
const h = 1 / a.length;
|
|
525
528
|
a.forEach((u) => {
|
|
526
|
-
(!u.style.flex || u.style.flex === "1 1 100%") && (u.style.flex = `${
|
|
529
|
+
(!u.style.flex || u.style.flex === "1 1 100%") && (u.style.flex = `${h} ${h} 0px`);
|
|
527
530
|
});
|
|
528
531
|
} else
|
|
529
|
-
a.forEach((
|
|
530
|
-
|
|
532
|
+
a.forEach((h) => {
|
|
533
|
+
h.style.flex = "1 1 100%";
|
|
531
534
|
});
|
|
532
535
|
n();
|
|
533
536
|
const g = r.querySelector("nine-table-sheet.active");
|
|
534
537
|
if (g && typeof g.getRowCount == "function") {
|
|
535
|
-
const
|
|
536
|
-
|
|
538
|
+
const h = this.querySelector("#row-count");
|
|
539
|
+
h && (h.textContent = g.getRowCount().toLocaleString());
|
|
537
540
|
}
|
|
538
541
|
}, "switchSheet"));
|
|
539
542
|
}
|
|
@@ -560,13 +563,13 @@ const Se = class Se {
|
|
|
560
563
|
var A, E;
|
|
561
564
|
const t = (A = s.shadowRoot) == null ? void 0 : A.querySelector("nine-table-sheet.active");
|
|
562
565
|
if (!t) return;
|
|
563
|
-
const i = ((E = t.getRowCount) == null ? void 0 : E.call(t)) || 0, n = parseInt(s.getAttribute("max-display-row"), 10) || 10, o = Math.min(i, n), r = t.querySelector("tbody tr") || t.querySelector("tr"), l = r ? r.getBoundingClientRect().height : 32,
|
|
566
|
+
const i = ((E = t.getRowCount) == null ? void 0 : E.call(t)) || 0, n = parseInt(s.getAttribute("max-display-row"), 10) || 10, o = Math.min(i, n), r = t.querySelector("tbody tr") || t.querySelector("tr"), l = r ? r.getBoundingClientRect().height : 32, d = e(this, _).querySelector("nine-table-header"), a = e(this, _).querySelector("nine-table-sheets-footer"), g = d ? d.getBoundingClientRect().height : 40, h = a ? a.getBoundingClientRect().height : 32, b = g + h + 16, x = o * l + b;
|
|
564
567
|
s.style.height = `${x}px`, s.style.maxHeight = `${n * l + b}px`;
|
|
565
568
|
const R = e(this, _).querySelector("nine-table-sheets-body");
|
|
566
569
|
R && (R.style.overflowY = i > n ? "auto" : "hidden");
|
|
567
570
|
}, "#applyAutoHeight"));
|
|
568
571
|
f(this, se, /* @__PURE__ */ c(() => {
|
|
569
|
-
const s = e(this, _).host, i = Array.from(s.children).filter((
|
|
572
|
+
const s = e(this, _).host, i = Array.from(s.children).filter((d) => d.tagName === "TABLE"), n = s.getAttribute("auto-height") === "true", o = i.map((d, a) => `<nine-table-sheet class="${a === 0 ? "active" : ""}" data-index="${a}"></nine-table-sheet>`).join(""), r = i.map((d, a) => `<div class="nine-tab-item ${a === 0 ? "active" : ""}" data-index="${a}">Sheet ${a + 1}</div>`).join("");
|
|
570
573
|
e(this, _).innerHTML = `
|
|
571
574
|
<style>
|
|
572
575
|
:host {
|
|
@@ -666,9 +669,9 @@ const Se = class Se {
|
|
|
666
669
|
<nine-table-footer></nine-table-footer>
|
|
667
670
|
`;
|
|
668
671
|
const l = e(this, _).querySelectorAll("nine-table-sheet");
|
|
669
|
-
l == null || l.forEach((
|
|
672
|
+
l == null || l.forEach((d, a) => {
|
|
670
673
|
i[a] && setTimeout(() => {
|
|
671
|
-
|
|
674
|
+
d.init(i[a]), n && e(this, K).call(this, s);
|
|
672
675
|
});
|
|
673
676
|
});
|
|
674
677
|
}, "#render"));
|
|
@@ -677,36 +680,36 @@ const Se = class Se {
|
|
|
677
680
|
};
|
|
678
681
|
_ = new WeakMap(), Z = new WeakMap(), te = new WeakMap(), K = new WeakMap(), se = new WeakMap(), c(Se, "LayoutManager");
|
|
679
682
|
let be = Se;
|
|
680
|
-
var $,
|
|
683
|
+
var $, D;
|
|
681
684
|
const Ee = class Ee {
|
|
682
685
|
constructor(s) {
|
|
683
686
|
f(this, $);
|
|
684
|
-
f(this,
|
|
687
|
+
f(this, D, -1);
|
|
685
688
|
v(this, "count", /* @__PURE__ */ c(() => e(this, $).rawRecords.length, "count"));
|
|
686
689
|
y(this, $, s);
|
|
687
690
|
}
|
|
688
691
|
get at() {
|
|
689
|
-
return e(this,
|
|
692
|
+
return e(this, D);
|
|
690
693
|
}
|
|
691
694
|
set at(s) {
|
|
692
695
|
var i, n;
|
|
693
|
-
y(this,
|
|
696
|
+
y(this, D, parseInt(s, 10));
|
|
694
697
|
const t = ((n = (i = e(this, $).owner).querySelector) == null ? void 0 : n.call(i, ".ng-container-body")) || e(this, $).owner.body;
|
|
695
|
-
t && !t.querySelector(`tbody.bindable tr[data-row="${e(this,
|
|
698
|
+
t && !t.querySelector(`tbody.bindable tr[data-row="${e(this, D)}"]`) && setTimeout(() => {
|
|
696
699
|
var o, r;
|
|
697
|
-
(r = (o = e(this, $).owner).scrollTo_V1) == null || r.call(o, e(this,
|
|
700
|
+
(r = (o = e(this, $).owner).scrollTo_V1) == null || r.call(o, e(this, D));
|
|
698
701
|
});
|
|
699
702
|
}
|
|
700
703
|
};
|
|
701
|
-
$ = new WeakMap(),
|
|
704
|
+
$ = new WeakMap(), D = new WeakMap(), c(Ee, "ngRow");
|
|
702
705
|
let ge = Ee;
|
|
703
|
-
var S, m, q,
|
|
706
|
+
var S, m, q, F, ie, H, ne, j, re, oe, V;
|
|
704
707
|
const T = class T {
|
|
705
708
|
constructor(s, t) {
|
|
706
709
|
f(this, S);
|
|
707
710
|
f(this, m);
|
|
708
711
|
f(this, q, []);
|
|
709
|
-
f(this,
|
|
712
|
+
f(this, F, []);
|
|
710
713
|
f(this, ie, 0);
|
|
711
714
|
f(this, H, []);
|
|
712
715
|
f(this, ne, /* @__PURE__ */ c(() => {
|
|
@@ -732,11 +735,11 @@ const T = class T {
|
|
|
732
735
|
_: [0, 0, 0, 0, T.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, e(this, H).slice(), -1, {}, {}]
|
|
733
736
|
}), "#getDefaultMeta"));
|
|
734
737
|
v(this, "reset", /* @__PURE__ */ c(() => {
|
|
735
|
-
y(this, q, []), y(this,
|
|
738
|
+
y(this, q, []), y(this, F, []);
|
|
736
739
|
}, "reset"));
|
|
737
740
|
v(this, "clear", /* @__PURE__ */ c(() => {
|
|
738
741
|
var s;
|
|
739
|
-
e(this, m).rawRecords = [], y(this, q, []), y(this,
|
|
742
|
+
e(this, m).rawRecords = [], y(this, q, []), y(this, F, []), (s = e(this, m).viewRecords) != null && s.reset && e(this, m).viewRecords.reset();
|
|
740
743
|
}, "clear"));
|
|
741
744
|
f(this, re, /* @__PURE__ */ c((s) => {
|
|
742
745
|
var n;
|
|
@@ -759,8 +762,8 @@ const T = class T {
|
|
|
759
762
|
e(this, m).rawRecords = e(this, m).rawRecords.concat(e(this, oe).call(this, i)), this.resetRecords();
|
|
760
763
|
const n = this.count() - 1;
|
|
761
764
|
return t || i.forEach((r, l) => {
|
|
762
|
-
const
|
|
763
|
-
|
|
765
|
+
const d = e(this, m).rawRecords[n - l];
|
|
766
|
+
d && (d.__ng.rowState = T.ROW_STATE.EMPTY);
|
|
764
767
|
}), (o = e(this, m).viewRecords) != null && o.reset && e(this, m).viewRecords.reset(), n;
|
|
765
768
|
}, "add"));
|
|
766
769
|
v(this, "delete", /* @__PURE__ */ c((s) => {
|
|
@@ -776,9 +779,9 @@ const T = class T {
|
|
|
776
779
|
}), this.resetRecords(), (i = e(this, m).viewRecords) != null && i.reset && e(this, m).viewRecords.reset();
|
|
777
780
|
}, "delete"));
|
|
778
781
|
v(this, "setValue", /* @__PURE__ */ c((s, t, i) => {
|
|
779
|
-
var
|
|
782
|
+
var d;
|
|
780
783
|
s = parseInt(s, 10);
|
|
781
|
-
const o = (typeof ((
|
|
784
|
+
const o = (typeof ((d = e(this, S).fields) == null ? void 0 : d.get) == "function" ? e(this, S).fields.get() : []).indexOf(t);
|
|
782
785
|
if (o < 0) return;
|
|
783
786
|
const r = this.getValidData()[s];
|
|
784
787
|
if (!r) return;
|
|
@@ -786,14 +789,14 @@ const T = class T {
|
|
|
786
789
|
l !== i && r.__ng.rowState !== T.ROW_STATE.INSERT && (r.__ng.o.hasOwnProperty(t) || (r.__ng.o[t] = l), r.__ng.rowState = T.ROW_STATE.UPDATE), r.v[o] = i, e(this, m).owner.refreshData && e(this, m).owner.refreshData(s);
|
|
787
790
|
}, "setValue"));
|
|
788
791
|
v(this, "resetRecords", /* @__PURE__ */ c(() => {
|
|
789
|
-
y(this,
|
|
792
|
+
y(this, F, e(this, m).rawRecords.filter((s) => !s.__ng.deleted)), y(this, q, e(this, m).rawRecords.filter((s) => !s.__ng.deleted && !s.__ng.filtered)), e(this, m).rawRecords.forEach((s, t) => {
|
|
790
793
|
s.__ng.rowidx = t;
|
|
791
794
|
}), e(this, q).forEach((s, t) => {
|
|
792
795
|
s.__ng.i = t;
|
|
793
796
|
});
|
|
794
797
|
}, "resetRecords"));
|
|
795
798
|
v(this, "getValidData", /* @__PURE__ */ c(() => (e(this, q).length === 0 && e(this, m).rawRecords.length > 0 && this.resetRecords(), e(this, q)), "getValidData"));
|
|
796
|
-
f(this,
|
|
799
|
+
f(this, V, /* @__PURE__ */ c((s) => {
|
|
797
800
|
var i;
|
|
798
801
|
if (!s) return s;
|
|
799
802
|
const t = typeof ((i = e(this, S).fields) == null ? void 0 : i.get) == "function" ? e(this, S).fields.get() : [];
|
|
@@ -809,19 +812,19 @@ const T = class T {
|
|
|
809
812
|
var o;
|
|
810
813
|
const i = this.getValidData();
|
|
811
814
|
if (!i || i.length <= 0) return;
|
|
812
|
-
if (s == null) return e(this,
|
|
815
|
+
if (s == null) return e(this, V).call(this, i);
|
|
813
816
|
if (s < 0 || s >= i.length) return null;
|
|
814
817
|
const n = typeof ((o = e(this, S).fields) == null ? void 0 : o.get) == "function" ? e(this, S).fields.get() : [];
|
|
815
818
|
if (t != null) {
|
|
816
819
|
const r = n.indexOf(t);
|
|
817
820
|
return r >= 0 ? i[s].v[r] : null;
|
|
818
821
|
}
|
|
819
|
-
return e(this,
|
|
822
|
+
return e(this, V).call(this, i[s]);
|
|
820
823
|
}, "get"));
|
|
821
824
|
y(this, S, s), y(this, m, t), e(this, ne).call(this);
|
|
822
825
|
}
|
|
823
826
|
get source() {
|
|
824
|
-
return e(this,
|
|
827
|
+
return e(this, V).call(this, e(this, m).rawRecords);
|
|
825
828
|
}
|
|
826
829
|
set source(s) {
|
|
827
830
|
this.clear(), this.add(s, !1);
|
|
@@ -830,7 +833,7 @@ const T = class T {
|
|
|
830
833
|
return ++Le(this, ie)._;
|
|
831
834
|
}
|
|
832
835
|
};
|
|
833
|
-
S = new WeakMap(), m = new WeakMap(), q = new WeakMap(),
|
|
836
|
+
S = new WeakMap(), m = new WeakMap(), q = new WeakMap(), F = new WeakMap(), ie = new WeakMap(), H = new WeakMap(), ne = new WeakMap(), j = new WeakMap(), re = new WeakMap(), oe = new WeakMap(), V = new WeakMap(), c(T, "ngData"), // π― ν μν μ μ μμλ₯Ό ν΄λμ€ λ΄λΆλ‘ λ΄μ¬ν
|
|
834
837
|
v(T, "ROW_STATE", {
|
|
835
838
|
EMPTY: "EMPTY",
|
|
836
839
|
NORMAL: "NORMAL",
|