@firestitch/filter 9.10.0 → 12.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (240) hide show
  1. package/app/classes/actions-controller.d.ts +3 -0
  2. package/app/components/action-button/action-button.component.d.ts +3 -0
  3. package/app/components/action-kebab-actions/action-kebab-actions.component.d.ts +3 -0
  4. package/app/components/actions/actions.component.d.ts +3 -0
  5. package/app/components/filter/filter.component.d.ts +3 -0
  6. package/app/components/filter-chip/filter-chip.component.d.ts +3 -0
  7. package/app/components/filter-chip-content/filter-chip-content.component.d.ts +3 -0
  8. package/app/components/filter-chips/filter-chips.component.d.ts +3 -0
  9. package/app/components/filter-drawer/filter-drawer.component.d.ts +3 -0
  10. package/app/components/filter-drawer-actions/filter-drawer-actions.component.d.ts +3 -0
  11. package/app/components/filters-item/autocomplete/autocomplete.component.d.ts +3 -0
  12. package/app/components/filters-item/autocompletechips/autocompletechips.component.d.ts +3 -0
  13. package/app/components/filters-item/base-item/base-item.component.d.ts +3 -0
  14. package/app/components/filters-item/checkbox/checkbox.component.d.ts +3 -0
  15. package/app/components/filters-item/chips/chips.component.d.ts +3 -0
  16. package/app/components/filters-item/date/date.component.d.ts +3 -0
  17. package/app/components/filters-item/date-range/date-range.component.d.ts +3 -0
  18. package/app/components/filters-item/filter-item.component.d.ts +3 -0
  19. package/app/components/filters-item/range/range.component.d.ts +3 -0
  20. package/app/components/filters-item/select/backdrop/backdrop.component.d.ts +3 -0
  21. package/app/components/filters-item/select/groups/groups.component.d.ts +3 -0
  22. package/app/components/filters-item/select/multiple/multiple.component.d.ts +3 -0
  23. package/app/components/filters-item/select/select.component.d.ts +3 -0
  24. package/app/components/filters-item/select/simple/simple.component.d.ts +3 -0
  25. package/app/components/filters-item/text/text.component.d.ts +3 -0
  26. package/app/components/saved-filter-edit/saved-filter-edit.component.d.ts +3 -0
  27. package/app/components/saved-filters-menu/saved-filters-menu.component.d.ts +3 -0
  28. package/app/directives/focus-to-item/focus-to-item.directive.d.ts +3 -0
  29. package/app/directives/status-bar/status-bar.directive.d.ts +3 -0
  30. package/app/fs-filter.module.d.ts +59 -0
  31. package/app/pipes/remove-isolate-value.pipe.d.ts +3 -0
  32. package/app/services/external-params/persistance-params-controller.service.d.ts +3 -0
  33. package/app/services/external-params/query-params-controller.service.d.ts +3 -0
  34. package/app/services/external-params/saved-filters-controller.service.d.ts +3 -0
  35. package/app/services/external-params-controller.service.d.ts +3 -0
  36. package/app/services/filter-overlay.service.d.ts +7 -1
  37. package/app/services/focus-controller.service.d.ts +4 -3
  38. package/app/services/items-store.service.d.ts +3 -0
  39. package/bundles/firestitch-filter.umd.js +2820 -2719
  40. package/bundles/firestitch-filter.umd.js.map +1 -1
  41. package/esm2015/app/classes/actions-controller.js +10 -12
  42. package/esm2015/app/components/action-button/action-button.component.js +23 -19
  43. package/esm2015/app/components/action-kebab-actions/action-kebab-actions.component.js +22 -17
  44. package/esm2015/app/components/actions/actions.component.js +27 -21
  45. package/esm2015/app/components/filter/filter.component.js +86 -91
  46. package/esm2015/app/components/filter-chip/filter-chip.component.js +22 -24
  47. package/esm2015/app/components/filter-chip-content/filter-chip-content.component.js +20 -26
  48. package/esm2015/app/components/filter-chips/filter-chips.component.js +21 -17
  49. package/esm2015/app/components/filter-drawer/filter-drawer.component.js +35 -37
  50. package/esm2015/app/components/filter-drawer-actions/filter-drawer-actions.component.js +22 -23
  51. package/esm2015/app/components/filters-item/autocomplete/autocomplete.component.js +17 -18
  52. package/esm2015/app/components/filters-item/autocompletechips/autocompletechips.component.js +17 -18
  53. package/esm2015/app/components/filters-item/base-item/base-item.component.js +19 -28
  54. package/esm2015/app/components/filters-item/checkbox/checkbox.component.js +18 -19
  55. package/esm2015/app/components/filters-item/chips/chips.component.js +19 -19
  56. package/esm2015/app/components/filters-item/date/date.component.js +21 -19
  57. package/esm2015/app/components/filters-item/date-range/date-range.component.js +20 -19
  58. package/esm2015/app/components/filters-item/filter-item.component.js +27 -21
  59. package/esm2015/app/components/filters-item/range/range.component.js +29 -28
  60. package/esm2015/app/components/filters-item/select/backdrop/backdrop.component.js +15 -14
  61. package/esm2015/app/components/filters-item/select/groups/groups.component.js +27 -25
  62. package/esm2015/app/components/filters-item/select/multiple/multiple.component.js +30 -26
  63. package/esm2015/app/components/filters-item/select/select.component.js +24 -23
  64. package/esm2015/app/components/filters-item/select/simple/simple.component.js +29 -25
  65. package/esm2015/app/components/filters-item/text/text.component.js +21 -20
  66. package/esm2015/app/components/saved-filter-edit/saved-filter-edit.component.js +25 -17
  67. package/esm2015/app/components/saved-filters-menu/saved-filters-menu.component.js +28 -33
  68. package/esm2015/app/consts/query-param-delimiter.js +1 -1
  69. package/esm2015/app/directives/focus-to-item/focus-to-item.directive.js +53 -47
  70. package/esm2015/app/directives/status-bar/status-bar.directive.js +12 -10
  71. package/esm2015/app/enums/action-mode.enum.js +1 -1
  72. package/esm2015/app/enums/action-type.enum.js +1 -1
  73. package/esm2015/app/enums/item-date-mode.enum.js +1 -1
  74. package/esm2015/app/enums/item-type.enum.js +1 -1
  75. package/esm2015/app/fs-filter.module.js +145 -56
  76. package/esm2015/app/helpers/build-query-params.js +1 -1
  77. package/esm2015/app/helpers/compare.js +1 -1
  78. package/esm2015/app/helpers/create-filter-item.js +1 -1
  79. package/esm2015/app/helpers/find-value.js +1 -1
  80. package/esm2015/app/helpers/get-range-name.js +1 -1
  81. package/esm2015/app/helpers/parse-item-value-from-stored.js +1 -1
  82. package/esm2015/app/helpers/query-param-transformers.js +1 -1
  83. package/esm2015/app/helpers/restore-items.js +1 -1
  84. package/esm2015/app/helpers/try-convert-to-number.js +1 -1
  85. package/esm2015/app/injectors/filter-config.js +1 -1
  86. package/esm2015/app/injectors/filter-drawer-data.js +1 -1
  87. package/esm2015/app/injectors/filter-drawer-overlay.js +1 -1
  88. package/esm2015/app/interfaces/action.interface.js +2 -1
  89. package/esm2015/app/interfaces/config.interface.js +2 -1
  90. package/esm2015/app/interfaces/external-params.interface.js +2 -1
  91. package/esm2015/app/interfaces/filter.interface.js +2 -1
  92. package/esm2015/app/interfaces/items/autocomplete-chips.interface.js +2 -1
  93. package/esm2015/app/interfaces/items/autocomplete.interface.js +2 -1
  94. package/esm2015/app/interfaces/items/base.interface.js +2 -1
  95. package/esm2015/app/interfaces/items/checkbox.interface.js +2 -1
  96. package/esm2015/app/interfaces/items/chips.interface.js +2 -1
  97. package/esm2015/app/interfaces/items/date-range.interface.js +2 -1
  98. package/esm2015/app/interfaces/items/date.interface.js +2 -1
  99. package/esm2015/app/interfaces/items/range.interface.js +2 -1
  100. package/esm2015/app/interfaces/items/select.interface.js +2 -1
  101. package/esm2015/app/interfaces/items/text.interface.js +2 -1
  102. package/esm2015/app/interfaces/saved-filters.interface.js +2 -1
  103. package/esm2015/app/interfaces/update-filter-item.interface.js +2 -1
  104. package/esm2015/app/models/action-menu-item.model.js +1 -1
  105. package/esm2015/app/models/action.model.js +1 -1
  106. package/esm2015/app/models/filter-config.js +1 -1
  107. package/esm2015/app/models/items/autocomplete/base-autocomplete-item.js +1 -1
  108. package/esm2015/app/models/items/autocomplete-chips-item.js +1 -1
  109. package/esm2015/app/models/items/autocomplete-item.js +1 -1
  110. package/esm2015/app/models/items/base-item.js +1 -1
  111. package/esm2015/app/models/items/checkbox-item.js +1 -1
  112. package/esm2015/app/models/items/chips-item.js +1 -1
  113. package/esm2015/app/models/items/date/base-date-item.js +1 -1
  114. package/esm2015/app/models/items/date-item.js +1 -1
  115. package/esm2015/app/models/items/date-range/base-date-range-item.js +1 -1
  116. package/esm2015/app/models/items/date-range-item.js +1 -1
  117. package/esm2015/app/models/items/date-time-item.js +1 -1
  118. package/esm2015/app/models/items/date-time-range-item.js +1 -1
  119. package/esm2015/app/models/items/range-item.js +1 -1
  120. package/esm2015/app/models/items/select/base-select-item.js +1 -1
  121. package/esm2015/app/models/items/select/multiple-select-item.js +1 -1
  122. package/esm2015/app/models/items/select/simple-select-item.js +1 -1
  123. package/esm2015/app/models/items/select-item.js +1 -1
  124. package/esm2015/app/models/items/text-item.js +1 -1
  125. package/esm2015/app/pipes/remove-isolate-value.pipe.js +12 -10
  126. package/esm2015/app/providers/filter-meta.js +1 -1
  127. package/esm2015/app/services/external-params/persistance-params-controller.service.js +19 -24
  128. package/esm2015/app/services/external-params/query-params-controller.service.js +11 -16
  129. package/esm2015/app/services/external-params/saved-filters-controller.service.js +11 -14
  130. package/esm2015/app/services/external-params-controller.service.js +14 -20
  131. package/esm2015/app/services/filter-overlay.service.js +30 -19
  132. package/esm2015/app/services/focus-controller.service.js +10 -18
  133. package/esm2015/app/services/items-store.service.js +9 -9
  134. package/esm2015/firestitch-filter.js +1 -40
  135. package/esm2015/public_api.js +2 -1
  136. package/fesm2015/firestitch-filter.js +1986 -1986
  137. package/fesm2015/firestitch-filter.js.map +1 -1
  138. package/firestitch-filter.d.ts +1 -39
  139. package/package.json +12 -15
  140. package/public_api.d.ts +1 -0
  141. package/bundles/firestitch-filter.umd.min.js +0 -16
  142. package/bundles/firestitch-filter.umd.min.js.map +0 -1
  143. package/esm5/app/classes/actions-controller.js +0 -151
  144. package/esm5/app/components/action-button/action-button.component.js +0 -24
  145. package/esm5/app/components/action-kebab-actions/action-kebab-actions.component.js +0 -21
  146. package/esm5/app/components/actions/actions.component.js +0 -27
  147. package/esm5/app/components/filter/filter.component.js +0 -701
  148. package/esm5/app/components/filter-chip/filter-chip.component.js +0 -99
  149. package/esm5/app/components/filter-chip-content/filter-chip-content.component.js +0 -92
  150. package/esm5/app/components/filter-chips/filter-chips.component.js +0 -22
  151. package/esm5/app/components/filter-drawer/filter-drawer.component.js +0 -91
  152. package/esm5/app/components/filter-drawer-actions/filter-drawer-actions.component.js +0 -49
  153. package/esm5/app/components/filters-item/autocomplete/autocomplete.component.js +0 -34
  154. package/esm5/app/components/filters-item/autocompletechips/autocompletechips.component.js +0 -56
  155. package/esm5/app/components/filters-item/base-item/base-item.component.js +0 -74
  156. package/esm5/app/components/filters-item/checkbox/checkbox.component.js +0 -29
  157. package/esm5/app/components/filters-item/chips/chips.component.js +0 -35
  158. package/esm5/app/components/filters-item/date/date.component.js +0 -46
  159. package/esm5/app/components/filters-item/date-range/date-range.component.js +0 -38
  160. package/esm5/app/components/filters-item/filter-item.component.js +0 -43
  161. package/esm5/app/components/filters-item/range/range.component.js +0 -54
  162. package/esm5/app/components/filters-item/select/backdrop/backdrop.component.js +0 -18
  163. package/esm5/app/components/filters-item/select/groups/groups.component.js +0 -33
  164. package/esm5/app/components/filters-item/select/multiple/multiple.component.js +0 -58
  165. package/esm5/app/components/filters-item/select/select.component.js +0 -46
  166. package/esm5/app/components/filters-item/select/simple/simple.component.js +0 -45
  167. package/esm5/app/components/filters-item/text/text.component.js +0 -58
  168. package/esm5/app/components/saved-filter-edit/saved-filter-edit.component.js +0 -49
  169. package/esm5/app/components/saved-filters-menu/saved-filters-menu.component.js +0 -72
  170. package/esm5/app/consts/query-param-delimiter.js +0 -2
  171. package/esm5/app/directives/focus-to-item/focus-to-item.directive.js +0 -126
  172. package/esm5/app/directives/status-bar/status-bar.directive.js +0 -14
  173. package/esm5/app/enums/action-mode.enum.js +0 -7
  174. package/esm5/app/enums/action-type.enum.js +0 -9
  175. package/esm5/app/enums/item-date-mode.enum.js +0 -7
  176. package/esm5/app/enums/item-type.enum.js +0 -16
  177. package/esm5/app/fs-filter.module.js +0 -152
  178. package/esm5/app/helpers/build-query-params.js +0 -32
  179. package/esm5/app/helpers/compare.js +0 -50
  180. package/esm5/app/helpers/create-filter-item.js +0 -51
  181. package/esm5/app/helpers/find-value.js +0 -13
  182. package/esm5/app/helpers/get-range-name.js +0 -9
  183. package/esm5/app/helpers/parse-item-value-from-stored.js +0 -77
  184. package/esm5/app/helpers/query-param-transformers.js +0 -9
  185. package/esm5/app/helpers/restore-items.js +0 -43
  186. package/esm5/app/helpers/try-convert-to-number.js +0 -6
  187. package/esm5/app/injectors/filter-config.js +0 -3
  188. package/esm5/app/injectors/filter-drawer-data.js +0 -3
  189. package/esm5/app/injectors/filter-drawer-overlay.js +0 -3
  190. package/esm5/app/interfaces/action.interface.js +0 -1
  191. package/esm5/app/interfaces/config.interface.js +0 -1
  192. package/esm5/app/interfaces/external-params.interface.js +0 -1
  193. package/esm5/app/interfaces/filter.interface.js +0 -1
  194. package/esm5/app/interfaces/items/autocomplete-chips.interface.js +0 -1
  195. package/esm5/app/interfaces/items/autocomplete.interface.js +0 -1
  196. package/esm5/app/interfaces/items/base.interface.js +0 -1
  197. package/esm5/app/interfaces/items/checkbox.interface.js +0 -1
  198. package/esm5/app/interfaces/items/chips.interface.js +0 -1
  199. package/esm5/app/interfaces/items/date-range.interface.js +0 -1
  200. package/esm5/app/interfaces/items/date.interface.js +0 -1
  201. package/esm5/app/interfaces/items/range.interface.js +0 -1
  202. package/esm5/app/interfaces/items/select.interface.js +0 -1
  203. package/esm5/app/interfaces/items/text.interface.js +0 -1
  204. package/esm5/app/interfaces/saved-filters.interface.js +0 -1
  205. package/esm5/app/interfaces/update-filter-item.interface.js +0 -1
  206. package/esm5/app/models/action-menu-item.model.js +0 -91
  207. package/esm5/app/models/action.model.js +0 -122
  208. package/esm5/app/models/filter-config.js +0 -139
  209. package/esm5/app/models/items/autocomplete/base-autocomplete-item.js +0 -25
  210. package/esm5/app/models/items/autocomplete-chips-item.js +0 -82
  211. package/esm5/app/models/items/autocomplete-item.js +0 -48
  212. package/esm5/app/models/items/base-item.js +0 -353
  213. package/esm5/app/models/items/checkbox-item.js +0 -73
  214. package/esm5/app/models/items/chips-item.js +0 -114
  215. package/esm5/app/models/items/date/base-date-item.js +0 -68
  216. package/esm5/app/models/items/date-item.js +0 -28
  217. package/esm5/app/models/items/date-range/base-date-range-item.js +0 -173
  218. package/esm5/app/models/items/date-range-item.js +0 -14
  219. package/esm5/app/models/items/date-time-item.js +0 -18
  220. package/esm5/app/models/items/date-time-range-item.js +0 -14
  221. package/esm5/app/models/items/range-item.js +0 -110
  222. package/esm5/app/models/items/select/base-select-item.js +0 -43
  223. package/esm5/app/models/items/select/multiple-select-item.js +0 -82
  224. package/esm5/app/models/items/select/simple-select-item.js +0 -79
  225. package/esm5/app/models/items/select-item.js +0 -17
  226. package/esm5/app/models/items/text-item.js +0 -46
  227. package/esm5/app/pipes/remove-isolate-value.pipe.js +0 -24
  228. package/esm5/app/providers/filter-meta.js +0 -10
  229. package/esm5/app/services/external-params/persistance-params-controller.service.js +0 -65
  230. package/esm5/app/services/external-params/query-params-controller.service.js +0 -66
  231. package/esm5/app/services/external-params/saved-filters-controller.service.js +0 -199
  232. package/esm5/app/services/external-params-controller.service.js +0 -193
  233. package/esm5/app/services/filter-overlay.service.js +0 -111
  234. package/esm5/app/services/focus-controller.service.js +0 -47
  235. package/esm5/app/services/items-store.service.js +0 -342
  236. package/esm5/firestitch-filter.js +0 -44
  237. package/esm5/public_api.js +0 -35
  238. package/fesm5/firestitch-filter.js +0 -5119
  239. package/fesm5/firestitch-filter.js.map +0 -1
  240. package/firestitch-filter.metadata.json +0 -1
@@ -1,39 +1,65 @@
1
- import { __decorate, __metadata, __param } from 'tslib';
2
- import { Injectable, Optional, Inject, Component, ChangeDetectionStrategy, InjectionToken, ChangeDetectorRef, HostListener, Input, Injector, Directive, EventEmitter, NgZone, Output, ContentChild, TemplateRef, ViewChild, ElementRef, HostBinding, ViewEncapsulation, KeyValueDiffers, Pipe, Self, NgModule } from '@angular/core';
3
- import { ActivatedRoute, Router, RouterModule } from '@angular/router';
4
- import { BehaviorSubject, Subject, isObservable, forkJoin, of, fromEvent, combineLatest, merge, timer } from 'rxjs';
5
- import { tap, finalize, take, takeUntil, debounceTime, filter as filter$1, distinctUntilChanged, switchMap, skip, map, mapTo, startWith, delay } from 'rxjs/operators';
1
+ import * as i0 from '@angular/core';
2
+ import { Injectable, Optional, Component, ChangeDetectionStrategy, Inject, InjectionToken, Input, Directive, Self, Pipe, ViewChild, EventEmitter, Output, HostListener, TemplateRef, ViewEncapsulation, ContentChild, HostBinding, NgModule } from '@angular/core';
3
+ import * as i1$1 from '@angular/router';
4
+ import { RouterModule } from '@angular/router';
5
+ import { BehaviorSubject, Subject, isObservable, forkJoin, of, fromEvent, merge, timer, combineLatest } from 'rxjs';
6
+ import { tap, finalize, take, takeUntil, debounceTime, filter as filter$1, distinctUntilChanged, switchMap, delay, skip, mapTo, startWith, map } from 'rxjs/operators';
6
7
  import { isFunction, clone, isObject, isString, toString, pickBy } from 'lodash-es';
8
+ import { __decorate, __metadata } from 'tslib';
7
9
  import { Model, Alias } from 'tsmodels';
8
10
  import { filter, isEmpty, getNormalizedPath, list, remove, FsCommonModule } from '@firestitch/common';
9
11
  import { simpleFormat, format } from '@firestitch/date';
10
12
  import { parseISO, isValid, isDate, isEqual } from 'date-fns';
11
- import { Location, CommonModule } from '@angular/common';
12
- import { MatDialogRef, MAT_DIALOG_DATA, MatDialog, MatDialogModule } from '@angular/material/dialog';
13
- import { DrawerRef } from '@firestitch/drawer';
14
- import { FsPersistanceStore, FsStore, FsStoreModule } from '@firestitch/store';
13
+ import * as i3 from '@angular/common';
14
+ import { CommonModule } from '@angular/common';
15
+ import * as i1$2 from '@angular/material/dialog';
16
+ import { MAT_DIALOG_DATA, MatDialogModule } from '@angular/material/dialog';
17
+ import * as i6 from '@firestitch/drawer';
18
+ import * as i1 from '@firestitch/store';
19
+ import { FsPersistanceStore, FsStoreModule, FsStore } from '@firestitch/store';
20
+ import * as i1$3 from '@angular/material/form-field';
21
+ import * as i2 from '@angular/material/select';
22
+ import { MatSelectModule } from '@angular/material/select';
23
+ import * as i3$1 from '@angular/material/core';
24
+ import * as i1$4 from '@angular/material/button';
25
+ import { MatButtonModule } from '@angular/material/button';
26
+ import * as i5 from '@angular/forms';
15
27
  import { FormControl, FormsModule, ReactiveFormsModule } from '@angular/forms';
28
+ import * as i7 from '@firestitch/form';
29
+ import { FsFormModule } from '@firestitch/form';
30
+ import * as i4 from '@angular/material/input';
31
+ import { MatInput, MatInputModule } from '@angular/material/input';
16
32
  import { MatAutocompleteModule } from '@angular/material/autocomplete';
17
- import { MatButtonModule } from '@angular/material/button';
33
+ import * as i4$2 from '@angular/material/checkbox';
18
34
  import { MatCheckboxModule } from '@angular/material/checkbox';
19
35
  import { MatChipsModule } from '@angular/material/chips';
36
+ import * as i2$3 from '@angular/material/icon';
20
37
  import { MatIconModule } from '@angular/material/icon';
21
- import { MatInput, MatInputModule } from '@angular/material/input';
22
- import { MatSelect, MatSelectModule } from '@angular/material/select';
23
38
  import { ComponentPortal, PortalInjector, PortalModule } from '@angular/cdk/portal';
24
39
  import { FlexLayoutModule } from '@angular/flex-layout';
25
- import { FsDatePickerComponent, FsDateScrollPickerComponent, DateRangePickerFromComponent, DateRangePickerToComponent, FsDatePickerModule } from '@firestitch/datepicker';
40
+ import * as i3$2 from '@firestitch/datepicker';
41
+ import { FsDatePickerModule } from '@firestitch/datepicker';
42
+ import * as i2$1 from '@firestitch/chip';
26
43
  import { FsChipModule } from '@firestitch/chip';
44
+ import * as i1$5 from '@firestitch/label';
27
45
  import { FsLabelModule } from '@firestitch/label';
28
46
  import { FsScrollModule } from '@firestitch/scroll';
29
- import { FsAutocompleteComponent, FsAutocompleteModule } from '@firestitch/autocomplete';
30
- import { FsAutocompleteChipsComponent, FsAutocompleteChipsModule } from '@firestitch/autocomplete-chips';
47
+ import * as i4$1 from '@firestitch/autocomplete';
48
+ import { FsAutocompleteModule } from '@firestitch/autocomplete';
49
+ import * as i5$1 from '@firestitch/autocomplete-chips';
50
+ import { FsAutocompleteChipsModule } from '@firestitch/autocomplete-chips';
51
+ import * as i6$2 from '@firestitch/mask';
31
52
  import { FsMaskModule } from '@firestitch/mask';
53
+ import * as i3$3 from '@firestitch/menu';
32
54
  import { FsMenuModule } from '@firestitch/menu';
55
+ import * as i6$3 from '@firestitch/skeleton';
33
56
  import { FsSkeletonModule } from '@firestitch/skeleton';
34
- import { FsFormModule } from '@firestitch/form';
35
- import { OverlayRef, OverlayConfig, Overlay } from '@angular/cdk/overlay';
36
- import { BreakpointObserver } from '@angular/cdk/layout';
57
+ import * as i1$6 from '@angular/cdk/overlay';
58
+ import { OverlayConfig } from '@angular/cdk/overlay';
59
+ import * as i6$1 from '@angular/flex-layout/extended';
60
+ import * as i2$2 from '@angular/flex-layout/flex';
61
+ import * as i1$7 from '@angular/cdk/layout';
62
+ import * as i4$3 from '@firestitch/file';
37
63
  import { FsFileModule } from '@firestitch/file';
38
64
 
39
65
  var ItemType;
@@ -1207,7 +1233,7 @@ function createFilterItem(item, config) {
1207
1233
  }
1208
1234
  }
1209
1235
 
1210
- let FsFilterItemsStore = class FsFilterItemsStore {
1236
+ class FsFilterItemsStore {
1211
1237
  constructor() {
1212
1238
  this.sortByItem = null;
1213
1239
  this.sortDirectionItem = null;
@@ -1500,11 +1526,12 @@ let FsFilterItemsStore = class FsFilterItemsStore {
1500
1526
  .items
1501
1527
  .find((item) => item.isTypeKeyword);
1502
1528
  }
1503
- };
1504
- FsFilterItemsStore = __decorate([
1505
- Injectable(),
1506
- __metadata("design:paramtypes", [])
1507
- ], FsFilterItemsStore);
1529
+ }
1530
+ FsFilterItemsStore.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsFilterItemsStore, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1531
+ FsFilterItemsStore.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsFilterItemsStore });
1532
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsFilterItemsStore, decorators: [{
1533
+ type: Injectable
1534
+ }], ctorParameters: function () { return []; } });
1508
1535
 
1509
1536
  const QUERY_PARAM_DELIMITER = ':';
1510
1537
 
@@ -1633,7 +1660,7 @@ function findItemWidthName(items, name) {
1633
1660
  }
1634
1661
 
1635
1662
  const FILTER_STORE_KEY = 'fs-filter-persist';
1636
- let PersistanceParamsController = class PersistanceParamsController extends FsPersistanceStore {
1663
+ class PersistanceParamsController extends FsPersistanceStore {
1637
1664
  constructor(_store, _route, _location, _itemsStore, _dialogRef, _drawerRef) {
1638
1665
  super(_store, _route);
1639
1666
  this._location = _location;
@@ -1657,28 +1684,18 @@ let PersistanceParamsController = class PersistanceParamsController extends FsPe
1657
1684
  this._value.data = restoreItems(this._value.data, this._itemsStore.items, this._paramsCase);
1658
1685
  }
1659
1686
  }
1660
- };
1661
- PersistanceParamsController.ctorParameters = () => [
1662
- { type: FsStore },
1663
- { type: ActivatedRoute },
1664
- { type: Location },
1665
- { type: FsFilterItemsStore },
1666
- { type: MatDialogRef, decorators: [{ type: Optional }] },
1667
- { type: DrawerRef, decorators: [{ type: Optional }] }
1668
- ];
1669
- PersistanceParamsController = __decorate([
1670
- Injectable(),
1671
- __param(4, Optional()),
1672
- __param(5, Optional()),
1673
- __metadata("design:paramtypes", [FsStore,
1674
- ActivatedRoute,
1675
- Location,
1676
- FsFilterItemsStore,
1677
- MatDialogRef,
1678
- DrawerRef])
1679
- ], PersistanceParamsController);
1687
+ }
1688
+ PersistanceParamsController.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: PersistanceParamsController, deps: [{ token: i1.FsStore }, { token: i1$1.ActivatedRoute }, { token: i3.Location }, { token: FsFilterItemsStore }, { token: i1$2.MatDialogRef, optional: true }, { token: i6.DrawerRef, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
1689
+ PersistanceParamsController.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: PersistanceParamsController });
1690
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: PersistanceParamsController, decorators: [{
1691
+ type: Injectable
1692
+ }], ctorParameters: function () { return [{ type: i1.FsStore }, { type: i1$1.ActivatedRoute }, { type: i3.Location }, { type: FsFilterItemsStore }, { type: i1$2.MatDialogRef, decorators: [{
1693
+ type: Optional
1694
+ }] }, { type: i6.DrawerRef, decorators: [{
1695
+ type: Optional
1696
+ }] }]; } });
1680
1697
 
1681
- let QueryParamsController = class QueryParamsController {
1698
+ class QueryParamsController {
1682
1699
  constructor(_router, _route, _itemsStore) {
1683
1700
  this._router = _router;
1684
1701
  this._route = _route;
@@ -1716,20 +1733,14 @@ let QueryParamsController = class QueryParamsController {
1716
1733
  fetchFromQueryParams() {
1717
1734
  this._fetchedParams = restoreItems(this._route.snapshot.queryParams, this._itemsStore.items, this._paramsCase);
1718
1735
  }
1719
- };
1720
- QueryParamsController.ctorParameters = () => [
1721
- { type: Router },
1722
- { type: ActivatedRoute },
1723
- { type: FsFilterItemsStore }
1724
- ];
1725
- QueryParamsController = __decorate([
1726
- Injectable(),
1727
- __metadata("design:paramtypes", [Router,
1728
- ActivatedRoute,
1729
- FsFilterItemsStore])
1730
- ], QueryParamsController);
1736
+ }
1737
+ QueryParamsController.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: QueryParamsController, deps: [{ token: i1$1.Router }, { token: i1$1.ActivatedRoute }, { token: FsFilterItemsStore }], target: i0.ɵɵFactoryTarget.Injectable });
1738
+ QueryParamsController.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: QueryParamsController });
1739
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: QueryParamsController, decorators: [{
1740
+ type: Injectable
1741
+ }], ctorParameters: function () { return [{ type: i1$1.Router }, { type: i1$1.ActivatedRoute }, { type: FsFilterItemsStore }]; } });
1731
1742
 
1732
- let FsFilterSavedFilterEditComponent = class FsFilterSavedFilterEditComponent {
1743
+ class FsFilterSavedFilterEditComponent {
1733
1744
  constructor(data, _dialogRef) {
1734
1745
  this.data = data;
1735
1746
  this._dialogRef = _dialogRef;
@@ -1756,19 +1767,19 @@ let FsFilterSavedFilterEditComponent = class FsFilterSavedFilterEditComponent {
1756
1767
  this.savedFilters = this.data.savedFilters;
1757
1768
  this._saveCallback = this.data.saveCallback;
1758
1769
  }
1759
- };
1760
- FsFilterSavedFilterEditComponent.ctorParameters = () => [
1761
- { type: undefined, decorators: [{ type: Inject, args: [MAT_DIALOG_DATA,] }] },
1762
- { type: MatDialogRef }
1763
- ];
1764
- FsFilterSavedFilterEditComponent = __decorate([
1765
- Component({
1766
- template: "<form fsForm [submit]=\"save\">\n <h1 mat-dialog-title>\n Save Filter\n </h1>\n <div mat-dialog-content>\n <mat-form-field>\n <mat-label>Save as</mat-label>\n <mat-select [(ngModel)]=\"saveAsFilter\" name=\"saveAs\">\n <mat-option value=\"new\">New filter</mat-option>\n <mat-optgroup label=\"Saved filters:\">\n <ng-container *ngFor=\"let filter of savedFilters\">\n <mat-option [value]=\"filter\">{{ filter.name }}</mat-option>\n </ng-container>\n </mat-optgroup>\n </mat-select>\n </mat-form-field>\n <br>\n <mat-form-field *ngIf=\"saveAsFilter === 'new'\">\n <mat-label>Name</mat-label>\n <input matInput name=\"filter-name\" [(ngModel)]=\"savedFilterName\" required>\n </mat-form-field>\n </div>\n <div mat-dialog-actions>\n <button mat-button\n type=\"submit\"\n color=\"primary\">\n {{ saveAsFilter === 'new' ? 'Create' : 'Save' }}\n </button>\n\n <button mat-button\n type=\"button\"\n [mat-dialog-close]=\"null\">\n Cancel\n </button>\n </div>\n</form>\n",
1767
- changeDetection: ChangeDetectionStrategy.OnPush
1768
- }),
1769
- __param(0, Inject(MAT_DIALOG_DATA)),
1770
- __metadata("design:paramtypes", [Object, MatDialogRef])
1771
- ], FsFilterSavedFilterEditComponent);
1770
+ }
1771
+ FsFilterSavedFilterEditComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsFilterSavedFilterEditComponent, deps: [{ token: MAT_DIALOG_DATA }, { token: i1$2.MatDialogRef }], target: i0.ɵɵFactoryTarget.Component });
1772
+ FsFilterSavedFilterEditComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FsFilterSavedFilterEditComponent, selector: "ng-component", ngImport: i0, template: "<form fsForm [submit]=\"save\">\n <h1 mat-dialog-title>\n Save Filter\n </h1>\n <div mat-dialog-content>\n <mat-form-field>\n <mat-label>Save as</mat-label>\n <mat-select [(ngModel)]=\"saveAsFilter\" name=\"saveAs\">\n <mat-option value=\"new\">New filter</mat-option>\n <mat-optgroup label=\"Saved filters:\">\n <ng-container *ngFor=\"let filter of savedFilters\">\n <mat-option [value]=\"filter\">{{ filter.name }}</mat-option>\n </ng-container>\n </mat-optgroup>\n </mat-select>\n </mat-form-field>\n <br>\n <mat-form-field *ngIf=\"saveAsFilter === 'new'\">\n <mat-label>Name</mat-label>\n <input matInput name=\"filter-name\" [(ngModel)]=\"savedFilterName\" required>\n </mat-form-field>\n </div>\n <div mat-dialog-actions>\n <button mat-button\n type=\"submit\"\n color=\"primary\">\n {{ saveAsFilter === 'new' ? 'Create' : 'Save' }}\n </button>\n\n <button mat-button\n type=\"button\"\n [mat-dialog-close]=\"null\">\n Cancel\n </button>\n </div>\n</form>\n", components: [{ type: i1$3.MatFormField, selector: "mat-form-field", inputs: ["color", "floatLabel", "appearance", "hideRequiredMarker", "hintLabel"], exportAs: ["matFormField"] }, { type: i2.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { type: i3$1.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { type: i3$1.MatOptgroup, selector: "mat-optgroup", inputs: ["disabled"], exportAs: ["matOptgroup"] }, { type: i1$4.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }], directives: [{ type: i5.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i5.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i5.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i7.FsFormDirective, selector: "[fsForm]", inputs: ["wrapperSelector", "messageSelector", "hintSelector", "labelSelector", "autocomplete", "shortcuts", "confirm", "confirmDialog", "confirmDrawer", "confirmBrowser", "confirmTabs", "dirtySubmitButton", "submit", "successDelay", "errorDelay", "tabGroup"], outputs: ["fsForm", "invalid", "valid", "submitted", "reseted", "cleared"] }, { type: i1$2.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { type: i1$2.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { type: i1$3.MatLabel, selector: "mat-label" }, { type: i5.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i5.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["id", "disabled", "required", "type", "value", "readonly", "placeholder", "errorStateMatcher", "aria-describedby"], exportAs: ["matInput"] }, { type: i5.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i5.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { type: i7.FsFormRequiredDirective, selector: "[fsFormRequired],[ngModel][required]", inputs: ["fsFormRequired", "required", "fsFormRequiredMessage"] }, { type: i1$2.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]" }, { type: i7.FsSubmitButtonDirective, selector: "button[type=\"submit\"]", inputs: ["name", "dirtySubmit"] }, { type: i1$2.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["type", "mat-dialog-close", "aria-label", "matDialogClose"], exportAs: ["matDialogClose"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1773
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsFilterSavedFilterEditComponent, decorators: [{
1774
+ type: Component,
1775
+ args: [{
1776
+ templateUrl: './saved-filter-edit.component.html',
1777
+ changeDetection: ChangeDetectionStrategy.OnPush,
1778
+ }]
1779
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
1780
+ type: Inject,
1781
+ args: [MAT_DIALOG_DATA]
1782
+ }] }, { type: i1$2.MatDialogRef }]; } });
1772
1783
 
1773
1784
  function buildQueryParams(flattenedParams, items) {
1774
1785
  items.forEach(filterItem => {
@@ -1797,7 +1808,7 @@ function buildQueryParams(flattenedParams, items) {
1797
1808
  return flattenedParams;
1798
1809
  }
1799
1810
 
1800
- let SavedFiltersController = class SavedFiltersController {
1811
+ class SavedFiltersController {
1801
1812
  constructor(_itemsStore, _dialog) {
1802
1813
  this._itemsStore = _itemsStore;
1803
1814
  this._dialog = _dialog;
@@ -1944,18 +1955,14 @@ let SavedFiltersController = class SavedFiltersController {
1944
1955
  _setEnabledStatus(value) {
1945
1956
  this._enabled$.next(value);
1946
1957
  }
1947
- };
1948
- SavedFiltersController.ctorParameters = () => [
1949
- { type: FsFilterItemsStore },
1950
- { type: MatDialog }
1951
- ];
1952
- SavedFiltersController = __decorate([
1953
- Injectable(),
1954
- __metadata("design:paramtypes", [FsFilterItemsStore,
1955
- MatDialog])
1956
- ], SavedFiltersController);
1958
+ }
1959
+ SavedFiltersController.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SavedFiltersController, deps: [{ token: FsFilterItemsStore }, { token: i1$2.MatDialog }], target: i0.ɵɵFactoryTarget.Injectable });
1960
+ SavedFiltersController.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SavedFiltersController });
1961
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SavedFiltersController, decorators: [{
1962
+ type: Injectable
1963
+ }], ctorParameters: function () { return [{ type: FsFilterItemsStore }, { type: i1$2.MatDialog }]; } });
1957
1964
 
1958
- let ExternalParamsController = class ExternalParamsController {
1965
+ class ExternalParamsController {
1959
1966
  constructor(_itemsStore, _persistanceStore, _queryParams, _savedFilters, _route) {
1960
1967
  this._itemsStore = _itemsStore;
1961
1968
  this._persistanceStore = _persistanceStore;
@@ -2095,22 +2102,12 @@ let ExternalParamsController = class ExternalParamsController {
2095
2102
  }), targetItems);
2096
2103
  this._persistanceStore.save(params);
2097
2104
  }
2098
- };
2099
- ExternalParamsController.ctorParameters = () => [
2100
- { type: FsFilterItemsStore },
2101
- { type: PersistanceParamsController },
2102
- { type: QueryParamsController },
2103
- { type: SavedFiltersController },
2104
- { type: ActivatedRoute }
2105
- ];
2106
- ExternalParamsController = __decorate([
2107
- Injectable(),
2108
- __metadata("design:paramtypes", [FsFilterItemsStore,
2109
- PersistanceParamsController,
2110
- QueryParamsController,
2111
- SavedFiltersController,
2112
- ActivatedRoute])
2113
- ], ExternalParamsController);
2105
+ }
2106
+ ExternalParamsController.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ExternalParamsController, deps: [{ token: FsFilterItemsStore }, { token: PersistanceParamsController }, { token: QueryParamsController }, { token: SavedFiltersController }, { token: i1$1.ActivatedRoute }], target: i0.ɵɵFactoryTarget.Injectable });
2107
+ ExternalParamsController.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ExternalParamsController });
2108
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ExternalParamsController, decorators: [{
2109
+ type: Injectable
2110
+ }], ctorParameters: function () { return [{ type: FsFilterItemsStore }, { type: PersistanceParamsController }, { type: QueryParamsController }, { type: SavedFiltersController }, { type: i1$1.ActivatedRoute }]; } });
2114
2111
 
