@firestitch/filter 13.3.1 → 13.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (30) hide show
  1. package/app/components/saved-filter/index.d.ts +3 -0
  2. package/app/components/saved-filter/saved-filter-edit/index.d.ts +1 -0
  3. package/app/components/{saved-filter-edit → saved-filter/saved-filter-edit}/saved-filter-edit.component.d.ts +2 -2
  4. package/app/components/saved-filter/saved-filter-manage/index.d.ts +1 -0
  5. package/app/components/saved-filter/saved-filter-manage/saved-filter-manage.component.d.ts +16 -0
  6. package/app/components/saved-filter/saved-filters-menu/index.d.ts +1 -0
  7. package/app/components/{saved-filters-menu → saved-filter/saved-filters-menu}/saved-filters-menu.component.d.ts +7 -5
  8. package/app/fs-filter.module.d.ts +37 -35
  9. package/app/helpers/create-filter-item.d.ts +1 -1
  10. package/app/services/items-store.service.d.ts +1 -0
  11. package/esm2020/app/components/saved-filter/index.mjs +4 -0
  12. package/esm2020/app/components/saved-filter/saved-filter-edit/index.mjs +2 -0
  13. package/esm2020/app/components/{saved-filter-edit → saved-filter/saved-filter-edit}/saved-filter-edit.component.mjs +1 -1
  14. package/esm2020/app/components/saved-filter/saved-filter-manage/index.mjs +2 -0
  15. package/esm2020/app/components/saved-filter/saved-filter-manage/saved-filter-manage.component.mjs +40 -0
  16. package/esm2020/app/components/saved-filter/saved-filters-menu/index.mjs +2 -0
  17. package/esm2020/app/components/saved-filter/saved-filters-menu/saved-filters-menu.component.mjs +52 -0
  18. package/esm2020/app/fs-filter.module.mjs +10 -3
  19. package/esm2020/app/helpers/restore-items.mjs +4 -4
  20. package/esm2020/app/services/external-params/saved-filters-controller.service.mjs +6 -6
  21. package/esm2020/app/services/external-params-controller.service.mjs +23 -6
  22. package/esm2020/app/services/items-store.service.mjs +4 -1
  23. package/esm2020/public_api.mjs +2 -2
  24. package/fesm2015/firestitch-filter.mjs +67 -15
  25. package/fesm2015/firestitch-filter.mjs.map +1 -1
  26. package/fesm2020/firestitch-filter.mjs +221 -159
  27. package/fesm2020/firestitch-filter.mjs.map +1 -1
  28. package/package.json +1 -1
  29. package/public_api.d.ts +1 -1
  30. package/esm2020/app/components/saved-filters-menu/saved-filters-menu.component.mjs +0 -44
@@ -29,6 +29,8 @@ import * as i7 from '@firestitch/form';
29
29
  import { FsFormModule } from '@firestitch/form';
30
30
  import * as i3$2 from '@angular/material/input';
31
31
  import { MatInput, MatInputModule } from '@angular/material/input';
32
+ import * as i4$3 from '@angular/cdk/drag-drop';
33
+ import { moveItemInArray, DragDropModule } from '@angular/cdk/drag-drop';
32
34
  import { ComponentPortal, PortalInjector, PortalModule } from '@angular/cdk/portal';
33
35
  import { MatAutocompleteModule } from '@angular/material/autocomplete';
34
36
  import * as i4$2 from '@angular/material/checkbox';
@@ -519,85 +521,6 @@ function getRangeName(configCase, name, range) {
519
521
  }
520
522
  }
521
523
 
