@firestitch/list 12.1.2 → 12.1.5

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.
@@ -31,7 +31,7 @@ export interface FsListConfig {
31
31
  savedFilters?: IFilterSavedFiltersConfig;
32
32
  persist?: FsListPersitance;
33
33
  rowActions?: (FsListRowActionGroup | FsListRowAction)[];
34
- rowClass?: (row: any) => string;
34
+ rowClass?: (row: any, options?: FsListRowClassOptions) => string;
35
35
  actions?: FsListAction[];
36
36
  fetch?: FsListFetchFn;
37
37
  afterFetch?: FsListAfterFetchFn;
@@ -241,3 +241,8 @@ export declare type FsListFetchFn = (query: Record<string, any>, options: FsList
241
241
  }>;
242
242
  export declare type FsListAfterFetchFn = (query: Record<string, any>, data: unknown[]) => void;
243
243
  export declare type FsListAfterContentInitFn = (query: Record<string, any>, data: unknown[]) => void;
244
+ export interface FsListRowClassOptions {
245
+ index: number;
246
+ groupIndex?: number;
247
+ groupChildIndex?: number;
248
+ }
@@ -5,7 +5,7 @@ export declare class ColumnAttributes {
5
5
  private _customize;
6
6
  private _sortable;
7
7
  private _sortableDefault;
8
- private _direction;
8
+ private _direction$;
9
9
  private _align;
10
10
  private _width;
11
11
  private _className;
@@ -25,6 +25,7 @@ export declare class ColumnAttributes {
25
25
  get sortableDefault(): boolean;
26
26
  set direction(value: 'asc' | 'desc');
27
27
  get direction(): 'asc' | 'desc';
28
+ get direction$(): Observable<'asc' | 'desc'>;
28
29
  set align(value: string);
29
30
  get align(): string;
30
31
  set width(value: string);
@@ -35,6 +35,7 @@ export declare class Column {
35
35
  get sortableDefault(): boolean;
36
36
  set sortingDirection(value: 'asc' | 'desc');
37
37
  get sortingDirection(): 'asc' | 'desc';
38
+ get sortingDirection$(): Observable<'asc' | 'desc'>;
38
39
  get visible(): boolean;
39
40
  get visible$(): Observable<boolean>;
40
41
  get direction(): "desc" | "asc";
@@ -535,6 +535,13 @@
535
535
  enumerable: false,
536
536
  configurable: true
537
537
  });
538
+ Object.defineProperty(Column.prototype, "sortingDirection$", {
539
+ get: function () {
540
+ return this._attributes.direction$;
541
+ },
542
+ enumerable: false,
543
+ configurable: true
544
+ });
538
545
  Object.defineProperty(Column.prototype, "visible", {
539
546
  get: function () {
540
547
  return this._attributes.visible;
@@ -2838,6 +2845,7 @@
2838
2845
  function ColumnAttributes(attrs) {
2839
2846
  if (attrs === void 0) { attrs = {}; }
2840
2847
  this._customize = true;
2848
+ this._direction$ = new ColumnAsyncAttribute(null);
2841
2849
  this._visible$ = new ColumnAsyncAttribute(true);
2842
2850
  this._init(attrs);
2843
2851
  }
@@ -2901,11 +2909,18 @@
2901
2909
  });
2902
2910
  Object.defineProperty(ColumnAttributes.prototype, "direction", {
2903
2911
  get: function () {
2904
- return this._direction;
2912
+ return this._direction$.value;
2905
2913
  },
2906
2914
  // direction
2907
2915
  set: function (value) {
2908
- this._direction = value;
2916
+ this._direction$.next(value);
2917
+ },
2918
+ enumerable: false,
2919
+ configurable: true
2920
+ });
2921
+ Object.defineProperty(ColumnAttributes.prototype, "direction$", {
2922
+ get: function () {
2923
+ return this._direction$.asObservable();
2909
2924
  },
2910
2925
  enumerable: false,
2911
2926
  configurable: true
@@ -4846,6 +4861,7 @@
4846
4861
  }
4847
4862
  else if (this.row.isChild) {
4848
4863
  this.cellContext.groupChildIndex = this.row.index;
4864
+ this.cellContext.groupRow = this.row.parent.data;
4849
4865
  }
4850
4866
  }
4851
4867
  this.cellContext.column = this.column;
@@ -4920,7 +4936,7 @@
4920
4936
  return FsHeadCellComponent;
4921
4937
  }(FsCellComponent));
4922
4938
  FsHeadCellComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsHeadCellComponent, deps: [{ token: i0__namespace.ChangeDetectorRef }, { token: i0__namespace.KeyValueDiffers }], target: i0__namespace.ɵɵFactoryTarget.Component });
