@firestitch/filter 12.12.13 → 12.13.0

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.
Files changed (35) hide show
  1. package/app/components/filter/filter.component.d.ts +2 -1
  2. package/app/components/filter-chip/filter-chip.component.d.ts +1 -1
  3. package/app/components/filter-chips/filter-chips.component.d.ts +1 -1
  4. package/app/components/filter-drawer/filter-drawer.component.d.ts +8 -6
  5. package/app/components/filters-item/autocomplete/autocomplete.component.d.ts +1 -1
  6. package/app/components/filters-item/autocompletechips/autocompletechips.component.d.ts +1 -1
  7. package/app/components/filters-item/base-item/base-item.component.d.ts +5 -3
  8. package/app/components/filters-item/filter-item.component.d.ts +11 -9
  9. package/app/fs-filter.module.d.ts +1 -1
  10. package/app/helpers/create-filter-item.d.ts +1 -1
  11. package/app/models/items/autocomplete/base-autocomplete-item.d.ts +3 -3
  12. package/app/models/items/base-item.d.ts +7 -6
  13. package/app/services/filter-overlay.service.d.ts +7 -5
  14. package/app/services/items-store.service.d.ts +3 -1
  15. package/bundles/firestitch-filter.umd.js +138 -137
  16. package/bundles/firestitch-filter.umd.js.map +1 -1
  17. package/esm2015/app/components/filter/filter.component.js +9 -8
  18. package/esm2015/app/components/filter-chip/filter-chip.component.js +4 -4
  19. package/esm2015/app/components/filter-chips/filter-chips.component.js +1 -1
  20. package/esm2015/app/components/filter-drawer/filter-drawer.component.js +15 -14
  21. package/esm2015/app/components/filters-item/autocomplete/autocomplete.component.js +3 -3
  22. package/esm2015/app/components/filters-item/autocompletechips/autocompletechips.component.js +2 -2
  23. package/esm2015/app/components/filters-item/base-item/base-item.component.js +6 -10
  24. package/esm2015/app/components/filters-item/filter-item.component.js +5 -3
  25. package/esm2015/app/fs-filter.module.js +11 -9
  26. package/esm2015/app/models/items/autocomplete/base-autocomplete-item.js +2 -1
  27. package/esm2015/app/models/items/base-item.js +6 -8
  28. package/esm2015/app/models/items/select/multiple-select-item.js +4 -6
  29. package/esm2015/app/models/items/select/simple-select-item.js +8 -10
  30. package/esm2015/app/pipes/remove-isolate-value.pipe.js +5 -7
  31. package/esm2015/app/services/filter-overlay.service.js +19 -15
  32. package/esm2015/app/services/items-store.service.js +13 -13
  33. package/fesm2015/firestitch-filter.js +128 -129
  34. package/fesm2015/firestitch-filter.js.map +1 -1
  35. package/package.json +1 -1
