@firestitch/list 12.3.1 → 12.3.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.
@@ -25,6 +25,7 @@ export declare class List {
25
25
  heading: string;
26
26
  trackBy: string;
27
27
  subheading: string;
28
+ autoFocus: boolean;
28
29
  rowActionsRaw: any[];
29
30
  groupActionsRaw: any[];
30
31
  rowClass: any;
@@ -127,6 +128,11 @@ export declare class List {
127
128
  */
128
129
  private listenFetch;
129
130
  private listenRowsRemove;
131
+ /**
132
+ * Lister may have originally hidden columns, but visibility of those columns
133
+ * can be changed programmaticaly in any time
134
+ */
135
+ private _listenVisibleColumnChanges;
130
136
  private initInfinityScroll;
131
137
  /**
132
138
  * Update and watch filter changes
@@ -164,4 +170,5 @@ export declare class List {
164
170
  * @param row
165
171
  */
166
172
  private restoreClick;
173
+ private _updateSortingColumns;
167
174
  }
@@ -55,6 +55,7 @@ export declare class FsListComponent implements OnInit, OnDestroy {
55
55
  get groupEnabled(): boolean;
56
56
  get paginatorVisible(): boolean;
57
57
  set groupEnabled(value: boolean);
58
+ get filtersQuery(): Record<string, unknown>;
58
59
  ngOnInit(): void;
59
60
  ngOnDestroy(): void;
60
61
  nextPage(): void;
@@ -22,6 +22,7 @@ export interface FsListConfig {
22
22
  status?: boolean;
23
23
  chips?: boolean;
24
24
  column?: FsListColumnConfig;
25
+ autoFocus?: boolean;
25
26
  filterInput?: boolean;
26
27
  queryParam?: boolean;
27
28
  paging?: FsPaging | false;
@@ -3522,7 +3522,6 @@
3522
3522
  * @param templates
3523
3523
  */
3524
3524
  List.prototype.tranformTemplatesToColumns = function (templates) {
3525
- var _this = this;
3526
3525
  var defaultConfigs = {
3527
3526
  header: this._headerConfig,
3528
3527
  groupCell: this._groupCellConfig,
@@ -3532,12 +3531,7 @@
3532
3531
  this.columns.setDefaults(defaultConfigs);
3533
3532
  this.columns.initializeColumns(templates);
3534
3533
  // Set sortBy default column
3535
- this.sorting.clearSortableColumns();
3536
- this.columns.columns
3537
- .filter(function (column) { return column.sortable && column.visible; })
3538
- .forEach(function (column) {
3539
- _this.sorting.addSortableColumn(column);
3540
- });
3534
+ this._updateSortingColumns();
3541
3535
  // Default sort by
3542
3536
  var externalSorting = this.externalParams.externalSorting;
3543
3537
  var initialSortConfig = externalSorting || this.config.sort;
@@ -3614,6 +3608,7 @@
3614
3608
  _this.fetch$.next();
3615
3609
  }
3616
3610
  });
3611
+ this._listenVisibleColumnChanges();
3617
3612
  this.listenRowsRemove();
3618
3613
  this.listenFetch();
3619
3614
  };
@@ -3674,6 +3669,7 @@
3674
3669
  */
3675
3670
  List.prototype.initialize = function (config) {
3676
3671
  var _a;
3672
+ this.autoFocus = config.autoFocus;
3677
3673
  this.heading = config.heading;
3678
3674
  this.trackBy = config.trackBy;
3679
3675
  this.subheading = config.subheading;
@@ -3905,6 +3901,18 @@
3905
3901
  }
3906
3902
  });
3907
3903
  };
3904
+ /**
3905
+ * Lister may have originally hidden columns, but visibility of those columns
3906
+ * can be changed programmaticaly in any time
3907
+ */
3908
+ List.prototype._listenVisibleColumnChanges = function () {
3909
+ var _this = this;
3910
+ this.columns.visibleColumns$
3911
+ .pipe(operators.takeUntil(this.onDestroy$))
3912
+ .subscribe(function () {
3913
+ _this._updateSortingColumns();
3914
+ });
3915
+ };
3908
3916
  List.prototype.initInfinityScroll = function () {
3909
3917
  var _this = this;
3910
3918
  if (this.fsScrollInstance) {
@@ -3985,6 +3993,7 @@
3985
3993
  // inline: this.inlineFilters,
3986
3994
  actions: this.actions.actions,
3987
3995
  queryParam: this.queryParam,
3996
+ autofocus: this.autoFocus,
3988
3997
  sorts: sortValues,
3989
3998
  sort: sortConfig,
3990
3999
  chips: this.chips,
@@ -4139,6 +4148,15 @@
4139
4148
  });
4140
4149
  }
4141
4150
  };
4151
+ List.prototype._updateSortingColumns = function () {
4152
+ var _this = this;
4153
+ this.sorting.clearSortableColumns();
4154
+ this.columns.columns
4155
+ .filter(function (column) { return column.sortable && column.visible; })
4156
+ .forEach(function (column) {
4157
+ _this.sorting.addSortableColumn(column);
4158
+ });
4159
+ };
4142
4160
  return List;
4143
4161
  }());
4144
4162
 
@@ -6118,6 +6136,13 @@
6118
6136
  enumerable: false,
6119
6137
  configurable: true
6120
6138
  });
6139
+ Object.defineProperty(FsListComponent.prototype, "filtersQuery", {
6140
+ get: function () {
6141
+ return this.list.filtersQuery;
6142
+ },
6143
+ enumerable: false,
6144
+ configurable: true
6145
+ });
6121
6146
  FsListComponent.prototype.ngOnInit = function () {
6122
6147
  this._subscribeToRemoveRow();
6123
6148
  this._subscribeToGroupExpandStatusChange();