2115
2112
  const FS_FILTER_CONFIG = new InjectionToken('fs.filter-config');
2116
2113
 
@@ -2155,199 +2152,69 @@ const FILTER_DRAWER_DATA = new InjectionToken('fs.filter-drawer-data');
2155
2152
 
2156
2153
  const FILTER_DRAWER_OVERLAY = new InjectionToken('fs.filter-drawer-overlay');
2157
2154
 
2158
- let FilterDrawerComponent = class FilterDrawerComponent {
2159
- constructor(externalParams, _cd, _itemsStore, overlayRef, data) {
2160
- this.externalParams = externalParams;
2155
+ class BaseItemComponent {
2156
+ constructor(_kvDiffers, _cd) {
2157
+ this._kvDiffers = _kvDiffers;
2161
2158
  this._cd = _cd;
2162
- this._itemsStore = _itemsStore;
2163
- this.overlayRef = overlayRef;
2164
- this.data = data;
2165
2159
  this.inline = false;
2166
- this.windowDesktop = false;
2167
- this._itemsStore.prepareItems();
2168
- this._clear = data.clear;
2169
- this._done = data.done;
2170
- this.updateWindowWidth();
2171
- }
2172
- updateWindowWidth() {
2173
- this.windowDesktop = window.innerWidth > 1200;
2174
- }
2175
- get items$() {
2176
- return this._itemsStore.visibleItems$;
2177
- }
2178
- get sortItem() {
2179
- return this._itemsStore.sortByItem;
2180
- }
2181
- get sortDirectionItem() {
2182
- return this._itemsStore.sortDirectionItem;
2183
- }
2184
- clear() {
2185
- this._clear();
2186
- // this.overlayRef.detach();
2187
- }
2188
- done() {
2189
- this._done();
2190
- this.overlayRef.detach();
2191
- }
2192
- backdropClick() {
2193
- this.done();
2194
- }
2195
- };
2196
- FilterDrawerComponent.ctorParameters = () => [
2197
- { type: ExternalParamsController },
2198
- { type: ChangeDetectorRef },
2199
- { type: FsFilterItemsStore },
2200
- { type: OverlayRef, decorators: [{ type: Inject, args: [FILTER_DRAWER_OVERLAY,] }] },
2201
- { type: undefined, decorators: [{ type: Inject, args: [FILTER_DRAWER_DATA,] }] }
2202
- ];
2203
- __decorate([
2204
- HostListener('window:resize'),
2205
- __metadata("design:type", Function),
2206
- __metadata("design:paramtypes", []),
2207
- __metadata("design:returntype", void 0)
2208
- ], FilterDrawerComponent.prototype, "updateWindowWidth", null);
2209
- __decorate([
2210
- Input(),
2211
- __metadata("design:type", Object)
2212
- ], FilterDrawerComponent.prototype, "inline", void 0);
2213
- FilterDrawerComponent = __decorate([
2214
- Component({
2215
- template: "<div class=\"filters\">\n <div class=\"filters-wrap\">\n\n <div class=\"filter-by\">\n <mat-icon>tune</mat-icon>\n <span class=\"text\">Filters</span>\n </div>\n\n <div class=\"overflow-shadow filter-items\">\n <div class=\"overflow-shadow-content\">\n <ng-container *fsSkeleton=\"(externalParams.pending$ | async) !== true\">\n <filter-item *ngFor=\"let filterItem of items$ | async\"\n class=\"filter-group\"\n [item]=\"filterItem\">\n </filter-item>\n\n <ng-container *ngIf=\"sortItem && sortItem.values && sortItem.values.length > 0\">\n <filter-item class=\"filter-group sort\"\n [item]=\"sortItem\">\n </filter-item>\n <filter-item class=\"filter-group sort\"\n [item]=\"sortDirectionItem\">\n </filter-item>\n </ng-container>\n </ng-container>\n </div>\n </div>\n\n <fs-filter-drawer-actions class=\"filter-actions\"\n *ngIf=\"(externalParams.pending$ | async) !== true\"\n (clear)=\"clear()\"\n (done)=\"done()\">\n </fs-filter-drawer-actions>\n </div>\n</div>\n<div class=\"backdrop\" *ngIf=\"!windowDesktop\" (click)=\"backdropClick()\"></div>\n",
2216
- // Commented out because filter items are not updating with a delayed observable. Need to figure this out.
2217
- changeDetection: ChangeDetectionStrategy.OnPush,
2218
- styles: [":host ::ng-deep mat-form-field{width:100%}.filter-by{display:flex;flex-direction:row;align-items:center;box-sizing:border-box;padding:20px 25px}.filter-by mat-icon{margin-right:8px}.filter-by .text{font-weight:400;font-size:19px}.filter-actions{display:block;box-sizing:border-box;padding:13px}.filter-actions button{margin-right:6px}.filter-actions button:last-child{margin-right:0}.filters{position:fixed;display:block;top:0;right:0;z-index:1002;bottom:0}.filters .filters-wrap{background:#fff;box-shadow:0 2px 4px -1px rgba(0,0,0,.2),0 4px 5px 0 rgba(0,0,0,.14),0 1px 10px 0 rgba(0,0,0,.12);width:85vw;max-width:350px;display:flex;flex-direction:column;height:100%}.filters .filters-wrap .filter-items{overflow-y:auto}.filters .filters-wrap .filter-items .overflow-shadow-content{padding:0 25px;box-sizing:border-box}.filters .filter-group{margin:10px 0 0}.filters .filter-group:first-child{margin:0}.filters .filter label{white-space:nowrap;color:rgba(0,0,0,.54)}.filters .filter .interface.interface-range,.filters .filter .interface.interface-range .mat-input-wrapper,.filters .filter .interface.interface-range input{text-align:center}.filters .filter .interface.interface-datetime fs-datetime.has-time .md-input{width:100%}.filters .filter .interface fs-datetime-range input{text-align:center}.filters .filter .filter-label{width:1%;white-space:nowrap;vertical-align:middle;padding-right:15px}.filters md-autocomplete-container md-input-container{margin:0}.filters .isolate{margin-top:-12px}.filters .isolate .interface{line-height:20px;padding-bottom:1.25em}.filters .isolate md-checkbox{margin:0 0 0 2px}.backdrop{position:fixed;top:0;bottom:0;left:0;right:0;z-index:900;outline:0}"]
2219
- }),
2220
- __param(3, Inject(FILTER_DRAWER_OVERLAY)),
2221
- __param(4, Inject(FILTER_DRAWER_DATA)),
2222
- __metadata("design:paramtypes", [ExternalParamsController,
2223
- ChangeDetectorRef,
2224
- FsFilterItemsStore,
2225
- OverlayRef, Object])
2226
- ], FilterDrawerComponent);
2227
-
2228
- const FS_FILTER_META = new InjectionToken('fs.filter.meta', {
2229
- providedIn: 'root',
2230
- factory: () => {
2231
- return {
2232
- openedFilters: 0,
2233
- };
2234
- }
2235
- });
2236
-
2237
- let FsFilterOverlayService = class FsFilterOverlayService {
2238
- constructor(_injector, _filterMeta, _overlay) {
2239
- this._injector = _injector;
2240
- this._filterMeta = _filterMeta;
2241
- this._overlay = _overlay;
2242
- this.detach$ = new Subject();
2243
- this.attach$ = new Subject();
2244
2160
  this._destroy$ = new Subject();
2161
+ this._debouncer$ = new Subject();
2162
+ this._kvDiffer = this._kvDiffers.find(this.item || {}).create();
2163
+ this.listenWithDebounce();
2245
2164
  }
2246
- get isOpened() {
2247
- return !!this._overlayRef;
2248
- }
2249
- setClearFn(fn) {
2250
- this._clearFn = fn;
2165
+ set item(value) {
2166
+ this._item = value;
2251
2167
  }
2252
- setDoneFn(fn) {
2253
- this._doneFn = fn;
2168
+ ;
2169
+ get item() {
2170
+ return this._item;
2254
2171
  }
2255
- close() {
2256
- if (this._overlayRef) {
2257
- this._overlayRef.detach();
2258
- this._overlayRef = null;
2259
- this.removeFilterClass();
2172
+ ngDoCheck() {
2173
+ if (this._kvDiffer) {
2174
+ const changes = this._kvDiffer.diff(this.item);
2175
+ if (changes) {
2176
+ this._cd.detectChanges();
2177
+ }
2260
2178
  }
2261
2179
  }
2262
- open() {
2263
- this._overlayRef = this._createOverlay();
2264
- this._overlayRef.backdropClick()
2265
- .pipe(takeUntil(this._destroy$))
2266
- .subscribe(() => {
2267
- this._overlayRef.detach();
2268
- });
2269
- this._overlayRef.detachments()
2270
- .pipe(takeUntil(this._destroy$))
2271
- .subscribe(() => {
2272
- this.detach$.next();
2273
- });
2274
- this._overlayRef.attachments()
2275
- .pipe(takeUntil(this._destroy$))
2276
- .subscribe(() => {
2277
- this.attach$.next();
2278
- });
2279
- this.addFilterClass();
2280
- return this.openPortalPreview();
2281
- }
2282
2180
  ngOnDestroy() {
2283
2181
  this._destroy$.next();
2284
2182
  this._destroy$.complete();
2285
2183
  }
2286
- _createOverlay() {
2287
- const overlayConfig = new OverlayConfig({
2288
- hasBackdrop: true,
2289
- backdropClass: 'fs-filter-backdrop'
2184
+ listenWithDebounce() {
2185
+ this._debouncer$
2186
+ .pipe(debounceTime(150), takeUntil(this._destroy$))
2187
+ .subscribe(() => {
2188
+ this.item.valueChanged();
2290
2189
  });
2291
- return this._overlay.create(overlayConfig);
2292
- }
2293
- openPortalPreview() {
2294
- const data = { done: this._doneFn, clear: this._clearFn };
2295
- const injector = this._createInjector(this._injector, data, this._overlayRef);
2296
- const containerPortal = new ComponentPortal(FilterDrawerComponent, undefined, injector);
2297
- const containerRef = this._overlayRef.attach(containerPortal);
2298
- return containerRef.instance;
2299
- }
2300
- _createInjector(parentInjector, data, overlayRef) {
2301
- const injectionTokens = new WeakMap([
2302
- [FILTER_DRAWER_DATA, data],
2303
- [FILTER_DRAWER_OVERLAY, overlayRef],
2304
- ]);
2305
- return new PortalInjector(parentInjector, injectionTokens);
2306
- }
2307
- removeFilterClass() {
2308
- this._filterMeta.openedFilters--;
2309
- if (this._filterMeta.openedFilters === 0) {
2310
- window.document.body.classList.remove('fs-filter-open');
2311
- }
2312
2190
  }
2313
- addFilterClass() {
2314
- this._filterMeta.openedFilters++;
2315
- if (this._filterMeta.openedFilters === 1) {
2316
- window.document.body.classList.add('fs-filter-open');
2317
- }
2191
+ itemChange() {
2192
+ this._debouncer$.next();
2318
2193
  }
2319
- };
2320
- FsFilterOverlayService.ctorParameters = () => [
2321
- { type: Injector },
2322
- { type: undefined, decorators: [{ type: Inject, args: [FS_FILTER_META,] }] },
2323
- { type: Overlay }
2324
- ];
2325
- FsFilterOverlayService = __decorate([
2326
- Injectable(),
2327
- __param(1, Inject(FS_FILTER_META)),
2328
- __metadata("design:paramtypes", [Injector, Object, Overlay])
2329
- ], FsFilterOverlayService);
2330
-
2331
- let FilterStatusBarDirective = class FilterStatusBarDirective {
2332
- };
2333
- FilterStatusBarDirective = __decorate([
2334
- Directive({
2335
- selector: '[fsFilterStatusBar]',
2336
- })
2337
- ], FilterStatusBarDirective);
2194
+ }
2195
+ BaseItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: BaseItemComponent, deps: [{ token: i0.KeyValueDiffers }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
2196
+ BaseItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: BaseItemComponent, selector: "base-item", inputs: { item: "item", inline: "inline" }, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
2197
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: BaseItemComponent, decorators: [{
2198
+ type: Component,
2199
+ args: [{
2200
+ selector: 'base-item',
2201
+ template: '',
2202
+ changeDetection: ChangeDetectionStrategy.OnPush,
2203
+ }]
2204
+ }], ctorParameters: function () { return [{ type: i0.KeyValueDiffers }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { item: [{
2205
+ type: Input
2206
+ }], inline: [{
2207
+ type: Input
2208
+ }] } });
2338
2209
 
2339
- let FocusControllerService = class FocusControllerService {
2340
- constructor(_filterOverlay) {
2341
- this._filterOverlay = _filterOverlay;
2210
+ class FocusControllerService {
2211
+ constructor() {
2342
2212
  this._focusOn = new BehaviorSubject(null);
2343
2213
  }
2344
2214
  get focusOn$() {
2345
2215
  return this._focusOn.asObservable();
2346
2216
  }
2347
2217
  click(item, type = null) {
2348
- if (!this._filterOverlay.isOpened) {
2349
- this._filterOverlay.open();
2350
- }
2351
2218
  this._focusOn.next({ item, type });
2352
2219
  }
2353
2220
  listenFocusFor$(targetItem, targetType = null) {
@@ -2359,1821 +2226,1928 @@ let FocusControllerService = class FocusControllerService {
2359
2226
  clearFocus() {
2360
2227
  this._focusOn.next(null);
2361
2228
  }
2362
- };
2363
- FocusControllerService.ctorParameters = () => [
2364
- { type: FsFilterOverlayService }
2365
- ];
2366
- FocusControllerService = __decorate([
2367
- Injectable(),
2368
- __metadata("design:paramtypes", [FsFilterOverlayService])
2369
- ], FocusControllerService);
2370
-
2371
- var ActionType;
2372
- (function (ActionType) {
2373
- ActionType["Basic"] = "basic";
2374
- ActionType["Raised"] = "raised";
2375
- ActionType["Icon"] = "icon";
2376
- ActionType["Fab"] = "fab";
2377
- ActionType["MiniFab"] = "mini-fab";
2378
- })(ActionType || (ActionType = {}));
2379
-
2380
- var ActionMode;
2381
- (function (ActionMode) {
2382
- ActionMode["Button"] = "button";
2383
- ActionMode["Menu"] = "menu";
2384
- ActionMode["File"] = "file";
2385
- })(ActionMode || (ActionMode = {}));
2229
+ }
2230
+ FocusControllerService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FocusControllerService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
2231
+ FocusControllerService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FocusControllerService });
2232
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FocusControllerService, decorators: [{
2233
+ type: Injectable
2234
+ }], ctorParameters: function () { return []; } });
2386
2235
 
2387
- class ActionMenuItem {
2388
- constructor(config = {}, _parent) {
2389
- this._parent = _parent;
2390
- this.items = [];
2391
- this._isGroup = false;
2392
- this._visible$ = new BehaviorSubject(true);
2393
- this._disabled$ = new BehaviorSubject(false);
2394
- this._init(config);
2236
+ class FocusToItemDirective {
2237
+ constructor(_el, _focusController, _targetSelect, _targetDate, _targetDateScroll, _targetDateRangeFrom, _targetDateRangeTo, _targetAutocomplete, _targetAutocompleteChips) {
2238
+ this._el = _el;
2239
+ this._focusController = _focusController;
2240
+ this._targetSelect = _targetSelect;
2241
+ this._targetDate = _targetDate;
2242
+ this._targetDateScroll = _targetDateScroll;
2243
+ this._targetDateRangeFrom = _targetDateRangeFrom;
2244
+ this._targetDateRangeTo = _targetDateRangeTo;
2245
+ this._targetAutocomplete = _targetAutocomplete;
2246
+ this._targetAutocompleteChips = _targetAutocompleteChips;
2247
+ this._destroy$ = new Subject();
2395
2248
  }
2396
- get isGroup() {
2397
- return this._isGroup;
2249
+ ngOnInit() {
2250
+ this._focusController
2251
+ .listenFocusFor$(this._item, this._focusTargetType)
2252
+ .pipe(delay(500), takeUntil(this._destroy$))
2253
+ .subscribe(() => {
2254
+ this._focus();
2255
+ });
2398
2256
  }
2399
- get visible() {
2400
- return this._visible$.getValue();
2257
+ ngOnDestroy() {
2258
+ this._destroy$.next();
2259
+ this._destroy$.complete();
2401
2260
  }
2402
- get visible$() {
2403
- return this._visible$.asObservable();
2261
+ _focus() {
2262
+ switch (this._item.type) {
2263
+ case ItemType.Select:
2264
+ {
2265
+ this._targetSelect.open();
2266
+ }
2267
+ break;
2268
+ case ItemType.Text:
2269
+ case ItemType.Range:
2270
+ {
2271
+ this._el.nativeElement.focus();
2272
+ }
2273
+ break;
2274
+ case ItemType.Date:
2275
+ {
2276
+ if (this._item.mode === ItemDateMode.Calendar) {
2277
+ this._targetDate.open();
2278
+ }
2279
+ else {
2280
+ this._targetDateScroll.open();
2281
+ }
2282
+ }
2283
+ break;
2284
+ case ItemType.DateRange:
2285
+ {
2286
+ if (this._focusTargetType === 'from') {
2287
+ this._targetDateRangeFrom.open();
2288
+ }
2289
+ else {
2290
+ this._targetDateRangeTo.open();
2291
+ }
2292
+ }
2293
+ break;
2294
+ case ItemType.AutoComplete:
2295
+ {
2296
+ this._targetAutocomplete.focus();
2297
+ }
2298
+ break;
2299
+ case ItemType.AutoCompleteChips:
2300
+ {
2301
+ this._targetAutocompleteChips.focus();
2302
+ }
2303
+ break;
2304
+ }
2404
2305
  }
2405
- set disabled(value) {
2406
- this._disabled$.next(value);
2306
+ }
2307
+ FocusToItemDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FocusToItemDirective, deps: [{ token: i0.ElementRef }, { token: FocusControllerService }, { token: i2.MatSelect, optional: true, self: true }, { token: i3$2.FsDatePickerComponent, optional: true, self: true }, { token: i3$2.FsDateScrollPickerComponent, optional: true, self: true }, { token: i3$2.DateRangePickerFromComponent, optional: true, self: true }, { token: i3$2.DateRangePickerToComponent, optional: true, self: true }, { token: i4$1.FsAutocompleteComponent, optional: true, self: true }, { token: i5$1.FsAutocompleteChipsComponent, optional: true, self: true }], target: i0.ɵɵFactoryTarget.Directive });
2308
+ FocusToItemDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: FocusToItemDirective, selector: "[fsFilterFocusTrigger]", inputs: { _item: ["fsFilterFocusTrigger", "_item"], _focusTargetType: ["focusTargetType", "_focusTargetType"] }, ngImport: i0 });
2309
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FocusToItemDirective, decorators: [{
2310
+ type: Directive,
2311
+ args: [{
2312
+ selector: '[fsFilterFocusTrigger]',
2313
+ }]
2314
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: FocusControllerService }, { type: i2.MatSelect, decorators: [{
2315
+ type: Optional
2316
+ }, {
2317
+ type: Self
2318
+ }] }, { type: i3$2.FsDatePickerComponent, decorators: [{
2319
+ type: Optional
2320
+ }, {
2321
+ type: Self
2322
+ }] }, { type: i3$2.FsDateScrollPickerComponent, decorators: [{
2323
+ type: Optional
2324
+ }, {
2325
+ type: Self
2326
+ }] }, { type: i3$2.DateRangePickerFromComponent, decorators: [{
2327
+ type: Optional
2328
+ }, {
2329
+ type: Self
2330
+ }] }, { type: i3$2.DateRangePickerToComponent, decorators: [{
2331
+ type: Optional
2332
+ }, {
2333
+ type: Self
2334
+ }] }, { type: i4$1.FsAutocompleteComponent, decorators: [{
2335
+ type: Optional
2336
+ }, {
2337
+ type: Self
2338
+ }] }, { type: i5$1.FsAutocompleteChipsComponent, decorators: [{
2339
+ type: Optional
2340
+ }, {
2341
+ type: Self
2342
+ }] }]; }, propDecorators: { _item: [{
2343
+ type: Input,
2344
+ args: ['fsFilterFocusTrigger']
2345
+ }], _focusTargetType: [{
2346
+ type: Input,
2347
+ args: ['focusTargetType']
2348
+ }] } });
2349
+
2350
+ class TextComponent extends BaseItemComponent {
2351
+ constructor(_kvDiffers, _cd) {
2352
+ super(_kvDiffers, _cd);
2353
+ this._kvDiffers = _kvDiffers;
2354
+ this._cd = _cd;
2355
+ this.textControl = new FormControl();
2356
+ this.destroy$ = new Subject();
2407
2357
  }
2408
- get disabled() {
2409
- return this._disabled$.getValue();
2358
+ ngOnInit() {
2359
+ this._listenControlValueChanges();
2360
+ this._listenModelChanges();
2410
2361
  }
2411
- get disabled$() {
2412
- return this._disabled$.asObservable();
2362
+ ngOnDestroy() {
2363
+ this.destroy$.next();
2364
+ this.destroy$.complete();
2413
2365
  }
2414
- updateVisibility() {
2415
- const visible = !!this._showFn ? this._showFn() : true;
2416
- if (!visible || !this.isGroup) {
2417
- this._visible$.next(visible);
2418
- return;
2419
- }
2420
- const numberOfVisibleChildren = this.items
2421
- .reduce((acc, item) => {
2422
- item.updateVisibility();
2423
- if (item.visible) {
2424
- acc++;
2425
- }
2426
- return acc;
2427
- }, 0);
2428
- this._visible$.next(!!numberOfVisibleChildren);
2366
+ _listenControlValueChanges() {
2367
+ this.textControl.valueChanges
2368
+ .pipe(distinctUntilChanged(), debounceTime(200), takeUntil(this.destroy$))
2369
+ .subscribe((value) => {
2370
+ this.item.model = value;
2371
+ });
2429
2372
  }
2430
- _init(config) {
2431
- this.label = config.label;
2432
- this.icon = config.icon;
2433
- this._showFn = config.show;
2434
- if ('items' in config) {
2435
- this._isGroup = true;
2436
- if (Array.isArray(config.items)) {
2437
- this.items = config
2438
- .items
2439
- .map((item) => new ActionMenuItem(item, this));
2440
- }
2441
- this.updateVisibility();
2373
+ _listenModelChanges() {
2374
+ this._item.value$
2375
+ .pipe(takeUntil(this.destroy$))
2376
+ .subscribe(() => {
2377
+ this.textControl.setValue(this.item.model, { emitEvent: false });
2378
+ });
2379
+ }
2380
+ }
2381
+ TextComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TextComponent, deps: [{ token: i0.KeyValueDiffers }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
2382
+ TextComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: TextComponent, selector: "filter-item-text", usesInheritance: true, ngImport: i0, template: "<mat-form-field>\n <mat-label>{{item.label}}</mat-label>\n <span matPrefix *ngIf=\"item.prefix\" [innerHtml]=\"item.prefix\"></span>\n <input matInput [formControl]=\"textControl\" [fsFilterFocusTrigger]=\"item\">\n <span matSuffix *ngIf=\"item.suffix\" [innerHtml]=\"item.suffix\"></span>\n</mat-form-field>\n", styles: [""], components: [{ type: i1$3.MatFormField, selector: "mat-form-field", inputs: ["color", "floatLabel", "appearance", "hideRequiredMarker", "hintLabel"], exportAs: ["matFormField"] }], directives: [{ type: i1$3.MatLabel, selector: "mat-label" }, { type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1$3.MatPrefix, selector: "[matPrefix]" }, { type: i4.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["id", "disabled", "required", "type", "value", "readonly", "placeholder", "errorStateMatcher", "aria-describedby"], exportAs: ["matInput"] }, { type: i5.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i5.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i5.FormControlDirective, selector: "[formControl]", inputs: ["disabled", "formControl", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: FocusToItemDirective, selector: "[fsFilterFocusTrigger]", inputs: ["fsFilterFocusTrigger", "focusTargetType"] }, { type: i1$3.MatSuffix, selector: "[matSuffix]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2383
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TextComponent, decorators: [{
2384
+ type: Component,
2385
+ args: [{
2386
+ selector: 'filter-item-text',
2387
+ templateUrl: './text.component.html',
2388
+ styleUrls: ['./text.component.scss'],
2389
+ changeDetection: ChangeDetectionStrategy.OnPush,
2390
+ }]
2391
+ }], ctorParameters: function () { return [{ type: i0.KeyValueDiffers }, { type: i0.ChangeDetectorRef }]; } });
2392
+
2393
+ class FsFilterIsolateValues {
2394
+ transform(values, isolate) {
2395
+ if (!isolate) {
2396
+ return values;
2442
2397
  }
2443
2398
  else {
2444
- this.click = config.click;
2445
- this.routerLink = config.link;
2446
- if (!this._parent) {
2447
- this.updateVisibility();
2448
- }
2399
+ return values.filter((value) => {
2400
+ return value.value !== isolate.value;
2401
+ });
2449
2402
  }
2450
2403
  }
2451
2404
  }
2405
+ FsFilterIsolateValues.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsFilterIsolateValues, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
2406
+ FsFilterIsolateValues.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsFilterIsolateValues, name: "fsFilterIsolateValues" });
2407
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsFilterIsolateValues, decorators: [{
2408
+ type: Pipe,
2409
+ args: [{
2410
+ name: 'fsFilterIsolateValues'
2411
+ }]
2412
+ }] });
2452
2413
 
2453
- class Action {
2454
- constructor(config = {}) {
2455
- this.primary = true;
2456
- this.isReorderAction = false;
2457
- this.classArray = [];
2458
- this.items = [];
2459
- this._visible$ = new BehaviorSubject(true);
2460
- this._disabled$ = new BehaviorSubject(false);
2461
- this._init(config);
2462
- }
2463
- get visible() {
2464
- return this._visible$.getValue();
2465
- }
2466
- get visible$() {
2467
- return this._visible$.asObservable();
2468
- }
2469
- set disabled(value) {
2470
- this._disabled$.next(value);
2414
+ class SelectMultipleComponent {
2415
+ constructor(cd) {
2416
+ this.cd = cd;
2471
2417
  }
2472
- get disabled() {
2473
- return this._disabled$.getValue();
2418
+ changed() {
2419
+ if (this.item.isolate) {
2420
+ this.item.isolate.enabled = false;
2421
+ if (this.item.multiple && Array.isArray(this.item.model)) {
2422
+ const index = this.item.model.indexOf(this.item.isolate.value);
2423
+ if (index > -1) {
2424
+ this.item.model.splice(index, 1);
2425
+ }
2426
+ }
2427
+ }
2474
2428
  }
2475
- get disabled$() {
2476
- return this._disabled$.asObservable();
2429
+ close() {
2430
+ this.select.close();
2477
2431
  }
2478
- updateVisibility() {
2479
- const visible = !!this._showFn ? this._showFn() : true;
2480
- if (!visible || this.mode !== ActionMode.Menu) {
2481
- this._visible$.next(visible);
2482
- return;
2432
+ isolateChange(filter) {
2433
+ if (filter.isolate.enabled) {
2434
+ filter.model = filter.multiple ? [filter.isolate.value] : filter.isolate.value;
2483
2435
  }
2484
- const hasVisibleChildren = this.items.some((item) => item.visible);
2485
- this._visible$.next(hasVisibleChildren);
2486
- }
2487
- updateDisabledState() {
2488
- if (this._disabledFn) {
2489
- this.disabled = this._disabledFn();
2436
+ else {
2437
+ if (filter.multiple) {
2438
+ filter.model = filter.defaultValue ? filter.defaultValue : [];
2439
+ }
2440
+ else {
2441
+ filter.model = filter.defaultValue ? filter.defaultValue : null;
2442
+ }
2490
2443
  }
2491
2444
  }
2492
- _init(config) {
2493
- var _a, _b, _c, _d, _e, _f;
2494
- config.mode = (_a = config.mode) !== null && _a !== void 0 ? _a : ActionMode.Button;
2495
- this.primary = (_b = config.primary) !== null && _b !== void 0 ? _b : true;
2496
- this.color = config.color;
2497
- this.type = (_c = config.type) !== null && _c !== void 0 ? _c : ActionType.Raised;
2498
- this.label = config.label;
2499
- this.mode = config.mode;
2500
- this.icon = config.icon;
2501
- this.iconPlacement = config.iconPlacement;
2502
- this._showFn = config.show;
2503
- this.tabIndex = (_d = config.tabIndex) !== null && _d !== void 0 ? _d : 0;
2504
- if (config.multiple !== undefined) {
2505
- this.multiple = config.multiple;
2506
- }
2507
- if (config.className) {
2508
- this.className = config.className;
2509
- this.classArray = this.className
2510
- .split(' ');
2445
+ }
2446
+ SelectMultipleComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SelectMultipleComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
2447
+ SelectMultipleComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SelectMultipleComponent, selector: "filter-item-select-multiple", inputs: { item: "item" }, viewQueries: [{ propertyName: "select", first: true, predicate: ["select"], descendants: true, static: true }], ngImport: i0, template: "<mat-form-field [ngClass]=\"{ isolate: item.isolate }\">\n <mat-label>{{item.label}}</mat-label>\n <mat-select\n #select\n [fsFilterFocusTrigger]=\"item\"\n [(ngModel)]=\"item.model\"\n (ngModelChange)=\"changed()\"\n [multiple]=\"item.multiple\">\n <mat-option\n *ngFor=\"let item of item.values | fsFilterIsolateValues: item.isolate\"\n [value]=\"item.value\">\n {{ item.name }}\n </mat-option>\n </mat-select>\n\n <mat-hint>\n <div *ngIf=\"item.isolate\">\n <mat-checkbox (change)=\"isolateChange(item)\" [(ngModel)]=\"item.isolate.enabled\">\n <span class=\"checkbox-label\">{{ item.isolate.label }}</span>\n </mat-checkbox>\n </div>\n </mat-hint>\n</mat-form-field>\n", styles: [".isolate{margin-bottom:25px}\n"], components: [{ type: i1$3.MatFormField, selector: "mat-form-field", inputs: ["color", "floatLabel", "appearance", "hideRequiredMarker", "hintLabel"], exportAs: ["matFormField"] }, { type: i2.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { type: i3$1.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { type: i4$2.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex", "aria-label", "aria-labelledby", "id", "labelPosition", "name", "required", "checked", "disabled", "indeterminate", "aria-describedby", "value"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }], directives: [{ type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i6$1.DefaultClassDirective, selector: " [ngClass], [ngClass.xs], [ngClass.sm], [ngClass.md], [ngClass.lg], [ngClass.xl], [ngClass.lt-sm], [ngClass.lt-md], [ngClass.lt-lg], [ngClass.lt-xl], [ngClass.gt-xs], [ngClass.gt-sm], [ngClass.gt-md], [ngClass.gt-lg]", inputs: ["ngClass", "ngClass.xs", "ngClass.sm", "ngClass.md", "ngClass.lg", "ngClass.xl", "ngClass.lt-sm", "ngClass.lt-md", "ngClass.lt-lg", "ngClass.lt-xl", "ngClass.gt-xs", "ngClass.gt-sm", "ngClass.gt-md", "ngClass.gt-lg"] }, { type: i1$3.MatLabel, selector: "mat-label" }, { type: FocusToItemDirective, selector: "[fsFilterFocusTrigger]", inputs: ["fsFilterFocusTrigger", "focusTargetType"] }, { type: i5.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i5.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i1$3.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "fsFilterIsolateValues": FsFilterIsolateValues }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
2448
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SelectMultipleComponent, decorators: [{
2449
+ type: Component,
2450
+ args: [{
2451
+ selector: 'filter-item-select-multiple',
2452
+ templateUrl: './multiple.component.html',
2453
+ styleUrls: ['./multiple.component.scss'],
2454
+ changeDetection: ChangeDetectionStrategy.OnPush,
2455
+ }]
2456
+ }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { item: [{
2457
+ type: Input
2458
+ }], select: [{
2459
+ type: ViewChild,
2460
+ args: ['select', { static: true }]
2461
+ }] } });
2462
+
2463
+ class SelectSimpleComponent {
2464
+ constructor(cd) {
2465
+ this.cd = cd;
2466
+ }
2467
+ changed() {
2468
+ if (this.item.isolate) {
2469
+ this.item.isolate.enabled = false;
2511
2470
  }
2512
- if (this.primary) {
2513
- this.color = 'primary';
2471
+ }
2472
+ isolateChange(filter) {
2473
+ if (filter.isolate.enabled) {
2474
+ filter.model = filter.isolate.value;
2514
2475
  }
2515
- switch (config.mode) {
2516
- case ActionMode.Button:
2517
- {
2518
- this.menu = config.menu;
2519
- this.customize = config.customize;
2520
- this.click = (_e = config.click) !== null && _e !== void 0 ? _e : (() => { });
2521
- this._disabledFn = config.disabled;
2522
- this.updateDisabledState();
2523
- }
2524
- break;
2525
- case ActionMode.Menu:
2526
- {
2527
- if (config.items && Array.isArray(config.items)) {
2528
- this.items = config.items.map((item) => new ActionMenuItem(item));
2529
- }
2530
- }
2531
- break;
2532
- case ActionMode.File:
2533
- {
2534
- this.fileSelected = config.select;
2535
- this.fileError = config.error;
2536
- this.accept = config.accept;
2537
- this.imageQuality = config.imageQuality;
2538
- this.minWidth = config.minWidth;
2539
- this.minHeight = config.minHeight;
2540
- this.maxWidth = config.maxWidth;
2541
- this.maxHeight = config.maxHeight;
2542
- this.click = (_f = config.click) !== null && _f !== void 0 ? _f : (() => { });
2543
- this._disabledFn = config.disabled;
2544
- this.updateDisabledState();
2545
- }
2546
- break;
2476
+ else {
2477
+ filter.model = null;
2547
2478
  }
2548
- this.updateVisibility();
2549
2479
  }
2550
2480
  }
2481
+ SelectSimpleComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SelectSimpleComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
2482
+ SelectSimpleComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SelectSimpleComponent, selector: "filter-item-select-simple", inputs: { item: "item" }, viewQueries: [{ propertyName: "select", first: true, predicate: ["select"], descendants: true, static: true }], ngImport: i0, template: "<mat-form-field [ngClass]=\"{ isolate: item.isolate }\">\n <mat-label>{{item.label}}</mat-label>\n <mat-select\n #select\n [fsFilterFocusTrigger]=\"item\"\n [(ngModel)]=\"item.model\"\n (ngModelChange)=\"changed()\">\n <mat-option *ngFor=\"let item of item.values | fsFilterIsolateValues: item.isolate\"\n [value]=\"item.value\"\n >\n {{ item.name }}\n </mat-option>\n </mat-select>\n\n <mat-hint>\n <div *ngIf=\"item.isolate\">\n <mat-checkbox (change)=\"isolateChange(item)\" [(ngModel)]=\"item.isolate.enabled\">\n <span class=\"checkbox-label\">{{ item.isolate.label }}</span>\n </mat-checkbox>\n </div>\n </mat-hint>\n</mat-form-field>\n", styles: [".isolate{margin-bottom:25px}\n"], components: [{ type: i1$3.MatFormField, selector: "mat-form-field", inputs: ["color", "floatLabel", "appearance", "hideRequiredMarker", "hintLabel"], exportAs: ["matFormField"] }, { type: i2.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { type: i3$1.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { type: i4$2.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex", "aria-label", "aria-labelledby", "id", "labelPosition", "name", "required", "checked", "disabled", "indeterminate", "aria-describedby", "value"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }], directives: [{ type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i6$1.DefaultClassDirective, selector: " [ngClass], [ngClass.xs], [ngClass.sm], [ngClass.md], [ngClass.lg], [ngClass.xl], [ngClass.lt-sm], [ngClass.lt-md], [ngClass.lt-lg], [ngClass.lt-xl], [ngClass.gt-xs], [ngClass.gt-sm], [ngClass.gt-md], [ngClass.gt-lg]", inputs: ["ngClass", "ngClass.xs", "ngClass.sm", "ngClass.md", "ngClass.lg", "ngClass.xl", "ngClass.lt-sm", "ngClass.lt-md", "ngClass.lt-lg", "ngClass.lt-xl", "ngClass.gt-xs", "ngClass.gt-sm", "ngClass.gt-md", "ngClass.gt-lg"] }, { type: i1$3.MatLabel, selector: "mat-label" }, { type: FocusToItemDirective, selector: "[fsFilterFocusTrigger]", inputs: ["fsFilterFocusTrigger", "focusTargetType"] }, { type: i5.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i5.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i1$3.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "fsFilterIsolateValues": FsFilterIsolateValues }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
2483
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SelectSimpleComponent, decorators: [{
2484
+ type: Component,
2485
+ args: [{
2486
+ selector: 'filter-item-select-simple',
2487
+ templateUrl: './simple.component.html',
2488
+ styleUrls: ['./simple.component.scss'],
2489
+ changeDetection: ChangeDetectionStrategy.OnPush,
2490
+ }]
2491
+ }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { item: [{
2492
+ type: Input
2493
+ }], select: [{
2494
+ type: ViewChild,
2495
+ args: ['select', { static: true }]
2496
+ }] } });
2551
2497
 
2552
- let ActionsController = class ActionsController {
2553
- constructor(_breakpointObserver) {
2554
- this._breakpointObserver = _breakpointObserver;
2555
- this._visible$ = new BehaviorSubject(false);
2556
- this._actions$ = new BehaviorSubject([]);
2557
- this._menuActions$ = new BehaviorSubject([]);
2558
- this._destroy$ = new Subject();
2559
- this._mobileMedia = '(max-width: 799px)';
2560
- this._allActions = [];
2561
- this._listenMobileMedia();
2562
- }
2563
- get menuActions() {
2564
- return this._menuActions$.value;
2498
+ class SelectGroupsComponent {
2499
+ constructor(cd) {
2500
+ this.cd = cd;
2565
2501
  }
2566
- get actions() {
2567
- return this._actions$.value;
2502
+ compare(o1, o2) {
2503
+ return o1 == o2;
2568
2504
  }
2569
- get actions$() {
2570
- return this._actions$.asObservable();
2505
+ }
2506
+ SelectGroupsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SelectGroupsComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
2507
+ SelectGroupsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SelectGroupsComponent, selector: "filter-item-select-groups", inputs: { item: "item" }, viewQueries: [{ propertyName: "select", first: true, predicate: ["select"], descendants: true, static: true }], ngImport: i0, template: "<mat-form-field>\n <mat-label>{{item.label}}</mat-label>\n <mat-select\n #select\n [fsFilterFocusTrigger]=\"item\"\n [(ngModel)]=\"item.model\"\n [compareWith]=\"compare\">\n <ng-container *ngFor=\"let selectItem of item.values\">\n <ng-container *ngIf=\"selectItem[item.children]; else simpleOption\">\n <mat-optgroup [label]=\"selectItem.name\">\n <mat-option *ngFor=\"let subItem of selectItem[item.children]\"\n [value]=\"subItem.value\"\n [ngStyle]=\"selectItem.style\">\n {{ subItem.name }}\n </mat-option>\n </mat-optgroup>\n </ng-container>\n\n <ng-template #simpleOption>\n <mat-option\n [value]=\"selectItem.value\"\n [ngStyle]=\"selectItem.style\">\n {{ selectItem.name }}\n </mat-option>\n </ng-template>\n </ng-container>\n </mat-select>\n</mat-form-field>\n", components: [{ type: i1$3.MatFormField, selector: "mat-form-field", inputs: ["color", "floatLabel", "appearance", "hideRequiredMarker", "hintLabel"], exportAs: ["matFormField"] }, { type: i2.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { type: i3$1.MatOptgroup, selector: "mat-optgroup", inputs: ["disabled"], exportAs: ["matOptgroup"] }, { type: i3$1.MatOption, selector: "mat-option", exportAs: ["matOption"] }], directives: [{ type: i1$3.MatLabel, selector: "mat-label" }, { type: FocusToItemDirective, selector: "[fsFilterFocusTrigger]", inputs: ["fsFilterFocusTrigger", "focusTargetType"] }, { type: i5.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i5.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { type: i6$1.DefaultStyleDirective, selector: " [ngStyle], [ngStyle.xs], [ngStyle.sm], [ngStyle.md], [ngStyle.lg], [ngStyle.xl], [ngStyle.lt-sm], [ngStyle.lt-md], [ngStyle.lt-lg], [ngStyle.lt-xl], [ngStyle.gt-xs], [ngStyle.gt-sm], [ngStyle.gt-md], [ngStyle.gt-lg]", inputs: ["ngStyle", "ngStyle.xs", "ngStyle.sm", "ngStyle.md", "ngStyle.lg", "ngStyle.xl", "ngStyle.lt-sm", "ngStyle.lt-md", "ngStyle.lt-lg", "ngStyle.lt-xl", "ngStyle.gt-xs", "ngStyle.gt-sm", "ngStyle.gt-md", "ngStyle.gt-lg"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2508
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SelectGroupsComponent, decorators: [{
2509
+ type: Component,
2510
+ args: [{
2511
+ selector: 'filter-item-select-groups',
2512
+ templateUrl: './groups.component.html',
2513
+ changeDetection: ChangeDetectionStrategy.OnPush,
2514
+ }]
2515
+ }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { select: [{
2516
+ type: ViewChild,
2517
+ args: ['select', { static: true }]
2518
+ }], item: [{
2519
+ type: Input
2520
+ }] } });
2521
+
2522
+ class SelectComponent extends BaseItemComponent {
2523
+ constructor(_kvDiffers, _cd) {
2524
+ super(_kvDiffers, _cd);
2525
+ this._kvDiffers = _kvDiffers;
2526
+ this._cd = _cd;
2527
+ // For case when we have multiple selection with __all option
2528
+ // If _all has been selected than we must disable all other items
2529
+ this.allItemsOptionSelected = false;
2571
2530
  }
2572
- get menuActions$() {
2573
- return this._menuActions$.asObservable();
2531
+ ngDoCheck() {
2532
+ if (this._kvDiffer) {
2533
+ const changes = this._kvDiffer.diff(this.item);
2534
+ if (changes) {
2535
+ this._cd.markForCheck();
2536
+ if (this.selectedItem) {
2537
+ this.selectedItem.cd.markForCheck();
2538
+ }
2539
+ }
2540
+ }
2574
2541
  }
2575
- get visible$() {
2576
- return this._visible$.asObservable();
2542
+ }
2543
+ SelectComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SelectComponent, deps: [{ token: i0.KeyValueDiffers }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
2544
+ SelectComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SelectComponent, selector: "filter-item-select", viewQueries: [{ propertyName: "selectedItem", first: true, predicate: ["selectItem"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<ng-container *ngIf=\"(item.loading$ | async) else itemSelect\">\n <mat-form-field>\n <mat-label>{{item.label}}</mat-label>\n <mat-select disabled></mat-select>\n </mat-form-field>\n</ng-container>\n\n<ng-template #itemSelect>\n <ng-container *ngIf=\"(item.values$ | async)?.length\">\n <ng-container *ngIf=\"item.multiple && !item.children\">\n <filter-item-select-multiple\n [item]=\"item\"\n #selectItem>\n </filter-item-select-multiple>\n </ng-container>\n\n <ng-container *ngIf=\"!item.multiple && !item.children\">\n <filter-item-select-simple\n [item]=\"item\"\n #selectItem>\n </filter-item-select-simple>\n </ng-container>\n\n <ng-container *ngIf=\"item.children\">\n <filter-item-select-groups\n [item]=\"item\"\n #selectItem>\n </filter-item-select-groups>\n </ng-container>\n </ng-container>\n</ng-template>\n", components: [{ type: i1$3.MatFormField, selector: "mat-form-field", inputs: ["color", "floatLabel", "appearance", "hideRequiredMarker", "hintLabel"], exportAs: ["matFormField"] }, { type: i2.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { type: SelectMultipleComponent, selector: "filter-item-select-multiple", inputs: ["item"] }, { type: SelectSimpleComponent, selector: "filter-item-select-simple", inputs: ["item"] }, { type: SelectGroupsComponent, selector: "filter-item-select-groups", inputs: ["item"] }], directives: [{ type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1$3.MatLabel, selector: "mat-label" }], pipes: { "async": i3.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
2545
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SelectComponent, decorators: [{
2546
+ type: Component,
2547
+ args: [{
2548
+ selector: 'filter-item-select',
2549
+ templateUrl: './select.component.html',
2550
+ changeDetection: ChangeDetectionStrategy.OnPush,
2551
+ }]
2552
+ }], ctorParameters: function () { return [{ type: i0.KeyValueDiffers }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { selectedItem: [{
2553
+ type: ViewChild,
2554
+ args: ['selectItem']
2555
+ }] } });
2556
+
2557
+ class ChipsComponent extends BaseItemComponent {
2558
+ constructor(_kvDiffers, _cd) {
2559
+ super(_kvDiffers, _cd);
2560
+ this._kvDiffers = _kvDiffers;
2561
+ this._cd = _cd;
2577
2562
  }
2578
- get mobileMode() {
2579
- return this._breakpointObserver.isMatched(this._mobileMedia);
2563
+ modelChange() {
2564
+ this.itemChange();
2580
2565
  }
2581
- ngOnDestroy() {
2582
- this._destroy$.next();
2583
- this._destroy$.complete();
2566
+ compareFn(modelValue, chipValue) {
2567
+ return modelValue.value === chipValue.value;
2584
2568
  }
2585
- initActions(rawActions) {
2586
- if (!rawActions || !Array.isArray(rawActions)) {
2587
- return;
2588
- }
2589
- this.show();
2590
- this._allActions = rawActions
2591
- .map((action) => new Action(action));
2592
- if (this._reorderAction) {
2593
- this._allActions.unshift(this._reorderAction);
2594
- }
2595
- this._classifyActions();
2569
+ }
2570
+ ChipsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ChipsComponent, deps: [{ token: i0.KeyValueDiffers }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
2571
+ ChipsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ChipsComponent, selector: "filter-item-chips", usesInheritance: true, ngImport: i0, template: "<ng-template [ngIf]=\"item.values?.length\">\n <fs-label-field>\n <fs-label>{{item.label}}</fs-label>\n <fs-chips [(ngModel)]=\"item.model\"\n [compare]=\"compareFn\"\n [multiple]=\"item.multiple\">\n <fs-chip *ngFor=\"let value of item.values\"\n [value]=\"value\"\n [selectable]=\"true\">\n {{ value.name }}\n </fs-chip>\n </fs-chips>\n </fs-label-field>\n</ng-template>\n\n<ng-template [ngIf]=\"item.loading\">{{ item.label }} loading...</ng-template>\n", styles: ["fs-chip{line-height:40px}\n"], components: [{ type: i1$5.FsLabelFieldComponent, selector: "fs-label-field", inputs: ["bottomMargin", "topMargin", "labelMargin"] }, { type: i1$5.FsLabelComponent, selector: "fs-label" }, { type: i2$1.FsChipsComponent, selector: "fs-chips", inputs: ["compare", "multiple"] }, { type: i2$1.FsChipComponent, selector: "fs-chip", inputs: ["size", "value", "backgroundColor", "borderColor", "color", "outlined", "removable", "selectable", "selected", "image"], outputs: ["selectedToggled", "removed"] }], directives: [{ type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i5.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i5.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2572
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ChipsComponent, decorators: [{
2573
+ type: Component,
2574
+ args: [{
2575
+ selector: 'filter-item-chips',
2576
+ templateUrl: './chips.component.html',
2577
+ styleUrls: ['./chips.component.scss'],
2578
+ changeDetection: ChangeDetectionStrategy.OnPush,
2579
+ }]
2580
+ }], ctorParameters: function () { return [{ type: i0.KeyValueDiffers }, { type: i0.ChangeDetectorRef }]; } });
2581
+
2582
+ class RangeComponent extends BaseItemComponent {
2583
+ constructor(_kvDiffers, _cd) {
2584
+ super(_kvDiffers, _cd);
2585
+ this._kvDiffers = _kvDiffers;
2586
+ this._cd = _cd;
2596
2587
  }
2597
- show() {
2598
- this._visible$.next(true);
2588
+ ngOnInit() {
2589
+ this.listenChanges();
2599
2590
  }
2600
- hide() {
2601
- this._visible$.next(false);
2591
+ listenChanges() {
2592
+ const fromListener = fromEvent(this.from.nativeElement, 'keyup')
2593
+ .pipe(distinctUntilChanged());
2594
+ const toListener = fromEvent(this.to.nativeElement, 'keyup')
2595
+ .pipe(distinctUntilChanged());
2596
+ merge(fromListener, toListener)
2597
+ .pipe(takeUntil(this._destroy$))
2598
+ .subscribe(() => {
2599
+ this.itemChange();
2600
+ });
2602
2601
  }
2603
- addReorderAction(action) {
2604
- this._allActions.unshift(action);
2605
- action.isReorderAction = true;
2606
- this._classifyAction(action);
2607
- this._reorderAction = action;
2602
+ }
2603
+ RangeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: RangeComponent, deps: [{ token: i0.KeyValueDiffers }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
2604
+ RangeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: RangeComponent, selector: "filter-item-range", viewQueries: [{ propertyName: "from", first: true, predicate: ["from"], descendants: true, static: true }, { propertyName: "to", first: true, predicate: ["to"], descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: "<span fxLayout=\"row\">\n <mat-form-field class=\"filter-range-min\">\n <mat-label>{{item.label[0]}}</mat-label>\n <span matPrefix *ngIf=\"item.prefix\" [innerHtml]=\"item.prefix\"></span>\n <input matInput\n [fsFilterFocusTrigger]=\"item\"\n [focusTargetType]=\"'from'\"\n type=\"text\"\n inputmode=\"decimal\"\n [(ngModel)]=\"item.model.min\"\n fsMaskNumber\n [scale]=\"item.options?.scale || 2\"\n #from\n >\n <span matSuffix *ngIf=\"item.suffix\" [innerHtml]=\"item.suffix\"></span>\n </mat-form-field>\n <div class=\"spacer\"></div>\n <mat-form-field class=\"filter-range-max\">\n <mat-label>{{item.label[1]}}</mat-label>\n <span matPrefix *ngIf=\"item.prefix\" [innerHtml]=\"item.prefix\"></span>\n <input matInput\n [fsFilterFocusTrigger]=\"item\"\n [focusTargetType]=\"'to'\"\n type=\"text\"\n inputmode=\"decimal\"\n [(ngModel)]=\"item.model.max\"\n fsMaskNumber\n [scale]=\"item.options?.scale || 2\"\n #to\n >\n <span matSuffix *ngIf=\"item.suffix\" [innerHtml]=\"item.suffix\"></span>\n </mat-form-field>\n</span>\n", styles: [".spacer{width:15px}mat-form-field{min-width:initial;display:flex;width:auto}mat-form-field ::ng-deep .mat-form-field-infix{width:auto}\n"], components: [{ type: i1$3.MatFormField, selector: "mat-form-field", inputs: ["color", "floatLabel", "appearance", "hideRequiredMarker", "hintLabel"], exportAs: ["matFormField"] }], directives: [{ type: i2$2.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { type: i1$3.MatLabel, selector: "mat-label" }, { type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1$3.MatPrefix, selector: "[matPrefix]" }, { type: i4.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["id", "disabled", "required", "type", "value", "readonly", "placeholder", "errorStateMatcher", "aria-describedby"], exportAs: ["matInput"] }, { type: i5.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i6$2.FsMaskNumberDirective, selector: "[fsMaskNumber]" }, { type: FocusToItemDirective, selector: "[fsFilterFocusTrigger]", inputs: ["fsFilterFocusTrigger", "focusTargetType"] }, { type: i5.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i5.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i1$3.MatSuffix, selector: "[matSuffix]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2605
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: RangeComponent, decorators: [{
2606
+ type: Component,
2607
+ args: [{
2608
+ selector: 'filter-item-range',
2609
+ templateUrl: './range.component.html',
2610
+ styleUrls: ['./range.component.scss'],
2611
+ changeDetection: ChangeDetectionStrategy.OnPush,
2612
+ }]
2613
+ }], ctorParameters: function () { return [{ type: i0.KeyValueDiffers }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { from: [{
2614
+ type: ViewChild,
2615
+ args: ['from', { static: true }]
2616
+ }], to: [{
2617
+ type: ViewChild,
2618
+ args: ['to', { static: true }]
2619
+ }] } });
2620
+
2621
+ class AutocompleteComponent extends BaseItemComponent {
2622
+ constructor(_kvDiffers, _cd) {
2623
+ super(_kvDiffers, _cd);
2624
+ this._kvDiffers = _kvDiffers;
2625
+ this._cd = _cd;
2626
+ this.displayWith = (data) => {
2627
+ return data ? data.name : data;
2628
+ };
2629
+ this.fetch = (keyword) => {
2630
+ return this.item.valuesFn(keyword);
2631
+ };
2608
2632
  }
2609
- clearActions() {
2610
- this._allActions = [];
2611
- this._setActions([]);
2612
- this._setKebabActions([]);
2633
+ }
2634
+ AutocompleteComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: AutocompleteComponent, deps: [{ token: i0.KeyValueDiffers }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
2635
+ AutocompleteComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: AutocompleteComponent, selector: "filter-item-autocomplete", usesInheritance: true, ngImport: i0, template: "<fs-autocomplete\n [fsFilterFocusTrigger]=\"item\"\n [fetch]=\"fetch\"\n [displayWith]=\"displayWith\"\n [(ngModel)]=\"item.model\"\n [placeholder]=\"item.label\"\n [fetchOnFocus]=\"item.fetchOnFocus\"\n [showClear]=\"item.clearAllowed\"\n name=\"item.name\">\n <ng-template fsAutocompleteTemplate let-data=\"data\">\n {{data.name}}\n </ng-template>\n</fs-autocomplete>\n", components: [{ type: i4$1.FsAutocompleteComponent, selector: "fs-autocomplete", inputs: ["fetch", "placeholder", "displayWith", "fetchOnFocus", "readonly", "required", "disabled", "hint", "panelWidth", "panelClass", "showClear"], outputs: ["cleared"] }], directives: [{ type: FocusToItemDirective, selector: "[fsFilterFocusTrigger]", inputs: ["fsFilterFocusTrigger", "focusTargetType"] }, { type: i5.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i5.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i4$1.FsAutocompleteTemplateDirective, selector: "[fsAutocompleteTemplate]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2636
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: AutocompleteComponent, decorators: [{
2637
+ type: Component,
2638
+ args: [{
2639
+ selector: 'filter-item-autocomplete',
2640
+ templateUrl: './autocomplete.component.html',
2641
+ changeDetection: ChangeDetectionStrategy.OnPush,
2642
+ }]
2643
+ }], ctorParameters: function () { return [{ type: i0.KeyValueDiffers }, { type: i0.ChangeDetectorRef }]; } });
2644
+
2645
+ class AutocompletechipsComponent extends BaseItemComponent {
2646
+ constructor(_kvDiffers, _cd) {
2647
+ super(_kvDiffers, _cd);
2648
+ this._kvDiffers = _kvDiffers;
2649
+ this._cd = _cd;
2650
+ this.fetch = (keyword) => {
2651
+ return this.item.valuesFn(keyword);
2652
+ };
2613
2653
  }
2614
- updateActionsVisibility() {
2615
- this._allActions.forEach((action) => action.updateVisibility());
2616
- this._classifyActions();
2654
+ // SP-T1747
2655
+ clicked() {
2656
+ this.chipBackground = this.item.chipBackground;
2657
+ this.chipColor = this.item.chipColor;
2658
+ this.chipIcon = this.item.chipIcon;
2659
+ this._cd.markForCheck();
2617
2660
  }
2618
- updateDisabledState() {
2619
- this.actions.forEach((action) => action.updateDisabledState());
2661
+ addAutocompleteChipItem(event) {
2662
+ if (event.data && this.item.model.indexOf(event.data.value) === -1) {
2663
+ this.item.model.push(event.data);
2664
+ this.itemChange();
2665
+ }
2620
2666
  }
2621
- _setKebabActions(actions) {
2622
- this._menuActions$.next(actions);
2667
+ removeAutocompleteChipItem(event) {
2668
+ remove(this.item.model, { value: event.data.value });
2669
+ this.itemChange();
2623
2670
  }
2624
- _setActions(actions) {
2625
- this._actions$.next(actions);
2671
+ clearAutocompleteChipItem() {
2672
+ this.item.clear();
2673
+ this.itemChange();
2626
2674
  }
2627
- _classifyActions() {
2628
- const kebabActions = [];
2629
- const actions = [];
2630
- const mobileMode = this.mobileMode;
2631
- this._allActions
2632
- .filter((action) => {
2633
- return action.visible;
2634
- })
2635
- .forEach((action) => {
2636
- if (action.menu || mobileMode) {
2637
- kebabActions.push(action);
2638
- }
2639
- else {
2640
- actions.push(action);
2641
- }
2642
- });
2643
- this._setKebabActions(kebabActions);
2644
- this._setActions(actions);
2675
+ compareItems(item1, item2) {
2676
+ return (item1 === null || item1 === void 0 ? void 0 : item1.value) === (item2 === null || item2 === void 0 ? void 0 : item2.value);
2645
2677
  }
2646
- _classifyAction(action) {
2647
- if (action.menu) {
2648
- this._setKebabActions([...this.menuActions, action]);
2678
+ }
2679
+ AutocompletechipsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: AutocompletechipsComponent, deps: [{ token: i0.KeyValueDiffers }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
2680
+ AutocompletechipsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: AutocompletechipsComponent, selector: "filter-item-autocompletechips", usesInheritance: true, ngImport: i0, template: "<fs-autocomplete-chips\n [fsFilterFocusTrigger]=\"item\"\n [fetch]=\"fetch\"\n [ngModel]=\"item.model\"\n (selected)=\"addAutocompleteChipItem($event)\"\n (removed)=\"removeAutocompleteChipItem($event)\"\n (clear)=\"clearAutocompleteChipItem()\"\n (click)=\"clicked()\"\n [allowText]=\"false\"\n [fetchOnFocus]=\"item.fetchOnFocus\"\n [placeholder]=\"item.label\"\n [chipImage]=\"item.chipImage\"\n [chipColor]=\"chipColor\"\n [chipIconColor]=\"chipIcon\"\n [chipBackground]=\"chipBackground\"\n [chipIcon]=\"item.chipIcon\"\n [chipClass]=\"item.chipClass\"\n [allowClear]=\"item.clearAllowed\"\n [removable]=\"item.clearAllowed\"\n [compareWith]=\"compareItems\"\n name=\"model\">\n <ng-template fsAutocompleteObject let-object=\"object\">\n {{ object.name }}\n </ng-template>\n</fs-autocomplete-chips>\n\n<!--<mat-form-field floatLabel=\"auto\">\n <mat-label>{{item.label}}</mat-label>\n <mat-chip-list #chipList>\n <mat-chip *ngFor=\"let item of item.model\"\n (removed)=\"removeAutocompleteChipItem(item)\">\n {{ item.name }}\n <mat-icon matChipRemove>cancel</mat-icon>\n </mat-chip>\n\n <input #chipsInput\n type=\"text\"\n matInput\n [(ngModel)]=\"item.selectedValue\"\n (ngModelChange)=\"onAutocompleteChipsChange(chipsInput)\"\n [name]=\"item.name\"\n [matChipInputFor]=\"chipList\"\n [matAutocomplete]=\"autocompleteChipsInput\">\n </mat-chip-list>\n\n <mat-autocomplete #autocompleteChipsInput=\"matAutocomplete\"\n (optionSelected)=\"addAutocompleteChipItem( $event)\"\n >\n <mat-option *ngFor=\"let item of item.values$ | async\" [value]=\"item\">\n {{ item.name }}\n </mat-option>\n </mat-autocomplete>\n <mat-placeholder *ngIf=\"inline\">{{ item.label }}</mat-placeholder>\n</mat-form-field>-->\n", components: [{ type: i5$1.FsAutocompleteChipsComponent, selector: "fs-autocomplete-chips", inputs: ["fetch", "readonly", "size", "placeholder", "chipImage", "chipBackground", "chipColor", "chipIcon", "chipIconColor", "chipClass", "hint", "allowText", "allowObject", "delay", "validateText", "invalidTextMessage", "removable", "allowClear", "color", "background", "orderable", "limit", "initOnClick", "fetchOnFocus", "multiple", "panelClass", "compareWith", "disabled", "panelWidth"], outputs: ["selected", "removed", "reordered", "clear"] }], directives: [{ type: FocusToItemDirective, selector: "[fsFilterFocusTrigger]", inputs: ["fsFilterFocusTrigger", "focusTargetType"] }, { type: i5.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i5.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i5$1.FsAutocompleteObjectDirective, selector: "[fsAutocompleteObject],[fsAutocompleteChipsTemplate]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2681
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: AutocompletechipsComponent, decorators: [{
2682
+ type: Component,
2683
+ args: [{
2684
+ selector: 'filter-item-autocompletechips',
2685
+ templateUrl: './autocompletechips.component.html',
2686
+ changeDetection: ChangeDetectionStrategy.OnPush,
2687
+ }]
2688
+ }], ctorParameters: function () { return [{ type: i0.KeyValueDiffers }, { type: i0.ChangeDetectorRef }]; } });
2689
+
2690
+ class DateComponent extends BaseItemComponent {
2691
+ constructor(_kvDiffers, _cd) {
2692
+ super(_kvDiffers, _cd);
2693
+ this._kvDiffers = _kvDiffers;
2694
+ this._cd = _cd;
2695
+ this.viewType = 'date';
2696
+ this.itemDateMode = ItemDateMode;
2697
+ this.showYear = true;
2698
+ this.showMonth = true;
2699
+ this.showDay = true;
2700
+ }
2701
+ ngOnInit() {
2702
+ if (this.item.type === ItemType.DateTime) {
2703
+ this.viewType = 'datetime';
2649
2704
  }
2650
2705
  else {
2651
- this._setActions([...this.actions, action]);
2706
+ this.viewType = 'date';
2707
+ }
2708
+ if (this.item.mode === ItemDateMode.ScrollMonthYear) {
2709
+ this.showDay = false;
2652
2710
  }
2653
2711
  }
2654
- _listenMobileMedia() {
2655
- this._breakpointObserver.observe(this._mobileMedia)
2656
- .pipe(skip(1), takeUntil(this._destroy$))
2657
- .subscribe(() => {
2658
- this._classifyActions();
2659
- });
2712
+ }
2713
+ DateComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: DateComponent, deps: [{ token: i0.KeyValueDiffers }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
2714
+ DateComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: DateComponent, selector: "filter-item-date", usesInheritance: true, ngImport: i0, template: "<mat-form-field *ngIf=\"item.mode===itemDateMode.Calendar; else elseMode\">\n <mat-label>{{item.label}}</mat-label>\n <input matInput\n fsDatePicker\n [fsFilterFocusTrigger]=\"item\"\n [(ngModel)]=\"item.model\"\n [maxYear]=\"item.maxYear\"\n [view]=\"viewType\"\n [clear]=\"item.clearAllowed\"\n [name]=\"item.name\">\n <mat-placeholder *ngIf=\"inline\">{{ item.label }}</mat-placeholder>\n</mat-form-field>\n\n<ng-template #elseMode>\n <mat-form-field>\n <mat-label>{{item.label}}</mat-label>\n <input matInput\n fsDateScrollPicker\n [fsFilterFocusTrigger]=\"item\"\n [(ngModel)]=\"item.model\"\n [maxYear]=\"item.maxYear\"\n [showMonth]=\"showMonth\"\n [showDay]=\"showDay\"\n [showYear]=\"showYear\"\n [clear]=\"item.clearAllowed\"\n [name]=\"item.name\">\n <mat-placeholder *ngIf=\"inline\">{{ item.label }}</mat-placeholder>\n </mat-form-field>\n</ng-template>\n", components: [{ type: i1$3.MatFormField, selector: "mat-form-field", inputs: ["color", "floatLabel", "appearance", "hideRequiredMarker", "hintLabel"], exportAs: ["matFormField"] }, { type: i3$2.FsDatePickerComponent, selector: "[fsDatePicker]", inputs: ["minYear", "maxYear", "minDate", "maxDate", "startOfDay", "view", "minutes", "format"], outputs: ["change"] }, { type: i3$2.FsDateScrollPickerComponent, selector: "[fsDateScrollPicker]", inputs: ["minYear", "maxYear", "showMonth", "showYear", "showDay", "maxDate"] }], directives: [{ type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1$3.MatLabel, selector: "mat-label" }, { type: i4.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["id", "disabled", "required", "type", "value", "readonly", "placeholder", "errorStateMatcher", "aria-describedby"], exportAs: ["matInput"] }, { type: i5.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: FocusToItemDirective, selector: "[fsFilterFocusTrigger]", inputs: ["fsFilterFocusTrigger", "focusTargetType"] }, { type: i5.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i5.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i1$3.MatPlaceholder, selector: "mat-placeholder" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2715
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: DateComponent, decorators: [{
2716
+ type: Component,
2717
+ args: [{
2718
+ selector: 'filter-item-date',
2719
+ templateUrl: './date.component.html',
2720
+ changeDetection: ChangeDetectionStrategy.OnPush,
2721
+ }]
2722
+ }], ctorParameters: function () { return [{ type: i0.KeyValueDiffers }, { type: i0.ChangeDetectorRef }]; } });
2723
+
2724
+ class DateRangeComponent extends BaseItemComponent {
2725
+ constructor(_kvDiffers, _cd) {
2726
+ super(_kvDiffers, _cd);
2727
+ this._kvDiffers = _kvDiffers;
2728
+ this._cd = _cd;
2729
+ this.viewType = 'date';
2730
+ }
2731
+ ngOnInit() {
2732
+ if (this.item.type === ItemType.DateTimeRange) {
2733
+ this.viewType = 'datetime';
2734
+ }
2735
+ else {
2736
+ this.viewType = 'date';
2737
+ }
2660
2738
  }
2661
- };
2662
- ActionsController.ctorParameters = () => [
2663
- { type: BreakpointObserver }
2664
- ];
2665
- ActionsController = __decorate([
2666
- Injectable(),
2667
- __metadata("design:paramtypes", [BreakpointObserver])
2668
- ], ActionsController);
2739
+ }
2740
+ DateRangeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: DateRangeComponent, deps: [{ token: i0.KeyValueDiffers }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
2741
+ DateRangeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: DateRangeComponent, selector: "filter-item-date-range", usesInheritance: true, ngImport: i0, template: "<mat-form-field>\n <mat-label>{{item.label[0]}}</mat-label>\n <input\n matInput\n [fsFilterFocusTrigger]=\"item\"\n [focusTargetType]=\"'from'\"\n [fsDateRangeFrom]=\"item.name\"\n [(ngModel)]=\"item.model.from\"\n (ngModelChange)=\"itemChange()\"\n [clear]=\"item.clearAllowed\"\n [view]=\"viewType\"\n name=\"date_from\">\n</mat-form-field>\n\n<mat-form-field>\n <mat-label>{{item.label[1]}}</mat-label>\n <input\n matInput\n [fsFilterFocusTrigger]=\"item\"\n [focusTargetType]=\"'to'\"\n [fsDateRangeTo]=\"item.name\"\n [(ngModel)]=\"item.model.to\"\n (ngModelChange)=\"itemChange()\"\n [clear]=\"item.clearAllowed\"\n [view]=\"viewType\"\n name=\"date_to\">\n</mat-form-field>\n", components: [{ type: i1$3.MatFormField, selector: "mat-form-field", inputs: ["color", "floatLabel", "appearance", "hideRequiredMarker", "hintLabel"], exportAs: ["matFormField"] }, { type: i3$2.DateRangePickerFromComponent, selector: "[fsDateRangeFrom],[fsDateRangeFromPicker]", inputs: ["fsDateRangeFrom", "fsDateRangeFromPicker"] }, { type: i3$2.DateRangePickerToComponent, selector: "[fsDateRangeTo],[fsDateRangeToPicker]", inputs: ["fsDateRangeTo", "fsDateRangeToPicker"] }], directives: [{ type: i1$3.MatLabel, selector: "mat-label" }, { type: i4.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["id", "disabled", "required", "type", "value", "readonly", "placeholder", "errorStateMatcher", "aria-describedby"], exportAs: ["matInput"] }, { type: i5.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: FocusToItemDirective, selector: "[fsFilterFocusTrigger]", inputs: ["fsFilterFocusTrigger", "focusTargetType"] }, { type: i5.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i5.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2742
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: DateRangeComponent, decorators: [{
2743
+ type: Component,
2744
+ args: [{
2745
+ selector: 'filter-item-date-range',
2746
+ templateUrl: './date-range.component.html',
2747
+ changeDetection: ChangeDetectionStrategy.OnPush,
2748
+ }]
2749
+ }], ctorParameters: function () { return [{ type: i0.KeyValueDiffers }, { type: i0.ChangeDetectorRef }]; } });
2669
2750
 
2670
- let FilterComponent = class FilterComponent {
2671
- constructor(_filterOverlay, _zone, _externalParams, _filterItems, _actions, _defaultConfig) {
2672
- this._filterOverlay = _filterOverlay;
2673
- this._zone = _zone;
2674
- this._externalParams = _externalParams;
2675
- this._filterItems = _filterItems;
2676
- this._actions = _actions;
2677
- this._defaultConfig = _defaultConfig;
2678
- this.showSortBy = true;
2679
- this.showFilterInput = true;
2680
- this.closed = new EventEmitter();
2681
- this.opened = new EventEmitter();
2682
- this.ready = new EventEmitter();
2683
- this.showFilterMenu = false;
2684
- this.windowDesktop = false;
2685
- this.fsFilterClass = true;
2686
- this.searchText = new FormControl();
2687
- this.searchPlaceholder = 'Search';
2688
- this._config = null;
2689
- this._filtersBtnVisible$ = new BehaviorSubject(true);
2690
- this._keywordVisible$ = new BehaviorSubject(true);
2691
- this._hasFilterChips$ = new BehaviorSubject(false);
2751
+ class CheckboxComponent extends BaseItemComponent {
2752
+ constructor(_kvDiffers, _cd) {
2753
+ super(_kvDiffers, _cd);
2754
+ this._kvDiffers = _kvDiffers;
2755
+ this._cd = _cd;
2756
+ }
2757
+ }
2758
+ CheckboxComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: CheckboxComponent, deps: [{ token: i0.KeyValueDiffers }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
2759
+ CheckboxComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: CheckboxComponent, selector: "filter-item-checkbox", usesInheritance: true, ngImport: i0, template: "<fs-label-field>\n <mat-checkbox [(ngModel)]=\"item.model\">\n {{ item.label }}\n </mat-checkbox>\n</fs-label-field>\n", styles: ["fs-label-field{margin:0}\n"], components: [{ type: i1$5.FsLabelFieldComponent, selector: "fs-label-field", inputs: ["bottomMargin", "topMargin", "labelMargin"] }, { type: i4$2.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex", "aria-label", "aria-labelledby", "id", "labelPosition", "name", "required", "checked", "disabled", "indeterminate", "aria-describedby", "value"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }], directives: [{ type: i5.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i5.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2760
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: CheckboxComponent, decorators: [{
2761
+ type: Component,
2762
+ args: [{
2763
+ selector: 'filter-item-checkbox',
2764
+ templateUrl: './checkbox.component.html',
2765
+ styleUrls: ['checkbox.component.scss'],
2766
+ changeDetection: ChangeDetectionStrategy.OnPush,
2767
+ }]
2768
+ }], ctorParameters: function () { return [{ type: i0.KeyValueDiffers }, { type: i0.ChangeDetectorRef }]; } });
2769
+
2770
+ class FilterItemComponent {
2771
+ constructor(_cdRef) {
2772
+ this._cdRef = _cdRef;
2692
2773
  this._destroy$ = new Subject();
2693
- this._listenWhenFilterReady();
2694
- this._updateWindowWidth();
2695
- this._filterOverlay.attach$
2696
- .pipe(takeUntil(this._destroy$))
2697
- .subscribe(() => {
2698
- this.showFilterMenu = true;
2699
- });
2700
- this._filterOverlay.detach$
2774
+ this.itemType = ItemType;
2775
+ }
2776
+ ngOnInit() {
2777
+ this.item.value$
2701
2778
  .pipe(takeUntil(this._destroy$))
2702
2779
  .subscribe(() => {
2703
- this.showFilterMenu = false;
2780
+ this._cdRef.markForCheck();
2704
2781
  });
2705
- this._listenWindowResize();
2706
2782
  }
2707
- set setConfig(config) {
2708
- this._initFilterWithConfig(config);
2783
+ ngOnDestroy() {
2784
+ this._destroy$.next();
2785
+ this._destroy$.complete();
2709
2786
  }
2710
- set setFilter(config) {
2711
- this._initFilterWithConfig(config);
2787
+ }
2788
+ FilterItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FilterItemComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
2789
+ FilterItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FilterItemComponent, selector: "filter-item", inputs: { item: "item" }, ngImport: i0, template: "<div class=\"filter filter-{{ item.type }}\">\n\n <ng-container [ngSwitch]=\"item.type\">\n <filter-item-text class=\"interface\"\n *ngSwitchCase=\"itemType.Text\"\n [item]=\"item\">\n </filter-item-text>\n\n <filter-item-select class=\"interface\"\n *ngSwitchCase=\"itemType.Select\"\n [item]=\"item\">\n </filter-item-select>\n\n <filter-item-chips class=\"interface\"\n *ngSwitchCase=\"itemType.Chips\"\n [item]=\"item\">\n </filter-item-chips>\n\n <filter-item-range class=\"interface interface-range\"\n *ngSwitchCase=\"itemType.Range\"\n [item]=\"item\">\n </filter-item-range>\n\n <filter-item-autocomplete class=\"interface\"\n *ngSwitchCase=\"itemType.AutoComplete\"\n [item]=\"item\">\n </filter-item-autocomplete>\n\n <filter-item-autocompletechips class=\"interface\"\n *ngSwitchCase=\"itemType.AutoCompleteChips\"\n [item]=\"item\">\n </filter-item-autocompletechips>\n\n <filter-item-date class=\"interface interface-date\"\n *ngSwitchCase=\"itemType.Date\"\n [item]=\"item\">\n </filter-item-date>\n\n <filter-item-date class=\"interface interface-date\"\n *ngSwitchCase=\"itemType.DateTime\"\n [item]=\"item\">\n </filter-item-date>\n\n <filter-item-date-range class=\"interface interface-date\"\n *ngSwitchCase=\"itemType.DateRange\"\n [item]=\"item\">\n </filter-item-date-range>\n\n <filter-item-date-range class=\"interface interface-date\"\n *ngSwitchCase=\"itemType.DateTimeRange\"\n [item]=\"item\">\n </filter-item-date-range>\n\n <filter-item-checkbox class=\"interface interface-checkbox\"\n *ngSwitchCase=\"itemType.Checkbox\"\n [item]=\"item\">\n </filter-item-checkbox>\n </ng-container>\n\n</div>\n", components: [{ type: TextComponent, selector: "filter-item-text" }, { type: SelectComponent, selector: "filter-item-select" }, { type: ChipsComponent, selector: "filter-item-chips" }, { type: RangeComponent, selector: "filter-item-range" }, { type: AutocompleteComponent, selector: "filter-item-autocomplete" }, { type: AutocompletechipsComponent, selector: "filter-item-autocompletechips" }, { type: DateComponent, selector: "filter-item-date" }, { type: DateRangeComponent, selector: "filter-item-date-range" }, { type: CheckboxComponent, selector: "filter-item-checkbox" }], directives: [{ type: i3.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i3.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2790
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FilterItemComponent, decorators: [{
2791
+ type: Component,
2792
+ args: [{
2793
+ selector: 'filter-item',
2794
+ templateUrl: './filter-item.component.html',
2795
+ changeDetection: ChangeDetectionStrategy.OnPush,
2796
+ }]
2797
+ }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { item: [{
2798
+ type: Input
2799
+ }] } });
2800
+
2801
+ class FsFilterDrawerActionsComponent {
2802
+ constructor(externalParams) {
2803
+ this.externalParams = externalParams;
2804
+ this._clear = new EventEmitter();
2805
+ this._done = new EventEmitter();
2712
2806
  }
2713
- get config() {
2714
- return this._config;
2807
+ get savedFilters() {
2808
+ return this.externalParams.savedFiltersController;
2715
2809
  }
2716
- get filterParams() {
2717
- return this._filterItems.values();
2810
+ done() {
2811
+ this._done.emit();
2718
2812
  }
2719
- get filterParamsQuery() {
2720
- return this._filterItems.valuesAsQuery();
2813
+ clear() {
2814
+ this._clear.emit();
2721
2815
  }
2722
- get items() {
2723
- return this._filterItems.items;
2816
+ saveFilters() {
2817
+ this.externalParams
2818
+ .savedFiltersController
2819
+ .openSavedFilterEditDialog();
2724
2820
  }
2725
- get visibleItems() {
2726
- return this._filterItems.visibleItems;
2821
+ }
2822
+ FsFilterDrawerActionsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsFilterDrawerActionsComponent, deps: [{ token: ExternalParamsController }], target: i0.ɵɵFactoryTarget.Component });
2823
+ FsFilterDrawerActionsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FsFilterDrawerActionsComponent, selector: "fs-filter-drawer-actions", outputs: { _clear: "clear", _done: "done" }, ngImport: i0, template: "<button type=\"button\" mat-button color=\"primary\" (click)=\"done()\">Done</button>\n<button type=\"button\" mat-button (click)=\"clear()\">Clear</button>\n<ng-container *ngIf=\"savedFilters.enabled$ | async\">\n <button type=\"button\" mat-button (click)=\"saveFilters()\">Save</button>\n</ng-container>\n\n", components: [{ type: i1$4.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }], directives: [{ type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "async": i3.AsyncPipe } });
2824
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsFilterDrawerActionsComponent, decorators: [{
2825
+ type: Component,
2826
+ args: [{
2827
+ selector: 'fs-filter-drawer-actions',
2828
+ templateUrl: './filter-drawer-actions.component.html',
2829
+ }]
2830
+ }], ctorParameters: function () { return [{ type: ExternalParamsController }]; }, propDecorators: { _clear: [{
2831
+ type: Output,
2832
+ args: ['clear']
2833
+ }], _done: [{
2834
+ type: Output,
2835
+ args: ['done']
2836
+ }] } });
2837
+
2838
+ class FilterDrawerComponent {
2839
+ constructor(externalParams, _cd, _itemsStore, overlayRef, data) {
2840
+ this.externalParams = externalParams;
2841
+ this._cd = _cd;
2842
+ this._itemsStore = _itemsStore;
2843
+ this.overlayRef = overlayRef;
2844
+ this.data = data;
2845
+ this.inline = false;
2846
+ this.windowDesktop = false;
2847
+ this._itemsStore.prepareItems();
2848
+ this._clear = data.clear;
2849
+ this._done = data.done;
2850
+ this.updateWindowWidth();
2727
2851
  }
2728
- get itemsReady$() {
2729
- return this._filterItems.ready$;
2852
+ updateWindowWidth() {
2853
+ this.windowDesktop = window.innerWidth > 1200;
2730
2854
  }
2731
- get hasFilterChips$() {
2732
- return this._hasFilterChips$.asObservable();
2855
+ get items$() {
2856
+ return this._itemsStore.visibleItems$;
2733
2857
  }
2734
- get hasVisibleItemOrSorting() {
2735
- return this.visibleItems.length > 0 || !!this._filterItems.sortByItem;
2858
+ get sortItem() {
2859
+ return this._itemsStore.sortByItem;
2736
2860
  }
2737
- get hasKeyword() {
2738
- return this._filterItems.hasKeyword;
2861
+ get sortDirectionItem() {
2862
+ return this._itemsStore.sortDirectionItem;
2739
2863
  }
2740
- get filtersBtnVisible$() {
2741
- return this._filtersBtnVisible$.asObservable();
2864
+ clear() {
2865
+ this._clear();
2866
+ // this.overlayRef.detach();
2742
2867
  }
2743
- get keywordVisible$() {
2744
- return this._keywordVisible$.asObservable();
2868
+ done() {
2869
+ this._done();
2870
+ this.overlayRef.detach();
2745
2871
  }
2746
- get actionsVisible$() {
2747
- return this._actions.visible$;
2872
+ backdropClick() {
2873
+ this.done();
2748
2874
  }
2749
- get actions$() {
2750
- return this._actions.actions$;
2875
+ }
2876
+ FilterDrawerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FilterDrawerComponent, deps: [{ token: ExternalParamsController }, { token: i0.ChangeDetectorRef }, { token: FsFilterItemsStore }, { token: FILTER_DRAWER_OVERLAY }, { token: FILTER_DRAWER_DATA }], target: i0.ɵɵFactoryTarget.Component });
2877
+ FilterDrawerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FilterDrawerComponent, selector: "ng-component", inputs: { inline: "inline" }, host: { listeners: { "window:resize": "updateWindowWidth()" } }, ngImport: i0, template: "<div class=\"filters\">\n <div class=\"filters-wrap\">\n\n <div class=\"filter-by\">\n <mat-icon>tune</mat-icon>\n <span class=\"text\">Filters</span>\n </div>\n\n <div class=\"overflow-shadow filter-items\">\n <div class=\"overflow-shadow-content\">\n <ng-container *fsSkeleton=\"(externalParams.pending$ | async) !== true\">\n <filter-item *ngFor=\"let filterItem of items$ | async\"\n class=\"filter-group\"\n [item]=\"filterItem\">\n </filter-item>\n\n <ng-container *ngIf=\"sortItem && sortItem.values && sortItem.values.length > 0\">\n <filter-item class=\"filter-group sort\"\n [item]=\"sortItem\">\n </filter-item>\n <filter-item class=\"filter-group sort\"\n [item]=\"sortDirectionItem\">\n </filter-item>\n </ng-container>\n </ng-container>\n </div>\n </div>\n\n <fs-filter-drawer-actions class=\"filter-actions\"\n *ngIf=\"(externalParams.pending$ | async) !== true\"\n (clear)=\"clear()\"\n (done)=\"done()\">\n </fs-filter-drawer-actions>\n </div>\n</div>\n<div class=\"backdrop\" *ngIf=\"!windowDesktop\" (click)=\"backdropClick()\"></div>\n", styles: [":host ::ng-deep mat-form-field{width:100%}.filter-by{display:flex;flex-direction:row;align-items:center;box-sizing:border-box;padding:20px 25px}.filter-by mat-icon{margin-right:8px}.filter-by .text{font-weight:400;font-size:19px}.filter-actions{display:block;box-sizing:border-box;padding:13px}.filter-actions button{margin-right:6px}.filter-actions button:last-child{margin-right:0}.filters{position:fixed;display:block;top:0;right:0;z-index:1002;bottom:0}.filters .filters-wrap{background:#fff;box-shadow:0 2px 4px -1px #0003,0 4px 5px #00000024,0 1px 10px #0000001f;width:85vw;max-width:350px;display:flex;flex-direction:column;height:100%}.filters .filters-wrap .filter-items{overflow-y:auto}.filters .filters-wrap .filter-items .overflow-shadow-content{padding:0 25px;box-sizing:border-box}.filters .filter-group{margin:10px 0 0}.filters .filter-group:first-child{margin:0}.filters .filter label{white-space:nowrap;color:#0000008a}.filters .filter .interface.interface-range input,.filters .filter .interface.interface-range .mat-input-wrapper{text-align:center}.filters .filter .interface.interface-range{text-align:center}.filters .filter .interface.interface-datetime fs-datetime.has-time .md-input{width:100%}.filters .filter .interface fs-datetime-range input{text-align:center}.filters .filter .filter-label{width:1%;white-space:nowrap;vertical-align:middle;padding-right:15px}.filters md-autocomplete-container md-input-container{margin:0}.filters .isolate{margin-top:-12px}.filters .isolate .interface{line-height:20px;padding-bottom:1.25em}.filters .isolate md-checkbox{margin:0 0 0 2px}.backdrop{position:fixed;top:0;bottom:0;left:0;right:0;z-index:900;outline:none}\n"], components: [{ type: i2$3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: FilterItemComponent, selector: "filter-item", inputs: ["item"] }, { type: FsFilterDrawerActionsComponent, selector: "fs-filter-drawer-actions", outputs: ["clear", "done"] }], directives: [{ type: i6$3.FsSkeletonContentDirective, selector: "[fsSkeleton]", inputs: ["fsSkeleton", "fsSkeletonPattern"] }, { type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "async": i3.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
2878
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FilterDrawerComponent, decorators: [{
2879
+ type: Component,
2880
+ args: [{
2881
+ templateUrl: './filter-drawer.component.html',
2882
+ styleUrls: ['filter-drawer.component.scss'],
2883
+ // Commented out because filter items are not updating with a delayed observable. Need to figure this out.
2884
+ changeDetection: ChangeDetectionStrategy.OnPush,
2885
+ }]
2886
+ }], ctorParameters: function () { return [{ type: ExternalParamsController }, { type: i0.ChangeDetectorRef }, { type: FsFilterItemsStore }, { type: i1$6.OverlayRef, decorators: [{
2887
+ type: Inject,
2888
+ args: [FILTER_DRAWER_OVERLAY]
2889
+ }] }, { type: undefined, decorators: [{
2890
+ type: Inject,
2891
+ args: [FILTER_DRAWER_DATA]
2892
+ }] }]; }, propDecorators: { updateWindowWidth: [{
2893
+ type: HostListener,
2894
+ args: ['window:resize']
2895
+ }], inline: [{
2896
+ type: Input
2897
+ }] } });
2898
+
2899
+ const FS_FILTER_META = new InjectionToken('fs.filter.meta', {
2900
+ providedIn: 'root',
2901
+ factory: () => {
2902
+ return {
2903
+ openedFilters: 0,
2904
+ };
2751
2905
  }
2752
- get menuActions$() {
2753
- return this._actions.menuActions$;
2906
+ });
2907
+
2908
+ class FsFilterOverlayService {
2909
+ constructor(_injector, _filterMeta, _overlay, _focusController) {
2910
+ this._injector = _injector;
2911
+ this._filterMeta = _filterMeta;
2912
+ this._overlay = _overlay;
2913
+ this._focusController = _focusController;
2914
+ this.detach$ = new Subject();
2915
+ this.attach$ = new Subject();
2916
+ this._destroy$ = new Subject();
2917
+ this._openWhenChipClicked();
2754
2918
  }
2755
- ngOnInit() {
2756
- // Avoid ngChanges error
2757
- setTimeout(() => {
2758
- if (this.config.autofocus) {
2759
- this.focus();
2760
- }
2761
- });
2762
- this._listenInternalItemsChange();
2763
- this._initOverlay();
2919
+ get isOpened() {
2920
+ return !!this._overlayRef;
2764
2921
  }
2765
- ngAfterViewInit() {
2766
- this._listenInputKeyEvents();
2767
- // FIXME prevent fire change after init
2768
- setTimeout(() => {
2769
- this._listenInputChanges();
2922
+ setClearFn(fn) {
2923
+ this._clearFn = fn;
2924
+ }
2925
+ setDoneFn(fn) {
2926
+ this._doneFn = fn;
2927
+ }
2928
+ close() {
2929
+ if (this._overlayRef) {
2930
+ this._overlayRef.detach();
2931
+ this._overlayRef = null;
2932
+ this.removeFilterClass();
2933
+ }
2934
+ }
2935
+ open() {
2936
+ this._overlayRef = this._createOverlay();
2937
+ this._overlayRef.backdropClick()
2938
+ .pipe(takeUntil(this._destroy$))
2939
+ .subscribe(() => {
2940
+ this._overlayRef.detach();
2941
+ });
2942
+ this._overlayRef.detachments()
2943
+ .pipe(takeUntil(this._destroy$))
2944
+ .subscribe(() => {
2945
+ this.detach$.next();
2946
+ });
2947
+ this._overlayRef.attachments()
2948
+ .pipe(takeUntil(this._destroy$))
2949
+ .subscribe(() => {
2950
+ this.attach$.next();
2770
2951
  });
2952
+ this.addFilterClass();
2953
+ return this.openPortalPreview();
2771
2954
  }
2772
2955
  ngOnDestroy() {
2773
- this._destroyFilterDrawer();
2774
2956
  this._destroy$.next();
2775
2957
  this._destroy$.complete();
2776
2958
  }
2777
- focus() {
2778
- if (this.searchTextMatInput) {
2779
- this.searchTextMatInput.focus();
2959
+ _createOverlay() {
2960
+ const overlayConfig = new OverlayConfig({
2961
+ hasBackdrop: true,
2962
+ backdropClass: 'fs-filter-backdrop'
2963
+ });
2964
+ return this._overlay.create(overlayConfig);
2965
+ }
2966
+ openPortalPreview() {
2967
+ const data = { done: this._doneFn, clear: this._clearFn };
2968
+ const injector = this._createInjector(this._injector, data, this._overlayRef);
2969
+ const containerPortal = new ComponentPortal(FilterDrawerComponent, undefined, injector);
2970
+ const containerRef = this._overlayRef.attach(containerPortal);
2971
+ return containerRef.instance;
2972
+ }
2973
+ _createInjector(parentInjector, data, overlayRef) {
2974
+ const injectionTokens = new WeakMap([
2975
+ [FILTER_DRAWER_DATA, data],
2976
+ [FILTER_DRAWER_OVERLAY, overlayRef],
2977
+ ]);
2978
+ return new PortalInjector(parentInjector, injectionTokens);
2979
+ }
2980
+ removeFilterClass() {
2981
+ this._filterMeta.openedFilters--;
2982
+ if (this._filterMeta.openedFilters === 0) {
2983
+ window.document.body.classList.remove('fs-filter-open');
2780
2984
  }
2781
2985
  }
2782
- updateSort(sort) {
2783
- this._filterItems.updateSort(sort);
2986
+ addFilterClass() {
2987
+ this._filterMeta.openedFilters++;
2988
+ if (this._filterMeta.openedFilters === 1) {
2989
+ window.document.body.classList.add('fs-filter-open');
2990
+ }
2784
2991
  }
2785
- /**
2786
- *
2787
- * Do update value of some field
2788
- *
2789
- * @param values - values for update
2790
- *
2791
- * To update text value just pass new text value
2792
- *
2793
- * public updateSelectValue(val) {
2794
- * this.filterEl.updateValues({ keyword: val });
2795
- * }
2796
- *
2797
- * To update select or observable select you could pass suitable value
2798
- *
2799
- * public updateSelectValue(val: number) {
2800
- * this.filterEl.updateValues({ simple_select: val }, { observable_select: val });
2801
- * }
2802
- *
2803
- * To update checkbox value just pass true/false as value
2804
- *
2805
- * public updateCheckox(val: boolean) {
2806
- * this.filterEl.updateValues({ checkbox: val });
2807
- * }
2808
- *
2809
- * To update range value just pass object with min&max object or just with one of targets
2810
- *
2811
- * Ex.: { min: 10, max 15 }, { min: 5 }, { max 5 }
2812
- *
2813
- * public updateRange(val) {
2814
- * this.filterEl.updateValues({ range: val });
2815
- * }
2816
- *
2817
- * To update autocomplete just pass object with name/value fields
2818
- *
2819
- * Ex.: { name: 'John Doe', value: 1 }
2820
- *
2821
- * public updateAutocomplete(val) {
2822
- * this.filterEl.updateValues({ autocomplete_user_id: val });
2823
- * }
2824
- *
2825
- * To update autocompletechips just pass:
2826
- *
2827
- * 1) object with name/value fields - will be appended to existing set of values
2828
- *
2829
- * { name: 'John Doe', value: 1 }
2830
- *
2831
- * 2) array of objects - will be appended to existing set of values
2832
- *
2833
- * [{ name: 'John Doe', value: 1 }, { name: 'Darya Filipova', value: 2 }]
2834
- *
2835
- * 3) null - clear existing set of values
2836
- *
2837
- * public updateAutocomplete(val) {
2838
- * this.filterEl.updateValues({ autocompletechips_user_id: val });
2839
- * }
2840
- *
2841
- */
2842
- updateValues(values) {
2843
- Object.keys(values).forEach((key) => {
2844
- const filterItem = this.items
2845
- .find((item) => item.name === key);
2846
- if (!filterItem) {
2847
- return;
2992
+ _openWhenChipClicked() {
2993
+ this._focusController.focusOn$
2994
+ .pipe(filter$1((v) => !!v), takeUntil(this._destroy$))
2995
+ .subscribe(() => {
2996
+ if (!this.isOpened) {
2997
+ this.open();
2848
2998
  }
2849
- filterItem.model = values[key];
2850
2999
  });
2851
3000
  }
2852
- hide() {
2853
- this.changeVisibility(false);
3001
+ }
3002
+ FsFilterOverlayService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsFilterOverlayService, deps: [{ token: i0.Injector }, { token: FS_FILTER_META }, { token: i1$6.Overlay }, { token: FocusControllerService }], target: i0.ɵɵFactoryTarget.Injectable });
3003
+ FsFilterOverlayService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsFilterOverlayService });
3004
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsFilterOverlayService, decorators: [{
3005
+ type: Injectable
3006
+ }], ctorParameters: function () { return [{ type: i0.Injector }, { type: undefined, decorators: [{
3007
+ type: Inject,
3008
+ args: [FS_FILTER_META]
3009
+ }] }, { type: i1$6.Overlay }, { type: FocusControllerService }]; } });
3010
+
3011
+ class FilterStatusBarDirective {
3012
+ }
3013
+ FilterStatusBarDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FilterStatusBarDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
3014
+ FilterStatusBarDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: FilterStatusBarDirective, selector: "[fsFilterStatusBar]", ngImport: i0 });
3015
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FilterStatusBarDirective, decorators: [{
3016
+ type: Directive,
3017
+ args: [{
3018
+ selector: '[fsFilterStatusBar]',
3019
+ }]
3020
+ }] });
3021
+
3022
+ var ActionType;
3023
+ (function (ActionType) {
3024
+ ActionType["Basic"] = "basic";
3025
+ ActionType["Raised"] = "raised";
3026
+ ActionType["Icon"] = "icon";
3027
+ ActionType["Fab"] = "fab";
3028
+ ActionType["MiniFab"] = "mini-fab";
3029
+ })(ActionType || (ActionType = {}));
3030
+
3031
+ var ActionMode;
3032
+ (function (ActionMode) {
3033
+ ActionMode["Button"] = "button";
3034
+ ActionMode["Menu"] = "menu";
3035
+ ActionMode["File"] = "file";
3036
+ })(ActionMode || (ActionMode = {}));
3037
+
3038
+ class ActionMenuItem {
3039
+ constructor(config = {}, _parent) {
3040
+ this._parent = _parent;
3041
+ this.items = [];
3042
+ this._isGroup = false;
3043
+ this._visible$ = new BehaviorSubject(true);
3044
+ this._disabled$ = new BehaviorSubject(false);
3045
+ this._init(config);
2854
3046
  }
2855
- show() {
2856
- this.changeVisibility(true);
3047
+ get isGroup() {
3048
+ return this._isGroup;
2857
3049
  }
2858
- changeVisibilityClick(value, event = null) {
2859
- if (event) {
2860
- event.stopPropagation();
2861
- }
2862
- this.changeVisibility(value);
3050
+ get visible() {
3051
+ return this._visible$.getValue();
2863
3052
  }
2864
- filterInputEvent(event) {
2865
- if (!this.windowDesktop) {
3053
+ get visible$() {
3054
+ return this._visible$.asObservable();
3055
+ }
3056
+ set disabled(value) {
3057
+ this._disabled$.next(value);
3058
+ }
3059
+ get disabled() {
3060
+ return this._disabled$.getValue();
3061
+ }
3062
+ get disabled$() {
3063
+ return this._disabled$.asObservable();
3064
+ }
3065
+ updateVisibility() {
3066
+ const visible = !!this._showFn ? this._showFn() : true;
3067
+ if (!visible || !this.isGroup) {
3068
+ this._visible$.next(visible);
2866
3069
  return;
2867
3070
  }
2868
- if (['Enter', 'NumpadEnter', 'Escape'].indexOf(event.code) >= 0) {
2869
- this.changeVisibility(false);
2870
- if (this.searchTextInput) {
2871
- this.searchTextInput.nativeElement.blur();
3071
+ const numberOfVisibleChildren = this.items
3072
+ .reduce((acc, item) => {
3073
+ item.updateVisibility();
3074
+ if (item.visible) {
3075
+ acc++;
2872
3076
  }
2873
- }
3077
+ return acc;
3078
+ }, 0);
3079
+ this._visible$.next(!!numberOfVisibleChildren);
2874
3080
  }
2875
- getItemValue(name) {
2876
- const item = this.items
2877
- .find((item) => item.name === name);
2878
- if (item) {
2879
- return item.model;
3081
+ _init(config) {
3082
+ this.label = config.label;
3083
+ this.icon = config.icon;
3084
+ this._showFn = config.show;
3085
+ if ('items' in config) {
3086
+ this._isGroup = true;
3087
+ if (Array.isArray(config.items)) {
3088
+ this.items = config
3089
+ .items
3090
+ .map((item) => new ActionMenuItem(item, this));
3091
+ }
3092
+ this.updateVisibility();
2880
3093
  }
2881
3094
  else {
2882
- return null;
3095
+ this.click = config.click;
3096
+ this.routerLink = config.link;
3097
+ if (!this._parent) {
3098
+ this.updateVisibility();
3099
+ }
2883
3100
  }
2884
3101
  }
2885
- showItem(name) {
2886
- const item = this.getItem(name);
2887
- if (item) {
2888
- item.hide = false;
2889
- this._filterItems.updateVisibleItems();
2890
- }
3102
+ }
3103
+
3104
+ class Action {
3105
+ constructor(config = {}) {
3106
+ this.primary = true;
3107
+ this.isReorderAction = false;
3108
+ this.classArray = [];
3109
+ this.items = [];
3110
+ this._visible$ = new BehaviorSubject(true);
3111
+ this._disabled$ = new BehaviorSubject(false);
3112
+ this._init(config);
2891
3113
  }
2892
- hideItem(name) {
2893
- const item = this.getItem(name);
2894
- if (!item) {
2895
- return;
2896
- }
2897
- item.hide = true;
2898
- this._filterItems.updateVisibleItems();
3114
+ get visible() {
3115
+ return this._visible$.getValue();
2899
3116
  }
2900
- clearItem(name) {
2901
- const item = this.getItem(name);
2902
- if (!item) {
2903
- return;
2904
- }
2905
- item.clear();
3117
+ get visible$() {
3118
+ return this._visible$.asObservable();
2906
3119
  }
2907
- updateItemConfig(name, params) {
2908
- var _a, _b;
2909
- const item = this.getItem(name);
2910
- if (!item) {
3120
+ set disabled(value) {
3121
+ this._disabled$.next(value);
3122
+ }
3123
+ get disabled() {
3124
+ return this._disabled$.getValue();
3125
+ }
3126
+ get disabled$() {
3127
+ return this._disabled$.asObservable();
3128
+ }
3129
+ updateVisibility() {
3130
+ const visible = !!this._showFn ? this._showFn() : true;
3131
+ if (!visible || this.mode !== ActionMode.Menu) {
3132
+ this._visible$.next(visible);
2911
3133
  return;
2912
3134
  }
2913
- item.label = (_a = params.label) !== null && _a !== void 0 ? _a : item.label;
2914
- item.chipLabel = (_b = params.chipLabel) !== null && _b !== void 0 ? _b : item.chipLabel;
2915
- this._filterItems.updateVisibleItems();
3135
+ const hasVisibleChildren = this.items.some((item) => item.visible);
3136
+ this._visible$.next(hasVisibleChildren);
2916
3137
  }
2917
- getItemValueChange$(name) {
2918
- const item = this.items.find((i) => i.name === name);
2919
- if (item) {
2920
- return item.value$
2921
- .pipe(map(() => {
2922
- return item.model;
2923
- }));
2924
- }
2925
- else {
2926
- return null;
3138
+ updateDisabledState() {
3139
+ if (this._disabledFn) {
3140
+ this.disabled = this._disabledFn();
2927
3141
  }
2928
3142
  }
2929
- changeVisibility(state) {
2930
- if (state === this.showFilterMenu) {
2931
- return;
3143
+ _init(config) {
3144
+ var _a, _b, _c, _d, _e, _f;
3145
+ config.mode = (_a = config.mode) !== null && _a !== void 0 ? _a : ActionMode.Button;
3146
+ this.primary = (_b = config.primary) !== null && _b !== void 0 ? _b : true;
3147
+ this.color = config.color;
3148
+ this.type = (_c = config.type) !== null && _c !== void 0 ? _c : ActionType.Raised;
3149
+ this.label = config.label;
3150
+ this.mode = config.mode;
3151
+ this.icon = config.icon;
3152
+ this.iconPlacement = config.iconPlacement;
3153
+ this._showFn = config.show;
3154
+ this.tabIndex = (_d = config.tabIndex) !== null && _d !== void 0 ? _d : 0;
3155
+ if (config.multiple !== undefined) {
3156
+ this.multiple = config.multiple;
2932
3157
  }
2933
- if (!state) {
2934
- this.closed.emit();
2935
- return this._destroyFilterDrawer();
3158
+ if (config.className) {
3159
+ this.className = config.className;
3160
+ this.classArray = this.className
3161
+ .split(' ');
2936
3162
  }
2937
- if (!this.hasVisibleItemOrSorting) {
2938
- return;
3163
+ if (this.primary) {
3164
+ this.color = 'primary';
2939
3165
  }
2940
- this._listenEscButton();
2941
- this.opened.emit();
2942
- this._filterOverlay.open();
3166
+ switch (config.mode) {
3167
+ case ActionMode.Button:
3168
+ {
3169
+ this.menu = config.menu;
3170
+ this.customize = config.customize;
3171
+ this.click = (_e = config.click) !== null && _e !== void 0 ? _e : (() => { });
3172
+ this._disabledFn = config.disabled;
3173
+ this.updateDisabledState();
3174
+ }
3175
+ break;
3176
+ case ActionMode.Menu:
3177
+ {
3178
+ if (config.items && Array.isArray(config.items)) {
3179
+ this.items = config.items.map((item) => new ActionMenuItem(item));
3180
+ }
3181
+ }
3182
+ break;
3183
+ case ActionMode.File:
3184
+ {
3185
+ this.fileSelected = config.select;
3186
+ this.fileError = config.error;
3187
+ this.accept = config.accept;
3188
+ this.imageQuality = config.imageQuality;
3189
+ this.minWidth = config.minWidth;
3190
+ this.minHeight = config.minHeight;
3191
+ this.maxWidth = config.maxWidth;
3192
+ this.maxHeight = config.maxHeight;
3193
+ this.click = (_f = config.click) !== null && _f !== void 0 ? _f : (() => { });
3194
+ this._disabledFn = config.disabled;
3195
+ this.updateDisabledState();
3196
+ }
3197
+ break;
3198
+ }
3199
+ this.updateVisibility();
2943
3200
  }
2944
- clearSearchText(event) {
2945
- event.stopPropagation();
2946
- this._filterItems.keywordItem.clear();
2947
- this.searchTextInput.nativeElement.focus();
3201
+ }
3202
+
3203
+ class ActionsController {
3204
+ constructor(_breakpointObserver) {
3205
+ this._breakpointObserver = _breakpointObserver;
3206
+ this._visible$ = new BehaviorSubject(false);
3207
+ this._actions$ = new BehaviorSubject([]);
3208
+ this._menuActions$ = new BehaviorSubject([]);
3209
+ this._destroy$ = new Subject();
3210
+ this._mobileMedia = '(max-width: 799px)';
3211
+ this._allActions = [];
3212
+ this._listenMobileMedia();
2948
3213
  }
2949
- init() {
2950
- const data = this._filterItems.valuesAsQuery();
2951
- this._sort = this._filterItems.getSort();
2952
- this.config.init(data, this._sort);
2953
- this._updateChipsVisibility();
3214
+ get menuActions() {
3215
+ return this._menuActions$.value;
2954
3216
  }
2955
- clear(event = null) {
2956
- if (event) {
2957
- event.stopPropagation();
2958
- }
2959
- this._filterItems.filtersClear();
2960
- if (this.config.clear) {
2961
- this.config.clear();
2962
- }
3217
+ get actions() {
3218
+ return this._actions$.value;
2963
3219
  }
2964
- /**
2965
- * Close filter window and do change callback
2966
- */
2967
- search(event) {
2968
- this.changeVisibilityClick(false, event);
3220
+ get actions$() {
3221
+ return this._actions$.asObservable();
2969
3222
  }
2970
- reload(event = null) {
2971
- if (event) {
2972
- event.preventDefault();
2973
- event.stopPropagation();
2974
- }
2975
- const data = this._filterItems.valuesAsQuery();
2976
- if (this.config.reload) {
2977
- this.config.reload(data, this._filterItems.getSort());
2978
- }
3223
+ get menuActions$() {
3224
+ return this._menuActions$.asObservable();
2979
3225
  }
2980
- getItem(name) {
2981
- return this.items
2982
- .find((item) => item.name === name);
3226
+ get visible$() {
3227
+ return this._visible$.asObservable();
2983
3228
  }
2984
- /**
2985
- * Call change callback and apply new filter values
2986
- */
2987
- change() {
2988
- const data = this._filterItems.valuesAsQuery();
2989
- const sort = this._filterItems.getSort();
2990
- const sortingChanged = ((!sort || !this._sort) && sort !== this._sort)
2991
- || (sort && this._sort && !objectsAreEquals(this._sort, sort));
2992
- if (sortingChanged) {
2993
- this._sort = sort;
2994
- if (this.config.sortChange) {
2995
- this.config.sortChange(data, sort);
2996
- }
3229
+ get mobileMode() {
3230
+ return this._breakpointObserver.isMatched(this._mobileMedia);
3231
+ }
3232
+ ngOnDestroy() {
3233
+ this._destroy$.next();
3234
+ this._destroy$.complete();
3235
+ }
3236
+ initActions(rawActions) {
3237
+ if (!rawActions || !Array.isArray(rawActions)) {
3238
+ return;
2997
3239
  }
2998
- if (this.config.change) {
2999
- this.config.change(data, sort);
3240
+ this.show();
3241
+ this._allActions = rawActions
3242
+ .map((action) => new Action(action));
3243
+ if (this._reorderAction) {
3244
+ this._allActions.unshift(this._reorderAction);
3000
3245
  }
3001
- this._updateChipsVisibility();
3246
+ this._classifyActions();
3002
3247
  }
3003
- /**
3004
- * Update filter actions config
3005
- * @param actions
3006
- */
3007
- updateActions(actions) {
3008
- this._actions.initActions(actions);
3248
+ show() {
3249
+ this._visible$.next(true);
3009
3250
  }
3010
- /**
3011
- * Show "Filters" button
3012
- */
3013
- showFiltersBtn() {
3014
- this._filtersBtnVisible$.next(true);
3015
- }
3016
- /**
3017
- * Hide "Filters" button
3018
- */
3019
- hideFiltersBtn() {
3020
- this._filtersBtnVisible$.next(false);
3251
+ hide() {
3252
+ this._visible$.next(false);
3021
3253
  }
3022
- /**
3023
- * Show "Keyword" field if it present
3024
- */
3025
- showKeywordField() {
3026
- this._keywordVisible$.next(true);
3254
+ addReorderAction(action) {
3255
+ this._allActions.unshift(action);
3256
+ action.isReorderAction = true;
3257
+ this._classifyAction(action);
3258
+ this._reorderAction = action;
3027
3259
  }
3028
- /**
3029
- * Hide "Keyword" field if it present
3030
- */
3031
- hideKeywordField() {
3032
- this._keywordVisible$.next(false);
3260
+ clearActions() {
3261
+ this._allActions = [];
3262
+ this._setActions([]);
3263
+ this._setKebabActions([]);
3033
3264
  }
3034
- /**
3035
- * Go through actions and check show() callback and update visible actions
3036
- */
3037
3265
  updateActionsVisibility() {
3038
- this._actions.updateActionsVisibility();
3266
+ this._allActions.forEach((action) => action.updateVisibility());
3267
+ this._classifyActions();
3039
3268
  }
3040
- /**
3041
- * Go through actions and check disabled() callback and update disabled state
3042
- */
3043
3269
  updateDisabledState() {
3044
- this._actions.updateDisabledState();
3045
- }
3046
- setItems(items) {
3047
- this._filterItems.destroyItems();
3048
- this.config.items = items;
3049
- this._filterItems.setConfig(this._config);
3050
- this._externalParams.initItems();
3051
- this._syncSearchInputWithKeyword();
3052
- this._listenKeywordItemClear();
3053
- }
3054
- _initFilterWithConfig(config) {
3055
- if (this.config) {
3056
- this._filterItems.destroyItems();
3057
- }
3058
- config = Object.assign(Object.assign({}, (this._defaultConfig || {})), config);
3059
- this._config = new FsFilterConfig(config);
3060
- this._actions.initActions(this._config.actions);
3061
- this._filterItems.setConfig(this._config);
3062
- this._externalParams.setConfig(this._config);
3063
- this._syncSearchInputWithKeyword();
3064
- if (!!this.config.reloadWhenConfigChanged) {
3065
- this.change();
3066
- }
3067
- this._listenKeywordItemClear();
3068
- }
3069
- _destroyFilterDrawer() {
3070
- this._filterOverlay.close();
3071
- }
3072
- _updateWindowWidth() {
3073
- this.windowDesktop = window.innerWidth > 1200;
3270
+ this.actions.forEach((action) => action.updateDisabledState());
3074
3271
  }
3075
- _listenEscButton() {
3076
- this._zone.runOutsideAngular(() => {
3077
- fromEvent(window, 'keyup')
3078
- .pipe(filter$1((event) => event.code === 'Escape'), takeUntil(this.closed), takeUntil(this._destroy$))
3079
- .subscribe(() => {
3080
- this._zone.run(() => {
3081
- this.changeVisibility(false);
3082
- });
3083
- });
3084
- });
3272
+ _setKebabActions(actions) {
3273
+ this._menuActions$.next(actions);
3085
3274
  }
3086
- _listenInputKeyEvents() {
3087
- if (!this.searchTextInput) {
3088
- return;
3089
- }
3090
- this._zone.runOutsideAngular(() => {
3091
- fromEvent(this.searchTextInput.nativeElement, 'keydown')
3092
- .pipe(debounceTime(500), filter$1((event) => {
3093
- return ['Enter', 'NumpadEnter', 'Escape'].indexOf(event.code) > -1;
3094
- }), takeUntil(this._destroy$))
3095
- .subscribe((event) => {
3096
- this._zone.run(() => {
3097
- this.filterInputEvent(event);
3098
- });
3099
- });
3100
- });
3275
+ _setActions(actions) {
3276
+ this._actions$.next(actions);
3101
3277
  }
3102
- _listenWindowResize() {
3103
- this._zone.runOutsideAngular(() => {
3104
- fromEvent(window, 'resize')
3105
- .pipe(debounceTime(100), takeUntil(this._destroy$))
3106
- .subscribe(() => {
3107
- this._zone.run(() => {
3108
- this._updateWindowWidth();
3109
- });
3110
- });
3278
+ _classifyActions() {
3279
+ const kebabActions = [];
3280
+ const actions = [];
3281
+ const mobileMode = this.mobileMode;
3282
+ this._allActions
3283
+ .filter((action) => {
3284
+ return action.visible;
3285
+ })
3286
+ .forEach((action) => {
3287
+ if (action.menu || mobileMode) {
3288
+ kebabActions.push(action);
3289
+ }
3290
+ else {
3291
+ actions.push(action);
3292
+ }
3111
3293
  });
3294
+ this._setKebabActions(kebabActions);
3295
+ this._setActions(actions);
3112
3296
  }
3113
- _listenInputChanges() {
3114
- if (!this._filterItems.keywordItem) {
3115
- return;
3297
+ _classifyAction(action) {
3298
+ if (action.menu) {
3299
+ this._setKebabActions([...this.menuActions, action]);
3116
3300
  }
3117
- this._zone.runOutsideAngular(() => {
3118
- this.searchText.valueChanges
3119
- .pipe(debounceTime(200), distinctUntilChanged(), filter$1((value) => {
3120
- var _a;
3121
- return value !== ((_a = this._filterItems.keywordItem) === null || _a === void 0 ? void 0 : _a.model);
3122
- }), takeUntil(this._destroy$))
3123
- .subscribe((value) => {
3124
- this._zone.run(() => {
3125
- const keywordItem = this._filterItems.keywordItem;
3126
- if (keywordItem && keywordItem.value !== value) {
3127
- keywordItem.model = value;
3128
- }
3129
- });
3130
- });
3131
- });
3132
- }
3133
- _syncSearchInputWithKeyword() {
3134
- const keywordItem = this._filterItems.keywordItem;
3135
- if (keywordItem) {
3136
- this.searchText.setValue(keywordItem.model);
3137
- this.searchPlaceholder = keywordItem.label || 'Search';
3301
+ else {
3302
+ this._setActions([...this.actions, action]);
3138
3303
  }
3139
3304
  }
3140
- _listenKeywordItemClear() {
3141
- var _a;
3142
- (_a = this._filterItems
3143
- .keywordItem) === null || _a === void 0 ? void 0 : _a.clear$.pipe(takeUntil(this._filterItems.keywordItem.destroy$), takeUntil(this._destroy$)).subscribe(() => {
3144
- this.searchText.setValue('');
3145
- });
3146
- }
3147
- _listenInternalItemsChange() {
3148
- this._filterItems
3149
- .itemsChange$
3150
- .pipe(takeUntil(this._destroy$))
3151
- .subscribe(() => {
3152
- this.change();
3153
- });
3154
- }
3155
- _initOverlay() {
3156
- this._filterOverlay.setClearFn(this.clear.bind(this));
3157
- this._filterOverlay.setDoneFn(this.hide.bind(this));
3158
- }
3159
- // We may need some time to recieve external params and after that ready can be emitted
3160
- _listenWhenFilterReady() {
3161
- combineLatest([
3162
- this._externalParams.pending$,
3163
- this.itemsReady$,
3164
- ])
3165
- .pipe(filter$1(([pendingParams, itemsReady]) => !pendingParams && itemsReady), takeUntil(this._destroy$))
3305
+ _listenMobileMedia() {
3306
+ this._breakpointObserver.observe(this._mobileMedia)
3307
+ .pipe(skip(1), takeUntil(this._destroy$))
3166
3308
  .subscribe(() => {
3167
- if (this.config.init) {
3168
- this.init();
3169
- }
3170
- this.ready.emit();
3309
+ this._classifyActions();
3171
3310
  });
3172
3311
  }
3173
- _updateChipsVisibility() {
3174
- const hasFilterChips = this._filterItems.items
3175
- .some((item) => {
3176
- return item.isChipVisible;
3177
- });
3178
- this._hasFilterChips$.next(hasFilterChips);
3312
+ }
3313
+ ActionsController.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ActionsController, deps: [{ token: i1$7.BreakpointObserver }], target: i0.ɵɵFactoryTarget.Injectable });
3314
+ ActionsController.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ActionsController });
3315
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ActionsController, decorators: [{
3316
+ type: Injectable
3317
+ }], ctorParameters: function () { return [{ type: i1$7.BreakpointObserver }]; } });
3318
+
3319
+ class FsFilterActionButtonComponent {
3320
+ }
3321
+ FsFilterActionButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsFilterActionButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
3322
+ FsFilterActionButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FsFilterActionButtonComponent, selector: "fs-filter-action-button", inputs: { action: "action" }, host: { classAttribute: "action-button" }, ngImport: i0, template: "<ng-container [ngSwitch]=\"action.type\">\n <!-- Basic button -->\n <button type=\"button\"\n *ngSwitchCase=\"'basic'\"\n mat-button\n (click)=\"action.click && action.click($event)\"\n [color]=\"action.color\"\n [ngClass]=\"action.classArray\"\n [disabled]=\"action.disabled$ | async\"\n [tabIndex]=\"action.tabIndex\"\n >\n <ng-template [ngTemplateOutlet]=\"buttonContent\"></ng-template>\n </button>\n\n <!-- Raised button -->\n <button type=\"button\"\n *ngSwitchDefault\n mat-raised-button\n (click)=\"action.click && action.click($event)\"\n [color]=\"action.color\"\n [ngClass]=\"action.classArray\"\n [disabled]=\"action.disabled$ | async\"\n [tabIndex]=\"action.tabIndex\"\n >\n <ng-template [ngTemplateOutlet]=\"buttonContent\"></ng-template>\n </button>\n\n <!-- Icon button -->\n <button type=\"button\"\n *ngSwitchCase=\"'icon'\"\n mat-icon-button\n (click)=\"action.click && action.click($event)\"\n [color]=\"action.color\"\n [ngClass]=\"action.classArray\"\n [disabled]=\"action.disabled$ | async\"\n [tabIndex]=\"action.tabIndex\"\n >\n <ng-template [ngTemplateOutlet]=\"buttonContent\"></ng-template>\n </button>\n\n <!-- Fab button -->\n <button type=\"button\"\n *ngSwitchCase=\"'fab'\"\n mat-fab\n (click)=\"action.click && action.click($event)\"\n [color]=\"action.color\"\n [ngClass]=\"action.classArray\"\n [disabled]=\"action.disabled$ | async\"\n [tabIndex]=\"action.tabIndex\"\n >\n <ng-template [ngTemplateOutlet]=\"buttonContent\"></ng-template>\n </button>\n\n <!-- Mini Fab button -->\n <button type=\"button\"\n *ngSwitchCase=\"'mini-fab'\"\n mat-mini-fab\n (click)=\"action.click && action.click($event)\"\n [color]=\"action.color\"\n [ngClass]=\"action.classArray\"\n [disabled]=\"action.disabled$ | async\"\n [tabIndex]=\"action.tabIndex\"\n >\n <ng-template [ngTemplateOutlet]=\"buttonContent\"></ng-template>\n </button>\n\n <ng-template #buttonContent>\n <ng-container *ngIf=\"!action.icon else withIcon\">\n {{action.label}}\n </ng-container>\n\n <ng-template #withIcon>\n <mat-icon *ngIf=\"!action.iconPlacement || action.iconPlacement === 'left'\">{{action.icon}}</mat-icon>\n {{action.label}}\n <mat-icon *ngIf=\"action.iconPlacement === 'right'\">{{action.icon}}</mat-icon>\n </ng-template>\n </ng-template>\n</ng-container>\n", components: [{ type: i1$4.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { type: i2$3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }], directives: [{ type: i3.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i3.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i6$1.DefaultClassDirective, selector: " [ngClass], [ngClass.xs], [ngClass.sm], [ngClass.md], [ngClass.lg], [ngClass.xl], [ngClass.lt-sm], [ngClass.lt-md], [ngClass.lt-lg], [ngClass.lt-xl], [ngClass.gt-xs], [ngClass.gt-sm], [ngClass.gt-md], [ngClass.gt-lg]", inputs: ["ngClass", "ngClass.xs", "ngClass.sm", "ngClass.md", "ngClass.lg", "ngClass.xl", "ngClass.lt-sm", "ngClass.lt-md", "ngClass.lt-lg", "ngClass.lt-xl", "ngClass.gt-xs", "ngClass.gt-sm", "ngClass.gt-md", "ngClass.gt-lg"] }, { type: i3.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i3.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "async": i3.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
3323
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsFilterActionButtonComponent, decorators: [{
3324
+ type: Component,
3325
+ args: [{
3326
+ selector: 'fs-filter-action-button',
3327
+ templateUrl: './action-button.component.html',
3328
+ host: {
3329
+ class: 'action-button',
3330
+ },
3331
+ changeDetection: ChangeDetectionStrategy.OnPush,
3332
+ }]
3333
+ }], propDecorators: { action: [{
3334
+ type: Input
3335
+ }] } });
3336
+
3337
+ class FsFilterActionKebabActionsComponent {
3338
+ }
3339
+ FsFilterActionKebabActionsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsFilterActionKebabActionsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
3340
+ FsFilterActionKebabActionsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FsFilterActionKebabActionsComponent, selector: "fs-filter-action-kebab-actions", inputs: { kebabActions: "kebabActions" }, ngImport: i0, template: "<button type=\"button\"\n mat-icon-button\n class=\"menu-button\"\n [fsMenuTriggerFor]=\"kebabActionsMenu\">\n <mat-icon>more_vert</mat-icon>\n</button>\n<fs-menu #kebabActionsMenu>\n <ng-container *ngFor=\"let action of kebabActions\">\n <ng-container [ngSwitch]=\"action.mode\">\n <!-- Case when actions was collapsed from action with mode = 'menu'-->\n <ng-container *ngSwitchCase=\"'menu'\">\n <ng-container *ngFor=\"let childAction of action.items\">\n <ng-container *ngIf=\"childAction.isGroup else simpleMenuItem\">\n <fs-menu-group>\n <ng-template fs-group-menu-item-template>\n {{ action.label }} <mat-icon style=\"margin: 0;\">arrow_right</mat-icon> {{childAction.label}}\n </ng-template>\n <ng-container *ngFor=\"let subAction of childAction.items\">\n <ng-template fs-menu-item\n [link]=\"subAction.routerLink?.link\"\n [queryParams]=\"subAction.routerLink?.queryParams\"\n [hidden]=\"!(subAction.visible$ | async)\"\n (click)=\"subAction.click($event)\">\n <mat-icon *ngIf=\"subAction.icon\">{{subAction.icon}}</mat-icon>\n {{subAction.label}}\n </ng-template>\n </ng-container>\n </fs-menu-group>\n </ng-container>\n <ng-template #simpleMenuItem>\n <ng-template fs-menu-item\n [link]=\"childAction.routerLink?.link\"\n [queryParams]=\"childAction.routerLink?.queryParams\"\n [hidden]=\"!(childAction.visible$ | async)\"\n (click)=\"childAction.click($event);\">\n <mat-icon *ngIf=\"childAction.icon\">{{childAction.icon}}</mat-icon>\n {{ action.label }} <mat-icon style=\"margin: 0;\">arrow_right</mat-icon>{{ childAction.label }}\n </ng-template>\n </ng-template>\n </ng-container>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'file'\">\n <ng-template fs-menu-item\n [fsClass]=\"action.classArray\"\n >\n <fs-file\n class=\"action-button\"\n [accept]=\"action.accept || '*'\"\n [multiple]=\"action.multiple\"\n [minWidth]=\"action.minWidth\"\n [minHeight]=\"action.minHeight\"\n [imageWidth]=\"action.maxWidth\"\n [imageHeight]=\"action.maxHeight\"\n (select)=\"action.fileSelected($event)\"\n (error)=\"action.fileError($event)\"\n (clicked)=\"action.click($event)\">\n <mat-icon *ngIf=\"action.icon\">{{action.icon}}</mat-icon> {{action.label}}\n </fs-file>\n </ng-template>\n </ng-container>\n\n <ng-container *ngSwitchDefault>\n <ng-template fs-menu-item\n (click)=\"action.click($event)\"\n [fsClass]=\"action.classArray\"\n >\n <mat-icon *ngIf=\"action.icon\">{{action.icon}}</mat-icon> {{action.label}}\n </ng-template>\n </ng-container>\n\n </ng-container>\n </ng-container>\n</fs-menu>\n", styles: [".menu-button{width:36px;height:36px;line-height:36px}\n"], components: [{ type: i1$4.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { type: i2$3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: i3$3.FsMenuComponent, selector: "fs-menu", inputs: ["class", "buttonClass"], outputs: ["opened", "closed"] }, { type: i4$3.FsFileComponent, selector: "fs-file", inputs: ["minHeight", "minWidth", "multiple", "capture", "allowClick", "allowDrop", "accept", "disabled", "imageWidth", "imageHeight", "imageQuality"], outputs: ["select", "error", "clicked", "declined"] }], directives: [{ type: i3$3.FsMenuTriggerDirective, selector: "[fsMenuTriggerFor]", inputs: ["fsMenuTriggerFor"] }, { type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i3.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i3.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3$3.FsMenuItemDirective, selector: "fs-menu-group,[fs-menu-item]", inputs: ["fsClass", "class", "id", "label", "hidden", "groupHidden", "dismissAfterClick", "link", "target", "queryParams"], outputs: ["click"] }, { type: i3$3.FsGroupMenuItemTemplateDirective, selector: "[fs-group-menu-item-template]" }, { type: i3.NgSwitchDefault, selector: "[ngSwitchDefault]" }], pipes: { "async": i3.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
3341
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsFilterActionKebabActionsComponent, decorators: [{
3342
+ type: Component,
3343
+ args: [{
3344
+ selector: 'fs-filter-action-kebab-actions',
3345
+ styleUrls: ['./action-kebab-actions.component.scss'],
3346
+ templateUrl: './action-kebab-actions.component.html',
3347
+ changeDetection: ChangeDetectionStrategy.OnPush,
3348
+ }]
3349
+ }], propDecorators: { kebabActions: [{
3350
+ type: Input
3351
+ }] } });
3352
+
3353
+ class FsFilterActionsComponent {
3354
+ constructor() {
3355
+ this.kebabActions = [];
3356
+ this.actions = [];
3179
3357
  }
3180
- };
3181
- FilterComponent.ctorParameters = () => [
3182
- { type: FsFilterOverlayService },
3183
- { type: NgZone },
3184
- { type: ExternalParamsController },
3185
- { type: FsFilterItemsStore },
3186
- { type: ActionsController },
3187
- { type: FsFilterConfig, decorators: [{ type: Optional }, { type: Inject, args: [FS_FILTER_CONFIG,] }] }
3188
- ];
3189
- __decorate([
3190
- Input('config'),
3191
- __metadata("design:type", Object),
3192
- __metadata("design:paramtypes", [Object])
3193
- ], FilterComponent.prototype, "setConfig", null);
3194
- __decorate([
3195
- Input('filter'),
3196
- __metadata("design:type", Object),
3197
- __metadata("design:paramtypes", [Object])
3198
- ], FilterComponent.prototype, "setFilter", null);
3199
- __decorate([
3200
- Input(),
3201
- __metadata("design:type", Object)
3202
- ], FilterComponent.prototype, "showSortBy", void 0);
3203
- __decorate([
3204
- Input(),
3205
- __metadata("design:type", Object)
3206
- ], FilterComponent.prototype, "showFilterInput", void 0);
3207
- __decorate([
3208
- Output(),
3209
- __metadata("design:type", Object)
3210
- ], FilterComponent.prototype, "closed", void 0);
3211
- __decorate([
3212
- Output(),
3213
- __metadata("design:type", Object)
3214
- ], FilterComponent.prototype, "opened", void 0);
3215
- __decorate([
3216
- Output(),
3217
- __metadata("design:type", Object)
3218
- ], FilterComponent.prototype, "ready", void 0);
3219
- __decorate([
3220
- ContentChild(FilterStatusBarDirective, { read: TemplateRef }),
3221
- __metadata("design:type", Object)
3222
- ], FilterComponent.prototype, "statusBar", void 0);
3223
- __decorate([
3224
- ViewChild('searchTextInput'),
3225
- __metadata("design:type", ElementRef)
3226
- ], FilterComponent.prototype, "searchTextInput", void 0);
3227
- __decorate([
3228
- ViewChild('searchTextInput', { read: MatInput }),
3229
- __metadata("design:type", MatInput)
3230
- ], FilterComponent.prototype, "searchTextMatInput", void 0);
3231
- __decorate([
3232
- HostBinding('class.filters-open'),
3233
- __metadata("design:type", Object)
3234
- ], FilterComponent.prototype, "showFilterMenu", void 0);
3235
- __decorate([
3236
- HostBinding('class.window-desktop'),
3237
- __metadata("design:type", Object)
3238
- ], FilterComponent.prototype, "windowDesktop", void 0);
3239
- __decorate([
3240
- HostBinding('class.fs-filter'),
3241
- __metadata("design:type", Object)
3242
- ], FilterComponent.prototype, "fsFilterClass", void 0);
3243
- FilterComponent = __decorate([
3244
- Component({
3245
- selector: 'fs-filter',
3246
- template: "<ng-container *ngIf=\"hasKeyword; else noKeywordFilter\">\n <div class=\"filter-search-container\">\n <div class=\"filter-input-field\">\n <form autocomplete=\"off\" role=\"presentation\" *ngIf=\"keywordVisible$ | async\">\n <mat-form-field floatLabel=\"never\">\n <span matPrefix>\n <mat-icon matPrefix>search</mat-icon>\n </span>\n\n <input\n #searchTextInput\n matInput\n [formControl]=\"searchText\"\n [placeholder]=\"searchPlaceholder\"\n name=\"filter-input\"\n (click)=\"filterInputEvent($event)\"\n class=\"filter-input\">\n\n <a matSuffix\n *ngIf=\"searchText.value && showFilterInput && config.clear\"\n (click)=\"clearSearchText($event)\"\n href=\"javascript:void(0)\"\n class=\"clear\">\n <mat-icon>clear</mat-icon>\n </a>\n\n <a matSuffix\n (click)=\"reload($event)\"\n class=\"reload\"\n *ngIf=\"config.reload\">\n <mat-icon>refresh</mat-icon>\n </a>\n </mat-form-field>\n </form>\n </div>\n <ng-container *ngTemplateOutlet=\"filterActions\"></ng-container>\n </div>\n <div class=\"status-actions\" *ngIf=\"keywordVisible$ | async\">\n <ng-container *ngTemplateOutlet=\"statusBarContainer\"></ng-container>\n <ng-container *ngTemplateOutlet=\"filterChips\"></ng-container>\n </div>\n</ng-container>\n\n<ng-template #noKeywordFilter>\n <div class=\"filter-searchless-container\">\n <div class=\"status-actions\">\n <ng-container *ngTemplateOutlet=\"statusBarContainer\"></ng-container>\n <ng-container *ngTemplateOutlet=\"filterChips\"></ng-container>\n </div>\n <ng-container *ngTemplateOutlet=\"filterActions\"></ng-container>\n </div>\n</ng-template>\n\n\n<ng-template #filterActions>\n <div class=\"filter-actions\">\n <ng-container *ngIf=\"hasVisibleItemOrSorting && filtersBtnVisible$ | async\">\n <button\n mat-button\n class=\"filters-button\"\n [ngClass]=\"{\n 'mat-raised-button': config.button.style == 'raised',\n 'mat-button': config.button.style == 'basic',\n 'mat-icon-button': config.button.style == 'icon'\n }\"\n (click)=\"changeVisibilityClick(!showFilterMenu, $event)\"\n type=\"button\"\n [color]=\"config.button.color\">\n <mat-icon *ngIf=\"config.button.icon\">{{config.button.icon}}</mat-icon>\n {{ config.button.label }}\n </button>\n </ng-container>\n\n <fs-filter-actions\n *ngIf=\"actionsVisible$ | async\"\n [actions]=\"actions$ | async\"\n [kebabActions]=\"menuActions$ | async\">\n </fs-filter-actions>\n </div>\n</ng-template>\n\n<ng-template #filterChips>\n <fs-filter-chips\n *ngIf=\"config.chips && hasFilterChips$ | async\"\n class=\"filter-chips\"\n [filters]=\"items\">\n </fs-filter-chips>\n</ng-template>\n\n<ng-template #statusBarContainer>\n <div class=\"status-bar\" *ngIf=\"statusBar\">\n <small><ng-container *ngTemplateOutlet=\"statusBar\"></ng-container></small>\n </div>\n</ng-template>\n",
3247
- encapsulation: ViewEncapsulation.None,
3248
- providers: [
3249
- FsFilterOverlayService,
3250
- ExternalParamsController,
3251
- PersistanceParamsController,
3252
- QueryParamsController,
3253
- FocusControllerService,
3254
- FsFilterItemsStore,
3255
- SavedFiltersController,
3256
- ActionsController,
3257
- ],
3258
- changeDetection: ChangeDetectionStrategy.OnPush,
3259
- styles: ["fs-filter{display:block}.fs-filter{margin-bottom:20px;display:block}.fs-filter .results{min-height:90px;position:relative;overflow-x:auto;overflow-y:hidden}.fs-filter .status-bar{overflow:hidden;text-overflow:ellipsis;line-height:17px;margin:4px 0}.fs-filter .filter-chips{display:block}.fs-filter .filter-searchless-container{display:flex}.fs-filter .filter-searchless-container .status-actions{flex-grow:1}.fs-filter .filter-searchless-container .status-actions>:first-child{margin-top:0}.fs-filter fs-filter-chips{margin:5px 0}.fs-filter .filter-search-container{flex-direction:row;box-sizing:border-box;display:flex;flex:1 1 0;position:relative}.fs-filter .filter-search-container .search{top:8px;position:absolute;margin-left:1px;left:0}.fs-filter .filter-search-container .search mat-icon{transform:scale(.9)}.fs-filter .filter-search-container form{width:100%;height:100%}.fs-filter .filter-search-container .filter-input-field{flex-direction:row;box-sizing:border-box;display:flex;align-items:center;flex:1}.fs-filter .filter-search-container .filter-input-field .mat-form-field{width:100%;height:100%;font-size:103%}.fs-filter .filter-search-container .filter-input-field .mat-form-field .mat-form-field-underline{bottom:auto}.fs-filter .filter-search-container .filter-input-field .mat-form-field .mat-form-field-infix{border-top:0}.fs-filter .filter-search-container .filter-input-field .mat-form-field .mat-form-field-wrapper{padding-bottom:0;height:100%}.fs-filter .filter-search-container .filter-input-field .mat-form-field .mat-form-field-flex{align-items:center;height:100%}.fs-filter .filter-search-container .filter-input-field .mat-form-field-prefix,.fs-filter .filter-search-container .filter-input-field .mat-form-field-suffix{-ms-grid-row-align:center;align-self:center;display:flex;align-items:center;white-space:nowrap}.fs-filter .filter-search-container .filter-input-field .mat-form-field-prefix a,.fs-filter .filter-search-container .filter-input-field .mat-form-field-prefix mat-icon,.fs-filter .filter-search-container .filter-input-field .mat-form-field-suffix a,.fs-filter .filter-search-container .filter-input-field .mat-form-field-suffix mat-icon{display:flex;cursor:pointer;color:initial}.fs-filter .filter-search-container .filter-input-field .mat-form-field-prefix a:hover,.fs-filter .filter-search-container .filter-input-field .mat-form-field-prefix mat-icon:hover,.fs-filter .filter-search-container .filter-input-field .mat-form-field-suffix a:hover,.fs-filter .filter-search-container .filter-input-field .mat-form-field-suffix mat-icon:hover{color:inherit}.fs-filter .filter-search-container .filter-input-field .mat-form-field-infix{width:auto}.fs-filter .filter-actions{display:flex;align-items:center}.fs-filter button.reload{margin-left:-40px;right:-9px}@media screen and (min-width:599px){.filter-actions{margin-left:10px}.filters-button+fs-filter-actions:not(:empty){margin-left:5px}}@media screen and (max-width:600px){.filter-actions{margin-left:5px}.filter-actions .filters-button{font-size:0;padding:0;min-width:unset;width:36px;height:36px;border-radius:50%;box-shadow:unset!important}}@media screen and (min-width:1200px){body.fs-filter-open{margin-right:350px}.fs-filter-backdrop{display:none}}body.fs-filter-open::-webkit-scrollbar{width:0;background:0 0}"]
3260
- }),
3261
- __param(5, Optional()), __param(5, Inject(FS_FILTER_CONFIG)),
3262
- __metadata("design:paramtypes", [FsFilterOverlayService,
3263
- NgZone,
3264
- ExternalParamsController,
3265
- FsFilterItemsStore,
3266
- ActionsController,
3267
- FsFilterConfig])
3268
- ], FilterComponent);
3358
+ }
3359
+ FsFilterActionsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsFilterActionsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
3360
+ FsFilterActionsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FsFilterActionsComponent, selector: "fs-filter-actions", inputs: { kebabActions: "kebabActions", actions: "actions" }, ngImport: i0, template: "<!-- Buttons -->\n<ng-container *ngFor=\"let action of actions\">\n\n <ng-container [ngSwitch]=\"action.mode\">\n <ng-container *ngSwitchCase=\"'button'\">\n <fs-filter-action-button [action]=\"action\"></fs-filter-action-button>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'menu'\">\n <fs-filter-action-button\n [action]=\"action\"\n [fsMenuTriggerFor]=\"someRef\">\n </fs-filter-action-button>\n\n <fs-menu #someRef>\n <ng-container *ngFor=\"let childAction of action.items\">\n <ng-container *ngIf=\"childAction.isGroup else simpleMenuItem\">\n <fs-menu-group [label]=\"childAction.label\">\n <ng-container *ngFor=\"let subAction of childAction.items\">\n <ng-template fs-menu-item\n [link]=\"subAction.routerLink?.link\"\n [queryParams]=\"subAction.routerLink?.queryParams\"\n [hidden]=\"!(subAction.visible$ | async)\"\n (click)=\"subAction.click($event)\">\n <mat-icon *ngIf=\"subAction.icon\">{{subAction.icon}}</mat-icon>\n {{subAction.label}}\n </ng-template>\n </ng-container>\n </fs-menu-group>\n </ng-container>\n <ng-template #simpleMenuItem>\n <ng-template fs-menu-item\n [link]=\"childAction.routerLink?.link\"\n [queryParams]=\"childAction.routerLink?.queryParams\"\n [hidden]=\"!(childAction.visible$ | async)\"\n (click)=\"childAction.click($event);\">\n <mat-icon *ngIf=\"childAction.icon\">{{childAction.icon}}</mat-icon>\n {{childAction.label}}\n </ng-template>\n </ng-template>\n </ng-container>\n </fs-menu>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'file'\">\n <fs-file\n class=\"action-button\"\n [accept]=\"action.accept || '*'\"\n [multiple]=\"action.multiple\"\n [minWidth]=\"action.minWidth\"\n [minHeight]=\"action.minHeight\"\n [imageWidth]=\"action.maxWidth\"\n [imageHeight]=\"action.maxHeight\"\n (select)=\"action.fileSelected($event)\"\n (error)=\"action.fileError($event)\"\n (clicked)=\"action.click($event)\">\n <fs-filter-action-button [action]=\"action\"></fs-filter-action-button>\n </fs-file>\n </ng-container>\n </ng-container>\n</ng-container>\n<!-- /Buttons -->\n\n<!-- menu -->\n<ng-container *ngIf=\"kebabActions?.length\">\n <fs-filter-action-kebab-actions [kebabActions]=\"kebabActions\"></fs-filter-action-kebab-actions>\n</ng-container>\n", styles: [":host{display:inline-flex}.action-button{display:block}.action-button+.action-button,fs-menu+.action-button{margin-left:5px}.menu-button{width:36px;height:36px;line-height:36px}\n"], components: [{ type: FsFilterActionButtonComponent, selector: "fs-filter-action-button", inputs: ["action"] }, { type: i3$3.FsMenuComponent, selector: "fs-menu", inputs: ["class", "buttonClass"], outputs: ["opened", "closed"] }, { type: i2$3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: i4$3.FsFileComponent, selector: "fs-file", inputs: ["minHeight", "minWidth", "multiple", "capture", "allowClick", "allowDrop", "accept", "disabled", "imageWidth", "imageHeight", "imageQuality"], outputs: ["select", "error", "clicked", "declined"] }, { type: FsFilterActionKebabActionsComponent, selector: "fs-filter-action-kebab-actions", inputs: ["kebabActions"] }], directives: [{ type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i3.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i3.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: 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]", inputs: ["fsClass", "class", "id", "label", "hidden", "groupHidden", "dismissAfterClick", "link", "target", "queryParams"], outputs: ["click"] }], pipes: { "async": i3.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
3361
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsFilterActionsComponent, decorators: [{
3362
+ type: Component,
3363
+ args: [{
3364
+ selector: 'fs-filter-actions',
3365
+ templateUrl: './actions.component.html',
3366
+ styleUrls: [
3367
+ './actions.component.scss',
3368
+ ],
3369
+ changeDetection: ChangeDetectionStrategy.OnPush,
3370
+ }]
3371
+ }], propDecorators: { kebabActions: [{
3372
+ type: Input
3373
+ }], actions: [{
3374
+ type: Input
3375
+ }] } });
3269
3376
 
3270
- let FilterItemComponent = class FilterItemComponent {
3377
+ class FsFilterChipContentComponent {
3271
3378
  constructor(_cdRef) {
3272
3379
  this._cdRef = _cdRef;
3273
3380
  this._destroy$ = new Subject();
3274
- this.itemType = ItemType;
3275
3381
  }
3276
3382
  ngOnInit() {
3277
- this.item.value$
3278
- .pipe(takeUntil(this._destroy$))
3279
- .subscribe(() => {
3280
- this._cdRef.markForCheck();
3281
- });
3383
+ this.listenValueChangesForRanges();
3282
3384
  }
3283
3385
  ngOnDestroy() {
3284
3386
  this._destroy$.next();
3285
3387
  this._destroy$.complete();
3286
3388
  }
3287
- };
3288
- FilterItemComponent.ctorParameters = () => [
3289
- { type: ChangeDetectorRef }
3290
- ];
3291
- __decorate([
3292
- Input(),
3293
- __metadata("design:type", BaseItem)
3294
- ], FilterItemComponent.prototype, "item", void 0);
3295
- FilterItemComponent = __decorate([
3296
- Component({
3297
- selector: 'filter-item',
3298
- template: "<div class=\"filter filter-{{ item.type }}\">\n\n <ng-container [ngSwitch]=\"item.type\">\n <filter-item-text class=\"interface\"\n *ngSwitchCase=\"itemType.Text\"\n [item]=\"item\">\n </filter-item-text>\n\n <filter-item-select class=\"interface\"\n *ngSwitchCase=\"itemType.Select\"\n [item]=\"item\">\n </filter-item-select>\n\n <filter-item-chips class=\"interface\"\n *ngSwitchCase=\"itemType.Chips\"\n [item]=\"item\">\n </filter-item-chips>\n\n <filter-item-range class=\"interface interface-range\"\n *ngSwitchCase=\"itemType.Range\"\n [item]=\"item\">\n </filter-item-range>\n\n <filter-item-autocomplete class=\"interface\"\n *ngSwitchCase=\"itemType.AutoComplete\"\n [item]=\"item\">\n </filter-item-autocomplete>\n\n <filter-item-autocompletechips class=\"interface\"\n *ngSwitchCase=\"itemType.AutoCompleteChips\"\n [item]=\"item\">\n </filter-item-autocompletechips>\n\n <filter-item-date class=\"interface interface-date\"\n *ngSwitchCase=\"itemType.Date\"\n [item]=\"item\">\n </filter-item-date>\n\n <filter-item-date class=\"interface interface-date\"\n *ngSwitchCase=\"itemType.DateTime\"\n [item]=\"item\">\n </filter-item-date>\n\n <filter-item-date-range class=\"interface interface-date\"\n *ngSwitchCase=\"itemType.DateRange\"\n [item]=\"item\">\n </filter-item-date-range>\n\n <filter-item-date-range class=\"interface interface-date\"\n *ngSwitchCase=\"itemType.DateTimeRange\"\n [item]=\"item\">\n </filter-item-date-range>\n\n <filter-item-checkbox class=\"interface interface-checkbox\"\n *ngSwitchCase=\"itemType.Checkbox\"\n [item]=\"item\">\n </filter-item-checkbox>\n </ng-container>\n\n</div>\n",
3299
- changeDetection: ChangeDetectionStrategy.OnPush
3300
- }),
3301
- __metadata("design:paramtypes", [ChangeDetectorRef])
3302
- ], FilterItemComponent);
3303
-
3304
- let BaseItemComponent = class BaseItemComponent {
3305
- constructor(_kvDiffers, _cd) {
3306
- this._kvDiffers = _kvDiffers;
3307
- this._cd = _cd;
3308
- this.inline = false;
3309
- this._destroy$ = new Subject();
3310
- this._debouncer$ = new Subject();
3311
- this._kvDiffer = this._kvDiffers.find(this.item || {}).create();
3312
- this.listenWithDebounce();
3389
+ listenValueChangesForRanges() {
3390
+ this.item.value$
3391
+ .pipe(takeUntil(this._destroy$))
3392
+ .subscribe(() => {
3393
+ this.content = this._getContent();
3394
+ this._cdRef.detectChanges();
3395
+ });
3313
3396
  }
3314
- set item(value) {
3315
- this._item = value;
3397
+ _getContent() {
3398
+ const result = this.item.getChipsContent(this.type);
3399
+ if (this.item.chipLabel !== undefined) {
3400
+ if (this.item.chipLabel === '') {
3401
+ return `${result}`;
3402
+ }
3403
+ else {
3404
+ if (Array.isArray(this.item.chipLabel)) {
3405
+ const label = getLabelFromArray(this.item.chipLabel, this.type);
3406
+ return `${label}: ${result}`;
3407
+ }
3408
+ else {
3409
+ return `${this.item.chipLabel}: ${result}`;
3410
+ }
3411
+ }
3412
+ }
3413
+ else {
3414
+ if (Array.isArray(this.item.label)) {
3415
+ const label = getLabelFromArray(this.item.label, this.type);
3416
+ return `${label}: ${result}`;
3417
+ }
3418
+ else {
3419
+ if (this.item.isTypeCheckbox) {
3420
+ return result;
3421
+ }
3422
+ else {
3423
+ return `${this.item.label}: ${result}`;
3424
+ }
3425
+ }
3426
+ }
3316
3427
  }
3317
- ;
3318
- get item() {
3319
- return this._item;
3428
+ }
3429
+ FsFilterChipContentComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsFilterChipContentComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
3430
+ FsFilterChipContentComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FsFilterChipContentComponent, selector: "fs-filter-chip-content", inputs: { item: "item", type: "type" }, ngImport: i0, template: "{{ content }}\n", styles: [""], changeDetection: i0.ChangeDetectionStrategy.OnPush });
3431
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsFilterChipContentComponent, decorators: [{
3432
+ type: Component,
3433
+ args: [{
3434
+ selector: 'fs-filter-chip-content',
3435
+ templateUrl: './filter-chip-content.component.html',
3436
+ styleUrls: ['./filter-chip-content.component.scss'],
3437
+ changeDetection: ChangeDetectionStrategy.OnPush,
3438
+ }]
3439
+ }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { item: [{
3440
+ type: Input
3441
+ }], type: [{
3442
+ type: Input
3443
+ }] } });
3444
+ function getLabelFromArray(labelArr, type) {
3445
+ if (type === 'from' && labelArr[0]) {
3446
+ return `${labelArr[0]}`;
3320
3447
  }
3321
- ngDoCheck() {
3322
- if (this._kvDiffer) {
3323
- const changes = this._kvDiffer.diff(this.item);
3324
- if (changes) {
3325
- this._cd.detectChanges();
3326
- }
3448
+ else if (type === 'to' && labelArr[1]) {
3449
+ return `${labelArr[1]}`;
3450
+ }
3451
+ else {
3452
+ return '';
3453
+ }
3454
+ }
3455
+
3456
+ class FsFilterChipComponent {
3457
+ constructor(_cdRef, _focusController) {
3458
+ this._cdRef = _cdRef;
3459
+ this._focusController = _focusController;
3460
+ this._chipRenderTimer$ = timer(500)
3461
+ .pipe(mapTo(true));
3462
+ this._destroy$ = new Subject();
3463
+ }
3464
+ ngOnInit() {
3465
+ this.rangeItem = this.item.isTypeDateRange
3466
+ || this.item.isTypeRange
3467
+ || this.item.isTypeDateTimeRange;
3468
+ this.listenValueChangesForRanges();
3469
+ this._updateVisibility();
3470
+ if (this.item.hasPendingValues) {
3471
+ this.item.loadAsyncValues(false);
3472
+ this.item.values$
3473
+ .pipe(take(2), takeUntil(this._destroy$))
3474
+ .subscribe(() => {
3475
+ this._updateVisibility();
3476
+ this._cdRef.markForCheck();
3477
+ });
3478
+ this._initDelayRender();
3327
3479
  }
3328
3480
  }
3329
3481
  ngOnDestroy() {
3330
3482
  this._destroy$.next();
3331
3483
  this._destroy$.complete();
3332
3484
  }
3333
- listenWithDebounce() {
3334
- this._debouncer$
3335
- .pipe(debounceTime(150), takeUntil(this._destroy$))
3485
+ focusOnItem(type = null) {
3486
+ this._focusController.click(this.item, type);
3487
+ }
3488
+ removeItem(event, type = null) {
3489
+ if (this.item instanceof RangeItem) {
3490
+ this.item.clearRange(type);
3491
+ }
3492
+ else if (this.item instanceof DateRangeItem || this.item instanceof DateTimeRangeItem) {
3493
+ this.item.clearDateRange(type);
3494
+ }
3495
+ else {
3496
+ this.item.clear();
3497
+ }
3498
+ }
3499
+ listenValueChangesForRanges() {
3500
+ this.item.value$
3501
+ .pipe(distinctUntilChanged(), takeUntil(this._destroy$))
3336
3502
  .subscribe(() => {
3337
- this.item.valueChanged();
3503
+ this._updateVisibility();
3504
+ this._cdRef.markForCheck();
3338
3505
  });
3339
3506
  }
3340
- itemChange() {
3341
- this._debouncer$.next();
3342
- }
3343
- };
3344
- BaseItemComponent.ctorParameters = () => [
3345
- { type: KeyValueDiffers },
3346
- { type: ChangeDetectorRef }
3347
- ];
3348
- __decorate([
3349
- Input(),
3350
- __metadata("design:type", Object),
3351
- __metadata("design:paramtypes", [Object])
3352
- ], BaseItemComponent.prototype, "item", null);
3353
- __decorate([
3354
- Input(),
3355
- __metadata("design:type", Object)
3356
- ], BaseItemComponent.prototype, "inline", void 0);
3357
- BaseItemComponent = __decorate([
3358
- Component({
3359
- selector: 'base-item',
3360
- template: '',
3361
- changeDetection: ChangeDetectionStrategy.OnPush
3362
- }),
3363
- __metadata("design:paramtypes", [KeyValueDiffers,
3364
- ChangeDetectorRef])
3365
- ], BaseItemComponent);
3366
-
3367
- let SelectComponent = class SelectComponent extends BaseItemComponent {
3368
- constructor(_kvDiffers, _cd) {
3369
- super(_kvDiffers, _cd);
3370
- this._kvDiffers = _kvDiffers;
3371
- this._cd = _cd;
3372
- // For case when we have multiple selection with __all option
3373
- // If _all has been selected than we must disable all other items
3374
- this.allItemsOptionSelected = false;
3507
+ _updateVisibility() {
3508
+ this.itemVisible = this.item.isChipVisible;
3375
3509
  }
3376
- ngDoCheck() {
3377
- if (this._kvDiffer) {
3378
- const changes = this._kvDiffer.diff(this.item);
3379
- if (changes) {
3380
- this._cd.markForCheck();
3381
- if (this.selectedItem) {
3382
- this.selectedItem.cd.markForCheck();
3383
- }
3384
- }
3385
- }
3510
+ _initDelayRender() {
3511
+ this.chipDelayedRender$ = combineLatest([
3512
+ this.item.values$,
3513
+ this._chipRenderTimer$.pipe(startWith(false))
3514
+ ])
3515
+ .pipe(map(([values, timerValue]) => {
3516
+ return !!values || timerValue;
3517
+ }));
3386
3518
  }
3387
- };
3388
- SelectComponent.ctorParameters = () => [
3389
- { type: KeyValueDiffers },
3390
- { type: ChangeDetectorRef }
3391
- ];
3392
- __decorate([
3393
- ViewChild('selectItem'),
3394
- __metadata("design:type", Object)
3395
- ], SelectComponent.prototype, "selectedItem", void 0);
3396
- SelectComponent = __decorate([
3397
- Component({
3398
- selector: 'filter-item-select',
3399
- template: "<ng-container *ngIf=\"(item.loading$ | async) else itemSelect\">\n <mat-form-field>\n <mat-label>{{item.label}}</mat-label>\n <mat-select disabled></mat-select>\n </mat-form-field>\n</ng-container>\n\n<ng-template #itemSelect>\n <ng-container *ngIf=\"(item.values$ | async)?.length\">\n <ng-container *ngIf=\"item.multiple && !item.children\">\n <filter-item-select-multiple\n [item]=\"item\"\n #selectItem>\n </filter-item-select-multiple>\n </ng-container>\n\n <ng-container *ngIf=\"!item.multiple && !item.children\">\n <filter-item-select-simple\n [item]=\"item\"\n #selectItem>\n </filter-item-select-simple>\n </ng-container>\n\n <ng-container *ngIf=\"item.children\">\n <filter-item-select-groups\n [item]=\"item\"\n #selectItem>\n </filter-item-select-groups>\n </ng-container>\n </ng-container>\n</ng-template>\n",
3400
- changeDetection: ChangeDetectionStrategy.OnPush
3401
- }),
3402
- __metadata("design:paramtypes", [KeyValueDiffers,
3403
- ChangeDetectorRef])
3404
- ], SelectComponent);
3519
+ }
3520
+ FsFilterChipComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsFilterChipComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: FocusControllerService }], target: i0.ɵɵFactoryTarget.Component });
3521
+ FsFilterChipComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FsFilterChipComponent, selector: "fs-filter-chip", inputs: { item: "item" }, ngImport: i0, template: "<ng-container *ngIf=\"!item.hasPendingValues || (chipDelayedRender$ | async)\">\n <ng-container *ngIf=\"rangeItem; else defaultChip\">\n <fs-chip\n *ngIf=\"item.model?.min || item.model?.from\"\n [value]=\"item\"\n [selectable]=\"false\"\n [removable]=\"item.clearAllowed\"\n size=\"small\"\n (click)=\"focusOnItem('from')\"\n (removed)=\"removeItem($event, 'from')\">\n <ng-template\n [ngTemplateOutlet]=\"chipContent\"\n [ngTemplateOutletContext]=\"{ item: item, type: 'from' }\"\n ></ng-template>\n </fs-chip>\n\n <fs-chip\n *ngIf=\"item.model?.max || item.model?.to\"\n [value]=\"item\"\n [selectable]=\"false\"\n [removable]=\"item.clearAllowed\"\n size=\"small\"\n (click)=\"focusOnItem('to')\"\n (removed)=\"removeItem($event, 'to')\">\n <ng-template\n [ngTemplateOutlet]=\"chipContent\"\n [ngTemplateOutletContext]=\"{ item: item, type: 'to' }\"\n ></ng-template>\n </fs-chip>\n\n </ng-container>\n\n <ng-template #defaultChip>\n <fs-chip\n *ngIf=\"itemVisible\"\n [value]=\"item\"\n [selectable]=\"false\"\n [removable]=\"item.clearAllowed\"\n size=\"small\"\n (click)=\"focusOnItem()\"\n (removed)=\"removeItem($event)\">\n <ng-template\n [ngTemplateOutlet]=\"chipContent\"\n [ngTemplateOutletContext]=\"{ item: item }\"\n ></ng-template>\n </fs-chip>\n </ng-template>\n\n <ng-template #chipContent let-item=\"item\" let-type=\"type\">\n <ng-container *ngIf=\"!item.hasPendingValues && !item.loading; else lodaingValues\">\n <fs-filter-chip-content [item]=\"item\" [type]=\"type\"></fs-filter-chip-content>\n </ng-container>\n\n <ng-template #lodaingValues>\n Loading...\n </ng-template>\n </ng-template>\n</ng-container>\n\n", styles: ["fs-chip{cursor:pointer;color:#6f6f6f}\n"], components: [{ type: i2$1.FsChipComponent, selector: "fs-chip", inputs: ["size", "value", "backgroundColor", "borderColor", "color", "outlined", "removable", "selectable", "selected", "image"], outputs: ["selectedToggled", "removed"] }, { type: FsFilterChipContentComponent, selector: "fs-filter-chip-content", inputs: ["item", "type"] }], directives: [{ type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }], pipes: { "async": i3.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
3522
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsFilterChipComponent, decorators: [{
3523
+ type: Component,
3524
+ args: [{
3525
+ selector: 'fs-filter-chip',
3526
+ templateUrl: './filter-chip.component.html',
3527
+ styleUrls: ['./filter-chip.component.scss'],
3528
+ changeDetection: ChangeDetectionStrategy.OnPush,
3529
+ }]
3530
+ }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: FocusControllerService }]; }, propDecorators: { item: [{
3531
+ type: Input
3532
+ }] } });
3405
3533
 
3406
- let SelectGroupsComponent = class SelectGroupsComponent {
3407
- constructor(cd) {
3408
- this.cd = cd;
3409
- }
3410
- compare(o1, o2) {
3411
- return o1 == o2;
3534
+ class FsFilterChipsComponent {
3535
+ constructor() {
3536
+ this.chips = [];
3412
3537
  }
3413
- };
3414
- SelectGroupsComponent.ctorParameters = () => [
3415
- { type: ChangeDetectorRef }
3416
- ];
3417
- __decorate([
3418
- ViewChild('select', { static: true }),
3419
- __metadata("design:type", MatSelect)
3420
- ], SelectGroupsComponent.prototype, "select", void 0);
3421
- __decorate([
3422
- Input(),
3423
- __metadata("design:type", Object)
3424
- ], SelectGroupsComponent.prototype, "item", void 0);
3425
- SelectGroupsComponent = __decorate([
3426
- Component({
3427
- selector: 'filter-item-select-groups',
3428
- template: "<mat-form-field>\n <mat-label>{{item.label}}</mat-label>\n <mat-select\n #select\n [fsFilterFocusTrigger]=\"item\"\n [(ngModel)]=\"item.model\"\n [compareWith]=\"compare\">\n <ng-container *ngFor=\"let selectItem of item.values\">\n <ng-container *ngIf=\"selectItem[item.children]; else simpleOption\">\n <mat-optgroup [label]=\"selectItem.name\">\n <mat-option *ngFor=\"let subItem of selectItem[item.children]\"\n [value]=\"subItem.value\"\n [ngStyle]=\"selectItem.style\">\n {{ subItem.name }}\n </mat-option>\n </mat-optgroup>\n </ng-container>\n\n <ng-template #simpleOption>\n <mat-option\n [value]=\"selectItem.value\"\n [ngStyle]=\"selectItem.style\">\n {{ selectItem.name }}\n </mat-option>\n </ng-template>\n </ng-container>\n </mat-select>\n</mat-form-field>\n",
3429
- changeDetection: ChangeDetectionStrategy.OnPush
3430
- }),
3431
- __metadata("design:paramtypes", [ChangeDetectorRef])
3432
- ], SelectGroupsComponent);
3538
+ }
3539
+ FsFilterChipsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsFilterChipsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
3540
+ FsFilterChipsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FsFilterChipsComponent, selector: "fs-filter-chips", inputs: { filters: "filters" }, ngImport: i0, template: "<fs-chips [(ngModel)]=\"chips\">\n <ng-container *ngFor=\"let item of filters\">\n <ng-container *ngIf=\"(item.value$ | async) !== null\">\n <fs-filter-chip [item]=\"item\"></fs-filter-chip>\n </ng-container>\n </ng-container>\n</fs-chips>\n", styles: [""], components: [{ type: i2$1.FsChipsComponent, selector: "fs-chips", inputs: ["compare", "multiple"] }, { type: FsFilterChipComponent, selector: "fs-filter-chip", inputs: ["item"] }], directives: [{ type: i5.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i5.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "async": i3.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
3541
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsFilterChipsComponent, decorators: [{
3542
+ type: Component,
3543
+ args: [{
3544
+ selector: 'fs-filter-chips',
3545
+ templateUrl: './filter-chips.component.html',
3546
+ styleUrls: ['./filter-chips.component.scss'],
3547
+ changeDetection: ChangeDetectionStrategy.OnPush,
3548
+ }]
3549
+ }], propDecorators: { filters: [{
3550
+ type: Input
3551
+ }] } });
3433
3552
 
3434
- let SelectSimpleComponent = class SelectSimpleComponent {
3435
- constructor(cd) {
3436
- this.cd = cd;
3553
+ class FilterComponent {
3554
+ constructor(_filterOverlay, _zone, _externalParams, _filterItems, _actions, _defaultConfig) {
3555
+ this._filterOverlay = _filterOverlay;
3556
+ this._zone = _zone;
3557
+ this._externalParams = _externalParams;
3558
+ this._filterItems = _filterItems;
3559
+ this._actions = _actions;
3560
+ this._defaultConfig = _defaultConfig;
3561
+ this.showSortBy = true;
3562
+ this.showFilterInput = true;
3563
+ this.closed = new EventEmitter();
3564
+ this.opened = new EventEmitter();
3565
+ this.ready = new EventEmitter();
3566
+ this.showFilterMenu = false;
3567
+ this.windowDesktop = false;
3568
+ this.fsFilterClass = true;
3569
+ this.searchText = new FormControl();
3570
+ this.searchPlaceholder = 'Search';
3571
+ this._config = null;
3572
+ this._filtersBtnVisible$ = new BehaviorSubject(true);
3573
+ this._keywordVisible$ = new BehaviorSubject(true);
3574
+ this._hasFilterChips$ = new BehaviorSubject(false);
3575
+ this._destroy$ = new Subject();
3576
+ this._listenWhenFilterReady();
3577
+ this._updateWindowWidth();
3578
+ this._filterOverlay.attach$
3579
+ .pipe(takeUntil(this._destroy$))
3580
+ .subscribe(() => {
3581
+ this.showFilterMenu = true;
3582
+ });
3583
+ this._filterOverlay.detach$
3584
+ .pipe(takeUntil(this._destroy$))
3585
+ .subscribe(() => {
3586
+ this.showFilterMenu = false;
3587
+ });
3588
+ this._listenWindowResize();
3437
3589
  }
3438
- changed() {
3439
- if (this.item.isolate) {
3440
- this.item.isolate.enabled = false;
3441
- }
3590
+ set setConfig(config) {
3591
+ this._initFilterWithConfig(config);
3442
3592
  }
3443
- isolateChange(filter) {
3444
- if (filter.isolate.enabled) {
3445
- filter.model = filter.isolate.value;
3446
- }
3447
- else {
3448
- filter.model = null;
3449
- }
3593
+ set setFilter(config) {
3594
+ this._initFilterWithConfig(config);
3450
3595
  }
3451
- };
3452
- SelectSimpleComponent.ctorParameters = () => [
3453
- { type: ChangeDetectorRef }
3454
- ];
3455
- __decorate([
3456
- Input(),
3457
- __metadata("design:type", SimpleSelectItem)
3458
- ], SelectSimpleComponent.prototype, "item", void 0);
3459
- __decorate([
3460
- ViewChild('select', { static: true }),
3461
- __metadata("design:type", MatSelect)
3462
- ], SelectSimpleComponent.prototype, "select", void 0);
3463
- SelectSimpleComponent = __decorate([
3464
- Component({
3465
- selector: 'filter-item-select-simple',
3466
- template: "<mat-form-field [ngClass]=\"{ isolate: item.isolate }\">\n <mat-label>{{item.label}}</mat-label>\n <mat-select\n #select\n [fsFilterFocusTrigger]=\"item\"\n [(ngModel)]=\"item.model\"\n (ngModelChange)=\"changed()\">\n <mat-option *ngFor=\"let item of item.values | fsFilterIsolateValues: item.isolate\"\n [value]=\"item.value\"\n >\n {{ item.name }}\n </mat-option>\n </mat-select>\n\n <mat-hint>\n <div *ngIf=\"item.isolate\">\n <mat-checkbox (change)=\"isolateChange(item)\" [(ngModel)]=\"item.isolate.enabled\">\n <span class=\"checkbox-label\">{{ item.isolate.label }}</span>\n </mat-checkbox>\n </div>\n </mat-hint>\n</mat-form-field>\n",
3467
- changeDetection: ChangeDetectionStrategy.OnPush,
3468
- styles: [".isolate{margin-bottom:25px}"]
3469
- }),
3470
- __metadata("design:paramtypes", [ChangeDetectorRef])
3471
- ], SelectSimpleComponent);
3472
-
3473
- let SelectMultipleComponent = class SelectMultipleComponent {
3474
- constructor(cd) {
3475
- this.cd = cd;
3596
+ get config() {
3597
+ return this._config;
3476
3598
  }
3477
- changed() {
3478
- if (this.item.isolate) {
3479
- this.item.isolate.enabled = false;
3480
- if (this.item.multiple && Array.isArray(this.item.model)) {
3481
- const index = this.item.model.indexOf(this.item.isolate.value);
3482
- if (index > -1) {
3483
- this.item.model.splice(index, 1);
3484
- }
3485
- }
3486
- }
3599
+ get filterParams() {
3600
+ return this._filterItems.values();
3487
3601
  }
3488
- close() {
3489
- this.select.close();
3602
+ get filterParamsQuery() {
3603
+ return this._filterItems.valuesAsQuery();
3490
3604
  }
3491
- isolateChange(filter) {
3492
- if (filter.isolate.enabled) {
3493
- filter.model = filter.multiple ? [filter.isolate.value] : filter.isolate.value;
3494
- }
3495
- else {
3496
- if (filter.multiple) {
3497
- filter.model = filter.defaultValue ? filter.defaultValue : [];
3498
- }
3499
- else {
3500
- filter.model = filter.defaultValue ? filter.defaultValue : null;
3501
- }
3502
- }
3605
+ get items() {
3606
+ return this._filterItems.items;
3503
3607
  }
3504
- };
3505
- SelectMultipleComponent.ctorParameters = () => [
3506
- { type: ChangeDetectorRef }
3507
- ];
3508
- __decorate([
3509
- Input(),
3510
- __metadata("design:type", Object)
3511
- ], SelectMultipleComponent.prototype, "item", void 0);
3512
- __decorate([
3513
- ViewChild('select', { static: true }),
3514
- __metadata("design:type", MatSelect)
3515
- ], SelectMultipleComponent.prototype, "select", void 0);
3516
- SelectMultipleComponent = __decorate([
3517
- Component({
3518
- selector: 'filter-item-select-multiple',
3519
- template: "<mat-form-field [ngClass]=\"{ isolate: item.isolate }\">\n <mat-label>{{item.label}}</mat-label>\n <mat-select\n #select\n [fsFilterFocusTrigger]=\"item\"\n [(ngModel)]=\"item.model\"\n (ngModelChange)=\"changed()\"\n [multiple]=\"item.multiple\">\n <mat-option\n *ngFor=\"let item of item.values | fsFilterIsolateValues: item.isolate\"\n [value]=\"item.value\">\n {{ item.name }}\n </mat-option>\n </mat-select>\n\n <mat-hint>\n <div *ngIf=\"item.isolate\">\n <mat-checkbox (change)=\"isolateChange(item)\" [(ngModel)]=\"item.isolate.enabled\">\n <span class=\"checkbox-label\">{{ item.isolate.label }}</span>\n </mat-checkbox>\n </div>\n </mat-hint>\n</mat-form-field>\n",
3520
- changeDetection: ChangeDetectionStrategy.OnPush,
3521
- styles: [".isolate{margin-bottom:25px}"]
3522
- }),
3523
- __metadata("design:paramtypes", [ChangeDetectorRef])
3524
- ], SelectMultipleComponent);
3525
-
3526
- let ChipsComponent = class ChipsComponent extends BaseItemComponent {
3527
- constructor(_kvDiffers, _cd) {
3528
- super(_kvDiffers, _cd);
3529
- this._kvDiffers = _kvDiffers;
3530
- this._cd = _cd;
3608
+ get visibleItems() {
3609
+ return this._filterItems.visibleItems;
3531
3610
  }
3532
- modelChange() {
3533
- this.itemChange();
3611
+ get itemsReady$() {
3612
+ return this._filterItems.ready$;
3534
3613
  }
3535
- compareFn(modelValue, chipValue) {
3536
- return modelValue.value === chipValue.value;
3614
+ get hasFilterChips$() {
3615
+ return this._hasFilterChips$.asObservable();
3537
3616
  }
3538
- };
3539
- ChipsComponent.ctorParameters = () => [
3540
- { type: KeyValueDiffers },
3541
- { type: ChangeDetectorRef }
3542
- ];
3543
- ChipsComponent = __decorate([
3544
- Component({
3545
- selector: 'filter-item-chips',
3546
- template: "<ng-template [ngIf]=\"item.values?.length\">\n <fs-label-field>\n <fs-label>{{item.label}}</fs-label>\n <fs-chips [(ngModel)]=\"item.model\"\n [compare]=\"compareFn\"\n [multiple]=\"item.multiple\">\n <fs-chip *ngFor=\"let value of item.values\"\n [value]=\"value\"\n [selectable]=\"true\">\n {{ value.name }}\n </fs-chip>\n </fs-chips>\n </fs-label-field>\n</ng-template>\n\n<ng-template [ngIf]=\"item.loading\">{{ item.label }} loading...</ng-template>\n",
3547
- changeDetection: ChangeDetectionStrategy.OnPush,
3548
- styles: ["fs-chip{line-height:40px}"]
3549
- }),
3550
- __metadata("design:paramtypes", [KeyValueDiffers,
3551
- ChangeDetectorRef])
3552
- ], ChipsComponent);
3553
-
3554
- let TextComponent = class TextComponent extends BaseItemComponent {
3555
- constructor(_kvDiffers, _cd) {
3556
- super(_kvDiffers, _cd);
3557
- this._kvDiffers = _kvDiffers;
3558
- this._cd = _cd;
3559
- this.textControl = new FormControl();
3560
- this.destroy$ = new Subject();
3617
+ get hasVisibleItemOrSorting() {
3618
+ return this.visibleItems.length > 0 || !!this._filterItems.sortByItem;
3561
3619
  }
3562
- ngOnInit() {
3563
- this._listenControlValueChanges();
3564
- this._listenModelChanges();
3620
+ get hasKeyword() {
3621
+ return this._filterItems.hasKeyword;
3565
3622
  }
3566
- ngOnDestroy() {
3567
- this.destroy$.next();
3568
- this.destroy$.complete();
3623
+ get filtersBtnVisible$() {
3624
+ return this._filtersBtnVisible$.asObservable();
3569
3625
  }
3570
- _listenControlValueChanges() {
3571
- this.textControl.valueChanges
3572
- .pipe(distinctUntilChanged(), debounceTime(200), takeUntil(this.destroy$))
3573
- .subscribe((value) => {
3574
- this.item.model = value;
3575
- });
3626
+ get keywordVisible$() {
3627
+ return this._keywordVisible$.asObservable();
3576
3628
  }
3577
- _listenModelChanges() {
3578
- this._item.value$
3579
- .pipe(takeUntil(this.destroy$))
3580
- .subscribe(() => {
3581
- this.textControl.setValue(this.item.model, { emitEvent: false });
3582
- });
3629
+ get actionsVisible$() {
3630
+ return this._actions.visible$;
3583
3631
  }
3584
- };
3585
- TextComponent.ctorParameters = () => [
3586
- { type: KeyValueDiffers },
3587
- { type: ChangeDetectorRef }
3588
- ];
3589
- TextComponent = __decorate([
3590
- Component({
3591
- selector: 'filter-item-text',
3592
- template: "<mat-form-field>\n <mat-label>{{item.label}}</mat-label>\n <span matPrefix *ngIf=\"item.prefix\" [innerHtml]=\"item.prefix\"></span>\n <input matInput [formControl]=\"textControl\" [fsFilterFocusTrigger]=\"item\">\n <span matSuffix *ngIf=\"item.suffix\" [innerHtml]=\"item.suffix\"></span>\n</mat-form-field>\n",
3593
- changeDetection: ChangeDetectionStrategy.OnPush,
3594
- styles: [""]
3595
- }),
3596
- __metadata("design:paramtypes", [KeyValueDiffers,
3597
- ChangeDetectorRef])
3598
- ], TextComponent);
3599
-
3600
- let RangeComponent = class RangeComponent extends BaseItemComponent {
3601
- constructor(_kvDiffers, _cd) {
3602
- super(_kvDiffers, _cd);
3603
- this._kvDiffers = _kvDiffers;
3604
- this._cd = _cd;
3632
+ get actions$() {
3633
+ return this._actions.actions$;
3634
+ }
3635
+ get menuActions$() {
3636
+ return this._actions.menuActions$;
3605
3637
  }
3606
3638
  ngOnInit() {
3607
- this.listenChanges();
3639
+ // Avoid ngChanges error
3640
+ setTimeout(() => {
3641
+ if (this.config.autofocus) {
3642
+ this.focus();
3643
+ }
3644
+ });
3645
+ this._listenInternalItemsChange();
3646
+ this._initOverlay();
3608
3647
  }
3609
- listenChanges() {
3610
- const fromListener = fromEvent(this.from.nativeElement, 'keyup')
3611
- .pipe(distinctUntilChanged());
3612
- const toListener = fromEvent(this.to.nativeElement, 'keyup')
3613
- .pipe(distinctUntilChanged());
3614
- merge(fromListener, toListener)
3615
- .pipe(takeUntil(this._destroy$))
3616
- .subscribe(() => {
3617
- this.itemChange();
3648
+ ngAfterViewInit() {
3649
+ this._listenInputKeyEvents();
3650
+ // FIXME prevent fire change after init
3651
+ setTimeout(() => {
3652
+ this._listenInputChanges();
3618
3653
  });
3619
3654
  }
3620
- };
3621
- RangeComponent.ctorParameters = () => [
3622
- { type: KeyValueDiffers },
3623
- { type: ChangeDetectorRef }
3624
- ];
3625
- __decorate([
3626
- ViewChild('from', { static: true }),
3627
- __metadata("design:type", ElementRef)
3628
- ], RangeComponent.prototype, "from", void 0);
3629
- __decorate([
3630
- ViewChild('to', { static: true }),
3631
- __metadata("design:type", Object)
3632
- ], RangeComponent.prototype, "to", void 0);
3633
- RangeComponent = __decorate([
3634
- Component({
3635
- selector: 'filter-item-range',
3636
- template: "<span fxLayout=\"row\">\n <mat-form-field class=\"filter-range-min\">\n <mat-label>{{item.label[0]}}</mat-label>\n <span matPrefix *ngIf=\"item.prefix\" [innerHtml]=\"item.prefix\"></span>\n <input matInput\n [fsFilterFocusTrigger]=\"item\"\n [focusTargetType]=\"'from'\"\n type=\"text\"\n inputmode=\"decimal\"\n [(ngModel)]=\"item.model.min\"\n fsMaskNumber\n [scale]=\"item.options?.scale || 2\"\n #from\n >\n <span matSuffix *ngIf=\"item.suffix\" [innerHtml]=\"item.suffix\"></span>\n </mat-form-field>\n <div class=\"spacer\"></div>\n <mat-form-field class=\"filter-range-max\">\n <mat-label>{{item.label[1]}}</mat-label>\n <span matPrefix *ngIf=\"item.prefix\" [innerHtml]=\"item.prefix\"></span>\n <input matInput\n [fsFilterFocusTrigger]=\"item\"\n [focusTargetType]=\"'to'\"\n type=\"text\"\n inputmode=\"decimal\"\n [(ngModel)]=\"item.model.max\"\n fsMaskNumber\n [scale]=\"item.options?.scale || 2\"\n #to\n >\n <span matSuffix *ngIf=\"item.suffix\" [innerHtml]=\"item.suffix\"></span>\n </mat-form-field>\n</span>\n",
3637
- changeDetection: ChangeDetectionStrategy.OnPush,
3638
- styles: [".spacer{width:15px}mat-form-field{min-width:initial;display:flex;width:auto}mat-form-field ::ng-deep .mat-form-field-infix{width:auto}"]
3639
- }),
3640
- __metadata("design:paramtypes", [KeyValueDiffers,
3641
- ChangeDetectorRef])
3642
- ], RangeComponent);
3643
-
3644
- let AutocompleteComponent = class AutocompleteComponent extends BaseItemComponent {
3645
- constructor(_kvDiffers, _cd) {
3646
- super(_kvDiffers, _cd);
3647
- this._kvDiffers = _kvDiffers;
3648
- this._cd = _cd;
3649
- this.displayWith = (data) => {
3650
- return data ? data.name : data;
3651
- };
3652
- this.fetch = (keyword) => {
3653
- return this.item.valuesFn(keyword);
3654
- };
3655
+ ngOnDestroy() {
3656
+ this._destroyFilterDrawer();
3657
+ this._destroy$.next();
3658
+ this._destroy$.complete();
3655
3659
  }
3656
- };
3657
- AutocompleteComponent.ctorParameters = () => [
3658
- { type: KeyValueDiffers },
3659
- { type: ChangeDetectorRef }
3660
- ];
3661
- AutocompleteComponent = __decorate([
3662
- Component({
3663
- selector: 'filter-item-autocomplete',
3664
- template: "<fs-autocomplete\n [fsFilterFocusTrigger]=\"item\"\n [fetch]=\"fetch\"\n [displayWith]=\"displayWith\"\n [(ngModel)]=\"item.model\"\n [placeholder]=\"item.label\"\n [fetchOnFocus]=\"item.fetchOnFocus\"\n [showClear]=\"item.clearAllowed\"\n name=\"item.name\">\n <ng-template fsAutocompleteTemplate let-data=\"data\">\n {{data.name}}\n </ng-template>\n</fs-autocomplete>\n",
3665
- changeDetection: ChangeDetectionStrategy.OnPush
3666
- }),
3667
- __metadata("design:paramtypes", [KeyValueDiffers,
3668
- ChangeDetectorRef])
3669
- ], AutocompleteComponent);
3670
-
3671
- let AutocompletechipsComponent = class AutocompletechipsComponent extends BaseItemComponent {
3672
- constructor(_kvDiffers, _cd) {
3673
- super(_kvDiffers, _cd);
3674
- this._kvDiffers = _kvDiffers;
3675
- this._cd = _cd;
3676
- this.fetch = (keyword) => {
3677
- return this.item.valuesFn(keyword);
3678
- };
3660
+ focus() {
3661
+ if (this.searchTextMatInput) {
3662
+ this.searchTextMatInput.focus();
3663
+ }
3679
3664
  }
3680
- // SP-T1747
3681
- clicked() {
3682
- this.chipBackground = this.item.chipBackground;
3683
- this.chipColor = this.item.chipColor;
3684
- this.chipIcon = this.item.chipIcon;
3685
- this._cd.markForCheck();
3665
+ updateSort(sort) {
3666
+ this._filterItems.updateSort(sort);
3686
3667
  }
3687
- addAutocompleteChipItem(event) {
3688
- if (event.data && this.item.model.indexOf(event.data.value) === -1) {
3689
- this.item.model.push(event.data);
3690
- this.itemChange();
3691
- }
3668
+ /**
3669
+ *
3670
+ * Do update value of some field
3671
+ *
3672
+ * @param values - values for update
3673
+ *
3674
+ * To update text value just pass new text value
3675
+ *
3676
+ * public updateSelectValue(val) {
3677
+ * this.filterEl.updateValues({ keyword: val });
3678
+ * }
3679
+ *
3680
+ * To update select or observable select you could pass suitable value
3681
+ *
3682
+ * public updateSelectValue(val: number) {
3683
+ * this.filterEl.updateValues({ simple_select: val }, { observable_select: val });
3684
+ * }
3685
+ *
3686
+ * To update checkbox value just pass true/false as value
3687
+ *
3688
+ * public updateCheckox(val: boolean) {
3689
+ * this.filterEl.updateValues({ checkbox: val });
3690
+ * }
3691
+ *
3692
+ * To update range value just pass object with min&max object or just with one of targets
3693
+ *
3694
+ * Ex.: { min: 10, max 15 }, { min: 5 }, { max 5 }
3695
+ *
3696
+ * public updateRange(val) {
3697
+ * this.filterEl.updateValues({ range: val });
3698
+ * }
3699
+ *
3700
+ * To update autocomplete just pass object with name/value fields
3701
+ *
3702
+ * Ex.: { name: 'John Doe', value: 1 }
3703
+ *
3704
+ * public updateAutocomplete(val) {
3705
+ * this.filterEl.updateValues({ autocomplete_user_id: val });
3706
+ * }
3707
+ *
3708
+ * To update autocompletechips just pass:
3709
+ *
3710
+ * 1) object with name/value fields - will be appended to existing set of values
3711
+ *
3712
+ * { name: 'John Doe', value: 1 }
3713
+ *
3714
+ * 2) array of objects - will be appended to existing set of values
3715
+ *
3716
+ * [{ name: 'John Doe', value: 1 }, { name: 'Darya Filipova', value: 2 }]
3717
+ *
3718
+ * 3) null - clear existing set of values
3719
+ *
3720
+ * public updateAutocomplete(val) {
3721
+ * this.filterEl.updateValues({ autocompletechips_user_id: val });
3722
+ * }
3723
+ *
3724
+ */
3725
+ updateValues(values) {
3726
+ Object.keys(values).forEach((key) => {
3727
+ const filterItem = this.items
3728
+ .find((item) => item.name === key);
3729
+ if (!filterItem) {
3730
+ return;
3731
+ }
3732
+ filterItem.model = values[key];
3733
+ });
3692
3734
  }
3693
- removeAutocompleteChipItem(event) {
3694
- remove(this.item.model, { value: event.data.value });
3695
- this.itemChange();
3735
+ hide() {
3736
+ this.changeVisibility(false);
3696
3737
  }
3697
- clearAutocompleteChipItem() {
3698
- this.item.clear();
3699
- this.itemChange();
3738
+ show() {
3739
+ this.changeVisibility(true);
3700
3740
  }
3701
- compareItems(item1, item2) {
3702
- return (item1 === null || item1 === void 0 ? void 0 : item1.value) === (item2 === null || item2 === void 0 ? void 0 : item2.value);
3741
+ changeVisibilityClick(value, event = null) {
3742
+ if (event) {
3743
+ event.stopPropagation();
3744
+ }
3745
+ this.changeVisibility(value);
3703
3746
  }
3704
- };
3705
- AutocompletechipsComponent.ctorParameters = () => [
3706
- { type: KeyValueDiffers },
3707
- { type: ChangeDetectorRef }
3708
- ];
3709
- AutocompletechipsComponent = __decorate([
3710
- Component({
3711
- selector: 'filter-item-autocompletechips',
3712
- template: "<fs-autocomplete-chips\n [fsFilterFocusTrigger]=\"item\"\n [fetch]=\"fetch\"\n [ngModel]=\"item.model\"\n (selected)=\"addAutocompleteChipItem($event)\"\n (removed)=\"removeAutocompleteChipItem($event)\"\n (clear)=\"clearAutocompleteChipItem()\"\n (click)=\"clicked()\"\n [allowText]=\"false\"\n [fetchOnFocus]=\"item.fetchOnFocus\"\n [placeholder]=\"item.label\"\n [chipImage]=\"item.chipImage\"\n [chipColor]=\"chipColor\"\n [chipIconColor]=\"chipIcon\"\n [chipBackground]=\"chipBackground\"\n [chipIcon]=\"item.chipIcon\"\n [chipClass]=\"item.chipClass\"\n [allowClear]=\"item.clearAllowed\"\n [removable]=\"item.clearAllowed\"\n [compareWith]=\"compareItems\"\n name=\"model\">\n <ng-template fsAutocompleteObject let-object=\"object\">\n {{ object.name }}\n </ng-template>\n</fs-autocomplete-chips>\n\n<!--<mat-form-field floatLabel=\"auto\">\n <mat-label>{{item.label}}</mat-label>\n <mat-chip-list #chipList>\n <mat-chip *ngFor=\"let item of item.model\"\n (removed)=\"removeAutocompleteChipItem(item)\">\n {{ item.name }}\n <mat-icon matChipRemove>cancel</mat-icon>\n </mat-chip>\n\n <input #chipsInput\n type=\"text\"\n matInput\n [(ngModel)]=\"item.selectedValue\"\n (ngModelChange)=\"onAutocompleteChipsChange(chipsInput)\"\n [name]=\"item.name\"\n [matChipInputFor]=\"chipList\"\n [matAutocomplete]=\"autocompleteChipsInput\">\n </mat-chip-list>\n\n <mat-autocomplete #autocompleteChipsInput=\"matAutocomplete\"\n (optionSelected)=\"addAutocompleteChipItem( $event)\"\n >\n <mat-option *ngFor=\"let item of item.values$ | async\" [value]=\"item\">\n {{ item.name }}\n </mat-option>\n </mat-autocomplete>\n <mat-placeholder *ngIf=\"inline\">{{ item.label }}</mat-placeholder>\n</mat-form-field>-->\n",
3713
- changeDetection: ChangeDetectionStrategy.OnPush
3714
- }),
3715
- __metadata("design:paramtypes", [KeyValueDiffers,
3716
- ChangeDetectorRef])
3717
- ], AutocompletechipsComponent);
3718
-
3719
- let DateComponent = class DateComponent extends BaseItemComponent {
3720
- constructor(_kvDiffers, _cd) {
3721
- super(_kvDiffers, _cd);
3722
- this._kvDiffers = _kvDiffers;
3723
- this._cd = _cd;
3724
- this.viewType = 'date';
3725
- this.itemDateMode = ItemDateMode;
3726
- this.showYear = true;
3727
- this.showMonth = true;
3728
- this.showDay = true;
3747
+ filterInputEvent(event) {
3748
+ if (!this.windowDesktop) {
3749
+ return;
3750
+ }
3751
+ if (['Enter', 'NumpadEnter', 'Escape'].indexOf(event.code) >= 0) {
3752
+ this.changeVisibility(false);
3753
+ if (this.searchTextInput) {
3754
+ this.searchTextInput.nativeElement.blur();
3755
+ }
3756
+ }
3729
3757
  }
3730
- ngOnInit() {
3731
- if (this.item.type === ItemType.DateTime) {
3732
- this.viewType = 'datetime';
3758
+ getItemValue(name) {
3759
+ const item = this.items
3760
+ .find((item) => item.name === name);
3761
+ if (item) {
3762
+ return item.model;
3763
+ }
3764
+ else {
3765
+ return null;
3766
+ }
3767
+ }
3768
+ showItem(name) {
3769
+ const item = this.getItem(name);
3770
+ if (item) {
3771
+ item.hide = false;
3772
+ this._filterItems.updateVisibleItems();
3733
3773
  }
3734
- else {
3735
- this.viewType = 'date';
3774
+ }
3775
+ hideItem(name) {
3776
+ const item = this.getItem(name);
3777
+ if (!item) {
3778
+ return;
3736
3779
  }
3737
- if (this.item.mode === ItemDateMode.ScrollMonthYear) {
3738
- this.showDay = false;
3780
+ item.hide = true;
3781
+ this._filterItems.updateVisibleItems();
3782
+ }
3783
+ clearItem(name) {
3784
+ const item = this.getItem(name);
3785
+ if (!item) {
3786
+ return;
3739
3787
  }
3788
+ item.clear();
3740
3789
  }
3741
- };
3742
- DateComponent.ctorParameters = () => [
3743
- { type: KeyValueDiffers },
3744
- { type: ChangeDetectorRef }
3745
- ];
3746
- DateComponent = __decorate([
3747
- Component({
3748
- selector: 'filter-item-date',
3749
- template: "<mat-form-field *ngIf=\"item.mode===itemDateMode.Calendar; else elseMode\">\n <mat-label>{{item.label}}</mat-label>\n <input matInput\n fsDatePicker\n [fsFilterFocusTrigger]=\"item\"\n [(ngModel)]=\"item.model\"\n [maxYear]=\"item.maxYear\"\n [view]=\"viewType\"\n [clear]=\"item.clearAllowed\"\n [name]=\"item.name\">\n <mat-placeholder *ngIf=\"inline\">{{ item.label }}</mat-placeholder>\n</mat-form-field>\n\n<ng-template #elseMode>\n <mat-form-field>\n <mat-label>{{item.label}}</mat-label>\n <input matInput\n fsDateScrollPicker\n [fsFilterFocusTrigger]=\"item\"\n [(ngModel)]=\"item.model\"\n [maxYear]=\"item.maxYear\"\n [showMonth]=\"showMonth\"\n [showDay]=\"showDay\"\n [showYear]=\"showYear\"\n [clear]=\"item.clearAllowed\"\n [name]=\"item.name\">\n <mat-placeholder *ngIf=\"inline\">{{ item.label }}</mat-placeholder>\n </mat-form-field>\n</ng-template>\n",
3750
- changeDetection: ChangeDetectionStrategy.OnPush
3751
- }),
3752
- __metadata("design:paramtypes", [KeyValueDiffers,
3753
- ChangeDetectorRef])
3754
- ], DateComponent);
3755
-
3756
- let DateRangeComponent = class DateRangeComponent extends BaseItemComponent {
3757
- constructor(_kvDiffers, _cd) {
3758
- super(_kvDiffers, _cd);
3759
- this._kvDiffers = _kvDiffers;
3760
- this._cd = _cd;
3761
- this.viewType = 'date';
3790
+ updateItemConfig(name, params) {
3791
+ var _a, _b;
3792
+ const item = this.getItem(name);
3793
+ if (!item) {
3794
+ return;
3795
+ }
3796
+ item.label = (_a = params.label) !== null && _a !== void 0 ? _a : item.label;
3797
+ item.chipLabel = (_b = params.chipLabel) !== null && _b !== void 0 ? _b : item.chipLabel;
3798
+ this._filterItems.updateVisibleItems();
3762
3799
  }
3763
- ngOnInit() {
3764
- if (this.item.type === ItemType.DateTimeRange) {
3765
- this.viewType = 'datetime';
3800
+ getItemValueChange$(name) {
3801
+ const item = this.items.find((i) => i.name === name);
3802
+ if (item) {
3803
+ return item.value$
3804
+ .pipe(map(() => {
3805
+ return item.model;
3806
+ }));
3766
3807
  }
3767
3808
  else {
3768
- this.viewType = 'date';
3809
+ return null;
3769
3810
  }
3770
3811
  }
3771
- };
3772
- DateRangeComponent.ctorParameters = () => [
3773
- { type: KeyValueDiffers },
3774
- { type: ChangeDetectorRef }
3775
- ];
3776
- DateRangeComponent = __decorate([
3777
- Component({
3778
- selector: 'filter-item-date-range',
3779
- template: "<mat-form-field>\n <mat-label>{{item.label[0]}}</mat-label>\n <input\n matInput\n [fsFilterFocusTrigger]=\"item\"\n [focusTargetType]=\"'from'\"\n [fsDateRangeFrom]=\"item.name\"\n [(ngModel)]=\"item.model.from\"\n (ngModelChange)=\"itemChange()\"\n [clear]=\"item.clearAllowed\"\n [view]=\"viewType\"\n name=\"date_from\">\n</mat-form-field>\n\n<mat-form-field>\n <mat-label>{{item.label[1]}}</mat-label>\n <input\n matInput\n [fsFilterFocusTrigger]=\"item\"\n [focusTargetType]=\"'to'\"\n [fsDateRangeTo]=\"item.name\"\n [(ngModel)]=\"item.model.to\"\n (ngModelChange)=\"itemChange()\"\n [clear]=\"item.clearAllowed\"\n [view]=\"viewType\"\n name=\"date_to\">\n</mat-form-field>\n",
3780
- changeDetection: ChangeDetectionStrategy.OnPush
3781
- }),
3782
- __metadata("design:paramtypes", [KeyValueDiffers,
3783
- ChangeDetectorRef])
3784
- ], DateRangeComponent);
3785
-
3786
- let CheckboxComponent = class CheckboxComponent extends BaseItemComponent {
3787
- constructor(_kvDiffers, _cd) {
3788
- super(_kvDiffers, _cd);
3789
- this._kvDiffers = _kvDiffers;
3790
- this._cd = _cd;
3812
+ changeVisibility(state) {
3813
+ if (state === this.showFilterMenu) {
3814
+ return;
3815
+ }
3816
+ if (!state) {
3817
+ this.closed.emit();
3818
+ return this._destroyFilterDrawer();
3819
+ }
3820
+ if (!this.hasVisibleItemOrSorting) {
3821
+ return;
3822
+ }
3823
+ this._listenEscButton();
3824
+ this.opened.emit();
3825
+ this._filterOverlay.open();
3791
3826
  }
3792
- };
3793
- CheckboxComponent.ctorParameters = () => [
3794
- { type: KeyValueDiffers },
3795
- { type: ChangeDetectorRef }
3796
- ];
3797
- CheckboxComponent = __decorate([
3798
- Component({
3799
- selector: 'filter-item-checkbox',
3800
- template: "<fs-label-field>\n <mat-checkbox [(ngModel)]=\"item.model\">\n {{ item.label }}\n </mat-checkbox>\n</fs-label-field>\n",
3801
- changeDetection: ChangeDetectionStrategy.OnPush,
3802
- styles: ["fs-label-field{margin:0}"]
3803
- }),
3804
- __metadata("design:paramtypes", [KeyValueDiffers,
3805
- ChangeDetectorRef])
3806
- ], CheckboxComponent);
3807
-
3808
- let FsFilterChipsComponent = class FsFilterChipsComponent {
3809
- constructor() {
3810
- this.chips = [];
3827
+ clearSearchText(event) {
3828
+ event.stopPropagation();
3829
+ this._filterItems.keywordItem.clear();
3830
+ this.searchTextInput.nativeElement.focus();
3811
3831
  }
3812
- };
3813
- __decorate([
3814
- Input(),
3815
- __metadata("design:type", Array)
3816
- ], FsFilterChipsComponent.prototype, "filters", void 0);
3817
- FsFilterChipsComponent = __decorate([
3818
- Component({
3819
- selector: 'fs-filter-chips',
3820
- template: "<fs-chips [(ngModel)]=\"chips\">\n <ng-container *ngFor=\"let item of filters\">\n <ng-container *ngIf=\"(item.value$ | async) !== null\">\n <fs-filter-chip [item]=\"item\"></fs-filter-chip>\n </ng-container>\n </ng-container>\n</fs-chips>\n",
3821
- changeDetection: ChangeDetectionStrategy.OnPush,
3822
- styles: [""]
3823
- })
3824
- ], FsFilterChipsComponent);
3825
-
3826
- let SelectBackdropComponent = class SelectBackdropComponent {
3827
- constructor() { }
3828
- };
3829
- SelectBackdropComponent = __decorate([
3830
- Component({
3831
- selector: 'filter-item-select-backdrop',
3832
- template: "",
3833
- changeDetection: ChangeDetectionStrategy.OnPush,
3834
- styles: [":host{position:absolute;top:0;bottom:0;right:0;z-index:1002;left:0}"]
3835
- }),
3836
- __metadata("design:paramtypes", [])
3837
- ], SelectBackdropComponent);
3838
-
3839
- let FsFilterChipComponent = class FsFilterChipComponent {
3840
- constructor(_cdRef, _focusController) {
3841
- this._cdRef = _cdRef;
3842
- this._focusController = _focusController;
3843
- this._chipRenderTimer$ = timer(500)
3844
- .pipe(mapTo(true));
3845
- this._destroy$ = new Subject();
3832
+ init() {
3833
+ const data = this._filterItems.valuesAsQuery();
3834
+ this._sort = this._filterItems.getSort();
3835
+ this.config.init(data, this._sort);
3836
+ this._updateChipsVisibility();
3846
3837
  }
3847
- ngOnInit() {
3848
- this.rangeItem = this.item.isTypeDateRange
3849
- || this.item.isTypeRange
3850
- || this.item.isTypeDateTimeRange;
3851
- this.listenValueChangesForRanges();
3852
- this._updateVisibility();
3853
- if (this.item.hasPendingValues) {
3854
- this.item.loadAsyncValues(false);
3855
- this.item.values$
3856
- .pipe(take(2), takeUntil(this._destroy$))
3857
- .subscribe(() => {
3858
- this._updateVisibility();
3859
- this._cdRef.markForCheck();
3860
- });
3861
- this._initDelayRender();
3838
+ clear(event = null) {
3839
+ if (event) {
3840
+ event.stopPropagation();
3841
+ }
3842
+ this._filterItems.filtersClear();
3843
+ if (this.config.clear) {
3844
+ this.config.clear();
3862
3845
  }
3863
3846
  }
3864
- ngOnDestroy() {
3865
- this._destroy$.next();
3866
- this._destroy$.complete();
3867
- }
3868
- focusOnItem(type = null) {
3869
- this._focusController.click(this.item, type);
3847
+ /**
3848
+ * Close filter window and do change callback
3849
+ */
3850
+ search(event) {
3851
+ this.changeVisibilityClick(false, event);
3870
3852
  }
3871
- removeItem(event, type = null) {
3872
- if (this.item instanceof RangeItem) {
3873
- this.item.clearRange(type);
3853
+ reload(event = null) {
3854
+ if (event) {
3855
+ event.preventDefault();
3856
+ event.stopPropagation();
3874
3857
  }
3875
- else if (this.item instanceof DateRangeItem || this.item instanceof DateTimeRangeItem) {
3876
- this.item.clearDateRange(type);
3858
+ const data = this._filterItems.valuesAsQuery();
3859
+ if (this.config.reload) {
3860
+ this.config.reload(data, this._filterItems.getSort());
3877
3861
  }
3878
- else {
3879
- this.item.clear();
3862
+ }
3863
+ getItem(name) {
3864
+ return this.items
3865
+ .find((item) => item.name === name);
3866
+ }
3867
+ /**
3868
+ * Call change callback and apply new filter values
3869
+ */
3870
+ change() {
3871
+ const data = this._filterItems.valuesAsQuery();
3872
+ const sort = this._filterItems.getSort();
3873
+ const sortingChanged = ((!sort || !this._sort) && sort !== this._sort)
3874
+ || (sort && this._sort && !objectsAreEquals(this._sort, sort));
3875
+ if (sortingChanged) {
3876
+ this._sort = sort;
3877
+ if (this.config.sortChange) {
3878
+ this.config.sortChange(data, sort);
3879
+ }
3880
3880
  }
3881
+ if (this.config.change) {
3882
+ this.config.change(data, sort);
3883
+ }
3884
+ this._updateChipsVisibility();
3881
3885
  }
3882
- listenValueChangesForRanges() {
3883
- this.item.value$
3884
- .pipe(distinctUntilChanged(), takeUntil(this._destroy$))
3885
- .subscribe(() => {
3886
- this._updateVisibility();
3887
- this._cdRef.markForCheck();
3888
- });
3886
+ /**
3887
+ * Update filter actions config
3888
+ * @param actions
3889
+ */
3890
+ updateActions(actions) {
3891
+ this._actions.initActions(actions);
3889
3892
  }
3890
- _updateVisibility() {
3891
- this.itemVisible = this.item.isChipVisible;
3893
+ /**
3894
+ * Show "Filters" button
3895
+ */
3896
+ showFiltersBtn() {
3897
+ this._filtersBtnVisible$.next(true);
3892
3898
  }
3893
- _initDelayRender() {
3894
- this.chipDelayedRender$ = combineLatest([
3895
- this.item.values$,
3896
- this._chipRenderTimer$.pipe(startWith(false))
3897
- ])
3898
- .pipe(map(([values, timerValue]) => {
3899
- return !!values || timerValue;
3900
- }));
3899
+ /**
3900
+ * Hide "Filters" button
3901
+ */
3902
+ hideFiltersBtn() {
3903
+ this._filtersBtnVisible$.next(false);
3901
3904
  }
3902
- };
3903
- FsFilterChipComponent.ctorParameters = () => [
3904
- { type: ChangeDetectorRef },
3905
- { type: FocusControllerService }
3906
- ];
3907
- __decorate([
3908
- Input(),
3909
- __metadata("design:type", BaseItem)
3910
- ], FsFilterChipComponent.prototype, "item", void 0);
3911
- FsFilterChipComponent = __decorate([
3912
- Component({
3913
- selector: 'fs-filter-chip',
3914
- template: "<ng-container *ngIf=\"!item.hasPendingValues || (chipDelayedRender$ | async)\">\n <ng-container *ngIf=\"rangeItem; else defaultChip\">\n <fs-chip\n *ngIf=\"item.model?.min || item.model?.from\"\n [value]=\"item\"\n [selectable]=\"false\"\n [removable]=\"item.clearAllowed\"\n size=\"small\"\n (click)=\"focusOnItem('from')\"\n (removed)=\"removeItem($event, 'from')\">\n <ng-template\n [ngTemplateOutlet]=\"chipContent\"\n [ngTemplateOutletContext]=\"{ item: item, type: 'from' }\"\n ></ng-template>\n </fs-chip>\n\n <fs-chip\n *ngIf=\"item.model?.max || item.model?.to\"\n [value]=\"item\"\n [selectable]=\"false\"\n [removable]=\"item.clearAllowed\"\n size=\"small\"\n (click)=\"focusOnItem('to')\"\n (removed)=\"removeItem($event, 'to')\">\n <ng-template\n [ngTemplateOutlet]=\"chipContent\"\n [ngTemplateOutletContext]=\"{ item: item, type: 'to' }\"\n ></ng-template>\n </fs-chip>\n\n </ng-container>\n\n <ng-template #defaultChip>\n <fs-chip\n *ngIf=\"itemVisible\"\n [value]=\"item\"\n [selectable]=\"false\"\n [removable]=\"item.clearAllowed\"\n size=\"small\"\n (click)=\"focusOnItem()\"\n (removed)=\"removeItem($event)\">\n <ng-template\n [ngTemplateOutlet]=\"chipContent\"\n [ngTemplateOutletContext]=\"{ item: item }\"\n ></ng-template>\n </fs-chip>\n </ng-template>\n\n <ng-template #chipContent let-item=\"item\" let-type=\"type\">\n <ng-container *ngIf=\"!item.hasPendingValues && !item.loading; else lodaingValues\">\n <fs-filter-chip-content [item]=\"item\" [type]=\"type\"></fs-filter-chip-content>\n </ng-container>\n\n <ng-template #lodaingValues>\n Loading...\n </ng-template>\n </ng-template>\n</ng-container>\n\n",
3915
- changeDetection: ChangeDetectionStrategy.OnPush,
3916
- styles: ["fs-chip{cursor:pointer;color:#6f6f6f}"]
3917
- }),
3918
- __metadata("design:paramtypes", [ChangeDetectorRef,
3919
- FocusControllerService])
3920
- ], FsFilterChipComponent);
3921
-
3922
- let FsFilterDrawerActionsComponent = class FsFilterDrawerActionsComponent {
3923
- constructor(externalParams) {
3924
- this.externalParams = externalParams;
3925
- this._clear = new EventEmitter();
3926
- this._done = new EventEmitter();
3905
+ /**
3906
+ * Show "Keyword" field if it present
3907
+ */
3908
+ showKeywordField() {
3909
+ this._keywordVisible$.next(true);
3927
3910
  }
3928
- get savedFilters() {
3929
- return this.externalParams.savedFiltersController;
3911
+ /**
3912
+ * Hide "Keyword" field if it present
3913
+ */
3914
+ hideKeywordField() {
3915
+ this._keywordVisible$.next(false);
3930
3916
  }
3931
- done() {
3932
- this._done.emit();
3917
+ /**
3918
+ * Go through actions and check show() callback and update visible actions
3919
+ */
3920
+ updateActionsVisibility() {
3921
+ this._actions.updateActionsVisibility();
3933
3922
  }
3934
- clear() {
3935
- this._clear.emit();
3923
+ /**
3924
+ * Go through actions and check disabled() callback and update disabled state
3925
+ */
3926
+ updateDisabledState() {
3927
+ this._actions.updateDisabledState();
3936
3928
  }
3937
- saveFilters() {
3938
- this.externalParams
3939
- .savedFiltersController
3940
- .openSavedFilterEditDialog();
3929
+ setItems(items) {
3930
+ this._filterItems.destroyItems();
3931
+ this.config.items = items;
3932
+ this._filterItems.setConfig(this._config);
3933
+ this._externalParams.initItems();
3934
+ this._syncSearchInputWithKeyword();
3935
+ this._listenKeywordItemClear();
3941
3936
  }
3942
- };
3943
- FsFilterDrawerActionsComponent.ctorParameters = () => [
3944
- { type: ExternalParamsController }
3945
- ];
3946
- __decorate([
3947
- Output('clear'),
3948
- __metadata("design:type", Object)
3949
- ], FsFilterDrawerActionsComponent.prototype, "_clear", void 0);
3950
- __decorate([
3951
- Output('done'),
3952
- __metadata("design:type", Object)
3953
- ], FsFilterDrawerActionsComponent.prototype, "_done", void 0);
3954
- FsFilterDrawerActionsComponent = __decorate([
3955
- Component({
3956
- selector: 'fs-filter-drawer-actions',
3957
- template: "<button type=\"button\" mat-button color=\"primary\" (click)=\"done()\">Done</button>\n<button type=\"button\" mat-button (click)=\"clear()\">Clear</button>\n<ng-container *ngIf=\"savedFilters.enabled$ | async\">\n <button type=\"button\" mat-button (click)=\"saveFilters()\">Save</button>\n</ng-container>\n\n"
3958
- }),
3959
- __metadata("design:paramtypes", [ExternalParamsController])
3960
- ], FsFilterDrawerActionsComponent);
3961
-
3962
- let FsFilterIsolateValues = class FsFilterIsolateValues {
3963
- transform(values, isolate) {
3964
- if (!isolate) {
3965
- return values;
3937
+ _initFilterWithConfig(config) {
3938
+ if (this.config) {
3939
+ this._filterItems.destroyItems();
3966
3940
  }
3967
- else {
3968
- return values.filter((value) => {
3969
- return value.value !== isolate.value;
3970
- });
3941
+ config = Object.assign(Object.assign({}, (this._defaultConfig || {})), config);
3942
+ this._config = new FsFilterConfig(config);
3943
+ this._actions.initActions(this._config.actions);
3944
+ this._filterItems.setConfig(this._config);
3945
+ this._externalParams.setConfig(this._config);
3946
+ this._syncSearchInputWithKeyword();
3947
+ if (!!this.config.reloadWhenConfigChanged) {
3948
+ this.change();
3971
3949
  }
3950
+ this._listenKeywordItemClear();
3972
3951
  }
3973
- };
3974
- FsFilterIsolateValues = __decorate([
3975
- Pipe({
3976
- name: 'fsFilterIsolateValues'
3977
- })
3978
- ], FsFilterIsolateValues);
3979
-
3980
- let FocusToItemDirective = class FocusToItemDirective {
3981
- constructor(_el, _focusController, _targetSelect, _targetDate, _targetDateScroll, _targetDateRangeFrom, _targetDateRangeTo, _targetAutocomplete, _targetAutocompleteChips) {
3982
- this._el = _el;
3983
- this._focusController = _focusController;
3984
- this._targetSelect = _targetSelect;
3985
- this._targetDate = _targetDate;
3986
- this._targetDateScroll = _targetDateScroll;
3987
- this._targetDateRangeFrom = _targetDateRangeFrom;
3988
- this._targetDateRangeTo = _targetDateRangeTo;
3989
- this._targetAutocomplete = _targetAutocomplete;
3990
- this._targetAutocompleteChips = _targetAutocompleteChips;
3991
- this._destroy$ = new Subject();
3952
+ _destroyFilterDrawer() {
3953
+ this._filterOverlay.close();
3992
3954
  }
3993
- ngOnInit() {
3994
- this._focusController
3995
- .listenFocusFor$(this._item, this._focusTargetType)
3996
- .pipe(delay(500), takeUntil(this._destroy$))
3997
- .subscribe(() => {
3998
- this._focus();
3999
- });
3955
+ _updateWindowWidth() {
3956
+ this.windowDesktop = window.innerWidth > 1200;
4000
3957
  }
4001
- ngOnDestroy() {
4002
- this._destroy$.next();
4003
- this._destroy$.complete();
3958
+ _listenEscButton() {
3959
+ this._zone.runOutsideAngular(() => {
3960
+ fromEvent(window, 'keyup')
3961
+ .pipe(filter$1((event) => event.code === 'Escape'), takeUntil(this.closed), takeUntil(this._destroy$))
3962
+ .subscribe(() => {
3963
+ this._zone.run(() => {
3964
+ this.changeVisibility(false);
3965
+ });
3966
+ });
3967
+ });
4004
3968
  }
4005
- _focus() {
4006
- switch (this._item.type) {
4007
- case ItemType.Select:
4008
- {
4009
- this._targetSelect.open();
4010
- }
4011
- break;
4012
- case ItemType.Text:
4013
- case ItemType.Range:
4014
- {
4015
- this._el.nativeElement.focus();
4016
- }
4017
- break;
4018
- case ItemType.Date:
4019
- {
4020
- if (this._item.mode === ItemDateMode.Calendar) {
4021
- this._targetDate.open();
4022
- }
4023
- else {
4024
- this._targetDateScroll.inputClick();
4025
- }
4026
- }
4027
- break;
4028
- case ItemType.DateRange:
4029
- {
4030
- if (this._focusTargetType === 'from') {
4031
- this._targetDateRangeFrom.open();
4032
- }
4033
- else {
4034
- this._targetDateRangeTo.open();
4035
- }
4036
- }
4037
- break;
4038
- case ItemType.AutoComplete:
4039
- {
4040
- this._targetAutocomplete.focus();
4041
- }
4042
- break;
4043
- case ItemType.AutoCompleteChips:
4044
- {
4045
- this._targetAutocompleteChips.focus();
4046
- }
4047
- break;
3969
+ _listenInputKeyEvents() {
3970
+ if (!this.searchTextInput) {
3971
+ return;
4048
3972
  }
3973
+ this._zone.runOutsideAngular(() => {
3974
+ fromEvent(this.searchTextInput.nativeElement, 'keydown')
3975
+ .pipe(debounceTime(500), filter$1((event) => {
3976
+ return ['Enter', 'NumpadEnter', 'Escape'].indexOf(event.code) > -1;
3977
+ }), takeUntil(this._destroy$))
3978
+ .subscribe((event) => {
3979
+ this._zone.run(() => {
3980
+ this.filterInputEvent(event);
3981
+ });
3982
+ });
3983
+ });
4049
3984
  }
4050
- };
4051
- FocusToItemDirective.ctorParameters = () => [
4052
- { type: ElementRef },
4053
- { type: FocusControllerService },
4054
- { type: MatSelect, decorators: [{ type: Optional }, { type: Self }] },
4055
- { type: FsDatePickerComponent, decorators: [{ type: Optional }, { type: Self }] },
4056
- { type: FsDateScrollPickerComponent, decorators: [{ type: Optional }, { type: Self }] },
4057
- { type: DateRangePickerFromComponent, decorators: [{ type: Optional }, { type: Self }] },
4058
- { type: DateRangePickerToComponent, decorators: [{ type: Optional }, { type: Self }] },
4059
- { type: FsAutocompleteComponent, decorators: [{ type: Optional }, { type: Self }] },
4060
- { type: FsAutocompleteChipsComponent, decorators: [{ type: Optional }, { type: Self }] }
4061
- ];
4062
- __decorate([
4063
- Input('fsFilterFocusTrigger'),
4064
- __metadata("design:type", Object)
4065
- ], FocusToItemDirective.prototype, "_item", void 0);
4066
- __decorate([
4067
- Input('focusTargetType'),
4068
- __metadata("design:type", Object)
4069
- ], FocusToItemDirective.prototype, "_focusTargetType", void 0);
4070
- FocusToItemDirective = __decorate([
4071
- Directive({
4072
- selector: '[fsFilterFocusTrigger]',
4073
- }),
4074
- __param(2, Optional()), __param(2, Self()),
4075
- __param(3, Optional()), __param(3, Self()),
4076
- __param(4, Optional()), __param(4, Self()),
4077
- __param(5, Optional()), __param(5, Self()),
4078
- __param(6, Optional()), __param(6, Self()),
4079
- __param(7, Optional()), __param(7, Self()),
4080
- __param(8, Optional()), __param(8, Self()),
4081
- __metadata("design:paramtypes", [ElementRef,
4082
- FocusControllerService,
4083
- MatSelect,
4084
- FsDatePickerComponent,
4085
- FsDateScrollPickerComponent,
4086
- DateRangePickerFromComponent,
4087
- DateRangePickerToComponent,
4088
- FsAutocompleteComponent,
4089
- FsAutocompleteChipsComponent])
4090
- ], FocusToItemDirective);
4091
-
4092
- let FsFilterChipContentComponent = class FsFilterChipContentComponent {
4093
- constructor(_cdRef) {
4094
- this._cdRef = _cdRef;
4095
- this._destroy$ = new Subject();
3985
+ _listenWindowResize() {
3986
+ this._zone.runOutsideAngular(() => {
3987
+ fromEvent(window, 'resize')
3988
+ .pipe(debounceTime(100), takeUntil(this._destroy$))
3989
+ .subscribe(() => {
3990
+ this._zone.run(() => {
3991
+ this._updateWindowWidth();
3992
+ });
3993
+ });
3994
+ });
4096
3995
  }
4097
- ngOnInit() {
4098
- this.listenValueChangesForRanges();
3996
+ _listenInputChanges() {
3997
+ if (!this._filterItems.keywordItem) {
3998
+ return;
3999
+ }
4000
+ this._zone.runOutsideAngular(() => {
4001
+ this.searchText.valueChanges
4002
+ .pipe(debounceTime(200), distinctUntilChanged(), filter$1((value) => {
4003
+ var _a;
4004
+ return value !== ((_a = this._filterItems.keywordItem) === null || _a === void 0 ? void 0 : _a.model);
4005
+ }), takeUntil(this._destroy$))
4006
+ .subscribe((value) => {
4007
+ this._zone.run(() => {
4008
+ const keywordItem = this._filterItems.keywordItem;
4009
+ if (keywordItem && keywordItem.value !== value) {
4010
+ keywordItem.model = value;
4011
+ }
4012
+ });
4013
+ });
4014
+ });
4099
4015
  }
4100
- ngOnDestroy() {
4101
- this._destroy$.next();
4102
- this._destroy$.complete();
4016
+ _syncSearchInputWithKeyword() {
4017
+ const keywordItem = this._filterItems.keywordItem;
4018
+ if (keywordItem) {
4019
+ this.searchText.setValue(keywordItem.model);
4020
+ this.searchPlaceholder = keywordItem.label || 'Search';
4021
+ }
4103
4022
  }
4104
- listenValueChangesForRanges() {
4105
- this.item.value$
4023
+ _listenKeywordItemClear() {
4024
+ var _a;
4025
+ (_a = this._filterItems
4026
+ .keywordItem) === null || _a === void 0 ? void 0 : _a.clear$.pipe(takeUntil(this._filterItems.keywordItem.destroy$), takeUntil(this._destroy$)).subscribe(() => {
4027
+ this.searchText.setValue('');
4028
+ });
4029
+ }
4030
+ _listenInternalItemsChange() {
4031
+ this._filterItems
4032
+ .itemsChange$
4106
4033
  .pipe(takeUntil(this._destroy$))
4107
4034
  .subscribe(() => {
4108
- this.content = this._getContent();
4109
- this._cdRef.detectChanges();
4035
+ this.change();
4110
4036
  });
4111
4037
  }
4112
- _getContent() {
4113
- const result = this.item.getChipsContent(this.type);
4114
- if (this.item.chipLabel !== undefined) {
4115
- if (this.item.chipLabel === '') {
4116
- return `${result}`;
4117
- }
4118
- else {
4119
- if (Array.isArray(this.item.chipLabel)) {
4120
- const label = getLabelFromArray(this.item.chipLabel, this.type);
4121
- return `${label}: ${result}`;
4122
- }
4123
- else {
4124
- return `${this.item.chipLabel}: ${result}`;
4125
- }
4126
- }
4127
- }
4128
- else {
4129
- if (Array.isArray(this.item.label)) {
4130
- const label = getLabelFromArray(this.item.label, this.type);
4131
- return `${label}: ${result}`;
4132
- }
4133
- else {
4134
- if (this.item.isTypeCheckbox) {
4135
- return result;
4136
- }
4137
- else {
4138
- return `${this.item.label}: ${result}`;
4139
- }
4140
- }
4141
- }
4142
- }
4143
- };
4144
- FsFilterChipContentComponent.ctorParameters = () => [
4145
- { type: ChangeDetectorRef }
4146
- ];
4147
- __decorate([
4148
- Input(),
4149
- __metadata("design:type", BaseItem)
4150
- ], FsFilterChipContentComponent.prototype, "item", void 0);
4151
- __decorate([
4152
- Input(),
4153
- __metadata("design:type", String)
4154
- ], FsFilterChipContentComponent.prototype, "type", void 0);
4155
- FsFilterChipContentComponent = __decorate([
4156
- Component({
4157
- selector: 'fs-filter-chip-content',
4158
- template: "{{ content }}\n",
4159
- changeDetection: ChangeDetectionStrategy.OnPush,
4160
- styles: [""]
4161
- }),
4162
- __metadata("design:paramtypes", [ChangeDetectorRef])
4163
- ], FsFilterChipContentComponent);
4164
- function getLabelFromArray(labelArr, type) {
4165
- if (type === 'from' && labelArr[0]) {
4166
- return `${labelArr[0]}`;
4038
+ _initOverlay() {
4039
+ this._filterOverlay.setClearFn(this.clear.bind(this));
4040
+ this._filterOverlay.setDoneFn(this.hide.bind(this));
4167
4041
  }
4168
- else if (type === 'to' && labelArr[1]) {
4169
- return `${labelArr[1]}`;
4042
+ // We may need some time to recieve external params and after that ready can be emitted
4043
+ _listenWhenFilterReady() {
4044
+ combineLatest([
4045
+ this._externalParams.pending$,
4046
+ this.itemsReady$,
4047
+ ])
4048
+ .pipe(filter$1(([pendingParams, itemsReady]) => !pendingParams && itemsReady), takeUntil(this._destroy$))
4049
+ .subscribe(() => {
4050
+ if (this.config.init) {
4051
+ this.init();
4052
+ }
4053
+ this.ready.emit();
4054
+ });
4170
4055
  }
4171
- else {
4172
- return '';
4056
+ _updateChipsVisibility() {
4057
+ const hasFilterChips = this._filterItems.items
4058
+ .some((item) => {
4059
+ return item.isChipVisible;
4060
+ });
4061
+ this._hasFilterChips$.next(hasFilterChips);
4173
4062
  }
4174
4063
  }
4064
+ FilterComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FilterComponent, deps: [{ token: FsFilterOverlayService }, { token: i0.NgZone }, { token: ExternalParamsController }, { token: FsFilterItemsStore }, { token: ActionsController }, { token: FS_FILTER_CONFIG, optional: true }], target: i0.ɵɵFactoryTarget.Component });
4065
+ FilterComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", 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" } }, providers: [
4066
+ FsFilterOverlayService,
4067
+ ExternalParamsController,
4068
+ PersistanceParamsController,
4069
+ QueryParamsController,
4070
+ FocusControllerService,
4071
+ FsFilterItemsStore,
4072
+ SavedFiltersController,
4073
+ ActionsController,
4074
+ ], queries: [{ propertyName: "statusBar", first: true, predicate: FilterStatusBarDirective, descendants: true, read: TemplateRef }], viewQueries: [{ propertyName: "searchTextInput", first: true, predicate: ["searchTextInput"], descendants: true }, { propertyName: "searchTextMatInput", first: true, predicate: ["searchTextInput"], descendants: true, read: MatInput }], ngImport: i0, template: "<ng-container *ngIf=\"hasKeyword; else noKeywordFilter\">\n <div class=\"filter-search-container\">\n <div class=\"filter-input-field\">\n <form autocomplete=\"off\" role=\"presentation\" *ngIf=\"keywordVisible$ | async\">\n <mat-form-field floatLabel=\"never\">\n <span matPrefix>\n <mat-icon matPrefix>search</mat-icon>\n </span>\n\n <input\n #searchTextInput\n matInput\n [formControl]=\"searchText\"\n [placeholder]=\"searchPlaceholder\"\n name=\"filter-input\"\n (click)=\"filterInputEvent($event)\"\n class=\"filter-input\">\n\n <a matSuffix\n *ngIf=\"searchText.value && showFilterInput && config.clear\"\n (click)=\"clearSearchText($event)\"\n href=\"javascript:void(0)\"\n class=\"clear\">\n <mat-icon>clear</mat-icon>\n </a>\n\n <a matSuffix\n (click)=\"reload($event)\"\n class=\"reload\"\n *ngIf=\"config.reload\">\n <mat-icon>refresh</mat-icon>\n </a>\n </mat-form-field>\n </form>\n </div>\n <ng-container *ngTemplateOutlet=\"filterActions\"></ng-container>\n </div>\n <div class=\"status-actions\" *ngIf=\"keywordVisible$ | async\">\n <ng-container *ngTemplateOutlet=\"statusBarContainer\"></ng-container>\n <ng-container *ngTemplateOutlet=\"filterChips\"></ng-container>\n </div>\n</ng-container>\n\n<ng-template #noKeywordFilter>\n <div class=\"filter-searchless-container\">\n <div class=\"status-actions\">\n <ng-container *ngTemplateOutlet=\"statusBarContainer\"></ng-container>\n <ng-container *ngTemplateOutlet=\"filterChips\"></ng-container>\n </div>\n <ng-container *ngTemplateOutlet=\"filterActions\"></ng-container>\n </div>\n</ng-template>\n\n\n<ng-template #filterActions>\n <div class=\"filter-actions\">\n <ng-container *ngIf=\"hasVisibleItemOrSorting && filtersBtnVisible$ | async\">\n <button\n mat-button\n class=\"filters-button\"\n [ngClass]=\"{\n 'mat-raised-button': config.button.style == 'raised',\n 'mat-button': config.button.style == 'basic',\n 'mat-icon-button': config.button.style == 'icon'\n }\"\n (click)=\"changeVisibilityClick(!showFilterMenu, $event)\"\n type=\"button\"\n [color]=\"config.button.color\">\n <mat-icon *ngIf=\"config.button.icon\">{{config.button.icon}}</mat-icon>\n {{ config.button.label }}\n </button>\n </ng-container>\n\n <fs-filter-actions\n *ngIf=\"actionsVisible$ | async\"\n [actions]=\"actions$ | async\"\n [kebabActions]=\"menuActions$ | async\">\n </fs-filter-actions>\n </div>\n</ng-template>\n\n<ng-template #filterChips>\n <fs-filter-chips\n *ngIf=\"config.chips && hasFilterChips$ | async\"\n class=\"filter-chips\"\n [filters]=\"items\">\n </fs-filter-chips>\n</ng-template>\n\n<ng-template #statusBarContainer>\n <div class=\"status-bar\" *ngIf=\"statusBar\">\n <small><ng-container *ngTemplateOutlet=\"statusBar\"></ng-container></small>\n </div>\n</ng-template>\n", styles: ["fs-filter{display:block}.fs-filter{margin-bottom:20px;display:block}.fs-filter .results{min-height:90px;position:relative;overflow-x:auto;overflow-y:hidden}.fs-filter .status-bar{overflow:hidden;text-overflow:ellipsis;line-height:17px;margin:4px 0}.fs-filter .filter-chips{display:block}.fs-filter .filter-searchless-container{display:flex}.fs-filter .filter-searchless-container .status-actions{flex-grow:1}.fs-filter .filter-searchless-container .status-actions>*:first-child{margin-top:0}.fs-filter fs-filter-chips{margin:5px 0}.fs-filter .filter-search-container{flex-direction:row;box-sizing:border-box;display:flex;flex:1 1 0;position:relative}.fs-filter .filter-search-container .search{top:8px;position:absolute;margin-left:1px;left:0}.fs-filter .filter-search-container .search mat-icon{transform:scale(.9)}.fs-filter .filter-search-container form{width:100%;height:100%}.fs-filter .filter-search-container .filter-input-field{flex-direction:row;box-sizing:border-box;display:flex;align-items:center;flex:1}.fs-filter .filter-search-container .filter-input-field .mat-form-field{width:100%;height:100%;font-size:103%}.fs-filter .filter-search-container .filter-input-field .mat-form-field .mat-form-field-underline{bottom:auto}.fs-filter .filter-search-container .filter-input-field .mat-form-field .mat-form-field-infix{border-top:0}.fs-filter .filter-search-container .filter-input-field .mat-form-field .mat-form-field-wrapper{padding-bottom:0;height:100%}.fs-filter .filter-search-container .filter-input-field .mat-form-field .mat-form-field-flex{align-items:center;height:100%}.fs-filter .filter-search-container .filter-input-field .mat-form-field-prefix,.fs-filter .filter-search-container .filter-input-field .mat-form-field-suffix{align-self:center;display:flex;align-items:center;white-space:nowrap}.fs-filter .filter-search-container .filter-input-field .mat-form-field-prefix mat-icon,.fs-filter .filter-search-container .filter-input-field .mat-form-field-prefix a,.fs-filter .filter-search-container .filter-input-field .mat-form-field-suffix mat-icon,.fs-filter .filter-search-container .filter-input-field .mat-form-field-suffix a{display:flex;cursor:pointer;color:initial}.fs-filter .filter-search-container .filter-input-field .mat-form-field-prefix mat-icon:hover,.fs-filter .filter-search-container .filter-input-field .mat-form-field-prefix a:hover,.fs-filter .filter-search-container .filter-input-field .mat-form-field-suffix mat-icon:hover,.fs-filter .filter-search-container .filter-input-field .mat-form-field-suffix a:hover{color:inherit}.fs-filter .filter-search-container .filter-input-field .mat-form-field-infix{width:auto}.fs-filter .filter-actions{display:flex;align-items:center}.fs-filter button.reload{margin-left:-40px;right:-9px}@media screen and (min-width: 599px){.filter-actions{margin-left:10px}.filters-button+fs-filter-actions:not(:empty){margin-left:5px}}@media screen and (max-width: 600px){.filter-actions{margin-left:5px}.filter-actions .filters-button{font-size:0;padding:0;min-width:unset;width:36px;height:36px;border-radius:50%;box-shadow:unset!important}}@media screen and (min-width: 1200px){body.fs-filter-open{margin-right:350px}.fs-filter-backdrop{display:none}}body.fs-filter-open::-webkit-scrollbar{width:0;background:transparent}\n"], components: [{ type: i1$3.MatFormField, selector: "mat-form-field", inputs: ["color", "floatLabel", "appearance", "hideRequiredMarker", "hintLabel"], exportAs: ["matFormField"] }, { type: i2$3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: i1$4.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { type: FsFilterActionsComponent, selector: "fs-filter-actions", inputs: ["kebabActions", "actions"] }, { type: FsFilterChipsComponent, selector: "fs-filter-chips", inputs: ["filters"] }], directives: [{ type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i5.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i5.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i5.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i1$3.MatPrefix, selector: "[matPrefix]" }, { type: i4.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["id", "disabled", "required", "type", "value", "readonly", "placeholder", "errorStateMatcher", "aria-describedby"], exportAs: ["matInput"] }, { type: i5.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i5.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i5.FormControlDirective, selector: "[formControl]", inputs: ["disabled", "formControl", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i1$3.MatSuffix, selector: "[matSuffix]" }, { type: i3.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i6$1.DefaultClassDirective, selector: " [ngClass], [ngClass.xs], [ngClass.sm], [ngClass.md], [ngClass.lg], [ngClass.xl], [ngClass.lt-sm], [ngClass.lt-md], [ngClass.lt-lg], [ngClass.lt-xl], [ngClass.gt-xs], [ngClass.gt-sm], [ngClass.gt-md], [ngClass.gt-lg]", inputs: ["ngClass", "ngClass.xs", "ngClass.sm", "ngClass.md", "ngClass.lg", "ngClass.xl", "ngClass.lt-sm", "ngClass.lt-md", "ngClass.lt-lg", "ngClass.lt-xl", "ngClass.gt-xs", "ngClass.gt-sm", "ngClass.gt-md", "ngClass.gt-lg"] }], pipes: { "async": i3.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
4075
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FilterComponent, decorators: [{
4076
+ type: Component,
4077
+ args: [{
4078
+ selector: 'fs-filter',
4079
+ styleUrls: ['./filter.component.scss'],
4080
+ templateUrl: './filter.component.html',
4081
+ encapsulation: ViewEncapsulation.None,
4082
+ providers: [
4083
+ FsFilterOverlayService,
4084
+ ExternalParamsController,
4085
+ PersistanceParamsController,
4086
+ QueryParamsController,
4087
+ FocusControllerService,
4088
+ FsFilterItemsStore,
4089
+ SavedFiltersController,
4090
+ ActionsController,
4091
+ ],
4092
+ changeDetection: ChangeDetectionStrategy.OnPush,
4093
+ }]
4094
+ }], ctorParameters: function () { return [{ type: FsFilterOverlayService }, { type: i0.NgZone }, { type: ExternalParamsController }, { type: FsFilterItemsStore }, { type: ActionsController }, { type: FsFilterConfig, decorators: [{
4095
+ type: Optional
4096
+ }, {
4097
+ type: Inject,
4098
+ args: [FS_FILTER_CONFIG]
4099
+ }] }]; }, propDecorators: { setConfig: [{
4100
+ type: Input,
4101
+ args: ['config']
4102
+ }], setFilter: [{
4103
+ type: Input,
4104
+ args: ['filter']
4105
+ }], showSortBy: [{
4106
+ type: Input
4107
+ }], showFilterInput: [{
4108
+ type: Input
4109
+ }], closed: [{
4110
+ type: Output
4111
+ }], opened: [{
4112
+ type: Output
4113
+ }], ready: [{
4114
+ type: Output
4115
+ }], statusBar: [{
4116
+ type: ContentChild,
4117
+ args: [FilterStatusBarDirective, { read: TemplateRef }]
4118
+ }], searchTextInput: [{
4119
+ type: ViewChild,
4120
+ args: ['searchTextInput']
4121
+ }], searchTextMatInput: [{
4122
+ type: ViewChild,
4123
+ args: ['searchTextInput', { read: MatInput }]
4124
+ }], showFilterMenu: [{
4125
+ type: HostBinding,
4126
+ args: ['class.filters-open']
4127
+ }], windowDesktop: [{
4128
+ type: HostBinding,
4129
+ args: ['class.window-desktop']
4130
+ }], fsFilterClass: [{
4131
+ type: HostBinding,
4132
+ args: ['class.fs-filter']
4133
+ }] } });
4134
+
4135
+ class SelectBackdropComponent {
4136
+ constructor() { }
4137
+ }
4138
+ SelectBackdropComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SelectBackdropComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
4139
+ SelectBackdropComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SelectBackdropComponent, selector: "filter-item-select-backdrop", ngImport: i0, template: "", styles: [":host{position:absolute;top:0;bottom:0;right:0;z-index:1002;left:0}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
4140
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SelectBackdropComponent, decorators: [{
4141
+ type: Component,
4142
+ args: [{
4143
+ selector: 'filter-item-select-backdrop',
4144
+ styleUrls: ['./backdrop.component.scss'],
4145
+ templateUrl: './backdrop.component.html',
4146
+ changeDetection: ChangeDetectionStrategy.OnPush,
4147
+ }]
4148
+ }], ctorParameters: function () { return []; } });
4175
4149
 
4176
- let FsSavedFiltersMenuComponent = class FsSavedFiltersMenuComponent {
4150
+ class FsSavedFiltersMenuComponent {
4177
4151
  constructor(_itemsStore, _externalParams, _savedFilters) {
4178
4152
  this._itemsStore = _itemsStore;
4179
4153
  this._externalParams = _externalParams;
@@ -4200,105 +4174,99 @@ let FsSavedFiltersMenuComponent = class FsSavedFiltersMenuComponent {
4200
4174
  manageFilters() {
4201
4175
  this.manage.emit();
4202
4176
  }
4203
- };
4204
- FsSavedFiltersMenuComponent.ctorParameters = () => [
4205
- { type: FsFilterItemsStore },
4206
- { type: ExternalParamsController },
4207
- { type: SavedFiltersController }
4208
- ];
4209
- __decorate([
4210
- Output(),
4211
- __metadata("design:type", Object)
4212
- ], FsSavedFiltersMenuComponent.prototype, "select", void 0);
4213
- __decorate([
4214
- Output(),
4215
- __metadata("design:type", Object)
4216
- ], FsSavedFiltersMenuComponent.prototype, "clear", void 0);
4217
- __decorate([
4218
- Output(),
4219
- __metadata("design:type", Object)
4220
- ], FsSavedFiltersMenuComponent.prototype, "manage", void 0);
4221
- FsSavedFiltersMenuComponent = __decorate([
4222
- Component({
4223
- selector: 'fs-filter-saved-filters-menu',
4224
- 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 <ng-template fs-menu-item class=\"saved-filter-last-item\" (click)=\"manageFilters()\">\n Manage\n </ng-template>\n</fs-menu>\n",
4225
- changeDetection: ChangeDetectionStrategy.OnPush,
4226
- styles: [":host ::ng-deep .selector{cursor:pointer}"]
4227
- }),
4228
- __metadata("design:paramtypes", [FsFilterItemsStore,
4229
- ExternalParamsController,
4230
- SavedFiltersController])
4231
- ], FsSavedFiltersMenuComponent);
4232
-
4233
- let FsFilterActionsComponent = class FsFilterActionsComponent {
4234
- constructor() {
4235
- this.kebabActions = [];
4236
- this.actions = [];
4237
- }
4238
- };
4239
- __decorate([
4240
- Input(),
4241
- __metadata("design:type", Array)
4242
- ], FsFilterActionsComponent.prototype, "kebabActions", void 0);
4243
- __decorate([
4244
- Input(),
4245
- __metadata("design:type", Array)
4246
- ], FsFilterActionsComponent.prototype, "actions", void 0);
4247
- FsFilterActionsComponent = __decorate([
4248
- Component({
4249
- selector: 'fs-filter-actions',
4250
- template: "<!-- Buttons -->\n<ng-container *ngFor=\"let action of actions\">\n\n <ng-container [ngSwitch]=\"action.mode\">\n <ng-container *ngSwitchCase=\"'button'\">\n <fs-filter-action-button [action]=\"action\"></fs-filter-action-button>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'menu'\">\n <fs-filter-action-button\n [action]=\"action\"\n [fsMenuTriggerFor]=\"someRef\">\n </fs-filter-action-button>\n\n <fs-menu #someRef>\n <ng-container *ngFor=\"let childAction of action.items\">\n <ng-container *ngIf=\"childAction.isGroup else simpleMenuItem\">\n <fs-menu-group [label]=\"childAction.label\">\n <ng-container *ngFor=\"let subAction of childAction.items\">\n <ng-template fs-menu-item\n [link]=\"subAction.routerLink?.link\"\n [queryParams]=\"subAction.routerLink?.queryParams\"\n [hidden]=\"!(subAction.visible$ | async)\"\n (click)=\"subAction.click($event)\">\n <mat-icon *ngIf=\"subAction.icon\">{{subAction.icon}}</mat-icon>\n {{subAction.label}}\n </ng-template>\n </ng-container>\n </fs-menu-group>\n </ng-container>\n <ng-template #simpleMenuItem>\n <ng-template fs-menu-item\n [link]=\"childAction.routerLink?.link\"\n [queryParams]=\"childAction.routerLink?.queryParams\"\n [hidden]=\"!(childAction.visible$ | async)\"\n (click)=\"childAction.click($event);\">\n <mat-icon *ngIf=\"childAction.icon\">{{childAction.icon}}</mat-icon>\n {{childAction.label}}\n </ng-template>\n </ng-template>\n </ng-container>\n </fs-menu>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'file'\">\n <fs-file\n class=\"action-button\"\n [accept]=\"action.accept || '*'\"\n [multiple]=\"action.multiple\"\n [minWidth]=\"action.minWidth\"\n [minHeight]=\"action.minHeight\"\n [imageWidth]=\"action.maxWidth\"\n [imageHeight]=\"action.maxHeight\"\n (select)=\"action.fileSelected($event)\"\n (error)=\"action.fileError($event)\"\n (clicked)=\"action.click($event)\">\n <fs-filter-action-button [action]=\"action\"></fs-filter-action-button>\n </fs-file>\n </ng-container>\n </ng-container>\n</ng-container>\n<!-- /Buttons -->\n\n<!-- menu -->\n<ng-container *ngIf=\"kebabActions?.length\">\n <fs-filter-action-kebab-actions [kebabActions]=\"kebabActions\"></fs-filter-action-kebab-actions>\n</ng-container>\n",
4251
- changeDetection: ChangeDetectionStrategy.OnPush,
4252
- styles: [":host{display:inline-flex}.action-button{display:block}.action-button+.action-button,fs-menu+.action-button{margin-left:5px}.menu-button{width:36px;height:36px;line-height:36px}"]
4253
- })
4254
- ], FsFilterActionsComponent);
4255
-
4256
- let FsFilterActionButtonComponent = class FsFilterActionButtonComponent {
4257
- };
4258
- __decorate([
4259
- Input(),
4260
- __metadata("design:type", Action)
4261
- ], FsFilterActionButtonComponent.prototype, "action", void 0);
4262
- FsFilterActionButtonComponent = __decorate([
4263
- Component({
4264
- selector: 'fs-filter-action-button',
4265
- template: "<ng-container [ngSwitch]=\"action.type\">\n <!-- Basic button -->\n <button type=\"button\"\n *ngSwitchCase=\"'basic'\"\n mat-button\n (click)=\"action.click && action.click($event)\"\n [color]=\"action.color\"\n [ngClass]=\"action.classArray\"\n [disabled]=\"action.disabled$ | async\"\n [tabIndex]=\"action.tabIndex\"\n >\n <ng-template [ngTemplateOutlet]=\"buttonContent\"></ng-template>\n </button>\n\n <!-- Raised button -->\n <button type=\"button\"\n *ngSwitchDefault\n mat-raised-button\n (click)=\"action.click && action.click($event)\"\n [color]=\"action.color\"\n [ngClass]=\"action.classArray\"\n [disabled]=\"action.disabled$ | async\"\n [tabIndex]=\"action.tabIndex\"\n >\n <ng-template [ngTemplateOutlet]=\"buttonContent\"></ng-template>\n </button>\n\n <!-- Icon button -->\n <button type=\"button\"\n *ngSwitchCase=\"'icon'\"\n mat-icon-button\n (click)=\"action.click && action.click($event)\"\n [color]=\"action.color\"\n [ngClass]=\"action.classArray\"\n [disabled]=\"action.disabled$ | async\"\n [tabIndex]=\"action.tabIndex\"\n >\n <ng-template [ngTemplateOutlet]=\"buttonContent\"></ng-template>\n </button>\n\n <!-- Fab button -->\n <button type=\"button\"\n *ngSwitchCase=\"'fab'\"\n mat-fab\n (click)=\"action.click && action.click($event)\"\n [color]=\"action.color\"\n [ngClass]=\"action.classArray\"\n [disabled]=\"action.disabled$ | async\"\n [tabIndex]=\"action.tabIndex\"\n >\n <ng-template [ngTemplateOutlet]=\"buttonContent\"></ng-template>\n </button>\n\n <!-- Mini Fab button -->\n <button type=\"button\"\n *ngSwitchCase=\"'mini-fab'\"\n mat-mini-fab\n (click)=\"action.click && action.click($event)\"\n [color]=\"action.color\"\n [ngClass]=\"action.classArray\"\n [disabled]=\"action.disabled$ | async\"\n [tabIndex]=\"action.tabIndex\"\n >\n <ng-template [ngTemplateOutlet]=\"buttonContent\"></ng-template>\n </button>\n\n <ng-template #buttonContent>\n <ng-container *ngIf=\"!action.icon else withIcon\">\n {{action.label}}\n </ng-container>\n\n <ng-template #withIcon>\n <mat-icon *ngIf=\"!action.iconPlacement || action.iconPlacement === 'left'\">{{action.icon}}</mat-icon>\n {{action.label}}\n <mat-icon *ngIf=\"action.iconPlacement === 'right'\">{{action.icon}}</mat-icon>\n </ng-template>\n </ng-template>\n</ng-container>\n",
4266
- host: {
4267
- class: 'action-button',
4268
- },
4269
- changeDetection: ChangeDetectionStrategy.OnPush
4270
- })
4271
- ], FsFilterActionButtonComponent);
4272
-
4273
- let FsFilterActionKebabActionsComponent = class FsFilterActionKebabActionsComponent {
4274
- };
4275
- __decorate([
4276
- Input(),
4277
- __metadata("design:type", Array)
4278
- ], FsFilterActionKebabActionsComponent.prototype, "kebabActions", void 0);
4279
- FsFilterActionKebabActionsComponent = __decorate([
4280
- Component({
4281
- selector: 'fs-filter-action-kebab-actions',
4282
- template: "<button type=\"button\"\n mat-icon-button\n class=\"menu-button\"\n [fsMenuTriggerFor]=\"kebabActionsMenu\">\n <mat-icon>more_vert</mat-icon>\n</button>\n<fs-menu #kebabActionsMenu>\n <ng-container *ngFor=\"let action of kebabActions\">\n <ng-container [ngSwitch]=\"action.mode\">\n <!-- Case when actions was collapsed from action with mode = 'menu'-->\n <ng-container *ngSwitchCase=\"'menu'\">\n <ng-container *ngFor=\"let childAction of action.items\">\n <ng-container *ngIf=\"childAction.isGroup else simpleMenuItem\">\n <fs-menu-group>\n <ng-template fs-group-menu-item-template>\n {{ action.label }} <mat-icon style=\"margin: 0;\">arrow_right</mat-icon> {{childAction.label}}\n </ng-template>\n <ng-container *ngFor=\"let subAction of childAction.items\">\n <ng-template fs-menu-item\n [link]=\"subAction.routerLink?.link\"\n [queryParams]=\"subAction.routerLink?.queryParams\"\n [hidden]=\"!(subAction.visible$ | async)\"\n (click)=\"subAction.click($event)\">\n <mat-icon *ngIf=\"subAction.icon\">{{subAction.icon}}</mat-icon>\n {{subAction.label}}\n </ng-template>\n </ng-container>\n </fs-menu-group>\n </ng-container>\n <ng-template #simpleMenuItem>\n <ng-template fs-menu-item\n [link]=\"childAction.routerLink?.link\"\n [queryParams]=\"childAction.routerLink?.queryParams\"\n [hidden]=\"!(childAction.visible$ | async)\"\n (click)=\"childAction.click($event);\">\n <mat-icon *ngIf=\"childAction.icon\">{{childAction.icon}}</mat-icon>\n {{ action.label }} <mat-icon style=\"margin: 0;\">arrow_right</mat-icon>{{ childAction.label }}\n </ng-template>\n </ng-template>\n </ng-container>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'file'\">\n <ng-template fs-menu-item\n [fsClass]=\"action.classArray\"\n >\n <fs-file\n class=\"action-button\"\n [accept]=\"action.accept || '*'\"\n [multiple]=\"action.multiple\"\n [minWidth]=\"action.minWidth\"\n [minHeight]=\"action.minHeight\"\n [imageWidth]=\"action.maxWidth\"\n [imageHeight]=\"action.maxHeight\"\n (select)=\"action.fileSelected($event)\"\n (error)=\"action.fileError($event)\"\n (clicked)=\"action.click($event)\">\n <mat-icon *ngIf=\"action.icon\">{{action.icon}}</mat-icon> {{action.label}}\n </fs-file>\n </ng-template>\n </ng-container>\n\n <ng-container *ngSwitchDefault>\n <ng-template fs-menu-item\n (click)=\"action.click($event)\"\n [fsClass]=\"action.classArray\"\n >\n <mat-icon *ngIf=\"action.icon\">{{action.icon}}</mat-icon> {{action.label}}\n </ng-template>\n </ng-container>\n\n </ng-container>\n </ng-container>\n</fs-menu>\n",
4283
- changeDetection: ChangeDetectionStrategy.OnPush,
4284
- styles: [".menu-button{width:36px;height:36px;line-height:36px}"]
4285
- })
4286
- ], FsFilterActionKebabActionsComponent);
4177
+ }
4178
+ FsSavedFiltersMenuComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsSavedFiltersMenuComponent, deps: [{ token: FsFilterItemsStore }, { token: ExternalParamsController }, { token: SavedFiltersController }], target: i0.ɵɵFactoryTarget.Component });
4179
+ FsSavedFiltersMenuComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FsSavedFiltersMenuComponent, selector: "fs-filter-saved-filters-menu", outputs: { select: "select", clear: "clear", manage: "manage" }, 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 <ng-template fs-menu-item class=\"saved-filter-last-item\" (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"], 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]", inputs: ["fsClass", "class", "id", "label", "hidden", "groupHidden", "dismissAfterClick", "link", "target", "queryParams"], outputs: ["click"] }, { type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], pipes: { "async": i3.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
4180
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsSavedFiltersMenuComponent, decorators: [{
4181
+ type: Component,
4182
+ args: [{
4183
+ selector: 'fs-filter-saved-filters-menu',
4184
+ templateUrl: './saved-filters-menu.component.html',
4185
+ styleUrls: [
4186
+ './saved-filters-menu.component.scss',
4187
+ ],
4188
+ changeDetection: ChangeDetectionStrategy.OnPush,
4189
+ }]
4190
+ }], ctorParameters: function () { return [{ type: FsFilterItemsStore }, { type: ExternalParamsController }, { type: SavedFiltersController }]; }, propDecorators: { select: [{
4191
+ type: Output
4192
+ }], clear: [{
4193
+ type: Output
4194
+ }], manage: [{
4195
+ type: Output
4196
+ }] } });
4287
4197
 
4288
- var FsFilterModule_1;
4289
- let FsFilterModule = FsFilterModule_1 = class FsFilterModule {
4198
+ class FsFilterModule {
4290
4199
  static forRoot(config = {}) {
4291
4200
  return {
4292
- ngModule: FsFilterModule_1,
4201
+ ngModule: FsFilterModule,
4293
4202
  providers: [
4294
4203
  { provide: FS_FILTER_CONFIG, useValue: config || {} }
4295
4204
  ]
4296
4205
  };
4297
4206
  }
4298
- };
4299
- FsFilterModule = FsFilterModule_1 = __decorate([
4300
- NgModule({
4301
- imports: [
4207
+ }
4208
+ FsFilterModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsFilterModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
4209
+ FsFilterModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsFilterModule, declarations: [BaseItemComponent,
4210
+ FilterComponent,
4211
+ FilterItemComponent,
4212
+ FsFilterChipsComponent,
4213
+ SelectComponent,
4214
+ SelectGroupsComponent,
4215
+ SelectSimpleComponent,
4216
+ SelectMultipleComponent,
4217
+ ChipsComponent,
4218
+ TextComponent,
4219
+ RangeComponent,
4220
+ AutocompleteComponent,
4221
+ AutocompletechipsComponent,
4222
+ DateComponent,
4223
+ DateRangeComponent,
4224
+ CheckboxComponent,
4225
+ FilterDrawerComponent,
4226
+ SelectBackdropComponent,
4227
+ FsFilterChipComponent,
4228
+ FsFilterChipContentComponent,
4229
+ FsFilterDrawerActionsComponent,
4230
+ FsFilterSavedFilterEditComponent,
4231
+ FsSavedFiltersMenuComponent,
4232
+ FsFilterActionsComponent,
4233
+ FsFilterActionButtonComponent,
4234
+ FsFilterActionKebabActionsComponent,
4235
+ FilterStatusBarDirective,
4236
+ FocusToItemDirective,
4237
+ // Pipes
4238
+ FsFilterIsolateValues], imports: [CommonModule,
4239
+ RouterModule,
4240
+ FormsModule,
4241
+ ReactiveFormsModule,
4242
+ MatIconModule,
4243
+ MatInputModule,
4244
+ MatSelectModule,
4245
+ MatChipsModule,
4246
+ MatCheckboxModule,
4247
+ MatAutocompleteModule,
4248
+ MatButtonModule,
4249
+ MatDialogModule,
4250
+ FlexLayoutModule,
4251
+ FsChipModule,
4252
+ FsCommonModule,
4253
+ FsStoreModule,
4254
+ FsDatePickerModule,
4255
+ FsLabelModule,
4256
+ FsAutocompleteModule,
4257
+ FsAutocompleteChipsModule,
4258
+ FsScrollModule,
4259
+ PortalModule,
4260
+ FsMaskModule,
4261
+ FsMenuModule,
4262
+ FsSkeletonModule,
4263
+ FsFormModule,
4264
+ FsFileModule], exports: [FilterComponent,
4265
+ FilterStatusBarDirective,
4266
+ FsSavedFiltersMenuComponent] });
4267
+ FsFilterModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsFilterModule, providers: [
4268
+ FsStore,
4269
+ ], imports: [[
4302
4270
  CommonModule,
4303
4271
  RouterModule,
4304
4272
  FormsModule,
@@ -4326,52 +4294,84 @@ FsFilterModule = FsFilterModule_1 = __decorate([
4326
4294
  FsSkeletonModule,
4327
4295
  FsFormModule,
4328
4296
  FsFileModule,
4329
- ],
4330
- declarations: [
4331
- BaseItemComponent,
4332
- FilterComponent,
4333
- FilterItemComponent,
4334
- FsFilterChipsComponent,
4335
- SelectComponent,
4336
- SelectGroupsComponent,
4337
- SelectSimpleComponent,
4338
- SelectMultipleComponent,
4339
- ChipsComponent,
4340
- TextComponent,
4341
- RangeComponent,
4342
- AutocompleteComponent,
4343
- AutocompletechipsComponent,
4344
- DateComponent,
4345
- DateRangeComponent,
4346
- CheckboxComponent,
4347
- FilterDrawerComponent,
4348
- SelectBackdropComponent,
4349
- FsFilterChipComponent,
4350
- FsFilterChipContentComponent,
4351
- FsFilterDrawerActionsComponent,
4352
- FsFilterSavedFilterEditComponent,
4353
- FsSavedFiltersMenuComponent,
4354
- FsFilterActionsComponent,
4355
- FsFilterActionButtonComponent,
4356
- FsFilterActionKebabActionsComponent,
4357
- FilterStatusBarDirective,
4358
- FocusToItemDirective,
4359
- // Pipes
4360
- FsFilterIsolateValues,
4361
- ],
4362
- providers: [
4363
- FsStore,
4364
- ],
4365
- exports: [
4366
- FilterComponent,
4367
- FilterStatusBarDirective,
4368
- FsSavedFiltersMenuComponent,
4369
- ],
4370
- entryComponents: [
4371
- FilterDrawerComponent
4372
- ]
4373
- })
4374
- ], FsFilterModule);
4297
+ ]] });
4298
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsFilterModule, decorators: [{
4299
+ type: NgModule,
4300
+ args: [{
4301
+ imports: [
4302
+ CommonModule,
4303
+ RouterModule,
4304
+ FormsModule,
4305
+ ReactiveFormsModule,
4306
+ MatIconModule,
4307
+ MatInputModule,
4308
+ MatSelectModule,
4309
+ MatChipsModule,
4310
+ MatCheckboxModule,
4311
+ MatAutocompleteModule,
4312
+ MatButtonModule,
4313
+ MatDialogModule,
4314
+ FlexLayoutModule,
4315
+ FsChipModule,
4316
+ FsCommonModule,
4317
+ FsStoreModule,
4318
+ FsDatePickerModule,
4319
+ FsLabelModule,
4320
+ FsAutocompleteModule,
4321
+ FsAutocompleteChipsModule,
4322
+ FsScrollModule,
4323
+ PortalModule,
4324
+ FsMaskModule,
4325
+ FsMenuModule,
4326
+ FsSkeletonModule,
4327
+ FsFormModule,
4328
+ FsFileModule,
4329
+ ],
4330
+ declarations: [
4331
+ BaseItemComponent,
4332
+ FilterComponent,
4333
+ FilterItemComponent,
4334
+ FsFilterChipsComponent,
4335
+ SelectComponent,
4336
+ SelectGroupsComponent,
4337
+ SelectSimpleComponent,
4338
+ SelectMultipleComponent,
4339
+ ChipsComponent,
4340
+ TextComponent,
4341
+ RangeComponent,
4342
+ AutocompleteComponent,
4343
+ AutocompletechipsComponent,
4344
+ DateComponent,
4345
+ DateRangeComponent,
4346
+ CheckboxComponent,
4347
+ FilterDrawerComponent,
4348
+ SelectBackdropComponent,
4349
+ FsFilterChipComponent,
4350
+ FsFilterChipContentComponent,
4351
+ FsFilterDrawerActionsComponent,
4352
+ FsFilterSavedFilterEditComponent,
4353
+ FsSavedFiltersMenuComponent,
4354
+ FsFilterActionsComponent,
4355
+ FsFilterActionButtonComponent,
4356
+ FsFilterActionKebabActionsComponent,
4357
+ FilterStatusBarDirective,
4358
+ FocusToItemDirective,
4359
+ // Pipes
4360
+ FsFilterIsolateValues,
4361
+ ],
4362
+ providers: [
4363
+ FsStore,
4364
+ ],
4365
+ exports: [
4366
+ FilterComponent,
4367
+ FilterStatusBarDirective,
4368
+ FsSavedFiltersMenuComponent,
4369
+ ],
4370
+ entryComponents: [
4371
+ FilterDrawerComponent
4372
+ ]
4373
+ }]
4374
+ }] });
4375
4375
 
4376
4376
  // Controllers
4377
4377
 
@@ -4379,5 +4379,5 @@ FsFilterModule = FsFilterModule_1 = __decorate([
4379
4379
  * Generated bundle index. Do not edit.
4380
4380
  */
4381
4381
 
4382
- export { ActionMode, ActionType, AutocompleteChipsItem, AutocompleteItem, BaseItem, CheckboxItem, ChipsItem, DateItem, DateRangeItem, DateTimeItem, DateTimeRangeItem, ExternalParamsController, FS_FILTER_CONFIG, FilterComponent, FilterItemComponent, FilterStatusBarDirective, FsFilterModule, ItemDateMode, ItemType, QUERY_PARAM_DELIMITER, RangeItem, SavedFiltersController, SelectItem, TextItem, filterFromQueryParam, filterToQueryParam, FsFilterItemsStore as ɵa, PersistanceParamsController as ɵb, SelectBackdropComponent as ɵba, FsFilterChipComponent as ɵbb, FsFilterChipContentComponent as ɵbc, FsFilterDrawerActionsComponent as ɵbd, FsFilterSavedFilterEditComponent as ɵbe, FsSavedFiltersMenuComponent as ɵbf, FsFilterActionsComponent as ɵbg, FsFilterActionButtonComponent as ɵbh, FsFilterActionKebabActionsComponent as ɵbi, FocusToItemDirective as ɵbj, FsFilterIsolateValues as ɵbk, BaseDateItem as ɵbl, BaseDateRangeItem as ɵbm, BaseAutocompleteItem as ɵbn, QueryParamsController as ɵc, BaseItemComponent as ɵd, FsFilterOverlayService as ɵe, FS_FILTER_META as ɵg, FocusControllerService as ɵh, ActionsController as ɵi, FsFilterConfig as ɵj, FsFilterChipsComponent as ɵk, SelectComponent as ɵl, SelectGroupsComponent as ɵm, SelectSimpleComponent as ɵn, SelectMultipleComponent as ɵo, ChipsComponent as ɵp, TextComponent as ɵq, RangeComponent as ɵr, AutocompleteComponent as ɵs, AutocompletechipsComponent as ɵt, DateComponent as ɵu, DateRangeComponent as ɵv, CheckboxComponent as ɵw, FilterDrawerComponent as ɵx, FILTER_DRAWER_OVERLAY as ɵy, FILTER_DRAWER_DATA as ɵz };
4382
+ export { ActionMode, ActionType, AutocompleteChipsItem, AutocompleteItem, BaseItem, CheckboxItem, ChipsItem, DateItem, DateRangeItem, DateTimeItem, DateTimeRangeItem, ExternalParamsController, FS_FILTER_CONFIG, FilterComponent, FilterItemComponent, FilterStatusBarDirective, FsFilterModule, FsSavedFiltersMenuComponent, ItemDateMode, ItemType, QUERY_PARAM_DELIMITER, RangeItem, SavedFiltersController, SelectItem, TextItem, filterFromQueryParam, filterToQueryParam };
4383
4383
  //# sourceMappingURL=firestitch-filter.js.map