4923
- FsHeadCellComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FsHeadCellComponent, selector: "[fs-head-cell]", usesInheritance: true, ngImport: i0__namespace, template: "<div class=\"wrap\">\n <span class=\"title\">\n <ng-template [ngIf]=\"!column.headerTemplate\">{{column.title}}</ng-template>\n <ng-template\n [ngIf]=\"column.headerTemplate\"\n [ngTemplateOutlet]=\"column.headerTemplate\"\n [ngTemplateOutletContext]=\"cellContext\">\n </ng-template>\n </span>\n <div class=\"direction\" *ngIf=\"column.ordered\" [ngSwitch]=\"column.sortingDirection\">\n <mat-icon class=\"material-icons\" role=\"img\" aria-label=\"arrow_downward\" *ngSwitchCase=\"'asc'\">arrow_downward</mat-icon>\n <mat-icon class=\"material-icons\" role=\"img\" aria-label=\"arrow_upward\" *ngSwitchCase=\"'desc'\">arrow_upward</mat-icon>\n </div>\n</div>\n", components: [{ type: i3__namespace.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }], directives: [{ type: i3__namespace$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3__namespace$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i3__namespace$1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i3__namespace$1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
4939
+ FsHeadCellComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FsHeadCellComponent, selector: "[fs-head-cell]", usesInheritance: true, ngImport: i0__namespace, template: "<div class=\"wrap\">\n <span class=\"title\">\n <ng-template [ngIf]=\"!column.headerTemplate\">{{column.title}}</ng-template>\n <ng-template\n [ngIf]=\"column.headerTemplate\"\n [ngTemplateOutlet]=\"column.headerTemplate\"\n [ngTemplateOutletContext]=\"cellContext\">\n </ng-template>\n </span>\n <div class=\"direction\" *ngIf=\"column.ordered\" [ngSwitch]=\"column.sortingDirection$ | async\">\n <mat-icon class=\"material-icons\" role=\"img\" aria-label=\"arrow_downward\" *ngSwitchCase=\"'asc'\">arrow_downward</mat-icon>\n <mat-icon class=\"material-icons\" role=\"img\" aria-label=\"arrow_upward\" *ngSwitchCase=\"'desc'\">arrow_upward</mat-icon>\n </div>\n</div>\n", components: [{ type: i3__namespace.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }], directives: [{ type: i3__namespace$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3__namespace$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i3__namespace$1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i3__namespace$1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }], pipes: { "async": i3__namespace$1.AsyncPipe }, changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
4924
4940
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsHeadCellComponent, decorators: [{
4925
4941
  type: i0.Component,
4926
4942
  args: [{
@@ -5469,7 +5485,16 @@
5469
5485
  if (this.row && this.row.isGroup)
5470
5486
  cls += ' fs-list-row-group';
5471
5487
  if (this.rowClass) {
5472
- var resultClass = this.rowClass(this.row.data);
5488
+ var options = {
5489
+ index: this.rowIndex,
5490
+ };
5491
+ if (this.row.isGroup) {
5492
+ options.groupIndex = this.row.index;
5493
+ }
5494
+ else if (this.row.isChild) {
5495
+ options.groupChildIndex = this.row.index;
5496
+ }
5497
+ var resultClass = this.rowClass(this.row.data, options);
5473
5498
  if (typeof resultClass === 'string') {
5474
5499
  cls += " " + resultClass;
5475
5500
  }