@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.
@@ -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"), l = t.clientWidth, u = s.scrollWidth;
48
- if (l !== 0 && u > l)
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 a = n.clientWidth;
55
- if (a <= 0) return;
56
- const b = Math.max(Math.min(a * (l / u), a), 20);
57
- o.style.width = `${b}px`;
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 g = s.style.transform;
60
- if (g && g.includes("translateX")) {
61
- const x = g.match(/translateX\(([-\d.]+)px\)/);
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) * a / u, 10);
65
+ let d = parseInt(Math.abs(h) * l / u, 10);
66
66
  d < 0 && (d = 0);
67
- const S = a - b;
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 l = t;
76
- l < 0 && (l = 0);
75
+ let a = t;
76
+ a < 0 && (a = 0);
77
77
  const u = o.width - r;
78
- l > u && (l = u), l = parseInt(l, 10), e(this, y).thumb.style.left = `${l}px`, e(this, y).left.disabled = l === 0, e(this, y).right.disabled = l >= u - 1;
79
- const a = s.clientWidth, b = n.scrollWidth;
80
- let h = u > 0 ? -l * (b - a) / u : 0;
81
- return -h > b - a && (h = -(b - a)), -h + 5 > b - a && (h = -(b - a)), a >= b && (h = 0), n.style.transform = `translateX(${h}px)`, l > 0 && l < u - 1;
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((l) => {
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, l.clientX - u.left - this.shiftX);
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 l = s.querySelector(".ng-container-body") || s, u = l.querySelector("thead"), a = l.querySelector("tfoot");
235
- u && (r += u.offsetHeight || u.getBoundingClientRect().height), a && (r += a.offsetHeight || a.getBoundingClientRect().height);
236
- const b = Math.max(o - r, 100);
237
- if (e(this, I) !== b && (p(this, I, b), e(this, q) !== null)) {
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((g) => {
240
- const d = s.querySelector(g);
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((l) => l.remove());
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((l) => {
264
- n.appendChild(l.cloneNode(!0));
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((l, u) => {
268
- const a = l.offsetHeight;
269
- if (a === 0)
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 += a;
271
+ o += l;
272
272
  }), p(this, q, o), e(this, I) > 0) {
273
- const l = Math.ceil(e(this, I) / e(this, q));
274
- p(this, H, l + 20);
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((l) => {
302
- n.appendChild(l.cloneNode(!0));
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((a) => {
326
- const b = /* @__PURE__ */ c((g) => {
327
- if (g.querySelector("colgroup")) return;
328
- const d = g.querySelector("tbody tr") || g.querySelector("tr"), S = d ? d.querySelectorAll("th, td").length : 1, x = document.createElement("colgroup"), k = Math.max(Math.floor((g.clientWidth || 600) / S), 100);
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
- g.prepend(x);
334
- }, "ensureColgroup"), h = /* @__PURE__ */ c((g) => {
335
- if (g.querySelector("thead")) return;
336
- const d = document.createElement("thead"), S = g.querySelector("colgroup");
337
- S ? S.after(d) : g.prepend(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 b(a), h(a), a.classList.add("nine-table-element"), a;
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"), l = this.querySelector(".ng-container-right"), u = /* @__PURE__ */ c((a, b, h = !1) => {
343
- const g = a.cloneNode(!0), d = Array.from(g.querySelectorAll("colgroup col")), S = [];
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 === b) || S.push(k);
346
+ (h ? !R || R === "" : R === g) || S.push(k);
347
347
  }), S.reverse().forEach((x) => {
348
- d[x] && d[x].remove(), g.querySelectorAll("tr").forEach((k) => {
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
- }), g;
352
+ }), b;
353
353
  }, "filterTableByFixed");
354
354
  if (r) {
355
- const a = u(e(this, A), null, !0);
356
- r.innerHTML = "", r.appendChild(a), e(this, F).measureAndCacheHeight(r);
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 a = u(e(this, A), "left", !1);
360
- let b = 0;
361
- a.querySelectorAll("col").forEach((g) => {
362
- const d = parseInt(g.getAttribute("width"), 10);
363
- isNaN(d) || (b += d);
364
- }), o.innerHTML = "", o.appendChild(a);
365
- const h = b > 0 ? b : 0;
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 (l) {
369
- const a = u(e(this, A), "right", !1);
370
- let b = 0;
371
- a.querySelectorAll("col").forEach((g) => {
372
- const d = parseInt(g.getAttribute("width"), 10);
373
- isNaN(d) || (b += d);
374
- }), l.innerHTML = "", l.appendChild(a);
375
- const h = b > 0 ? b : 0;
376
- l.style.flex = `0 0 ${h}px`, l.style.width = `${h}px`;
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 a = this.getRowCount();
380
- r.style.overflowY = a > 10 ? "auto" : "hidden", r.addEventListener("scroll", () => {
381
- const b = this.querySelector("nine-table-hscrollbar");
382
- b && typeof b.refresh == "function" && b.refresh();
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 a = this.querySelector("nine-table-hscrollbar");
387
- a && typeof a.refresh == "function" && a.refresh();
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"), l = o.querySelectorAll(".nine-tab-item"), u = r.querySelectorAll("nine-table-sheet");
549
- if (!l[t]) return;
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
- l.forEach((h, g) => {
552
- h.classList.toggle("active", g === t);
553
- const d = r.querySelector(`nine-table-sheet[data-index="${g}"]`);
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, g) => {
556
- h.classList.toggle("active", g === t);
555
+ }), u.forEach((h, b) => {
556
+ h.classList.toggle("active", b === t);
557
557
  });
558
558
  else {
559
- const h = l[t], g = o.querySelectorAll(".nine-tab-item.active");
560
- if (h.classList.contains("active") && g.length <= 1)
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 a = Array.from(r.querySelectorAll("nine-table-sheet.active"));
567
- if (a.length > 1) {
568
- const h = 1 / a.length;
569
- a.forEach((g) => {
570
- (!g.style.flex || g.style.flex === "1 1 100%") && (g.style.flex = `${h} ${h} 0px`);
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
- a.forEach((h) => {
573
+ l.forEach((h) => {
574
574
  h.style.flex = "1 1 100%";
575
575
  });
576
576
  n();
577
- const b = r.querySelector("nine-table-sheet.active");
578
- if (b && typeof b.getRowCount == "function") {
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 = b.getRowCount().toLocaleString());
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"), l = r ? r.getBoundingClientRect().height : 32, u = e(this, L).querySelector("nine-table-header"), a = e(this, L).querySelector("nine-table-sheets-footer"), b = u ? u.getBoundingClientRect().height : 40, h = a ? a.getBoundingClientRect().height : 32, d = b + h + 16, S = o * l + d;
608
- i.style.height = `${S}px`, i.style.maxHeight = `${n * l + d}px`;
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, a) => `<nine-table-sheet class="${a === 0 ? "active" : ""}" data-index="${a}"></nine-table-sheet>`).join(""), r = s.map((u, a) => `<div class="nine-tab-item ${a === 0 ? "active" : ""}" data-index="${a}">Sheet ${a + 1}</div>`).join("");
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 l = e(this, L).querySelectorAll("nine-table-sheet");
713
- l == null || l.forEach((u, a) => {
714
- s[a] && setTimeout(() => {
715
- u.init(s[a]), n && e(this, J).call(this, i);
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((l) => {
792
- r.v.push(o[l] !== void 0 && o[l] !== null ? o[l] : "");
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, l) => {
806
- const u = e(this, m).rawRecords[n - l];
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 l = r.v[o];
830
- l !== s && 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] = s, e(this, m).owner.refreshData && e(this, m).owner.refreshData(i);
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, l) => {
847
- o[r] = n.v ? n.v[l] : n[r];
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"));