@firestitch/filter 9.8.5 → 9.9.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.
- package/app/components/filter/filter.component.d.ts +1 -0
- package/app/components/filters-item/text/text.component.d.ts +2 -0
- package/app/interfaces/items/base.interface.d.ts +3 -1
- package/app/models/items/base-item.d.ts +5 -1
- package/app/services/items-store.service.d.ts +5 -0
- package/bundles/firestitch-filter.umd.js +103 -32
- package/bundles/firestitch-filter.umd.js.map +1 -1
- package/bundles/firestitch-filter.umd.min.js +2 -2
- package/bundles/firestitch-filter.umd.min.js.map +1 -1
- package/esm2015/app/components/filter/filter.component.js +14 -21
- package/esm2015/app/components/filters-item/text/text.component.js +15 -5
- package/esm2015/app/interfaces/items/base.interface.js +1 -1
- package/esm2015/app/models/items/base-item.js +21 -3
- package/esm2015/app/models/items/date-range/base-date-range-item.js +3 -4
- package/esm2015/app/models/items/range-item.js +3 -4
- package/esm2015/app/services/items-store.service.js +38 -5
- package/esm2015/public_api.js +1 -1
- package/esm5/app/components/filter/filter.component.js +22 -22
- package/esm5/app/components/filters-item/text/text.component.js +16 -5
- package/esm5/app/interfaces/items/base.interface.js +1 -1
- package/esm5/app/models/items/base-item.js +26 -3
- package/esm5/app/models/items/date-range/base-date-range-item.js +3 -4
- package/esm5/app/models/items/range-item.js +3 -4
- package/esm5/app/services/items-store.service.js +44 -5
- package/esm5/public_api.js +1 -1
- package/fesm2015/firestitch-filter.js +86 -34
- package/fesm2015/firestitch-filter.js.map +1 -1
- package/fesm5/firestitch-filter.js +105 -34
- package/fesm5/firestitch-filter.js.map +1 -1
- package/firestitch-filter.metadata.json +1 -1
- package/package.json +1 -1
- package/public_api.d.ts +5 -4
|
@@ -45,6 +45,7 @@ export declare class FilterComponent implements OnInit, AfterViewInit, OnDestroy
|
|
|
45
45
|
get filterParamsQuery(): Record<string, unknown>;
|
|
46
46
|
get items(): BaseItem<import("../../interfaces/config.interface").IFilterConfigItem>[];
|
|
47
47
|
get visibleItems(): BaseItem<import("../../interfaces/config.interface").IFilterConfigItem>[];
|
|
48
|
+
get itemsReady$(): Observable<boolean>;
|
|
48
49
|
get hasFilterChips$(): Observable<boolean>;
|
|
49
50
|
get hasVisibleItemOrSorting(): boolean;
|
|
50
51
|
get hasKeyword(): boolean;
|
|
@@ -11,4 +11,6 @@ export declare class TextComponent extends BaseItemComponent<TextItem> implement
|
|
|
11
11
|
constructor(_kvDiffers: KeyValueDiffers, _cd: ChangeDetectorRef);
|
|
12
12
|
ngOnInit(): void;
|
|
13
13
|
ngOnDestroy(): void;
|
|
14
|
+
private _listenControlValueChanges;
|
|
15
|
+
private _listenModelChanges;
|
|
14
16
|
}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import { Observable } from 'rxjs';
|
|
1
2
|
import { ItemType } from '../../enums/item-type.enum';
|
|
2
3
|
import { BaseItem } from '../../models/items/base-item';
|
|
3
4
|
export declare type FilterConfigDateType = ItemType.Date | ItemType.DateTime | ItemType.DateRange | ItemType.DateTimeRange;
|
|
4
5
|
export declare type FilterDateRangeType = ItemType.DateRange | ItemType.DateTimeRange;
|
|
6
|
+
export declare type IFilterDefaultFn = () => Observable<unknown>;
|
|
5
7
|
export interface IFilterConfigBaseItem<T = ItemType, U = string> {
|
|
6
8
|
name: string;
|
|
7
9
|
type: T;
|
|
@@ -11,7 +13,7 @@ export interface IFilterConfigBaseItem<T = ItemType, U = string> {
|
|
|
11
13
|
disable?: boolean;
|
|
12
14
|
values?: any;
|
|
13
15
|
primary?: boolean;
|
|
14
|
-
default?:
|
|
16
|
+
default?: IFilterDefaultFn | any;
|
|
15
17
|
change?: (item: BaseItem<any>) => void;
|
|
16
18
|
clear?: boolean;
|
|
17
19
|
disablePersist?: boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BehaviorSubject, Observable, Subject } from 'rxjs';
|
|
2
|
-
import { IFilterConfigBaseItem } from '../../interfaces/items/base.interface';
|
|
2
|
+
import { IFilterConfigBaseItem, IFilterDefaultFn } from '../../interfaces/items/base.interface';
|
|
3
3
|
import { IFilterItemDefaultRange } from '../../interfaces/items/range.interface';
|
|
4
4
|
export declare abstract class BaseItem<T extends IFilterConfigBaseItem> {
|
|
5
5
|
protected _additionalConfig: unknown;
|
|
@@ -8,6 +8,7 @@ export declare abstract class BaseItem<T extends IFilterConfigBaseItem> {
|
|
|
8
8
|
chipLabel: string | string[];
|
|
9
9
|
hide: boolean;
|
|
10
10
|
defaultValue: any | IFilterItemDefaultRange;
|
|
11
|
+
defaultValueFn: IFilterDefaultFn;
|
|
11
12
|
persistedValue: unknown;
|
|
12
13
|
clearAllowed: boolean;
|
|
13
14
|
persistanceDisabled: boolean;
|
|
@@ -17,6 +18,7 @@ export declare abstract class BaseItem<T extends IFilterConfigBaseItem> {
|
|
|
17
18
|
protected _model: any;
|
|
18
19
|
protected _initialized: boolean;
|
|
19
20
|
protected _pendingValues: boolean;
|
|
21
|
+
protected _pendingDefaultValue: boolean;
|
|
20
22
|
protected _loading$: BehaviorSubject<boolean>;
|
|
21
23
|
protected _value$: BehaviorSubject<any>;
|
|
22
24
|
protected _valueChange$: Subject<void>;
|
|
@@ -41,6 +43,7 @@ export declare abstract class BaseItem<T extends IFilterConfigBaseItem> {
|
|
|
41
43
|
get destroy$(): Observable<void>;
|
|
42
44
|
get type(): T['type'];
|
|
43
45
|
get hasPendingValues(): boolean;
|
|
46
|
+
get hasPendingDefaultValue(): boolean;
|
|
44
47
|
get model(): any;
|
|
45
48
|
set model(value: any);
|
|
46
49
|
set values(values: any);
|
|
@@ -56,6 +59,7 @@ export declare abstract class BaseItem<T extends IFilterConfigBaseItem> {
|
|
|
56
59
|
valueChanged(): void;
|
|
57
60
|
get queryObject(): Record<string, unknown>;
|
|
58
61
|
get persistanceObject(): Record<string, unknown>;
|
|
62
|
+
loadDefaultValue(): Observable<any>;
|
|
59
63
|
initValues(persistedValue: unknown): void;
|
|
60
64
|
loadAsyncValues(reload?: boolean): void;
|
|
61
65
|
clear(defaultValue?: unknown): void;
|
|
@@ -15,6 +15,7 @@ export declare class FsFilterItemsStore implements OnDestroy {
|
|
|
15
15
|
sortByItem: BaseItem<IFilterConfigItem>;
|
|
16
16
|
sortDirectionItem: BaseItem<IFilterConfigItem>;
|
|
17
17
|
keywordItem: TextItem;
|
|
18
|
+
private _ready$;
|
|
18
19
|
private _items;
|
|
19
20
|
private _visibleItems$;
|
|
20
21
|
private _itemsByName;
|
|
@@ -22,6 +23,7 @@ export declare class FsFilterItemsStore implements OnDestroy {
|
|
|
22
23
|
private _hasKeyword;
|
|
23
24
|
private _config;
|
|
24
25
|
private _itemsChange$;
|
|
26
|
+
private _destroy$;
|
|
25
27
|
constructor();
|
|
26
28
|
get items(): BaseItem<IFilterConfigItem>[];
|
|
27
29
|
get visibleItems(): BaseItem<IFilterConfigItem>[];
|
|
@@ -29,12 +31,14 @@ export declare class FsFilterItemsStore implements OnDestroy {
|
|
|
29
31
|
set visibleItems(items: BaseItem<IFilterConfigItem>[]);
|
|
30
32
|
get hasKeyword(): boolean;
|
|
31
33
|
get itemsChange$(): Observable<unknown>;
|
|
34
|
+
get ready$(): Observable<boolean>;
|
|
32
35
|
ngOnDestroy(): void;
|
|
33
36
|
setConfig(config: any): void;
|
|
34
37
|
getItemByName(name: string): BaseItem<IFilterConfigBaseItem>;
|
|
35
38
|
initItems(items: IFilterConfigItem[]): void;
|
|
36
39
|
filtersClear(): void;
|
|
37
40
|
loadAsyncValues(): void;
|
|
41
|
+
loadAsyncDefaults(): void;
|
|
38
42
|
getSort(): FilterSort;
|
|
39
43
|
getSortByValue(): any;
|
|
40
44
|
getSortDirectionValue(): any;
|
|
@@ -51,6 +55,7 @@ export declare class FsFilterItemsStore implements OnDestroy {
|
|
|
51
55
|
updateVisibleItems(): void;
|
|
52
56
|
private _createItems;
|
|
53
57
|
private _subscribeToItemsChanges;
|
|
58
|
+
private _lazyInit;
|
|
54
59
|
private _createSortingItems;
|
|
55
60
|
private _setKeywordItem;
|
|
56
61
|
}
|
|
@@ -256,6 +256,7 @@
|
|
|
256
256
|
this._additionalConfig = _additionalConfig;
|
|
257
257
|
this._initialized = false;
|
|
258
258
|
this._pendingValues = false;
|
|
259
|
+
this._pendingDefaultValue = false;
|
|
259
260
|
this._loading$ = new rxjs.BehaviorSubject(false);
|
|
260
261
|
this._value$ = new rxjs.BehaviorSubject(null);
|
|
261
262
|
this._valueChange$ = new rxjs.Subject();
|
|
@@ -372,6 +373,13 @@
|
|
|
372
373
|
enumerable: true,
|
|
373
374
|
configurable: true
|
|
374
375
|
});
|
|
376
|
+
Object.defineProperty(BaseItem.prototype, "hasPendingDefaultValue", {
|
|
377
|
+
get: function () {
|
|
378
|
+
return this._pendingDefaultValue;
|
|
379
|
+
},
|
|
380
|
+
enumerable: true,
|
|
381
|
+
configurable: true
|
|
382
|
+
});
|
|
375
383
|
Object.defineProperty(BaseItem.prototype, "model", {
|
|
376
384
|
get: function () {
|
|
377
385
|
return this._model;
|
|
@@ -477,6 +485,15 @@
|
|
|
477
485
|
enumerable: true,
|
|
478
486
|
configurable: true
|
|
479
487
|
});
|
|
488
|
+
BaseItem.prototype.loadDefaultValue = function () {
|
|
489
|
+
var _this = this;
|
|
490
|
+
return this.defaultValueFn()
|
|
491
|
+
.pipe(operators.tap(function (value) {
|
|
492
|
+
_this.defaultValue = value;
|
|
493
|
+
}), operators.finalize(function () {
|
|
494
|
+
_this._pendingDefaultValue = false;
|
|
495
|
+
}));
|
|
496
|
+
};
|
|
480
497
|
BaseItem.prototype.initValues = function (persistedValue) {
|
|
481
498
|
this._initialized = false;
|
|
482
499
|
this.persistedValue = persistedValue;
|
|
@@ -540,7 +557,13 @@
|
|
|
540
557
|
this.name = item.name;
|
|
541
558
|
this.label = item.label;
|
|
542
559
|
this.chipLabel = item.chipLabel;
|
|
543
|
-
|
|
560
|
+
if (typeof item.default === 'function') {
|
|
561
|
+
this._pendingDefaultValue = true;
|
|
562
|
+
this.defaultValueFn = item.default;
|
|
563
|
+
}
|
|
564
|
+
else {
|
|
565
|
+
this.defaultValue = item.default;
|
|
566
|
+
}
|
|
544
567
|
this.change = item.change;
|
|
545
568
|
this.hide = item.hide;
|
|
546
569
|
this.clearAllowed = (_a = item.clear) !== null && _a !== void 0 ? _a : true;
|
|
@@ -1051,15 +1074,14 @@
|
|
|
1051
1074
|
});
|
|
1052
1075
|
Object.defineProperty(RangeItem.prototype, "queryObject", {
|
|
1053
1076
|
get: function () {
|
|
1054
|
-
var _a, _b;
|
|
1055
1077
|
var value = this.value;
|
|
1056
1078
|
var name = this.name;
|
|
1057
1079
|
var params = {};
|
|
1058
1080
|
var paramMinName = getRangeName(this.case, name, 'min');
|
|
1059
1081
|
var paramMaxName = getRangeName(this.case, name, 'max');
|
|
1060
1082
|
if (lodashEs.isObject(value)) {
|
|
1061
|
-
params[paramMinName] =
|
|
1062
|
-
params[paramMaxName] =
|
|
1083
|
+
params[paramMinName] = value.min || null;
|
|
1084
|
+
params[paramMaxName] = value.max || null;
|
|
1063
1085
|
}
|
|
1064
1086
|
else {
|
|
1065
1087
|
params[paramMinName] = null;
|
|
@@ -1197,14 +1219,13 @@
|
|
|
1197
1219
|
Object.defineProperty(BaseDateRangeItem.prototype, "queryObject", {
|
|
1198
1220
|
get: function () {
|
|
1199
1221
|
var _a;
|
|
1200
|
-
var _b, _c;
|
|
1201
1222
|
var value = this.value || {};
|
|
1202
1223
|
var name = this.name;
|
|
1203
1224
|
var paramFromName = getRangeName(this.case, name, 'from');
|
|
1204
1225
|
var paramToName = getRangeName(this.case, name, 'to');
|
|
1205
1226
|
return _a = {},
|
|
1206
|
-
_a[paramFromName] =
|
|
1207
|
-
_a[paramToName] =
|
|
1227
|
+
_a[paramFromName] = value.from || null,
|
|
1228
|
+
_a[paramToName] = value.to || null,
|
|
1208
1229
|
_a;
|
|
1209
1230
|
},
|
|
1210
1231
|
enumerable: true,
|
|
@@ -1726,12 +1747,15 @@
|
|
|
1726
1747
|
this.sortByItem = null;
|
|
1727
1748
|
this.sortDirectionItem = null;
|
|
1728
1749
|
this.keywordItem = null;
|
|
1750
|
+
this._ready$ = new rxjs.BehaviorSubject(false);
|
|
1729
1751
|
this._items = [];
|
|
1730
1752
|
this._visibleItems$ = new rxjs.BehaviorSubject([]);
|
|
1731
1753
|
this._itemsByName = new Map();
|
|
1732
1754
|
this._itemsValuesLoaded = false;
|
|
1733
1755
|
this._hasKeyword = false;
|
|
1734
1756
|
this._itemsChange$ = new rxjs.Subject();
|
|
1757
|
+
this._destroy$ = new rxjs.Subject();
|
|
1758
|
+
this._lazyInit();
|
|
1735
1759
|
}
|
|
1736
1760
|
Object.defineProperty(FsFilterItemsStore.prototype, "items", {
|
|
1737
1761
|
get: function () {
|
|
@@ -1771,8 +1795,17 @@
|
|
|
1771
1795
|
enumerable: true,
|
|
1772
1796
|
configurable: true
|
|
1773
1797
|
});
|
|
1798
|
+
Object.defineProperty(FsFilterItemsStore.prototype, "ready$", {
|
|
1799
|
+
get: function () {
|
|
1800
|
+
return this._ready$.asObservable();
|
|
1801
|
+
},
|
|
1802
|
+
enumerable: true,
|
|
1803
|
+
configurable: true
|
|
1804
|
+
});
|
|
1774
1805
|
FsFilterItemsStore.prototype.ngOnDestroy = function () {
|
|
1775
1806
|
this.destroyItems();
|
|
1807
|
+
this._destroy$.next();
|
|
1808
|
+
this._destroy$.complete();
|
|
1776
1809
|
};
|
|
1777
1810
|
FsFilterItemsStore.prototype.setConfig = function (config) {
|
|
1778
1811
|
this._itemsByName.clear();
|
|
@@ -1786,8 +1819,6 @@
|
|
|
1786
1819
|
this._itemsValuesLoaded = false;
|
|
1787
1820
|
if (Array.isArray(items)) {
|
|
1788
1821
|
this._createItems(items);
|
|
1789
|
-
this.updateVisibleItems();
|
|
1790
|
-
this._setKeywordItem();
|
|
1791
1822
|
}
|
|
1792
1823
|
};
|
|
1793
1824
|
FsFilterItemsStore.prototype.filtersClear = function () {
|
|
@@ -1826,6 +1857,25 @@
|
|
|
1826
1857
|
.filter(function (item) { return item.hasPendingValues; })
|
|
1827
1858
|
.forEach(function (item) { return item.loadAsyncValues(); });
|
|
1828
1859
|
};
|
|
1860
|
+
FsFilterItemsStore.prototype.loadAsyncDefaults = function () {
|
|
1861
|
+
var _this = this;
|
|
1862
|
+
var pendingItems = this.items
|
|
1863
|
+
.filter(function (item) {
|
|
1864
|
+
return item.hasPendingDefaultValue
|
|
1865
|
+
&& (item.persistedValue === null || item.persistedValue === undefined);
|
|
1866
|
+
});
|
|
1867
|
+
if (pendingItems.length > 0) {
|
|
1868
|
+
rxjs.forkJoin(pendingItems
|
|
1869
|
+
.map(function (item) { return item.loadDefaultValue(); }))
|
|
1870
|
+
.pipe(operators.finalize(function () {
|
|
1871
|
+
_this._ready$.next(true);
|
|
1872
|
+
}), operators.takeUntil(this._destroy$))
|
|
1873
|
+
.subscribe();
|
|
1874
|
+
}
|
|
1875
|
+
else {
|
|
1876
|
+
this._ready$.next(true);
|
|
1877
|
+
}
|
|
1878
|
+
};
|
|
1829
1879
|
FsFilterItemsStore.prototype.getSort = function () {
|
|
1830
1880
|
var sortBy = this.getSortByValue();
|
|
1831
1881
|
sortBy = sortBy === '__all' ? null : sortBy;
|
|
@@ -1882,6 +1932,7 @@
|
|
|
1882
1932
|
item.initValues(p[item.name]);
|
|
1883
1933
|
});
|
|
1884
1934
|
this._createSortingItems(p);
|
|
1935
|
+
this.loadAsyncDefaults();
|
|
1885
1936
|
this._subscribeToItemsChanges();
|
|
1886
1937
|
};
|
|
1887
1938
|
FsFilterItemsStore.prototype.updateItemsWithValues = function (values) {
|
|
@@ -1970,6 +2021,15 @@
|
|
|
1970
2021
|
});
|
|
1971
2022
|
}
|
|
1972
2023
|
};
|
|
2024
|
+
FsFilterItemsStore.prototype._lazyInit = function () {
|
|
2025
|
+
var _this = this;
|
|
2026
|
+
this.ready$
|
|
2027
|
+
.pipe(operators.filter(function (state) { return state; }), operators.takeUntil(this._destroy$))
|
|
2028
|
+
.subscribe(function () {
|
|
2029
|
+
_this.updateVisibleItems();
|
|
2030
|
+
_this._setKeywordItem();
|
|
2031
|
+
});
|
|
2032
|
+
};
|
|
1973
2033
|
FsFilterItemsStore.prototype._createSortingItems = function (p) {
|
|
1974
2034
|
var _a;
|
|
1975
2035
|
if (((_a = this._config.sortValues) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
|
@@ -3427,6 +3487,13 @@
|
|
|
3427
3487
|
enumerable: true,
|
|
3428
3488
|
configurable: true
|
|
3429
3489
|
});
|
|
3490
|
+
Object.defineProperty(FilterComponent.prototype, "itemsReady$", {
|
|
3491
|
+
get: function () {
|
|
3492
|
+
return this._filterItems.ready$;
|
|
3493
|
+
},
|
|
3494
|
+
enumerable: true,
|
|
3495
|
+
configurable: true
|
|
3496
|
+
});
|
|
3430
3497
|
Object.defineProperty(FilterComponent.prototype, "hasFilterChips$", {
|
|
3431
3498
|
get: function () {
|
|
3432
3499
|
return this._hasFilterChips$.asObservable();
|
|
@@ -3491,21 +3558,6 @@
|
|
|
3491
3558
|
_this.focus();
|
|
3492
3559
|
}
|
|
3493
3560
|
});
|
|
3494
|
-
if (this.config.init) {
|
|
3495
|
-
if (this._externalParams.pending) {
|
|
3496
|
-
this._externalParams
|
|
3497
|
-
.pending$
|
|
3498
|
-
.pipe(operators.filter(function (pending) {
|
|
3499
|
-
return !pending;
|
|
3500
|
-
}), operators.takeUntil(this._destroy$))
|
|
3501
|
-
.subscribe(function () {
|
|
3502
|
-
_this.init();
|
|
3503
|
-
});
|
|
3504
|
-
}
|
|
3505
|
-
else {
|
|
3506
|
-
this.init();
|
|
3507
|
-
}
|
|
3508
|
-
}
|
|
3509
3561
|
this._listenInternalItemsChange();
|
|
3510
3562
|
this._initOverlay();
|
|
3511
3563
|
};
|
|
@@ -3906,10 +3958,18 @@
|
|
|
3906
3958
|
// We may need some time to recieve external params and after that ready can be emitted
|
|
3907
3959
|
FilterComponent.prototype._listenWhenFilterReady = function () {
|
|
3908
3960
|
var _this = this;
|
|
3909
|
-
|
|
3910
|
-
.pending
|
|
3911
|
-
|
|
3961
|
+
rxjs.combineLatest([
|
|
3962
|
+
this._externalParams.pending$,
|
|
3963
|
+
this.itemsReady$,
|
|
3964
|
+
])
|
|
3965
|
+
.pipe(operators.filter(function (_a) {
|
|
3966
|
+
var _b = __read(_a, 2), pendingParams = _b[0], itemsReady = _b[1];
|
|
3967
|
+
return !pendingParams && itemsReady;
|
|
3968
|
+
}), operators.takeUntil(this._destroy$))
|
|
3912
3969
|
.subscribe(function () {
|
|
3970
|
+
if (_this.config.init) {
|
|
3971
|
+
_this.init();
|
|
3972
|
+
}
|
|
3913
3973
|
_this.ready.emit();
|
|
3914
3974
|
});
|
|
3915
3975
|
};
|
|
@@ -3985,7 +4045,7 @@
|
|
|
3985
4045
|
FilterComponent = __decorate([
|
|
3986
4046
|
core.Component({
|
|
3987
4047
|
selector: 'fs-filter',
|
|
3988
|
-
template: "<ng-container *ngIf=\"hasKeyword; else noKeywordFilter\">\n <div class=\"filter-search-container\">\n <div class=\"filter-input-field\">\n <form autocomplete=\"off\" role=\"presentation\" *ngIf=\"keywordVisible$ | async\">\n <mat-form-field floatLabel=\"never\">\n <span matPrefix>\n <mat-icon matPrefix>search</mat-icon>\n </span>\n\n <input\n matInput\n [formControl]=\"searchText\"\n [placeholder]=\"searchPlaceholder\"\n name=\"filter-input\"\n (click)=\"filterInputEvent($event)\"\n class=\"filter-input\">\n\n <a matSuffix\n *ngIf=\"searchText.value && showFilterInput && config.clear\"\n (click)=\"clearSearchText($event)\"\n href=\"javascript:void(0)\"\n class=\"clear\">\n <mat-icon>clear</mat-icon>\n </a>\n\n <a matSuffix\n (click)=\"reload($event)\"\n class=\"reload\"\n *ngIf=\"config.reload\">\n <mat-icon>refresh</mat-icon>\n </a>\n </mat-form-field>\n </form>\n </div>\n <ng-container *ngTemplateOutlet=\"filterActions\"></ng-container>\n </div>\n <div class=\"status-actions\" *ngIf=\"keywordVisible$ | async\">\n <ng-container *ngTemplateOutlet=\"statusBarContainer\"></ng-container>\n <ng-container *ngTemplateOutlet=\"filterChips\"></ng-container>\n </div>\n</ng-container>\n\n<ng-template #noKeywordFilter>\n <div class=\"filter-searchless-container\">\n <div class=\"status-actions\">\n <ng-container *ngTemplateOutlet=\"statusBarContainer\"></ng-container>\n <ng-container *ngTemplateOutlet=\"filterChips\"></ng-container>\n </div>\n <ng-container *ngTemplateOutlet=\"filterActions\"></ng-container>\n </div>\n</ng-template>\n\n\n<ng-template #filterActions>\n <div class=\"filter-actions\">\n <ng-container *ngIf=\"hasVisibleItemOrSorting && filtersBtnVisible$ | async
|
|
4048
|
+
template: "<ng-container *ngIf=\"hasKeyword; else noKeywordFilter\">\n <div class=\"filter-search-container\">\n <div class=\"filter-input-field\">\n <form autocomplete=\"off\" role=\"presentation\" *ngIf=\"keywordVisible$ | async\">\n <mat-form-field floatLabel=\"never\">\n <span matPrefix>\n <mat-icon matPrefix>search</mat-icon>\n </span>\n\n <input\n #searchTextInput\n matInput\n [formControl]=\"searchText\"\n [placeholder]=\"searchPlaceholder\"\n name=\"filter-input\"\n (click)=\"filterInputEvent($event)\"\n class=\"filter-input\">\n\n <a matSuffix\n *ngIf=\"searchText.value && showFilterInput && config.clear\"\n (click)=\"clearSearchText($event)\"\n href=\"javascript:void(0)\"\n class=\"clear\">\n <mat-icon>clear</mat-icon>\n </a>\n\n <a matSuffix\n (click)=\"reload($event)\"\n class=\"reload\"\n *ngIf=\"config.reload\">\n <mat-icon>refresh</mat-icon>\n </a>\n </mat-form-field>\n </form>\n </div>\n <ng-container *ngTemplateOutlet=\"filterActions\"></ng-container>\n </div>\n <div class=\"status-actions\" *ngIf=\"keywordVisible$ | async\">\n <ng-container *ngTemplateOutlet=\"statusBarContainer\"></ng-container>\n <ng-container *ngTemplateOutlet=\"filterChips\"></ng-container>\n </div>\n</ng-container>\n\n<ng-template #noKeywordFilter>\n <div class=\"filter-searchless-container\">\n <div class=\"status-actions\">\n <ng-container *ngTemplateOutlet=\"statusBarContainer\"></ng-container>\n <ng-container *ngTemplateOutlet=\"filterChips\"></ng-container>\n </div>\n <ng-container *ngTemplateOutlet=\"filterActions\"></ng-container>\n </div>\n</ng-template>\n\n\n<ng-template #filterActions>\n <div class=\"filter-actions\">\n <ng-container *ngIf=\"hasVisibleItemOrSorting && filtersBtnVisible$ | async\">\n <button\n mat-button\n class=\"filters-button\"\n [ngClass]=\"{\n 'mat-raised-button': config.button.style == 'raised',\n 'mat-button': config.button.style == 'basic',\n 'mat-icon-button': config.button.style == 'icon'\n }\"\n (click)=\"changeVisibilityClick(!showFilterMenu, $event)\"\n type=\"button\"\n [color]=\"config.button.color\">\n <mat-icon *ngIf=\"config.button.icon\">{{config.button.icon}}</mat-icon>\n {{ config.button.label }}\n </button>\n </ng-container>\n\n <fs-filter-actions\n *ngIf=\"actionsVisible$ | async\"\n [actions]=\"actions$ | async\"\n [kebabActions]=\"menuActions$ | async\">\n </fs-filter-actions>\n </div>\n</ng-template>\n\n<ng-template #filterChips>\n <fs-filter-chips\n *ngIf=\"config.chips && hasFilterChips$ | async\"\n class=\"filter-chips\"\n [filters]=\"items\">\n </fs-filter-chips>\n</ng-template>\n\n<ng-template #statusBarContainer>\n <div class=\"status-bar\" *ngIf=\"statusBar\">\n <small><ng-container *ngTemplateOutlet=\"statusBar\"></ng-container></small>\n </div>\n</ng-template>\n",
|
|
3989
4049
|
encapsulation: core.ViewEncapsulation.None,
|
|
3990
4050
|
providers: [
|
|
3991
4051
|
FsFilterOverlayService,
|
|
@@ -4323,17 +4383,28 @@
|
|
|
4323
4383
|
return _this;
|
|
4324
4384
|
}
|
|
4325
4385
|
TextComponent.prototype.ngOnInit = function () {
|
|
4386
|
+
this._listenControlValueChanges();
|
|
4387
|
+
this._listenModelChanges();
|
|
4388
|
+
};
|
|
4389
|
+
TextComponent.prototype.ngOnDestroy = function () {
|
|
4390
|
+
this.destroy$.next();
|
|
4391
|
+
this.destroy$.complete();
|
|
4392
|
+
};
|
|
4393
|
+
TextComponent.prototype._listenControlValueChanges = function () {
|
|
4326
4394
|
var _this = this;
|
|
4327
|
-
this.textControl.setValue(this.item.model);
|
|
4328
4395
|
this.textControl.valueChanges
|
|
4329
4396
|
.pipe(operators.distinctUntilChanged(), operators.debounceTime(200), operators.takeUntil(this.destroy$))
|
|
4330
4397
|
.subscribe(function (value) {
|
|
4331
4398
|
_this.item.model = value;
|
|
4332
4399
|
});
|
|
4333
4400
|
};
|
|
4334
|
-
TextComponent.prototype.
|
|
4335
|
-
this
|
|
4336
|
-
this.
|
|
4401
|
+
TextComponent.prototype._listenModelChanges = function () {
|
|
4402
|
+
var _this = this;
|
|
4403
|
+
this._item.value$
|
|
4404
|
+
.pipe(operators.takeUntil(this.destroy$))
|
|
4405
|
+
.subscribe(function () {
|
|
4406
|
+
_this.textControl.setValue(_this.item.model, { emitEvent: false });
|
|
4407
|
+
});
|
|
4337
4408
|
};
|
|
4338
4409
|
TextComponent.ctorParameters = function () { return [
|
|
4339
4410
|
{ type: core.KeyValueDiffers },
|