codexly-ui 0.10.21 → 0.10.22

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.
@@ -13179,6 +13179,13 @@ class ClxTableComponent {
13179
13179
  const start = this.pageIndex() * this.pageSize();
13180
13180
  return filtered.slice(start, start + this.pageSize());
13181
13181
  }, ...(ngDevMode ? [{ debugName: "_paginatedData" }] : /* istanbul ignore next */ []));
13182
+ /** The `index` passed into a cell template must refer to the row's position in the original
13183
+ * `data()` array the consumer owns (e.g. to splice/edit it directly) — never the position
13184
+ * within the current page, which silently gave every page's first row index 0 and broke
13185
+ * edit/remove handlers built around `data()[index]` as soon as a second page existed. */
13186
+ _absoluteIndex(item) {
13187
+ return this.data().indexOf(item);
13188
+ }
13182
13189
  _totalItems = computed(() => this.serverSide() ? (this.totalItems() ?? this.data().length) : this._filteredData().length, ...(ngDevMode ? [{ debugName: "_totalItems" }] : /* istanbul ignore next */ []));
13183
13190
  _emptyTitle = computed(() => this.emptyTitle() || (this.searchQuery() ? 'Sin resultados' : 'No hay datos'), ...(ngDevMode ? [{ debugName: "_emptyTitle" }] : /* istanbul ignore next */ []));
13184
13191
  _emptyDescription = computed(() => this.emptyDescription() ||
@@ -13350,7 +13357,7 @@ class ClxTableComponent {
13350
13357
  @if (_getColumnDef(col.key)?.cell()?.templateRef; as tpl) {
13351
13358
  <ng-container
13352
13359
  [ngTemplateOutlet]="tpl"
13353
- [ngTemplateOutletContext]="{ $implicit: item, index: i }">
13360
+ [ngTemplateOutletContext]="{ $implicit: item, index: _absoluteIndex(item) }">
13354
13361
  </ng-container>
13355
13362
  } @else {
13356
13363
  {{ _getCellValue(item, col.key) }}
@@ -13497,7 +13504,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.15", ngImpo
13497
13504
  @if (_getColumnDef(col.key)?.cell()?.templateRef; as tpl) {
13498
13505
  <ng-container
13499
13506
  [ngTemplateOutlet]="tpl"
13500
- [ngTemplateOutletContext]="{ $implicit: item, index: i }">
13507
+ [ngTemplateOutletContext]="{ $implicit: item, index: _absoluteIndex(item) }">
13501
13508
  </ng-container>
13502
13509
  } @else {
13503
13510
  {{ _getCellValue(item, col.key) }}