@firestitch/filter 12.12.6 → 12.12.8

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.
@@ -20,7 +20,7 @@ export interface IFilterConfigBaseItem<T = DefaultItemType, U = string> {
20
20
  primary?: boolean;
21
21
  default?: unknown;
22
22
  change?: (item: BaseItem<any>) => void;
23
- init?: (item: BaseItem<any>) => void;
23
+ init?: (item: BaseItem<any>, filter?: any) => void;
24
24
  clear?: boolean;
25
25
  disablePersist?: boolean;
26
26
  disableQueryParams?: boolean;
@@ -1,5 +1,5 @@
1
1
  import { FsFilterAction } from '../interfaces/action.interface';
2
- import { ChangeFn, Sort } from '../interfaces/config.interface';
2
+ import { ChangeFn, FilterSort, Sort } from '../interfaces/config.interface';
3
3
  import { IFilterSavedFiltersConfig } from '../interfaces/saved-filters.interface';
4
4
  import { FilterButton, FilterConfig, FsFilterPersistance, IFilterConfigItem } from './../interfaces/config.interface';
5
5
  export declare const SORT_BY_FIELD = "sortName";
@@ -14,7 +14,7 @@ export declare class FsFilterConfig {
14
14
  sortValues: any[];
15
15
  sort: Sort;
16
16
  queryParam: boolean;
17
- init: ChangeFn;
17
+ init: (query?: any, sort?: FilterSort | null, filter?: any) => void;
18
18
  change: ChangeFn;
19
19
  reload: ChangeFn;
20
20
  clear: ChangeFn;
@@ -15,7 +15,7 @@ export declare abstract class BaseItem<T extends IFilterConfigItem> {
15
15
  persistanceDisabled: boolean;
16
16
  queryParamsDisabled: boolean;
17
17
  change: (item: BaseItem<T>) => void;
18
- init: (item: BaseItem<T>) => void;
18
+ init: (item: BaseItem<T>, filter?: any) => void;
19
19
  protected readonly _type: T['type'];
20
20
  protected _model: any;
21
21
  protected _pendingValues: boolean;
@@ -5169,15 +5169,12 @@
5169
5169
  var data = this._filterItems.valuesAsQuery();
5170
5170
  this._sort = this._filterItems.getSort();
5171
5171
  if (this.config.init) {
5172
- this.config.init(data, this._sort);
5172
+ this.config.init(data, this._sort, this);
5173
5173
  }
5174
5174
  this._updateChipsVisibility();
5175
- // Waiting for external ViewChilds
5176
- setTimeout(function () {
5177
- _this.items
5178
- .forEach(function (item) {
5179
- item.init(item);
5180
- });
5175
+ this.items
5176
+ .forEach(function (item) {
5177
+ item.init(item, _this);
5181
5178
  });
5182
5179
  };
5183
5180
  FilterComponent.prototype.clear = function (event) {