@@ -1,8 +1,8 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('rxjs'), require('rxjs/operators'), require('@firestitch/common'), require('lodash-es'), require('@firestitch/date'), require('date-fns'), require('@firestitch/datepicker'), require('@firestitch/store'), require('@angular/router'), require('@angular/common'), require('@angular/material/dialog'), require('@firestitch/drawer'), require('@angular/material/form-field'), require('@angular/material/select'), require('@angular/material/core'), require('@angular/material/button'), require('@angular/forms'), require('@firestitch/form'), require('@angular/material/input'), require('@angular/cdk/portal'), require('@angular/material/autocomplete'), require('@angular/material/checkbox'), require('@angular/material/chips'), require('@angular/material/icon'), require('@firestitch/autocomplete'), require('@firestitch/autocomplete-chips'), require('@firestitch/chip'), require('@firestitch/file'), require('@firestitch/label'), require('@firestitch/menu'), require('@firestitch/popover'), require('@firestitch/scroll'), require('@firestitch/skeleton'), require('@firestitch/clear'), require('@angular/cdk/overlay'), require('@angular/cdk/layout')) :
3
- typeof define === 'function' && define.amd ? define('@firestitch/filter', ['exports', '@angular/core', 'rxjs', 'rxjs/operators', '@firestitch/common', 'lodash-es', '@firestitch/date', 'date-fns', '@firestitch/datepicker', '@firestitch/store', '@angular/router', '@angular/common', '@angular/material/dialog', '@firestitch/drawer', '@angular/material/form-field', '@angular/material/select', '@angular/material/core', '@angular/material/button', '@angular/forms', '@firestitch/form', '@angular/material/input', '@angular/cdk/portal', '@angular/material/autocomplete', '@angular/material/checkbox', '@angular/material/chips', '@angular/material/icon', '@firestitch/autocomplete', '@firestitch/autocomplete-chips', '@firestitch/chip', '@firestitch/file', '@firestitch/label', '@firestitch/menu', '@firestitch/popover', '@firestitch/scroll', '@firestitch/skeleton', '@firestitch/clear', '@angular/cdk/overlay', '@angular/cdk/layout'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.firestitch = global.firestitch || {}, global.firestitch.filter = {}), global.ng.core, global.rxjs, global.rxjs.operators, global.common, global.lodashEs, global.date, global.dateFns, global.i3, global.i1, global.ng.router, global.ng.common, global.ng.material.dialog, global.i6, global.ng.material.formField, global.ng.material.select, global.ng.material.core, global.ng.material.button, global.ng.forms, global.i7, global.ng.material.input, global.ng.cdk.portal, global.ng.material.autocomplete, global.ng.material.checkbox, global.ng.material.chips, global.ng.material.icon, global.i4$2, global.i5, global.i2$2, global.i4$1, global.i1$5, global.i3$4, global.i7$1, global.scroll, global.i6$1, global.i8, global.ng.cdk.overlay, global.ng.cdk.layout));
5
- })(this, (function (exports, i0, rxjs, operators, common, lodashEs, date, dateFns, i3, i1, i1$1, i3$1, i1$2, i6, i1$3, i2, i3$2, i1$4, i4, i7, i3$3, portal, autocomplete, i4$3, chips, i2$1, i4$2, i5, i2$2, i4$1, i1$5, i3$4, i7$1, scroll, i6$1, i8, i1$6, i1$7) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('rxjs'), require('rxjs/operators'), require('@firestitch/common'), require('lodash-es'), require('@firestitch/date'), require('date-fns'), require('@firestitch/datepicker'), require('@firestitch/store'), require('@angular/router'), require('@angular/common'), require('@angular/material/dialog'), require('@firestitch/drawer'), require('@angular/material/form-field'), require('@angular/material/select'), require('@angular/material/core'), require('@angular/material/button'), require('@angular/forms'), require('@firestitch/form'), require('@angular/material/input'), require('@angular/cdk/portal'), require('@angular/material/autocomplete'), require('@angular/material/checkbox'), require('@angular/material/chips'), require('@angular/material/icon'), require('@firestitch/autocomplete'), require('@firestitch/autocomplete-chips'), require('@firestitch/chip'), require('@firestitch/clear'), require('@firestitch/file'), require('@firestitch/label'), require('@firestitch/menu'), require('@firestitch/popover'), require('@firestitch/scroll'), require('@firestitch/skeleton'), require('@angular/cdk/overlay'), require('@angular/cdk/layout')) :
3
+ typeof define === 'function' && define.amd ? define('@firestitch/filter', ['exports', '@angular/core', 'rxjs', 'rxjs/operators', '@firestitch/common', 'lodash-es', '@firestitch/date', 'date-fns', '@firestitch/datepicker', '@firestitch/store', '@angular/router', '@angular/common', '@angular/material/dialog', '@firestitch/drawer', '@angular/material/form-field', '@angular/material/select', '@angular/material/core', '@angular/material/button', '@angular/forms', '@firestitch/form', '@angular/material/input', '@angular/cdk/portal', '@angular/material/autocomplete', '@angular/material/checkbox', '@angular/material/chips', '@angular/material/icon', '@firestitch/autocomplete', '@firestitch/autocomplete-chips', '@firestitch/chip', '@firestitch/clear', '@firestitch/file', '@firestitch/label', '@firestitch/menu', '@firestitch/popover', '@firestitch/scroll', '@firestitch/skeleton', '@angular/cdk/overlay', '@angular/cdk/layout'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.firestitch = global.firestitch || {}, global.firestitch.filter = {}), global.ng.core, global.rxjs, global.rxjs.operators, global.common, global.lodashEs, global.date, global.dateFns, global.i3, global.i1, global.ng.router, global.ng.common, global.ng.material.dialog, global.i6, global.ng.material.formField, global.ng.material.select, global.ng.material.core, global.ng.material.button, global.ng.forms, global.i7, global.ng.material.input, global.ng.cdk.portal, global.ng.material.autocomplete, global.ng.material.checkbox, global.ng.material.chips, global.ng.material.icon, global.i4$2, global.i5, global.i2$2, global.i8, global.i4$1, global.i1$5, global.i3$4, global.i7$1, global.scroll, global.i6$1, global.ng.cdk.overlay, global.ng.cdk.layout));
5
+ })(this, (function (exports, i0, rxjs, operators, common, lodashEs, date, dateFns, i3, i1, i1$1, i3$1, i1$2, i6, i1$3, i2, i3$2, i1$4, i4, i7, i3$3, portal, autocomplete, i4$3, chips, i2$1, i4$2, i5, i2$2, i8, i4$1, i1$5, i3$4, i7$1, scroll, i6$1, i1$6, i1$7) { 'use strict';
6
6
 
7
7
  function _interopNamespace(e) {
8
8
  if (e && e.__esModule) return e;
@@ -41,12 +41,12 @@
41
41
  var i4__namespace$2 = /*#__PURE__*/_interopNamespace(i4$2);
42
42
  var i5__namespace = /*#__PURE__*/_interopNamespace(i5);
43
43
  var i2__namespace$2 = /*#__PURE__*/_interopNamespace(i2$2);
44
+ var i8__namespace = /*#__PURE__*/_interopNamespace(i8);
44
45
  var i4__namespace$1 = /*#__PURE__*/_interopNamespace(i4$1);
45
46
  var i1__namespace$5 = /*#__PURE__*/_interopNamespace(i1$5);
46
47
  var i3__namespace$3 = /*#__PURE__*/_interopNamespace(i3$4);
47
48
  var i7__namespace$1 = /*#__PURE__*/_interopNamespace(i7$1);
48
49
  var i6__namespace$1 = /*#__PURE__*/_interopNamespace(i6$1);
49
- var i8__namespace = /*#__PURE__*/_interopNamespace(i8);
50
50
  var i1__namespace$6 = /*#__PURE__*/_interopNamespace(i1$6);
51
51
  var i1__namespace$7 = /*#__PURE__*/_interopNamespace(i1$7);
52
52
 
@@ -378,6 +378,54 @@
378
378
  return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
379
379
  }
380
380
 
381
+ function objectsAreEquals(obj1, obj2) {
382
+ var oldKeys = Object.keys(obj1);
383
+ var currKeys = Object.keys(obj2);
384
+ if (oldKeys.length !== currKeys.length) {
385
+ return false;
386
+ }
387
+ for (var key in obj1) {
388
+ if (obj1.hasOwnProperty(key)) {
389
+ var oldItem = obj1[key];
390
+ var currItem = obj2[key];
391
+ var isArrays = Array.isArray(oldItem) && Array.isArray(currItem);
392
+ var isObjects = lodashEs.isObject(oldItem) && lodashEs.isObject(currItem);
393
+ if (isArrays && !arraysAreEquals(oldItem, currItem)) {
394
+ return false;
395
+ }
396
+ else if (isObjects && !objectsAreEquals(oldItem, currItem)) {
397
+ return false;
398
+ }
399
+ else if (!isArrays && !isObjects && oldItem !== currItem) {
400
+ return false;
401
+ }
402
+ }
403
+ }
404
+ return true;
405
+ }
406
+ function arraysAreEquals(arr1, arr2) {
407
+ var e_1, _a;
408
+ if (arr1.length !== arr2.length) {
409
+ return false;
410
+ }
411
+ try {
412
+ for (var arr1_1 = __values(arr1), arr1_1_1 = arr1_1.next(); !arr1_1_1.done; arr1_1_1 = arr1_1.next()) {
413
+ var el = arr1_1_1.value;
414
+ if (arr2.indexOf(el) === -1) {
415
+ return false;
416
+ }
417
+ }
418
+ }
419
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
420
+ finally {
421
+ try {
422
+ if (arr1_1_1 && !arr1_1_1.done && (_a = arr1_1.return)) _a.call(arr1_1);
423
+ }
424
+ finally { if (e_1) throw e_1.error; }
425
+ }
426
+ return true;
427
+ }
428
+
381
429
  exports.ItemType = void 0;
382
430
  (function (ItemType) {
383
431
  ItemType["Text"] = "text";
@@ -646,13 +694,13 @@
646
694
  _this._pendingDefaultValue = false;
647
695
  }));
648
696
  };
649
- BaseItem.prototype.initValues = function (persistedValue) {
697
+ BaseItem.prototype.initValues = function (filter, persistedValue) {
650
698
  // this._initialized = false;
651
699
  this.persistedValue = persistedValue;
652
700
  this._initDefaultModel();
653
701
  var isAutocomplete = this.type === exports.ItemType.AutoComplete || this.type === exports.ItemType.AutoCompleteChips;
654
702
  if (this._valuesFn && !isAutocomplete) {
655
- var valuesResult = this._valuesFn();
703
+ var valuesResult = this._valuesFn(null, filter);
656
704
  if (rxjs.isObservable(valuesResult)) {
657
705
  this._pendingValues = true;
658
706
  }
@@ -668,12 +716,12 @@
668
716
  // this._initialized = true;
669
717
  }
670
718
  };
671
- BaseItem.prototype.loadAsyncValues = function (reload) {
719
+ BaseItem.prototype.loadAsyncValues = function (filter, reload) {
672
720
  var _this = this;
673
721
  if (reload === void 0) { reload = true; }
674
722
  if (reload || (!this.loading && this.hasPendingValues)) {
675
723
  this.loading = true;
676
- this._valuesFn()
724
+ this._valuesFn(null, filter)
677
725
  .pipe(operators.take(1), operators.takeUntil(this._destroy$))
678
726
  .subscribe(function (values) {
679
727
  _this.values = values;
@@ -693,7 +741,6 @@
693
741
  this._clear$.next(defaultValue);
694
742
  this._clearValue(defaultValue);
695
743
  };
696
- ;
697
744
  BaseItem.prototype.getChipsContent = function (type) {
698
745
  return '';
699
746
  };
@@ -728,7 +775,6 @@
728
775
  this.values = item.values;
729
776
  }
730
777
  };
731
- ;
732
778
  BaseItem.prototype._initDefaultModel = function () {
733
779
  var _a;
734
780
  var model = (_a = this.persistedValue) !== null && _a !== void 0 ? _a : this.defaultValue;
@@ -783,54 +829,6 @@
783
829
  return BaseSelectItem;
784
830
  }(BaseItem));
785
831
 
786
- function objectsAreEquals(obj1, obj2) {
787
- var oldKeys = Object.keys(obj1);
788
- var currKeys = Object.keys(obj2);
789
- if (oldKeys.length !== currKeys.length) {
790
- return false;
791
- }
792
- for (var key in obj1) {
793
- if (obj1.hasOwnProperty(key)) {
794
- var oldItem = obj1[key];
795
- var currItem = obj2[key];
796
- var isArrays = Array.isArray(oldItem) && Array.isArray(currItem);
797
- var isObjects = lodashEs.isObject(oldItem) && lodashEs.isObject(currItem);
798
- if (isArrays && !arraysAreEquals(oldItem, currItem)) {
799
- return false;
800
- }
801
- else if (isObjects && !objectsAreEquals(oldItem, currItem)) {
802
- return false;
803
- }
804
- else if (!isArrays && !isObjects && oldItem !== currItem) {
805
- return false;
806
- }
807
- }
808
- }
809
- return true;
810
- }
811
- function arraysAreEquals(arr1, arr2) {
812
- var e_1, _a;
813
- if (arr1.length !== arr2.length) {
814
- return false;
815
- }
816
- try {
817
- for (var arr1_1 = __values(arr1), arr1_1_1 = arr1_1.next(); !arr1_1_1.done; arr1_1_1 = arr1_1.next()) {
818
- var el = arr1_1_1.value;
819
- if (arr2.indexOf(el) === -1) {
820
- return false;
821
- }
822
- }
823
- }
824
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
825
- finally {
826
- try {
827
- if (arr1_1_1 && !arr1_1_1.done && (_a = arr1_1.return)) _a.call(arr1_1);
828
- }
829
- finally { if (e_1) throw e_1.error; }
830
- }
831
- return true;
832
- }
833
-
834
832
  var MultipleSelectItem = /** @class */ (function (_super) {
835
833
  __extends(MultipleSelectItem, _super);
836
834
  function MultipleSelectItem(itemConfig, _persistedValues) {
@@ -910,9 +908,7 @@
910
908
  if (isNaN(val)) {
911
909
  return val;
912
910
  }
913
- else {
914
- return +val;
915
- }
911
+ return +val;
916
912
  });
917
913
  }
918
914
  _super.prototype._setModel.call(this, value);
@@ -996,17 +992,15 @@
996
992
  var _this = this;
997
993
  if (type === void 0) { type = null; }
998
994
  if (this.children) {
999
- var itemValue = findValue(this.values, this.model, this.children);
1000
- return itemValue && itemValue.name;
995
+ var itemValue_1 = findValue(this.values, this.model, this.children);
996
+ return itemValue_1 && itemValue_1.name;
1001
997
  }
1002
- else {
1003
- var itemValue = this.values.find(function (val) { return val.value === _this.model; });
1004
- if (itemValue) {
1005
- return itemValue.name;
1006
- }
1007
- else if (this.isolate) {
1008
- return this.isolate.label;
1009
- }
998
+ var itemValue = this.values.find(function (val) { return val.value === _this.model; });
999
+ if (itemValue) {
1000
+ return itemValue.name;
1001
+ }
1002
+ else if (this.isolate) {
1003
+ return this.isolate.label;
1010
1004
  }
1011
1005
  };
1012
1006
  Object.defineProperty(SimpleSelectItem.prototype, "isChipVisible", {
@@ -1602,6 +1596,7 @@
1602
1596
  configurable: true
1603
1597
  });
1604
1598
  BaseAutocompleteItem.prototype._validateModel = function () {
1599
+ //
1605
1600
  };
1606
1601
  BaseAutocompleteItem.prototype._parseConfig = function (item) {
1607
1602
  var _a;
@@ -2223,9 +2218,10 @@
2223
2218
  (_a = this.keywordItem) === null || _a === void 0 ? void 0 : _a.clear();
2224
2219
  };
2225
2220
  FsFilterItemsStore.prototype.loadAsyncValues = function () {
2221
+ var _this = this;
2226
2222
  this.items
2227
2223
  .filter(function (item) { return item.hasPendingValues; })
2228
- .forEach(function (item) { return item.loadAsyncValues(); });
2224
+ .forEach(function (item) { return item.loadAsyncValues(_this.filter); });
2229
2225
  };
2230
2226
  FsFilterItemsStore.prototype.loadAsyncDefaults = function () {
2231
2227
  var _this = this;
@@ -2246,7 +2242,7 @@
2246
2242
  rxjs.forkJoin(__spreadArray(__spreadArray([], __read(defaultValuesToBeLoaded
2247
2243
  .map(function (item) { return item.loadDefaultValue(); }))), __read(valuesToBeLoaded
2248
2244
  .map(function (item) {
2249
- item.loadAsyncValues();
2245
+ item.loadAsyncValues(_this.filter);
2250
2246
  return item.loading$
2251
2247
  .pipe();
2252
2248
  }))))
@@ -2310,9 +2306,10 @@
2310
2306
  return params;
2311
2307
  };
2312
2308
  FsFilterItemsStore.prototype.init = function (p) {
2309
+ var _this = this;
2313
2310
  this.items
2314
2311
  .forEach(function (item) {
2315
- item.initValues(p[item.name]);
2312
+ item.initValues(_this.filter, p[item.name]);
2316
2313
  });
2317
2314
  this._initSortingItems(p);
2318
2315
  this.loadAsyncDefaults();
@@ -2424,8 +2421,8 @@
2424
2421
  };
2425
2422
  FsFilterItemsStore.prototype._initSortingItems = function (p) {
2426
2423
  if (this.sortByItem && this.sortDirectionItem) {
2427
- this.sortByItem.initValues(p[this.sortByItem.name]);
2428
- this.sortDirectionItem.initValues(p[this.sortDirectionItem.name]);
2424
+ this.sortByItem.initValues(this.filter, p[this.sortByItem.name]);
2425
+ this.sortDirectionItem.initValues(this.filter, p[this.sortDirectionItem.name]);
2429
2426
  }
2430
2427
  };
2431
2428
  FsFilterItemsStore.prototype._createSortingItems = function () {
@@ -2435,7 +2432,7 @@
2435
2432
  name: SORT_BY_FIELD,
2436
2433
  type: exports.ItemType.Select,
2437
2434
  label: 'Sort By',
2438
- values: this._config.sortValues
2435
+ values: this._config.sortValues,
2439
2436
  };
2440
2437
  if (this._config.sort && this._config.sort.value) {
2441
2438
  sortByItem.default = this._config.sort.value;
@@ -2447,8 +2444,8 @@
2447
2444
  label: 'Sort Direction',
2448
2445
  values: [
2449
2446
  { name: 'Ascending', value: 'asc' },
2450
- { name: 'Descending', value: 'desc' }
2451
- ]
2447
+ { name: 'Descending', value: 'desc' },
2448
+ ],
2452
2449
  };
2453
2450
  if (this._config.sort && this._config.sort.direction) {
2454
2451
  sortDirectionItem.default = this._config.sort.direction;
@@ -3113,8 +3110,6 @@
3113
3110
  type: i0.Injectable
3114
3111
  }], ctorParameters: function () { return [{ type: FsFilterItemsStore }, { type: PersistanceParamsController }, { type: QueryParamsController }, { type: SavedFiltersController }]; } });
