@ninebone/table 0.0.133 → 0.0.135
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 +111 -108
- 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
|
@@ -44,27 +44,27 @@ const Te = class Te extends HTMLElement {
|
|
|
44
44
|
if (!e(this, _) || !e(this, y) || e(this, O)) return;
|
|
45
45
|
const t = e(this, y).container, s = t.querySelector("table");
|
|
46
46
|
if (!s) return;
|
|
47
|
-
const n = e(this, y).track, o = e(this, y).thumb, r = e(this, _).querySelector(".ng-container-bottom"),
|
|
48
|
-
if (
|
|
47
|
+
const n = e(this, y).track, o = e(this, y).thumb, r = e(this, _).querySelector(".ng-container-bottom"), a = t.clientWidth, u = s.scrollWidth;
|
|
48
|
+
if (a !== 0 && u > a)
|
|
49
49
|
r && (r.style.display = "flex");
|
|
50
50
|
else {
|
|
51
51
|
r && (r.style.display = "none");
|
|
52
52
|
return;
|
|
53
53
|
}
|
|
54
|
-
const
|
|
55
|
-
if (
|
|
56
|
-
const
|
|
57
|
-
o.style.width = `${
|
|
54
|
+
const l = n.clientWidth;
|
|
55
|
+
if (l <= 0) return;
|
|
56
|
+
const g = Math.max(Math.min(l * (a / u), l), 20);
|
|
57
|
+
o.style.width = `${g}px`;
|
|
58
58
|
let h = 0;
|
|
59
|
-
const
|
|
60
|
-
if (
|
|
61
|
-
const x =
|
|
59
|
+
const b = s.style.transform;
|
|
60
|
+
if (b && b.includes("translateX")) {
|
|
61
|
+
const x = b.match(/translateX\(([-\d.]+)px\)/);
|
|
62
62
|
x && x[1] && (h = parseFloat(x[1]));
|
|
63
63
|
} else
|
|
64
64
|
h = parseInt(s.style.left || 0, 10);
|
|
65
|
-
let d = parseInt(Math.abs(h) *
|
|
65
|
+
let d = parseInt(Math.abs(h) * l / u, 10);
|
|
66
66
|
d < 0 && (d = 0);
|
|
67
|
-
const S =
|
|
67
|
+
const S = l - g;
|
|
68
68
|
d > S && (d = S), o.style.left = `${d}px`, e(this, y).left.disabled = d === 0, e(this, y).right.disabled = d >= S - 1;
|
|
69
69
|
}, "refresh"));
|
|
70
70
|
f(this, P, /* @__PURE__ */ c((t) => {
|
|
@@ -72,13 +72,13 @@ const Te = class Te extends HTMLElement {
|
|
|
72
72
|
const s = e(this, y).container, n = s.querySelector("table");
|
|
73
73
|
if (!n) return !1;
|
|
74
74
|
const o = e(this, y).track.getBoundingClientRect(), r = e(this, y).thumb.clientWidth;
|
|
75
|
-
let
|
|
76
|
-
|
|
75
|
+
let a = t;
|
|
76
|
+
a < 0 && (a = 0);
|
|
77
77
|
const u = o.width - r;
|
|
78
|
-
|
|
79
|
-
const
|
|
80
|
-
let h = u > 0 ? -
|
|
81
|
-
return -h >
|
|
78
|
+
a > u && (a = u), a = parseInt(a, 10), e(this, y).thumb.style.left = `${a}px`, e(this, y).left.disabled = a === 0, e(this, y).right.disabled = a >= u - 1;
|
|
79
|
+
const l = s.clientWidth, g = n.scrollWidth;
|
|
80
|
+
let h = u > 0 ? -a * (g - l) / u : 0;
|
|
81
|
+
return -h > g - l && (h = -(g - l)), -h + 5 > g - l && (h = -(g - l)), l >= g && (h = 0), n.style.transform = `translateX(${h}px)`, a > 0 && a < u - 1;
|
|
82
82
|
}, "#thumbMoveTo"));
|
|
83
83
|
f(this, te, /* @__PURE__ */ c(() => {
|
|
84
84
|
const t = /* @__PURE__ */ c((n) => {
|
|
@@ -107,10 +107,10 @@ const Te = class Te extends HTMLElement {
|
|
|
107
107
|
}), e(this, y).thumb.addEventListener("mousedown", (n) => {
|
|
108
108
|
if (n.button !== 0) return;
|
|
109
109
|
n.stopPropagation(), n.preventDefault(), p(this, O, !0), this.shiftX = n.clientX - e(this, y).thumb.getBoundingClientRect().left;
|
|
110
|
-
const o = /* @__PURE__ */ c((
|
|
110
|
+
const o = /* @__PURE__ */ c((a) => {
|
|
111
111
|
if (!e(this, O)) return;
|
|
112
112
|
const u = e(this, y).track.getBoundingClientRect();
|
|
113
|
-
e(this, P).call(this,
|
|
113
|
+
e(this, P).call(this, a.clientX - u.left - this.shiftX);
|
|
114
114
|
}, "onMouseMove"), r = /* @__PURE__ */ c(() => {
|
|
115
115
|
p(this, O, !1), s(), document.removeEventListener("mousemove", o), document.removeEventListener("mouseup", r), this.refresh();
|
|
116
116
|
}, "onMouseUp");
|
|
@@ -231,13 +231,13 @@ const qe = class qe {
|
|
|
231
231
|
if (n > 0) {
|
|
232
232
|
const o = s.clientHeight || s.getBoundingClientRect().height || n;
|
|
233
233
|
let r = 0;
|
|
234
|
-
const
|
|
235
|
-
u && (r += u.offsetHeight || u.getBoundingClientRect().height),
|
|
236
|
-
const
|
|
237
|
-
if (e(this, I) !==
|
|
234
|
+
const a = s.querySelector(".ng-container-body") || s, u = a.querySelector("thead"), l = a.querySelector("tfoot");
|
|
235
|
+
u && (r += u.offsetHeight || u.getBoundingClientRect().height), l && (r += l.offsetHeight || l.getBoundingClientRect().height);
|
|
236
|
+
const g = Math.max(o - r, 100);
|
|
237
|
+
if (e(this, I) !== g && (p(this, I, g), e(this, q) !== null)) {
|
|
238
238
|
const h = Math.ceil(e(this, I) / e(this, q));
|
|
239
|
-
p(this, H, h + 20), j.log(`[RowManager] Resized. Height: ${e(this, I)}px | Target Rows: ${e(this, H)}`), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((
|
|
240
|
-
const d = s.querySelector(
|
|
239
|
+
p(this, H, h + 20), j.log(`[RowManager] Resized. Height: ${e(this, I)}px | Target Rows: ${e(this, H)}`), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((b) => {
|
|
240
|
+
const d = s.querySelector(b);
|
|
241
241
|
d && d.querySelector("tbody") && this.renderRows(d);
|
|
242
242
|
});
|
|
243
243
|
}
|
|
@@ -258,20 +258,20 @@ const qe = class qe {
|
|
|
258
258
|
throw new Error("[RowManager] Template TRs are empty.");
|
|
259
259
|
const t = i.querySelector("tbody.bindable") || i.querySelector("tbody");
|
|
260
260
|
if (!t) return 24;
|
|
261
|
-
t.querySelectorAll("tr:not(.nodata)").forEach((
|
|
261
|
+
t.querySelectorAll("tr:not(.nodata)").forEach((a) => a.remove());
|
|
262
262
|
const s = t.querySelector("tr.nodata"), n = document.createDocumentFragment();
|
|
263
|
-
e(this, M).forEach((
|
|
264
|
-
n.appendChild(
|
|
263
|
+
e(this, M).forEach((a) => {
|
|
264
|
+
n.appendChild(a.cloneNode(!0));
|
|
265
265
|
}), s ? s.before(n) : t.appendChild(n);
|
|
266
266
|
let o = 0;
|
|
267
|
-
if (t.querySelectorAll("tr:not(.nodata)").forEach((
|
|
268
|
-
const
|
|
269
|
-
if (
|
|
267
|
+
if (t.querySelectorAll("tr:not(.nodata)").forEach((a, u) => {
|
|
268
|
+
const l = a.offsetHeight;
|
|
269
|
+
if (l === 0)
|
|
270
270
|
throw new Error(`[RowManager] Rendered TR[${u}] height is 0. Check CSS styles.`);
|
|
271
|
-
o +=
|
|
271
|
+
o += l;
|
|
272
272
|
}), p(this, q, o), e(this, I) > 0) {
|
|
273
|
-
const
|
|
274
|
-
p(this, H,
|
|
273
|
+
const a = Math.ceil(e(this, I) / e(this, q));
|
|
274
|
+
p(this, H, a + 20);
|
|
275
275
|
}
|
|
276
276
|
return console.log(`[RowManager] Template Height Cached: ${e(this, q)}px | RowCount: ${e(this, H)}`), e(this, q);
|
|
277
277
|
}, "measureAndCacheHeight"));
|
|
@@ -298,8 +298,8 @@ const qe = class qe {
|
|
|
298
298
|
t.querySelectorAll("tr:not(.nodata)").forEach((r) => r.remove());
|
|
299
299
|
const s = t.querySelector("tr.nodata"), n = document.createDocumentFragment(), o = e(this, H);
|
|
300
300
|
for (let r = 0; r < o; r++)
|
|
301
|
-
e(this, M).forEach((
|
|
302
|
-
n.appendChild(
|
|
301
|
+
e(this, M).forEach((a) => {
|
|
302
|
+
n.appendChild(a.cloneNode(!0));
|
|
303
303
|
});
|
|
304
304
|
s ? s.before(n) : t.appendChild(n), console.log(`[RowManager] Rendered ${o} sets into DOM.`);
|
|
305
305
|
}, "renderRows"));
|
|
@@ -322,69 +322,69 @@ const Z = class Z extends HTMLElement {
|
|
|
322
322
|
f(this, F);
|
|
323
323
|
v(this, "init", /* @__PURE__ */ c((t) => {
|
|
324
324
|
if (!t) return;
|
|
325
|
-
const s = /* @__PURE__ */ c((
|
|
326
|
-
const
|
|
327
|
-
if (
|
|
328
|
-
const d =
|
|
325
|
+
const s = /* @__PURE__ */ c((l) => {
|
|
326
|
+
const g = /* @__PURE__ */ c((b) => {
|
|
327
|
+
if (b.querySelector("colgroup")) return;
|
|
328
|
+
const d = b.querySelector("tbody tr") || b.querySelector("tr"), S = d ? d.querySelectorAll("th, td").length : 1, x = document.createElement("colgroup"), k = Math.max(Math.floor((b.clientWidth || 600) / S), 100);
|
|
329
329
|
for (let R = 0; R < S; R++) {
|
|
330
330
|
const ue = document.createElement("col");
|
|
331
331
|
ue.setAttribute("width", k), x.appendChild(ue);
|
|
332
332
|
}
|
|
333
|
-
|
|
334
|
-
}, "ensureColgroup"), h = /* @__PURE__ */ c((
|
|
335
|
-
if (
|
|
336
|
-
const d = document.createElement("thead"), S =
|
|
337
|
-
S ? S.after(d) :
|
|
333
|
+
b.prepend(x);
|
|
334
|
+
}, "ensureColgroup"), h = /* @__PURE__ */ c((b) => {
|
|
335
|
+
if (b.querySelector("thead")) return;
|
|
336
|
+
const d = document.createElement("thead"), S = b.querySelector("colgroup");
|
|
337
|
+
S ? S.after(d) : b.prepend(d);
|
|
338
338
|
}, "ensureThead");
|
|
339
|
-
return
|
|
339
|
+
return g(l), h(l), l.classList.add("nine-table-element"), l;
|
|
340
340
|
}, "initializeTable"), n = t.cloneNode(!0);
|
|
341
341
|
p(this, A, s(n)), e(this, A).style.display = "table", e(this, F).initTemplate(e(this, A));
|
|
342
|
-
const o = this.querySelector(".ng-container-left"), r = this.querySelector(".ng-container-body"),
|
|
343
|
-
const
|
|
342
|
+
const o = this.querySelector(".ng-container-left"), r = this.querySelector(".ng-container-body"), a = this.querySelector(".ng-container-right"), u = /* @__PURE__ */ c((l, g, h = !1) => {
|
|
343
|
+
const b = l.cloneNode(!0), d = Array.from(b.querySelectorAll("colgroup col")), S = [];
|
|
344
344
|
return d.forEach((x, k) => {
|
|
345
345
|
const R = x.getAttribute("fixed");
|
|
346
|
-
(h ? !R || R === "" : R ===
|
|
346
|
+
(h ? !R || R === "" : R === g) || S.push(k);
|
|
347
347
|
}), S.reverse().forEach((x) => {
|
|
348
|
-
d[x] && d[x].remove(),
|
|
348
|
+
d[x] && d[x].remove(), b.querySelectorAll("tr").forEach((k) => {
|
|
349
349
|
const R = k.querySelectorAll("th, td");
|
|
350
350
|
R[x] && R[x].remove();
|
|
351
351
|
});
|
|
352
|
-
}),
|
|
352
|
+
}), b;
|
|
353
353
|
}, "filterTableByFixed");
|
|
354
354
|
if (r) {
|
|
355
|
-
const
|
|
356
|
-
r.innerHTML = "", r.appendChild(
|
|
355
|
+
const l = u(e(this, A), null, !0);
|
|
356
|
+
r.innerHTML = "", r.appendChild(l), e(this, F).measureAndCacheHeight(r);
|
|
357
357
|
}
|
|
358
358
|
if (o) {
|
|
359
|
-
const
|
|
360
|
-
let
|
|
361
|
-
|
|
362
|
-
const d = parseInt(
|
|
363
|
-
isNaN(d) || (
|
|
364
|
-
}), o.innerHTML = "", o.appendChild(
|
|
365
|
-
const h =
|
|
359
|
+
const l = u(e(this, A), "left", !1);
|
|
360
|
+
let g = 0;
|
|
361
|
+
l.querySelectorAll("col").forEach((b) => {
|
|
362
|
+
const d = parseInt(b.getAttribute("width"), 10);
|
|
363
|
+
isNaN(d) || (g += d);
|
|
364
|
+
}), o.innerHTML = "", o.appendChild(l);
|
|
365
|
+
const h = g > 0 ? g : 0;
|
|
366
366
|
o.style.flex = `0 0 ${h}px`, o.style.width = `${h}px`;
|
|
367
367
|
}
|
|
368
|
-
if (
|
|
369
|
-
const
|
|
370
|
-
let
|
|
371
|
-
|
|
372
|
-
const d = parseInt(
|
|
373
|
-
isNaN(d) || (
|
|
374
|
-
}),
|
|
375
|
-
const h =
|
|
376
|
-
|
|
368
|
+
if (a) {
|
|
369
|
+
const l = u(e(this, A), "right", !1);
|
|
370
|
+
let g = 0;
|
|
371
|
+
l.querySelectorAll("col").forEach((b) => {
|
|
372
|
+
const d = parseInt(b.getAttribute("width"), 10);
|
|
373
|
+
isNaN(d) || (g += d);
|
|
374
|
+
}), a.innerHTML = "", a.appendChild(l);
|
|
375
|
+
const h = g > 0 ? g : 0;
|
|
376
|
+
a.style.flex = `0 0 ${h}px`, a.style.width = `${h}px`;
|
|
377
377
|
}
|
|
378
378
|
if (r) {
|
|
379
|
-
const
|
|
380
|
-
r.style.overflowY =
|
|
381
|
-
const
|
|
382
|
-
|
|
379
|
+
const l = this.getRowCount();
|
|
380
|
+
r.style.overflowY = l > 10 ? "auto" : "hidden", r.addEventListener("scroll", () => {
|
|
381
|
+
const g = this.querySelector("nine-table-hscrollbar");
|
|
382
|
+
g && typeof g.refresh == "function" && g.refresh();
|
|
383
383
|
});
|
|
384
384
|
}
|
|
385
385
|
setTimeout(() => {
|
|
386
|
-
const
|
|
387
|
-
|
|
386
|
+
const l = this.querySelector("nine-table-hscrollbar");
|
|
387
|
+
l && typeof l.refresh == "function" && l.refresh();
|
|
388
388
|
}, 0), j.log(`NineTableSheet 3-split initialized with rows: ${this.getRowCount()}`);
|
|
389
389
|
}, "init"));
|
|
390
390
|
v(this, "getRowCount", /* @__PURE__ */ c(() => e(this, A) ? e(this, A).querySelectorAll("tbody tr").length : 0, "getRowCount"));
|
|
@@ -545,39 +545,39 @@ const Ce = class Ce extends HTMLElement {
|
|
|
545
545
|
const S = parseInt(d.dataset.splitIndex, 10), x = h.querySelector(`nine-table-sheet[data-index="${S - 1}"]`), k = h.querySelector(`nine-table-sheet[data-index="${S}"]`);
|
|
546
546
|
x && k && x.classList.contains("active") && k.classList.contains("active") ? d.classList.add("active") : d.classList.remove("active");
|
|
547
547
|
});
|
|
548
|
-
}, "updateSplitters"), o = this.querySelector(".nine-tab-bar"), r = this.querySelector("nine-table-sheets-body"),
|
|
549
|
-
if (!
|
|
548
|
+
}, "updateSplitters"), o = this.querySelector(".nine-tab-bar"), r = this.querySelector("nine-table-sheets-body"), a = o.querySelectorAll(".nine-tab-item"), u = r.querySelectorAll("nine-table-sheet");
|
|
549
|
+
if (!a[t]) return;
|
|
550
550
|
if (!s)
|
|
551
|
-
|
|
552
|
-
h.classList.toggle("active",
|
|
553
|
-
const d = r.querySelector(`nine-table-sheet[data-index="${
|
|
551
|
+
a.forEach((h, b) => {
|
|
552
|
+
h.classList.toggle("active", b === t);
|
|
553
|
+
const d = r.querySelector(`nine-table-sheet[data-index="${b}"]`);
|
|
554
554
|
d && (d.style.flex = "");
|
|
555
|
-
}), u.forEach((h,
|
|
556
|
-
h.classList.toggle("active",
|
|
555
|
+
}), u.forEach((h, b) => {
|
|
556
|
+
h.classList.toggle("active", b === t);
|
|
557
557
|
});
|
|
558
558
|
else {
|
|
559
|
-
const h =
|
|
560
|
-
if (h.classList.contains("active") &&
|
|
559
|
+
const h = a[t], b = o.querySelectorAll(".nine-tab-item.active");
|
|
560
|
+
if (h.classList.contains("active") && b.length <= 1)
|
|
561
561
|
return;
|
|
562
562
|
h.classList.toggle("active");
|
|
563
563
|
const d = r.querySelector(`nine-table-sheet[data-index="${t}"]`);
|
|
564
564
|
d && (d.classList.toggle("active"), d.classList.contains("active") || (d.style.flex = ""));
|
|
565
565
|
}
|
|
566
|
-
const
|
|
567
|
-
if (
|
|
568
|
-
const h = 1 /
|
|
569
|
-
|
|
570
|
-
(!
|
|
566
|
+
const l = Array.from(r.querySelectorAll("nine-table-sheet.active"));
|
|
567
|
+
if (l.length > 1) {
|
|
568
|
+
const h = 1 / l.length;
|
|
569
|
+
l.forEach((b) => {
|
|
570
|
+
(!b.style.flex || b.style.flex === "1 1 100%") && (b.style.flex = `${h} ${h} 0px`);
|
|
571
571
|
});
|
|
572
572
|
} else
|
|
573
|
-
|
|
573
|
+
l.forEach((h) => {
|
|
574
574
|
h.style.flex = "1 1 100%";
|
|
575
575
|
});
|
|
576
576
|
n();
|
|
577
|
-
const
|
|
578
|
-
if (
|
|
577
|
+
const g = r.querySelector("nine-table-sheet.active");
|
|
578
|
+
if (g && typeof g.getRowCount == "function") {
|
|
579
579
|
const h = this.querySelector("#row-count");
|
|
580
|
-
h && (h.textContent =
|
|
580
|
+
h && (h.textContent = g.getRowCount().toLocaleString());
|
|
581
581
|
}
|
|
582
582
|
}, "switchSheet"));
|
|
583
583
|
}
|
|
@@ -604,13 +604,16 @@ const ke = class ke {
|
|
|
604
604
|
var k, R;
|
|
605
605
|
const t = (k = i.shadowRoot) == null ? void 0 : k.querySelector("nine-table-sheet.active");
|
|
606
606
|
if (!t) return;
|
|
607
|
-
const s = ((R = t.getRowCount) == null ? void 0 : R.call(t)) || 0, n = parseInt(i.getAttribute("max-display-row"), 10) || 10, o = Math.min(s, n), r = t.querySelector("tbody tr") || t.querySelector("tr"),
|
|
608
|
-
i.style.height = `${S}px`, i.style.maxHeight = `${n *
|
|
607
|
+
const s = ((R = t.getRowCount) == null ? void 0 : R.call(t)) || 0, n = parseInt(i.getAttribute("max-display-row"), 10) || 10, o = Math.min(s, n), r = t.querySelector("tbody tr") || t.querySelector("tr"), a = r ? r.getBoundingClientRect().height : 32, u = e(this, L).querySelector("nine-table-header"), l = e(this, L).querySelector("nine-table-sheets-footer"), g = u ? u.getBoundingClientRect().height : 40, h = l ? l.getBoundingClientRect().height : 32, d = g + h + 16, S = o * a + d;
|
|
608
|
+
i.style.height = `${S}px`, i.style.maxHeight = `${n * a + d}px`;
|
|
609
609
|
const x = e(this, L).querySelector("nine-table-sheets-body");
|
|
610
610
|
x && (x.style.overflowY = s > n ? "auto" : "hidden");
|
|
611
611
|
}, "#applyAutoHeight"));
|
|
612
612
|
f(this, le, /* @__PURE__ */ c(() => {
|
|
613
|
-
const i = e(this, L).host, s = Array.from(i.children).filter((u) => u.tagName === "TABLE"), n = i.getAttribute("auto-height") === "true", o = s.map((u,
|
|
613
|
+
const i = e(this, L).host, s = Array.from(i.children).filter((u) => u.tagName === "TABLE"), n = i.getAttribute("auto-height") === "true", o = s.map((u, l) => {
|
|
614
|
+
const h = `<nine-table-sheet class="${l === 0 ? "active" : ""}" data-index="${l}"></nine-table-sheet>`, b = l < s.length - 1 ? `<nine-splitter class="h" data-split-index="${l}"></nine-splitter>` : "";
|
|
615
|
+
return h + b;
|
|
616
|
+
}).join(""), r = s.map((u, l) => `<div class="nine-tab-item ${l === 0 ? "active" : ""}" data-index="${l}">Sheet ${l + 1}</div>`).join("");
|
|
614
617
|
e(this, L).innerHTML = `
|
|
615
618
|
<style>
|
|
616
619
|
:host {
|
|
@@ -709,10 +712,10 @@ const ke = class ke {
|
|
|
709
712
|
</nine-table-body>
|
|
710
713
|
<nine-table-footer></nine-table-footer>
|
|
711
714
|
`;
|
|
712
|
-
const
|
|
713
|
-
|
|
714
|
-
s[
|
|
715
|
-
u.init(s[
|
|
715
|
+
const a = e(this, L).querySelectorAll("nine-table-sheet");
|
|
716
|
+
a == null || a.forEach((u, l) => {
|
|
717
|
+
s[l] && setTimeout(() => {
|
|
718
|
+
u.init(s[l]), n && e(this, J).call(this, i);
|
|
716
719
|
});
|
|
717
720
|
});
|
|
718
721
|
}, "#render"));
|
|
@@ -788,8 +791,8 @@ const T = class T {
|
|
|
788
791
|
const t = typeof ((n = e(this, E).fields) == null ? void 0 : n.get) == "function" ? e(this, E).fields.get() : Object.keys(i[0] || {}), s = [];
|
|
789
792
|
return i.forEach((o) => {
|
|
790
793
|
const r = { v: [] };
|
|
791
|
-
t.forEach((
|
|
792
|
-
r.v.push(o[
|
|
794
|
+
t.forEach((a) => {
|
|
795
|
+
r.v.push(o[a] !== void 0 && o[a] !== null ? o[a] : "");
|
|
793
796
|
}), s.push(r);
|
|
794
797
|
}), s;
|
|
795
798
|
}, "#json2Array"));
|
|
@@ -802,8 +805,8 @@ const T = class T {
|
|
|
802
805
|
const s = e(this, he).call(this, i);
|
|
803
806
|
e(this, m).rawRecords = e(this, m).rawRecords.concat(e(this, de).call(this, s)), this.resetRecords();
|
|
804
807
|
const n = this.count() - 1;
|
|
805
|
-
return t || s.forEach((r,
|
|
806
|
-
const u = e(this, m).rawRecords[n -
|
|
808
|
+
return t || s.forEach((r, a) => {
|
|
809
|
+
const u = e(this, m).rawRecords[n - a];
|
|
807
810
|
u && (u.__ng.rowState = T.ROW_STATE.EMPTY);
|
|
808
811
|
}), (o = e(this, m).viewRecords) != null && o.reset && e(this, m).viewRecords.reset(), n;
|
|
809
812
|
}, "add"));
|
|
@@ -826,8 +829,8 @@ const T = class T {
|
|
|
826
829
|
if (o < 0) return;
|
|
827
830
|
const r = this.getValidData()[i];
|
|
828
831
|
if (!r) return;
|
|
829
|
-
const
|
|
830
|
-
|
|
832
|
+
const a = r.v[o];
|
|
833
|
+
a !== s && r.__ng.rowState !== T.ROW_STATE.INSERT && (r.__ng.o.hasOwnProperty(t) || (r.__ng.o[t] = a), r.__ng.rowState = T.ROW_STATE.UPDATE), r.v[o] = s, e(this, m).owner.refreshData && e(this, m).owner.refreshData(i);
|
|
831
834
|
}, "setValue"));
|
|
832
835
|
v(this, "resetRecords", /* @__PURE__ */ c(() => {
|
|
833
836
|
p(this, U, e(this, m).rawRecords.filter((i) => !i.__ng.deleted)), p(this, C, e(this, m).rawRecords.filter((i) => !i.__ng.deleted && !i.__ng.filtered)), e(this, m).rawRecords.forEach((i, t) => {
|
|
@@ -843,8 +846,8 @@ const T = class T {
|
|
|
843
846
|
const t = typeof ((s = e(this, E).fields) == null ? void 0 : s.get) == "function" ? e(this, E).fields.get() : [];
|
|
844
847
|
return Array.isArray(i) ? i.filter((n) => !n.__ng.deleted).map((n) => {
|
|
845
848
|
const o = {};
|
|
846
|
-
return t.forEach((r,
|
|
847
|
-
o[r] = n.v ? n.v[
|
|
849
|
+
return t.forEach((r, a) => {
|
|
850
|
+
o[r] = n.v ? n.v[a] : n[r];
|
|
848
851
|
}), o.__ng = n.__ng, o;
|
|
849
852
|
}) : i;
|
|
850
853
|
}, "#conv2"));
|