@firestitch/list 12.1.1 → 12.1.4

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
@@ -2986,6 +3001,21 @@
2986
3001
  _this.direction = attrs[key];
2987
3002
  }
2988
3003
  break;
3004
+ case 'sortable':
3005
+ {
3006
+ _this.sortable = attrs[key];
3007
+ }
3008
+ break;
3009
+ case 'show':
3010
+ {
3011
+ _this.visible = attrs[key];
3012
+ }
3013
+ break;
3014
+ case 'visible':
3015
+ {
3016
+ _this.visible = attrs[key];
3017
+ }
3018
+ break;
2989
3019
  }
2990
3020
  });
2991
3021
  };
@@ -3146,8 +3176,7 @@
3146
3176
  this.sortDirection(exports.SortingDirection.asc);
3147
3177
  };
3148
3178
  SortingController.prototype.getColumn = function (name) {
3149
- return this.sortingColumns.find(function (col) { return col.name === name && col.sortable; }) ||
3150
- this.fakeSortingColumns.find(function (col) { return col.name === name && col.sortable; });
3179
+ return __spreadArray(__spreadArray([], __read(this.sortingColumns)), __read(this.fakeSortingColumns)).find(function (col) { return col.name === name && col.sortable; });
3151
3180
  };
3152
3181
  /**
3153
3182
  * Destroy
@@ -4906,7 +4935,7 @@
4906
4935
  return FsHeadCellComponent;
4907
4936
  }(FsCellComponent));
4908
4937
  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 });
4909
- 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 });
4938
+ 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 });
4910
4939
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsHeadCellComponent, decorators: [{
4911
4940
  type: i0.Component,
4912
4941
  args: [{
@@ -5455,7 +5484,16 @@
5455
5484
  if (this.row && this.row.isGroup)
5456
5485
  cls += ' fs-list-row-group';
5457
5486
  if (this.rowClass) {
5458
- var resultClass = this.rowClass(this.row.data);
5487
+ var options = {
5488
+ index: this.rowIndex,
5489
+ };
5490
+ if (this.row.isGroup) {
5491
+ options.groupIndex = this.row.index;
5492
+ }
5493
+ else if (this.row.isChild) {
5494
+ options.groupChildIndex = this.row.index;
5495
+ }
5496
+ var resultClass = this.rowClass(this.row.data, options);
5459
5497
  if (typeof resultClass === 'string') {
5460
5498
  cls += " " + resultClass;
5461
5499
  }