3115
3112
 
3116
- var FS_FILTER_CONFIG = new i0.InjectionToken('fs.filter-config');
3117
-
3118
3113
  var FsFilterActionButtonComponent = /** @class */ (function () {
3119
3114
  function FsFilterActionButtonComponent() {
3120
3115
  this.ActionType = exports.ActionType;
@@ -3311,7 +3306,7 @@
3311
3306
  this.listenValueChangesForRanges();
3312
3307
  this._updateVisibility();
3313
3308
  if (this.item.hasPendingValues) {
3314
- this.item.loadAsyncValues(false);
3309
+ this.item.loadAsyncValues(null, false);
3315
3310
  this.item.values$
3316
3311
  .pipe(operators.take(2), operators.takeUntil(this._destroy$))
3317
3312
  .subscribe(function () {
@@ -3356,7 +3351,7 @@
3356
3351
  FsFilterChipComponent.prototype._initDelayRender = function () {
3357
3352
  this.chipDelayedRender$ = rxjs.combineLatest([
3358
3353
  this.item.values$,
3359
- this._chipRenderTimer$.pipe(operators.startWith(false))
3354
+ this._chipRenderTimer$.pipe(operators.startWith(false)),
3360
3355
  ])
3361
3356
  .pipe(operators.map(function (_a) {
3362
3357
  var _b = __read(_a, 2), values = _b[0], timerValue = _b[1];
@@ -3466,7 +3461,6 @@
3466
3461
  enumerable: false,
3467
3462
  configurable: true
3468
3463
  });
3469
- ;
3470
3464
  BaseItemComponent.prototype.ngDoCheck = function () {
3471
3465
  if (this._kvDiffer) {
3472
3466
  var changes = this._kvDiffer.diff(this.item);
@@ -3477,12 +3471,7 @@
3477
3471
  };
3478
3472
  BaseItemComponent.prototype.ngOnChanges = function (changes) {
3479
3473
  if (changes.item) {
3480
- if (Array.isArray(this.item.label)) {
3481
- this.label = this.item.label[0];
3482
- }
3483
- else {
3484
- this.label = this.item.label;
3485
- }
3474
+ this.label = Array.isArray(this.item.label) ? this.item.label[0] : this.item.label;
3486
3475
  }
3487
3476
  };
3488
3477
  BaseItemComponent.prototype.ngOnDestroy = function () {
@@ -3503,7 +3492,7 @@
3503
3492
  return BaseItemComponent;
3504
3493
  }());
3505
3494
  BaseItemComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: BaseItemComponent, deps: [{ token: i0__namespace.KeyValueDiffers }, { token: i0__namespace.ChangeDetectorRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
3506
- BaseItemComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: BaseItemComponent, selector: "base-item", inputs: { item: "item", inline: "inline" }, usesOnChanges: true, ngImport: i0__namespace, template: '', isInline: true, changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
3495
+ BaseItemComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: BaseItemComponent, selector: "base-item", inputs: { item: "item", inline: "inline", filter: "filter" }, usesOnChanges: true, ngImport: i0__namespace, template: '', isInline: true, changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
3507
3496
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: BaseItemComponent, decorators: [{
3508
3497
  type: i0.Component,
3509
3498
  args: [{
@@ -3515,6 +3504,8 @@
3515
3504
  type: i0.Input
3516
3505
  }], inline: [{
3517
3506
  type: i0.Input
3507
+ }], filter: [{
3508
+ type: i0.Input
3518
3509
  }] } });
3519
3510
 
3520
3511
  var FocusToItemDirective = /** @class */ (function () {
@@ -3690,11 +3681,9 @@
3690
3681
  if (!isolate) {
3691
3682
  return values;
3692
3683
  }
3693
- else {
3694
- return values.filter(function (value) {
3695
- return value.value !== isolate.value;
3696
- });
3697
- }
3684
+ return values.filter(function (value) {
3685
+ return value.value !== isolate.value;
3686
+ });
3698
3687
  };
3699
3688
  return FsFilterIsolateValues;
3700
3689
  }());
@@ -3703,7 +3692,7 @@
3703
3692
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsFilterIsolateValues, decorators: [{
3704
3693
  type: i0.Pipe,
3705
3694
  args: [{
3706
- name: 'fsFilterIsolateValues'
3695
+ name: 'fsFilterIsolateValues',
3707
3696
  }]
3708
3697
  }] });
3709
3698
 
@@ -3955,7 +3944,7 @@
3955
3944
  return data ? data.name : data;
3956
3945
  };
3957
3946
  _this.fetch = function (keyword) {
3958
- return _this.item.valuesFn(keyword);
3947
+ return _this.item.valuesFn(keyword, _this.filter);
3959
3948
  };
3960
3949
  return _this;
3961
3950
  }
@@ -3979,7 +3968,7 @@
3979
3968
  _this._kvDiffers = _kvDiffers;
3980
3969
  _this._cd = _cd;
3981
3970
  _this.fetch = function (keyword) {
3982
- return _this.item.valuesFn(keyword);
3971
+ return _this.item.valuesFn(keyword, _this.filter);
3983
3972
  };
3984
3973
  return _this;
3985
3974
  }
@@ -4134,8 +4123,8 @@
4134
4123
  var FilterItemComponent = /** @class */ (function () {
4135
4124
  function FilterItemComponent(_cdRef) {
4136
4125
  this._cdRef = _cdRef;
4137
- this._destroy$ = new rxjs.Subject();
4138
4126
  this.itemType = exports.ItemType;
4127
+ this._destroy$ = new rxjs.Subject();
4139
4128
  }
4140
4129
  Object.defineProperty(FilterItemComponent.prototype, "textItem", {
4141
4130
  get: function () {
@@ -4236,7 +4225,7 @@
4236
4225
  return FilterItemComponent;
4237
4226
  }());
4238
4227
  FilterItemComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FilterItemComponent, deps: [{ token: i0__namespace.ChangeDetectorRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
4239
- FilterItemComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FilterItemComponent, selector: "filter-item", inputs: { item: "item" }, ngImport: i0__namespace, template: "<div class=\"filter filter-{{ item.type }}\">\n\n <ng-container [ngSwitch]=\"item.type\">\n <filter-item-text class=\"interface\"\n *ngSwitchCase=\"itemType.Text\"\n [item]=\"textItem\">\n </filter-item-text>\n\n <filter-item-select class=\"interface\"\n *ngSwitchCase=\"itemType.Select\"\n [item]=\"baseSelectItem\">\n </filter-item-select>\n\n <filter-item-chips class=\"interface\"\n *ngSwitchCase=\"itemType.Chips\"\n [item]=\"chipsItem\">\n </filter-item-chips>\n\n <filter-item-range class=\"interface interface-range\"\n *ngSwitchCase=\"itemType.Range\"\n [item]=\"rangeItem\">\n </filter-item-range>\n\n <filter-item-autocomplete class=\"interface\"\n *ngSwitchCase=\"itemType.AutoComplete\"\n [item]=\"autocompleteItem\">\n </filter-item-autocomplete>\n\n <filter-item-autocompletechips class=\"interface\"\n *ngSwitchCase=\"itemType.AutoCompleteChips\"\n [item]=\"autocompleteChipsItem\">\n </filter-item-autocompletechips>\n\n <filter-item-date class=\"interface interface-date\"\n *ngSwitchCase=\"itemType.Date\"\n [item]=\"dateItem\">\n </filter-item-date>\n\n <filter-item-date class=\"interface interface-date\"\n *ngSwitchCase=\"itemType.DateTime\"\n [item]=\"dateTimeItem\">\n </filter-item-date>\n\n <filter-item-date-range class=\"interface interface-date\"\n *ngSwitchCase=\"itemType.DateRange\"\n [item]=\"dateRangeItem\">\n </filter-item-date-range>\n\n <filter-item-date-range class=\"interface interface-date\"\n *ngSwitchCase=\"itemType.DateTimeRange\"\n [item]=\"dateTimeRangeItem\">\n </filter-item-date-range>\n\n <filter-item-week class=\"interface\"\n *ngSwitchCase=\"itemType.Week\"\n [item]=\"weekItem\">\n </filter-item-week>\n\n <filter-item-checkbox class=\"interface interface-checkbox\"\n *ngSwitchCase=\"itemType.Checkbox\"\n [item]=\"checkboxItem\">\n </filter-item-checkbox>\n </ng-container>\n\n</div>\n", components: [{ type: TextComponent, selector: "filter-item-text" }, { type: SelectComponent, selector: "filter-item-select" }, { type: ChipsComponent, selector: "filter-item-chips" }, { type: RangeComponent, selector: "filter-item-range" }, { type: AutocompleteComponent, selector: "filter-item-autocomplete" }, { type: AutocompletechipsComponent, selector: "filter-item-autocompletechips" }, { type: DateComponent, selector: "filter-item-date" }, { type: DateRangeComponent, selector: "filter-item-date-range" }, { type: WeekComponent, selector: "filter-item-week" }, { type: CheckboxComponent, selector: "filter-item-checkbox" }], directives: [{ type: i3__namespace.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i3__namespace.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
4228
+ FilterItemComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FilterItemComponent, selector: "filter-item", inputs: { item: "item", filter: "filter" }, ngImport: i0__namespace, template: "<div class=\"filter filter-{{ item.type }}\">\n\n <ng-container [ngSwitch]=\"item.type\">\n <filter-item-text \n class=\"interface\"\n *ngSwitchCase=\"itemType.Text\"\n [item]=\"textItem\">\n </filter-item-text>\n\n <filter-item-select \n class=\"interface\"\n *ngSwitchCase=\"itemType.Select\"\n [item]=\"baseSelectItem\">\n </filter-item-select>\n\n <filter-item-chips \n class=\"interface\"\n *ngSwitchCase=\"itemType.Chips\"\n [item]=\"chipsItem\">\n </filter-item-chips>\n\n <filter-item-range \n class=\"interface interface-range\"\n *ngSwitchCase=\"itemType.Range\"\n [item]=\"rangeItem\">\n </filter-item-range>\n\n <filter-item-autocomplete \n class=\"interface\"\n *ngSwitchCase=\"itemType.AutoComplete\"\n [item]=\"autocompleteItem\"\n [filter]=\"filter\">\n </filter-item-autocomplete>\n\n <filter-item-autocompletechips \n class=\"interface\"\n *ngSwitchCase=\"itemType.AutoCompleteChips\"\n [item]=\"autocompleteChipsItem\"\n [filter]=\"filter\">\n </filter-item-autocompletechips>\n\n <filter-item-date \n class=\"interface interface-date\"\n *ngSwitchCase=\"itemType.Date\"\n [item]=\"dateItem\">\n </filter-item-date>\n\n <filter-item-date \n class=\"interface interface-date\"\n *ngSwitchCase=\"itemType.DateTime\"\n [item]=\"dateTimeItem\">\n </filter-item-date>\n\n <filter-item-date-range \n class=\"interface interface-date\"\n *ngSwitchCase=\"itemType.DateRange\"\n [item]=\"dateRangeItem\">\n </filter-item-date-range>\n\n <filter-item-date-range \n class=\"interface interface-date\"\n *ngSwitchCase=\"itemType.DateTimeRange\"\n [item]=\"dateTimeRangeItem\">\n </filter-item-date-range>\n\n <filter-item-week \n class=\"interface\"\n *ngSwitchCase=\"itemType.Week\"\n [item]=\"weekItem\">\n </filter-item-week>\n\n <filter-item-checkbox \n class=\"interface interface-checkbox\"\n *ngSwitchCase=\"itemType.Checkbox\"\n [item]=\"checkboxItem\">\n </filter-item-checkbox>\n </ng-container>\n\n</div>\n", components: [{ type: TextComponent, selector: "filter-item-text" }, { type: SelectComponent, selector: "filter-item-select" }, { type: ChipsComponent, selector: "filter-item-chips" }, { type: RangeComponent, selector: "filter-item-range" }, { type: AutocompleteComponent, selector: "filter-item-autocomplete" }, { type: AutocompletechipsComponent, selector: "filter-item-autocompletechips" }, { type: DateComponent, selector: "filter-item-date" }, { type: DateRangeComponent, selector: "filter-item-date-range" }, { type: WeekComponent, selector: "filter-item-week" }, { type: CheckboxComponent, selector: "filter-item-checkbox" }], directives: [{ type: i3__namespace.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i3__namespace.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
4240
4229
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FilterItemComponent, decorators: [{
4241
4230
  type: i0.Component,
4242
4231
  args: [{
@@ -4246,20 +4235,23 @@
4246
4235
  }]
4247
4236
  }], ctorParameters: function () { return [{ type: i0__namespace.ChangeDetectorRef }]; }, propDecorators: { item: [{
4248
4237
  type: i0.Input
4238
+ }], filter: [{
4239
+ type: i0.Input
4249
4240
  }] } });
4250
4241
 
4251
4242
  var FilterDrawerComponent = /** @class */ (function () {
4252
- function FilterDrawerComponent(externalParams, _cd, _itemsStore, overlayRef, data) {
4243
+ function FilterDrawerComponent(externalParams, _cd, _itemsStore, _overlayRef, _data) {
4253
4244
  this.externalParams = externalParams;
4254
4245
  this._cd = _cd;
4255
4246
  this._itemsStore = _itemsStore;
4256
- this.overlayRef = overlayRef;
4257
- this.data = data;
4247
+ this._overlayRef = _overlayRef;
4248
+ this._data = _data;
4258
4249
  this.inline = false;
4259
4250
  this.windowDesktop = false;
4260
4251
  this._itemsStore.prepareItems();
4261
- this._clear = data.clear;
4262
- this._done = data.done;
4252
+ this._clear = _data.clear;
4253
+ this._done = _data.done;
4254
+ this.filter = _data.filter;
4263
4255
  this.updateWindowWidth();
4264
4256
  }
4265
4257
  FilterDrawerComponent.prototype.updateWindowWidth = function () {
@@ -4292,7 +4284,7 @@
4292
4284
  };
4293
4285
  FilterDrawerComponent.prototype.done = function () {
4294
4286
  this._done();
4295
- this.overlayRef.detach();
4287
+ this._overlayRef.detach();
4296
4288
  };
4297
4289
  FilterDrawerComponent.prototype.backdropClick = function () {
4298
4290
  this.done();
@@ -4300,12 +4292,12 @@
4300
4292
  return FilterDrawerComponent;
4301
4293
  }());
4302
4294
  FilterDrawerComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FilterDrawerComponent, deps: [{ token: ExternalParamsController }, { token: i0__namespace.ChangeDetectorRef }, { token: FsFilterItemsStore }, { token: FILTER_DRAWER_OVERLAY }, { token: FILTER_DRAWER_DATA }], target: i0__namespace.ɵɵFactoryTarget.Component });
4303
- FilterDrawerComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FilterDrawerComponent, selector: "ng-component", inputs: { inline: "inline" }, host: { listeners: { "window:resize": "updateWindowWidth()" } }, ngImport: i0__namespace, template: "<div class=\"filters\">\n <div class=\"filters-wrap\">\n\n <div class=\"filter-by\">\n <mat-icon>tune</mat-icon>\n <span class=\"text\">Filters</span>\n </div>\n\n <div class=\"overflow-shadow filter-items\">\n <div class=\"overflow-shadow-content\">\n <ng-container *fsSkeleton=\"(externalParams.pending$ | async) !== true\">\n <filter-item \n *ngFor=\"let filterItem of items$ | async\"\n class=\"filter-group\"\n [item]=\"filterItem\">\n </filter-item>\n\n <ng-container *ngIf=\"sortItem && sortItem.values && sortItem.values.length > 0\">\n <filter-item \n class=\"filter-group sort\"\n [item]=\"sortItem\">\n </filter-item>\n <filter-item \n class=\"filter-group sort\"\n [item]=\"sortDirectionItem\">\n </filter-item>\n </ng-container>\n </ng-container>\n </div>\n </div>\n\n <fs-filter-drawer-actions \n class=\"filter-actions\"\n *ngIf=\"(externalParams.pending$ | async) !== true\"\n (clear)=\"clear()\"\n (done)=\"done()\">\n </fs-filter-drawer-actions>\n </div>\n</div>\n<div class=\"backdrop\" *ngIf=\"!windowDesktop\" (click)=\"backdropClick()\"></div>\n", styles: [":host ::ng-deep mat-form-field{width:100%}.filter-by{display:flex;flex-direction:row;align-items:center;box-sizing:border-box;padding:20px 25px}.filter-by mat-icon{margin-right:8px}.filter-by .text{font-weight:400;font-size:19px}.filter-actions{display:block;box-sizing:border-box;padding:13px}.filter-actions button{margin-right:6px}.filter-actions button:last-child{margin-right:0}.filters{position:fixed;display:block;top:0;right:0;z-index:1002;bottom:0}.filters .filters-wrap{background:#fff;box-shadow:0 2px 4px -1px #0003,0 4px 5px #00000024,0 1px 10px #0000001f;width:85vw;max-width:350px;display:flex;flex-direction:column;height:100%;padding-top:calc(env(safe-area-inset-top))}.filters .filters-wrap .filter-items{overflow-y:auto}.filters .filters-wrap .filter-items .overflow-shadow-content{padding:0 25px;box-sizing:border-box}.filters .filter-group{margin:10px 0 0}.filters .filter-group:first-child{margin:0}.filters .filter label{white-space:nowrap;color:#0000008a}.filters .filter .interface.interface-range input,.filters .filter .interface.interface-range .mat-input-wrapper{text-align:center}.filters .filter .interface.interface-range{text-align:center}.filters .filter .interface.interface-datetime fs-datetime.has-time .md-input{width:100%}.filters .filter .interface fs-datetime-range input{text-align:center}.filters .filter .filter-label{width:1%;white-space:nowrap;vertical-align:middle;padding-right:15px}.filters md-autocomplete-container md-input-container{margin:0}.filters .isolate{margin-top:-12px}.filters .isolate .interface{line-height:20px;padding-bottom:1.25em}.filters .isolate md-checkbox{margin:0 0 0 2px}.backdrop{position:fixed;top:0;bottom:0;left:0;right:0;z-index:900;outline:none}\n"], components: [{ type: i2__namespace$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: FilterItemComponent, selector: "filter-item", inputs: ["item"] }, { type: FsFilterDrawerActionsComponent, selector: "fs-filter-drawer-actions", outputs: ["clear", "done"] }], directives: [{ type: i6__namespace$1.FsSkeletonContentDirective, selector: "[fsSkeleton]", inputs: ["fsSkeleton", "fsSkeletonPattern"] }, { type: i3__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i3__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "async": i3__namespace.AsyncPipe }, changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
4295
+ FilterDrawerComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FilterDrawerComponent, selector: "ng-component", inputs: { inline: "inline" }, host: { listeners: { "window:resize": "updateWindowWidth()" } }, ngImport: i0__namespace, template: "<div class=\"filters\">\n <div class=\"filters-wrap\">\n\n <div class=\"filter-by\">\n <mat-icon>tune</mat-icon>\n <span class=\"text\">Filters</span>\n </div>\n\n <div class=\"overflow-shadow filter-items\">\n <div class=\"overflow-shadow-content\">\n <ng-container *fsSkeleton=\"(externalParams.pending$ | async) !== true\">\n <filter-item \n *ngFor=\"let filterItem of items$ | async\"\n class=\"filter-group\"\n [item]=\"filterItem\"\n [filter]=\"filter\">\n </filter-item>\n\n <ng-container *ngIf=\"sortItem && sortItem.values && sortItem.values.length > 0\">\n <filter-item \n class=\"filter-group sort\"\n [item]=\"sortItem\"\n [filter]=\"filter\">\n </filter-item>\n <filter-item \n class=\"filter-group sort\"\n [item]=\"sortDirectionItem\"\n [filter]=\"filter\">\n </filter-item>\n </ng-container>\n </ng-container>\n </div>\n </div>\n\n <fs-filter-drawer-actions \n class=\"filter-actions\"\n *ngIf=\"(externalParams.pending$ | async) !== true\"\n (clear)=\"clear()\"\n (done)=\"done()\">\n </fs-filter-drawer-actions>\n </div>\n</div>\n<div class=\"backdrop\" *ngIf=\"!windowDesktop\" (click)=\"backdropClick()\"></div>\n", styles: [":host ::ng-deep mat-form-field{width:100%}.filter-by{display:flex;flex-direction:row;align-items:center;box-sizing:border-box;padding:20px 25px}.filter-by mat-icon{margin-right:8px}.filter-by .text{font-weight:400;font-size:19px}.filter-actions{display:block;box-sizing:border-box;padding:13px}.filter-actions button{margin-right:6px}.filter-actions button:last-child{margin-right:0}.filters{position:fixed;display:block;top:0;right:0;z-index:1002;bottom:0}.filters .filters-wrap{background:#fff;box-shadow:0 2px 4px -1px #0003,0 4px 5px #00000024,0 1px 10px #0000001f;width:85vw;max-width:350px;display:flex;flex-direction:column;height:100%;padding-top:calc(env(safe-area-inset-top))}.filters .filters-wrap .filter-items{overflow-y:auto}.filters .filters-wrap .filter-items .overflow-shadow-content{padding:0 25px;box-sizing:border-box}.filters .filter-group{margin:10px 0 0}.filters .filter-group:first-child{margin:0}.filters .filter label{white-space:nowrap;color:#0000008a}.filters .filter .interface.interface-range input,.filters .filter .interface.interface-range .mat-input-wrapper{text-align:center}.filters .filter .interface.interface-range{text-align:center}.filters .filter .interface.interface-datetime fs-datetime.has-time .md-input{width:100%}.filters .filter .interface fs-datetime-range input{text-align:center}.filters .filter .filter-label{width:1%;white-space:nowrap;vertical-align:middle;padding-right:15px}.filters md-autocomplete-container md-input-container{margin:0}.filters .isolate{margin-top:-12px}.filters .isolate .interface{line-height:20px;padding-bottom:1.25em}.filters .isolate md-checkbox{margin:0 0 0 2px}.backdrop{position:fixed;top:0;bottom:0;left:0;right:0;z-index:900;outline:none}\n"], components: [{ type: i2__namespace$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: FilterItemComponent, selector: "filter-item", inputs: ["item", "filter"] }, { type: FsFilterDrawerActionsComponent, selector: "fs-filter-drawer-actions", outputs: ["clear", "done"] }], directives: [{ type: i6__namespace$1.FsSkeletonContentDirective, selector: "[fsSkeleton]", inputs: ["fsSkeleton", "fsSkeletonPattern"] }, { type: i3__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i3__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "async": i3__namespace.AsyncPipe }, changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
4304
4296
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FilterDrawerComponent, decorators: [{
4305
4297
  type: i0.Component,
4306
4298
  args: [{
4307
4299
  templateUrl: './filter-drawer.component.html',
4308
- styleUrls: ['filter-drawer.component.scss'],
4300
+ styleUrls: ['./filter-drawer.component.scss'],
4309
4301
  // Commented out because filter items are not updating with a delayed observable. Need to figure this out.
4310
4302
  changeDetection: i0.ChangeDetectionStrategy.OnPush,
4311
4303
  }]
@@ -4317,11 +4309,11 @@
4317
4309
  type: i0.Inject,
4318
4310
  args: [FILTER_DRAWER_DATA]
4319
4311
  }] }];
4320
- }, propDecorators: { updateWindowWidth: [{
4312
+ }, propDecorators: { inline: [{
4313
+ type: i0.Input
4314
+ }], updateWindowWidth: [{
4321
4315
  type: i0.HostListener,
4322
4316
  args: ['window:resize']
4323
- }], inline: [{
4324
- type: i0.Input
4325
4317
  }] } });
4326
4318
 
4327
4319
  var ActionMenuItem = /** @class */ (function () {
@@ -4694,9 +4686,9 @@
4694
4686
  });
4695
4687
 
4696
4688
  var FsFilterOverlayService = /** @class */ (function () {
4697
- function FsFilterOverlayService(_injector, _filterMeta, _overlay, _focusController) {
4698
- this._injector = _injector;
4689
+ function FsFilterOverlayService(_filterMeta, _injector, _overlay, _focusController) {
4699
4690
  this._filterMeta = _filterMeta;
4691
+ this._injector = _injector;
4700
4692
  this._overlay = _overlay;
4701
4693
  this._focusController = _focusController;
4702
4694
  this.detach$ = new rxjs.Subject();
@@ -4721,7 +4713,7 @@
4721
4713
  if (this._overlayRef) {
4722
4714
  this._overlayRef.detach();
4723
4715
  this._overlayRef = null;
4724
- this.removeFilterClass();
4716
+ this._removeFilterClass();
4725
4717
  }
4726
4718
  };
4727
4719
  FsFilterOverlayService.prototype.open = function () {
@@ -4742,8 +4734,8 @@
4742
4734
  .subscribe(function () {
4743
4735
  _this.attach$.next();
4744
4736
  });
4745
- this.addFilterClass();
4746
- return this.openPortalPreview();
4737
+ this._addFilterClass();
4738
+ return this._openPortalPreview();
4747
4739
  };
4748
4740
  FsFilterOverlayService.prototype.ngOnDestroy = function () {
4749
4741
  this._destroy$.next();
@@ -4752,12 +4744,16 @@
4752
4744
  FsFilterOverlayService.prototype._createOverlay = function () {
4753
4745
  var overlayConfig = new i1$6.OverlayConfig({
4754
4746
  hasBackdrop: true,
4755
- backdropClass: 'fs-filter-backdrop'
4747
+ backdropClass: 'fs-filter-backdrop',
4756
4748
  });
4757
4749
  return this._overlay.create(overlayConfig);
4758
4750
  };
4759
- FsFilterOverlayService.prototype.openPortalPreview = function () {
4760
- var data = { done: this._doneFn, clear: this._clearFn };
4751
+ FsFilterOverlayService.prototype._openPortalPreview = function () {
4752
+ var data = {
4753
+ done: this._doneFn,
4754
+ clear: this._clearFn,
4755
+ filter: this.filter,
4756
+ };
4761
4757
  var injector = this._createInjector(this._injector, data, this._overlayRef);
4762
4758
  var containerPortal = new portal.ComponentPortal(FilterDrawerComponent, undefined, injector);
4763
4759
  var containerRef = this._overlayRef.attach(containerPortal);
@@ -4770,13 +4766,13 @@
4770
4766
  ]);
4771
4767
  return new portal.PortalInjector(parentInjector, injectionTokens);
4772
4768
  };
4773
- FsFilterOverlayService.prototype.removeFilterClass = function () {
4769
+ FsFilterOverlayService.prototype._removeFilterClass = function () {
4774
4770
  this._filterMeta.openedFilters--;
4775
4771
  if (this._filterMeta.openedFilters === 0) {
4776
4772
  window.document.body.classList.remove('fs-filter-open');
4777
4773
  }
4778
4774
  };
4779
- FsFilterOverlayService.prototype.addFilterClass = function () {
4775
+ FsFilterOverlayService.prototype._addFilterClass = function () {
4780
4776
  this._filterMeta.openedFilters++;
4781
4777
  if (this._filterMeta.openedFilters === 1) {
4782
4778
  window.document.body.classList.add('fs-filter-open');
@@ -4794,15 +4790,15 @@
4794
4790
  };
4795
4791
  return FsFilterOverlayService;
4796
4792
  }());
4797
- FsFilterOverlayService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsFilterOverlayService, deps: [{ token: i0__namespace.Injector }, { token: FS_FILTER_META }, { token: i1__namespace$6.Overlay }, { token: FocusControllerService }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
4793
+ FsFilterOverlayService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsFilterOverlayService, deps: [{ token: FS_FILTER_META }, { token: i0__namespace.Injector }, { token: i1__namespace$6.Overlay }, { token: FocusControllerService }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
4798
4794
  FsFilterOverlayService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsFilterOverlayService });
4799
4795
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsFilterOverlayService, decorators: [{
4800
4796
  type: i0.Injectable
4801
4797
  }], ctorParameters: function () {
4802
- return [{ type: i0__namespace.Injector }, { type: undefined, decorators: [{
4798
+ return [{ type: undefined, decorators: [{
4803
4799
  type: i0.Inject,
4804
4800
  args: [FS_FILTER_META]
4805
- }] }, { type: i1__namespace$6.Overlay }, { type: FocusControllerService }];
4801
+ }] }, { type: i0__namespace.Injector }, { type: i1__namespace$6.Overlay }, { type: FocusControllerService }];
4806
4802
  } });
4807
4803
 
4808
4804
  var FilterStatusBarDirective = /** @class */ (function () {
@@ -4820,6 +4816,8 @@
4820
4816
  }]
4821
4817
  }], ctorParameters: function () { return [{ type: i0__namespace.TemplateRef }]; } });
4822
4818
 
4819
+ var FS_FILTER_CONFIG = new i0.InjectionToken('fs.filter-config');
4820
+
4823
4821
  var FilterComponent = /** @class */ (function () {
4824
4822
  function FilterComponent(_defaultConfig, _filterOverlay, _zone, _externalParams, _filterItems, _actions) {
4825
4823
  var _this = this;
@@ -4845,6 +4843,8 @@
4845
4843
  this._hasFilterChips$ = new rxjs.BehaviorSubject(false);
4846
4844
  this._keyword$ = new rxjs.Subject();
4847
4845
  this._destroy$ = new rxjs.Subject();
4846
+ this._filterItems.filter = this;
4847
+ this._filterOverlay.filter = this;
4848
4848
  this._listenWhenFilterReady();
4849
4849
  this._updateWindowWidth();
4850
4850
  this._filterOverlay.attach$
@@ -5146,9 +5146,7 @@
5146
5146
  return item.model;
5147
5147
  }));
5148
5148
  }
5149
- else {
5150
- return null;
5151
- }
5149
+ return null;
5152
5150
  };
5153
5151
  FilterComponent.prototype.changeVisibility = function (state) {
5154
5152
  if (state === this.showFilterMenu) {
@@ -5236,6 +5234,7 @@
5236
5234
  };
5237
5235
  /**
5238
5236
  * Update filter actions config
5237
+ *
5239
5238
  * @param actions
5240
5239
  */
5241
5240
  FilterComponent.prototype.updateActions = function (actions) {
@@ -5284,6 +5283,9 @@
5284
5283
  this._externalParams.initItems();
5285
5284
  this._syncSearchInputWithKeyword();
5286
5285
  };
5286
+ FilterComponent.prototype.keywordChange = function (keyword) {
5287
+ this._keyword$.next(keyword);
5288
+ };
5287
5289
  FilterComponent.prototype._initFilterWithConfig = function (config) {
5288
5290
  if (this.config) {
5289
5291
  this._filterItems.destroyItems();
@@ -5328,9 +5330,6 @@
5328
5330
  });
5329
5331
  });
5330
5332
  };
5331
- FilterComponent.prototype.keywordChange = function (keyword) {
5332
- this._keyword$.next(keyword);
5333
- };
5334
5333
  FilterComponent.prototype._listenInputChanges = function () {
5335
5334
  var _this = this;
5336
5335
  this._keyword$
@@ -5542,8 +5541,13 @@
5542
5541
  return {
5543
5542
  ngModule: FsFilterModule,
5544
5543
  providers: [
5545
- { provide: FS_FILTER_CONFIG, useValue: config || {} }
5546
- ]
5544
+ {
5545
+ provide: FS_FILTER_CONFIG,
5546
+ useValue: Object.assign({ button: {
5547
+ label: '',
5548
+ } }, config),
5549
+ },
5550
+ ],
5547
5551
  };
5548
5552
  };
5549
5553
  return FsFilterModule;
@@ -5712,9 +5716,6 @@
5712
5716
  FilterStatusBarDirective,
5713
5717
  FsSavedFiltersMenuComponent,
5714
5718
  ],
5715
- entryComponents: [
5716
- FilterDrawerComponent
5717
- ]
5718
5719
  }]
5719
5720
  }] });
5720
5721