@firestitch/filter 12.12.0 → 12.12.2

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.
@@ -14,12 +14,12 @@ import { FsFilterOverlayService } from '../../services/filter-overlay.service';
14
14
  import { FsFilterItemsStore } from '../../services/items-store.service';
15
15
  import * as i0 from "@angular/core";
16
16
  export declare class FilterComponent implements OnInit, AfterViewInit, OnDestroy {
17
+ private _defaultConfig;
17
18
  private _filterOverlay;
18
19
  private _zone;
19
20
  private _externalParams;
20
21
  private _filterItems;
21
22
  private _actions;
22
- private _defaultConfig;
23
23
  set setConfig(config: any);
24
24
  set setFilter(config: any);
25
25
  showSortBy: any;
@@ -42,7 +42,7 @@ export declare class FilterComponent implements OnInit, AfterViewInit, OnDestroy
42
42
  private _keywordVisible$;
43
43
  private _hasFilterChips$;
44
44
  private _destroy$;
45
- constructor(_filterOverlay: FsFilterOverlayService, _zone: NgZone, _externalParams: ExternalParamsController, _filterItems: FsFilterItemsStore, _actions: ActionsController, _defaultConfig: FsFilterConfig);
45
+ constructor(_defaultConfig: FsFilterConfig, _filterOverlay: FsFilterOverlayService, _zone: NgZone, _externalParams: ExternalParamsController, _filterItems: FsFilterItemsStore, _actions: ActionsController);
46
46
  get config(): FsFilterConfig;
47
47
  get filterParams(): Record<string, unknown>;
48
48
  get filterParamsQuery(): Record<string, unknown>;
@@ -190,6 +190,6 @@ export declare class FilterComponent implements OnInit, AfterViewInit, OnDestroy
190
190
  private _initOverlay;
191
191
  private _listenWhenFilterReady;
192
192
  private _updateChipsVisibility;
193
- static ɵfac: i0.ɵɵFactoryDeclaration<FilterComponent, [null, null, null, null, null, { optional: true; }]>;
193
+ static ɵfac: i0.ɵɵFactoryDeclaration<FilterComponent, [{ optional: true; }, null, null, null, null, null]>;
194
194
  static ɵcmp: i0.ɵɵComponentDeclaration<FilterComponent, "fs-filter", never, { "setConfig": "config"; "setFilter": "filter"; "showSortBy": "showSortBy"; "showFilterInput": "showFilterInput"; }, { "closed": "closed"; "opened": "opened"; "ready": "ready"; }, ["statusBar"], never>;
195
195
  }
@@ -10,4 +10,4 @@ import { AutocompleteChipsItem } from '../models/items/autocomplete-chips-item';
10
10
  import { CheckboxItem } from '../models/items/checkbox-item';
11
11
  import { TextItem } from '../models/items/text-item';
12
12
  import { WeekItem } from '../models/items/week-item';
13
- export declare function createFilterItem(item: IFilterConfigItem, config: any): import("../models/items/select/multiple-select-item").MultipleSelectItem | import("../models/items/select/simple-select-item").SimpleSelectItem | ChipsItem | RangeItem | DateRangeItem | DateTimeRangeItem | DateItem | DateTimeItem | AutocompleteItem | AutocompleteChipsItem | CheckboxItem | TextItem | WeekItem;
13
+ export declare function createFilterItem(item: IFilterConfigItem, config: any): import("../models/items/select/multiple-select-item").MultipleSelectItem | RangeItem | DateRangeItem | DateTimeRangeItem | WeekItem | import("../models/items/select/simple-select-item").SimpleSelectItem | ChipsItem | DateItem | DateTimeItem | AutocompleteItem | AutocompleteChipsItem | CheckboxItem | TextItem;
@@ -1,11 +1,11 @@
1
1
  import { OnDestroy } from '@angular/core';
2
2
  import { BehaviorSubject, Observable } from 'rxjs';
3
- import { FsFilterItemsStore } from './items-store.service';
3
+ import { IFilterExternalParams } from '../interfaces/external-params.interface';
4
+ import { IFilterSavedFilter } from '../interfaces/saved-filters.interface';
4
5
  import { PersistanceParamsController } from './external-params/persistance-params-controller.service';
5
6
  import { QueryParamsController } from './external-params/query-params-controller.service';
6
7
  import { SavedFiltersController } from './external-params/saved-filters-controller.service';
7
- import { IFilterExternalParams } from '../interfaces/external-params.interface';
8
- import { IFilterSavedFilter } from '../interfaces/saved-filters.interface';
8
+ import { FsFilterItemsStore } from './items-store.service';
9
9
  import * as i0 from "@angular/core";
