@firestitch/filter 12.11.2 → 12.11.3

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.
@@ -1,7 +1,7 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { Injectable, Optional, Component, ChangeDetectionStrategy, Inject, InjectionToken, Input, Directive, Self, Pipe, ViewChild, EventEmitter, Output, HostListener, TemplateRef, ViewEncapsulation, ContentChild, HostBinding, NgModule } from '@angular/core';
3
3
  import { BehaviorSubject, Subject, isObservable, forkJoin, of, fromEvent, merge, timer, combineLatest } from 'rxjs';
4
- import { tap, finalize, take, takeUntil, debounceTime, filter as filter$1, distinctUntilChanged, switchMap, delay, skip, mapTo, startWith, map } from 'rxjs/operators';
4
+ import { tap, finalize, take, takeUntil, debounceTime, filter as filter$1, distinctUntilChanged, switchMap, skip, delay, mapTo, startWith, map } from 'rxjs/operators';
5
5
  import { isFunction, isObject, clone, isString, toString, pickBy } from 'lodash-es';
6
6
  import { filter, isArrayEqual, isEmpty, getNormalizedPath, list, remove, FsCommonModule } from '@firestitch/common';
7
7
  import { simpleFormat, format } from '@firestitch/date';
@@ -38,7 +38,7 @@ import { MatIconModule } from '@angular/material/icon';
38
38
  import { ComponentPortal, PortalInjector, PortalModule } from '@angular/cdk/portal';
39
39
  import * as i2$1 from '@firestitch/chip';
40
40
  import { FsChipModule } from '@firestitch/chip';
41
- import * as i1$5 from '@firestitch/label';
41
+ import * as i1$6 from '@firestitch/label';
42
42
  import { FsLabelModule } from '@firestitch/label';
43
43
  import { FsScrollModule } from '@firestitch/scroll';
44
44
  import * as i4$1 from '@firestitch/autocomplete';
@@ -53,9 +53,9 @@ import * as i4$3 from '@firestitch/file';
53
53
  import { FsFileModule } from '@firestitch/file';
54
54
  import * as i7$1 from '@firestitch/popover';
55
55
  import { FsPopoverModule } from '@firestitch/popover';
56
- import * as i1$6 from '@angular/cdk/overlay';
56
+ import * as i1$5 from '@angular/cdk/layout';
57
+ import * as i1$7 from '@angular/cdk/overlay';
57
58
  import { OverlayConfig } from '@angular/cdk/overlay';
58
- import * as i1$7 from '@angular/cdk/layout';
59
59
 
60
60
  var ItemType;
