@firestitch/filter 16.0.0 → 16.0.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 (216) hide show
  1. package/app/classes/actions-controller.d.ts +41 -41
  2. package/app/components/action-button/action-button.component.d.ts +9 -9
  3. package/app/components/action-kebab-actions/action-kebab-actions.component.d.ts +7 -7
  4. package/app/components/actions/actions.component.d.ts +13 -13
  5. package/app/components/filter/filter.component.d.ts +204 -204
  6. package/app/components/filter-chip/filter-chip.component.d.ts +26 -26
  7. package/app/components/filter-chip-content/filter-chip-content.component.d.ts +18 -18
  8. package/app/components/filter-chips/filter-chips.component.d.ts +9 -9
  9. package/app/components/filter-drawer/filter-drawer.component.d.ts +30 -30
  10. package/app/components/filter-drawer-actions/filter-drawer-actions.component.d.ts +9 -9
  11. package/app/components/filters-item/autocomplete/autocomplete.component.d.ts +14 -14
  12. package/app/components/filters-item/autocompletechips/autocompletechips.component.d.ts +16 -16
  13. package/app/components/filters-item/base-item/base-item.component.d.ts +25 -25
  14. package/app/components/filters-item/checkbox/checkbox.component.d.ts +11 -11
  15. package/app/components/filters-item/chips/chips.component.d.ts +13 -13
  16. package/app/components/filters-item/date/date.component.d.ts +20 -20
  17. package/app/components/filters-item/date-range/date-range.component.d.ts +15 -15
  18. package/app/components/filters-item/filter-item.component.d.ts +39 -39
  19. package/app/components/filters-item/range/range.component.d.ts +15 -15
  20. package/app/components/filters-item/select/backdrop/backdrop.component.d.ts +6 -6
  21. package/app/components/filters-item/select/groups/groups.component.d.ts +12 -12
  22. package/app/components/filters-item/select/multiple/multiple.component.d.ts +15 -15
  23. package/app/components/filters-item/select/select.component.d.ts +23 -23
  24. package/app/components/filters-item/select/simple/simple.component.d.ts +14 -14
  25. package/app/components/filters-item/text/text.component.d.ts +19 -19
  26. package/app/components/filters-item/week/week.component.d.ts +12 -12
  27. package/app/components/saved-filter/index.d.ts +3 -3
  28. package/app/components/saved-filter/saved-filter-edit/index.d.ts +1 -1
  29. package/app/components/saved-filter/saved-filter-edit/saved-filter-edit.component.d.ts +18 -18
  30. package/app/components/saved-filter/saved-filter-manage/index.d.ts +1 -1
  31. package/app/components/saved-filter/saved-filter-manage/saved-filter-manage.component.d.ts +16 -16
  32. package/app/components/saved-filter/saved-filters-menu/index.d.ts +1 -1
  33. package/app/components/saved-filter/saved-filters-menu/saved-filters-menu.component.d.ts +24 -24
  34. package/app/consts/query-param-delimiter.d.ts +1 -1
  35. package/app/directives/focus-to-item/focus-to-item.directive.d.ts +27 -27
  36. package/app/directives/status-bar/status-bar.directive.d.ts +8 -8
  37. package/app/enums/action-mode.enum.d.ts +6 -6
  38. package/app/enums/action-type.enum.d.ts +9 -9
  39. package/app/enums/button-style.d.ts +9 -9
  40. package/app/enums/index.d.ts +6 -6
  41. package/app/enums/item-date-mode.enum.d.ts +5 -5
  42. package/app/enums/item-type.enum.d.ts +15 -15
  43. package/app/enums/picker-view-type.enum.d.ts +7 -7
  44. package/app/fs-filter.module.d.ts +70 -70
  45. package/app/helpers/build-query-params.d.ts +3 -3
  46. package/app/helpers/compare.d.ts +2 -2
  47. package/app/helpers/create-filter-item.d.ts +14 -14
  48. package/app/helpers/find-value.d.ts +1 -1
  49. package/app/helpers/get-range-name.d.ts +1 -1
  50. package/app/helpers/parse-date.d.ts +1 -1
  51. package/app/helpers/parse-item-value-from-stored.d.ts +1 -1
  52. package/app/helpers/query-param-transformers.d.ts +2 -2
  53. package/app/helpers/restore-items.d.ts +12 -12
  54. package/app/injectors/filter-config.d.ts +2 -2
  55. package/app/injectors/filter-drawer-data.d.ts +2 -2
  56. package/app/injectors/filter-drawer-overlay.d.ts +2 -2
  57. package/app/interfaces/action.interface.d.ts +81 -81
  58. package/app/interfaces/config.interface.d.ts +66 -66
  59. package/app/interfaces/external-params.interface.d.ts +3 -3
  60. package/app/interfaces/filter.interface.d.ts +4 -4
  61. package/app/interfaces/index.d.ts +6 -6
  62. package/app/interfaces/items/autocomplete-chips.interface.d.ts +15 -15
  63. package/app/interfaces/items/autocomplete.interface.d.ts +9 -9
  64. package/app/interfaces/items/base.interface.d.ts +29 -29
  65. package/app/interfaces/items/checkbox.interface.d.ts +7 -7
  66. package/app/interfaces/items/chips.interface.d.ts +6 -6
  67. package/app/interfaces/items/date-range.interface.d.ts +8 -8
  68. package/app/interfaces/items/date.interface.d.ts +7 -7
  69. package/app/interfaces/items/range.interface.d.ts +13 -13
  70. package/app/interfaces/items/select.interface.d.ts +20 -20
  71. package/app/interfaces/items/text.interface.d.ts +9 -9
  72. package/app/interfaces/items/week.interface.d.ts +7 -7
  73. package/app/interfaces/saved-filters.interface.d.ts +18 -18
  74. package/app/interfaces/update-filter-item.interface.d.ts +4 -4
  75. package/app/models/action-menu-item.model.d.ts +23 -23
  76. package/app/models/action.model.d.ts +54 -54
  77. package/app/models/filter-config.d.ts +31 -31
  78. package/app/models/items/autocomplete/base-autocomplete-item.d.ts +12 -12
  79. package/app/models/items/autocomplete-chips-item.d.ts +20 -20
  80. package/app/models/items/autocomplete-item.d.ts +11 -11
  81. package/app/models/items/base-item.d.ts +80 -80
  82. package/app/models/items/checkbox-item.d.ts +17 -17
  83. package/app/models/items/chips-item.d.ts +18 -18
  84. package/app/models/items/date/base-date-item.d.ts +14 -14
  85. package/app/models/items/date-item.d.ts +8 -8
  86. package/app/models/items/date-range/base-date-range-item.d.ts +17 -17
  87. package/app/models/items/date-range-item.d.ts +6 -6
  88. package/app/models/items/date-time-item.d.ts +7 -7
  89. package/app/models/items/date-time-range-item.d.ts +6 -6
  90. package/app/models/items/range-item.d.ts +19 -19
  91. package/app/models/items/select/base-select-item.d.ts +13 -13
  92. package/app/models/items/select/multiple-select-item.d.ts +14 -14
  93. package/app/models/items/select/simple-select-item.d.ts +14 -14
  94. package/app/models/items/select-item.d.ts +8 -8
  95. package/app/models/items/text-item.d.ts +15 -15
  96. package/app/models/items/week-item.d.ts +18 -18
  97. package/app/pipes/remove-isolate-value.pipe.d.ts +8 -8
  98. package/app/providers/filter-meta.d.ts +5 -5
  99. package/app/services/external-params/persistance-params-controller.service.d.ts +21 -21
  100. package/app/services/external-params/query-params-controller.service.d.ts +22 -22
  101. package/app/services/external-params/saved-filters-controller.service.d.ts +40 -40
  102. package/app/services/external-params-controller.service.d.ts +42 -42
  103. package/app/services/filter-overlay.service.d.ts +36 -36
  104. package/app/services/focus-controller.service.d.ts +18 -18
  105. package/app/services/items-store.service.d.ts +69 -69
  106. package/esm2022/app/classes/actions-controller.mjs +129 -129
  107. package/esm2022/app/components/action-button/action-button.component.mjs +20 -20
  108. package/esm2022/app/components/action-kebab-actions/action-kebab-actions.component.mjs +17 -17
  109. package/esm2022/app/components/actions/actions.component.mjs +39 -39
  110. package/esm2022/app/components/filter/filter.component.mjs +625 -625
  111. package/esm2022/app/components/filter-chip/filter-chip.component.mjs +91 -91
  112. package/esm2022/app/components/filter-chip-content/filter-chip-content.component.mjs +82 -82
  113. package/esm2022/app/components/filter-chips/filter-chips.component.mjs +17 -17
  114. package/esm2022/app/components/filter-drawer/filter-drawer.component.mjs +77 -77
  115. package/esm2022/app/components/filter-drawer-actions/filter-drawer-actions.component.mjs +26 -26
  116. package/esm2022/app/components/filters-item/autocomplete/autocomplete.component.mjs +28 -28
  117. package/esm2022/app/components/filters-item/autocompletechips/autocompletechips.component.mjs +43 -43
  118. package/esm2022/app/components/filters-item/base-item/base-item.component.mjs +67 -67
  119. package/esm2022/app/components/filters-item/checkbox/checkbox.component.mjs +22 -22
  120. package/esm2022/app/components/filters-item/chips/chips.component.mjs +29 -29
  121. package/esm2022/app/components/filters-item/date/date.component.mjs +44 -44
  122. package/esm2022/app/components/filters-item/date-range/date-range.component.mjs +35 -35
  123. package/esm2022/app/components/filters-item/filter-item.component.mjs +81 -81
  124. package/esm2022/app/components/filters-item/range/range.component.mjs +48 -48
  125. package/esm2022/app/components/filters-item/select/backdrop/backdrop.component.mjs +11 -11
  126. package/esm2022/app/components/filters-item/select/groups/groups.component.mjs +32 -32
  127. package/esm2022/app/components/filters-item/select/multiple/multiple.component.mjs +59 -59
  128. package/esm2022/app/components/filters-item/select/select.component.mjs +54 -54
  129. package/esm2022/app/components/filters-item/select/simple/simple.component.mjs +45 -45
  130. package/esm2022/app/components/filters-item/text/text.component.mjs +50 -50
  131. package/esm2022/app/components/filters-item/week/week.component.mjs +25 -25
  132. package/esm2022/app/components/saved-filter/index.mjs +3 -3
  133. package/esm2022/app/components/saved-filter/saved-filter-edit/index.mjs +1 -1
  134. package/esm2022/app/components/saved-filter/saved-filter-edit/saved-filter-edit.component.mjs +54 -54
  135. package/esm2022/app/components/saved-filter/saved-filter-manage/index.mjs +1 -1
  136. package/esm2022/app/components/saved-filter/saved-filter-manage/saved-filter-manage.component.mjs +44 -44
  137. package/esm2022/app/components/saved-filter/saved-filters-menu/index.mjs +1 -1
  138. package/esm2022/app/components/saved-filter/saved-filters-menu/saved-filters-menu.component.mjs +60 -60
  139. package/esm2022/app/consts/query-param-delimiter.mjs +1 -1
  140. package/esm2022/app/directives/focus-to-item/focus-to-item.directive.mjs +140 -140
  141. package/esm2022/app/directives/status-bar/status-bar.directive.mjs +16 -16
  142. package/esm2022/app/enums/action-mode.enum.mjs +7 -7
  143. package/esm2022/app/enums/action-type.enum.mjs +10 -10
  144. package/esm2022/app/enums/button-style.mjs +10 -10
  145. package/esm2022/app/enums/index.mjs +6 -6
  146. package/esm2022/app/enums/item-date-mode.enum.mjs +6 -6
  147. package/esm2022/app/enums/item-type.enum.mjs +16 -16
  148. package/esm2022/app/enums/picker-view-type.enum.mjs +8 -8
  149. package/esm2022/app/fs-filter.module.mjs +260 -260
  150. package/esm2022/app/helpers/build-query-params.mjs +32 -32
  151. package/esm2022/app/helpers/compare.mjs +37 -37
  152. package/esm2022/app/helpers/create-filter-item.mjs +54 -54
  153. package/esm2022/app/helpers/find-value.mjs +12 -12
  154. package/esm2022/app/helpers/get-range-name.mjs +3 -3
  155. package/esm2022/app/helpers/parse-date.mjs +7 -7
  156. package/esm2022/app/helpers/parse-item-value-from-stored.mjs +76 -76
  157. package/esm2022/app/helpers/query-param-transformers.mjs +8 -8
  158. package/esm2022/app/helpers/restore-items.mjs +48 -48
  159. package/esm2022/app/injectors/filter-config.mjs +2 -2
  160. package/esm2022/app/injectors/filter-drawer-data.mjs +2 -2
  161. package/esm2022/app/injectors/filter-drawer-overlay.mjs +2 -2
  162. package/esm2022/app/interfaces/action.interface.mjs +1 -1
  163. package/esm2022/app/interfaces/config.interface.mjs +1 -1
  164. package/esm2022/app/interfaces/external-params.interface.mjs +1 -1
  165. package/esm2022/app/interfaces/filter.interface.mjs +1 -1
  166. package/esm2022/app/interfaces/index.mjs +6 -6
  167. package/esm2022/app/interfaces/items/autocomplete-chips.interface.mjs +1 -1
  168. package/esm2022/app/interfaces/items/autocomplete.interface.mjs +1 -1
  169. package/esm2022/app/interfaces/items/base.interface.mjs +1 -1
  170. package/esm2022/app/interfaces/items/checkbox.interface.mjs +1 -1
  171. package/esm2022/app/interfaces/items/chips.interface.mjs +1 -1
  172. package/esm2022/app/interfaces/items/date-range.interface.mjs +1 -1
  173. package/esm2022/app/interfaces/items/date.interface.mjs +1 -1
  174. package/esm2022/app/interfaces/items/range.interface.mjs +1 -1
  175. package/esm2022/app/interfaces/items/select.interface.mjs +1 -1
  176. package/esm2022/app/interfaces/items/text.interface.mjs +1 -1
  177. package/esm2022/app/interfaces/items/week.interface.mjs +1 -1
  178. package/esm2022/app/interfaces/saved-filters.interface.mjs +1 -1
  179. package/esm2022/app/interfaces/update-filter-item.interface.mjs +1 -1
  180. package/esm2022/app/models/action-menu-item.model.mjs +72 -72
  181. package/esm2022/app/models/action.model.mjs +155 -155
  182. package/esm2022/app/models/filter-config.mjs +78 -78
  183. package/esm2022/app/models/items/autocomplete/base-autocomplete-item.mjs +15 -15
  184. package/esm2022/app/models/items/autocomplete-chips-item.mjs +66 -66
  185. package/esm2022/app/models/items/autocomplete-item.mjs +32 -32
  186. package/esm2022/app/models/items/base-item.mjs +250 -250
  187. package/esm2022/app/models/items/checkbox-item.mjs +51 -51
  188. package/esm2022/app/models/items/chips-item.mjs +89 -89
  189. package/esm2022/app/models/items/date/base-date-item.mjs +49 -49
  190. package/esm2022/app/models/items/date-item.mjs +18 -18
  191. package/esm2022/app/models/items/date-range/base-date-range-item.mjs +123 -123
  192. package/esm2022/app/models/items/date-range-item.mjs +6 -6
  193. package/esm2022/app/models/items/date-time-item.mjs +9 -9
  194. package/esm2022/app/models/items/date-time-range-item.mjs +6 -6
  195. package/esm2022/app/models/items/range-item.mjs +84 -84
  196. package/esm2022/app/models/items/select/base-select-item.mjs +39 -39
  197. package/esm2022/app/models/items/select/multiple-select-item.mjs +87 -87
  198. package/esm2022/app/models/items/select/simple-select-item.mjs +65 -65
  199. package/esm2022/app/models/items/select-item.mjs +11 -11
  200. package/esm2022/app/models/items/text-item.mjs +35 -35
  201. package/esm2022/app/models/items/week-item.mjs +94 -94
  202. package/esm2022/app/pipes/remove-isolate-value.pipe.mjs +20 -20
  203. package/esm2022/app/providers/filter-meta.mjs +9 -9
  204. package/esm2022/app/services/external-params/persistance-params-controller.service.mjs +61 -61
  205. package/esm2022/app/services/external-params/query-params-controller.service.mjs +65 -65
  206. package/esm2022/app/services/external-params/saved-filters-controller.service.mjs +166 -166
  207. package/esm2022/app/services/external-params-controller.service.mjs +184 -184
  208. package/esm2022/app/services/filter-overlay.service.mjs +129 -129
  209. package/esm2022/app/services/focus-controller.service.mjs +28 -28
  210. package/esm2022/app/services/items-store.service.mjs +346 -346
  211. package/esm2022/firestitch-filter.mjs +4 -4
  212. package/esm2022/public_api.mjs +35 -35
  213. package/fesm2022/firestitch-filter.mjs +4516 -4516
  214. package/index.d.ts +5 -5
  215. package/package.json +1 -1
  216. package/public_api.d.ts +40 -40
