@firestitch/list 18.0.91 → 18.0.93

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.
@@ -1,7 +1,7 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { Injectable, inject, NgZone, ChangeDetectorRef, ElementRef, Renderer2, Directive, Input, Pipe, EventEmitter, Component, ChangeDetectionStrategy, Output, input, effect, HostBinding, computed, TemplateRef, ViewContainerRef, ViewChild, ContentChild, isDevMode, HostListener, ContentChildren, InjectionToken, Injector, NgModule } from '@angular/core';
3
- import { BehaviorSubject, Subject, Observable, map as map$1, merge, of, from, combineLatest, EMPTY } from 'rxjs';
4
- import { finalize, takeUntil, map, take, distinctUntilChanged, skip, filter, tap, shareReplay, delay, switchMap, debounceTime, mapTo, catchError, retry } from 'rxjs/operators';
3
+ import { BehaviorSubject, Subject, Observable, map as map$1, EMPTY, merge, of, from, combineLatest } from 'rxjs';
4
+ import { finalize, takeUntil, map, take, distinctUntilChanged, catchError, tap, skip, filter, shareReplay, delay, switchMap, debounceTime, mapTo, retry } from 'rxjs/operators';
5
5
  import { get, isString, isObject, isBoolean, isFunction, cloneDeep, random, mergeWith } from 'lodash-es';
6
6
  import { BreakpointObserver } from '@angular/cdk/layout';
7
7
  import { NgClass, AsyncPipe, NgTemplateOutlet, Location, DecimalPipe } from '@angular/common';
@@ -1962,15 +1962,15 @@ class FsRowActionsComponent {
1962
1962
  }