61
61
  (function (ItemType) {
@@ -419,6 +419,51 @@ class SimpleSelectItem extends BaseSelectItem {
419
419
  }
420
420
  }
421
421
 
422
+ var ActionMode;
423
+ (function (ActionMode) {
424
+ ActionMode["Button"] = "button";
425
+ ActionMode["Menu"] = "menu";
426
+ ActionMode["File"] = "file";
427
+ })(ActionMode || (ActionMode = {}));
428
+
429
+ var ActionType;
430
+ (function (ActionType) {
431
+ ActionType["Basic"] = "basic";
432
+ ActionType["Raised"] = "raised";
433
+ ActionType["Icon"] = "icon";
434
+ ActionType["Fab"] = "fab";
435
+ ActionType["MiniFab"] = "mini-fab";
436
+ ActionType["Flat"] = "flat";
437
+ ActionType["Stroked"] = "stroked";
438
+ })(ActionType || (ActionType = {}));
439
+
440
+ var ButtonStyle;
441
+ (function (ButtonStyle) {
442
+ ButtonStyle["Basic"] = "basic";
443
+ ButtonStyle["Raised"] = "raised";
444
+ ButtonStyle["Icon"] = "icon";
445
+ ButtonStyle["Fab"] = "fab";
446
+ ButtonStyle["MiniFab"] = "mini-fab";
447
+ ButtonStyle["Flat"] = "flat";
448
+ ButtonStyle["Stroked"] = "stroked";
449
+ })(ButtonStyle || (ButtonStyle = {}));
450
+
451
+ var ItemDateMode;
452
+ (function (ItemDateMode) {
453
+ ItemDateMode["Calendar"] = "calendar";
454
+ ItemDateMode["ScrollMonthYear"] = "monthyear";
455
+ ItemDateMode["ScrollMonthDayYear"] = "monthdayyear";
456
+ })(ItemDateMode || (ItemDateMode = {}));
457
+
458
+ var PickerViewType;
459
+ (function (PickerViewType) {
460
+ PickerViewType["Date"] = "date";
461
+ PickerViewType["DateTime"] = "datetime";
462
+ PickerViewType["Time"] = "time";
463
+ PickerViewType["Week"] = "week";
464
+ PickerViewType["MonthRange"] = "monthrange";
465
+ })(PickerViewType || (PickerViewType = {}));
466
+
422
467
  const SORT_BY_FIELD = 'sortName';
423
468
  const SORT_DIRECTION_FIELD = 'sortDirection';
424
469
  class FsFilterConfig {
@@ -474,7 +519,7 @@ class FsFilterConfig {
474
519
  this.button.icon = 'tune';
475
520
  }
476
521
  if (this.button.style === undefined) {
477
- this.button.style = 'raised';
522
+ this.button.style = ButtonStyle.Raised;
478
523
  }
479
524
  if (this.button.color === undefined) {
480
525
  this.button.color = 'default';
@@ -938,13 +983,6 @@ class DateTimeRangeItem extends BaseDateRangeItem {
938
983
  }
939
984
  }
940
985
 
941
- var ItemDateMode;
942
- (function (ItemDateMode) {
943
- ItemDateMode["Calendar"] = "calendar";
944
- ItemDateMode["ScrollMonthYear"] = "monthyear";
945
- ItemDateMode["ScrollMonthDayYear"] = "monthdayyear";
946
- })(ItemDateMode || (ItemDateMode = {}));
947
-
948
986
  class BaseDateItem extends BaseItem {
949
987
  get value() {
950
988
  const value = clone(this.model);
@@ -2269,1263 +2307,1250 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
2269
2307
 
2270
2308
  const FS_FILTER_CONFIG = new InjectionToken('fs.filter-config');
2271
2309
 
2272
- const FILTER_DRAWER_DATA = new InjectionToken('fs.filter-drawer-data');
2273
-
2274
- const FILTER_DRAWER_OVERLAY = new InjectionToken('fs.filter-drawer-overlay');
2275
-
2276
- class BaseItemComponent {
2277
- constructor(_kvDiffers, _cd) {
2278
- this._kvDiffers = _kvDiffers;
2279
- this._cd = _cd;
2280
- this.inline = false;
2281
- this._destroy$ = new Subject();
2282
- this._debouncer$ = new Subject();
2283
- this._kvDiffer = this._kvDiffers.find(this.item || {}).create();
2284
- this.listenWithDebounce();
2310
+ class ActionMenuItem {
2311
+ constructor(config = {}, _parent) {
2312
+ this._parent = _parent;
2313
+ this.items = [];
2314
+ this._isGroup = false;
2315
+ this._visible$ = new BehaviorSubject(true);
2316
+ this._disabled$ = new BehaviorSubject(false);
2317
+ this._init(config);
2285
2318
  }
2286
- set item(value) {
2287
- this._item = value;
2319
+ get isGroup() {
2320
+ return this._isGroup;
2288
2321
  }
2289
- ;
2290
- get item() {
2291
- return this._item;
2322
+ get visible() {
2323
+ return this._visible$.getValue();
2292
2324
  }
2293
- ngDoCheck() {
2294
- if (this._kvDiffer) {
2295
- const changes = this._kvDiffer.diff(this.item);
2296
- if (changes) {
2297
- this._cd.detectChanges();
2298
- }
2325
+ get visible$() {
2326
+ return this._visible$.asObservable();
2327
+ }
2328
+ set disabled(value) {
2329
+ this._disabled$.next(value);
2330
+ }
2331
+ get disabled() {
2332
+ return this._disabled$.getValue();
2333
+ }
2334
+ get disabled$() {
2335
+ return this._disabled$.asObservable();
2336
+ }
2337
+ updateVisibility() {
2338
+ const visible = !!this._showFn ? this._showFn() : true;
2339
+ if (!visible || !this.isGroup) {
2340
+ this._visible$.next(visible);
2341
+ return;
2299
2342
  }
2343
+ const numberOfVisibleChildren = this.items
2344
+ .reduce((acc, item) => {
2345
+ item.updateVisibility();
2346
+ if (item.visible) {
2347
+ acc++;
2348
+ }
2349
+ return acc;
2350
+ }, 0);
2351
+ this._visible$.next(!!numberOfVisibleChildren);
2300
2352
  }
2301
- ngOnChanges(changes) {
2302
- if (changes.item) {
2303
- if (Array.isArray(this.item.label)) {
2304
- this.label = this.item.label[0];
2353
+ _init(config) {
2354
+ this.label = config.label;
2355
+ this.icon = config.icon;
2356
+ this._showFn = config.show;
2357
+ if ('items' in config) {
2358
+ this._isGroup = true;
2359
+ if (Array.isArray(config.items)) {
2360
+ this.items = config
2361
+ .items
2362
+ .map((item) => new ActionMenuItem(item, this));
2305
2363
  }
2306
- else {
2307
- this.label = this.item.label;
2364
+ this.updateVisibility();
2365
+ }
2366
+ else {
2367
+ this.click = config.click;
2368
+ this.routerLink = config.link;
2369
+ if (!this._parent) {
2370
+ this.updateVisibility();
2308
2371
  }
2309
2372
  }
2310
2373
  }
2311
- ngOnDestroy() {
2312
- this._destroy$.next();
2313
- this._destroy$.complete();
2314
- }
2315
- listenWithDebounce() {
2316
- this._debouncer$
2317
- .pipe(debounceTime(150), takeUntil(this._destroy$))
2318
- .subscribe(() => {
2319
- this.item.valueChanged();
2320
- });
2321
- }
2322
- itemChange() {
2323
- this._debouncer$.next();
2324
- }
2325
- }
2326
- BaseItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: BaseItemComponent, deps: [{ token: i0.KeyValueDiffers }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
2327
- BaseItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: BaseItemComponent, selector: "base-item", inputs: { item: "item", inline: "inline" }, usesOnChanges: true, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
2328
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: BaseItemComponent, decorators: [{
2329
- type: Component,
2330
- args: [{
2331
- selector: 'base-item',
2332
- template: '',
2333
- changeDetection: ChangeDetectionStrategy.OnPush,
2334
- }]
2335
- }], ctorParameters: function () { return [{ type: i0.KeyValueDiffers }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { item: [{
2336
- type: Input
2337
- }], inline: [{
2338
- type: Input
2339
- }] } });
2374
+ }
2340
2375
 
2341
- class FocusControllerService {
2342
- constructor() {
2343
- this._focusOn = new BehaviorSubject(null);
2376
+ class Action {
2377
+ constructor(filterConfig, actionConfig = {}) {
2378
+ this.primary = true;
2379
+ this.isReorderAction = false;
2380
+ this.classArray = [];
2381
+ this.items = [];
2382
+ this._visible$ = new BehaviorSubject(true);
2383
+ this._disabled$ = new BehaviorSubject(false);
2384
+ this._init(filterConfig, actionConfig);
2344
2385
  }
2345
- get focusOn$() {
2346
- return this._focusOn.asObservable();
2386
+ get visible() {
2387
+ return this._visible$.getValue();
2347
2388
  }
2348
- click(item, type = null) {
2349
- this._focusOn.next({ item, type });
2389
+ get visible$() {
2390
+ return this._visible$.asObservable();
2350
2391
  }
2351
- listenFocusFor$(targetItem, targetType = null) {
2352
- return this._focusOn
2353
- .pipe(filter$1((event) => !!event), filter$1(({ item, type }) => {
2354
- return targetItem === item && targetType === type;
2355
- }), tap(() => this.clearFocus()));
2392
+ set disabled(value) {
2393
+ this._disabled$.next(value);
2356
2394
  }
2357
- clearFocus() {
2358
- this._focusOn.next(null);
2395
+ get disabled() {
2396
+ return this._disabled$.getValue();
2359
2397
  }
2360
- }
2361
- FocusControllerService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FocusControllerService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
2362
- FocusControllerService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FocusControllerService });
2363
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FocusControllerService, decorators: [{
2364
- type: Injectable
2365
- }], ctorParameters: function () { return []; } });
2366
-
2367
- class FocusToItemDirective {
2368
- constructor(_el, _focusController, _targetSelect, _targetDate, _targetDateScroll, _targetDateRangeFrom, _targetDateRangeTo, _targetAutocomplete, _targetAutocompleteChips) {
2369
- this._el = _el;
2370
- this._focusController = _focusController;
2371
- this._targetSelect = _targetSelect;
2372
- this._targetDate = _targetDate;
2373
- this._targetDateScroll = _targetDateScroll;
2374
- this._targetDateRangeFrom = _targetDateRangeFrom;
2375
- this._targetDateRangeTo = _targetDateRangeTo;
2376
- this._targetAutocomplete = _targetAutocomplete;
2377
- this._targetAutocompleteChips = _targetAutocompleteChips;
2378
- this._destroy$ = new Subject();
2398
+ get disabled$() {
2399
+ return this._disabled$.asObservable();
2379
2400
  }
2380
- ngOnInit() {
2381
- this._focusController
2382
- .listenFocusFor$(this._item, this._focusTargetType)
2383
- .pipe(delay(500), takeUntil(this._destroy$))
2384
- .subscribe(() => {
2385
- this._focus();
2386
- });
2401
+ updateVisibility() {
2402
+ const visible = !!this._showFn ? this._showFn() : true;
2403
+ if (!visible || this.mode !== ActionMode.Menu) {
2404
+ this._visible$.next(visible);
2405
+ return;
2406
+ }
2407
+ const hasVisibleChildren = this.items.some((item) => item.visible);
2408
+ this._visible$.next(hasVisibleChildren);
2387
2409
  }
2388
- ngOnDestroy() {
2389
- this._destroy$.next();
2390
- this._destroy$.complete();
2410
+ updateDisabledState() {
2411
+ if (this._disabledFn) {
2412
+ this.disabled = this._disabledFn();
2413
+ }
2391
2414
  }
2392
- _focus() {
2393
- switch (this._item.type) {
2394
- case ItemType.Select:
2415
+ _init(filterConfig, config = {}) {
2416
+ var _a, _b, _c, _d, _e, _f;
2417
+ config.mode = (_a = config.mode) !== null && _a !== void 0 ? _a : ActionMode.Button;
2418
+ this.primary = (_b = config.primary) !== null && _b !== void 0 ? _b : true;
2419
+ this.color = config.color;
2420
+ this.tooltip = config.tooltip;
2421
+ this.label = config.label;
2422
+ this.mode = config.mode;
2423
+ this.icon = config.icon;
2424
+ this.iconPlacement = config.iconPlacement;
2425
+ this._showFn = config.show;
2426
+ this.tabIndex = (_c = config.tabIndex) !== null && _c !== void 0 ? _c : 0;
2427
+ this.menu = config.menu;
2428
+ if (!this.type) {
2429
+ this.type = (config.type || ((_d = filterConfig.button) === null || _d === void 0 ? void 0 : _d.style) || ActionType.Raised);
2430
+ if (this.type === ActionType.Stroked && this.primary) {
2431
+ this.type = ActionType.Flat;
2432
+ }
2433
+ }
2434
+ if (config.multiple !== undefined) {
2435
+ this.multiple = config.multiple;
2436
+ }
2437
+ if (config.className) {
2438
+ this.className = config.className;
2439
+ this.classArray = this.className
2440
+ .split(' ');
2441
+ }
2442
+ if (this.primary) {
2443
+ this.color = 'primary';
2444
+ }
2445
+ switch (config.mode) {
2446
+ case ActionMode.Button:
2395
2447
  {
2396
- this._targetSelect.open();
2397
- }
2398
- break;
2399
- case ItemType.Text:
2400
- case ItemType.Range:
2401
- {
2402
- this._el.nativeElement.focus();
2403
- }
2404
- break;
2405
- case ItemType.Date:
2406
- {
2407
- if (this._item.mode === ItemDateMode.Calendar) {
2408
- this._targetDate.open();
2409
- }
2410
- else {
2411
- this._targetDateScroll.open();
2412
- }
2448
+ this.customize = config.customize;
2449
+ this.click = (_e = config.click) !== null && _e !== void 0 ? _e : (() => { });
2450
+ this._disabledFn = config.disabled;
2451
+ this.updateDisabledState();
2413
2452
  }
2414
2453
  break;
2415
- case ItemType.DateRange:
2454
+ case ActionMode.Menu:
2416
2455
  {
2417
- if (this._focusTargetType === 'from') {
2418
- this._targetDateRangeFrom.open();
2419
- }
2420
- else {
2421
- this._targetDateRangeTo.open();
2456
+ if (config.items && Array.isArray(config.items)) {
2457
+ this.items = config.items.map((item) => new ActionMenuItem(item));
2422
2458
  }
2423
2459
  }
2424
2460
  break;
2425
- case ItemType.AutoComplete:
2426
- {
2427
- this._targetAutocomplete.focus();
2428
- }
2429
- break;
2430
- case ItemType.AutoCompleteChips:
2461
+ case ActionMode.File:
2431
2462
  {
2432
- this._targetAutocompleteChips.focus();
2463
+ this.fileSelected = config.select;
2464
+ this.fileError = config.error;
2465
+ this.accept = config.accept;
2466
+ this.imageQuality = config.imageQuality;
2467
+ this.minWidth = config.minWidth;
2468
+ this.minHeight = config.minHeight;
2469
+ this.maxWidth = config.maxWidth;
2470
+ this.maxHeight = config.maxHeight;
2471
+ this.click = (_f = config.click) !== null && _f !== void 0 ? _f : (() => { });
2472
+ this._disabledFn = config.disabled;
2473
+ this.updateDisabledState();
2433
2474
  }
2434
2475
  break;
2435
2476
  }
2477
+ this.updateVisibility();
2436
2478
  }
2437
- }
2438
- FocusToItemDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FocusToItemDirective, deps: [{ token: i0.ElementRef }, { token: FocusControllerService }, { token: i2.MatSelect, optional: true, self: true }, { token: i3$3.FsDatePickerComponent, optional: true, self: true }, { token: i3$3.FsDateScrollPickerComponent, optional: true, self: true }, { token: i3$3.DateRangePickerFromComponent, optional: true, self: true }, { token: i3$3.DateRangePickerToComponent, optional: true, self: true }, { token: i4$1.FsAutocompleteComponent, optional: true, self: true }, { token: i5.FsAutocompleteChipsComponent, optional: true, self: true }], target: i0.ɵɵFactoryTarget.Directive });
2439
- FocusToItemDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: FocusToItemDirective, selector: "[fsFilterFocusTrigger]", inputs: { _item: ["fsFilterFocusTrigger", "_item"], _focusTargetType: ["focusTargetType", "_focusTargetType"] }, ngImport: i0 });
2440
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FocusToItemDirective, decorators: [{
2441
- type: Directive,
2442
- args: [{
2443
- selector: '[fsFilterFocusTrigger]',
2444
- }]
2445
- }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: FocusControllerService }, { type: i2.MatSelect, decorators: [{
2446
- type: Optional
2447
- }, {
2448
- type: Self
2449
- }] }, { type: i3$3.FsDatePickerComponent, decorators: [{
2450
- type: Optional
2451
- }, {
2452
- type: Self
2453
- }] }, { type: i3$3.FsDateScrollPickerComponent, decorators: [{
2454
- type: Optional
2455
- }, {
2456
- type: Self
2457
- }] }, { type: i3$3.DateRangePickerFromComponent, decorators: [{
2458
- type: Optional
2459
- }, {
2460
- type: Self
2461
- }] }, { type: i3$3.DateRangePickerToComponent, decorators: [{
2462
- type: Optional
2463
- }, {
2464
- type: Self
2465
- }] }, { type: i4$1.FsAutocompleteComponent, decorators: [{
2466
- type: Optional
2467
- }, {
2468
- type: Self
2469
- }] }, { type: i5.FsAutocompleteChipsComponent, decorators: [{
2470
- type: Optional
2471
- }, {
2472
- type: Self
2473
- }] }]; }, propDecorators: { _item: [{
2474
- type: Input,
2475
- args: ['fsFilterFocusTrigger']
2476
- }], _focusTargetType: [{
2477
- type: Input,
2478
- args: ['focusTargetType']
2479
- }] } });
2479
+ }
2480
2480
 
2481
- class TextComponent extends BaseItemComponent {
2482
- constructor(_kvDiffers, _cd) {
2483
- super(_kvDiffers, _cd);
2484
- this._kvDiffers = _kvDiffers;
2485
- this._cd = _cd;
2486
- this.textControl = new FormControl();
2487
- this.destroy$ = new Subject();
2481
+ class ActionsController {
2482
+ constructor(_breakpointObserver) {
2483
+ this._breakpointObserver = _breakpointObserver;
2484
+ this._visible$ = new BehaviorSubject(false);
2485
+ this._actions$ = new BehaviorSubject([]);
2486
+ this._menuActions$ = new BehaviorSubject([]);
2487
+ this._destroy$ = new Subject();
2488
+ this._mobileMedia = '(max-width: 799px)';
2489
+ this._allActions = [];
2490
+ this._listenMobileMedia();
2488
2491
  }
2489
- ngOnInit() {
2490
- this._listenControlValueChanges();
2491
- this._listenModelChanges();
2492
+ get menuActions() {
2493
+ return this._menuActions$.value;
2492
2494
  }
2493
- ngOnDestroy() {
2494
- this.destroy$.next();
2495
- this.destroy$.complete();
2495
+ get actions() {
2496
+ return this._actions$.value;
2496
2497
  }
2497
- _listenControlValueChanges() {
2498
- this.textControl.valueChanges
2499
- .pipe(distinctUntilChanged(), debounceTime(200), takeUntil(this.destroy$))
2500
- .subscribe((value) => {
2501
- this.item.model = value;
2502
- });
2498
+ get actions$() {
2499
+ return this._actions$.asObservable();
2503
2500
  }
2504
- _listenModelChanges() {
2505
- this._item.value$
2506
- .pipe(takeUntil(this.destroy$))
2507
- .subscribe(() => {
2508
- this.textControl.setValue(this.item.model, { emitEvent: false });
2509
- });
2501
+ get menuActions$() {
2502
+ return this._menuActions$.asObservable();
2510
2503
  }
2511
- }
2512
- TextComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TextComponent, deps: [{ token: i0.KeyValueDiffers }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
2513
- TextComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: TextComponent, selector: "filter-item-text", usesInheritance: true, ngImport: i0, template: "<mat-form-field>\n <mat-label>{{item.label}}</mat-label>\n <span matPrefix *ngIf=\"item.prefix\" [innerHtml]=\"item.prefix\"></span>\n <input matInput [formControl]=\"textControl\" [fsFilterFocusTrigger]=\"item\">\n <span matSuffix *ngIf=\"item.suffix\" [innerHtml]=\"item.suffix\"></span>\n</mat-form-field>\n", styles: [""], components: [{ type: i1$3.MatFormField, selector: "mat-form-field", inputs: ["color", "floatLabel", "appearance", "hideRequiredMarker", "hintLabel"], exportAs: ["matFormField"] }], directives: [{ type: i1$3.MatLabel, selector: "mat-label" }, { type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1$3.MatPrefix, selector: "[matPrefix]" }, { type: i3$2.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["id", "disabled", "required", "type", "value", "readonly", "placeholder", "errorStateMatcher", "aria-describedby"], exportAs: ["matInput"] }, { type: i4.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4.FormControlDirective, selector: "[formControl]", inputs: ["disabled", "formControl", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: FocusToItemDirective, selector: "[fsFilterFocusTrigger]", inputs: ["fsFilterFocusTrigger", "focusTargetType"] }, { type: i1$3.MatSuffix, selector: "[matSuffix]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2514
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TextComponent, decorators: [{
2515
- type: Component,
2516
- args: [{
2517
- selector: 'filter-item-text',
2518
- templateUrl: './text.component.html',
2519
- styleUrls: ['./text.component.scss'],
2520
- changeDetection: ChangeDetectionStrategy.OnPush,
2521
- }]
2522
- }], ctorParameters: function () { return [{ type: i0.KeyValueDiffers }, { type: i0.ChangeDetectorRef }]; } });
2523
-
2524
- class FsFilterIsolateValues {
2525
- transform(values, isolate) {
2526
- if (!isolate) {
2527
- return values;
2528
- }
2529
- else {
2530
- return values.filter((value) => {
2531
- return value.value !== isolate.value;
2532
- });
2533
- }
2504
+ get visible$() {
2505
+ return this._visible$.asObservable();
2534
2506
  }
2535
- }
2536
- FsFilterIsolateValues.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsFilterIsolateValues, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
2537
- FsFilterIsolateValues.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsFilterIsolateValues, name: "fsFilterIsolateValues" });
2538
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsFilterIsolateValues, decorators: [{
2539
- type: Pipe,
2540
- args: [{
2541
- name: 'fsFilterIsolateValues'
2542
- }]
2543
- }] });
2544
-
2545
- class SelectMultipleComponent {
2546
- constructor(cd) {
2547
- this.cd = cd;
2507
+ get mobileMode() {
2508
+ return this._breakpointObserver.isMatched(this._mobileMedia);
2548
2509
  }
2549
- changed() {
2550
- if (this.item.isolate) {
2551
- this.item.isolate.enabled = false;
2552
- if (this.item.multiple && Array.isArray(this.item.model)) {
2553
- const index = this.item.model.indexOf(this.item.isolate.value);
2554
- if (index > -1) {
2555
- this.item.model.splice(index, 1);
2556
- }
2557
- }
2558
- }
2510
+ ngOnDestroy() {
2511
+ this._destroy$.next();
2512
+ this._destroy$.complete();
2559
2513
  }
2560
- close() {
2561
- this.select.close();
2514
+ setConfig(config) {
2515
+ this._config = config;
2516
+ this.initActions(config.actions);
2562
2517
  }
2563
- isolateChange(filter) {
2564
- if (filter.isolate.enabled) {
2565
- filter.model = filter.multiple ? [filter.isolate.value] : filter.isolate.value;
2518
+ initActions(rawActions) {
2519
+ if (!rawActions || !Array.isArray(rawActions)) {
2520
+ return;
2566
2521
  }
2567
- else {
2568
- if (filter.multiple) {
2569
- filter.model = filter.defaultValue ? filter.defaultValue : [];
2570
- }
2571
- else {
2572
- filter.model = filter.defaultValue ? filter.defaultValue : null;
2573
- }
2522
+ this.show();
2523
+ this._allActions = rawActions
2524
+ .map((action) => new Action(this._config, action));
2525
+ if (this._reorderAction) {
2526
+ this._allActions.unshift(this._reorderAction);
2574
2527
  }
2528
+ this._classifyActions();
2575
2529
  }
2576
- }
2577
- SelectMultipleComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SelectMultipleComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
2578
- SelectMultipleComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SelectMultipleComponent, selector: "filter-item-select-multiple", inputs: { item: "item" }, viewQueries: [{ propertyName: "select", first: true, predicate: ["select"], descendants: true, static: true }], ngImport: i0, template: "<mat-form-field [ngClass]=\"{ isolate: item.isolate }\">\n <mat-label>{{item.label}}</mat-label>\n <mat-select\n #select\n [fsFilterFocusTrigger]=\"item\"\n [(ngModel)]=\"item.model\"\n (ngModelChange)=\"changed()\"\n [multiple]=\"item.multiple\">\n <mat-option\n *ngFor=\"let item of item.values | fsFilterIsolateValues: item.isolate\"\n [value]=\"item.value\">\n {{ item.name }}\n </mat-option>\n </mat-select>\n\n <mat-hint>\n <div *ngIf=\"item.isolate\">\n <mat-checkbox (change)=\"isolateChange(item)\" [(ngModel)]=\"item.isolate.enabled\">\n <span class=\"checkbox-label\">{{ item.isolate.label }}</span>\n </mat-checkbox>\n </div>\n </mat-hint>\n</mat-form-field>\n", styles: [".isolate{margin-bottom:25px}\n"], components: [{ type: i1$3.MatFormField, selector: "mat-form-field", inputs: ["color", "floatLabel", "appearance", "hideRequiredMarker", "hintLabel"], exportAs: ["matFormField"] }, { type: i2.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { type: i3$1.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { type: i4$2.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex", "aria-label", "aria-labelledby", "id", "labelPosition", "name", "required", "checked", "disabled", "indeterminate", "aria-describedby", "value"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }], directives: [{ type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i1$3.MatLabel, selector: "mat-label" }, { type: FocusToItemDirective, selector: "[fsFilterFocusTrigger]", inputs: ["fsFilterFocusTrigger", "focusTargetType"] }, { type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i1$3.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "fsFilterIsolateValues": FsFilterIsolateValues }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
2579
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SelectMultipleComponent, decorators: [{
2580
- type: Component,
2581
- args: [{
2582
- selector: 'filter-item-select-multiple',
2583
- templateUrl: './multiple.component.html',
2584
- styleUrls: ['./multiple.component.scss'],
2585
- changeDetection: ChangeDetectionStrategy.OnPush,
2586
- }]
2587
- }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { item: [{
2588
- type: Input
2589
- }], select: [{
2590
- type: ViewChild,
2591
- args: ['select', { static: true }]
2592
- }] } });
2593
-
2594
- class SelectSimpleComponent {
2595
- constructor(cd) {
2596
- this.cd = cd;
2530
+ show() {
2531
+ this._visible$.next(true);
2597
2532
  }
2598
- changed() {
2599
- if (this.item.isolate) {
2600
- this.item.isolate.enabled = false;
2601
- }
2533
+ hide() {
2534
+ this._visible$.next(false);
2602
2535
  }
2603
- isolateChange(filter) {
2604
- if (filter.isolate.enabled) {
2605
- filter.model = filter.isolate.value;
2606
- }
2607
- else {
2608
- filter.model = null;
2609
- }
2536
+ addReorderAction(action) {
2537
+ this._allActions.unshift(action);
2538
+ action.isReorderAction = true;
2539
+ this._classifyAction(action);
2540
+ this._reorderAction = action;
2610
2541
  }
2611
- }
2612
- SelectSimpleComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SelectSimpleComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
2613
- SelectSimpleComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SelectSimpleComponent, selector: "filter-item-select-simple", inputs: { item: "item" }, viewQueries: [{ propertyName: "select", first: true, predicate: ["select"], descendants: true, static: true }], ngImport: i0, template: "<mat-form-field [ngClass]=\"{ isolate: item.isolate }\">\n <mat-label>{{item.label}}</mat-label>\n <mat-select\n #select\n [fsFilterFocusTrigger]=\"item\"\n [(ngModel)]=\"item.model\"\n (ngModelChange)=\"changed()\">\n <mat-option *ngFor=\"let item of item.values | fsFilterIsolateValues: item.isolate\"\n [value]=\"item.value\"\n >\n {{ item.name }}\n </mat-option>\n </mat-select>\n\n <mat-hint>\n <div *ngIf=\"item.isolate\">\n <mat-checkbox (change)=\"isolateChange(item)\" [(ngModel)]=\"item.isolate.enabled\">\n <span class=\"checkbox-label\">{{ item.isolate.label }}</span>\n </mat-checkbox>\n </div>\n </mat-hint>\n</mat-form-field>\n", styles: [".isolate{margin-bottom:25px}\n"], components: [{ type: i1$3.MatFormField, selector: "mat-form-field", inputs: ["color", "floatLabel", "appearance", "hideRequiredMarker", "hintLabel"], exportAs: ["matFormField"] }, { type: i2.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { type: i3$1.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { type: i4$2.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex", "aria-label", "aria-labelledby", "id", "labelPosition", "name", "required", "checked", "disabled", "indeterminate", "aria-describedby", "value"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }], directives: [{ type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i1$3.MatLabel, selector: "mat-label" }, { type: FocusToItemDirective, selector: "[fsFilterFocusTrigger]", inputs: ["fsFilterFocusTrigger", "focusTargetType"] }, { type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i1$3.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "fsFilterIsolateValues": FsFilterIsolateValues }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
2614
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SelectSimpleComponent, decorators: [{
2615
- type: Component,
2616
- args: [{
2617
- selector: 'filter-item-select-simple',
2618
- templateUrl: './simple.component.html',
2619
- styleUrls: ['./simple.component.scss'],
2620
- changeDetection: ChangeDetectionStrategy.OnPush,
2621
- }]
2622
- }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { item: [{
2623
- type: Input
2624
- }], select: [{
2625
- type: ViewChild,
2626
- args: ['select', { static: true }]
2627
- }] } });
2628
-
2629
- class SelectGroupsComponent {
2630
- constructor(cd) {
2631
- this.cd = cd;
2542
+ clearActions() {
2543
+ this._allActions = [];
2544
+ this._setActions([]);
2545
+ this._setKebabActions([]);
2632
2546
  }
2633
- compare(o1, o2) {
2634
- return o1 == o2;
2547
+ updateActionsVisibility() {
2548
+ this._allActions.forEach((action) => action.updateVisibility());
2549
+ this._classifyActions();
2550
+ }
2551
+ updateDisabledState() {
2552
+ this.actions.forEach((action) => action.updateDisabledState());
2553
+ }
2554
+ _setKebabActions(actions) {
2555
+ this._menuActions$.next(actions);
2556
+ }
2557
+ _setActions(actions) {
2558
+ this._actions$.next(actions);
2559
+ }
2560
+ _classifyActions() {
2561
+ const kebabActions = [];
2562
+ const actions = [];
2563
+ const mobileMode = this.mobileMode;
2564
+ this._allActions
2565
+ .filter((action) => {
2566
+ return action.visible;
2567
+ })
2568
+ .forEach((action) => {
2569
+ if (action.menu !== false && (action.menu || mobileMode)) {
2570
+ kebabActions.push(action);
2571
+ }
2572
+ else {
2573
+ actions.push(action);
2574
+ }
2575
+ });
2576
+ this._setKebabActions(kebabActions);
2577
+ this._setActions(actions);
2578
+ }
2579
+ _classifyAction(action) {
2580
+ if (action.menu) {
2581
+ this._setKebabActions([...this.menuActions, action]);
2582
+ }
2583
+ else {
2584
+ this._setActions([...this.actions, action]);
2585
+ }
2586
+ }
2587
+ _listenMobileMedia() {
2588
+ this._breakpointObserver.observe(this._mobileMedia)
2589
+ .pipe(skip(1), takeUntil(this._destroy$))
2590
+ .subscribe(() => {
2591
+ this._classifyActions();
2592
+ });
2635
2593
  }
2636
2594
  }
2637
- SelectGroupsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SelectGroupsComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
2638
- SelectGroupsComponentcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SelectGroupsComponent, selector: "filter-item-select-groups", inputs: { item: "item" }, viewQueries: [{ propertyName: "select", first: true, predicate: ["select"], descendants: true, static: true }], ngImport: i0, template: "<mat-form-field>\n <mat-label>{{item.label}}</mat-label>\n <mat-select\n #select\n [fsFilterFocusTrigger]=\"item\"\n [(ngModel)]=\"item.model\"\n [compareWith]=\"compare\">\n <ng-container *ngFor=\"let selectItem of item.values\">\n <ng-container *ngIf=\"selectItem[item.children]; else simpleOption\">\n <mat-optgroup [label]=\"selectItem.name\">\n <mat-option *ngFor=\"let subItem of selectItem[item.children]\"\n [value]=\"subItem.value\"\n [ngStyle]=\"selectItem.style\">\n {{ subItem.name }}\n </mat-option>\n </mat-optgroup>\n </ng-container>\n\n <ng-template #simpleOption>\n <mat-option\n [value]=\"selectItem.value\"\n [ngStyle]=\"selectItem.style\">\n {{ selectItem.name }}\n </mat-option>\n </ng-template>\n </ng-container>\n </mat-select>\n</mat-form-field>\n", components: [{ type: i1$3.MatFormField, selector: "mat-form-field", inputs: ["color", "floatLabel", "appearance", "hideRequiredMarker", "hintLabel"], exportAs: ["matFormField"] }, { type: i2.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { type: i3$1.MatOptgroup, selector: "mat-optgroup", inputs: ["disabled"], exportAs: ["matOptgroup"] }, { type: i3$1.MatOption, selector: "mat-option", exportAs: ["matOption"] }], directives: [{ type: i1$3.MatLabel, selector: "mat-label" }, { type: FocusToItemDirective, selector: "[fsFilterFocusTrigger]", inputs: ["fsFilterFocusTrigger", "focusTargetType"] }, { type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2639
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SelectGroupsComponent, decorators: [{
2640
- type: Component,
2641
- args: [{
2642
- selector: 'filter-item-select-groups',
2643
- templateUrl: './groups.component.html',
2644
- changeDetection: ChangeDetectionStrategy.OnPush,
2645
- }]
2646
- }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { select: [{
2647
- type: ViewChild,
2648
- args: ['select', { static: true }]
2649
- }], item: [{
2650
- type: Input
2651
- }] } });
2595
+ ActionsController.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ActionsController, deps: [{ token: i1$5.BreakpointObserver }], target: i0.ɵɵFactoryTarget.Injectable });
2596
+ ActionsControllerprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ActionsController });
2597
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ActionsController, decorators: [{
2598
+ type: Injectable
2599
+ }], ctorParameters: function () { return [{ type: i1$5.BreakpointObserver }]; } });
2652
2600
 
2653
- class SelectComponent extends BaseItemComponent {
2601
+ const FILTER_DRAWER_DATA = new InjectionToken('fs.filter-drawer-data');
2602
+
2603
+ const FILTER_DRAWER_OVERLAY = new InjectionToken('fs.filter-drawer-overlay');
2604
+
2605
+ class BaseItemComponent {
2654
2606
  constructor(_kvDiffers, _cd) {
2655
- super(_kvDiffers, _cd);
2656
2607
  this._kvDiffers = _kvDiffers;
2657
2608
  this._cd = _cd;
2658
- // For case when we have multiple selection with __all option
2659
- // If _all has been selected than we must disable all other items
2660
- this.allItemsOptionSelected = false;
2661
- }
2662
- get multipleSelectItem() {
2663
- return this.item;
2609
+ this.inline = false;
2610
+ this._destroy$ = new Subject();
2611
+ this._debouncer$ = new Subject();
2612
+ this._kvDiffer = this._kvDiffers.find(this.item || {}).create();
2613
+ this.listenWithDebounce();
2664
2614
  }
2665
- get simpleSelectItem() {
2666
- return this.item;
2615
+ set item(value) {
2616
+ this._item = value;
2667
2617
  }
2668
- ngOnChanges(changes) {
2669
- if (changes.item) {
2670
- this.values$ = this.item.values$;
2671
- }
2618
+ ;
2619
+ get item() {
2620
+ return this._item;
2672
2621
  }
2673
2622
  ngDoCheck() {
2674
2623
  if (this._kvDiffer) {
2675
2624
  const changes = this._kvDiffer.diff(this.item);
2676
2625
  if (changes) {
2677
- this._cd.markForCheck();
2678
- if (this.selectedItem) {
2679
- this.selectedItem.cd.markForCheck();
2680
- }
2626
+ this._cd.detectChanges();
2627
+ }
2628
+ }
2629
+ }
2630
+ ngOnChanges(changes) {
2631
+ if (changes.item) {
2632
+ if (Array.isArray(this.item.label)) {
2633
+ this.label = this.item.label[0];
2634
+ }
2635
+ else {
2636
+ this.label = this.item.label;
2681
2637
  }
2682
2638
  }
2683
2639
  }
2640
+ ngOnDestroy() {
2641
+ this._destroy$.next();
2642
+ this._destroy$.complete();
2643
+ }
2644
+ listenWithDebounce() {
2645
+ this._debouncer$
2646
+ .pipe(debounceTime(150), takeUntil(this._destroy$))
2647
+ .subscribe(() => {
2648
+ this.item.valueChanged();
2649
+ });
2650
+ }
2651
+ itemChange() {
2652
+ this._debouncer$.next();
2653
+ }
2684
2654
  }
2685
- SelectComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SelectComponent, deps: [{ token: i0.KeyValueDiffers }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
2686
- SelectComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SelectComponent, selector: "filter-item-select", viewQueries: [{ propertyName: "selectedItem", first: true, predicate: ["selectItem"], descendants: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<ng-container *ngIf=\"(item.loading$ | async) else itemSelect\">\n <mat-form-field>\n <mat-label>{{item.label}}</mat-label>\n <mat-select disabled></mat-select>\n </mat-form-field>\n</ng-container>\n\n<ng-template #itemSelect>\n <ng-container *ngIf=\"(values$ | async)?.length\">\n <ng-container *ngIf=\"item.multiple && !item.children\">\n <filter-item-select-multiple\n [item]=\"multipleSelectItem\"\n #selectItem>\n </filter-item-select-multiple>\n </ng-container>\n\n <ng-container *ngIf=\"!item.multiple && !item.children\">\n <filter-item-select-simple\n [item]=\"simpleSelectItem\"\n #selectItem>\n </filter-item-select-simple>\n </ng-container>\n\n <ng-container *ngIf=\"item.children\">\n <filter-item-select-groups\n [item]=\"item\"\n #selectItem>\n </filter-item-select-groups>\n </ng-container>\n </ng-container>\n</ng-template>\n", components: [{ type: i1$3.MatFormField, selector: "mat-form-field", inputs: ["color", "floatLabel", "appearance", "hideRequiredMarker", "hintLabel"], exportAs: ["matFormField"] }, { type: i2.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { type: SelectMultipleComponent, selector: "filter-item-select-multiple", inputs: ["item"] }, { type: SelectSimpleComponent, selector: "filter-item-select-simple", inputs: ["item"] }, { type: SelectGroupsComponent, selector: "filter-item-select-groups", inputs: ["item"] }], directives: [{ type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1$3.MatLabel, selector: "mat-label" }], pipes: { "async": i3.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
2687
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SelectComponent, decorators: [{
2655
+ BaseItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: BaseItemComponent, deps: [{ token: i0.KeyValueDiffers }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
2656
+ BaseItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: BaseItemComponent, selector: "base-item", inputs: { item: "item", inline: "inline" }, usesOnChanges: true, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
2657
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: BaseItemComponent, decorators: [{
2688
2658
  type: Component,
2689
2659
  args: [{
2690
- selector: 'filter-item-select',
2691
- templateUrl: './select.component.html',
2660
+ selector: 'base-item',
2661
+ template: '',
2692
2662
  changeDetection: ChangeDetectionStrategy.OnPush,
2693
2663
  }]
2694
- }], ctorParameters: function () { return [{ type: i0.KeyValueDiffers }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { selectedItem: [{
2695
- type: ViewChild,
2696
- args: ['selectItem']
2664
+ }], ctorParameters: function () { return [{ type: i0.KeyValueDiffers }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { item: [{
2665
+ type: Input
2666
+ }], inline: [{
2667
+ type: Input
2697
2668
  }] } });
2698
2669
 
2699
- class ChipsComponent extends BaseItemComponent {
2700
- constructor(_kvDiffers, _cd) {
2701
- super(_kvDiffers, _cd);
2702
- this._kvDiffers = _kvDiffers;
2703
- this._cd = _cd;
2670
+ class FocusControllerService {
2671
+ constructor() {
2672
+ this._focusOn = new BehaviorSubject(null);
2704
2673
  }
2705
- modelChange() {
2706
- this.itemChange();
2674
+ get focusOn$() {
2675
+ return this._focusOn.asObservable();
2707
2676
  }
2708
- compareFn(modelValue, chipValue) {
2709
- return modelValue.value === chipValue.value;
2677
+ click(item, type = null) {
2678
+ this._focusOn.next({ item, type });
2679
+ }
2680
+ listenFocusFor$(targetItem, targetType = null) {
2681
+ return this._focusOn
2682
+ .pipe(filter$1((event) => !!event), filter$1(({ item, type }) => {
2683
+ return targetItem === item && targetType === type;
2684
+ }), tap(() => this.clearFocus()));
2685
+ }
2686
+ clearFocus() {
2687
+ this._focusOn.next(null);
2710
2688
  }
2711
2689
  }
2712
- ChipsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ChipsComponent, deps: [{ token: i0.KeyValueDiffers }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
2713
- ChipsComponentcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ChipsComponent, selector: "filter-item-chips", usesInheritance: true, ngImport: i0, template: "<ng-template [ngIf]=\"item.values?.length\">\n <fs-label-field>\n <fs-label>{{item.label}}</fs-label>\n <fs-chips [(ngModel)]=\"item.model\"\n [compare]=\"compareFn\"\n [multiple]=\"item.multiple\">\n <fs-chip *ngFor=\"let value of item.values\"\n [value]=\"value\"\n [selectable]=\"true\">\n {{ value.name }}\n </fs-chip>\n </fs-chips>\n </fs-label-field>\n</ng-template>\n\n<ng-template [ngIf]=\"item.loading\">{{ item.label }} loading...</ng-template>\n", styles: ["fs-chip{line-height:40px}\n"], components: [{ type: i1$5.FsLabelFieldComponent, selector: "fs-label-field", inputs: ["bottomMargin", "topMargin", "labelMargin"] }, { type: i1$5.FsLabelComponent, selector: "fs-label" }, { type: i2$1.FsChipsComponent, selector: "fs-chips", inputs: ["compare", "multiple"] }, { type: i2$1.FsChipComponent, selector: "fs-chip", inputs: ["size", "value", "backgroundColor", "borderColor", "color", "outlined", "removable", "selectable", "selected", "image"], outputs: ["selectedToggled", "removed"] }], directives: [{ type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2714
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ChipsComponent, decorators: [{
2715
- type: Component,
2716
- args: [{
2717
- selector: 'filter-item-chips',
2718
- templateUrl: './chips.component.html',
2719
- styleUrls: ['./chips.component.scss'],
2720
- changeDetection: ChangeDetectionStrategy.OnPush,
2721
- }]
2722
- }], ctorParameters: function () { return [{ type: i0.KeyValueDiffers }, { type: i0.ChangeDetectorRef }]; } });
2690
+ FocusControllerService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FocusControllerService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
2691
+ FocusControllerServiceprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FocusControllerService });
2692
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FocusControllerService, decorators: [{
2693
+ type: Injectable
2694
+ }], ctorParameters: function () { return []; } });
2723
2695
 
2724
- class RangeComponent extends BaseItemComponent {
2725
- constructor(_kvDiffers, _cd) {
2726
- super(_kvDiffers, _cd);
2727
- this._kvDiffers = _kvDiffers;
2728
- this._cd = _cd;
2696
+ class FocusToItemDirective {
2697
+ constructor(_el, _focusController, _targetSelect, _targetDate, _targetDateScroll, _targetDateRangeFrom, _targetDateRangeTo, _targetAutocomplete, _targetAutocompleteChips) {
2698
+ this._el = _el;
2699
+ this._focusController = _focusController;
2700
+ this._targetSelect = _targetSelect;
2701
+ this._targetDate = _targetDate;
2702
+ this._targetDateScroll = _targetDateScroll;
2703
+ this._targetDateRangeFrom = _targetDateRangeFrom;
2704
+ this._targetDateRangeTo = _targetDateRangeTo;
2705
+ this._targetAutocomplete = _targetAutocomplete;
2706
+ this._targetAutocompleteChips = _targetAutocompleteChips;
2707
+ this._destroy$ = new Subject();
2729
2708
  }
2730
2709
  ngOnInit() {
2731
- this.listenChanges();
2732
- }
2733
- listenChanges() {
2734
- const fromListener = fromEvent(this.from.nativeElement, 'keyup')
2735
- .pipe(distinctUntilChanged());
2736
- const toListener = fromEvent(this.to.nativeElement, 'keyup')
2737
- .pipe(distinctUntilChanged());
2738
- merge(fromListener, toListener)
2739
- .pipe(takeUntil(this._destroy$))
2710
+ this._focusController
2711
+ .listenFocusFor$(this._item, this._focusTargetType)
2712
+ .pipe(delay(500), takeUntil(this._destroy$))
2740
2713
  .subscribe(() => {
2741
- this.itemChange();
2714
+ this._focus();
2742
2715
  });
2743
2716
  }
2744
- }
2745
- RangeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: RangeComponent, deps: [{ token: i0.KeyValueDiffers }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
2746
- RangeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: RangeComponent, selector: "filter-item-range", viewQueries: [{ propertyName: "from", first: true, predicate: ["from"], descendants: true, static: true }, { propertyName: "to", first: true, predicate: ["to"], descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: "<div class=\"fs-row form-field\">\n <mat-form-field class=\"filter-range-min\">\n <mat-label>{{item.label[0]}}</mat-label>\n <span matPrefix *ngIf=\"item.prefix\" [innerHtml]=\"item.prefix\"></span>\n <input matInput\n [fsFilterFocusTrigger]=\"item\"\n [focusTargetType]=\"'from'\"\n type=\"text\"\n inputmode=\"decimal\"\n [(ngModel)]=\"item.model.min\"\n #from>\n <span matSuffix *ngIf=\"item.suffix\" [innerHtml]=\"item.suffix\"></span>\n </mat-form-field>\n\n <mat-form-field class=\"filter-range-max\">\n <mat-label>{{item.label[1]}}</mat-label>\n <span matPrefix *ngIf=\"item.prefix\" [innerHtml]=\"item.prefix\"></span>\n <input matInput\n [fsFilterFocusTrigger]=\"item\"\n [focusTargetType]=\"'to'\"\n type=\"text\"\n inputmode=\"decimal\"\n [(ngModel)]=\"item.model.max\"\n #to>\n <span matSuffix *ngIf=\"item.suffix\" [innerHtml]=\"item.suffix\"></span>\n </mat-form-field>\n</div>\n", components: [{ type: i1$3.MatFormField, selector: "mat-form-field", inputs: ["color", "floatLabel", "appearance", "hideRequiredMarker", "hintLabel"], exportAs: ["matFormField"] }], directives: [{ type: i1$3.MatLabel, selector: "mat-label" }, { type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1$3.MatPrefix, selector: "[matPrefix]" }, { type: i3$2.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["id", "disabled", "required", "type", "value", "readonly", "placeholder", "errorStateMatcher", "aria-describedby"], exportAs: ["matInput"] }, { type: i4.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: FocusToItemDirective, selector: "[fsFilterFocusTrigger]", inputs: ["fsFilterFocusTrigger", "focusTargetType"] }, { type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i1$3.MatSuffix, selector: "[matSuffix]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2747
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: RangeComponent, decorators: [{
2748
- type: Component,
2749
- args: [{
2750
- selector: 'filter-item-range',
2751
- templateUrl: './range.component.html',
2752
- changeDetection: ChangeDetectionStrategy.OnPush,
2753
- }]
2754
- }], ctorParameters: function () { return [{ type: i0.KeyValueDiffers }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { from: [{
2755
- type: ViewChild,
2756
- args: ['from', { static: true }]
2757
- }], to: [{
2758
- type: ViewChild,
2759
- args: ['to', { static: true }]
2760
- }] } });
2761
-
2762
- class AutocompleteComponent extends BaseItemComponent {
2763
- constructor(_kvDiffers, _cd) {
2764
- super(_kvDiffers, _cd);
2765
- this._kvDiffers = _kvDiffers;
2766
- this._cd = _cd;
2767
- this.displayWith = (data) => {
2768
- return data ? data.name : data;
2769
- };
2770
- this.fetch = (keyword) => {
2771
- return this.item.valuesFn(keyword);
2772
- };
2717
+ ngOnDestroy() {
2718
+ this._destroy$.next();
2719
+ this._destroy$.complete();
2720
+ }
2721
+ _focus() {
2722
+ switch (this._item.type) {
2723
+ case ItemType.Select:
2724
+ {
2725
+ this._targetSelect.open();
2726
+ }
2727
+ break;
2728
+ case ItemType.Text:
2729
+ case ItemType.Range:
2730
+ {
2731
+ this._el.nativeElement.focus();
2732
+ }
2733
+ break;
2734
+ case ItemType.Date:
2735
+ {
2736
+ if (this._item.mode === ItemDateMode.Calendar) {
2737
+ this._targetDate.open();
2738
+ }
2739
+ else {
2740
+ this._targetDateScroll.open();
2741
+ }
2742
+ }
2743
+ break;
2744
+ case ItemType.DateRange:
2745
+ {
2746
+ if (this._focusTargetType === 'from') {
2747
+ this._targetDateRangeFrom.open();
2748
+ }
2749
+ else {
2750
+ this._targetDateRangeTo.open();
2751
+ }
2752
+ }
2753
+ break;
2754
+ case ItemType.AutoComplete:
2755
+ {
2756
+ this._targetAutocomplete.focus();
2757
+ }
2758
+ break;
2759
+ case ItemType.AutoCompleteChips:
2760
+ {
2761
+ this._targetAutocompleteChips.focus();
2762
+ }
2763
+ break;
2764
+ }
2773
2765
  }
2774
2766
  }
2775
- AutocompleteComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: AutocompleteComponent, deps: [{ token: i0.KeyValueDiffers }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
2776
- AutocompleteComponentcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: AutocompleteComponent, selector: "filter-item-autocomplete", usesInheritance: true, ngImport: i0, template: "<fs-autocomplete\n [fsFilterFocusTrigger]=\"item\"\n [fetch]=\"fetch\"\n [displayWith]=\"displayWith\"\n [(ngModel)]=\"item.model\"\n [placeholder]=\"label\"\n [fetchOnFocus]=\"item.fetchOnFocus\"\n [showClear]=\"item.clearAllowed\"\n name=\"item.name\">\n <ng-template fsAutocompleteTemplate let-data=\"data\">\n {{data.name}}\n </ng-template>\n</fs-autocomplete>\n", components: [{ type: i4$1.FsAutocompleteComponent, selector: "fs-autocomplete", inputs: ["fetch", "placeholder", "displayWith", "fetchOnFocus", "readonly", "required", "disabled", "hint", "panelWidth", "panelClass", "showClear"], outputs: ["cleared"] }], directives: [{ type: FocusToItemDirective, selector: "[fsFilterFocusTrigger]", inputs: ["fsFilterFocusTrigger", "focusTargetType"] }, { type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i4$1.FsAutocompleteTemplateDirective, selector: "[fsAutocompleteTemplate]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2777
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: AutocompleteComponent, decorators: [{
2778
- type: Component,
2767
+ FocusToItemDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FocusToItemDirective, deps: [{ token: i0.ElementRef }, { token: FocusControllerService }, { token: i2.MatSelect, optional: true, self: true }, { token: i3$3.FsDatePickerComponent, optional: true, self: true }, { token: i3$3.FsDateScrollPickerComponent, optional: true, self: true }, { token: i3$3.DateRangePickerFromComponent, optional: true, self: true }, { token: i3$3.DateRangePickerToComponent, optional: true, self: true }, { token: i4$1.FsAutocompleteComponent, optional: true, self: true }, { token: i5.FsAutocompleteChipsComponent, optional: true, self: true }], target: i0.ɵɵFactoryTarget.Directive });
2768
+ FocusToItemDirectivedir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: FocusToItemDirective, selector: "[fsFilterFocusTrigger]", inputs: { _item: ["fsFilterFocusTrigger", "_item"], _focusTargetType: ["focusTargetType", "_focusTargetType"] }, ngImport: i0 });
2769
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FocusToItemDirective, decorators: [{
2770
+ type: Directive,
2779
2771
  args: [{
2780
- selector: 'filter-item-autocomplete',
2781
- templateUrl: './autocomplete.component.html',
2782
- changeDetection: ChangeDetectionStrategy.OnPush,
2772
+ selector: '[fsFilterFocusTrigger]',
2783
2773
  }]
2784
- }], ctorParameters: function () { return [{ type: i0.KeyValueDiffers }, { type: i0.ChangeDetectorRef }]; } });
2774
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: FocusControllerService }, { type: i2.MatSelect, decorators: [{
2775
+ type: Optional
2776
+ }, {
2777
+ type: Self
2778
+ }] }, { type: i3$3.FsDatePickerComponent, decorators: [{
2779
+ type: Optional
2780
+ }, {
2781
+ type: Self
2782
+ }] }, { type: i3$3.FsDateScrollPickerComponent, decorators: [{
2783
+ type: Optional
2784
+ }, {
2785
+ type: Self
2786
+ }] }, { type: i3$3.DateRangePickerFromComponent, decorators: [{
2787
+ type: Optional
2788
+ }, {
2789
+ type: Self
2790
+ }] }, { type: i3$3.DateRangePickerToComponent, decorators: [{
2791
+ type: Optional
2792
+ }, {
2793
+ type: Self
2794
+ }] }, { type: i4$1.FsAutocompleteComponent, decorators: [{
2795
+ type: Optional
2796
+ }, {
2797
+ type: Self
2798
+ }] }, { type: i5.FsAutocompleteChipsComponent, decorators: [{
2799
+ type: Optional
2800
+ }, {
2801
+ type: Self
2802
+ }] }]; }, propDecorators: { _item: [{
2803
+ type: Input,
2804
+ args: ['fsFilterFocusTrigger']
2805
+ }], _focusTargetType: [{
2806
+ type: Input,
2807
+ args: ['focusTargetType']
2808
+ }] } });
2785
2809
 
2786
- class AutocompletechipsComponent extends BaseItemComponent {
2810
+ class TextComponent extends BaseItemComponent {
2787
2811
  constructor(_kvDiffers, _cd) {
2788
2812
  super(_kvDiffers, _cd);
2789
2813
  this._kvDiffers = _kvDiffers;
2790
2814
  this._cd = _cd;
2791
- this.fetch = (keyword) => {
2792
- return this.item.valuesFn(keyword);
2793
- };
2794
- }
2795
- // SP-T1747
2796
- clicked() {
2797
- this.chipBackground = this.item.chipBackground;
2798
- this.chipColor = this.item.chipColor;
2799
- this.chipIcon = this.item.chipIcon;
2800
- this._cd.markForCheck();
2815
+ this.textControl = new FormControl();
2816
+ this.destroy$ = new Subject();
2801
2817
  }
2802
- addAutocompleteChipItem(event) {
2803
- if (event.data && this.item.model.indexOf(event.data.value) === -1) {
2804
- this.item.model.push(event.data);
2805
- this.itemChange();
2806
- }
2818
+ ngOnInit() {
2819
+ this._listenControlValueChanges();
2820
+ this._listenModelChanges();
2807
2821
  }
2808
- removeAutocompleteChipItem(event) {
2809
- remove(this.item.model, { value: event.data.value });
2810
- this.itemChange();
2822
+ ngOnDestroy() {
2823
+ this.destroy$.next();
2824
+ this.destroy$.complete();
2811
2825
  }
2812
- clearAutocompleteChipItem() {
2813
- this.item.clear();
2814
- this.itemChange();
2826
+ _listenControlValueChanges() {
2827
+ this.textControl.valueChanges
2828
+ .pipe(distinctUntilChanged(), debounceTime(200), takeUntil(this.destroy$))
2829
+ .subscribe((value) => {
2830
+ this.item.model = value;
2831
+ });
2815
2832
  }
2816
- compareItems(item1, item2) {
2817
- return (item1 === null || item1 === void 0 ? void 0 : item1.value) === (item2 === null || item2 === void 0 ? void 0 : item2.value);
2833
+ _listenModelChanges() {
2834
+ this._item.value$
2835
+ .pipe(takeUntil(this.destroy$))
2836
+ .subscribe(() => {
2837
+ this.textControl.setValue(this.item.model, { emitEvent: false });
2838
+ });
2818
2839
  }
2819
2840
  }
2820
- AutocompletechipsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: AutocompletechipsComponent, deps: [{ token: i0.KeyValueDiffers }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
2821
- AutocompletechipsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: AutocompletechipsComponent, selector: "filter-item-autocompletechips", usesInheritance: true, ngImport: i0, template: "<fs-autocomplete-chips\n [fsFilterFocusTrigger]=\"item\"\n [fetch]=\"fetch\"\n [ngModel]=\"item.model\"\n (selected)=\"addAutocompleteChipItem($event)\"\n (removed)=\"removeAutocompleteChipItem($event)\"\n (clear)=\"clearAutocompleteChipItem()\"\n (click)=\"clicked()\"\n [allowText]=\"false\"\n [fetchOnFocus]=\"item.fetchOnFocus\"\n [placeholder]=\"label\"\n [chipImage]=\"item.chipImage\"\n [chipColor]=\"chipColor\"\n [chipIconColor]=\"chipIcon\"\n [chipBackground]=\"chipBackground\"\n [chipIcon]=\"item.chipIcon\"\n [chipClass]=\"item.chipClass\"\n [allowClear]=\"item.clearAllowed\"\n [removable]=\"item.clearAllowed\"\n [compareWith]=\"compareItems\"\n [panelWidth]=\"300\"\n name=\"model\">\n <ng-template fsAutocompleteObject let-object=\"object\">\n {{ object.name }}\n </ng-template>\n</fs-autocomplete-chips>\n\n<!--<mat-form-field floatLabel=\"auto\">\n <mat-label>{{item.label}}</mat-label>\n <mat-chip-list #chipList>\n <mat-chip *ngFor=\"let item of item.model\"\n (removed)=\"removeAutocompleteChipItem(item)\">\n {{ item.name }}\n <mat-icon matChipRemove>cancel</mat-icon>\n </mat-chip>\n\n <input #chipsInput\n type=\"text\"\n matInput\n [(ngModel)]=\"item.selectedValue\"\n (ngModelChange)=\"onAutocompleteChipsChange(chipsInput)\"\n [name]=\"item.name\"\n [matChipInputFor]=\"chipList\"\n [matAutocomplete]=\"autocompleteChipsInput\">\n </mat-chip-list>\n\n <mat-autocomplete #autocompleteChipsInput=\"matAutocomplete\"\n (optionSelected)=\"addAutocompleteChipItem( $event)\"\n >\n <mat-option *ngFor=\"let item of item.values$ | async\" [value]=\"item\">\n {{ item.name }}\n </mat-option>\n </mat-autocomplete>\n <mat-placeholder *ngIf=\"inline\">{{ item.label }}</mat-placeholder>\n</mat-form-field>-->\n", components: [{ type: i5.FsAutocompleteChipsComponent, selector: "fs-autocomplete-chips", inputs: ["fetch", "readonly", "size", "placeholder", "chipImage", "chipBackground", "chipColor", "chipIcon", "chipIconColor", "chipClass", "hint", "allowText", "allowObject", "delay", "validateText", "removable", "allowClear", "color", "background", "orderable", "limit", "initOnClick", "fetchOnFocus", "multiple", "confirm", "panelClass", "compareWith", "disabled", "panelWidth"], outputs: ["selected", "removed", "reordered", "clear"] }], directives: [{ type: FocusToItemDirective, selector: "[fsFilterFocusTrigger]", inputs: ["fsFilterFocusTrigger", "focusTargetType"] }, { type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i5.FsAutocompleteObjectDirective, selector: "[fsAutocompleteObject],[fsAutocompleteChipsTemplate]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2822
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: AutocompletechipsComponent, decorators: [{
2841
+ TextComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TextComponent, deps: [{ token: i0.KeyValueDiffers }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
2842
+ TextComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: TextComponent, selector: "filter-item-text", usesInheritance: true, ngImport: i0, template: "<mat-form-field>\n <mat-label>{{item.label}}</mat-label>\n <span matPrefix *ngIf=\"item.prefix\" [innerHtml]=\"item.prefix\"></span>\n <input matInput [formControl]=\"textControl\" [fsFilterFocusTrigger]=\"item\">\n <span matSuffix *ngIf=\"item.suffix\" [innerHtml]=\"item.suffix\"></span>\n</mat-form-field>\n", styles: [""], components: [{ type: i1$3.MatFormField, selector: "mat-form-field", inputs: ["color", "floatLabel", "appearance", "hideRequiredMarker", "hintLabel"], exportAs: ["matFormField"] }], directives: [{ type: i1$3.MatLabel, selector: "mat-label" }, { type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1$3.MatPrefix, selector: "[matPrefix]" }, { type: i3$2.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["id", "disabled", "required", "type", "value", "readonly", "placeholder", "errorStateMatcher", "aria-describedby"], exportAs: ["matInput"] }, { type: i4.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4.FormControlDirective, selector: "[formControl]", inputs: ["disabled", "formControl", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: FocusToItemDirective, selector: "[fsFilterFocusTrigger]", inputs: ["fsFilterFocusTrigger", "focusTargetType"] }, { type: i1$3.MatSuffix, selector: "[matSuffix]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2843
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TextComponent, decorators: [{
2823
2844
  type: Component,
2824
2845
  args: [{
2825
- selector: 'filter-item-autocompletechips',
2826
- templateUrl: './autocompletechips.component.html',
2846
+ selector: 'filter-item-text',
2847
+ templateUrl: './text.component.html',
2848
+ styleUrls: ['./text.component.scss'],
2827
2849
  changeDetection: ChangeDetectionStrategy.OnPush,
2828
2850
  }]
2829
2851
  }], ctorParameters: function () { return [{ type: i0.KeyValueDiffers }, { type: i0.ChangeDetectorRef }]; } });
2830
2852
 
2831
- var PickerViewType;
2832
- (function (PickerViewType) {
2833
- PickerViewType["Date"] = "date";
2834
- PickerViewType["DateTime"] = "datetime";
2835
- PickerViewType["Time"] = "time";
2836
- PickerViewType["Week"] = "week";
2837
- PickerViewType["MonthRange"] = "monthrange";
2838
- })(PickerViewType || (PickerViewType = {}));
2839
-
2840
- class DateComponent extends BaseItemComponent {
2841
- constructor(_kvDiffers, _cd) {
2842
- super(_kvDiffers, _cd);
2843
- this._kvDiffers = _kvDiffers;
2844
- this._cd = _cd;
2845
- this.viewType = PickerViewType.Date;
2846
- this.itemDateMode = ItemDateMode;
2847
- this.showYear = true;
2848
- this.showMonth = true;
2849
- this.showDay = true;
2850
- }
2851
- ngOnInit() {
2852
- if (this.item.type === ItemType.DateTime) {
2853
- this.viewType = PickerViewType.DateTime;
2853
+ class FsFilterIsolateValues {
2854
+ transform(values, isolate) {
2855
+ if (!isolate) {
2856
+ return values;
2854
2857
  }
2855
2858
  else {
2856
- this.viewType = PickerViewType.Date;
2857
- }
2858
- if (this.item.mode === ItemDateMode.ScrollMonthYear) {
2859
- this.showDay = false;
2859
+ return values.filter((value) => {
2860
+ return value.value !== isolate.value;
2861
+ });
2860
2862
  }
2861
2863
  }
2862
2864
  }
2863
- DateComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: DateComponent, deps: [{ token: i0.KeyValueDiffers }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
2864
- DateComponentcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: DateComponent, selector: "filter-item-date", usesInheritance: true, ngImport: i0, template: "<mat-form-field *ngIf=\"item.mode===itemDateMode.Calendar; else elseMode\">\n <mat-label>{{item.label}}</mat-label>\n <input matInput\n fsDatePicker\n [fsFilterFocusTrigger]=\"item\"\n [(ngModel)]=\"item.model\"\n [maxYear]=\"item.maxYear\"\n [view]=\"viewType\"\n [clear]=\"item.clearAllowed\"\n [name]=\"item.name\">\n <mat-placeholder *ngIf=\"inline\">{{ item.label }}</mat-placeholder>\n</mat-form-field>\n\n<ng-template #elseMode>\n <mat-form-field>\n <mat-label>{{item.label}}</mat-label>\n <input matInput\n fsDateScrollPicker\n [fsFilterFocusTrigger]=\"item\"\n [(ngModel)]=\"item.model\"\n [maxYear]=\"item.maxYear\"\n [showMonth]=\"showMonth\"\n [showDay]=\"showDay\"\n [showYear]=\"showYear\"\n [clear]=\"item.clearAllowed\"\n [name]=\"item.name\">\n <mat-placeholder *ngIf=\"inline\">{{ item.label }}</mat-placeholder>\n </mat-form-field>\n</ng-template>\n", components: [{ type: i1$3.MatFormField, selector: "mat-form-field", inputs: ["color", "floatLabel", "appearance", "hideRequiredMarker", "hintLabel"], exportAs: ["matFormField"] }, { type: i3$3.FsDatePickerComponent, selector: "[fsDatePicker]", inputs: ["minYear", "maxYear", "minDate", "maxDate", "startOfDay", "view", "format", "minutes"], outputs: ["change"] }, { type: i3$3.FsDateScrollPickerComponent, selector: "[fsDateScrollPicker]", inputs: ["minYear", "maxYear", "maxDate", "showMonth", "showYear", "showDay"] }], directives: [{ type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1$3.MatLabel, selector: "mat-label" }, { type: i3$2.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["id", "disabled", "required", "type", "value", "readonly", "placeholder", "errorStateMatcher", "aria-describedby"], exportAs: ["matInput"] }, { type: i4.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: FocusToItemDirective, selector: "[fsFilterFocusTrigger]", inputs: ["fsFilterFocusTrigger", "focusTargetType"] }, { type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i1$3.MatPlaceholder, selector: "mat-placeholder" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2865
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: DateComponent, decorators: [{
2866
- type: Component,
2865
+ FsFilterIsolateValues.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsFilterIsolateValues, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
2866
+ FsFilterIsolateValuespipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsFilterIsolateValues, name: "fsFilterIsolateValues" });
2867
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsFilterIsolateValues, decorators: [{
2868
+ type: Pipe,
2867
2869
  args: [{
2868
- selector: 'filter-item-date',
2869
- templateUrl: './date.component.html',
2870
- changeDetection: ChangeDetectionStrategy.OnPush,
2870
+ name: 'fsFilterIsolateValues'
2871
2871
  }]
2872
- }], ctorParameters: function () { return [{ type: i0.KeyValueDiffers }, { type: i0.ChangeDetectorRef }]; } });
2872
+ }] });
2873
2873
 
2874
- class DateRangeComponent extends BaseItemComponent {
2875
- constructor(_kvDiffers, _cd) {
2876
- super(_kvDiffers, _cd);
2877
- this._kvDiffers = _kvDiffers;
2878
- this._cd = _cd;
2879
- this.viewType = PickerViewType.Date;
2874
+ class SelectMultipleComponent {
2875
+ constructor(cd) {
2876
+ this.cd = cd;
2880
2877
  }
2881
- ngOnInit() {
2882
- if (this.item.type === ItemType.DateTimeRange) {
2883
- this.viewType = PickerViewType.DateTime;
2878
+ changed() {
2879
+ if (this.item.isolate) {
2880
+ this.item.isolate.enabled = false;
2881
+ if (this.item.multiple && Array.isArray(this.item.model)) {
2882
+ const index = this.item.model.indexOf(this.item.isolate.value);
2883
+ if (index > -1) {
2884
+ this.item.model.splice(index, 1);
2885
+ }
2886
+ }
2887
+ }
2888
+ }
2889
+ close() {
2890
+ this.select.close();
2891
+ }
2892
+ isolateChange(filter) {
2893
+ if (filter.isolate.enabled) {
2894
+ filter.model = filter.multiple ? [filter.isolate.value] : filter.isolate.value;
2884
2895
  }
2885
2896
  else {
2886
- this.viewType = PickerViewType.Date;
2897
+ if (filter.multiple) {
2898
+ filter.model = filter.defaultValue ? filter.defaultValue : [];
2899
+ }
2900
+ else {
2901
+ filter.model = filter.defaultValue ? filter.defaultValue : null;
2902
+ }
2887
2903
  }
2888
2904
  }
2889
2905
  }
2890
- DateRangeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: DateRangeComponent, deps: [{ token: i0.KeyValueDiffers }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
2891
- DateRangeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: DateRangeComponent, selector: "filter-item-date-range", usesInheritance: true, ngImport: i0, template: "<mat-form-field>\n <mat-label>{{item.label[0]}}</mat-label>\n <input\n matInput\n [fsFilterFocusTrigger]=\"item\"\n [focusTargetType]=\"'from'\"\n [fsDateRangeFrom]=\"item.name\"\n [(ngModel)]=\"item.model.from\"\n (ngModelChange)=\"itemChange()\"\n [clear]=\"item.clearAllowed\"\n [view]=\"viewType\"\n name=\"date_from\">\n</mat-form-field>\n\n<mat-form-field>\n <mat-label>{{item.label[1]}}</mat-label>\n <input\n matInput\n [fsFilterFocusTrigger]=\"item\"\n [focusTargetType]=\"'to'\"\n [fsDateRangeTo]=\"item.name\"\n [(ngModel)]=\"item.model.to\"\n (ngModelChange)=\"itemChange()\"\n [clear]=\"item.clearAllowed\"\n [view]=\"viewType\"\n name=\"date_to\">\n</mat-form-field>\n", components: [{ type: i1$3.MatFormField, selector: "mat-form-field", inputs: ["color", "floatLabel", "appearance", "hideRequiredMarker", "hintLabel"], exportAs: ["matFormField"] }, { type: i3$3.DateRangePickerFromComponent, selector: "[fsDateRangeFrom],[fsDateRangeFromPicker]", inputs: ["fsDateRangeFrom", "fsDateRangeFromPicker"] }, { type: i3$3.DateRangePickerToComponent, selector: "[fsDateRangeTo],[fsDateRangeToPicker]", inputs: ["fsDateRangeTo", "fsDateRangeToPicker"] }], directives: [{ type: i1$3.MatLabel, selector: "mat-label" }, { type: i3$2.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["id", "disabled", "required", "type", "value", "readonly", "placeholder", "errorStateMatcher", "aria-describedby"], exportAs: ["matInput"] }, { type: i4.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: FocusToItemDirective, selector: "[fsFilterFocusTrigger]", inputs: ["fsFilterFocusTrigger", "focusTargetType"] }, { type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2892
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: DateRangeComponent, decorators: [{
2906
+ SelectMultipleComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SelectMultipleComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
2907
+ SelectMultipleComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SelectMultipleComponent, selector: "filter-item-select-multiple", inputs: { item: "item" }, viewQueries: [{ propertyName: "select", first: true, predicate: ["select"], descendants: true, static: true }], ngImport: i0, template: "<mat-form-field [ngClass]=\"{ isolate: item.isolate }\">\n <mat-label>{{item.label}}</mat-label>\n <mat-select\n #select\n [fsFilterFocusTrigger]=\"item\"\n [(ngModel)]=\"item.model\"\n (ngModelChange)=\"changed()\"\n [multiple]=\"item.multiple\">\n <mat-option\n *ngFor=\"let item of item.values | fsFilterIsolateValues: item.isolate\"\n [value]=\"item.value\">\n {{ item.name }}\n </mat-option>\n </mat-select>\n\n <mat-hint>\n <div *ngIf=\"item.isolate\">\n <mat-checkbox (change)=\"isolateChange(item)\" [(ngModel)]=\"item.isolate.enabled\">\n <span class=\"checkbox-label\">{{ item.isolate.label }}</span>\n </mat-checkbox>\n </div>\n </mat-hint>\n</mat-form-field>\n", styles: [".isolate{margin-bottom:25px}\n"], components: [{ type: i1$3.MatFormField, selector: "mat-form-field", inputs: ["color", "floatLabel", "appearance", "hideRequiredMarker", "hintLabel"], exportAs: ["matFormField"] }, { type: i2.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { type: i3$1.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { type: i4$2.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex", "aria-label", "aria-labelledby", "id", "labelPosition", "name", "required", "checked", "disabled", "indeterminate", "aria-describedby", "value"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }], directives: [{ type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i1$3.MatLabel, selector: "mat-label" }, { type: FocusToItemDirective, selector: "[fsFilterFocusTrigger]", inputs: ["fsFilterFocusTrigger", "focusTargetType"] }, { type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i1$3.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "fsFilterIsolateValues": FsFilterIsolateValues }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
2908
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SelectMultipleComponent, decorators: [{
2893
2909
  type: Component,
2894
2910
  args: [{
2895
- selector: 'filter-item-date-range',
2896
- templateUrl: './date-range.component.html',
2911
+ selector: 'filter-item-select-multiple',
2912
+ templateUrl: './multiple.component.html',
2913
+ styleUrls: ['./multiple.component.scss'],
2897
2914
  changeDetection: ChangeDetectionStrategy.OnPush,
2898
2915
  }]
2899
- }], ctorParameters: function () { return [{ type: i0.KeyValueDiffers }, { type: i0.ChangeDetectorRef }]; } });
2900
-
2901
- class WeekComponent extends BaseItemComponent {
2902
- constructor(_kvDiffers, _cd) {
2903
- super(_kvDiffers, _cd);
2904
- this._kvDiffers = _kvDiffers;
2905
- this._cd = _cd;
2916
+ }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { item: [{
2917
+ type: Input
2918
+ }], select: [{
2919
+ type: ViewChild,
2920
+ args: ['select', { static: true }]
2921
+ }] } });
2922
+
2923
+ class SelectSimpleComponent {
2924
+ constructor(cd) {
2925
+ this.cd = cd;
2926
+ }
2927
+ changed() {
2928
+ if (this.item.isolate) {
2929
+ this.item.isolate.enabled = false;
2930
+ }
2931
+ }
2932
+ isolateChange(filter) {
2933
+ if (filter.isolate.enabled) {
2934
+ filter.model = filter.isolate.value;
2935
+ }
2936
+ else {
2937
+ filter.model = null;
2938
+ }
2906
2939
  }
2907
- ngOnInit() { }
2908
2940
  }
2909
- WeekComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: WeekComponent, deps: [{ token: i0.KeyValueDiffers }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
2910
- WeekComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: WeekComponent, selector: "filter-item-week", usesInheritance: true, ngImport: i0, template: "<mat-form-field>\n <mat-label>{{item.label}}</mat-label>\n <input matInput\n fsDateWeekPicker\n [fsFilterFocusTrigger]=\"item\"\n [(ngModel)]=\"item.model\"\n [seedDate]=\"item.seedDate\"\n [clear]=\"item.clearAllowed\"\n [name]=\"item.name\">\n <mat-placeholder *ngIf=\"inline\">{{ item.label }}</mat-placeholder>\n</mat-form-field>\n", components: [{ type: i1$3.MatFormField, selector: "mat-form-field", inputs: ["color", "floatLabel", "appearance", "hideRequiredMarker", "hintLabel"], exportAs: ["matFormField"] }, { type: i3$3.FsDateWeekPickerComponent, selector: "[fsDateWeekPicker]", inputs: ["minYear", "maxYear", "minDate", "maxDate", "seedDate", "period", "view"], outputs: ["change"] }], directives: [{ type: i1$3.MatLabel, selector: "mat-label" }, { type: i3$2.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["id", "disabled", "required", "type", "value", "readonly", "placeholder", "errorStateMatcher", "aria-describedby"], exportAs: ["matInput"] }, { type: i4.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: FocusToItemDirective, selector: "[fsFilterFocusTrigger]", inputs: ["fsFilterFocusTrigger", "focusTargetType"] }, { type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1$3.MatPlaceholder, selector: "mat-placeholder" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2911
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: WeekComponent, decorators: [{
2941
+ SelectSimpleComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SelectSimpleComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
2942
+ SelectSimpleComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SelectSimpleComponent, selector: "filter-item-select-simple", inputs: { item: "item" }, viewQueries: [{ propertyName: "select", first: true, predicate: ["select"], descendants: true, static: true }], ngImport: i0, template: "<mat-form-field [ngClass]=\"{ isolate: item.isolate }\">\n <mat-label>{{item.label}}</mat-label>\n <mat-select\n #select\n [fsFilterFocusTrigger]=\"item\"\n [(ngModel)]=\"item.model\"\n (ngModelChange)=\"changed()\">\n <mat-option *ngFor=\"let item of item.values | fsFilterIsolateValues: item.isolate\"\n [value]=\"item.value\"\n >\n {{ item.name }}\n </mat-option>\n </mat-select>\n\n <mat-hint>\n <div *ngIf=\"item.isolate\">\n <mat-checkbox (change)=\"isolateChange(item)\" [(ngModel)]=\"item.isolate.enabled\">\n <span class=\"checkbox-label\">{{ item.isolate.label }}</span>\n </mat-checkbox>\n </div>\n </mat-hint>\n</mat-form-field>\n", styles: [".isolate{margin-bottom:25px}\n"], components: [{ type: i1$3.MatFormField, selector: "mat-form-field", inputs: ["color", "floatLabel", "appearance", "hideRequiredMarker", "hintLabel"], exportAs: ["matFormField"] }, { type: i2.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { type: i3$1.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { type: i4$2.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex", "aria-label", "aria-labelledby", "id", "labelPosition", "name", "required", "checked", "disabled", "indeterminate", "aria-describedby", "value"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }], directives: [{ type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i1$3.MatLabel, selector: "mat-label" }, { type: FocusToItemDirective, selector: "[fsFilterFocusTrigger]", inputs: ["fsFilterFocusTrigger", "focusTargetType"] }, { type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i1$3.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "fsFilterIsolateValues": FsFilterIsolateValues }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
2943
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SelectSimpleComponent, decorators: [{
2912
2944
  type: Component,
2913
2945
  args: [{
2914
- selector: 'filter-item-week',
2915
- templateUrl: './week.component.html',
2946
+ selector: 'filter-item-select-simple',
2947
+ templateUrl: './simple.component.html',
2948
+ styleUrls: ['./simple.component.scss'],
2916
2949
  changeDetection: ChangeDetectionStrategy.OnPush,
2917
2950
  }]
2918
- }], ctorParameters: function () { return [{ type: i0.KeyValueDiffers }, { type: i0.ChangeDetectorRef }]; } });
2951
+ }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { item: [{
2952
+ type: Input
2953
+ }], select: [{
2954
+ type: ViewChild,
2955
+ args: ['select', { static: true }]
2956
+ }] } });
2919
2957
 
2920
- class CheckboxComponent extends BaseItemComponent {
2921
- constructor(_kvDiffers, _cd) {
2922
- super(_kvDiffers, _cd);
2923
- this._kvDiffers = _kvDiffers;
2924
- this._cd = _cd;
2958
+ class SelectGroupsComponent {
2959
+ constructor(cd) {
2960
+ this.cd = cd;
2961
+ }
2962
+ compare(o1, o2) {
2963
+ return o1 == o2;
2925
2964
  }
2926
2965
  }
2927
- CheckboxComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: CheckboxComponent, deps: [{ token: i0.KeyValueDiffers }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
2928
- CheckboxComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: CheckboxComponent, selector: "filter-item-checkbox", usesInheritance: true, ngImport: i0, template: "<fs-label-field>\n <mat-checkbox [(ngModel)]=\"item.model\">\n {{ item.label }}\n </mat-checkbox>\n</fs-label-field>\n", styles: ["fs-label-field{margin:0}\n"], components: [{ type: i1$5.FsLabelFieldComponent, selector: "fs-label-field", inputs: ["bottomMargin", "topMargin", "labelMargin"] }, { type: i4$2.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex", "aria-label", "aria-labelledby", "id", "labelPosition", "name", "required", "checked", "disabled", "indeterminate", "aria-describedby", "value"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }], directives: [{ type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2929
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: CheckboxComponent, decorators: [{
2966
+ SelectGroupsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SelectGroupsComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
2967
+ SelectGroupsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SelectGroupsComponent, selector: "filter-item-select-groups", inputs: { item: "item" }, viewQueries: [{ propertyName: "select", first: true, predicate: ["select"], descendants: true, static: true }], ngImport: i0, template: "<mat-form-field>\n <mat-label>{{item.label}}</mat-label>\n <mat-select\n #select\n [fsFilterFocusTrigger]=\"item\"\n [(ngModel)]=\"item.model\"\n [compareWith]=\"compare\">\n <ng-container *ngFor=\"let selectItem of item.values\">\n <ng-container *ngIf=\"selectItem[item.children]; else simpleOption\">\n <mat-optgroup [label]=\"selectItem.name\">\n <mat-option *ngFor=\"let subItem of selectItem[item.children]\"\n [value]=\"subItem.value\"\n [ngStyle]=\"selectItem.style\">\n {{ subItem.name }}\n </mat-option>\n </mat-optgroup>\n </ng-container>\n\n <ng-template #simpleOption>\n <mat-option\n [value]=\"selectItem.value\"\n [ngStyle]=\"selectItem.style\">\n {{ selectItem.name }}\n </mat-option>\n </ng-template>\n </ng-container>\n </mat-select>\n</mat-form-field>\n", components: [{ type: i1$3.MatFormField, selector: "mat-form-field", inputs: ["color", "floatLabel", "appearance", "hideRequiredMarker", "hintLabel"], exportAs: ["matFormField"] }, { type: i2.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { type: i3$1.MatOptgroup, selector: "mat-optgroup", inputs: ["disabled"], exportAs: ["matOptgroup"] }, { type: i3$1.MatOption, selector: "mat-option", exportAs: ["matOption"] }], directives: [{ type: i1$3.MatLabel, selector: "mat-label" }, { type: FocusToItemDirective, selector: "[fsFilterFocusTrigger]", inputs: ["fsFilterFocusTrigger", "focusTargetType"] }, { type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2968
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SelectGroupsComponent, decorators: [{
2930
2969
  type: Component,
2931
2970
  args: [{
2932
- selector: 'filter-item-checkbox',
2933
- templateUrl: './checkbox.component.html',
2934
- styleUrls: ['checkbox.component.scss'],
2971
+ selector: 'filter-item-select-groups',
2972
+ templateUrl: './groups.component.html',
2935
2973
  changeDetection: ChangeDetectionStrategy.OnPush,
2936
2974
  }]
2937
- }], ctorParameters: function () { return [{ type: i0.KeyValueDiffers }, { type: i0.ChangeDetectorRef }]; } });
2975
+ }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { select: [{
2976
+ type: ViewChild,
2977
+ args: ['select', { static: true }]
2978
+ }], item: [{
2979
+ type: Input
2980
+ }] } });
2938
2981
 
2939
- class FilterItemComponent {
2940
- constructor(_cdRef) {
2941
- this._cdRef = _cdRef;
2942
- this._destroy$ = new Subject();
2943
- this.itemType = ItemType;
2944
- }
2945
- get textItem() {
2946
- return this.item;
2947
- }
2948
- get chipsItem() {
2949
- return this.item;
2950
- }
2951
- get baseSelectItem() {
2952
- return this.item;
2953
- }
2954
- get rangeItem() {
2955
- return this.item;
2982
+ class SelectComponent extends BaseItemComponent {
2983
+ constructor(_kvDiffers, _cd) {
2984
+ super(_kvDiffers, _cd);
2985
+ this._kvDiffers = _kvDiffers;
2986
+ this._cd = _cd;
2987
+ // For case when we have multiple selection with __all option
2988
+ // If _all has been selected than we must disable all other items
2989
+ this.allItemsOptionSelected = false;
2956
2990
  }
2957
- get autocompleteItem() {
2991
+ get multipleSelectItem() {
2958
2992
  return this.item;
2959
2993
  }
2960
- get autocompleteChipsItem() {
2994
+ get simpleSelectItem() {
2961
2995
  return this.item;
2962
2996
  }
2963
- get dateItem() {
2964
- return this.item;
2997
+ ngOnChanges(changes) {
2998
+ if (changes.item) {
2999
+ this.values$ = this.item.values$;
3000
+ }
2965
3001
  }
2966
- get dateRangeItem() {
2967
- return this.item;
3002
+ ngDoCheck() {
3003
+ if (this._kvDiffer) {
3004
+ const changes = this._kvDiffer.diff(this.item);
3005
+ if (changes) {
3006
+ this._cd.markForCheck();
3007
+ if (this.selectedItem) {
3008
+ this.selectedItem.cd.markForCheck();
3009
+ }
3010
+ }
3011
+ }
2968
3012
  }
2969
- get dateTimeItem() {
2970
- return this.item;
3013
+ }
3014
+ SelectComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SelectComponent, deps: [{ token: i0.KeyValueDiffers }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
3015
+ SelectComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SelectComponent, selector: "filter-item-select", viewQueries: [{ propertyName: "selectedItem", first: true, predicate: ["selectItem"], descendants: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<ng-container *ngIf=\"(item.loading$ | async) else itemSelect\">\n <mat-form-field>\n <mat-label>{{item.label}}</mat-label>\n <mat-select disabled></mat-select>\n </mat-form-field>\n</ng-container>\n\n<ng-template #itemSelect>\n <ng-container *ngIf=\"(values$ | async)?.length\">\n <ng-container *ngIf=\"item.multiple && !item.children\">\n <filter-item-select-multiple\n [item]=\"multipleSelectItem\"\n #selectItem>\n </filter-item-select-multiple>\n </ng-container>\n\n <ng-container *ngIf=\"!item.multiple && !item.children\">\n <filter-item-select-simple\n [item]=\"simpleSelectItem\"\n #selectItem>\n </filter-item-select-simple>\n </ng-container>\n\n <ng-container *ngIf=\"item.children\">\n <filter-item-select-groups\n [item]=\"item\"\n #selectItem>\n </filter-item-select-groups>\n </ng-container>\n </ng-container>\n</ng-template>\n", components: [{ type: i1$3.MatFormField, selector: "mat-form-field", inputs: ["color", "floatLabel", "appearance", "hideRequiredMarker", "hintLabel"], exportAs: ["matFormField"] }, { type: i2.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { type: SelectMultipleComponent, selector: "filter-item-select-multiple", inputs: ["item"] }, { type: SelectSimpleComponent, selector: "filter-item-select-simple", inputs: ["item"] }, { type: SelectGroupsComponent, selector: "filter-item-select-groups", inputs: ["item"] }], directives: [{ type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1$3.MatLabel, selector: "mat-label" }], pipes: { "async": i3.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
3016
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SelectComponent, decorators: [{
3017
+ type: Component,
3018
+ args: [{
3019
+ selector: 'filter-item-select',
3020
+ templateUrl: './select.component.html',
3021
+ changeDetection: ChangeDetectionStrategy.OnPush,
3022
+ }]
3023
+ }], ctorParameters: function () { return [{ type: i0.KeyValueDiffers }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { selectedItem: [{
3024
+ type: ViewChild,
3025
+ args: ['selectItem']
3026
+ }] } });
3027
+
3028
+ class ChipsComponent extends BaseItemComponent {
3029
+ constructor(_kvDiffers, _cd) {
3030
+ super(_kvDiffers, _cd);
3031
+ this._kvDiffers = _kvDiffers;
3032
+ this._cd = _cd;
2971
3033
  }
2972
- get dateTimeRangeItem() {
2973
- return this.item;
3034
+ modelChange() {
3035
+ this.itemChange();
2974
3036
  }
2975
- get weekItem() {
2976
- return this.item;
3037
+ compareFn(modelValue, chipValue) {
3038
+ return modelValue.value === chipValue.value;
2977
3039
  }
2978
- get checkboxItem() {
2979
- return this.item;
3040
+ }
3041
+ ChipsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ChipsComponent, deps: [{ token: i0.KeyValueDiffers }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
3042
+ ChipsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ChipsComponent, selector: "filter-item-chips", usesInheritance: true, ngImport: i0, template: "<ng-template [ngIf]=\"item.values?.length\">\n <fs-label-field>\n <fs-label>{{item.label}}</fs-label>\n <fs-chips [(ngModel)]=\"item.model\"\n [compare]=\"compareFn\"\n [multiple]=\"item.multiple\">\n <fs-chip *ngFor=\"let value of item.values\"\n [value]=\"value\"\n [selectable]=\"true\">\n {{ value.name }}\n </fs-chip>\n </fs-chips>\n </fs-label-field>\n</ng-template>\n\n<ng-template [ngIf]=\"item.loading\">{{ item.label }} loading...</ng-template>\n", styles: ["fs-chip{line-height:40px}\n"], components: [{ type: i1$6.FsLabelFieldComponent, selector: "fs-label-field", inputs: ["bottomMargin", "topMargin", "labelMargin"] }, { type: i1$6.FsLabelComponent, selector: "fs-label" }, { type: i2$1.FsChipsComponent, selector: "fs-chips", inputs: ["compare", "multiple"] }, { type: i2$1.FsChipComponent, selector: "fs-chip", inputs: ["size", "value", "backgroundColor", "borderColor", "color", "outlined", "removable", "selectable", "selected", "image"], outputs: ["selectedToggled", "removed"] }], directives: [{ type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
3043
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ChipsComponent, decorators: [{
3044
+ type: Component,
3045
+ args: [{
3046
+ selector: 'filter-item-chips',
3047
+ templateUrl: './chips.component.html',
3048
+ styleUrls: ['./chips.component.scss'],
3049
+ changeDetection: ChangeDetectionStrategy.OnPush,
3050
+ }]
3051
+ }], ctorParameters: function () { return [{ type: i0.KeyValueDiffers }, { type: i0.ChangeDetectorRef }]; } });
3052
+
3053
+ class RangeComponent extends BaseItemComponent {
3054
+ constructor(_kvDiffers, _cd) {
3055
+ super(_kvDiffers, _cd);
3056
+ this._kvDiffers = _kvDiffers;
3057
+ this._cd = _cd;
2980
3058
  }
2981
3059
  ngOnInit() {
2982
- this.item.value$
3060
+ this.listenChanges();
3061
+ }
3062
+ listenChanges() {
3063
+ const fromListener = fromEvent(this.from.nativeElement, 'keyup')
3064
+ .pipe(distinctUntilChanged());
3065
+ const toListener = fromEvent(this.to.nativeElement, 'keyup')
3066
+ .pipe(distinctUntilChanged());
3067
+ merge(fromListener, toListener)
2983
3068
  .pipe(takeUntil(this._destroy$))
2984
3069
  .subscribe(() => {
2985
- this._cdRef.markForCheck();
3070
+ this.itemChange();
2986
3071
  });
2987
3072
  }
2988
- ngOnDestroy() {
2989
- this._destroy$.next();
2990
- this._destroy$.complete();
2991
- }
2992
3073
  }
2993
- FilterItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FilterItemComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
2994
- FilterItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FilterItemComponent, selector: "filter-item", inputs: { item: "item" }, ngImport: i0, 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.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i3.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2995
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FilterItemComponent, decorators: [{
3074
+ RangeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: RangeComponent, deps: [{ token: i0.KeyValueDiffers }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
3075
+ RangeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: RangeComponent, selector: "filter-item-range", viewQueries: [{ propertyName: "from", first: true, predicate: ["from"], descendants: true, static: true }, { propertyName: "to", first: true, predicate: ["to"], descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: "<div class=\"fs-row form-field\">\n <mat-form-field class=\"filter-range-min\">\n <mat-label>{{item.label[0]}}</mat-label>\n <span matPrefix *ngIf=\"item.prefix\" [innerHtml]=\"item.prefix\"></span>\n <input matInput\n [fsFilterFocusTrigger]=\"item\"\n [focusTargetType]=\"'from'\"\n type=\"text\"\n inputmode=\"decimal\"\n [(ngModel)]=\"item.model.min\"\n #from>\n <span matSuffix *ngIf=\"item.suffix\" [innerHtml]=\"item.suffix\"></span>\n </mat-form-field>\n\n <mat-form-field class=\"filter-range-max\">\n <mat-label>{{item.label[1]}}</mat-label>\n <span matPrefix *ngIf=\"item.prefix\" [innerHtml]=\"item.prefix\"></span>\n <input matInput\n [fsFilterFocusTrigger]=\"item\"\n [focusTargetType]=\"'to'\"\n type=\"text\"\n inputmode=\"decimal\"\n [(ngModel)]=\"item.model.max\"\n #to>\n <span matSuffix *ngIf=\"item.suffix\" [innerHtml]=\"item.suffix\"></span>\n </mat-form-field>\n</div>\n", components: [{ type: i1$3.MatFormField, selector: "mat-form-field", inputs: ["color", "floatLabel", "appearance", "hideRequiredMarker", "hintLabel"], exportAs: ["matFormField"] }], directives: [{ type: i1$3.MatLabel, selector: "mat-label" }, { type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1$3.MatPrefix, selector: "[matPrefix]" }, { type: i3$2.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["id", "disabled", "required", "type", "value", "readonly", "placeholder", "errorStateMatcher", "aria-describedby"], exportAs: ["matInput"] }, { type: i4.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: FocusToItemDirective, selector: "[fsFilterFocusTrigger]", inputs: ["fsFilterFocusTrigger", "focusTargetType"] }, { type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i1$3.MatSuffix, selector: "[matSuffix]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
3076
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: RangeComponent, decorators: [{
2996
3077
  type: Component,
2997
3078
  args: [{
2998
- selector: 'filter-item',
2999
- templateUrl: './filter-item.component.html',
3079
+ selector: 'filter-item-range',
3080
+ templateUrl: './range.component.html',
3000
3081
  changeDetection: ChangeDetectionStrategy.OnPush,
3001
3082
  }]
3002
- }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { item: [{
3003
- type: Input
3083
+ }], ctorParameters: function () { return [{ type: i0.KeyValueDiffers }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { from: [{
3084
+ type: ViewChild,
3085
+ args: ['from', { static: true }]
3086
+ }], to: [{
3087
+ type: ViewChild,
3088
+ args: ['to', { static: true }]
3004
3089
  }] } });
3005
3090
 
3006
- class FsFilterDrawerActionsComponent {
3007
- constructor(externalParams) {
3008
- this.externalParams = externalParams;
3009
- this._clear = new EventEmitter();
3010
- this._done = new EventEmitter();
3011
- }
3012
- get savedFilters() {
3013
- return this.externalParams.savedFiltersController;
3014
- }
3015
- done() {
3016
- this._done.emit();
3017
- }
3018
- clear() {
3019
- this._clear.emit();
3020
- }
3021
- saveFilters() {
3022
- this.externalParams
3023
- .savedFiltersController
3024
- .openSavedFilterEditDialog();
3091
+ class AutocompleteComponent extends BaseItemComponent {
3092
+ constructor(_kvDiffers, _cd) {
3093
+ super(_kvDiffers, _cd);
3094
+ this._kvDiffers = _kvDiffers;
3095
+ this._cd = _cd;
3096
+ this.displayWith = (data) => {
3097
+ return data ? data.name : data;
3098
+ };
3099
+ this.fetch = (keyword) => {
3100
+ return this.item.valuesFn(keyword);
3101
+ };
3025
3102
  }
3026
3103
  }
3027
- FsFilterDrawerActionsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsFilterDrawerActionsComponent, deps: [{ token: ExternalParamsController }], target: i0.ɵɵFactoryTarget.Component });
3028
- FsFilterDrawerActionsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FsFilterDrawerActionsComponent, selector: "fs-filter-drawer-actions", outputs: { _clear: "clear", _done: "done" }, ngImport: i0, template: "<button type=\"button\" mat-button color=\"primary\" (click)=\"done()\">Done</button>\n<button type=\"button\" mat-button (click)=\"clear()\">Clear</button>\n<ng-container *ngIf=\"savedFilters.enabled$ | async\">\n <button type=\"button\" mat-button (click)=\"saveFilters()\">Save</button>\n</ng-container>\n\n", components: [{ type: i1$4.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }], directives: [{ type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "async": i3.AsyncPipe } });
3029
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsFilterDrawerActionsComponent, decorators: [{
3104
+ AutocompleteComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: AutocompleteComponent, deps: [{ token: i0.KeyValueDiffers }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
3105
+ AutocompleteComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: AutocompleteComponent, selector: "filter-item-autocomplete", usesInheritance: true, ngImport: i0, template: "<fs-autocomplete\n [fsFilterFocusTrigger]=\"item\"\n [fetch]=\"fetch\"\n [displayWith]=\"displayWith\"\n [(ngModel)]=\"item.model\"\n [placeholder]=\"label\"\n [fetchOnFocus]=\"item.fetchOnFocus\"\n [showClear]=\"item.clearAllowed\"\n name=\"item.name\">\n <ng-template fsAutocompleteTemplate let-data=\"data\">\n {{data.name}}\n </ng-template>\n</fs-autocomplete>\n", components: [{ type: i4$1.FsAutocompleteComponent, selector: "fs-autocomplete", inputs: ["fetch", "placeholder", "displayWith", "fetchOnFocus", "readonly", "required", "disabled", "hint", "panelWidth", "panelClass", "showClear"], outputs: ["cleared"] }], directives: [{ type: FocusToItemDirective, selector: "[fsFilterFocusTrigger]", inputs: ["fsFilterFocusTrigger", "focusTargetType"] }, { type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i4$1.FsAutocompleteTemplateDirective, selector: "[fsAutocompleteTemplate]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
3106
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: AutocompleteComponent, decorators: [{
3030
3107
  type: Component,
3031
3108
  args: [{
3032
- selector: 'fs-filter-drawer-actions',
3033
- templateUrl: './filter-drawer-actions.component.html',
3109
+ selector: 'filter-item-autocomplete',
3110
+ templateUrl: './autocomplete.component.html',
3111
+ changeDetection: ChangeDetectionStrategy.OnPush,
3034
3112
  }]
3035
- }], ctorParameters: function () { return [{ type: ExternalParamsController }]; }, propDecorators: { _clear: [{
3036
- type: Output,
3037
- args: ['clear']
3038
- }], _done: [{
3039
- type: Output,
3040
- args: ['done']
3041
- }] } });
3113
+ }], ctorParameters: function () { return [{ type: i0.KeyValueDiffers }, { type: i0.ChangeDetectorRef }]; } });
3042
3114
 
3043
- class FilterDrawerComponent {
3044
- constructor(externalParams, _cd, _itemsStore, overlayRef, data) {
3045
- this.externalParams = externalParams;
3115
+ class AutocompletechipsComponent extends BaseItemComponent {
3116
+ constructor(_kvDiffers, _cd) {
3117
+ super(_kvDiffers, _cd);
3118
+ this._kvDiffers = _kvDiffers;
3046
3119
  this._cd = _cd;
3047
- this._itemsStore = _itemsStore;
3048
- this.overlayRef = overlayRef;
3049
- this.data = data;
3050
- this.inline = false;
3051
- this.windowDesktop = false;
3052
- this._itemsStore.prepareItems();
3053
- this._clear = data.clear;
3054
- this._done = data.done;
3055
- this.updateWindowWidth();
3056
- }
3057
- updateWindowWidth() {
3058
- this.windowDesktop = window.innerWidth > 1200;
3059
- }
3060
- get items$() {
3061
- return this._itemsStore.visibleItems$;
3120
+ this.fetch = (keyword) => {
3121
+ return this.item.valuesFn(keyword);
3122
+ };
3062
3123
  }
3063
- get sortItem() {
3064
- return this._itemsStore.sortByItem;
3124
+ // SP-T1747
3125
+ clicked() {
3126
+ this.chipBackground = this.item.chipBackground;
3127
+ this.chipColor = this.item.chipColor;
3128
+ this.chipIcon = this.item.chipIcon;
3129
+ this._cd.markForCheck();
3065
3130
  }
3066
- get sortDirectionItem() {
3067
- return this._itemsStore.sortDirectionItem;
3131
+ addAutocompleteChipItem(event) {
3132
+ if (event.data && this.item.model.indexOf(event.data.value) === -1) {
3133
+ this.item.model.push(event.data);
3134
+ this.itemChange();
3135
+ }
3068
3136
  }
3069
- clear() {
3070
- this._clear();
3071
- // this.overlayRef.detach();
3137
+ removeAutocompleteChipItem(event) {
3138
+ remove(this.item.model, { value: event.data.value });
3139
+ this.itemChange();
3072
3140
  }
3073
- done() {
3074
- this._done();
3075
- this.overlayRef.detach();
3141
+ clearAutocompleteChipItem() {
3142
+ this.item.clear();
3143
+ this.itemChange();
3076
3144
  }
3077
- backdropClick() {
3078
- this.done();
3145
+ compareItems(item1, item2) {
3146
+ return (item1 === null || item1 === void 0 ? void 0 : item1.value) === (item2 === null || item2 === void 0 ? void 0 : item2.value);
3079
3147
  }
3080
3148
  }
3081
- FilterDrawerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FilterDrawerComponent, deps: [{ token: ExternalParamsController }, { token: i0.ChangeDetectorRef }, { token: FsFilterItemsStore }, { token: FILTER_DRAWER_OVERLAY }, { token: FILTER_DRAWER_DATA }], target: i0.ɵɵFactoryTarget.Component });
3082
- FilterDrawerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FilterDrawerComponent, selector: "ng-component", inputs: { inline: "inline" }, host: { listeners: { "window:resize": "updateWindowWidth()" } }, ngImport: i0, 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 *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 class=\"filter-group sort\"\n [item]=\"sortItem\">\n </filter-item>\n <filter-item 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 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$2.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$1.FsSkeletonContentDirective, selector: "[fsSkeleton]", inputs: ["fsSkeleton", "fsSkeletonPattern"] }, { type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "async": i3.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
3083
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FilterDrawerComponent, decorators: [{
3149
+ AutocompletechipsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: AutocompletechipsComponent, deps: [{ token: i0.KeyValueDiffers }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
3150
+ AutocompletechipsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: AutocompletechipsComponent, selector: "filter-item-autocompletechips", usesInheritance: true, ngImport: i0, template: "<fs-autocomplete-chips\n [fsFilterFocusTrigger]=\"item\"\n [fetch]=\"fetch\"\n [ngModel]=\"item.model\"\n (selected)=\"addAutocompleteChipItem($event)\"\n (removed)=\"removeAutocompleteChipItem($event)\"\n (clear)=\"clearAutocompleteChipItem()\"\n (click)=\"clicked()\"\n [allowText]=\"false\"\n [fetchOnFocus]=\"item.fetchOnFocus\"\n [placeholder]=\"label\"\n [chipImage]=\"item.chipImage\"\n [chipColor]=\"chipColor\"\n [chipIconColor]=\"chipIcon\"\n [chipBackground]=\"chipBackground\"\n [chipIcon]=\"item.chipIcon\"\n [chipClass]=\"item.chipClass\"\n [allowClear]=\"item.clearAllowed\"\n [removable]=\"item.clearAllowed\"\n [compareWith]=\"compareItems\"\n [panelWidth]=\"300\"\n name=\"model\">\n <ng-template fsAutocompleteObject let-object=\"object\">\n {{ object.name }}\n </ng-template>\n</fs-autocomplete-chips>\n\n<!--<mat-form-field floatLabel=\"auto\">\n <mat-label>{{item.label}}</mat-label>\n <mat-chip-list #chipList>\n <mat-chip *ngFor=\"let item of item.model\"\n (removed)=\"removeAutocompleteChipItem(item)\">\n {{ item.name }}\n <mat-icon matChipRemove>cancel</mat-icon>\n </mat-chip>\n\n <input #chipsInput\n type=\"text\"\n matInput\n [(ngModel)]=\"item.selectedValue\"\n (ngModelChange)=\"onAutocompleteChipsChange(chipsInput)\"\n [name]=\"item.name\"\n [matChipInputFor]=\"chipList\"\n [matAutocomplete]=\"autocompleteChipsInput\">\n </mat-chip-list>\n\n <mat-autocomplete #autocompleteChipsInput=\"matAutocomplete\"\n (optionSelected)=\"addAutocompleteChipItem( $event)\"\n >\n <mat-option *ngFor=\"let item of item.values$ | async\" [value]=\"item\">\n {{ item.name }}\n </mat-option>\n </mat-autocomplete>\n <mat-placeholder *ngIf=\"inline\">{{ item.label }}</mat-placeholder>\n</mat-form-field>-->\n", components: [{ type: i5.FsAutocompleteChipsComponent, selector: "fs-autocomplete-chips", inputs: ["fetch", "readonly", "size", "placeholder", "chipImage", "chipBackground", "chipColor", "chipIcon", "chipIconColor", "chipClass", "hint", "allowText", "allowObject", "delay", "validateText", "removable", "allowClear", "color", "background", "orderable", "limit", "initOnClick", "fetchOnFocus", "multiple", "confirm", "panelClass", "compareWith", "disabled", "panelWidth"], outputs: ["selected", "removed", "reordered", "clear"] }], directives: [{ type: FocusToItemDirective, selector: "[fsFilterFocusTrigger]", inputs: ["fsFilterFocusTrigger", "focusTargetType"] }, { type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i5.FsAutocompleteObjectDirective, selector: "[fsAutocompleteObject],[fsAutocompleteChipsTemplate]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
3151
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: AutocompletechipsComponent, decorators: [{
3084
3152
  type: Component,
3085
3153
  args: [{
3086
- templateUrl: './filter-drawer.component.html',
3087
- styleUrls: ['filter-drawer.component.scss'],
3088
- // Commented out because filter items are not updating with a delayed observable. Need to figure this out.
3154
+ selector: 'filter-item-autocompletechips',
3155
+ templateUrl: './autocompletechips.component.html',
3089
3156
  changeDetection: ChangeDetectionStrategy.OnPush,
3090
3157
  }]
3091
- }], ctorParameters: function () { return [{ type: ExternalParamsController }, { type: i0.ChangeDetectorRef }, { type: FsFilterItemsStore }, { type: i1$6.OverlayRef, decorators: [{
3092
- type: Inject,
3093
- args: [FILTER_DRAWER_OVERLAY]
3094
- }] }, { type: undefined, decorators: [{
3095
- type: Inject,
3096
- args: [FILTER_DRAWER_DATA]
3097
- }] }]; }, propDecorators: { updateWindowWidth: [{
3098
- type: HostListener,
3099
- args: ['window:resize']
3100
- }], inline: [{
3101
- type: Input
3102
- }] } });
3103
-
3104
- const FS_FILTER_META = new InjectionToken('fs.filter.meta', {
3105
- providedIn: 'root',
3106
- factory: () => {
3107
- return {
3108
- openedFilters: 0,
3109
- };
3110
- }
3111
- });
3158
+ }], ctorParameters: function () { return [{ type: i0.KeyValueDiffers }, { type: i0.ChangeDetectorRef }]; } });
3112
3159
 
3113
- class FsFilterOverlayService {
3114
- constructor(_injector, _filterMeta, _overlay, _focusController) {
3115
- this._injector = _injector;
3116
- this._filterMeta = _filterMeta;
3117
- this._overlay = _overlay;
3118
- this._focusController = _focusController;
3119
- this.detach$ = new Subject();
3120
- this.attach$ = new Subject();
3121
- this._destroy$ = new Subject();
3122
- this._openWhenChipClicked();
3123
- }
3124
- get isOpened() {
3125
- return !!this._overlayRef;
3126
- }
3127
- setClearFn(fn) {
3128
- this._clearFn = fn;
3129
- }
3130
- setDoneFn(fn) {
3131
- this._doneFn = fn;
3160
+ class DateComponent extends BaseItemComponent {
3161
+ constructor(_kvDiffers, _cd) {
3162
+ super(_kvDiffers, _cd);
3163
+ this._kvDiffers = _kvDiffers;
3164
+ this._cd = _cd;
3165
+ this.viewType = PickerViewType.Date;
3166
+ this.itemDateMode = ItemDateMode;
3167
+ this.showYear = true;
3168
+ this.showMonth = true;
3169
+ this.showDay = true;
3132
3170
  }
3133
- close() {
3134
- if (this._overlayRef) {
3135
- this._overlayRef.detach();
3136
- this._overlayRef = null;
3137
- this.removeFilterClass();
3171
+ ngOnInit() {
3172
+ if (this.item.type === ItemType.DateTime) {
3173
+ this.viewType = PickerViewType.DateTime;
3174
+ }
3175
+ else {
3176
+ this.viewType = PickerViewType.Date;
3177
+ }
3178
+ if (this.item.mode === ItemDateMode.ScrollMonthYear) {
3179
+ this.showDay = false;
3138
3180
  }
3139
3181
  }
3140
- open() {
3141
- this._overlayRef = this._createOverlay();
3142
- this._overlayRef.backdropClick()
3143
- .pipe(takeUntil(this._destroy$))
3144
- .subscribe(() => {
3145
- this._overlayRef.detach();
3146
- });
3147
- this._overlayRef.detachments()
3148
- .pipe(takeUntil(this._destroy$))
3149
- .subscribe(() => {
3150
- this.detach$.next();
3151
- });
3152
- this._overlayRef.attachments()
3153
- .pipe(takeUntil(this._destroy$))
3154
- .subscribe(() => {
3155
- this.attach$.next();
3156
- });
3157
- this.addFilterClass();
3158
- return this.openPortalPreview();
3159
- }
3160
- ngOnDestroy() {
3161
- this._destroy$.next();
3162
- this._destroy$.complete();
3163
- }
3164
- _createOverlay() {
3165
- const overlayConfig = new OverlayConfig({
3166
- hasBackdrop: true,
3167
- backdropClass: 'fs-filter-backdrop'
3168
- });
3169
- return this._overlay.create(overlayConfig);
3170
- }
3171
- openPortalPreview() {
3172
- const data = { done: this._doneFn, clear: this._clearFn };
3173
- const injector = this._createInjector(this._injector, data, this._overlayRef);
3174
- const containerPortal = new ComponentPortal(FilterDrawerComponent, undefined, injector);
3175
- const containerRef = this._overlayRef.attach(containerPortal);
3176
- return containerRef.instance;
3177
- }
3178
- _createInjector(parentInjector, data, overlayRef) {
3179
- const injectionTokens = new WeakMap([
3180
- [FILTER_DRAWER_DATA, data],
3181
- [FILTER_DRAWER_OVERLAY, overlayRef],
3182
- ]);
3183
- return new PortalInjector(parentInjector, injectionTokens);
3182
+ }
3183
+ DateComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: DateComponent, deps: [{ token: i0.KeyValueDiffers }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
3184
+ DateComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: DateComponent, selector: "filter-item-date", usesInheritance: true, ngImport: i0, template: "<mat-form-field *ngIf=\"item.mode===itemDateMode.Calendar; else elseMode\">\n <mat-label>{{item.label}}</mat-label>\n <input matInput\n fsDatePicker\n [fsFilterFocusTrigger]=\"item\"\n [(ngModel)]=\"item.model\"\n [maxYear]=\"item.maxYear\"\n [view]=\"viewType\"\n [clear]=\"item.clearAllowed\"\n [name]=\"item.name\">\n <mat-placeholder *ngIf=\"inline\">{{ item.label }}</mat-placeholder>\n</mat-form-field>\n\n<ng-template #elseMode>\n <mat-form-field>\n <mat-label>{{item.label}}</mat-label>\n <input matInput\n fsDateScrollPicker\n [fsFilterFocusTrigger]=\"item\"\n [(ngModel)]=\"item.model\"\n [maxYear]=\"item.maxYear\"\n [showMonth]=\"showMonth\"\n [showDay]=\"showDay\"\n [showYear]=\"showYear\"\n [clear]=\"item.clearAllowed\"\n [name]=\"item.name\">\n <mat-placeholder *ngIf=\"inline\">{{ item.label }}</mat-placeholder>\n </mat-form-field>\n</ng-template>\n", components: [{ type: i1$3.MatFormField, selector: "mat-form-field", inputs: ["color", "floatLabel", "appearance", "hideRequiredMarker", "hintLabel"], exportAs: ["matFormField"] }, { type: i3$3.FsDatePickerComponent, selector: "[fsDatePicker]", inputs: ["minYear", "maxYear", "minDate", "maxDate", "startOfDay", "view", "format", "minutes"], outputs: ["change"] }, { type: i3$3.FsDateScrollPickerComponent, selector: "[fsDateScrollPicker]", inputs: ["minYear", "maxYear", "maxDate", "showMonth", "showYear", "showDay"] }], directives: [{ type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1$3.MatLabel, selector: "mat-label" }, { type: i3$2.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["id", "disabled", "required", "type", "value", "readonly", "placeholder", "errorStateMatcher", "aria-describedby"], exportAs: ["matInput"] }, { type: i4.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: FocusToItemDirective, selector: "[fsFilterFocusTrigger]", inputs: ["fsFilterFocusTrigger", "focusTargetType"] }, { type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i1$3.MatPlaceholder, selector: "mat-placeholder" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
3185
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: DateComponent, decorators: [{
3186
+ type: Component,
3187
+ args: [{
3188
+ selector: 'filter-item-date',
3189
+ templateUrl: './date.component.html',
3190
+ changeDetection: ChangeDetectionStrategy.OnPush,
3191
+ }]
3192
+ }], ctorParameters: function () { return [{ type: i0.KeyValueDiffers }, { type: i0.ChangeDetectorRef }]; } });
3193
+
3194
+ class DateRangeComponent extends BaseItemComponent {
3195
+ constructor(_kvDiffers, _cd) {
3196
+ super(_kvDiffers, _cd);
3197
+ this._kvDiffers = _kvDiffers;
3198
+ this._cd = _cd;
3199
+ this.viewType = PickerViewType.Date;
3184
3200
  }
3185
- removeFilterClass() {
3186
- this._filterMeta.openedFilters--;
3187
- if (this._filterMeta.openedFilters === 0) {
3188
- window.document.body.classList.remove('fs-filter-open');
3201
+ ngOnInit() {
3202
+ if (this.item.type === ItemType.DateTimeRange) {
3203
+ this.viewType = PickerViewType.DateTime;
3189
3204
  }
3190
- }
3191
- addFilterClass() {
3192
- this._filterMeta.openedFilters++;
3193
- if (this._filterMeta.openedFilters === 1) {
3194
- window.document.body.classList.add('fs-filter-open');
3205
+ else {
3206
+ this.viewType = PickerViewType.Date;
3195
3207
  }
3196
3208
  }
3197
- _openWhenChipClicked() {
3198
- this._focusController.focusOn$
3199
- .pipe(filter$1((v) => !!v), takeUntil(this._destroy$))
3200
- .subscribe(() => {
3201
- if (!this.isOpened) {
3202
- this.open();
3203
- }
3204
- });
3205
- }
3206
3209
  }
3207
- FsFilterOverlayService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsFilterOverlayService, deps: [{ token: i0.Injector }, { token: FS_FILTER_META }, { token: i1$6.Overlay }, { token: FocusControllerService }], target: i0.ɵɵFactoryTarget.Injectable });
3208
- FsFilterOverlayServiceprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsFilterOverlayService });
3209
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsFilterOverlayService, decorators: [{
3210
- type: Injectable
3211
- }], ctorParameters: function () { return [{ type: i0.Injector }, { type: undefined, decorators: [{
3212
- type: Inject,
3213
- args: [FS_FILTER_META]
3214
- }] }, { type: i1$6.Overlay }, { type: FocusControllerService }]; } });
3210
+ DateRangeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: DateRangeComponent, deps: [{ token: i0.KeyValueDiffers }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
3211
+ DateRangeComponentcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: DateRangeComponent, selector: "filter-item-date-range", usesInheritance: true, ngImport: i0, template: "<mat-form-field>\n <mat-label>{{item.label[0]}}</mat-label>\n <input\n matInput\n [fsFilterFocusTrigger]=\"item\"\n [focusTargetType]=\"'from'\"\n [fsDateRangeFrom]=\"item.name\"\n [(ngModel)]=\"item.model.from\"\n (ngModelChange)=\"itemChange()\"\n [clear]=\"item.clearAllowed\"\n [view]=\"viewType\"\n name=\"date_from\">\n</mat-form-field>\n\n<mat-form-field>\n <mat-label>{{item.label[1]}}</mat-label>\n <input\n matInput\n [fsFilterFocusTrigger]=\"item\"\n [focusTargetType]=\"'to'\"\n [fsDateRangeTo]=\"item.name\"\n [(ngModel)]=\"item.model.to\"\n (ngModelChange)=\"itemChange()\"\n [clear]=\"item.clearAllowed\"\n [view]=\"viewType\"\n name=\"date_to\">\n</mat-form-field>\n", components: [{ type: i1$3.MatFormField, selector: "mat-form-field", inputs: ["color", "floatLabel", "appearance", "hideRequiredMarker", "hintLabel"], exportAs: ["matFormField"] }, { type: i3$3.DateRangePickerFromComponent, selector: "[fsDateRangeFrom],[fsDateRangeFromPicker]", inputs: ["fsDateRangeFrom", "fsDateRangeFromPicker"] }, { type: i3$3.DateRangePickerToComponent, selector: "[fsDateRangeTo],[fsDateRangeToPicker]", inputs: ["fsDateRangeTo", "fsDateRangeToPicker"] }], directives: [{ type: i1$3.MatLabel, selector: "mat-label" }, { type: i3$2.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["id", "disabled", "required", "type", "value", "readonly", "placeholder", "errorStateMatcher", "aria-describedby"], exportAs: ["matInput"] }, { type: i4.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: FocusToItemDirective, selector: "[fsFilterFocusTrigger]", inputs: ["fsFilterFocusTrigger", "focusTargetType"] }, { type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
3212
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: DateRangeComponent, decorators: [{
3213
+ type: Component,
3214
+ args: [{
3215
+ selector: 'filter-item-date-range',
3216
+ templateUrl: './date-range.component.html',
3217
+ changeDetection: ChangeDetectionStrategy.OnPush,
3218
+ }]
3219
+ }], ctorParameters: function () { return [{ type: i0.KeyValueDiffers }, { type: i0.ChangeDetectorRef }]; } });
3215
3220
 
3216
- class FilterStatusBarDirective {
3221
+ class WeekComponent extends BaseItemComponent {
3222
+ constructor(_kvDiffers, _cd) {
3223
+ super(_kvDiffers, _cd);
3224
+ this._kvDiffers = _kvDiffers;
3225
+ this._cd = _cd;
3226
+ }
3227
+ ngOnInit() { }
3217
3228
  }
3218
- FilterStatusBarDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FilterStatusBarDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
3219
- FilterStatusBarDirectivedir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: FilterStatusBarDirective, selector: "[fsFilterStatusBar]", ngImport: i0 });
3220
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FilterStatusBarDirective, decorators: [{
3221
- type: Directive,
3229
+ WeekComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: WeekComponent, deps: [{ token: i0.KeyValueDiffers }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
3230
+ WeekComponentcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: WeekComponent, selector: "filter-item-week", usesInheritance: true, ngImport: i0, template: "<mat-form-field>\n <mat-label>{{item.label}}</mat-label>\n <input matInput\n fsDateWeekPicker\n [fsFilterFocusTrigger]=\"item\"\n [(ngModel)]=\"item.model\"\n [seedDate]=\"item.seedDate\"\n [clear]=\"item.clearAllowed\"\n [name]=\"item.name\">\n <mat-placeholder *ngIf=\"inline\">{{ item.label }}</mat-placeholder>\n</mat-form-field>\n", components: [{ type: i1$3.MatFormField, selector: "mat-form-field", inputs: ["color", "floatLabel", "appearance", "hideRequiredMarker", "hintLabel"], exportAs: ["matFormField"] }, { type: i3$3.FsDateWeekPickerComponent, selector: "[fsDateWeekPicker]", inputs: ["minYear", "maxYear", "minDate", "maxDate", "seedDate", "period", "view"], outputs: ["change"] }], directives: [{ type: i1$3.MatLabel, selector: "mat-label" }, { type: i3$2.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["id", "disabled", "required", "type", "value", "readonly", "placeholder", "errorStateMatcher", "aria-describedby"], exportAs: ["matInput"] }, { type: i4.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: FocusToItemDirective, selector: "[fsFilterFocusTrigger]", inputs: ["fsFilterFocusTrigger", "focusTargetType"] }, { type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1$3.MatPlaceholder, selector: "mat-placeholder" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
3231
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: WeekComponent, decorators: [{
3232
+ type: Component,
3222
3233
  args: [{
3223
- selector: '[fsFilterStatusBar]',
3234
+ selector: 'filter-item-week',
3235
+ templateUrl: './week.component.html',
3236
+ changeDetection: ChangeDetectionStrategy.OnPush,
3224
3237
  }]
3225
- }] });
3226
-
3227
- var ActionType;
3228
- (function (ActionType) {
3229
- ActionType["Basic"] = "basic";
3230
- ActionType["Raised"] = "raised";
3231
- ActionType["Icon"] = "icon";
3232
- ActionType["Fab"] = "fab";
3233
- ActionType["MiniFab"] = "mini-fab";
3234
- })(ActionType || (ActionType = {}));
3235
-
3236
- var ActionMode;
3237
- (function (ActionMode) {
3238
- ActionMode["Button"] = "button";
3239
- ActionMode["Menu"] = "menu";
3240
- ActionMode["File"] = "file";
3241
- })(ActionMode || (ActionMode = {}));
3238
+ }], ctorParameters: function () { return [{ type: i0.KeyValueDiffers }, { type: i0.ChangeDetectorRef }]; } });
3242
3239
 
3243
- class ActionMenuItem {
3244
- constructor(config = {}, _parent) {
3245
- this._parent = _parent;
3246
- this.items = [];
3247
- this._isGroup = false;
3248
- this._visible$ = new BehaviorSubject(true);
3249
- this._disabled$ = new BehaviorSubject(false);
3250
- this._init(config);
3240
+ class CheckboxComponent extends BaseItemComponent {
3241
+ constructor(_kvDiffers, _cd) {
3242
+ super(_kvDiffers, _cd);
3243
+ this._kvDiffers = _kvDiffers;
3244
+ this._cd = _cd;
3251
3245
  }
3252
- get isGroup() {
3253
- return this._isGroup;
3246
+ }
3247
+ CheckboxComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: CheckboxComponent, deps: [{ token: i0.KeyValueDiffers }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
3248
+ CheckboxComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: CheckboxComponent, selector: "filter-item-checkbox", usesInheritance: true, ngImport: i0, template: "<fs-label-field>\n <mat-checkbox [(ngModel)]=\"item.model\">\n {{ item.label }}\n </mat-checkbox>\n</fs-label-field>\n", styles: ["fs-label-field{margin:0}\n"], components: [{ type: i1$6.FsLabelFieldComponent, selector: "fs-label-field", inputs: ["bottomMargin", "topMargin", "labelMargin"] }, { type: i4$2.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex", "aria-label", "aria-labelledby", "id", "labelPosition", "name", "required", "checked", "disabled", "indeterminate", "aria-describedby", "value"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }], directives: [{ type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
3249
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: CheckboxComponent, decorators: [{
3250
+ type: Component,
3251
+ args: [{
3252
+ selector: 'filter-item-checkbox',
3253
+ templateUrl: './checkbox.component.html',
3254
+ styleUrls: ['checkbox.component.scss'],
3255
+ changeDetection: ChangeDetectionStrategy.OnPush,
3256
+ }]
3257
+ }], ctorParameters: function () { return [{ type: i0.KeyValueDiffers }, { type: i0.ChangeDetectorRef }]; } });
3258
+
3259
+ class FilterItemComponent {
3260
+ constructor(_cdRef) {
3261
+ this._cdRef = _cdRef;
3262
+ this._destroy$ = new Subject();
3263
+ this.itemType = ItemType;
3254
3264
  }
3255
- get visible() {
3256
- return this._visible$.getValue();
3265
+ get textItem() {
3266
+ return this.item;
3257
3267
  }
3258
- get visible$() {
3259
- return this._visible$.asObservable();
3268
+ get chipsItem() {
3269
+ return this.item;
3260
3270
  }
3261
- set disabled(value) {
3262
- this._disabled$.next(value);
3271
+ get baseSelectItem() {
3272
+ return this.item;
3263
3273
  }
3264
- get disabled() {
3265
- return this._disabled$.getValue();
3274
+ get rangeItem() {
3275
+ return this.item;
3266
3276
  }
3267
- get disabled$() {
3268
- return this._disabled$.asObservable();
3277
+ get autocompleteItem() {
3278
+ return this.item;
3269
3279
  }
3270
- updateVisibility() {
3271
- const visible = !!this._showFn ? this._showFn() : true;
3272
- if (!visible || !this.isGroup) {
3273
- this._visible$.next(visible);
3274
- return;
3275
- }
3276
- const numberOfVisibleChildren = this.items
3277
- .reduce((acc, item) => {
3278
- item.updateVisibility();
3279
- if (item.visible) {
3280
- acc++;
3281
- }
3282
- return acc;
3283
- }, 0);
3284
- this._visible$.next(!!numberOfVisibleChildren);
3280
+ get autocompleteChipsItem() {
3281
+ return this.item;
3285
3282
  }
3286
- _init(config) {
3287
- this.label = config.label;
3288
- this.icon = config.icon;
3289
- this._showFn = config.show;
3290
- if ('items' in config) {
3291
- this._isGroup = true;
3292
- if (Array.isArray(config.items)) {
3293
- this.items = config
3294
- .items
3295
- .map((item) => new ActionMenuItem(item, this));
3296
- }
3297
- this.updateVisibility();
3298
- }
3299
- else {
3300
- this.click = config.click;
3301
- this.routerLink = config.link;
3302
- if (!this._parent) {
3303
- this.updateVisibility();
3304
- }
3305
- }
3283
+ get dateItem() {
3284
+ return this.item;
3306
3285
  }
3307
- }
3308
-
3309
- class Action {
3310
- constructor(config = {}) {
3311
- this.primary = true;
3312
- this.isReorderAction = false;
3313
- this.classArray = [];
3314
- this.items = [];
3315
- this._visible$ = new BehaviorSubject(true);
3316
- this._disabled$ = new BehaviorSubject(false);
3317
- this._init(config);
3286
+ get dateRangeItem() {
3287
+ return this.item;
3318
3288
  }
3319
- get visible() {
3320
- return this._visible$.getValue();
3289
+ get dateTimeItem() {
3290
+ return this.item;
3321
3291
  }
3322
- get visible$() {
3323
- return this._visible$.asObservable();
3292
+ get dateTimeRangeItem() {
3293
+ return this.item;
3324
3294
  }
3325
- set disabled(value) {
3326
- this._disabled$.next(value);
3295
+ get weekItem() {
3296
+ return this.item;
3327
3297
  }
3328
- get disabled() {
3329
- return this._disabled$.getValue();
3298
+ get checkboxItem() {
3299
+ return this.item;
3330
3300
  }
3331
- get disabled$() {
3332
- return this._disabled$.asObservable();
3301
+ ngOnInit() {
3302
+ this.item.value$
3303
+ .pipe(takeUntil(this._destroy$))
3304
+ .subscribe(() => {
3305
+ this._cdRef.markForCheck();
3306
+ });
3333
3307
  }
3334
- updateVisibility() {
3335
- const visible = !!this._showFn ? this._showFn() : true;
3336
- if (!visible || this.mode !== ActionMode.Menu) {
3337
- this._visible$.next(visible);
3338
- return;
3339
- }
3340
- const hasVisibleChildren = this.items.some((item) => item.visible);
3341
- this._visible$.next(hasVisibleChildren);
3308
+ ngOnDestroy() {
3309
+ this._destroy$.next();
3310
+ this._destroy$.complete();
3342
3311
  }
3343
- updateDisabledState() {
3344
- if (this._disabledFn) {
3345
- this.disabled = this._disabledFn();
3346
- }
3312
+ }
3313
+ FilterItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FilterItemComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
3314
+ FilterItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FilterItemComponent, selector: "filter-item", inputs: { item: "item" }, ngImport: i0, 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.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i3.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
3315
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FilterItemComponent, decorators: [{
3316
+ type: Component,
3317
+ args: [{
3318
+ selector: 'filter-item',
3319
+ templateUrl: './filter-item.component.html',
3320
+ changeDetection: ChangeDetectionStrategy.OnPush,
3321
+ }]
3322
+ }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { item: [{
3323
+ type: Input
3324
+ }] } });
3325
+
3326
+ class FsFilterDrawerActionsComponent {
3327
+ constructor(externalParams) {
3328
+ this.externalParams = externalParams;
3329
+ this._clear = new EventEmitter();
3330
+ this._done = new EventEmitter();
3347
3331
  }
3348
- _init(config) {
3349
- var _a, _b, _c, _d, _e, _f;
3350
- config.mode = (_a = config.mode) !== null && _a !== void 0 ? _a : ActionMode.Button;
3351
- this.primary = (_b = config.primary) !== null && _b !== void 0 ? _b : true;
3352
- this.color = config.color;
3353
- this.type = (_c = config.type) !== null && _c !== void 0 ? _c : ActionType.Raised;
3354
- this.tooltip = config.tooltip;
3355
- this.label = config.label;
3356
- this.mode = config.mode;
3357
- this.icon = config.icon;
3358
- this.iconPlacement = config.iconPlacement;
3359
- this._showFn = config.show;
3360
- this.tabIndex = (_d = config.tabIndex) !== null && _d !== void 0 ? _d : 0;
3361
- this.menu = config.menu;
3362
- if (config.multiple !== undefined) {
3363
- this.multiple = config.multiple;
3364
- }
3365
- if (config.className) {
3366
- this.className = config.className;
3367
- this.classArray = this.className
3368
- .split(' ');
3369
- }
3370
- if (this.primary) {
3371
- this.color = 'primary';
3372
- }
3373
- switch (config.mode) {
3374
- case ActionMode.Button:
3375
- {
3376
- this.customize = config.customize;
3377
- this.click = (_e = config.click) !== null && _e !== void 0 ? _e : (() => { });
3378
- this._disabledFn = config.disabled;
3379
- this.updateDisabledState();
3380
- }
3381
- break;
3382
- case ActionMode.Menu:
3383
- {
3384
- if (config.items && Array.isArray(config.items)) {
3385
- this.items = config.items.map((item) => new ActionMenuItem(item));
3386
- }
3387
- }
3388
- break;
3389
- case ActionMode.File:
3390
- {
3391
- this.fileSelected = config.select;
3392
- this.fileError = config.error;
3393
- this.accept = config.accept;
3394
- this.imageQuality = config.imageQuality;
3395
- this.minWidth = config.minWidth;
3396
- this.minHeight = config.minHeight;
3397
- this.maxWidth = config.maxWidth;
3398
- this.maxHeight = config.maxHeight;
3399
- this.click = (_f = config.click) !== null && _f !== void 0 ? _f : (() => { });
3400
- this._disabledFn = config.disabled;
3401
- this.updateDisabledState();
3402
- }
3403
- break;
3404
- }
3405
- this.updateVisibility();
3332
+ get savedFilters() {
3333
+ return this.externalParams.savedFiltersController;
3406
3334
  }
3407
- }
3408
-
3409
- class ActionsController {
3410
- constructor(_breakpointObserver) {
3411
- this._breakpointObserver = _breakpointObserver;
3412
- this._visible$ = new BehaviorSubject(false);
3413
- this._actions$ = new BehaviorSubject([]);
3414
- this._menuActions$ = new BehaviorSubject([]);
3415
- this._destroy$ = new Subject();
3416
- this._mobileMedia = '(max-width: 799px)';
3417
- this._allActions = [];
3418
- this._listenMobileMedia();
3335
+ done() {
3336
+ this._done.emit();
3419
3337
  }
3420
- get menuActions() {
3421
- return this._menuActions$.value;
3338
+ clear() {
3339
+ this._clear.emit();
3422
3340
  }
3423
- get actions() {
3424
- return this._actions$.value;
3341
+ saveFilters() {
3342
+ this.externalParams
3343
+ .savedFiltersController
3344
+ .openSavedFilterEditDialog();
3425
3345
  }
3426
- get actions$() {
3427
- return this._actions$.asObservable();
3346
+ }
3347
+ FsFilterDrawerActionsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsFilterDrawerActionsComponent, deps: [{ token: ExternalParamsController }], target: i0.ɵɵFactoryTarget.Component });
3348
+ FsFilterDrawerActionsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FsFilterDrawerActionsComponent, selector: "fs-filter-drawer-actions", outputs: { _clear: "clear", _done: "done" }, ngImport: i0, template: "<button type=\"button\" mat-button color=\"primary\" (click)=\"done()\">Done</button>\n<button type=\"button\" mat-button (click)=\"clear()\">Clear</button>\n<ng-container *ngIf=\"savedFilters.enabled$ | async\">\n <button type=\"button\" mat-button (click)=\"saveFilters()\">Save</button>\n</ng-container>\n\n", components: [{ type: i1$4.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }], directives: [{ type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "async": i3.AsyncPipe } });
3349
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsFilterDrawerActionsComponent, decorators: [{
3350
+ type: Component,
3351
+ args: [{
3352
+ selector: 'fs-filter-drawer-actions',
3353
+ templateUrl: './filter-drawer-actions.component.html',
3354
+ }]
3355
+ }], ctorParameters: function () { return [{ type: ExternalParamsController }]; }, propDecorators: { _clear: [{
3356
+ type: Output,
3357
+ args: ['clear']
3358
+ }], _done: [{
3359
+ type: Output,
3360
+ args: ['done']
3361
+ }] } });
3362
+
3363
+ class FilterDrawerComponent {
3364
+ constructor(externalParams, _cd, _itemsStore, overlayRef, data) {
3365
+ this.externalParams = externalParams;
3366
+ this._cd = _cd;
3367
+ this._itemsStore = _itemsStore;
3368
+ this.overlayRef = overlayRef;
3369
+ this.data = data;
3370
+ this.inline = false;
3371
+ this.windowDesktop = false;
3372
+ this._itemsStore.prepareItems();
3373
+ this._clear = data.clear;
3374
+ this._done = data.done;
3375
+ this.updateWindowWidth();
3428
3376
  }
3429
- get menuActions$() {
3430
- return this._menuActions$.asObservable();
3377
+ updateWindowWidth() {
3378
+ this.windowDesktop = window.innerWidth > 1200;
3431
3379
  }
3432
- get visible$() {
3433
- return this._visible$.asObservable();
3380
+ get items$() {
3381
+ return this._itemsStore.visibleItems$;
3434
3382
  }
3435
- get mobileMode() {
3436
- return this._breakpointObserver.isMatched(this._mobileMedia);
3383
+ get sortItem() {
3384
+ return this._itemsStore.sortByItem;
3437
3385
  }
3438
- ngOnDestroy() {
3439
- this._destroy$.next();
3440
- this._destroy$.complete();
3386
+ get sortDirectionItem() {
3387
+ return this._itemsStore.sortDirectionItem;
3441
3388
  }
3442
- initActions(rawActions) {
3443
- if (!rawActions || !Array.isArray(rawActions)) {
3444
- return;
3445
- }
3446
- this.show();
3447
- this._allActions = rawActions
3448
- .map((action) => new Action(action));
3449
- if (this._reorderAction) {
3450
- this._allActions.unshift(this._reorderAction);
3451
- }
3452
- this._classifyActions();
3389
+ clear() {
3390
+ this._clear();
3391
+ // this.overlayRef.detach();
3453
3392
  }
3454
- show() {
3455
- this._visible$.next(true);
3393
+ done() {
3394
+ this._done();
3395
+ this.overlayRef.detach();
3456
3396
  }
3457
- hide() {
3458
- this._visible$.next(false);
3397
+ backdropClick() {
3398
+ this.done();
3459
3399
  }
3460
- addReorderAction(action) {
3461
- this._allActions.unshift(action);
3462
- action.isReorderAction = true;
3463
- this._classifyAction(action);
3464
- this._reorderAction = action;
3400
+ }
3401
+ FilterDrawerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FilterDrawerComponent, deps: [{ token: ExternalParamsController }, { token: i0.ChangeDetectorRef }, { token: FsFilterItemsStore }, { token: FILTER_DRAWER_OVERLAY }, { token: FILTER_DRAWER_DATA }], target: i0.ɵɵFactoryTarget.Component });
3402
+ FilterDrawerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FilterDrawerComponent, selector: "ng-component", inputs: { inline: "inline" }, host: { listeners: { "window:resize": "updateWindowWidth()" } }, ngImport: i0, 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 *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 class=\"filter-group sort\"\n [item]=\"sortItem\">\n </filter-item>\n <filter-item 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 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$2.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$1.FsSkeletonContentDirective, selector: "[fsSkeleton]", inputs: ["fsSkeleton", "fsSkeletonPattern"] }, { type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "async": i3.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
3403
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FilterDrawerComponent, decorators: [{
3404
+ type: Component,
3405
+ args: [{
3406
+ templateUrl: './filter-drawer.component.html',
3407
+ styleUrls: ['filter-drawer.component.scss'],
3408
+ // Commented out because filter items are not updating with a delayed observable. Need to figure this out.
3409
+ changeDetection: ChangeDetectionStrategy.OnPush,
3410
+ }]
3411
+ }], ctorParameters: function () { return [{ type: ExternalParamsController }, { type: i0.ChangeDetectorRef }, { type: FsFilterItemsStore }, { type: i1$7.OverlayRef, decorators: [{
3412
+ type: Inject,
3413
+ args: [FILTER_DRAWER_OVERLAY]
3414
+ }] }, { type: undefined, decorators: [{
3415
+ type: Inject,
3416
+ args: [FILTER_DRAWER_DATA]
3417
+ }] }]; }, propDecorators: { updateWindowWidth: [{
3418
+ type: HostListener,
3419
+ args: ['window:resize']
3420
+ }], inline: [{
3421
+ type: Input
3422
+ }] } });
3423
+
3424
+ const FS_FILTER_META = new InjectionToken('fs.filter.meta', {
3425
+ providedIn: 'root',
3426
+ factory: () => {
3427
+ return {
3428
+ openedFilters: 0,
3429
+ };
3465
3430
  }
3466
- clearActions() {
3467
- this._allActions = [];
3468
- this._setActions([]);
3469
- this._setKebabActions([]);
3431
+ });
3432
+
3433
+ class FsFilterOverlayService {
3434
+ constructor(_injector, _filterMeta, _overlay, _focusController) {
3435
+ this._injector = _injector;
3436
+ this._filterMeta = _filterMeta;
3437
+ this._overlay = _overlay;
3438
+ this._focusController = _focusController;
3439
+ this.detach$ = new Subject();
3440
+ this.attach$ = new Subject();
3441
+ this._destroy$ = new Subject();
3442
+ this._openWhenChipClicked();
3470
3443
  }
3471
- updateActionsVisibility() {
3472
- this._allActions.forEach((action) => action.updateVisibility());
3473
- this._classifyActions();
3444
+ get isOpened() {
3445
+ return !!this._overlayRef;
3474
3446
  }
3475
- updateDisabledState() {
3476
- this.actions.forEach((action) => action.updateDisabledState());
3447
+ setClearFn(fn) {
3448
+ this._clearFn = fn;
3477
3449
  }
3478
- _setKebabActions(actions) {
3479
- this._menuActions$.next(actions);
3450
+ setDoneFn(fn) {
3451
+ this._doneFn = fn;
3480
3452
  }
3481
- _setActions(actions) {
3482
- this._actions$.next(actions);
3453
+ close() {
3454
+ if (this._overlayRef) {
3455
+ this._overlayRef.detach();
3456
+ this._overlayRef = null;
3457
+ this.removeFilterClass();
3458
+ }
3483
3459
  }
3484
- _classifyActions() {
3485
- const kebabActions = [];
3486
- const actions = [];
3487
- const mobileMode = this.mobileMode;
3488
- this._allActions
3489
- .filter((action) => {
3490
- return action.visible;
3491
- })
3492
- .forEach((action) => {
3493
- if (action.menu !== false && (action.menu || mobileMode)) {
3494
- kebabActions.push(action);
3495
- }
3496
- else {
3497
- actions.push(action);
3498
- }
3460
+ open() {
3461
+ this._overlayRef = this._createOverlay();
3462
+ this._overlayRef.backdropClick()
3463
+ .pipe(takeUntil(this._destroy$))
3464
+ .subscribe(() => {
3465
+ this._overlayRef.detach();
3499
3466
  });
3500
- this._setKebabActions(kebabActions);
3501
- this._setActions(actions);
3467
+ this._overlayRef.detachments()
3468
+ .pipe(takeUntil(this._destroy$))
3469
+ .subscribe(() => {
3470
+ this.detach$.next();
3471
+ });
3472
+ this._overlayRef.attachments()
3473
+ .pipe(takeUntil(this._destroy$))
3474
+ .subscribe(() => {
3475
+ this.attach$.next();
3476
+ });
3477
+ this.addFilterClass();
3478
+ return this.openPortalPreview();
3502
3479
  }
3503
- _classifyAction(action) {
3504
- if (action.menu) {
3505
- this._setKebabActions([...this.menuActions, action]);
3480
+ ngOnDestroy() {
3481
+ this._destroy$.next();
3482
+ this._destroy$.complete();
3483
+ }
3484
+ _createOverlay() {
3485
+ const overlayConfig = new OverlayConfig({
3486
+ hasBackdrop: true,
3487
+ backdropClass: 'fs-filter-backdrop'
3488
+ });
3489
+ return this._overlay.create(overlayConfig);
3490
+ }
3491
+ openPortalPreview() {
3492
+ const data = { done: this._doneFn, clear: this._clearFn };
3493
+ const injector = this._createInjector(this._injector, data, this._overlayRef);
3494
+ const containerPortal = new ComponentPortal(FilterDrawerComponent, undefined, injector);
3495
+ const containerRef = this._overlayRef.attach(containerPortal);
3496
+ return containerRef.instance;
3497
+ }
3498
+ _createInjector(parentInjector, data, overlayRef) {
3499
+ const injectionTokens = new WeakMap([
3500
+ [FILTER_DRAWER_DATA, data],
3501
+ [FILTER_DRAWER_OVERLAY, overlayRef],
3502
+ ]);
3503
+ return new PortalInjector(parentInjector, injectionTokens);
3504
+ }
3505
+ removeFilterClass() {
3506
+ this._filterMeta.openedFilters--;
3507
+ if (this._filterMeta.openedFilters === 0) {
3508
+ window.document.body.classList.remove('fs-filter-open');
3506
3509
  }
3507
- else {
3508
- this._setActions([...this.actions, action]);
3510
+ }
3511
+ addFilterClass() {
3512
+ this._filterMeta.openedFilters++;
3513
+ if (this._filterMeta.openedFilters === 1) {
3514
+ window.document.body.classList.add('fs-filter-open');
3509
3515
  }
3510
3516
  }
3511
- _listenMobileMedia() {
3512
- this._breakpointObserver.observe(this._mobileMedia)
3513
- .pipe(skip(1), takeUntil(this._destroy$))
3517
+ _openWhenChipClicked() {
3518
+ this._focusController.focusOn$
3519
+ .pipe(filter$1((v) => !!v), takeUntil(this._destroy$))
3514
3520
  .subscribe(() => {
3515
- this._classifyActions();
3521
+ if (!this.isOpened) {
3522
+ this.open();
3523
+ }
3516
3524
  });
3517
3525
  }
3518
3526
  }
3519
- ActionsController.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ActionsController, deps: [{ token: i1$7.BreakpointObserver }], target: i0.ɵɵFactoryTarget.Injectable });
3520
- ActionsController.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ActionsController });
3521
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ActionsController, decorators: [{
3527
+ FsFilterOverlayService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsFilterOverlayService, deps: [{ token: i0.Injector }, { token: FS_FILTER_META }, { token: i1$7.Overlay }, { token: FocusControllerService }], target: i0.ɵɵFactoryTarget.Injectable });
3528
+ FsFilterOverlayService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsFilterOverlayService });
3529
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsFilterOverlayService, decorators: [{
3522
3530
  type: Injectable
3523
- }], ctorParameters: function () { return [{ type: i1$7.BreakpointObserver }]; } });
3531
+ }], ctorParameters: function () { return [{ type: i0.Injector }, { type: undefined, decorators: [{
3532
+ type: Inject,
3533
+ args: [FS_FILTER_META]
3534
+ }] }, { type: i1$7.Overlay }, { type: FocusControllerService }]; } });
3535
+
3536
+ class FilterStatusBarDirective {
3537
+ }
3538
+ FilterStatusBarDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FilterStatusBarDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
3539
+ FilterStatusBarDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: FilterStatusBarDirective, selector: "[fsFilterStatusBar]", ngImport: i0 });
3540
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FilterStatusBarDirective, decorators: [{
3541
+ type: Directive,
3542
+ args: [{
3543
+ selector: '[fsFilterStatusBar]',
3544
+ }]
3545
+ }] });
3524
3546
 
3525
3547
  class FsFilterActionButtonComponent {
3548
+ constructor() {
3549
+ this.ActionType = ActionType;
3550
+ }
3526
3551
  }
3527
3552
  FsFilterActionButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsFilterActionButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
3528
- FsFilterActionButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FsFilterActionButtonComponent, selector: "fs-filter-action-button", inputs: { action: "action" }, host: { classAttribute: "action-button" }, ngImport: i0, template: "<ng-container [ngSwitch]=\"action.type\">\n <!-- Basic button -->\n <button \n type=\"button\"\n *ngSwitchCase=\"'basic'\"\n mat-button\n (click)=\"action.click && action.click($event)\"\n [color]=\"action.color\"\n [ngClass]=\"action.classArray\"\n [disabled]=\"action.disabled$ | async\"\n [tabIndex]=\"action.tabIndex\">\n <ng-template [ngTemplateOutlet]=\"buttonContent\"></ng-template>\n </button>\n\n <!-- Raised button -->\n <button \n type=\"button\"\n *ngSwitchDefault\n mat-raised-button\n (click)=\"action.click && action.click($event)\"\n [color]=\"action.color\"\n [ngClass]=\"action.classArray\"\n [disabled]=\"action.disabled$ | async\"\n [tabIndex]=\"action.tabIndex\">\n <ng-template [ngTemplateOutlet]=\"buttonContent\"></ng-template>\n </button>\n\n <!-- Icon button -->\n <button\n type=\"button\"\n *ngSwitchCase=\"'icon'\"\n mat-icon-button\n (click)=\"action.click && action.click($event)\"\n [color]=\"action.color\"\n [ngClass]=\"action.classArray\"\n [disabled]=\"action.disabled$ | async\"\n [tabIndex]=\"action.tabIndex\">\n <ng-template [ngTemplateOutlet]=\"buttonContent\"></ng-template>\n </button>\n\n <!-- Fab button -->\n <button \n type=\"button\"\n *ngSwitchCase=\"'fab'\"\n mat-fab\n (click)=\"action.click && action.click($event)\"\n [color]=\"action.color\"\n [ngClass]=\"action.classArray\"\n [disabled]=\"action.disabled$ | async\"\n [tabIndex]=\"action.tabIndex\">\n <ng-template [ngTemplateOutlet]=\"buttonContent\"></ng-template>\n </button>\n\n <!-- Mini Fab button -->\n <button \n type=\"button\"\n *ngSwitchCase=\"'mini-fab'\"\n mat-mini-fab\n (click)=\"action.click && action.click($event)\"\n [color]=\"action.color\"\n [ngClass]=\"action.classArray\"\n [disabled]=\"action.disabled$ | async\"\n [tabIndex]=\"action.tabIndex\">\n <ng-template [ngTemplateOutlet]=\"buttonContent\"></ng-template>\n </button>\n\n <ng-template #buttonContent>\n <ng-container *ngIf=\"!action.icon else withIcon\">\n {{action.label}}\n </ng-container>\n\n <ng-template #withIcon>\n <mat-icon *ngIf=\"!action.iconPlacement || action.iconPlacement === 'left'\">{{action.icon}}</mat-icon>\n {{action.label}}\n <mat-icon *ngIf=\"action.iconPlacement === 'right'\">{{action.icon}}</mat-icon>\n </ng-template>\n </ng-template>\n</ng-container>\n", components: [{ type: i1$4.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { type: i2$2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }], directives: [{ type: i3.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i3.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i3.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i3.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "async": i3.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
3553
+ FsFilterActionButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FsFilterActionButtonComponent, selector: "fs-filter-action-button", inputs: { action: "action" }, host: { classAttribute: "action-button" }, ngImport: i0, template: "<ng-container [ngSwitch]=\"action.type\">\n <button\n type=\"button\"\n *ngSwitchCase=\"ActionType.Icon\"\n mat-icon-button\n (click)=\"action.click && action.click($event)\"\n [color]=\"action.color\"\n [ngClass]=\"action.classArray\"\n [disabled]=\"action.disabled$ | async\"\n [tabIndex]=\"action.tabIndex\">\n <ng-template [ngTemplateOutlet]=\"buttonContent\"></ng-template>\n </button>\n\n <!-- Fab button -->\n <button \n type=\"button\"\n *ngSwitchCase=\"ActionType.Fab\"\n mat-fab\n (click)=\"action.click && action.click($event)\"\n [color]=\"action.color\"\n [ngClass]=\"action.classArray\"\n [disabled]=\"action.disabled$ | async\"\n [tabIndex]=\"action.tabIndex\">\n <ng-template [ngTemplateOutlet]=\"buttonContent\"></ng-template>\n </button>\n\n <!-- Mini Fab button -->\n <button \n type=\"button\"\n *ngSwitchCase=\"ActionType.MiniFab\"\n mat-mini-fab\n (click)=\"action.click && action.click($event)\"\n [color]=\"action.color\"\n [ngClass]=\"action.classArray\"\n [disabled]=\"action.disabled$ | async\"\n [tabIndex]=\"action.tabIndex\">\n <ng-template [ngTemplateOutlet]=\"buttonContent\"></ng-template>\n </button>\n\n <button \n type=\"button\"\n *ngSwitchDefault\n mat-button\n [ngClass]=\"{ \n 'mat-raised-button': action.type === 'raised',\n 'mat-flat-button': action.type === 'flat',\n 'mat-stroked-button': action.type === 'stroked',\n 'mat-button': action.type === 'basic',\n 'mat-icon-button': action.type === 'icon'\n }\"\n (click)=\"action.click && action.click($event)\"\n [color]=\"action.color\"\n [class]=\"action.classArray.join(' ')\"\n [disabled]=\"action.disabled$ | async\"\n [tabIndex]=\"action.tabIndex\">\n <ng-template [ngTemplateOutlet]=\"buttonContent\"></ng-template>\n </button>\n\n <ng-template #buttonContent>\n <ng-container *ngIf=\"!action.icon else withIcon\">\n {{action.label}}\n </ng-container>\n\n <ng-template #withIcon>\n <mat-icon *ngIf=\"!action.iconPlacement || action.iconPlacement === 'left'\">{{action.icon}}</mat-icon>\n {{action.label}}\n <mat-icon *ngIf=\"action.iconPlacement === 'right'\">{{action.icon}}</mat-icon>\n </ng-template>\n </ng-template>\n</ng-container>\n", components: [{ type: i1$4.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { type: i2$2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }], directives: [{ type: i3.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i3.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i3.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i3.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "async": i3.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
3529
3554
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsFilterActionButtonComponent, decorators: [{
3530
3555
  type: Component,
3531
3556
  args: [{
@@ -3563,7 +3588,7 @@ class FsFilterActionsComponent {
3563
3588
  }
3564
3589
  }
3565
3590
  FsFilterActionsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsFilterActionsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
3566
- FsFilterActionsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FsFilterActionsComponent, selector: "fs-filter-actions", inputs: { kebabActions: "kebabActions", actions: "actions" }, ngImport: i0, template: "<!-- Buttons -->\n<ng-container *ngFor=\"let action of actions\">\n <ng-container [ngSwitch]=\"action.mode\">\n <ng-container *ngSwitchCase=\"'button'\">\n <fs-filter-action-button\n [action]=\"action\"\n fsPopover\n [enabled]=\"!!action.tooltip\"\n [text]=\"action.tooltip\">\n </fs-filter-action-button>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'menu'\">\n <fs-filter-action-button\n [action]=\"action\"\n [fsMenuTriggerFor]=\"someRef\"\n fsPopover\n [enabled]=\"!!action.tooltip\"\n [text]=\"action.tooltip\">\n </fs-filter-action-button>\n\n <fs-menu #someRef>\n <ng-container *ngFor=\"let childAction of action.items\">\n <ng-container *ngIf=\"childAction.isGroup else simpleMenuItem\">\n <fs-menu-group [label]=\"childAction.label\">\n <ng-container *ngFor=\"let subAction of childAction.items\">\n <ng-template\n fs-menu-item\n [link]=\"subAction.routerLink?.link\"\n [queryParams]=\"subAction.routerLink?.queryParams\"\n [hidden]=\"!(subAction.visible$ | async)\"\n (click)=\"subAction.click($event)\">\n <mat-icon *ngIf=\"subAction.icon\">{{subAction.icon}}</mat-icon>\n {{subAction.label}}\n </ng-template>\n </ng-container>\n </fs-menu-group>\n </ng-container>\n <ng-template #simpleMenuItem>\n <ng-template\n fs-menu-item\n [link]=\"childAction.routerLink?.link\"\n [queryParams]=\"childAction.routerLink?.queryParams\"\n [hidden]=\"!(childAction.visible$ | async)\"\n (click)=\"childAction.click($event);\">\n <mat-icon *ngIf=\"childAction.icon\">{{childAction.icon}}</mat-icon>\n {{childAction.label}}\n </ng-template>\n </ng-template>\n </ng-container>\n </fs-menu>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'file'\">\n <fs-file\n class=\"action-button\"\n [accept]=\"action.accept || '*'\"\n [multiple]=\"action.multiple\"\n [minWidth]=\"action.minWidth\"\n [minHeight]=\"action.minHeight\"\n [imageWidth]=\"action.maxWidth\"\n [imageHeight]=\"action.maxHeight\"\n (select)=\"action.fileSelected($event)\"\n (error)=\"action.fileError($event)\"\n (clicked)=\"action.click($event)\"\n fsPopover\n [enabled]=\"!!action.tooltip\"\n [text]=\"action.tooltip\">\n <fs-filter-action-button [action]=\"action\"></fs-filter-action-button>\n </fs-file>\n </ng-container>\n </ng-container>\n</ng-container>\n<!-- /Buttons -->\n\n<!-- menu -->\n<ng-container *ngIf=\"kebabActions?.length\">\n <fs-filter-action-kebab-actions\n [kebabActions]=\"kebabActions\">\n </fs-filter-action-kebab-actions>\n</ng-container>\n", styles: [":host{display:inline-flex}.action-button{display:block}.action-button+.action-button,fs-menu+.action-button{margin-left:5px}.menu-button{width:36px;height:36px;line-height:36px}\n"], components: [{ type: FsFilterActionButtonComponent, selector: "fs-filter-action-button", inputs: ["action"] }, { type: i3$4.FsMenuComponent, selector: "fs-menu", inputs: ["class", "buttonClass"], outputs: ["opened", "closed"] }, { type: i2$2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: i4$3.FsFileComponent, selector: "fs-file", inputs: ["minHeight", "minWidth", "multiple", "capture", "allowClick", "allowDrop", "accept", "disabled", "imageWidth", "imageHeight", "imageQuality"], outputs: ["select", "error", "clicked", "declined"] }, { type: FsFilterActionKebabActionsComponent, selector: "fs-filter-action-kebab-actions", inputs: ["kebabActions"] }], directives: [{ type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i3.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i3.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i7$1.FsPopoverDirective, selector: "[fsPopover]", inputs: ["text", "template", "data", "leaveDelay", "showDelay", "maxWidth", "wrapperClass", "autoShow", "autoClose", "loadingDiameter", "loading", "indication", "position", "theme", "size", "trigger", "enabled"] }, { type: i3$4.FsMenuTriggerDirective, selector: "[fsMenuTriggerFor]", inputs: ["fsMenuTriggerFor"] }, { type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3$4.FsMenuItemDirective, selector: "fs-menu-group,[fs-menu-item]" }], pipes: { "async": i3.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
3591
+ FsFilterActionsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FsFilterActionsComponent, selector: "fs-filter-actions", inputs: { kebabActions: "kebabActions", actions: "actions" }, ngImport: i0, template: "<!-- Buttons -->\n<ng-container *ngFor=\"let action of actions\">\n <ng-container [ngSwitch]=\"action.mode\">\n <ng-container *ngSwitchCase=\"'button'\">\n <fs-filter-action-button\n [action]=\"action\"\n fsPopover\n [enabled]=\"!!action.tooltip\"\n [text]=\"action.tooltip\">\n </fs-filter-action-button>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'menu'\">\n <fs-filter-action-button\n [action]=\"action\"\n [fsMenuTriggerFor]=\"someRef\"\n fsPopover\n [enabled]=\"!!action.tooltip\"\n [text]=\"action.tooltip\">\n </fs-filter-action-button>\n\n <fs-menu #someRef>\n <ng-container *ngFor=\"let childAction of action.items\">\n <ng-container *ngIf=\"childAction.isGroup else simpleMenuItem\">\n <fs-menu-group [label]=\"childAction.label\">\n <ng-container *ngFor=\"let subAction of childAction.items\">\n <ng-template\n fs-menu-item\n [link]=\"subAction.routerLink?.link\"\n [queryParams]=\"subAction.routerLink?.queryParams\"\n [hidden]=\"!(subAction.visible$ | async)\"\n (click)=\"subAction.click($event)\">\n <mat-icon *ngIf=\"subAction.icon\">{{subAction.icon}}</mat-icon>\n {{subAction.label}}\n </ng-template>\n </ng-container>\n </fs-menu-group>\n </ng-container>\n <ng-template #simpleMenuItem>\n <ng-template\n fs-menu-item\n [link]=\"childAction.routerLink?.link\"\n [queryParams]=\"childAction.routerLink?.queryParams\"\n [hidden]=\"!(childAction.visible$ | async)\"\n (click)=\"childAction.click($event);\">\n <mat-icon *ngIf=\"childAction.icon\">{{childAction.icon}}</mat-icon>\n {{childAction.label}}\n </ng-template>\n </ng-template>\n </ng-container>\n </fs-menu>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'file'\">\n <fs-file\n class=\"action-button\"\n [accept]=\"action.accept || '*'\"\n [multiple]=\"action.multiple\"\n [minWidth]=\"action.minWidth\"\n [minHeight]=\"action.minHeight\"\n [imageWidth]=\"action.maxWidth\"\n [imageHeight]=\"action.maxHeight\"\n (select)=\"action.fileSelected($event)\"\n (error)=\"action.fileError($event)\"\n (clicked)=\"action.click($event)\"\n fsPopover\n [enabled]=\"!!action.tooltip\"\n [text]=\"action.tooltip\">\n <fs-filter-action-button \n [action]=\"action\">\n </fs-filter-action-button>\n </fs-file>\n </ng-container>\n </ng-container>\n</ng-container>\n<!-- /Buttons -->\n<!-- menu -->\n<ng-container *ngIf=\"kebabActions?.length\">\n <fs-filter-action-kebab-actions\n [kebabActions]=\"kebabActions\">\n </fs-filter-action-kebab-actions>\n</ng-container>\n", styles: [":host{display:inline-flex}.action-button{display:block}.action-button+.action-button,fs-menu+.action-button{margin-left:5px}.menu-button{width:36px;height:36px;line-height:36px}\n"], components: [{ type: FsFilterActionButtonComponent, selector: "fs-filter-action-button", inputs: ["action"] }, { type: i3$4.FsMenuComponent, selector: "fs-menu", inputs: ["class", "buttonClass"], outputs: ["opened", "closed"] }, { type: i2$2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: i4$3.FsFileComponent, selector: "fs-file", inputs: ["minHeight", "minWidth", "multiple", "capture", "allowClick", "allowDrop", "accept", "disabled", "imageWidth", "imageHeight", "imageQuality"], outputs: ["select", "error", "clicked", "declined"] }, { type: FsFilterActionKebabActionsComponent, selector: "fs-filter-action-kebab-actions", inputs: ["kebabActions"] }], directives: [{ type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i3.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i3.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i7$1.FsPopoverDirective, selector: "[fsPopover]", inputs: ["text", "template", "data", "leaveDelay", "showDelay", "maxWidth", "wrapperClass", "autoShow", "autoClose", "loadingDiameter", "loading", "indication", "position", "theme", "size", "trigger", "enabled"] }, { type: i3$4.FsMenuTriggerDirective, selector: "[fsMenuTriggerFor]", inputs: ["fsMenuTriggerFor"] }, { type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3$4.FsMenuItemDirective, selector: "fs-menu-group,[fs-menu-item]" }], pipes: { "async": i3.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
3567
3592
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsFilterActionsComponent, decorators: [{
3568
3593
  type: Component,
3569
3594
  args: [{
@@ -4161,7 +4186,7 @@ class FilterComponent {
4161
4186
  }
4162
4187
  config = Object.assign(Object.assign({}, (this._defaultConfig || {})), config);
4163
4188
  this._config = new FsFilterConfig(config);
4164
- this._actions.initActions(this._config.actions);
4189
+ this._actions.setConfig(this._config);
4165
4190
  this._filterItems.setConfig(this._config);
4166
4191
  this._externalParams.setConfig(this._config);
4167
4192
  this._syncSearchInputWithKeyword();
@@ -4288,7 +4313,7 @@ FilterComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", versio
4288
4313
  FsFilterItemsStore,
4289
4314
  SavedFiltersController,
4290
4315
  ActionsController,
4291
- ], queries: [{ propertyName: "statusBar", first: true, predicate: FilterStatusBarDirective, descendants: true, read: TemplateRef }], viewQueries: [{ propertyName: "searchTextInput", first: true, predicate: ["searchTextInput"], descendants: true }, { propertyName: "searchTextMatInput", first: true, predicate: ["searchTextInput"], descendants: true, read: MatInput }], ngImport: i0, template: "<ng-container>\n <div class=\"filter-container\">\n <ng-container *ngIf=\"hasKeyword\">\n <div class=\"filter-keyword\">\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 <div matSuffix *ngIf=\"searchText.value && showFilterInput && config.clear\">\n <a\n mat-icon-button \n (click)=\"clearSearchText($event)\"\n class=\"clear\">\n <mat-icon>clear</mat-icon>\n </a>\n </div>\n <div matSuffix>\n <a \n mat-icon-button\n (click)=\"reload($event)\"\n class=\"reload\"\n *ngIf=\"config.reload\">\n <mat-icon>refresh</mat-icon>\n </a>\n </div>\n </mat-form-field>\n </form>\n </div>\n </ng-container>\n\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 </div>\n <div class=\"filter-status-container\">\n <div class=\"filter-status\" *ngIf=\"statusBar\">\n <ng-container *ngTemplateOutlet=\"statusBar\"></ng-container>\n </div>\n <fs-filter-chips\n *ngIf=\"config.chips && hasFilterChips$ | async\"\n class=\"filter-chips\"\n [filters]=\"items\">\n </fs-filter-chips>\n </div>\n</ng-container>", styles: ["fs-filter{display:block}.fs-filter{margin-bottom:20px;display:block}.fs-filter:not(.has-keyword){display:flex;flex-direction:row-reverse}.fs-filter .results{min-height:90px;position:relative;overflow-x:auto;overflow-y:hidden}.fs-filter .filter-status-container{flex-grow:1;display:flex;justify-content:center;flex-direction:column;margin:4px 0}.fs-filter .filter-status-container .filter-status{overflow:hidden;text-overflow:ellipsis;line-height:17px}.fs-filter .filter-status-container .filter-status+fs-filter-chips{margin-top:4px}.fs-filter .filter-status-container fs-filter-chips{display:block}.fs-filter .filter-container{flex-direction:row;box-sizing:border-box;display:flex;position:relative}.fs-filter .filter-container form{width:100%;height:100%}.fs-filter .filter-container .filter-keyword{flex-direction:row;box-sizing:border-box;display:flex;align-items:center;flex:1}.fs-filter .filter-container .filter-keyword .mat-form-field{width:100%;height:100%;font-size:103%}.fs-filter .filter-container .filter-keyword .mat-form-field .mat-form-field-underline{bottom:auto}.fs-filter .filter-container .filter-keyword .mat-form-field .mat-form-field-infix{border-top:0}.fs-filter .filter-container .filter-keyword .mat-form-field .mat-form-field-wrapper{padding-bottom:0;height:100%}.fs-filter .filter-container .filter-keyword .mat-form-field .mat-form-field-flex{align-items:center;height:100%}.fs-filter .filter-container .filter-keyword .mat-form-field-prefix .mat-icon{font-size:22px}.fs-filter .filter-container .filter-keyword .mat-form-field-suffix{display:flex;margin-top:3px}.fs-filter .filter-container .filter-keyword .mat-form-field-suffix .mat-icon-button{height:24px;width:24px}.fs-filter .filter-container .filter-keyword .mat-form-field-suffix .mat-icon{font-size:22px}.fs-filter .filter-container .filter-keyword .mat-form-field-infix{width:auto}.fs-filter .filter-actions{display:flex;align-items:center}.fs-filter button.reload{margin-left:-40px;right:-9px}@media screen and (min-width: 599px){.filter-actions{margin-left:10px}.filters-button+fs-filter-actions:not(:empty){margin-left:5px}}@media screen and (max-width: 600px){.filter-actions{margin-left:5px}.filter-actions .filters-button{font-size:0;padding:0;min-width:unset;width:36px;height:36px;border-radius:50%;box-shadow:unset!important}}@media screen and (min-width: 1200px){body.fs-filter-open{margin-right:350px}.fs-filter-backdrop{display:none}}body.fs-filter-open::-webkit-scrollbar{width:0;background:transparent}\n"], components: [{ type: i1$3.MatFormField, selector: "mat-form-field", inputs: ["color", "floatLabel", "appearance", "hideRequiredMarker", "hintLabel"], exportAs: ["matFormField"] }, { type: i2$2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: i1$4.MatAnchor, selector: "a[mat-button], a[mat-raised-button], a[mat-icon-button], a[mat-fab], a[mat-mini-fab], a[mat-stroked-button], a[mat-flat-button]", inputs: ["disabled", "disableRipple", "color", "tabIndex"], exportAs: ["matButton", "matAnchor"] }, { type: i1$4.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { type: FsFilterActionsComponent, selector: "fs-filter-actions", inputs: ["kebabActions", "actions"] }, { type: FsFilterChipsComponent, selector: "fs-filter-chips", inputs: ["filters"] }], directives: [{ type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i4.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i4.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i1$3.MatPrefix, selector: "[matPrefix]" }, { type: i3$2.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["id", "disabled", "required", "type", "value", "readonly", "placeholder", "errorStateMatcher", "aria-describedby"], exportAs: ["matInput"] }, { type: i4.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4.FormControlDirective, selector: "[formControl]", inputs: ["disabled", "formControl", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i1$3.MatSuffix, selector: "[matSuffix]" }, { type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i3.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }], pipes: { "async": i3.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
4316
+ ], queries: [{ propertyName: "statusBar", first: true, predicate: FilterStatusBarDirective, descendants: true, read: TemplateRef }], viewQueries: [{ propertyName: "searchTextInput", first: true, predicate: ["searchTextInput"], descendants: true }, { propertyName: "searchTextMatInput", first: true, predicate: ["searchTextInput"], descendants: true, read: MatInput }], ngImport: i0, template: "<ng-container>\n <div class=\"filter-container\">\n <ng-container *ngIf=\"hasKeyword\">\n <div class=\"filter-keyword\">\n <form autocomplete=\"off\" role=\"presentation\" *ngIf=\"keywordVisible$ | async\">\n <mat-form-field [floatLabel]=\"'never'\" class=\"form-field-padless\">\n <span matPrefix>\n <mat-icon matPrefix>search</mat-icon>\n </span>\n <input\n #searchTextInput\n matInput\n [formControl]=\"searchText\"\n name=\"filter-input\"\n [placeholder]=\"searchPlaceholder\"\n (click)=\"filterInputEvent($event)\"\n class=\"filter-input\">\n\n <div matSuffix *ngIf=\"searchText.value && showFilterInput && config.clear\">\n <a\n mat-icon-button \n (click)=\"clearSearchText($event)\"\n class=\"clear\">\n <mat-icon>clear</mat-icon>\n </a>\n </div>\n <div matSuffix>\n <a \n mat-icon-button\n (click)=\"reload($event)\"\n class=\"reload\"\n *ngIf=\"config.reload\">\n <mat-icon>refresh</mat-icon>\n </a>\n </div>\n </mat-form-field>\n </form>\n </div>\n </ng-container>\n\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-flat-button': config.button.style === 'flat',\n 'mat-stroked-button': config.button.style === 'stroked',\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 </div>\n <div class=\"filter-status-container\">\n <div class=\"filter-status\" *ngIf=\"statusBar\">\n <ng-container *ngTemplateOutlet=\"statusBar\"></ng-container>\n </div>\n <fs-filter-chips\n *ngIf=\"config.chips && hasFilterChips$ | async\"\n class=\"filter-chips\"\n [filters]=\"items\">\n </fs-filter-chips>\n </div>\n</ng-container>", styles: ["fs-filter{display:block}.fs-filter{margin-bottom:20px;display:block}.fs-filter:not(.has-keyword){display:flex;flex-direction:row-reverse}.fs-filter .results{min-height:90px;position:relative;overflow-x:auto;overflow-y:hidden}.fs-filter .filter-status-container{flex-grow:1;display:flex;justify-content:center;flex-direction:column;margin:4px 0}.fs-filter .filter-status-container .filter-status{overflow:hidden;text-overflow:ellipsis;line-height:17px}.fs-filter .filter-status-container .filter-status+fs-filter-chips{margin-top:4px}.fs-filter .filter-status-container fs-filter-chips{display:block}.fs-filter .filter-container{flex-direction:row;box-sizing:border-box;display:flex;position:relative}.fs-filter .filter-container form{width:100%;height:100%}.fs-filter .filter-container .filter-keyword{flex-direction:row;box-sizing:border-box;display:flex;align-items:center;flex:1}.fs-filter .filter-container .filter-keyword .mat-form-field{height:100%;width:100%}.fs-filter .filter-container .filter-keyword .mat-form-field .mat-form-field-flex{align-items:center;height:100%}.fs-filter .filter-container .filter-keyword .mat-form-field.mat-form-field-appearance-legacy .mat-form-field-underline{bottom:auto}.fs-filter .filter-container .filter-keyword .mat-form-field.mat-form-field-appearance-legacy .mat-form-field-infix{border-top:0}.fs-filter .filter-container .filter-keyword .mat-form-field.mat-form-field-appearance-legacy .mat-form-field-wrapper{padding-bottom:0}.fs-filter .filter-container .filter-keyword .mat-form-field.mat-form-field-appearance-legacy .mat-icon{font-size:22px;color:#5b5b5b}.fs-filter .filter-container .filter-keyword .mat-form-field.mat-form-field-appearance-outline .mat-form-field-suffix,.fs-filter .filter-container .filter-keyword .mat-form-field.mat-form-field-appearance-outline .mat-form-field-prefix{top:0}.fs-filter .filter-container .filter-keyword .mat-form-field-wrapper{height:100%}.fs-filter .filter-container .filter-keyword .mat-form-field-suffix{display:flex}.fs-filter .filter-container .filter-keyword .mat-form-field-suffix .mat-icon-button{height:24px;width:24px}.fs-filter .filter-container .filter-keyword .mat-form-field-suffix .mat-icon-button .mat-icon{display:inline}.fs-filter .filter-actions{display:flex;align-items:center}@media screen and (min-width: 599px){.filter-actions{margin-left:10px}.filters-button+fs-filter-actions:not(:empty){margin-left:5px}}@media screen and (max-width: 600px){.filter-actions{margin-left:5px}.filter-actions .filters-button{font-size:0;padding:0;min-width:unset;width:36px;height:36px;border-radius:50%;box-shadow:unset!important}}@media screen and (min-width: 1200px){body.fs-filter-open{margin-right:350px}.fs-filter-backdrop{display:none}}body.fs-filter-open::-webkit-scrollbar{width:0;background:transparent}\n"], components: [{ type: i1$3.MatFormField, selector: "mat-form-field", inputs: ["color", "floatLabel", "appearance", "hideRequiredMarker", "hintLabel"], exportAs: ["matFormField"] }, { type: i2$2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: i1$4.MatAnchor, selector: "a[mat-button], a[mat-raised-button], a[mat-icon-button], a[mat-fab], a[mat-mini-fab], a[mat-stroked-button], a[mat-flat-button]", inputs: ["disabled", "disableRipple", "color", "tabIndex"], exportAs: ["matButton", "matAnchor"] }, { type: i1$4.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { type: FsFilterActionsComponent, selector: "fs-filter-actions", inputs: ["kebabActions", "actions"] }, { type: FsFilterChipsComponent, selector: "fs-filter-chips", inputs: ["filters"] }], directives: [{ type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i4.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i4.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i1$3.MatPrefix, selector: "[matPrefix]" }, { type: i3$2.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["id", "disabled", "required", "type", "value", "readonly", "placeholder", "errorStateMatcher", "aria-describedby"], exportAs: ["matInput"] }, { type: i4.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4.FormControlDirective, selector: "[formControl]", inputs: ["disabled", "formControl", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i1$3.MatSuffix, selector: "[matSuffix]" }, { type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i3.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }], pipes: { "async": i3.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
4292
4317
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FilterComponent, decorators: [{
4293
4318
  type: Component,
4294
4319
  args: [{
@@ -4598,5 +4623,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
4598
4623
  * Generated bundle index. Do not edit.
4599
4624
  */
4600
4625
 
4601
- export { ActionMode, ActionType, AutocompleteChipsItem, AutocompleteItem, BaseItem, CheckboxItem, ChipsItem, DateItem, DateRangeItem, DateTimeItem, DateTimeRangeItem, ExternalParamsController, FS_FILTER_CONFIG, FilterComponent, FilterItemComponent, FilterStatusBarDirective, FsFilterModule, FsSavedFiltersMenuComponent, ItemDateMode, ItemType, QUERY_PARAM_DELIMITER, RangeItem, SavedFiltersController, SelectItem, TextItem, buildQueryParams, filterFromQueryParam, filterToQueryParam };
4626
+ export { ActionMode, ActionType, AutocompleteChipsItem, AutocompleteItem, BaseItem, ButtonStyle, CheckboxItem, ChipsItem, DateItem, DateRangeItem, DateTimeItem, DateTimeRangeItem, ExternalParamsController, FS_FILTER_CONFIG, FilterComponent, FilterItemComponent, FilterStatusBarDirective, FsFilterModule, FsSavedFiltersMenuComponent, ItemDateMode, ItemType, QUERY_PARAM_DELIMITER, RangeItem, SavedFiltersController, SelectItem, TextItem, buildQueryParams, filterFromQueryParam, filterToQueryParam };
4602
4627
  //# sourceMappingURL=firestitch-filter.js.map