@@ -1,626 +1,626 @@
1
- import { ChangeDetectionStrategy, Component, ContentChild, ElementRef, EventEmitter, HostBinding, Inject, Input, NgZone, Optional, Output, ViewChild, } from '@angular/core';
2
- import { MatInput } from '@angular/material/input';
3
- import { BehaviorSubject, combineLatest, fromEvent, interval, Subject } from 'rxjs';
4
- import { debounceTime, distinctUntilChanged, filter, map, takeUntil } from 'rxjs/operators';
5
- import { ActionsController } from '../../classes/actions-controller';
6
- import { objectsAreEquals } from '../../helpers/compare';
7
- import { FsFilterConfig } from '../../models/filter-config';
8
- import { ExternalParamsController } from '../../services/external-params-controller.service';
9
- import { PersistanceParamsController } from '../../services/external-params/persistance-params-controller.service';
10
- import { QueryParamsController } from '../../services/external-params/query-params-controller.service';
11
- import { SavedFiltersController } from '../../services/external-params/saved-filters-controller.service';
12
- import { FsFilterOverlayService } from '../../services/filter-overlay.service';
13
- import { FocusControllerService } from '../../services/focus-controller.service';
14
- import { FsFilterItemsStore } from '../../services/items-store.service';
15
- import { FilterStatusBarDirective } from './../../directives/status-bar/status-bar.directive';
16
- import { FS_FILTER_CONFIG } from './../../injectors/filter-config';
17
- import * as i0 from "@angular/core";
18
- import * as i1 from "../../services/filter-overlay.service";
19
- import * as i2 from "../../services/external-params-controller.service";
20
- import * as i3 from "../../services/items-store.service";
21
- import * as i4 from "../../classes/actions-controller";
22
- import * as i5 from "../../services/external-params/saved-filters-controller.service";
23
- import * as i6 from "@angular/common";
24
- import * as i7 from "@angular/forms";
25
- import * as i8 from "@angular/material/icon";
26
- import * as i9 from "@angular/material/input";
27
- import * as i10 from "@angular/material/form-field";
28
- import * as i11 from "@angular/material/button";
29
- import * as i12 from "@angular/material/slide-toggle";
30
- import * as i13 from "@firestitch/form";
31
- import * as i14 from "@firestitch/clear";
32
- import * as i15 from "../filter-chips/filter-chips.component";
33
- import * as i16 from "../actions/actions.component";
34
- import * as i17 from "../../models/filter-config";
35
- export class FilterComponent {
36
- _defaultConfig;
37
- _filterOverlay;
38
- _zone;
39
- _externalParams;
40
- _filterItems;
41
- _actions;
42
- _savedFiltersController;
43
- _externalParamsController;
44
- set setConfig(config) {
45
- this._initFilterWithConfig(config);
46
- }
47
- set setFilter(config) {
48
- this._initFilterWithConfig(config);
49
- }
50
- showSortBy = true;
51
- showFilterInput = true;
52
- closed = new EventEmitter();
53
- opened = new EventEmitter();
54
- ready = new EventEmitter();
55
- statusBar;
56
- keywordMatInput;
57
- reloadEl;
58
- showFilterMenu = false;
59
- windowDesktop = false;
60
- fsFilterClass = true;
61
- get hasKeyword() {
62
- return this._filterItems.hasKeyword;
63
- }
64
- searchPlaceholder = 'Search';
65
- keyword = '';
66
- autoReload = true;
67
- _config = null;
68
- _sort;
69
- _filtersBtnVisible$ = new BehaviorSubject(true);
70
- _keywordVisible$ = new BehaviorSubject(true);
71
- _hasFilterChips$ = new BehaviorSubject(false);
72
- _keyword$ = new Subject();
73
- _destroy$ = new Subject();
74
- constructor(_defaultConfig, _filterOverlay, _zone, _externalParams, _filterItems, _actions, _savedFiltersController, _externalParamsController) {
75
- this._defaultConfig = _defaultConfig;
76
- this._filterOverlay = _filterOverlay;
77
- this._zone = _zone;
78
- this._externalParams = _externalParams;
79
- this._filterItems = _filterItems;
80
- this._actions = _actions;
81
- this._savedFiltersController = _savedFiltersController;
82
- this._externalParamsController = _externalParamsController;
83
- this._filterItems.filter = this;
84
- this._listenWhenFilterReady();
85
- this._updateWindowWidth();
86
- this._filterOverlay.attach$
87
- .pipe(takeUntil(this._destroy$))
88
- .subscribe(() => {
89
- this.showFilterMenu = true;
90
- });
91
- this._filterOverlay.detach$
92
- .pipe(takeUntil(this._destroy$))
93
- .subscribe(() => {
94
- this.showFilterMenu = false;
95
- });
96
- this._listenWindowResize();
97
- }
98
- get config() {
99
- return this._config;
100
- }
101
- get filterParams() {
102
- return this._filterItems.values();
103
- }
104
- get filterParamsQuery() {
105
- return this._filterItems.valuesAsQuery();
106
- }
107
- get items() {
108
- return this._filterItems.items;
109
- }
110
- get visibleItems() {
111
- return this._filterItems.visibleItems;
112
- }
113
- get keywordItem() {
114
- return this._filterItems.keywordItem;
115
- }
116
- get itemsReady$() {
117
- return this._filterItems.ready$;
118
- }
119
- get hasFilterChips$() {
120
- return this._hasFilterChips$.asObservable();
121
- }
122
- get hasVisibleItemOrSorting() {
123
- return this.visibleItems.length > 0 || !!this._filterItems.sortByItem;
124
- }
125
- get filtersBtnVisible$() {
126
- return this._filtersBtnVisible$.asObservable();
127
- }
128
- get keywordVisible$() {
129
- return this._keywordVisible$.asObservable();
130
- }
131
- get actionsVisible$() {
132
- return this._actions.visible$;
133
- }
134
- get actions$() {
135
- return this._actions.actions$;
136
- }
137
- get menuActions$() {
138
- return this._actions.menuActions$;
139
- }
140
- set activeSavedFilter(savedFilter) {
141
- this._externalParams.setActiveSavedFilter(savedFilter);
142
- }
143
- get activeSavedFilter() {
144
- return this._savedFiltersController.activeFilter;
145
- }
146
- get savedFilters() {
147
- return this._savedFiltersController.savedFilters;
148
- }
149
- ngOnInit() {
150
- // Avoid ngChanges error
151
- setTimeout(() => {
152
- if (this.config.autofocus) {
153
- this.focus();
154
- }
155
- });
156
- this._initAutoReload();
157
- this._listenInputChanges();
158
- this._listenInternalItemsChange();
159
- this._initOverlay();
160
- }
161
- ngOnDestroy() {
162
- this._destroyFilterDrawer();
163
- this._destroy$.next();
164
- this._destroy$.complete();
165
- }
166
- focus() {
167
- this.keywordMatInput?.focus();
168
- }
169
- updateSort(sort) {
170
- this._filterItems.updateSort(sort);
171
- }
172
- /**
173
- *
174
- * Do update value of some field
175
- *
176
- * @param values - values for update
177
- *
178
- * To update text value just pass new text value
179
- *
180
- * public updateSelectValue(val) {
181
- * this.filterEl.updateValues({ keyword: val });
182
- * }
183
- *
184
- * To update select or observable select you could pass suitable value
185
- *
186
- * public updateSelectValue(val: number) {
187
- * this.filterEl.updateValues({ simple_select: val }, { observable_select: val });
188
- * }
189
- *
190
- * To update checkbox value just pass true/false as value
191
- *
192
- * public updateCheckox(val: boolean) {
193
- * this.filterEl.updateValues({ checkbox: val });
194
- * }
195
- *
196
- * To update range value just pass object with min&max object or just with one of targets
197
- *
198
- * Ex.: { min: 10, max 15 }, { min: 5 }, { max 5 }
199
- *
200
- * public updateRange(val) {
201
- * this.filterEl.updateValues({ range: val });
202
- * }
203
- *
204
- * To update autocomplete just pass object with name/value fields
205
- *
206
- * Ex.: { name: 'John Doe', value: 1 }
207
- *
208
- * public updateAutocomplete(val) {
209
- * this.filterEl.updateValues({ autocomplete_user_id: val });
210
- * }
211
- *
212
- * To update autocompletechips just pass:
213
- *
214
- * 1) object with name/value fields - will be appended to existing set of values
215
- *
216
- * { name: 'John Doe', value: 1 }
217
- *
218
- * 2) array of objects - will be appended to existing set of values
219
- *
220
- * [{ name: 'John Doe', value: 1 }, { name: 'Darya Filipova', value: 2 }]
221
- *
222
- * 3) null - clear existing set of values
223
- *
224
- * public updateAutocomplete(val) {
225
- * this.filterEl.updateValues({ autocompletechips_user_id: val });
226
- * }
227
- *
228
- */
229
- updateValues(values) {
230
- Object.keys(values).forEach((key) => {
231
- const filterItem = this.items
232
- .find((item) => item.name === key);
233
- if (!filterItem) {
234
- return;
235
- }
236
- filterItem.model = values[key];
237
- });
238
- }
239
- hide() {
240
- this.changeVisibility(false);
241
- }
242
- show() {
243
- this.changeVisibility(true);
244
- }
245
- changeVisibilityClick(value, event = null) {
246
- if (event) {
247
- event.stopPropagation();
248
- }
249
- this.changeVisibility(value);
250
- }
251
- get itemValues() {
252
- return this.items
253
- .map((item) => item.value);
254
- }
255
- get nonEmptyItemValues() {
256
- return this.items
257
- .filter((item) => item.value !== undefined)
258
- .map((item) => item.value);
259
- }
260
- get hasItemValues() {
261
- return this.items
262
- .some((item) => item.value !== undefined);
263
- }
264
- getItemValue(name) {
265
- const item = this.items
266
- .find((_item) => _item.name === name);
267
- return item?.value;
268
- }
269
- showItem(name) {
270
- const item = this.getItem(name);
271
- if (item) {
272
- item.hide = false;
273
- this._filterItems.updateItemsVisiblity();
274
- }
275
- }
276
- hideItem(name) {
277
- const item = this.getItem(name);
278
- if (!item) {
279
- return;
280
- }
281
- item.hide = true;
282
- this._filterItems.updateItemsVisiblity();
283
- }
284
- clearItem(name) {
285
- const item = this.getItem(name);
286
- if (!item) {
287
- return;
288
- }
289
- item.clear();
290
- }
291
- updateItemConfig(name, params) {
292
- const item = this.getItem(name);
293
- if (!item) {
294
- return;
295
- }
296
- item.label = params.label ?? item.label;
297
- item.chipLabel = params.chipLabel ?? item.chipLabel;
298
- this._filterItems.updateItemsVisiblity();
299
- }
300
- getItemValueChange$(name) {
301
- const item = this.items.find((i) => i.name === name);
302
- if (item) {
303
- return item.value$
304
- .pipe(map(() => {
305
- return item.model;
306
- }));
307
- }
308
- return null;
309
- }
310
- changeVisibility(state) {
311
- if (state === this.showFilterMenu) {
312
- return;
313
- }
314
- if (!state) {
315
- this.closed.emit();
316
- return this._destroyFilterDrawer();
317
- }
318
- if (!this.hasVisibleItemOrSorting) {
319
- return;
320
- }
321
- this._listenEscButton();
322
- this.opened.emit();
323
- this._filterOverlay.open();
324
- }
325
- init() {
326
- const data = this._filterItems.valuesAsQuery();
327
- this._sort = this._filterItems.getSort();
328
- if (this.config.init) {
329
- this.config.init(data, this._sort, this);
330
- }
331
- this._updateChipsVisibility();
332
- this.items
333
- .forEach((item) => {
334
- item.init(item, this);
335
- });
336
- }
337
- clear(event = null) {
338
- if (event) {
339
- event.stopPropagation();
340
- }
341
- this._filterItems.filtersClear();
342
- if (this.config.clear) {
343
- this.config.clear();
344
- }
345
- this.keyword = '';
346
- }
347
- /**
348
- * Close filter window and do change callback
349
- */
350
- search(event) {
351
- this.changeVisibilityClick(false, event);
352
- }
353
- reload(event = null) {
354
- if (event) {
355
- event.preventDefault();
356
- event.stopPropagation();
357
- }
358
- const data = this._filterItems.valuesAsQuery();
359
- const el = this.reloadEl?.nativeElement;
360
- if (el) {
361
- el.style.transition = 'all 0.75s 0.0s';
362
- el.style.transform = 'rotate(360deg)';
363
- setTimeout(() => {
364
- el.style.transition = null;
365
- el.style.transform = null;
366
- }, 1000);
367
- }
368
- if (this.config.reload) {
369
- this.config.reload(data, this._filterItems.getSort());
370
- }
371
- }
372
- getItem(name) {
373
- return this.items
374
- .find((item) => item.name === name);
375
- }
376
- fetchQueryParams() {
377
- this._externalParams.fetchQueryParams();
378
- }
379
- /**
380
- * Call change callback and apply new filter values
381
- */
382
- change() {
383
- const data = this._filterItems.valuesAsQuery();
384
- const sort = this._filterItems.getSort();
385
- const sortingChanged = ((!sort || !this._sort) && sort !== this._sort)
386
- || (sort && this._sort && !objectsAreEquals(this._sort, sort));
387
- if (sortingChanged) {
388
- this._sort = sort;
389
- if (this.config.sortChange) {
390
- this.config.sortChange(data, sort);
391
- }
392
- }
393
- if (this.config.change) {
394
- this.config.change(data, sort);
395
- }
396
- this._updateChipsVisibility();
397
- // visibility for actions can depend on filters state
398
- this._actions.updateActionsVisibility();
399
- }
400
- /**
401
- * Update filter actions config
402
- *
403
- * @param actions
404
- */
405
- updateActions(actions) {
406
- this._actions.initActions(actions);
407
- }
408
- /**
409
- * Show "Filters" button
410
- */
411
- showFiltersBtn() {
412
- this._filtersBtnVisible$.next(true);
413
- }
414
- /**
415
- * Hide "Filters" button
416
- */
417
- hideFiltersBtn() {
418
- this._filtersBtnVisible$.next(false);
419
- }
420
- /**
421
- * Show "Keyword" field if it present
422
- */
423
- showKeywordField() {
424
- this._keywordVisible$.next(true);
425
- }
426
- /**
427
- * Hide "Keyword" field if it present
428
- */
429
- hideKeywordField() {
430
- this._keywordVisible$.next(false);
431
- }
432
- /**
433
- * Go through actions and check show() callback and update visible actions
434
- */
435
- updateActionsVisibility() {
436
- this._actions.updateActionsVisibility();
437
- }
438
- /**
439
- * Go through actions and check disabled() callback and update disabled state
440
- */
441
- updateDisabledState() {
442
- this._actions.updateDisabledState();
443
- }
444
- setItems(items) {
445
- this._filterItems.destroyItems();
446
- this.config.items = items;
447
- this._filterItems.setConfig(this._config);
448
- this._externalParams.initItems();
449
- this._syncSearchInputWithKeyword();
450
- }
451
- keywordChange(keyword) {
452
- this._keyword$.next(keyword);
453
- }
454
- updateSortings(items) {
455
- this._filterItems.updateSortingItemsValues(items);
456
- }
457
- _initFilterWithConfig(config) {
458
- if (this.config) {
459
- this._filterItems.destroyItems();
460
- }
461
- config = {
462
- ...(this._defaultConfig || {}),
463
- ...config,
464
- };
465
- this._config = new FsFilterConfig(config);
466
- this._actions.setConfig(this._config);
467
- this._filterItems.setConfig(this._config);
468
- this._externalParams.setConfig(this._config);
469
- this._syncSearchInputWithKeyword();
470
- if (this.config.reloadWhenConfigChanged) {
471
- this.change();
472
- }
473
- }
474
- _destroyFilterDrawer() {
475
- this._filterOverlay.close();
476
- }
477
- _updateWindowWidth() {
478
- this.windowDesktop = window.innerWidth > 1200;
479
- }
480
- _listenEscButton() {
481
- this._zone.runOutsideAngular(() => {
482
- fromEvent(window, 'keyup')
483
- .pipe(filter((event) => event.code === 'Escape'), takeUntil(this.closed), takeUntil(this._destroy$))
484
- .subscribe(() => {
485
- this._zone.run(() => {
486
- this.changeVisibility(false);
487
- });
488
- });
489
- });
490
- }
491
- _listenWindowResize() {
492
- this._zone.runOutsideAngular(() => {
493
- fromEvent(window, 'resize')
494
- .pipe(debounceTime(100), takeUntil(this._destroy$))
495
- .subscribe(() => {
496
- this._zone.run(() => {
497
- this._updateWindowWidth();
498
- });
499
- });
500
- });
501
- }
502
- _initAutoReload() {
503
- if (this.config.autoReload) {
504
- interval(this.config.autoReload.seconds * 1000)
505
- .pipe(filter(() => this.autoReload), takeUntil(this._destroy$))
506
- .subscribe(() => {
507
- this.reload(null);
508
- });
509
- }
510
- }
511
- _listenInputChanges() {
512
- this._keyword$
513
- .pipe(debounceTime(200), distinctUntilChanged(), takeUntil(this._destroy$))
514
- .subscribe((value) => {
515
- const keywordItem = this._filterItems.keywordItem;
516
- keywordItem.model = value;
517
- this.change();
518
- });
519
- }
520
- _syncSearchInputWithKeyword() {
521
- const keywordItem = this._filterItems.keywordItem;
522
- if (keywordItem) {
523
- this.keyword = keywordItem.model;
524
- this.searchPlaceholder = keywordItem.label || 'Search';
525
- }
526
- }
527
- _listenInternalItemsChange() {
528
- this._filterItems
529
- .itemsChange$
530
- .pipe(takeUntil(this._destroy$))
531
- .subscribe(() => {
532
- this.change();
533
- });
534
- }
535
- _initOverlay() {
536
- this._filterOverlay.setClearFn(this.clear.bind(this));
537
- this._filterOverlay.setDoneFn(this.hide.bind(this));
538
- }
539
- // We may need some time to recieve external params and after that ready can be emitted
540
- _listenWhenFilterReady() {
541
- combineLatest([
542
- this._externalParams.pending$,
543
- this.itemsReady$,
544
- ])
545
- .pipe(filter(([pendingParams, itemsReady]) => !pendingParams && itemsReady), takeUntil(this._destroy$))
546
- .subscribe(() => {
547
- this.init();
548
- this._syncSearchInputWithKeyword();
549
- this.ready.emit();
550
- });
551
- }
552
- _updateChipsVisibility() {
553
- const hasFilterChips = this._filterItems.items
554
- .some((item) => {
555
- return item.isChipVisible;
556
- });
557
- this._hasFilterChips$.next(hasFilterChips);
558
- }
559
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FilterComponent, deps: [{ token: FS_FILTER_CONFIG, optional: true }, { token: i1.FsFilterOverlayService }, { token: i0.NgZone }, { token: i2.ExternalParamsController }, { token: i3.FsFilterItemsStore }, { token: i4.ActionsController }, { token: i5.SavedFiltersController }, { token: i2.ExternalParamsController }], target: i0.ɵɵFactoryTarget.Component });
560
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: FilterComponent, selector: "fs-filter", inputs: { setConfig: ["config", "setConfig"], setFilter: ["filter", "setFilter"], showSortBy: "showSortBy", showFilterInput: "showFilterInput" }, outputs: { closed: "closed", opened: "opened", ready: "ready" }, host: { properties: { "class.filters-open": "this.showFilterMenu", "class.window-desktop": "this.windowDesktop", "class.fs-filter": "this.fsFilterClass", "class.has-keyword": "this.hasKeyword" } }, providers: [
561
- FsFilterOverlayService,
562
- ExternalParamsController,
563
- PersistanceParamsController,
564
- QueryParamsController,
565
- FocusControllerService,
566
- FsFilterItemsStore,
567
- SavedFiltersController,
568
- ActionsController,
569
- ], queries: [{ propertyName: "statusBar", first: true, predicate: FilterStatusBarDirective, descendants: true }], viewQueries: [{ propertyName: "keywordMatInput", first: true, predicate: ["keywordMatInput"], descendants: true, read: MatInput }, { propertyName: "reloadEl", first: true, predicate: ["reloadEl"], descendants: true, read: ElementRef }], ngImport: i0, template: "<div class=\"filter-container\">\n <div class=\"filter-inner-container\">\n <ng-container *ngIf=\"!hasKeyword; else filterKeyword\">\n <div>\n <ng-container *ngTemplateOutlet=\"filterStatusBarChips\"></ng-container>\n </div>\n </ng-container>\n\n <ng-container [ngTemplateOutlet]=\"filterToolbar\"></ng-container>\n <ng-container [ngTemplateOutlet]=\"filterActions\"></ng-container>\n </div>\n\n <ng-container *ngIf=\"hasKeyword\">\n <ng-container *ngTemplateOutlet=\"filterStatusBarChips\"></ng-container>\n </ng-container>\n</div>\n\n<ng-template #filterStatusBarChips>\n <ng-container *ngIf=\"statusBar\">\n <div class=\"filter-status-container\" [ngClass]=\"{ 'has-status': !!filterStatus.textContent }\">\n <div class=\"filter-status\" #filterStatus>\n <ng-container *ngTemplateOutlet=\"statusBar.templateRef\"></ng-container>\n </div>\n </div>\n </ng-container>\n\n <ng-container *ngIf=\"config.chips && hasFilterChips$ | async\">\n <fs-filter-chips\n class=\"filter-chips\"\n [filters]=\"items\">\n </fs-filter-chips>\n </ng-container>\n</ng-template>\n\n<ng-template #filterKeyword>\n <div class=\"filter-keyword\">\n <ng-container *ngIf=\"(keywordVisible$ | async) && !keywordItem?.hide \">\n <mat-form-field\n class=\"form-field-padless\"\n [ngClass]=\"search\"\n appearance=\"outline\">\n <span matPrefix class=\"icon\">\n <mat-icon matPrefix>search</mat-icon>\n </span>\n <input\n #keywordMatInput\n matInput\n [(ngModel)]=\"keyword\"\n (ngModelChange)=\"keywordChange($event)\"\n name=\"filter-input\"\n [fsClear]=\"true\"\n [placeholder]=\"searchPlaceholder\">\n </mat-form-field>\n </ng-container>\n </div>\n</ng-template>\n\n<ng-template #filterActions>\n <div class=\"filter-actions\">\n <fs-filter-actions\n *ngIf=\"actionsVisible$ | async\"\n [actions]=\"actions$ | async\"\n [kebabActions]=\"menuActions$ | async\">\n </fs-filter-actions>\n </div>\n</ng-template>\n\n<ng-template #filterToolbar>\n <div class=\"filter-toobar\">\n <ng-container *ngIf=\"filtersBtnVisible$ | async\">\n <ng-container *ngIf=\"hasVisibleItemOrSorting\">\n <a\n mat-icon-button\n class=\"filters-button\"\n (click)=\"changeVisibilityClick(!showFilterMenu, $event)\"\n [color]=\"config.button.color\">\n <mat-icon *ngIf=\"config.button.icon\">{{config.button.icon}}</mat-icon>\n {{ config.button.label }}\n </a>\n </ng-container>\n </ng-container> \n <ng-container *ngIf=\"config.reload\">\n <a\n mat-icon-button\n (click)=\"reload($event)\"\n class=\"reload\">\n <mat-icon #reloadEl>refresh</mat-icon>\n </a>\n </ng-container>\n <ng-container *ngIf=\"config.autoReload\">\n <mat-slide-toggle \n name=\"autoReload\" \n class=\"auto-reload\"\n [(ngModel)]=\"autoReload\">\n Auto refresh\n </mat-slide-toggle>\n </ng-container>\n </div>\n</ng-template>\n", styles: [":host{margin-bottom:20px;display:block}:host.has-keyword .filter-status-container.has-status{margin-top:4px}:host:not(.has-keyword) .filter-status-container:not(.has-status)+fs-filter-chips{margin-top:0}:host:not(.has-keyword) .filter-inner-container{display:flex}:host:not(.has-keyword) .filter-toobar{justify-content:flex-end}.filter-status-container{flex-grow:1;display:flex;justify-content:center;flex-direction:column;align-self:flex-end}.filter-status-container .filter-status{overflow:hidden;text-overflow:ellipsis;line-height:17px}.filter-container{width:100%}.filter-inner-container{flex-direction:row;box-sizing:border-box;display:flex;position:relative;align-items:center}.filter-inner-container .filter-keyword{flex-direction:row;box-sizing:border-box;display:flex;align-items:center;min-width:0}.filter-inner-container .filter-keyword mat-form-field{max-width:100%;min-width:100px;margin-right:6px}.filter-inner-container .filter-keyword mat-form-field .icon{margin-left:10px}.filter-inner-container .filter-keyword mat-form-field .icon mat-icon{font-size:22px;color:#626262}.filter-inner-container .filter-keyword mat-form-field ::ng-deep .mat-mdc-form-field-subscript-wrapper{display:none}.filter-actions{display:flex;align-items:center}.filter-toobar{flex:1;white-space:nowrap;display:flex;align-items:center}.filter-toobar .reload{margin-left:-6px}.results{min-height:90px;position:relative;overflow-x:auto;overflow-y:hidden}fs-filter-chips{margin-top:4px;display:block}@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){html.fs-filter-open body{margin-right:350px}.fs-filter-backdrop{display:none}}html.fs-filter-open{scrollbar-width:none}:host ::ng-deep .auto-reload.mat-checked .mat-slide-toggle-thumb-container{transform:translate3d(12px,0,0)}:host ::ng-deep .auto-reload:not(.mat-checked) .mat-slide-toggle-content{color:#ccc}:host ::ng-deep .auto-reload .mat-slide-toggle-thumb,:host ::ng-deep .auto-reload .mat-slide-toggle-thumb-container{height:15px;width:15px}:host ::ng-deep .auto-reload .mat-slide-toggle-content{font-size:90%}:host ::ng-deep .auto-reload .mat-slide-toggle-bar{width:26px;height:10px;border-radius:10px}\n"], dependencies: [{ kind: "directive", type: i6.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i6.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i7.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i7.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i7.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i8.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i9.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i10.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i10.MatPrefix, selector: "[matPrefix], [matIconPrefix], [matTextPrefix]", inputs: ["matTextPrefix"] }, { kind: "component", type: i11.MatIconAnchor, selector: "a[mat-icon-button]", inputs: ["disabled", "disableRipple", "color", "tabIndex"], exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: i12.MatSlideToggle, selector: "mat-slide-toggle", inputs: ["disabled", "disableRipple", "color", "tabIndex"], exportAs: ["matSlideToggle"] }, { kind: "directive", type: i13.FsFormNoFsValidatorsDirective, selector: "[ngModel]:not([required]):not([fsFormRequired]):not([fsFormCompare]):not([fsFormDateRange]):not([fsFormEmail]):not([fsFormEmails]):not([fsFormFunction]):not([fsFormGreater]):not([fsFormGreaterEqual]):not([fsFormInteger]):not([fsFormLesser]):not([fsFormMax]):not([fsFormMaxLength]):not([fsFormMin]):not([fsFormMinLength]):not([fsFormNumeric]):not([fsFormPattern]):not([fsFormPhone]):not([fsFormUrl]):not([validate])" }, { kind: "component", type: i14.FsClearComponent, selector: "[fsClear]", inputs: ["ngModel", "fsClear"], outputs: ["ngModelChange", "cleared"] }, { kind: "component", type: i15.FsFilterChipsComponent, selector: "fs-filter-chips", inputs: ["filters"] }, { kind: "component", type: i16.FsFilterActionsComponent, selector: "fs-filter-actions", inputs: ["kebabActions", "actions"] }, { kind: "pipe", type: i6.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
570
- }
571
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FilterComponent, decorators: [{
572
- type: Component,
573
- args: [{ selector: 'fs-filter', providers: [
574
- FsFilterOverlayService,
575
- ExternalParamsController,
576
- PersistanceParamsController,
577
- QueryParamsController,
578
- FocusControllerService,
579
- FsFilterItemsStore,
580
- SavedFiltersController,
581
- ActionsController,
582
- ], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"filter-container\">\n <div class=\"filter-inner-container\">\n <ng-container *ngIf=\"!hasKeyword; else filterKeyword\">\n <div>\n <ng-container *ngTemplateOutlet=\"filterStatusBarChips\"></ng-container>\n </div>\n </ng-container>\n\n <ng-container [ngTemplateOutlet]=\"filterToolbar\"></ng-container>\n <ng-container [ngTemplateOutlet]=\"filterActions\"></ng-container>\n </div>\n\n <ng-container *ngIf=\"hasKeyword\">\n <ng-container *ngTemplateOutlet=\"filterStatusBarChips\"></ng-container>\n </ng-container>\n</div>\n\n<ng-template #filterStatusBarChips>\n <ng-container *ngIf=\"statusBar\">\n <div class=\"filter-status-container\" [ngClass]=\"{ 'has-status': !!filterStatus.textContent }\">\n <div class=\"filter-status\" #filterStatus>\n <ng-container *ngTemplateOutlet=\"statusBar.templateRef\"></ng-container>\n </div>\n </div>\n </ng-container>\n\n <ng-container *ngIf=\"config.chips && hasFilterChips$ | async\">\n <fs-filter-chips\n class=\"filter-chips\"\n [filters]=\"items\">\n </fs-filter-chips>\n </ng-container>\n</ng-template>\n\n<ng-template #filterKeyword>\n <div class=\"filter-keyword\">\n <ng-container *ngIf=\"(keywordVisible$ | async) && !keywordItem?.hide \">\n <mat-form-field\n class=\"form-field-padless\"\n [ngClass]=\"search\"\n appearance=\"outline\">\n <span matPrefix class=\"icon\">\n <mat-icon matPrefix>search</mat-icon>\n </span>\n <input\n #keywordMatInput\n matInput\n [(ngModel)]=\"keyword\"\n (ngModelChange)=\"keywordChange($event)\"\n name=\"filter-input\"\n [fsClear]=\"true\"\n [placeholder]=\"searchPlaceholder\">\n </mat-form-field>\n </ng-container>\n </div>\n</ng-template>\n\n<ng-template #filterActions>\n <div class=\"filter-actions\">\n <fs-filter-actions\n *ngIf=\"actionsVisible$ | async\"\n [actions]=\"actions$ | async\"\n [kebabActions]=\"menuActions$ | async\">\n </fs-filter-actions>\n </div>\n</ng-template>\n\n<ng-template #filterToolbar>\n <div class=\"filter-toobar\">\n <ng-container *ngIf=\"filtersBtnVisible$ | async\">\n <ng-container *ngIf=\"hasVisibleItemOrSorting\">\n <a\n mat-icon-button\n class=\"filters-button\"\n (click)=\"changeVisibilityClick(!showFilterMenu, $event)\"\n [color]=\"config.button.color\">\n <mat-icon *ngIf=\"config.button.icon\">{{config.button.icon}}</mat-icon>\n {{ config.button.label }}\n </a>\n </ng-container>\n </ng-container> \n <ng-container *ngIf=\"config.reload\">\n <a\n mat-icon-button\n (click)=\"reload($event)\"\n class=\"reload\">\n <mat-icon #reloadEl>refresh</mat-icon>\n </a>\n </ng-container>\n <ng-container *ngIf=\"config.autoReload\">\n <mat-slide-toggle \n name=\"autoReload\" \n class=\"auto-reload\"\n [(ngModel)]=\"autoReload\">\n Auto refresh\n </mat-slide-toggle>\n </ng-container>\n </div>\n</ng-template>\n", styles: [":host{margin-bottom:20px;display:block}:host.has-keyword .filter-status-container.has-status{margin-top:4px}:host:not(.has-keyword) .filter-status-container:not(.has-status)+fs-filter-chips{margin-top:0}:host:not(.has-keyword) .filter-inner-container{display:flex}:host:not(.has-keyword) .filter-toobar{justify-content:flex-end}.filter-status-container{flex-grow:1;display:flex;justify-content:center;flex-direction:column;align-self:flex-end}.filter-status-container .filter-status{overflow:hidden;text-overflow:ellipsis;line-height:17px}.filter-container{width:100%}.filter-inner-container{flex-direction:row;box-sizing:border-box;display:flex;position:relative;align-items:center}.filter-inner-container .filter-keyword{flex-direction:row;box-sizing:border-box;display:flex;align-items:center;min-width:0}.filter-inner-container .filter-keyword mat-form-field{max-width:100%;min-width:100px;margin-right:6px}.filter-inner-container .filter-keyword mat-form-field .icon{margin-left:10px}.filter-inner-container .filter-keyword mat-form-field .icon mat-icon{font-size:22px;color:#626262}.filter-inner-container .filter-keyword mat-form-field ::ng-deep .mat-mdc-form-field-subscript-wrapper{display:none}.filter-actions{display:flex;align-items:center}.filter-toobar{flex:1;white-space:nowrap;display:flex;align-items:center}.filter-toobar .reload{margin-left:-6px}.results{min-height:90px;position:relative;overflow-x:auto;overflow-y:hidden}fs-filter-chips{margin-top:4px;display:block}@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){html.fs-filter-open body{margin-right:350px}.fs-filter-backdrop{display:none}}html.fs-filter-open{scrollbar-width:none}:host ::ng-deep .auto-reload.mat-checked .mat-slide-toggle-thumb-container{transform:translate3d(12px,0,0)}:host ::ng-deep .auto-reload:not(.mat-checked) .mat-slide-toggle-content{color:#ccc}:host ::ng-deep .auto-reload .mat-slide-toggle-thumb,:host ::ng-deep .auto-reload .mat-slide-toggle-thumb-container{height:15px;width:15px}:host ::ng-deep .auto-reload .mat-slide-toggle-content{font-size:90%}:host ::ng-deep .auto-reload .mat-slide-toggle-bar{width:26px;height:10px;border-radius:10px}\n"] }]
583
- }], ctorParameters: function () { return [{ type: i17.FsFilterConfig, decorators: [{
584
- type: Optional
585
- }, {
586
- type: Inject,
587
- args: [FS_FILTER_CONFIG]
588
- }] }, { type: i1.FsFilterOverlayService }, { type: i0.NgZone }, { type: i2.ExternalParamsController }, { type: i3.FsFilterItemsStore }, { type: i4.ActionsController }, { type: i5.SavedFiltersController }, { type: i2.ExternalParamsController }]; }, propDecorators: { setConfig: [{
589
- type: Input,
590
- args: ['config']
591
- }], setFilter: [{
592
- type: Input,
593
- args: ['filter']
594
- }], showSortBy: [{
595
- type: Input
596
- }], showFilterInput: [{
597
- type: Input
598
- }], closed: [{
599
- type: Output
600
- }], opened: [{
601
- type: Output
602
- }], ready: [{
603
- type: Output
604
- }], statusBar: [{
605
- type: ContentChild,
606
- args: [FilterStatusBarDirective]
607
- }], keywordMatInput: [{
608
- type: ViewChild,
609
- args: ['keywordMatInput', { read: MatInput }]
610
- }], reloadEl: [{
611
- type: ViewChild,
612
- args: ['reloadEl', { read: ElementRef }]
613
- }], showFilterMenu: [{
614
- type: HostBinding,
615
- args: ['class.filters-open']
616
- }], windowDesktop: [{
617
- type: HostBinding,
618
- args: ['class.window-desktop']
619
- }], fsFilterClass: [{
620
- type: HostBinding,
621
- args: ['class.fs-filter']
622
- }], hasKeyword: [{
623
- type: HostBinding,
624
- args: ['class.has-keyword']
625
- }] } });
1
+ import { ChangeDetectionStrategy, Component, ContentChild, ElementRef, EventEmitter, HostBinding, Inject, Input, NgZone, Optional, Output, ViewChild, } from '@angular/core';
2
+ import { MatInput } from '@angular/material/input';
3
+ import { BehaviorSubject, combineLatest, fromEvent, interval, Subject } from 'rxjs';
4
+ import { debounceTime, distinctUntilChanged, filter, map, takeUntil } from 'rxjs/operators';
5
+ import { ActionsController } from '../../classes/actions-controller';
6
+ import { objectsAreEquals } from '../../helpers/compare';
7
+ import { FsFilterConfig } from '../../models/filter-config';
8
+ import { ExternalParamsController } from '../../services/external-params-controller.service';
9
+ import { PersistanceParamsController } from '../../services/external-params/persistance-params-controller.service';
10
+ import { QueryParamsController } from '../../services/external-params/query-params-controller.service';
11
+ import { SavedFiltersController } from '../../services/external-params/saved-filters-controller.service';
12
+ import { FsFilterOverlayService } from '../../services/filter-overlay.service';
13
+ import { FocusControllerService } from '../../services/focus-controller.service';
14
+ import { FsFilterItemsStore } from '../../services/items-store.service';
15
+ import { FilterStatusBarDirective } from './../../directives/status-bar/status-bar.directive';
16
+ import { FS_FILTER_CONFIG } from './../../injectors/filter-config';
17
+ import * as i0 from "@angular/core";
18
+ import * as i1 from "../../services/filter-overlay.service";
19
+ import * as i2 from "../../services/external-params-controller.service";
20
+ import * as i3 from "../../services/items-store.service";
21
+ import * as i4 from "../../classes/actions-controller";
22
+ import * as i5 from "../../services/external-params/saved-filters-controller.service";
23
+ import * as i6 from "@angular/common";
24
+ import * as i7 from "@angular/forms";
25
+ import * as i8 from "@angular/material/icon";
26
+ import * as i9 from "@angular/material/input";
27
+ import * as i10 from "@angular/material/form-field";
28
+ import * as i11 from "@angular/material/button";
29
+ import * as i12 from "@angular/material/slide-toggle";
30
+ import * as i13 from "@firestitch/form";
31
+ import * as i14 from "@firestitch/clear";
32
+ import * as i15 from "../filter-chips/filter-chips.component";
33
+ import * as i16 from "../actions/actions.component";
34
+ import * as i17 from "../../models/filter-config";
35
+ export class FilterComponent {
36
+ _defaultConfig;
37
+ _filterOverlay;
38
+ _zone;
39
+ _externalParams;
40
+ _filterItems;
41
+ _actions;
42
+ _savedFiltersController;
43
+ _externalParamsController;
44
+ set setConfig(config) {
45
+ this._initFilterWithConfig(config);
46
+ }
47
+ set setFilter(config) {
48
+ this._initFilterWithConfig(config);
49
+ }
50
+ showSortBy = true;
51
+ showFilterInput = true;
52
+ closed = new EventEmitter();
53
+ opened = new EventEmitter();
54
+ ready = new EventEmitter();
55
+ statusBar;
56
+ keywordMatInput;
57
+ reloadEl;
58
+ showFilterMenu = false;
59
+ windowDesktop = false;
60
+ fsFilterClass = true;
61
+ get hasKeyword() {
62
+ return this._filterItems.hasKeyword;
63
+ }
64
+ searchPlaceholder = 'Search';
65
+ keyword = '';
66
+ autoReload = true;
67
+ _config = null;
68
+ _sort;
69
+ _filtersBtnVisible$ = new BehaviorSubject(true);
70
+ _keywordVisible$ = new BehaviorSubject(true);
71
+ _hasFilterChips$ = new BehaviorSubject(false);
72
+ _keyword$ = new Subject();
73
+ _destroy$ = new Subject();
74
+ constructor(_defaultConfig, _filterOverlay, _zone, _externalParams, _filterItems, _actions, _savedFiltersController, _externalParamsController) {
75
+ this._defaultConfig = _defaultConfig;
76
+ this._filterOverlay = _filterOverlay;
77
+ this._zone = _zone;
78
+ this._externalParams = _externalParams;
79
+ this._filterItems = _filterItems;
80
+ this._actions = _actions;
81
+ this._savedFiltersController = _savedFiltersController;
82
+ this._externalParamsController = _externalParamsController;
83
+ this._filterItems.filter = this;
84
+ this._listenWhenFilterReady();
85
+ this._updateWindowWidth();
86
+ this._filterOverlay.attach$
87
+ .pipe(takeUntil(this._destroy$))
88
+ .subscribe(() => {
89
+ this.showFilterMenu = true;
90
+ });
91
+ this._filterOverlay.detach$
92
+ .pipe(takeUntil(this._destroy$))
93
+ .subscribe(() => {
94
+ this.showFilterMenu = false;
95
+ });
96
+ this._listenWindowResize();
97
+ }
98
+ get config() {
99
+ return this._config;
100
+ }
101
+ get filterParams() {
102
+ return this._filterItems.values();
103
+ }
104
+ get filterParamsQuery() {
105
+ return this._filterItems.valuesAsQuery();
106
+ }
107
+ get items() {
108
+ return this._filterItems.items;
109
+ }
110
+ get visibleItems() {
111
+ return this._filterItems.visibleItems;
112
+ }
113
+ get keywordItem() {
114
+ return this._filterItems.keywordItem;
115
+ }
116
+ get itemsReady$() {
117
+ return this._filterItems.ready$;
118
+ }
119
+ get hasFilterChips$() {
120
+ return this._hasFilterChips$.asObservable();
121
+ }
122
+ get hasVisibleItemOrSorting() {
123
+ return this.visibleItems.length > 0 || !!this._filterItems.sortByItem;
124
+ }
125
+ get filtersBtnVisible$() {
126
+ return this._filtersBtnVisible$.asObservable();
127
+ }
128
+ get keywordVisible$() {
129
+ return this._keywordVisible$.asObservable();
130
+ }
131
+ get actionsVisible$() {
132
+ return this._actions.visible$;
133
+ }
134
+ get actions$() {
135
+ return this._actions.actions$;
136
+ }
137
+ get menuActions$() {
138
+ return this._actions.menuActions$;
139
+ }
140
+ set activeSavedFilter(savedFilter) {
141
+ this._externalParams.setActiveSavedFilter(savedFilter);
142
+ }
143
+ get activeSavedFilter() {
144
+ return this._savedFiltersController.activeFilter;
145
+ }
146
+ get savedFilters() {
147
+ return this._savedFiltersController.savedFilters;
148
+ }
149
+ ngOnInit() {
150
+ // Avoid ngChanges error
151
+ setTimeout(() => {
152
+ if (this.config.autofocus) {
153
+ this.focus();
154
+ }
155
+ });
156
+ this._initAutoReload();
157
+ this._listenInputChanges();
158
+ this._listenInternalItemsChange();
159
+ this._initOverlay();
160
+ }
161
+ ngOnDestroy() {
162
+ this._destroyFilterDrawer();
163
+ this._destroy$.next();
164
+ this._destroy$.complete();
165
+ }
166
+ focus() {
167
+ this.keywordMatInput?.focus();
168
+ }
169
+ updateSort(sort) {
170
+ this._filterItems.updateSort(sort);
171
+ }
172
+ /**
173
+ *
174
+ * Do update value of some field
175
+ *
176
+ * @param values - values for update
177
+ *
178
+ * To update text value just pass new text value
179
+ *
180
+ * public updateSelectValue(val) {
181
+ * this.filterEl.updateValues({ keyword: val });
182
+ * }
183
+ *
184
+ * To update select or observable select you could pass suitable value
185
+ *
186
+ * public updateSelectValue(val: number) {
187
+ * this.filterEl.updateValues({ simple_select: val }, { observable_select: val });
188
+ * }
189
+ *
190
+ * To update checkbox value just pass true/false as value
191
+ *
192
+ * public updateCheckox(val: boolean) {
193
+ * this.filterEl.updateValues({ checkbox: val });
194
+ * }
195
+ *
196
+ * To update range value just pass object with min&max object or just with one of targets
197
+ *
198
+ * Ex.: { min: 10, max 15 }, { min: 5 }, { max 5 }
199
+ *
200
+ * public updateRange(val) {
201
+ * this.filterEl.updateValues({ range: val });
202
+ * }
203
+ *
204
+ * To update autocomplete just pass object with name/value fields
205
+ *
206
+ * Ex.: { name: 'John Doe', value: 1 }
207
+ *
208
+ * public updateAutocomplete(val) {
209
+ * this.filterEl.updateValues({ autocomplete_user_id: val });
210
+ * }
211
+ *
212
+ * To update autocompletechips just pass:
213
+ *
214
+ * 1) object with name/value fields - will be appended to existing set of values
215
+ *
216
+ * { name: 'John Doe', value: 1 }
217
+ *
218
+ * 2) array of objects - will be appended to existing set of values
219
+ *
220
+ * [{ name: 'John Doe', value: 1 }, { name: 'Darya Filipova', value: 2 }]
221
+ *
222
+ * 3) null - clear existing set of values
223
+ *
224
+ * public updateAutocomplete(val) {
225
+ * this.filterEl.updateValues({ autocompletechips_user_id: val });
226
+ * }
227
+ *
228
+ */
229
+ updateValues(values) {
230
+ Object.keys(values).forEach((key) => {
231
+ const filterItem = this.items
232
+ .find((item) => item.name === key);
233
+ if (!filterItem) {
234
+ return;
235
+ }
236
+ filterItem.model = values[key];
237
+ });
238
+ }
239
+ hide() {
240
+ this.changeVisibility(false);
241
+ }
242
+ show() {
243
+ this.changeVisibility(true);
244
+ }
245
+ changeVisibilityClick(value, event = null) {
246
+ if (event) {
247
+ event.stopPropagation();
248
+ }
249
+ this.changeVisibility(value);
250
+ }
251
+ get itemValues() {
252
+ return this.items
253
+ .map((item) => item.value);
254
+ }
255
+ get nonEmptyItemValues() {
256
+ return this.items
257
+ .filter((item) => item.value !== undefined)
258
+ .map((item) => item.value);
259
+ }
260
+ get hasItemValues() {
261
+ return this.items
262
+ .some((item) => item.value !== undefined);
263
+ }
264
+ getItemValue(name) {
265
+ const item = this.items
266
+ .find((_item) => _item.name === name);
267
+ return item?.value;
268
+ }
269
+ showItem(name) {
270
+ const item = this.getItem(name);
271
+ if (item) {
272
+ item.hide = false;
273
+ this._filterItems.updateItemsVisiblity();
274
+ }
275
+ }
276
+ hideItem(name) {
277
+ const item = this.getItem(name);
278
+ if (!item) {
279
+ return;
280
+ }
281
+ item.hide = true;
282
+ this._filterItems.updateItemsVisiblity();
283
+ }
284
+ clearItem(name) {
285
+ const item = this.getItem(name);
286
+ if (!item) {
287
+ return;
288
+ }
289
+ item.clear();
290
+ }
291
+ updateItemConfig(name, params) {
292
+ const item = this.getItem(name);
293
+ if (!item) {
294
+ return;
295
+ }
296
+ item.label = params.label ?? item.label;
297
+ item.chipLabel = params.chipLabel ?? item.chipLabel;
298
+ this._filterItems.updateItemsVisiblity();
299
+ }
300
+ getItemValueChange$(name) {
301
+ const item = this.items.find((i) => i.name === name);
302
+ if (item) {
303
+ return item.value$
304
+ .pipe(map(() => {
305
+ return item.model;
306
+ }));
307
+ }
308
+ return null;
309
+ }
310
+ changeVisibility(state) {
311
+ if (state === this.showFilterMenu) {
312
+ return;
313
+ }
314
+ if (!state) {
315
+ this.closed.emit();
316
+ return this._destroyFilterDrawer();
317
+ }
318
+ if (!this.hasVisibleItemOrSorting) {
319
+ return;
320
+ }
321
+ this._listenEscButton();
322
+ this.opened.emit();
323
+ this._filterOverlay.open();
324
+ }
325
+ init() {
326
+ const data = this._filterItems.valuesAsQuery();
327
+ this._sort = this._filterItems.getSort();
328
+ if (this.config.init) {
329
+ this.config.init(data, this._sort, this);
330
+ }
331
+ this._updateChipsVisibility();
332
+ this.items
333
+ .forEach((item) => {
334
+ item.init(item, this);
335
+ });
336
+ }
337
+ clear(event = null) {
338
+ if (event) {
339
+ event.stopPropagation();
340
+ }
341
+ this._filterItems.filtersClear();
342
+ if (this.config.clear) {
343
+ this.config.clear();
344
+ }
345
+ this.keyword = '';
346
+ }
347
+ /**
348
+ * Close filter window and do change callback
349
+ */
350
+ search(event) {
351
+ this.changeVisibilityClick(false, event);
352
+ }
353
+ reload(event = null) {
354
+ if (event) {
355
+ event.preventDefault();
356
+ event.stopPropagation();
357
+ }
358
+ const data = this._filterItems.valuesAsQuery();
359
+ const el = this.reloadEl?.nativeElement;
360
+ if (el) {
361
+ el.style.transition = 'all 0.75s 0.0s';
362
+ el.style.transform = 'rotate(360deg)';
363
+ setTimeout(() => {
364
+ el.style.transition = null;
365
+ el.style.transform = null;
366
+ }, 1000);
367
+ }
368
+ if (this.config.reload) {
369
+ this.config.reload(data, this._filterItems.getSort());
370
+ }
371
+ }
372
+ getItem(name) {
373
+ return this.items
374
+ .find((item) => item.name === name);
375
+ }
376
+ fetchQueryParams() {
377
+ this._externalParams.fetchQueryParams();
378
+ }
379
+ /**
380
+ * Call change callback and apply new filter values
381
+ */
382
+ change() {
383
+ const data = this._filterItems.valuesAsQuery();
384
+ const sort = this._filterItems.getSort();
385
+ const sortingChanged = ((!sort || !this._sort) && sort !== this._sort)
386
+ || (sort && this._sort && !objectsAreEquals(this._sort, sort));
387
+ if (sortingChanged) {
388
+ this._sort = sort;
389
+ if (this.config.sortChange) {
390
+ this.config.sortChange(data, sort);
391
+ }
392
+ }
393
+ if (this.config.change) {
394
+ this.config.change(data, sort);
395
+ }
396
+ this._updateChipsVisibility();
397
+ // visibility for actions can depend on filters state
398
+ this._actions.updateActionsVisibility();
399
+ }
400
+ /**
401
+ * Update filter actions config
402
+ *
403
+ * @param actions
404
+ */
405
+ updateActions(actions) {
406
+ this._actions.initActions(actions);
407
+ }
408
+ /**
409
+ * Show "Filters" button
410
+ */
411
+ showFiltersBtn() {
412
+ this._filtersBtnVisible$.next(true);
413
+ }
414
+ /**
415
+ * Hide "Filters" button
416
+ */
417
+ hideFiltersBtn() {
418
+ this._filtersBtnVisible$.next(false);
419
+ }
420
+ /**
421
+ * Show "Keyword" field if it present
422
+ */
423
+ showKeywordField() {
424
+ this._keywordVisible$.next(true);
425
+ }
426
+ /**
427
+ * Hide "Keyword" field if it present
428
+ */
429
+ hideKeywordField() {
430
+ this._keywordVisible$.next(false);
431
+ }
432
+ /**
433
+ * Go through actions and check show() callback and update visible actions
434
+ */
435
+ updateActionsVisibility() {
436
+ this._actions.updateActionsVisibility();
437
+ }
438
+ /**
439
+ * Go through actions and check disabled() callback and update disabled state
440
+ */
441
+ updateDisabledState() {
442
+ this._actions.updateDisabledState();
443
+ }
444
+ setItems(items) {
445
+ this._filterItems.destroyItems();
446
+ this.config.items = items;
447
+ this._filterItems.setConfig(this._config);
448
+ this._externalParams.initItems();
449
+ this._syncSearchInputWithKeyword();
450
+ }
451
+ keywordChange(keyword) {
452
+ this._keyword$.next(keyword);
453
+ }
454
+ updateSortings(items) {
455
+ this._filterItems.updateSortingItemsValues(items);
456
+ }
457
+ _initFilterWithConfig(config) {
458
+ if (this.config) {
459
+ this._filterItems.destroyItems();
460
+ }
461
+ config = {
462
+ ...(this._defaultConfig || {}),
463
+ ...config,
464
+ };
465
+ this._config = new FsFilterConfig(config);
466
+ this._actions.setConfig(this._config);
467
+ this._filterItems.setConfig(this._config);
468
+ this._externalParams.setConfig(this._config);
469
+ this._syncSearchInputWithKeyword();
470
+ if (this.config.reloadWhenConfigChanged) {
471
+ this.change();
472
+ }
473
+ }
474
+ _destroyFilterDrawer() {
475
+ this._filterOverlay.close();
476
+ }
477
+ _updateWindowWidth() {
478
+ this.windowDesktop = window.innerWidth > 1200;
479
+ }
480
+ _listenEscButton() {
481
+ this._zone.runOutsideAngular(() => {
482
+ fromEvent(window, 'keyup')
483
+ .pipe(filter((event) => event.code === 'Escape'), takeUntil(this.closed), takeUntil(this._destroy$))
484
+ .subscribe(() => {
485
+ this._zone.run(() => {
486
+ this.changeVisibility(false);
487
+ });
488
+ });
489
+ });
490
+ }
491
+ _listenWindowResize() {
492
+ this._zone.runOutsideAngular(() => {
493
+ fromEvent(window, 'resize')
494
+ .pipe(debounceTime(100), takeUntil(this._destroy$))
495
+ .subscribe(() => {
496
+ this._zone.run(() => {
497
+ this._updateWindowWidth();
498
+ });
499
+ });
500
+ });
501
+ }
502
+ _initAutoReload() {
503
+ if (this.config.autoReload) {
504
+ interval(this.config.autoReload.seconds * 1000)
505
+ .pipe(filter(() => this.autoReload), takeUntil(this._destroy$))
506
+ .subscribe(() => {
507
+ this.reload(null);
508
+ });
509
+ }
510
+ }
511
+ _listenInputChanges() {
512
+ this._keyword$
513
+ .pipe(debounceTime(200), distinctUntilChanged(), takeUntil(this._destroy$))
514
+ .subscribe((value) => {
515
+ const keywordItem = this._filterItems.keywordItem;
516
+ keywordItem.model = value;
517
+ this.change();
518
+ });
519
+ }
520
+ _syncSearchInputWithKeyword() {
521
+ const keywordItem = this._filterItems.keywordItem;
522
+ if (keywordItem) {
523
+ this.keyword = keywordItem.model;
524
+ this.searchPlaceholder = keywordItem.label || 'Search';
525
+ }
526
+ }
527
+ _listenInternalItemsChange() {
528
+ this._filterItems
529
+ .itemsChange$
530
+ .pipe(takeUntil(this._destroy$))
531
+ .subscribe(() => {
532
+ this.change();
533
+ });
534
+ }
535
+ _initOverlay() {
536
+ this._filterOverlay.setClearFn(this.clear.bind(this));
537
+ this._filterOverlay.setDoneFn(this.hide.bind(this));
538
+ }
539
+ // We may need some time to recieve external params and after that ready can be emitted
540
+ _listenWhenFilterReady() {
541
+ combineLatest([
542
+ this._externalParams.pending$,
543
+ this.itemsReady$,
544
+ ])
545
+ .pipe(filter(([pendingParams, itemsReady]) => !pendingParams && itemsReady), takeUntil(this._destroy$))
546
+ .subscribe(() => {
547
+ this.init();
548
+ this._syncSearchInputWithKeyword();
549
+ this.ready.emit();
550
+ });
551
+ }
552
+ _updateChipsVisibility() {
553
+ const hasFilterChips = this._filterItems.items
554
+ .some((item) => {
555
+ return item.isChipVisible;
556
+ });
557
+ this._hasFilterChips$.next(hasFilterChips);
558
+ }
559
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FilterComponent, deps: [{ token: FS_FILTER_CONFIG, optional: true }, { token: i1.FsFilterOverlayService }, { token: i0.NgZone }, { token: i2.ExternalParamsController }, { token: i3.FsFilterItemsStore }, { token: i4.ActionsController }, { token: i5.SavedFiltersController }, { token: i2.ExternalParamsController }], target: i0.ɵɵFactoryTarget.Component });
560
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: FilterComponent, selector: "fs-filter", inputs: { setConfig: ["config", "setConfig"], setFilter: ["filter", "setFilter"], showSortBy: "showSortBy", showFilterInput: "showFilterInput" }, outputs: { closed: "closed", opened: "opened", ready: "ready" }, host: { properties: { "class.filters-open": "this.showFilterMenu", "class.window-desktop": "this.windowDesktop", "class.fs-filter": "this.fsFilterClass", "class.has-keyword": "this.hasKeyword" } }, providers: [
561
+ FsFilterOverlayService,
562
+ ExternalParamsController,
563
+ PersistanceParamsController,
564
+ QueryParamsController,
565
+ FocusControllerService,
566
+ FsFilterItemsStore,
567
+ SavedFiltersController,
568
+ ActionsController,
569
+ ], queries: [{ propertyName: "statusBar", first: true, predicate: FilterStatusBarDirective, descendants: true }], viewQueries: [{ propertyName: "keywordMatInput", first: true, predicate: ["keywordMatInput"], descendants: true, read: MatInput }, { propertyName: "reloadEl", first: true, predicate: ["reloadEl"], descendants: true, read: ElementRef }], ngImport: i0, template: "<div class=\"filter-container\">\n <div class=\"filter-inner-container\">\n <ng-container *ngIf=\"!hasKeyword; else filterKeyword\">\n <div>\n <ng-container *ngTemplateOutlet=\"filterStatusBarChips\"></ng-container>\n </div>\n </ng-container>\n\n <ng-container [ngTemplateOutlet]=\"filterToolbar\"></ng-container>\n <ng-container [ngTemplateOutlet]=\"filterActions\"></ng-container>\n </div>\n\n <ng-container *ngIf=\"hasKeyword\">\n <ng-container *ngTemplateOutlet=\"filterStatusBarChips\"></ng-container>\n </ng-container>\n</div>\n\n<ng-template #filterStatusBarChips>\n <ng-container *ngIf=\"statusBar\">\n <div class=\"filter-status-container\" [ngClass]=\"{ 'has-status': !!filterStatus.textContent }\">\n <div class=\"filter-status\" #filterStatus>\n <ng-container *ngTemplateOutlet=\"statusBar.templateRef\"></ng-container>\n </div>\n </div>\n </ng-container>\n\n <ng-container *ngIf=\"config.chips && hasFilterChips$ | async\">\n <fs-filter-chips\n class=\"filter-chips\"\n [filters]=\"items\">\n </fs-filter-chips>\n </ng-container>\n</ng-template>\n\n<ng-template #filterKeyword>\n <div class=\"filter-keyword\">\n <ng-container *ngIf=\"(keywordVisible$ | async) && !keywordItem?.hide \">\n <mat-form-field\n class=\"form-field-padless\"\n [ngClass]=\"search\"\n appearance=\"outline\">\n <span matPrefix class=\"icon\">\n <mat-icon matPrefix>search</mat-icon>\n </span>\n <input\n #keywordMatInput\n matInput\n [(ngModel)]=\"keyword\"\n (ngModelChange)=\"keywordChange($event)\"\n name=\"filter-input\"\n [fsClear]=\"true\"\n [placeholder]=\"searchPlaceholder\">\n </mat-form-field>\n </ng-container>\n </div>\n</ng-template>\n\n<ng-template #filterActions>\n <div class=\"filter-actions\">\n <fs-filter-actions\n *ngIf=\"actionsVisible$ | async\"\n [actions]=\"actions$ | async\"\n [kebabActions]=\"menuActions$ | async\">\n </fs-filter-actions>\n </div>\n</ng-template>\n\n<ng-template #filterToolbar>\n <div class=\"filter-toobar\">\n <ng-container *ngIf=\"filtersBtnVisible$ | async\">\n <ng-container *ngIf=\"hasVisibleItemOrSorting\">\n <a\n mat-icon-button\n class=\"filters-button\"\n (click)=\"changeVisibilityClick(!showFilterMenu, $event)\"\n [color]=\"config.button.color\">\n <mat-icon *ngIf=\"config.button.icon\">{{config.button.icon}}</mat-icon>\n {{ config.button.label }}\n </a>\n </ng-container>\n </ng-container> \n <ng-container *ngIf=\"config.reload\">\n <a\n mat-icon-button\n (click)=\"reload($event)\"\n class=\"reload\">\n <mat-icon #reloadEl>refresh</mat-icon>\n </a>\n </ng-container>\n <ng-container *ngIf=\"config.autoReload\">\n <mat-slide-toggle \n name=\"autoReload\" \n class=\"auto-reload\"\n [(ngModel)]=\"autoReload\">\n Auto refresh\n </mat-slide-toggle>\n </ng-container>\n </div>\n</ng-template>\n", styles: [":host{margin-bottom:20px;display:block}:host.has-keyword .filter-status-container.has-status{margin-top:4px}:host:not(.has-keyword) .filter-status-container:not(.has-status)+fs-filter-chips{margin-top:0}:host:not(.has-keyword) .filter-inner-container{display:flex}:host:not(.has-keyword) .filter-toobar{justify-content:flex-end}.filter-status-container{flex-grow:1;display:flex;justify-content:center;flex-direction:column;align-self:flex-end}.filter-status-container .filter-status{overflow:hidden;text-overflow:ellipsis;line-height:17px}.filter-container{width:100%}.filter-inner-container{flex-direction:row;box-sizing:border-box;display:flex;position:relative;align-items:center}.filter-inner-container .filter-keyword{flex-direction:row;box-sizing:border-box;display:flex;align-items:center;min-width:0}.filter-inner-container .filter-keyword mat-form-field{max-width:100%;min-width:100px;margin-right:6px}.filter-inner-container .filter-keyword mat-form-field .icon{margin-left:10px}.filter-inner-container .filter-keyword mat-form-field .icon mat-icon{font-size:22px;color:#626262}.filter-inner-container .filter-keyword mat-form-field ::ng-deep .mat-mdc-form-field-subscript-wrapper{display:none}.filter-actions{display:flex;align-items:center}.filter-toobar{flex:1;white-space:nowrap;display:flex;align-items:center}.filter-toobar .reload{margin-left:-6px}.results{min-height:90px;position:relative;overflow-x:auto;overflow-y:hidden}fs-filter-chips{margin-top:4px;display:block}@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){html.fs-filter-open body{margin-right:350px}.fs-filter-backdrop{display:none}}html.fs-filter-open{scrollbar-width:none}:host ::ng-deep .auto-reload.mat-checked .mat-slide-toggle-thumb-container{transform:translate3d(12px,0,0)}:host ::ng-deep .auto-reload:not(.mat-checked) .mat-slide-toggle-content{color:#ccc}:host ::ng-deep .auto-reload .mat-slide-toggle-thumb,:host ::ng-deep .auto-reload .mat-slide-toggle-thumb-container{height:15px;width:15px}:host ::ng-deep .auto-reload .mat-slide-toggle-content{font-size:90%}:host ::ng-deep .auto-reload .mat-slide-toggle-bar{width:26px;height:10px;border-radius:10px}\n"], dependencies: [{ kind: "directive", type: i6.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i6.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i7.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i7.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i7.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i8.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i9.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i10.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i10.MatPrefix, selector: "[matPrefix], [matIconPrefix], [matTextPrefix]", inputs: ["matTextPrefix"] }, { kind: "component", type: i11.MatIconAnchor, selector: "a[mat-icon-button]", inputs: ["disabled", "disableRipple", "color", "tabIndex"], exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: i12.MatSlideToggle, selector: "mat-slide-toggle", inputs: ["disabled", "disableRipple", "color", "tabIndex"], exportAs: ["matSlideToggle"] }, { kind: "directive", type: i13.FsFormNoFsValidatorsDirective, selector: "[ngModel]:not([required]):not([fsFormRequired]):not([fsFormCompare]):not([fsFormDateRange]):not([fsFormEmail]):not([fsFormEmails]):not([fsFormFunction]):not([fsFormGreater]):not([fsFormGreaterEqual]):not([fsFormInteger]):not([fsFormLesser]):not([fsFormMax]):not([fsFormMaxLength]):not([fsFormMin]):not([fsFormMinLength]):not([fsFormNumeric]):not([fsFormPattern]):not([fsFormPhone]):not([fsFormUrl]):not([validate])" }, { kind: "component", type: i14.FsClearComponent, selector: "[fsClear]", inputs: ["ngModel", "fsClear"], outputs: ["ngModelChange", "cleared"] }, { kind: "component", type: i15.FsFilterChipsComponent, selector: "fs-filter-chips", inputs: ["filters"] }, { kind: "component", type: i16.FsFilterActionsComponent, selector: "fs-filter-actions", inputs: ["kebabActions", "actions"] }, { kind: "pipe", type: i6.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
570
+ }
571
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FilterComponent, decorators: [{
572
+ type: Component,
573
+ args: [{ selector: 'fs-filter', providers: [
574
+ FsFilterOverlayService,
575
+ ExternalParamsController,
576
+ PersistanceParamsController,
577
+ QueryParamsController,
578
+ FocusControllerService,
579
+ FsFilterItemsStore,
580
+ SavedFiltersController,
581
+ ActionsController,
582
+ ], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"filter-container\">\n <div class=\"filter-inner-container\">\n <ng-container *ngIf=\"!hasKeyword; else filterKeyword\">\n <div>\n <ng-container *ngTemplateOutlet=\"filterStatusBarChips\"></ng-container>\n </div>\n </ng-container>\n\n <ng-container [ngTemplateOutlet]=\"filterToolbar\"></ng-container>\n <ng-container [ngTemplateOutlet]=\"filterActions\"></ng-container>\n </div>\n\n <ng-container *ngIf=\"hasKeyword\">\n <ng-container *ngTemplateOutlet=\"filterStatusBarChips\"></ng-container>\n </ng-container>\n</div>\n\n<ng-template #filterStatusBarChips>\n <ng-container *ngIf=\"statusBar\">\n <div class=\"filter-status-container\" [ngClass]=\"{ 'has-status': !!filterStatus.textContent }\">\n <div class=\"filter-status\" #filterStatus>\n <ng-container *ngTemplateOutlet=\"statusBar.templateRef\"></ng-container>\n </div>\n </div>\n </ng-container>\n\n <ng-container *ngIf=\"config.chips && hasFilterChips$ | async\">\n <fs-filter-chips\n class=\"filter-chips\"\n [filters]=\"items\">\n </fs-filter-chips>\n </ng-container>\n</ng-template>\n\n<ng-template #filterKeyword>\n <div class=\"filter-keyword\">\n <ng-container *ngIf=\"(keywordVisible$ | async) && !keywordItem?.hide \">\n <mat-form-field\n class=\"form-field-padless\"\n [ngClass]=\"search\"\n appearance=\"outline\">\n <span matPrefix class=\"icon\">\n <mat-icon matPrefix>search</mat-icon>\n </span>\n <input\n #keywordMatInput\n matInput\n [(ngModel)]=\"keyword\"\n (ngModelChange)=\"keywordChange($event)\"\n name=\"filter-input\"\n [fsClear]=\"true\"\n [placeholder]=\"searchPlaceholder\">\n </mat-form-field>\n </ng-container>\n </div>\n</ng-template>\n\n<ng-template #filterActions>\n <div class=\"filter-actions\">\n <fs-filter-actions\n *ngIf=\"actionsVisible$ | async\"\n [actions]=\"actions$ | async\"\n [kebabActions]=\"menuActions$ | async\">\n </fs-filter-actions>\n </div>\n</ng-template>\n\n<ng-template #filterToolbar>\n <div class=\"filter-toobar\">\n <ng-container *ngIf=\"filtersBtnVisible$ | async\">\n <ng-container *ngIf=\"hasVisibleItemOrSorting\">\n <a\n mat-icon-button\n class=\"filters-button\"\n (click)=\"changeVisibilityClick(!showFilterMenu, $event)\"\n [color]=\"config.button.color\">\n <mat-icon *ngIf=\"config.button.icon\">{{config.button.icon}}</mat-icon>\n {{ config.button.label }}\n </a>\n </ng-container>\n </ng-container> \n <ng-container *ngIf=\"config.reload\">\n <a\n mat-icon-button\n (click)=\"reload($event)\"\n class=\"reload\">\n <mat-icon #reloadEl>refresh</mat-icon>\n </a>\n </ng-container>\n <ng-container *ngIf=\"config.autoReload\">\n <mat-slide-toggle \n name=\"autoReload\" \n class=\"auto-reload\"\n [(ngModel)]=\"autoReload\">\n Auto refresh\n </mat-slide-toggle>\n </ng-container>\n </div>\n</ng-template>\n", styles: [":host{margin-bottom:20px;display:block}:host.has-keyword .filter-status-container.has-status{margin-top:4px}:host:not(.has-keyword) .filter-status-container:not(.has-status)+fs-filter-chips{margin-top:0}:host:not(.has-keyword) .filter-inner-container{display:flex}:host:not(.has-keyword) .filter-toobar{justify-content:flex-end}.filter-status-container{flex-grow:1;display:flex;justify-content:center;flex-direction:column;align-self:flex-end}.filter-status-container .filter-status{overflow:hidden;text-overflow:ellipsis;line-height:17px}.filter-container{width:100%}.filter-inner-container{flex-direction:row;box-sizing:border-box;display:flex;position:relative;align-items:center}.filter-inner-container .filter-keyword{flex-direction:row;box-sizing:border-box;display:flex;align-items:center;min-width:0}.filter-inner-container .filter-keyword mat-form-field{max-width:100%;min-width:100px;margin-right:6px}.filter-inner-container .filter-keyword mat-form-field .icon{margin-left:10px}.filter-inner-container .filter-keyword mat-form-field .icon mat-icon{font-size:22px;color:#626262}.filter-inner-container .filter-keyword mat-form-field ::ng-deep .mat-mdc-form-field-subscript-wrapper{display:none}.filter-actions{display:flex;align-items:center}.filter-toobar{flex:1;white-space:nowrap;display:flex;align-items:center}.filter-toobar .reload{margin-left:-6px}.results{min-height:90px;position:relative;overflow-x:auto;overflow-y:hidden}fs-filter-chips{margin-top:4px;display:block}@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){html.fs-filter-open body{margin-right:350px}.fs-filter-backdrop{display:none}}html.fs-filter-open{scrollbar-width:none}:host ::ng-deep .auto-reload.mat-checked .mat-slide-toggle-thumb-container{transform:translate3d(12px,0,0)}:host ::ng-deep .auto-reload:not(.mat-checked) .mat-slide-toggle-content{color:#ccc}:host ::ng-deep .auto-reload .mat-slide-toggle-thumb,:host ::ng-deep .auto-reload .mat-slide-toggle-thumb-container{height:15px;width:15px}:host ::ng-deep .auto-reload .mat-slide-toggle-content{font-size:90%}:host ::ng-deep .auto-reload .mat-slide-toggle-bar{width:26px;height:10px;border-radius:10px}\n"] }]
583
+ }], ctorParameters: function () { return [{ type: i17.FsFilterConfig, decorators: [{
584
+ type: Optional
585
+ }, {
586
+ type: Inject,
587
+ args: [FS_FILTER_CONFIG]
588
+ }] }, { type: i1.FsFilterOverlayService }, { type: i0.NgZone }, { type: i2.ExternalParamsController }, { type: i3.FsFilterItemsStore }, { type: i4.ActionsController }, { type: i5.SavedFiltersController }, { type: i2.ExternalParamsController }]; }, propDecorators: { setConfig: [{
589
+ type: Input,
590
+ args: ['config']
591
+ }], setFilter: [{
592
+ type: Input,
593
+ args: ['filter']
594
+ }], showSortBy: [{
595
+ type: Input
596
+ }], showFilterInput: [{
597
+ type: Input
598
+ }], closed: [{
599
+ type: Output
600
+ }], opened: [{
601
+ type: Output
602
+ }], ready: [{
603
+ type: Output
604
+ }], statusBar: [{
605
+ type: ContentChild,
606
+ args: [FilterStatusBarDirective]
607
+ }], keywordMatInput: [{
608
+ type: ViewChild,
609
+ args: ['keywordMatInput', { read: MatInput }]
610
+ }], reloadEl: [{
611
+ type: ViewChild,
612
+ args: ['reloadEl', { read: ElementRef }]
613
+ }], showFilterMenu: [{
614
+ type: HostBinding,
615
+ args: ['class.filters-open']
616
+ }], windowDesktop: [{
617
+ type: HostBinding,
618
+ args: ['class.window-desktop']
619
+ }], fsFilterClass: [{
620
+ type: HostBinding,
621
+ args: ['class.fs-filter']
622
+ }], hasKeyword: [{
623
+ type: HostBinding,
624
+ args: ['class.has-keyword']
625
+ }] } });
626
626
  //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZmlsdGVyLmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3NyYy9hcHAvY29tcG9uZW50cy9maWx0ZXIvZmlsdGVyLmNvbXBvbmVudC50cyIsIi4uLy4uLy4uLy4uLy4uL3NyYy9hcHAvY29tcG9uZW50cy9maWx0ZXIvZmlsdGVyLmNvbXBvbmVudC5odG1sIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFDTCx1QkFBdUIsRUFDdkIsU0FBUyxFQUNULF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R5Q2xpY2soIXNob3dGaWx0ZXJNZW51LCAkZXZlbnQpXCJcbiAgICAgICAgICAgIFtjb2xvcl09XCJjb25maWcuYnV0dG9uLmNvbG9yXCI+XG4gICAgICAgICAgPG1hdC1pY29uICpuZ0lmPVwiY29uZmlnLmJ1dHRvbi5pY29uXCI+e3tjb25maWcuYnV0dG9uLmljb259fTwvbWF0LWljb24+XG4gICAgICAgICAge3sgY29uZmlnLmJ1dHRvbi5sYWJlbCB9fVxuICAgICAgICA8L2E+XG4gICAgICA8L25nLWNvbnRhaW5lcj5cbiAgICA8L25nLWNvbnRhaW5lcj4gICAgXG4gICAgPG5nLWNvbnRhaW5lciAqbmdJZj1cImNvbmZpZy5yZWxvYWRcIj5cbiAgICAgIDxhXG4gICAgICAgICAgbWF0LWljb24tYnV0dG9uXG4gICAgICAgICAgKGNsaWNrKT1cInJlbG9hZCgkZXZlbnQpXCJcbiAgICAgICAgICBjbGFzcz1cInJlbG9hZFwiPlxuICAgICAgICA8bWF0LWljb24gI3JlbG9hZEVsPnJlZnJlc2g8L21hdC1pY29uPlxuICAgICAgPC9hPlxuICAgIDwvbmctY29udGFpbmVyPlxuICAgIDxuZy1jb250YWluZXIgKm5nSWY9XCJjb25maWcuYXV0b1JlbG9hZFwiPlxuICAgICAgPG1hdC1zbGlkZS10b2dnbGUgXG4gICAgICAgICAgbmFtZT1cImF1dG9SZWxvYWRcIiBcbiAgICAgICAgICBjbGFzcz1cImF1dG8tcmVsb2FkXCJcbiAgICAgICAgICBbKG5nTW9kZWwpXT1cImF1dG9SZWxvYWRcIj5cbiAgICAgICAgQXV0byByZWZyZXNoXG4gICAgICA8L21hdC1zbGlkZS10b2dnbGU+XG4gICAgPC9uZy1jb250YWluZXI+XG4gIDwvZGl2PlxuPC9uZy10ZW1wbGF0ZT5cbiJdfQ==