10
10
  export declare class ExternalParamsController implements OnDestroy {
11
11
  private _itemsStore;
@@ -45,7 +45,7 @@ export declare class FsFilterItemsStore implements OnDestroy {
45
45
  updateSort(sort: ISortingChangeEvent): void;
46
46
  values(onlyPresented?: boolean): Record<string, unknown>;
47
47
  valuesAsQuery({ onlyPresented, items, persisted, }?: IValueAsQuery): Record<string, unknown>;
48
- initItemValues(p: IFilterExternalParams): void;
48
+ init(p: IFilterExternalParams): void;
49
49
  updateItemsWithValues(values: IFilterExternalParams): void;
50
50
  destroyItems(): void;
51
51
  /**
@@ -2308,7 +2308,7 @@
2308
2308
  }
2309
2309
  return params;
2310
2310
  };
2311
- FsFilterItemsStore.prototype.initItemValues = function (p) {
2311
+ FsFilterItemsStore.prototype.init = function (p) {
2312
2312
  this.items
2313
2313
  .forEach(function (item) {
2314
2314
  item.initValues(p[item.name]);
@@ -2316,10 +2316,6 @@
2316
2316
  this._initSortingItems(p);
2317
2317
  this.loadAsyncDefaults();
2318
2318
  this._subscribeToItemsChanges();
2319
- this.items
2320
- .forEach(function (item) {
2321
- item.init(item);
2322
- });
2323
2319
  };
2324
2320
  FsFilterItemsStore.prototype.updateItemsWithValues = function (values) {
2325
2321
  this.items
@@ -3022,6 +3018,7 @@
3022
3018
  };
3023
3019
  ExternalParamsController.prototype.initItems = function () {
3024
3020
  var _this = this;
3021
+ this._itemsStore.ready$;
3025
3022
  this._pending$.next(true);
3026
3023
  if (this._savedFilters.enabled) {
3027
3024
  this._savedFilters
@@ -3041,7 +3038,7 @@
3041
3038
  this._listenItemsChange();
3042
3039
  };
3043
3040
  ExternalParamsController.prototype._initItemsValues = function () {
3044
- this._itemsStore.initItemValues(this.params);
3041
+ this._itemsStore.init(this.params);
3045
3042
  this._saveQueryParams();
3046
3043
  this._savePersistedParams();
3047
3044
  };
@@ -4822,14 +4819,14 @@
4822
4819
  }] } });
4823
4820
 
4824
4821
  var FilterComponent = /** @class */ (function () {
4825
- function FilterComponent(_filterOverlay, _zone, _externalParams, _filterItems, _actions, _defaultConfig) {
4822
+ function FilterComponent(_defaultConfig, _filterOverlay, _zone, _externalParams, _filterItems, _actions) {
4826
4823
  var _this = this;
4824
+ this._defaultConfig = _defaultConfig;
4827
4825
  this._filterOverlay = _filterOverlay;
4828
4826
  this._zone = _zone;
4829
4827
  this._externalParams = _externalParams;
4830
4828
  this._filterItems = _filterItems;
4831
4829
  this._actions = _actions;
4832
- this._defaultConfig = _defaultConfig;
4833
4830
  this.showSortBy = true;
4834
4831
  this.showFilterInput = true;
4835
4832
  this.closed = new i0.EventEmitter();
@@ -5191,12 +5188,20 @@
5191
5188
  this.searchTextInput.nativeElement.focus();
5192
5189
  };
5193
5190
  FilterComponent.prototype.init = function () {
5191
+ var _this = this;
5194
5192
  var data = this._filterItems.valuesAsQuery();
5195
5193
  this._sort = this._filterItems.getSort();
5196
5194
  if (this.config.init) {
5197
5195
  this.config.init(data, this._sort);
5198
5196
  }
5199
5197
  this._updateChipsVisibility();
5198
+ // Waiting for external ViewChilds
5199
+ setTimeout(function () {
5200
+ _this.items
5201
+ .forEach(function (item) {
5202
+ item.init(item);
5203
+ });
5204
+ });
5200
5205
  };
5201
5206
  FilterComponent.prototype.clear = function (event) {
5202
5207
  if (event === void 0) { event = null; }
@@ -5438,7 +5443,7 @@
5438
5443
  };
5439
5444
  return FilterComponent;
5440
5445
  }());
5441
- FilterComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FilterComponent, deps: [{ token: FsFilterOverlayService }, { token: i0__namespace.NgZone }, { token: ExternalParamsController }, { token: FsFilterItemsStore }, { token: ActionsController }, { token: FS_FILTER_CONFIG, optional: true }], target: i0__namespace.ɵɵFactoryTarget.Component });
5446
+ FilterComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FilterComponent, deps: [{ token: FS_FILTER_CONFIG, optional: true }, { token: FsFilterOverlayService }, { token: i0__namespace.NgZone }, { token: ExternalParamsController }, { token: FsFilterItemsStore }, { token: ActionsController }], target: i0__namespace.ɵɵFactoryTarget.Component });
5442
5447
  FilterComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FilterComponent, selector: "fs-filter", inputs: { setConfig: ["config", "setConfig"], setFilter: ["filter", "setFilter"], showSortBy: "showSortBy", showFilterInput: "showFilterInput" }, outputs: { closed: "closed", opened: "opened", ready: "ready" }, host: { properties: { "class.filters-open": "this.showFilterMenu", "class.window-desktop": "this.windowDesktop", "class.fs-filter": "this.fsFilterClass", "class.has-keyword": "this.hasKeyword" } }, providers: [
5443
5448
  FsFilterOverlayService,
5444
5449
  ExternalParamsController,
@@ -5469,12 +5474,12 @@
5469
5474
  changeDetection: i0.ChangeDetectionStrategy.OnPush,
5470
5475
  }]
5471
5476
  }], ctorParameters: function () {
5472
- return [{ type: FsFilterOverlayService }, { type: i0__namespace.NgZone }, { type: ExternalParamsController }, { type: FsFilterItemsStore }, { type: ActionsController }, { type: FsFilterConfig, decorators: [{
5477
+ return [{ type: FsFilterConfig, decorators: [{
5473
5478
  type: i0.Optional
5474
5479
  }, {
5475
5480
  type: i0.Inject,
5476
5481
  args: [FS_FILTER_CONFIG]
5477
- }] }];
5482
+ }] }, { type: FsFilterOverlayService }, { type: i0__namespace.NgZone }, { type: ExternalParamsController }, { type: FsFilterItemsStore }, { type: ActionsController }];
5478
5483
  }, propDecorators: { setConfig: [{
5479
5484
  type: i0.Input,
5480
5485
  args: ['config']