522
- class RangeItem extends BaseItem {
523
- static create(config, additionalConfig, filter) {
524
- return new RangeItem(config, additionalConfig, filter);
525
- }
526
- get value() {
527
- let value = clone(this.model);
528
- if (!isObject(this.model) ||
529
- (isEmpty(this.model.max, { zero: true }) && isEmpty(this.model.min, { zero: true }))) {
530
- value = undefined;
531
- }
532
- return value;
533
- }
534
- get queryObject() {
535
- const value = this.value;
536
- const name = this.name;
537
- const params = {};
538
- const paramMinName = getRangeName(this.case, name, 'min');
539
- const paramMaxName = getRangeName(this.case, name, 'max');
540
- if (isObject(value)) {
541
- params[paramMinName] = value.min || undefined;
542
- params[paramMaxName] = value.max || undefined;
543
- }
544
- else {
545
- params[paramMinName] = undefined;
546
- params[paramMaxName] = undefined;
547
- }
548
- return params;
549
- }
550
- get isChipVisible() {
551
- return this.model && (this.model.min !== undefined || this.model.max !== undefined);
552
- }
553
- getChipsContent(type) {
554
- if (type === 'from') {
555
- const min = this.model.min;
556
- return `${min}`;
557
- }
558
- else if (type === 'to') {
559
- const max = this.model.max;
560
- return `${max}`;
561
- }
562
- }
563
- clearRange(type = null, defaultValue = undefined) {
564
- if (type === 'from') {
565
- delete this.model.min;
566
- if (defaultValue?.min) {
567
- this.model.min = defaultValue.min;
568
- }
569
- this.model = { ...this.model };
570
- }
571
- else if (type === 'to') {
572
- delete this.model.max;
573
- if (defaultValue?.max) {
574
- this.model.max = defaultValue.max;
575
- }
576
- this.model = { ...this.model };
577
- }
578
- else {
579
- this.model = defaultValue ? { ...defaultValue } : {};
580
- }
581
- }
582
- _validateModel() {
583
- }
584
- _parseConfig(item) {
585
- this.options = item.options;
586
- this.prefix = item.prefix;
587
- this.suffix = item.suffix;
588
- this.case = this._additionalConfig?.case ?? 'camel';
589
- super._parseConfig(item);
590
- }
591
- _init() {
592
- if (!this.label) {
593
- this.label = ['Min', 'Max'];
594
- }
595
- if (!this.model) {
596
- this.model = this.defaultValue || {};
597
- }
598
- }
599
- }
600
-
601
524
  class BaseDateRangeItem extends BaseItem {
602
525
  get isTypeDateRange() {
603
526
  return this.type === ItemType.DateRange;
@@ -738,82 +661,83 @@ class DateTimeRangeItem extends BaseDateRangeItem {
738
661
  }
739
662
  }
740
663
 
741
- function parseItemValueFromStored(item, params, paramCase) {
742
- const param = params[item.name];
743
- switch (item.type) {
744
- case ItemType.Range: {
745
- const min = params[getRangeName(paramCase, item.name, 'min')];
746
- const max = params[getRangeName(paramCase, item.name, 'max')];
747
- return { min: min, max: max };
664
+ class RangeItem extends BaseItem {
665
+ static create(config, additionalConfig, filter) {
666
+ return new RangeItem(config, additionalConfig, filter);
667
+ }
668
+ get value() {
669
+ let value = clone(this.model);
670
+ if (!isObject(this.model) ||
671
+ (isEmpty(this.model.max, { zero: true }) && isEmpty(this.model.min, { zero: true }))) {
672
+ value = undefined;
748
673
  }
749
- case ItemType.DateRange:
750
- case ItemType.DateTimeRange: {
751
- const from = params[getRangeName(item.case, item.name, 'from')];
752
- const to = params[getRangeName(item.case, item.name, 'to')];
753
- return { from: from, to: to };
674
+ return value;
675
+ }
676
+ get queryObject() {
677
+ const value = this.value;
678
+ const name = this.name;
679
+ const params = {};
680
+ const paramMinName = getRangeName(this.case, name, 'min');
681
+ const paramMaxName = getRangeName(this.case, name, 'max');
682
+ if (isObject(value)) {
683
+ params[paramMinName] = value.min || undefined;
684
+ params[paramMaxName] = value.max || undefined;
754
685
  }
755
- case ItemType.Week: {
756
- const from = params[getRangeName('camel', item.name, 'from')];
757
- const to = params[getRangeName('camel', item.name, 'to')];
758
- const period = params[`${item.name}Period`];
759
- return { from, to, period };
686
+ else {
687
+ params[paramMinName] = undefined;
688
+ params[paramMaxName] = undefined;
760
689
  }
761
- case ItemType.Select: {
762
- if (item.multiple && !!param) {
763
- const values = param.split(',');
764
- if (item.isolate) {
765
- const isolatedValue = Array.isArray(item.isolate.value)
766
- ? item.isolate.value
767
- : [item.isolate.value];
768
- item.isolate.enabled = arraysHaveSameElements(isolatedValue, values);
769
- return item.isolate.enabled
770
- ? isolatedValue
771
- : values;
772
- }
773
- return values;
774
- }
775
- else {
776
- return param;
777
- }
690
+ return params;
691
+ }
692
+ get isChipVisible() {
693
+ return this.model && (this.model.min !== undefined || this.model.max !== undefined);
694
+ }
695
+ getChipsContent(type) {
696
+ if (type === 'from') {
697
+ const min = this.model.min;
698
+ return `${min}`;
778
699
  }
779
- case ItemType.Checkbox: {
780
- if (param === 'true') {
781
- return true === item.checked;
700
+ else if (type === 'to') {
701
+ const max = this.model.max;
702
+ return `${max}`;
703
+ }
704
+ }
705
+ clearRange(type = null, defaultValue = undefined) {
706
+ if (type === 'from') {
707
+ delete this.model.min;
708
+ if (defaultValue?.min) {
709
+ this.model.min = defaultValue.min;
782
710
  }
783
- else {
784
- return param === item.checked;
711
+ this.model = { ...this.model };
712
+ }
713
+ else if (type === 'to') {
714
+ delete this.model.max;
715
+ if (defaultValue?.max) {
716
+ this.model.max = defaultValue.max;
785
717
  }
718
+ this.model = { ...this.model };
786
719
  }
787
- case ItemType.AutoComplete: {
788
- const filterParts = filterFromQueryParam(param);
789
- return {
790
- name: filterParts[1],
791
- value: filterParts[0]
792
- };
720
+ else {
721
+ this.model = defaultValue ? { ...defaultValue } : {};
793
722
  }
794
- case ItemType.AutoCompleteChips:
795
- case ItemType.Chips: {
796
- const filterParts = param.split(',');
797
- return filterParts.reduce((arry, value) => {
798
- const chipParts = filterFromQueryParam(value);
799
- arry.push({
800
- name: chipParts[1],
801
- value: chipParts[0],
802
- });
803
- return arry;
804
- }, []);
723
+ }
724
+ _validateModel() {
725
+ }
726
+ _parseConfig(item) {
727
+ this.options = item.options;
728
+ this.prefix = item.prefix;
729
+ this.suffix = item.suffix;
730
+ this.case = this._additionalConfig?.case ?? 'camel';
731
+ super._parseConfig(item);
732
+ }
733
+ _init() {
734
+ if (!this.label) {
735
+ this.label = ['Min', 'Max'];
805
736
  }
806
- default: {
807
- return param;
737
+ if (!this.model) {
738
+ this.model = this.defaultValue || {};
808
739
  }
809
740
  }
810
- }
811
- function arraysHaveSameElements(arr1, arr2) {
812
- arr1 = [...arr1].sort();
813
- arr2 = [...arr2].sort();
814
- return arr1.some((item) => {
815
- return arr2.includes(item);
816
- });
817
741
  }
818
742
 
819
743
  function parseDate(value) {
@@ -909,6 +833,84 @@ class WeekItem extends BaseItem {
909
833
  }
910
834
  }
911
835
 
836
+ function parseItemValueFromStored(item, params, paramCase) {
837
+ const param = params[item.name];
838
+ switch (item.type) {
839
+ case ItemType.Range: {
840
+ const min = params[getRangeName(paramCase, item.name, 'min')];
841
+ const max = params[getRangeName(paramCase, item.name, 'max')];
842
+ return { min: min, max: max };
843
+ }
844
+ case ItemType.DateRange:
845
+ case ItemType.DateTimeRange: {
846
+ const from = params[getRangeName(item.case, item.name, 'from')];
847
+ const to = params[getRangeName(item.case, item.name, 'to')];
848
+ return { from: from, to: to };
849
+ }
850
+ case ItemType.Week: {
851
+ const from = params[getRangeName('camel', item.name, 'from')];
852
+ const to = params[getRangeName('camel', item.name, 'to')];
853
+ const period = params[`${item.name}Period`];
854
+ return { from, to, period };
855
+ }
856
+ case ItemType.Select: {
857
+ if (item.multiple && !!param) {
858
+ const values = param.split(',');
859
+ if (item.isolate) {
860
+ const isolatedValue = Array.isArray(item.isolate.value)
861
+ ? item.isolate.value
862
+ : [item.isolate.value];
863
+ item.isolate.enabled = arraysHaveSameElements(isolatedValue, values);
864
+ return item.isolate.enabled
865
+ ? isolatedValue
866
+ : values;
867
+ }
868
+ return values;
869
+ }
870
+ else {
871
+ return param;
872
+ }
873
+ }
874
+ case ItemType.Checkbox: {
875
+ if (param === 'true') {
876
+ return true === item.checked;
877
+ }
878
+ else {
879
+ return param === item.checked;
880
+ }
881
+ }
882
+ case ItemType.AutoComplete: {
883
+ const filterParts = filterFromQueryParam(param);
884
+ return {
885
+ name: filterParts[1],
886
+ value: filterParts[0]
887
+ };
888
+ }
889
+ case ItemType.AutoCompleteChips:
890
+ case ItemType.Chips: {
891
+ const filterParts = param.split(',');
892
+ return filterParts.reduce((arry, value) => {
893
+ const chipParts = filterFromQueryParam(value);
894
+ arry.push({
895
+ name: chipParts[1],
896
+ value: chipParts[0],
897
+ });
898
+ return arry;
899
+ }, []);
900
+ }
901
+ default: {
902
+ return param;
903
+ }
904
+ }
905
+ }
906
+ function arraysHaveSameElements(arr1, arr2) {
907
+ arr1 = [...arr1].sort();
908
+ arr2 = [...arr2].sort();
909
+ return arr1.some((item) => {
910
+ return arr2.includes(item);
911
+ });
912
+ }
913
+
912
914
  /**
913
915
  * We need this function because when we store persisted/query/remote filter values
914
916
  * it stores with different format, ex.: Range will be stored as RangeFrom && RangeTo
@@ -1549,6 +1551,9 @@ class FsFilterItemsStore {
1549
1551
  get items() {
1550
1552
  return this._items;
1551
1553
  }
1554
+ get itemNames() {
1555
+ return this._items.map((item) => item.name);
1556
+ }
1552
1557
  get visibleItems() {
1553
1558
  return this._visibleItems$.getValue();
1554
1559
  }
@@ -2060,17 +2065,17 @@ class SavedFiltersController {
2060
2065
  }
2061
2066
  order(savedFilters) {
2062
2067
  return this._config.order(savedFilters)
2063
- .pipe(tap((response) => {
2068
+ .pipe(tap(() => {
2064
2069
  this.savedFilters = [
2065
- ...response,
2070
+ ...savedFilters,
2066
2071
  ];
2067
2072
  }));
2068
2073
  }
2069
2074
  delete(savedFilter) {
2070
2075
  return this._config.delete(savedFilter)
2071
- .pipe(tap((response) => {
2076
+ .pipe(tap(() => {
2072
2077
  this.savedFilters = this.savedFilters
2073
- .filter((f) => f.id !== response.id);
2078
+ .filter((f) => f.id !== savedFilter.id);
2074
2079
  }));
2075
2080
  }
2076
2081
  setActiveFilter(savedFilter) {
@@ -2156,15 +2161,32 @@ class ExternalParamsController {
2156
2161
  this._destroy$ = new Subject();
2157
2162
  }
2158
2163
  get params() {
2159
- const result = {};
2164
+ let result = {};
2160
2165
  if (this._persistanceStore.enabled) {
2161
- Object.assign(result, this._persistanceStore.value?.data);
2166
+ result = {
2167
+ ...result,
2168
+ ...this._persistanceStore.value?.data,
2169
+ };
2162
2170
  }
2163
2171
  if (this._savedFilters.enabled && this._savedFilters.activeFilter) {
2164
- Object.assign(result, this._savedFilters.activeFilterData);
2172
+ const query = Object.keys(result)
2173
+ .filter((key) => !this._itemsStore.itemNames.includes(key))
2174
+ .reduce((acc, key) => {
2175
+ return {
2176
+ ...acc,
2177
+ [key]: result[key],
2178
+ };
2179
+ }, {});
2180
+ result = {
2181
+ ...query,
2182
+ ...this._savedFilters.activeFilterData,
2183
+ };
2165
2184
  }
2166
- if (this._queryParams.enabled) {
2167
- Object.assign(result, this._queryParams.fetchedParams);
2185
+ else if (this._queryParams.enabled) {
2186
+ result = {
2187
+ ...result,
2188
+ ...this._queryParams.fetchedParams,
2189
+ };
2168
2190
  }
2169
2191
  return result;
2170
2192
  }
@@ -4280,11 +4302,42 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImpor
4280
4302
  args: [{ selector: 'filter-item-select-backdrop', changeDetection: ChangeDetectionStrategy.OnPush, template: "", styles: [":host{position:absolute;z-index:1002;inset:0}\n"] }]
4281
4303
  }], ctorParameters: function () { return []; } });
4282
4304
 
4305
+ class FsFilterSavedFilterManageComponent {
4306
+ constructor(data, _cdRef) {
4307
+ this.data = data;
4308
+ this._cdRef = _cdRef;
4309
+ this._savedFiltersController = this.data.savedFiltersController;
4310
+ this.savedFilters = [...this._savedFiltersController.savedFilters];
4311
+ }
4312
+ remove(savedFilter) {
4313
+ this._savedFiltersController.delete(savedFilter)
4314
+ .subscribe(() => {
4315
+ this.savedFilters = [...this._savedFiltersController.savedFilters];
4316
+ this._cdRef.markForCheck();
4317
+ });
4318
+ }
4319
+ drop(event) {
4320
+ moveItemInArray(this.savedFilters, event.previousIndex, event.currentIndex);
4321
+ this._savedFiltersController.order(this.savedFilters)
4322
+ .subscribe();
4323
+ }
4324
+ }
4325
+ FsFilterSavedFilterManageComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsFilterSavedFilterManageComponent, deps: [{ token: MAT_DIALOG_DATA }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
4326
+ FsFilterSavedFilterManageComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: FsFilterSavedFilterManageComponent, selector: "ng-component", ngImport: i0, template: "<h1 mat-dialog-title>\n Manage saved filters\n</h1>\n<div mat-dialog-content>\n <div\n cdkDropList \n [cdkDropListData]=\"savedFilters\"\n cdkDropListOrientation=\"vertical\"\n (cdkDropListDropped)=\"drop($event)\"> \n <ng-container \n *ngFor=\"let savedFilter of savedFilters\">\n <div class=\"chip-container\">\n <fs-chip \n cdkDrag\n (removed)=\"remove(savedFilter)\">\n {{savedFilter.name}}\n </fs-chip>\n </div>\n </ng-container>\n </div>\n</div>\n<div mat-dialog-actions>\n <button \n mat-button\n type=\"button\"\n [mat-dialog-close]=\"null\">\n Done\n </button>\n</div>\n", styles: [".chip-container{padding:5px 0}.chip-container fs-chip{cursor:move}.cdk-drag-preview{box-sizing:border-box}.cdk-drag-placeholder{opacity:0}.cdk-drag-animating{transition:transform .25s cubic-bezier(0,0,.2,1)}.example-box:last-child{border:none}.example-list.cdk-drop-list-dragging .example-box:not(.cdk-drag-placeholder){transition:transform .25s cubic-bezier(0,0,.2,1)}\n"], components: [{ type: i2$3.FsChipComponent, selector: "fs-chip", inputs: ["selectable", "removable", "value", "icon", "image", "selected", "size", "backgroundColor", "borderColor", "color", "outlined"], outputs: ["selectedToggled", "removed"] }, { type: i1$3.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: i1$1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { type: i1$1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { type: i4$3.CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i4$3.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { type: i1$1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]" }, { type: i7.FsButtonDirective, selector: "[mat-raised-button],[mat-button],[mat-flat-button],[mat-stroked-button]", inputs: ["name", "dirtySubmit", "form"] }, { type: i1$1.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
4327
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsFilterSavedFilterManageComponent, decorators: [{
4328
+ type: Component,
4329
+ args: [{ changeDetection: ChangeDetectionStrategy.OnPush, template: "<h1 mat-dialog-title>\n Manage saved filters\n</h1>\n<div mat-dialog-content>\n <div\n cdkDropList \n [cdkDropListData]=\"savedFilters\"\n cdkDropListOrientation=\"vertical\"\n (cdkDropListDropped)=\"drop($event)\"> \n <ng-container \n *ngFor=\"let savedFilter of savedFilters\">\n <div class=\"chip-container\">\n <fs-chip \n cdkDrag\n (removed)=\"remove(savedFilter)\">\n {{savedFilter.name}}\n </fs-chip>\n </div>\n </ng-container>\n </div>\n</div>\n<div mat-dialog-actions>\n <button \n mat-button\n type=\"button\"\n [mat-dialog-close]=\"null\">\n Done\n </button>\n</div>\n", styles: [".chip-container{padding:5px 0}.chip-container fs-chip{cursor:move}.cdk-drag-preview{box-sizing:border-box}.cdk-drag-placeholder{opacity:0}.cdk-drag-animating{transition:transform .25s cubic-bezier(0,0,.2,1)}.example-box:last-child{border:none}.example-list.cdk-drop-list-dragging .example-box:not(.cdk-drag-placeholder){transition:transform .25s cubic-bezier(0,0,.2,1)}\n"] }]
4330
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
4331
+ type: Inject,
4332
+ args: [MAT_DIALOG_DATA]
4333
+ }] }, { type: i0.ChangeDetectorRef }]; } });
4334
+
4283
4335
  class FsSavedFiltersMenuComponent {
4284
- constructor(_itemsStore, _externalParams, _savedFilters) {
4336
+ constructor(_itemsStore, _externalParams, _savedFilters, _dialog) {
4285
4337
  this._itemsStore = _itemsStore;
4286
4338
  this._externalParams = _externalParams;
4287
4339
  this._savedFilters = _savedFilters;
4340
+ this._dialog = _dialog;
4288
4341
  this.clear = new EventEmitter();
4289
4342
  }
4290
4343
  get filters$() {
@@ -4302,15 +4355,19 @@ class FsSavedFiltersMenuComponent {
4302
4355
  this.clear.emit();
4303
4356
  }
4304
4357
  manageFilters() {
4305
- // TODO: Implement
4358
+ this._dialog.open(FsFilterSavedFilterManageComponent, {
4359
+ data: {
4360
+ savedFiltersController: this._savedFilters,
4361
+ },
4362
+ });
4306
4363
  }
4307
4364
  }
4308
- FsSavedFiltersMenuComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsSavedFiltersMenuComponent, deps: [{ token: FsFilterItemsStore }, { token: ExternalParamsController }, { token: SavedFiltersController }], target: i0.ɵɵFactoryTarget.Component });
4309
- FsSavedFiltersMenuComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: FsSavedFiltersMenuComponent, selector: "fs-filter-saved-filters-menu", outputs: { clear: "clear" }, ngImport: i0, template: "<a [fsMenuTriggerFor]=\"menu\" class=\"selector\">{{ (activeFilter$ | async)?.name || 'Not selected' }}</a>\n\n<fs-menu #menu>\n <ng-container *ngIf=\"activeFilter$ | async\">\n <ng-template fs-menu-item (click)=\"removeActiveFilter()\">\n None\n </ng-template>\n </ng-container>\n <ng-container *ngFor=\"let filter of filters$ | async\">\n <ng-template fs-menu-item (click)=\"selectFilter(filter)\">\n {{ filter.name }}\n </ng-template>\n </ng-container>\n <!-- TODO: Implement -->\n <!-- <ng-template \n fs-menu-item \n class=\"saved-filter-last-item\" \n (click)=\"manageFilters()\">\n Manage\n </ng-template> -->\n</fs-menu>\n", styles: [":host ::ng-deep .selector{cursor:pointer}\n"], components: [{ type: i3$3.FsMenuComponent, selector: "fs-menu", inputs: ["class", "buttonClass", "buttonType", "buttonColor"], outputs: ["opened", "closed"] }], directives: [{ type: i3$3.FsMenuTriggerDirective, selector: "[fsMenuTriggerFor]", inputs: ["fsMenuTriggerFor"] }, { type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3$3.FsMenuItemDirective, selector: "fs-menu-group,[fs-menu-item]" }, { type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], pipes: { "async": i3.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
4365
+ FsSavedFiltersMenuComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsSavedFiltersMenuComponent, deps: [{ token: FsFilterItemsStore }, { token: ExternalParamsController }, { token: SavedFiltersController }, { token: i1$1.MatDialog }], target: i0.ɵɵFactoryTarget.Component });
4366
+ FsSavedFiltersMenuComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: FsSavedFiltersMenuComponent, selector: "fs-filter-saved-filters-menu", outputs: { clear: "clear" }, ngImport: i0, template: "<a [fsMenuTriggerFor]=\"menu\" class=\"selector\">{{ (activeFilter$ | async)?.name || 'Not selected' }}</a>\n\n<fs-menu #menu>\n <ng-container *ngIf=\"activeFilter$ | async\">\n <ng-template fs-menu-item (click)=\"removeActiveFilter()\">\n None\n </ng-template>\n </ng-container>\n <ng-container *ngIf=\"(filters$ | async).length !==0\">\n <ng-container *ngFor=\"let filter of filters$ | async\">\n <ng-template fs-menu-item (click)=\"selectFilter(filter)\">\n {{ filter.name }}\n </ng-template>\n </ng-container>\n <ng-template fs-menu-divider-item></ng-template>\n </ng-container>\n <ng-template \n fs-menu-item \n class=\"saved-filter-last-item\" \n (click)=\"manageFilters()\">\n Manage\n </ng-template>\n</fs-menu>\n", styles: [":host ::ng-deep .selector{cursor:pointer}\n"], components: [{ type: i3$3.FsMenuComponent, selector: "fs-menu", inputs: ["class", "buttonClass", "buttonType", "buttonColor"], outputs: ["opened", "closed"] }], directives: [{ type: i3$3.FsMenuTriggerDirective, selector: "[fsMenuTriggerFor]", inputs: ["fsMenuTriggerFor"] }, { type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3$3.FsMenuItemDirective, selector: "fs-menu-group,[fs-menu-item]" }, { type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], pipes: { "async": i3.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
4310
4367
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsSavedFiltersMenuComponent, decorators: [{
4311
4368
  type: Component,
4312
- args: [{ selector: 'fs-filter-saved-filters-menu', changeDetection: ChangeDetectionStrategy.OnPush, template: "<a [fsMenuTriggerFor]=\"menu\" class=\"selector\">{{ (activeFilter$ | async)?.name || 'Not selected' }}</a>\n\n<fs-menu #menu>\n <ng-container *ngIf=\"activeFilter$ | async\">\n <ng-template fs-menu-item (click)=\"removeActiveFilter()\">\n None\n </ng-template>\n </ng-container>\n <ng-container *ngFor=\"let filter of filters$ | async\">\n <ng-template fs-menu-item (click)=\"selectFilter(filter)\">\n {{ filter.name }}\n </ng-template>\n </ng-container>\n <!-- TODO: Implement -->\n <!-- <ng-template \n fs-menu-item \n class=\"saved-filter-last-item\" \n (click)=\"manageFilters()\">\n Manage\n </ng-template> -->\n</fs-menu>\n", styles: [":host ::ng-deep .selector{cursor:pointer}\n"] }]
4313
- }], ctorParameters: function () { return [{ type: FsFilterItemsStore }, { type: ExternalParamsController }, { type: SavedFiltersController }]; }, propDecorators: { clear: [{
4369
+ args: [{ selector: 'fs-filter-saved-filters-menu', changeDetection: ChangeDetectionStrategy.OnPush, template: "<a [fsMenuTriggerFor]=\"menu\" class=\"selector\">{{ (activeFilter$ | async)?.name || 'Not selected' }}</a>\n\n<fs-menu #menu>\n <ng-container *ngIf=\"activeFilter$ | async\">\n <ng-template fs-menu-item (click)=\"removeActiveFilter()\">\n None\n </ng-template>\n </ng-container>\n <ng-container *ngIf=\"(filters$ | async).length !==0\">\n <ng-container *ngFor=\"let filter of filters$ | async\">\n <ng-template fs-menu-item (click)=\"selectFilter(filter)\">\n {{ filter.name }}\n </ng-template>\n </ng-container>\n <ng-template fs-menu-divider-item></ng-template>\n </ng-container>\n <ng-template \n fs-menu-item \n class=\"saved-filter-last-item\" \n (click)=\"manageFilters()\">\n Manage\n </ng-template>\n</fs-menu>\n", styles: [":host ::ng-deep .selector{cursor:pointer}\n"] }]
4370
+ }], ctorParameters: function () { return [{ type: FsFilterItemsStore }, { type: ExternalParamsController }, { type: SavedFiltersController }, { type: i1$1.MatDialog }]; }, propDecorators: { clear: [{
4314
4371
  type: Output
4315
4372
  }] } });
4316
4373
 
@@ -4360,6 +4417,7 @@ FsFilterModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version:
4360
4417
  FsFilterActionsComponent,
4361
4418
  FsFilterActionButtonComponent,
4362
4419
  FsFilterActionKebabActionsComponent,
4420
+ FsFilterSavedFilterManageComponent,
4363
4421
  FilterStatusBarDirective,
4364
4422
  FocusToItemDirective,
4365
4423
  // Pipes
@@ -4367,6 +4425,7 @@ FsFilterModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version:
4367
4425
  RouterModule,
4368
4426
  FormsModule,
4369
4427
  ReactiveFormsModule,
4428
+ DragDropModule,
4370
4429
  MatIconModule,
4371
4430
  MatInputModule,
4372
4431
  MatSelectModule,
@@ -4402,6 +4461,7 @@ FsFilterModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version:
4402
4461
  RouterModule,
4403
4462
  FormsModule,
4404
4463
  ReactiveFormsModule,
4464
+ DragDropModule,
4405
4465
  MatIconModule,
4406
4466
  MatInputModule,
4407
4467
  MatSelectModule,
@@ -4437,6 +4497,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImpor
4437
4497
  RouterModule,
4438
4498
  FormsModule,
4439
4499
  ReactiveFormsModule,
4500
+ DragDropModule,
4440
4501
  MatIconModule,
4441
4502
  MatInputModule,
4442
4503
  MatSelectModule,
@@ -4492,6 +4553,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImpor
4492
4553
  FsFilterActionsComponent,
4493
4554
  FsFilterActionButtonComponent,
4494
4555
  FsFilterActionKebabActionsComponent,
4556
+ FsFilterSavedFilterManageComponent,
4495
4557
  FilterStatusBarDirective,
4496
4558
  FocusToItemDirective,
4497
4559
  // Pipes