1963
1963
  if (action.remove) {
1964
1964
  if (action.remove instanceof Object) {
1965
+ // Cancel, Escape and a click outside error the prompt's stream; backing
1966
+ // out is not an error, so it ends here quietly and the row stays
1965
1967
  this._prompt.confirm({
1966
1968
  title: action.remove.title,
1967
1969
  template: action.remove.template,
1968
1970
  autofocus: true,
1969
1971
  })
1970
- .pipe(take(1), takeUntil(this._destroy$))
1971
- .subscribe(() => {
1972
- this._removeAction(action, row.data, event, this.index);
1973
- });
1972
+ .pipe(catchError(() => EMPTY), take(1), tap(() => this._removeAction(action, row.data, event, this.index)), takeUntil(this._destroy$))
1973
+ .subscribe();
1974
1974
  }
1975
1975
  else {
1976
1976
  this._removeAction(action, row.data, event, this.index);
@@ -2743,11 +2743,11 @@ class FsCellComponent {
2743
2743
  }
2744
2744
  }
2745
2745
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: FsCellComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2746
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "18.2.7", type: FsCellComponent, isStandalone: true, selector: "[fs-cell]", inputs: { column: { classPropertyName: "column", publicName: "column", isSignal: false, isRequired: false, transformFunction: null }, rowIndex: { classPropertyName: "rowIndex", publicName: "rowIndex", isSignal: false, isRequired: false, transformFunction: null }, row: { classPropertyName: "row", publicName: "row", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.fs-list-col": "this.isColl", "attr.role": "this.role" } }, usesOnChanges: true, ngImport: i0, template: "<ng-template [ngTemplateOutlet]=\"cellTemplate || defaultCellTemplate\" [ngTemplateOutletContext]=\"cellContext\"></ng-template>\n\n<ng-template #defaultCellTemplate let-value=\"value\">\n {{value}}\n</ng-template>\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2746
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "18.2.7", type: FsCellComponent, isStandalone: true, selector: "[fs-cell]", inputs: { column: { classPropertyName: "column", publicName: "column", isSignal: false, isRequired: false, transformFunction: null }, rowIndex: { classPropertyName: "rowIndex", publicName: "rowIndex", isSignal: false, isRequired: false, transformFunction: null }, row: { classPropertyName: "row", publicName: "row", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.fs-list-col": "this.isColl", "attr.role": "this.role" } }, usesOnChanges: true, ngImport: i0, template: "<ng-template [ngTemplateOutlet]=\"cellTemplate || defaultCellTemplate\" [ngTemplateOutletContext]=\"cellContext\"></ng-template>\r\n\r\n<ng-template #defaultCellTemplate let-value=\"value\">\r\n {{value}}\r\n</ng-template>\r\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2747
2747
  }
2748
2748
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: FsCellComponent, decorators: [{
2749
2749
  type: Component,
2750
- args: [{ selector: '[fs-cell]', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [NgTemplateOutlet], template: "<ng-template [ngTemplateOutlet]=\"cellTemplate || defaultCellTemplate\" [ngTemplateOutletContext]=\"cellContext\"></ng-template>\n\n<ng-template #defaultCellTemplate let-value=\"value\">\n {{value}}\n</ng-template>\n" }]
2750
+ args: [{ selector: '[fs-cell]', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [NgTemplateOutlet], template: "<ng-template [ngTemplateOutlet]=\"cellTemplate || defaultCellTemplate\" [ngTemplateOutletContext]=\"cellContext\"></ng-template>\r\n\r\n<ng-template #defaultCellTemplate let-value=\"value\">\r\n {{value}}\r\n</ng-template>\r\n" }]
2751
2751
  }], ctorParameters: () => [], propDecorators: { isColl: [{
2752
2752
  type: HostBinding,
2753
2753
  args: ['class.fs-list-col']
@@ -3125,27 +3125,36 @@ class FsBodyComponent {
3125
3125
  /**
3126
3126
  * Track rows by their underlying record id so that a reload (which creates
3127
3127
  * fresh Row wrapper objects) reuses the existing DOM instead of destroying
3128
- * and recreating every row. Only a genuine, non-empty id counts as a stable
3129
- * identity: empty string / null / undefined (group & footer rows, id-less
3130
- * records) fall back to the row index, namespaced so it can never collide
3131
- * with a real id. Without the fallback every id-less row keys to the same
3132
- * value and Angular throws NG0955 (duplicate track keys) -> scrambled rows.
3133
- */
3134
- trackByFn(index, row) {
3128
+ * and recreating every row. A reused DOM row keeps the cell templates and
3129
+ * actions it was first built with, so only a row that renders the same way
3130
+ * may take it over:
3131
+ * - Group headers and group footers are tracked by their wrapper, never by
3132
+ * id. Their data can be a child's own record (a groupBy that returns the
3133
+ * row), so the id would collide with that child's, and they render with
3134
+ * different templates and actions than a record row.
3135
+ * - A record row without a genuine, non-empty id (empty string / null /
3136
+ * undefined) is tracked by its wrapper too. Tracking it by its position
3137
+ * handed each DOM row to whatever row landed there after the reload, so a
3138
+ * group header drew a record's cells and a record drew a group header.
3139
+ */
3140
+ trackByFn(row) {
3141
+ if (isGroupRow(row) || isGroupFooterRow(row)) {
3142
+ return row;
3143
+ }
3135
3144
  const id = row?.data?.id;
3136
3145
  return id === undefined || id === null || id === ''
3137
- ? `__row_index_${index}`
3146
+ ? row
3138
3147
  : id;
3139
3148
  }
3140
3149
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: FsBodyComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
3141
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.7", type: FsBodyComponent, isStandalone: true, selector: "[fs-list-body]", inputs: { rows: "rows", columns: "columns", hasFooter: "hasFooter", rowActionsRaw: "rowActionsRaw", groupActionsRaw: "groupActionsRaw", rowEvents: "rowEvents", rowClass: "rowClass", hasRowActions: "hasRowActions", selection: "selection", restoreMode: "restoreMode", rowRemoved: "rowRemoved", activeFiltersCount: "activeFiltersCount", reorderEnabled: "reorderEnabled", reorderPosition: "reorderPosition", reorderStrategy: "reorderStrategy", reorderMultiple: "reorderMultiple" }, queries: [{ propertyName: "headerTemplate", first: true, predicate: FsRowComponent, descendants: true, read: TemplateRef, static: true }], viewQueries: [{ propertyName: "rowsContainer", first: true, predicate: ["rowsContainer"], descendants: true, read: ViewContainerRef, static: true }], ngImport: i0, template: "@for (row of rows; track trackByFn(i, row); let i = $index) {\n <tr\n fs-list-row\n fsListDraggableRow\n [row]=\"row\"\n [rowIndex]=\"i\"\n [columns]=\"columns\"\n [rowActionsRaw]=\"rowActionsRaw\"\n [groupActionsRaw]=\"groupActionsRaw\"\n [hasRowActions]=\"hasRowActions\"\n [rowEvents]=\"rowEvents\"\n [rowClass]=\"rowClass\"\n [selection]=\"selection\"\n [restoreMode]=\"restoreMode\"\n [rowRemoved]=\"rowRemoved\"\n [activeFiltersCount]=\"activeFiltersCount\"\n [reorderEnabled]=\"reorderEnabled\"\n [reorderPosition]=\"reorderPosition\"\n [reorderStrategy]=\"reorderStrategy\"\n [reorderMultiple]=\"reorderMultiple\">\n </tr>\n}", styles: [":host.drag-hidden .drag-col{opacity:0!important;cursor:default}:host.disabled{opacity:.4;pointer-events:none}\n"], dependencies: [{ kind: "component", type: FsRowComponent, selector: "[fs-list-row]", inputs: ["row", "rowActionsRaw", "groupActionsRaw", "hasRowActions", "rowEvents", "rowClass", "restoreMode", "rowIndex", "columns", "selection", "rowRemoved", "activeFiltersCount", "reorderEnabled", "reorderPosition", "reorderStrategy", "reorderMultiple"] }, { kind: "directive", type: FsListDraggableRowDirective, selector: "[fsListDraggableRow]", inputs: ["row"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
3150
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.7", type: FsBodyComponent, isStandalone: true, selector: "[fs-list-body]", inputs: { rows: "rows", columns: "columns", hasFooter: "hasFooter", rowActionsRaw: "rowActionsRaw", groupActionsRaw: "groupActionsRaw", rowEvents: "rowEvents", rowClass: "rowClass", hasRowActions: "hasRowActions", selection: "selection", restoreMode: "restoreMode", rowRemoved: "rowRemoved", activeFiltersCount: "activeFiltersCount", reorderEnabled: "reorderEnabled", reorderPosition: "reorderPosition", reorderStrategy: "reorderStrategy", reorderMultiple: "reorderMultiple" }, queries: [{ propertyName: "headerTemplate", first: true, predicate: FsRowComponent, descendants: true, read: TemplateRef, static: true }], viewQueries: [{ propertyName: "rowsContainer", first: true, predicate: ["rowsContainer"], descendants: true, read: ViewContainerRef, static: true }], ngImport: i0, template: "@for (row of rows; track trackByFn(row); let i = $index) {\n <tr\n fs-list-row\n fsListDraggableRow\n [row]=\"row\"\n [rowIndex]=\"i\"\n [columns]=\"columns\"\n [rowActionsRaw]=\"rowActionsRaw\"\n [groupActionsRaw]=\"groupActionsRaw\"\n [hasRowActions]=\"hasRowActions\"\n [rowEvents]=\"rowEvents\"\n [rowClass]=\"rowClass\"\n [selection]=\"selection\"\n [restoreMode]=\"restoreMode\"\n [rowRemoved]=\"rowRemoved\"\n [activeFiltersCount]=\"activeFiltersCount\"\n [reorderEnabled]=\"reorderEnabled\"\n [reorderPosition]=\"reorderPosition\"\n [reorderStrategy]=\"reorderStrategy\"\n [reorderMultiple]=\"reorderMultiple\">\n </tr>\n}", styles: [":host.drag-hidden .drag-col{opacity:0!important;cursor:default}:host.disabled{opacity:.4;pointer-events:none}\n"], dependencies: [{ kind: "component", type: FsRowComponent, selector: "[fs-list-row]", inputs: ["row", "rowActionsRaw", "groupActionsRaw", "hasRowActions", "rowEvents", "rowClass", "restoreMode", "rowIndex", "columns", "selection", "rowRemoved", "activeFiltersCount", "reorderEnabled", "reorderPosition", "reorderStrategy", "reorderMultiple"] }, { kind: "directive", type: FsListDraggableRowDirective, selector: "[fsListDraggableRow]", inputs: ["row"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
3142
3151
  }
3143
3152
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: FsBodyComponent, decorators: [{
3144
3153
  type: Component,
3145
3154
  args: [{ selector: '[fs-list-body]', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [
3146
3155
  FsRowComponent,
3147
3156
  FsListDraggableRowDirective,
3148
- ], template: "@for (row of rows; track trackByFn(i, row); let i = $index) {\n <tr\n fs-list-row\n fsListDraggableRow\n [row]=\"row\"\n [rowIndex]=\"i\"\n [columns]=\"columns\"\n [rowActionsRaw]=\"rowActionsRaw\"\n [groupActionsRaw]=\"groupActionsRaw\"\n [hasRowActions]=\"hasRowActions\"\n [rowEvents]=\"rowEvents\"\n [rowClass]=\"rowClass\"\n [selection]=\"selection\"\n [restoreMode]=\"restoreMode\"\n [rowRemoved]=\"rowRemoved\"\n [activeFiltersCount]=\"activeFiltersCount\"\n [reorderEnabled]=\"reorderEnabled\"\n [reorderPosition]=\"reorderPosition\"\n [reorderStrategy]=\"reorderStrategy\"\n [reorderMultiple]=\"reorderMultiple\">\n </tr>\n}", styles: [":host.drag-hidden .drag-col{opacity:0!important;cursor:default}:host.disabled{opacity:.4;pointer-events:none}\n"] }]
3157
+ ], template: "@for (row of rows; track trackByFn(row); let i = $index) {\n <tr\n fs-list-row\n fsListDraggableRow\n [row]=\"row\"\n [rowIndex]=\"i\"\n [columns]=\"columns\"\n [rowActionsRaw]=\"rowActionsRaw\"\n [groupActionsRaw]=\"groupActionsRaw\"\n [hasRowActions]=\"hasRowActions\"\n [rowEvents]=\"rowEvents\"\n [rowClass]=\"rowClass\"\n [selection]=\"selection\"\n [restoreMode]=\"restoreMode\"\n [rowRemoved]=\"rowRemoved\"\n [activeFiltersCount]=\"activeFiltersCount\"\n [reorderEnabled]=\"reorderEnabled\"\n [reorderPosition]=\"reorderPosition\"\n [reorderStrategy]=\"reorderStrategy\"\n [reorderMultiple]=\"reorderMultiple\">\n </tr>\n}", styles: [":host.drag-hidden .drag-col{opacity:0!important;cursor:default}:host.disabled{opacity:.4;pointer-events:none}\n"] }]
3149
3158
  }], propDecorators: { rows: [{
3150
3159
  type: Input
3151
3160
  }], columns: [{
@@ -3345,11 +3354,11 @@ class FsFooterCellComponent extends FsCellComponent {
3345
3354
  super();
3346
3355
  }
3347
3356
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: FsFooterCellComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
3348
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.7", type: FsFooterCellComponent, isStandalone: true, selector: "[fs-list-footer-cell]", usesInheritance: true, ngImport: i0, template: "<ng-template [ngTemplateOutlet]=\"column.footerTemplate || cell\" [ngTemplateOutletContext]=\"cellContext\"></ng-template>\n\n<ng-template #cell let-value=\"value\">\n {{value}}\n</ng-template>\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
3357
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.7", type: FsFooterCellComponent, isStandalone: true, selector: "[fs-list-footer-cell]", usesInheritance: true, ngImport: i0, template: "<ng-template [ngTemplateOutlet]=\"column.footerTemplate || cell\" [ngTemplateOutletContext]=\"cellContext\"></ng-template>\r\n\r\n<ng-template #cell let-value=\"value\">\r\n {{value}}\r\n</ng-template>\r\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
3349
3358
  }
3350
3359
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: FsFooterCellComponent, decorators: [{
3351
3360
  type: Component,
3352
- args: [{ selector: '[fs-list-footer-cell]', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [NgTemplateOutlet], template: "<ng-template [ngTemplateOutlet]=\"column.footerTemplate || cell\" [ngTemplateOutletContext]=\"cellContext\"></ng-template>\n\n<ng-template #cell let-value=\"value\">\n {{value}}\n</ng-template>\n" }]
3361
+ args: [{ selector: '[fs-list-footer-cell]', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [NgTemplateOutlet], template: "<ng-template [ngTemplateOutlet]=\"column.footerTemplate || cell\" [ngTemplateOutletContext]=\"cellContext\"></ng-template>\r\n\r\n<ng-template #cell let-value=\"value\">\r\n {{value}}\r\n</ng-template>\r\n" }]
3353
3362
  }], ctorParameters: () => [] });
3354
3363
 
3355
3364
  class FsFooterRowComponent extends FsRowComponent {