@firestitch/filter 9.9.7 → 12.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (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 +8 -2
  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 +4 -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 +3005 -2890
  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 +102 -96
  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 +29 -32
  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 +2018 -2004
  137. package/fesm2015/firestitch-filter.js.map +1 -1
  138. package/firestitch-filter.d.ts +1 -39
  139. package/package.json +18 -21
  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 -690
  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 -190
  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 -5105
  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;
@@ -2001,6 +2008,21 @@ let ExternalParamsController = class ExternalParamsController {
2001
2008
  this._initPersistance();
2002
2009
  this._initQueryParams();
2003
2010
  this._initSavedFilters();
2011
+ this.initItems();
2012
+ }
2013
+ setActiveSavedFilter(savedFilter) {
2014
+ this.savedFiltersController.setActiveFilter(savedFilter);
2015
+ if (savedFilter) {
2016
+ this.reloadFiltersWithValues(savedFilter.filters, false);
2017
+ }
2018
+ }
2019
+ reloadFiltersWithValues(params, shouldResetSavedFilters = true) {
2020
+ this._shouldResetSavedFilters = shouldResetSavedFilters;
2021
+ this._itemsStore.updateItemsWithValues(params);
2022
+ this._saveQueryParams();
2023
+ this._savePersistedParams();
2024
+ }
2025
+ initItems() {
2004
2026
  this._pending$.next(true);
2005
2027
  if (this._savedFilters.enabled) {
2006
2028
  this._savedFilters
@@ -2019,18 +2041,6 @@ let ExternalParamsController = class ExternalParamsController {
2019
2041
  }
2020
2042
  this._listenItemsChange();
2021
2043
  }
2022
- setActiveSavedFilter(savedFilter) {
2023
- this.savedFiltersController.setActiveFilter(savedFilter);
2024
- if (savedFilter) {
2025
- this.reloadFiltersWithValues(savedFilter.filters, false);
2026
- }
2027
- }
2028
- reloadFiltersWithValues(params, shouldResetSavedFilters = true) {
2029
- this._shouldResetSavedFilters = shouldResetSavedFilters;
2030
- this._itemsStore.updateItemsWithValues(params);
2031
- this._saveQueryParams();
2032
- this._savePersistedParams();
2033
- }
2034
2044
  _initItemsValues() {
2035
2045
  this._itemsStore.initItemValues(this.params);
2036
2046
  this._saveQueryParams();
@@ -2092,22 +2102,12 @@ let ExternalParamsController = class ExternalParamsController {
2092
2102
  }), targetItems);
2093
2103
  this._persistanceStore.save(params);
2094
2104
  }
2095
- };
2096
- ExternalParamsController.ctorParameters = () => [
2097
- { type: FsFilterItemsStore },
2098
- { type: PersistanceParamsController },
2099
- { type: QueryParamsController },
2100
- { type: SavedFiltersController },
2101
- { type: ActivatedRoute }
2102
- ];
2103
- ExternalParamsController = __decorate([
2104
- Injectable(),
2105
- __metadata("design:paramtypes", [FsFilterItemsStore,
2106
- PersistanceParamsController,
2107
- QueryParamsController,
2108
- SavedFiltersController,
2109
- ActivatedRoute])
2110
- ], 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 }]; } });
2111
2111
 
2112
2112
  const FS_FILTER_CONFIG = new InjectionToken('fs.filter-config');
2113
2113
 
@@ -2152,199 +2152,69 @@ const FILTER_DRAWER_DATA = new InjectionToken('fs.filter-drawer-data');
2152
2152
 
2153
2153
  const FILTER_DRAWER_OVERLAY = new InjectionToken('fs.filter-drawer-overlay');
2154
2154
 
2155
- let FilterDrawerComponent = class FilterDrawerComponent {
2156
- constructor(externalParams, _cd, _itemsStore, overlayRef, data) {
2157
- this.externalParams = externalParams;
2155
+ class BaseItemComponent {
2156
+ constructor(_kvDiffers, _cd) {
2157
+ this._kvDiffers = _kvDiffers;
2158
2158
  this._cd = _cd;
2159
- this._itemsStore = _itemsStore;
2160
- this.overlayRef = overlayRef;
2161
- this.data = data;
2162
2159
  this.inline = false;
2163
- this.windowDesktop = false;
2164
- this._itemsStore.prepareItems();
2165
- this._clear = data.clear;
2166
- this._done = data.done;
2167
- this.updateWindowWidth();
2168
- }
2169
- updateWindowWidth() {
2170
- this.windowDesktop = window.innerWidth > 1200;
2171
- }
2172
- get items$() {
2173
- return this._itemsStore.visibleItems$;
2174
- }
2175
- get sortItem() {
2176
- return this._itemsStore.sortByItem;
2177
- }
2178
- get sortDirectionItem() {
2179
- return this._itemsStore.sortDirectionItem;
2180
- }
2181
- clear() {
2182
- this._clear();
2183
- // this.overlayRef.detach();
2184
- }
2185
- done() {
2186
- this._done();
2187
- this.overlayRef.detach();
2188
- }
2189
- backdropClick() {
2190
- this.done();
2191
- }
2192
- };
2193
- FilterDrawerComponent.ctorParameters = () => [
2194
- { type: ExternalParamsController },
2195
- { type: ChangeDetectorRef },
2196
- { type: FsFilterItemsStore },
2197
- { type: OverlayRef, decorators: [{ type: Inject, args: [FILTER_DRAWER_OVERLAY,] }] },
2198
- { type: undefined, decorators: [{ type: Inject, args: [FILTER_DRAWER_DATA,] }] }
2199
- ];
2200
- __decorate([
2201
- HostListener('window:resize'),
2202
- __metadata("design:type", Function),
2203
- __metadata("design:paramtypes", []),
2204
- __metadata("design:returntype", void 0)
2205
- ], FilterDrawerComponent.prototype, "updateWindowWidth", null);
2206
- __decorate([
2207
- Input(),
2208
- __metadata("design:type", Object)
2209
- ], FilterDrawerComponent.prototype, "inline", void 0);
2210
- FilterDrawerComponent = __decorate([
2211
- Component({
2212
- 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",
2213
- // Commented out because filter items are not updating with a delayed observable. Need to figure this out.
2214
- changeDetection: ChangeDetectionStrategy.OnPush,
2215
- 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}"]
2216
- }),
2217
- __param(3, Inject(FILTER_DRAWER_OVERLAY)),
2218
- __param(4, Inject(FILTER_DRAWER_DATA)),
2219
- __metadata("design:paramtypes", [ExternalParamsController,
2220
- ChangeDetectorRef,
2221
- FsFilterItemsStore,
2222
- OverlayRef, Object])
2223
- ], FilterDrawerComponent);
2224
-
2225
- const FS_FILTER_META = new InjectionToken('fs.filter.meta', {
2226
- providedIn: 'root',
2227
- factory: () => {
2228
- return {
2229
- openedFilters: 0,
2230
- };
2231
- }
2232
- });
2233
-
2234
- let FsFilterOverlayService = class FsFilterOverlayService {
2235
- constructor(_injector, _filterMeta, _overlay) {
2236
- this._injector = _injector;
2237
- this._filterMeta = _filterMeta;
2238
- this._overlay = _overlay;
2239
- this.detach$ = new Subject();
2240
- this.attach$ = new Subject();
2241
2160
  this._destroy$ = new Subject();
2161
+ this._debouncer$ = new Subject();
2162
+ this._kvDiffer = this._kvDiffers.find(this.item || {}).create();
2163
+ this.listenWithDebounce();
2242
2164
  }
2243
- get isOpened() {
2244
- return !!this._overlayRef;
2245
- }
2246
- setClearFn(fn) {
2247
- this._clearFn = fn;
2165
+ set item(value) {
2166
+ this._item = value;
2248
2167
  }
2249
- setDoneFn(fn) {
2250
- this._doneFn = fn;
2168
+ ;
2169
+ get item() {
2170
+ return this._item;
2251
2171
  }
2252
- close() {
2253
- if (this._overlayRef) {
2254
- this._overlayRef.detach();
2255
- this._overlayRef = null;
2256
- this.removeFilterClass();
2172
+ ngDoCheck() {
2173
+ if (this._kvDiffer) {
2174
+ const changes = this._kvDiffer.diff(this.item);
2175
+ if (changes) {
2176
+ this._cd.detectChanges();
2177
+ }
2257
2178
  }
2258
2179
  }
2259
- open() {
2260
- this._overlayRef = this._createOverlay();
2261
- this._overlayRef.backdropClick()
2262
- .pipe(takeUntil(this._destroy$))
2263
- .subscribe(() => {
2264
- this._overlayRef.detach();
2265
- });
2266
- this._overlayRef.detachments()
2267
- .pipe(takeUntil(this._destroy$))
2268
- .subscribe(() => {
2269
- this.detach$.next();
2270
- });
2271
- this._overlayRef.attachments()
2272
- .pipe(takeUntil(this._destroy$))
2273
- .subscribe(() => {
2274
- this.attach$.next();
2275
- });
2276
- this.addFilterClass();
2277
- return this.openPortalPreview();
2278
- }
2279
2180
  ngOnDestroy() {
2280
2181
  this._destroy$.next();
2281
2182
  this._destroy$.complete();
2282
2183
  }
2283
- _createOverlay() {
2284
- const overlayConfig = new OverlayConfig({
2285
- hasBackdrop: true,
2286
- backdropClass: 'fs-filter-backdrop'
2184
+ listenWithDebounce() {
2185
+ this._debouncer$
2186
+ .pipe(debounceTime(150), takeUntil(this._destroy$))
2187
+ .subscribe(() => {
2188
+ this.item.valueChanged();
2287
2189
  });
2288
- return this._overlay.create(overlayConfig);
2289
- }
2290
- openPortalPreview() {
2291
- const data = { done: this._doneFn, clear: this._clearFn };
2292
- const injector = this._createInjector(this._injector, data, this._overlayRef);
2293
- const containerPortal = new ComponentPortal(FilterDrawerComponent, undefined, injector);
2294
- const containerRef = this._overlayRef.attach(containerPortal);
2295
- return containerRef.instance;
2296
- }
2297
- _createInjector(parentInjector, data, overlayRef) {
2298
- const injectionTokens = new WeakMap([
2299
- [FILTER_DRAWER_DATA, data],
2300
- [FILTER_DRAWER_OVERLAY, overlayRef],
2301
- ]);
2302
- return new PortalInjector(parentInjector, injectionTokens);
2303
- }
2304
- removeFilterClass() {
2305
- this._filterMeta.openedFilters--;
2306
- if (this._filterMeta.openedFilters === 0) {
2307
- window.document.body.classList.remove('fs-filter-open');
2308
- }
2309
2190
  }
2310
- addFilterClass() {
2311
- this._filterMeta.openedFilters++;
2312
- if (this._filterMeta.openedFilters === 1) {
2313
- window.document.body.classList.add('fs-filter-open');
2314
- }
2191
+ itemChange() {
2192
+ this._debouncer$.next();
2315
2193
  }
2316
- };
2317
- FsFilterOverlayService.ctorParameters = () => [
2318
- { type: Injector },
2319
- { type: undefined, decorators: [{ type: Inject, args: [FS_FILTER_META,] }] },
2320
- { type: Overlay }
2321
- ];
2322
- FsFilterOverlayService = __decorate([
2323
- Injectable(),
2324
- __param(1, Inject(FS_FILTER_META)),
2325
- __metadata("design:paramtypes", [Injector, Object, Overlay])
2326
- ], FsFilterOverlayService);
2327
-
2328
- let FilterStatusBarDirective = class FilterStatusBarDirective {
2329
- };
2330
- FilterStatusBarDirective = __decorate([
2331
- Directive({
2332
- selector: '[fsFilterStatusBar]',
2333
- })
2334
- ], 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
+ }] } });
2335
2209
 
2336
- let FocusControllerService = class FocusControllerService {
2337
- constructor(_filterOverlay) {
2338
- this._filterOverlay = _filterOverlay;
2210
+ class FocusControllerService {
2211
+ constructor() {
2339
2212
  this._focusOn = new BehaviorSubject(null);
2340
2213
  }
2341
2214
  get focusOn$() {
2342
2215
  return this._focusOn.asObservable();
2343
2216
  }
2344
2217
  click(item, type = null) {
2345
- if (!this._filterOverlay.isOpened) {
2346
- this._filterOverlay.open();
2347
- }
2348
2218
  this._focusOn.next({ item, type });
2349
2219
  }
2350
2220
  listenFocusFor$(targetItem, targetType = null) {
@@ -2356,1810 +2226,1928 @@ let FocusControllerService = class FocusControllerService {
2356
2226
  clearFocus() {
2357
2227
  this._focusOn.next(null);
2358
2228
  }
2359
- };
2360
- FocusControllerService.ctorParameters = () => [
2361
- { type: FsFilterOverlayService }
2362
- ];
2363
- FocusControllerService = __decorate([
2364
- Injectable(),
2365
- __metadata("design:paramtypes", [FsFilterOverlayService])
2366
- ], FocusControllerService);
2367
-
2368
- var ActionType;
2369
- (function (ActionType) {
2370
- ActionType["Basic"] = "basic";
2371
- ActionType["Raised"] = "raised";
2372
- ActionType["Icon"] = "icon";
2373
- ActionType["Fab"] = "fab";
2374
- ActionType["MiniFab"] = "mini-fab";
2375
- })(ActionType || (ActionType = {}));
2376
-
2377
- var ActionMode;
2378
- (function (ActionMode) {
2379
- ActionMode["Button"] = "button";
2380
- ActionMode["Menu"] = "menu";
2381
- ActionMode["File"] = "file";
2382
- })(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 []; } });
2383
2235
 
2384
- class ActionMenuItem {
2385
- constructor(config = {}, _parent) {
2386
- this._parent = _parent;
2387
- this.items = [];
2388
- this._isGroup = false;
2389
- this._visible$ = new BehaviorSubject(true);
2390
- this._disabled$ = new BehaviorSubject(false);
2391
- this._init(config);
2392
- }
2393
- get isGroup() {
2394
- return this._isGroup;
2395
- }
2396
- get visible() {
2397
- return this._visible$.getValue();
2398
- }
2399
- get visible$() {
2400
- return this._visible$.asObservable();
2401
- }
2402
- set disabled(value) {
2403
- this._disabled$.next(value);
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();
2404
2248
  }
2405
- get disabled() {
2406
- return this._disabled$.getValue();
2249
+ ngOnInit() {
2250
+ this._focusController
2251
+ .listenFocusFor$(this._item, this._focusTargetType)
2252
+ .pipe(delay(500), takeUntil(this._destroy$))
2253
+ .subscribe(() => {
2254
+ this._focus();
2255
+ });
2407
2256
  }
2408
- get disabled$() {
2409
- return this._disabled$.asObservable();
2257
+ ngOnDestroy() {
2258
+ this._destroy$.next();
2259
+ this._destroy$.complete();
2410
2260
  }
2411
- updateVisibility() {
2412
- const visible = !!this._showFn ? this._showFn() : true;
2413
- if (!visible || !this.isGroup) {
2414
- this._visible$.next(visible);
2415
- return;
2416
- }
2417
- const numberOfVisibleChildren = this.items
2418
- .reduce((acc, item) => {
2419
- item.updateVisibility();
2420
- if (item.visible) {
2421
- acc++;
2422
- }
2423
- return acc;
2424
- }, 0);
2425
- this._visible$.next(!!numberOfVisibleChildren);
2426
- }
2427
- _init(config) {
2428
- this.label = config.label;
2429
- this.icon = config.icon;
2430
- this._showFn = config.show;
2431
- if ('items' in config) {
2432
- this._isGroup = true;
2433
- if (Array.isArray(config.items)) {
2434
- this.items = config
2435
- .items
2436
- .map((item) => new ActionMenuItem(item, this));
2437
- }
2438
- this.updateVisibility();
2439
- }
2440
- else {
2441
- this.click = config.click;
2442
- this.routerLink = config.link;
2443
- if (!this._parent) {
2444
- this.updateVisibility();
2445
- }
2446
- }
2447
- }
2448
- }
2449
-
2450
- class Action {
2451
- constructor(config = {}) {
2452
- this.primary = true;
2453
- this.isReorderAction = false;
2454
- this.classArray = [];
2455
- this.items = [];
2456
- this._visible$ = new BehaviorSubject(true);
2457
- this._disabled$ = new BehaviorSubject(false);
2458
- this._init(config);
2459
- }
2460
- get visible() {
2461
- return this._visible$.getValue();
2462
- }
2463
- get visible$() {
2464
- return this._visible$.asObservable();
2465
- }
2466
- set disabled(value) {
2467
- this._disabled$.next(value);
2468
- }
2469
- get disabled() {
2470
- return this._disabled$.getValue();
2471
- }
2472
- get disabled$() {
2473
- return this._disabled$.asObservable();
2474
- }
2475
- updateVisibility() {
2476
- const visible = !!this._showFn ? this._showFn() : true;
2477
- if (!visible || this.mode !== ActionMode.Menu) {
2478
- this._visible$.next(visible);
2479
- return;
2480
- }
2481
- const hasVisibleChildren = this.items.some((item) => item.visible);
2482
- this._visible$.next(hasVisibleChildren);
2483
- }
2484
- updateDisabledState() {
2485
- if (this._disabledFn) {
2486
- this.disabled = this._disabledFn();
2487
- }
2488
- }
2489
- _init(config) {
2490
- var _a, _b, _c, _d, _e, _f;
2491
- config.mode = (_a = config.mode) !== null && _a !== void 0 ? _a : ActionMode.Button;
2492
- this.primary = (_b = config.primary) !== null && _b !== void 0 ? _b : true;
2493
- this.color = config.color;
2494
- this.type = (_c = config.type) !== null && _c !== void 0 ? _c : ActionType.Raised;
2495
- this.label = config.label;
2496
- this.mode = config.mode;
2497
- this.icon = config.icon;
2498
- this.iconPlacement = config.iconPlacement;
2499
- this._showFn = config.show;
2500
- this.tabIndex = (_d = config.tabIndex) !== null && _d !== void 0 ? _d : 0;
2501
- if (config.multiple !== undefined) {
2502
- this.multiple = config.multiple;
2503
- }
2504
- if (config.className) {
2505
- this.className = config.className;
2506
- this.classArray = this.className
2507
- .split(' ');
2508
- }
2509
- if (this.primary) {
2510
- this.color = 'primary';
2511
- }
2512
- switch (config.mode) {
2513
- case ActionMode.Button:
2261
+ _focus() {
2262
+ switch (this._item.type) {
2263
+ case ItemType.Select:
2514
2264
  {
2515
- this.menu = config.menu;
2516
- this.customize = config.customize;
2517
- this.click = (_e = config.click) !== null && _e !== void 0 ? _e : (() => { });
2518
- this._disabledFn = config.disabled;
2519
- this.updateDisabledState();
2265
+ this._targetSelect.open();
2520
2266
  }
2521
2267
  break;
2522
- case ActionMode.Menu:
2268
+ case ItemType.Text:
2269
+ case ItemType.Range:
2523
2270
  {
2524
- if (config.items && Array.isArray(config.items)) {
2525
- this.items = config.items.map((item) => new ActionMenuItem(item));
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();
2526
2281
  }
2527
2282
  }
2528
2283
  break;
2529
- case ActionMode.File:
2284
+ case ItemType.DateRange:
2530
2285
  {
2531
- this.fileSelected = config.select;
2532
- this.fileError = config.error;
2533
- this.accept = config.accept;
2534
- this.imageQuality = config.imageQuality;
2535
- this.minWidth = config.minWidth;
2536
- this.minHeight = config.minHeight;
2537
- this.maxWidth = config.maxWidth;
2538
- this.maxHeight = config.maxHeight;
2539
- this.click = (_f = config.click) !== null && _f !== void 0 ? _f : (() => { });
2540
- this._disabledFn = config.disabled;
2541
- this.updateDisabledState();
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();
2542
2302
  }
2543
2303
  break;
2544
2304
  }
2545
- this.updateVisibility();
2546
2305
  }
2547
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
+ }] } });
2548
2349
 
2549
- let ActionsController = class ActionsController {
2550
- constructor(_breakpointObserver) {
2551
- this._breakpointObserver = _breakpointObserver;
2552
- this._visible$ = new BehaviorSubject(false);
2553
- this._actions$ = new BehaviorSubject([]);
2554
- this._menuActions$ = new BehaviorSubject([]);
2555
- this._destroy$ = new Subject();
2556
- this._mobileMedia = '(max-width: 799px)';
2557
- this._allActions = [];
2558
- this._listenMobileMedia();
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();
2559
2357
  }
2560
- get menuActions() {
2561
- return this._menuActions$.value;
2358
+ ngOnInit() {
2359
+ this._listenControlValueChanges();
2360
+ this._listenModelChanges();
2562
2361
  }
2563
- get actions() {
2564
- return this._actions$.value;
2362
+ ngOnDestroy() {
2363
+ this.destroy$.next();
2364
+ this.destroy$.complete();
2565
2365
  }
2566
- get actions$() {
2567
- return this._actions$.asObservable();
2366
+ _listenControlValueChanges() {
2367
+ this.textControl.valueChanges
2368
+ .pipe(distinctUntilChanged(), debounceTime(200), takeUntil(this.destroy$))
2369
+ .subscribe((value) => {
2370
+ this.item.model = value;
2371
+ });
2568
2372
  }
2569
- get menuActions$() {
2570
- return this._menuActions$.asObservable();
2373
+ _listenModelChanges() {
2374
+ this._item.value$
2375
+ .pipe(takeUntil(this.destroy$))
2376
+ .subscribe(() => {
2377
+ this.textControl.setValue(this.item.model, { emitEvent: false });
2378
+ });
2571
2379
  }
2572
- get visible$() {
2573
- return this._visible$.asObservable();
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;
2397
+ }
2398
+ else {
2399
+ return values.filter((value) => {
2400
+ return value.value !== isolate.value;
2401
+ });
2402
+ }
2574
2403
  }
2575
- get mobileMode() {
2576
- return this._breakpointObserver.isMatched(this._mobileMedia);
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
+ }] });
2413
+
2414
+ class SelectMultipleComponent {
2415
+ constructor(cd) {
2416
+ this.cd = cd;
2577
2417
  }
2578
- ngOnDestroy() {
2579
- this._destroy$.next();
2580
- this._destroy$.complete();
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
+ }
2581
2428
  }
2582
- initActions(rawActions) {
2583
- if (!rawActions || !Array.isArray(rawActions)) {
2584
- return;
2429
+ close() {
2430
+ this.select.close();
2431
+ }
2432
+ isolateChange(filter) {
2433
+ if (filter.isolate.enabled) {
2434
+ filter.model = filter.multiple ? [filter.isolate.value] : filter.isolate.value;
2585
2435
  }
2586
- this.show();
2587
- this._allActions = rawActions
2588
- .map((action) => new Action(action));
2589
- if (this._reorderAction) {
2590
- this._allActions.unshift(this._reorderAction);
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
+ }
2591
2443
  }
2592
- this._classifyActions();
2593
2444
  }
2594
- show() {
2595
- this._visible$.next(true);
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;
2596
2466
  }
2597
- hide() {
2598
- this._visible$.next(false);
2467
+ changed() {
2468
+ if (this.item.isolate) {
2469
+ this.item.isolate.enabled = false;
2470
+ }
2599
2471
  }
2600
- addReorderAction(action) {
2601
- this._allActions.unshift(action);
2602
- action.isReorderAction = true;
2603
- this._classifyAction(action);
2604
- this._reorderAction = action;
2605
- }
2606
- clearActions() {
2607
- this._allActions = [];
2608
- this._setActions([]);
2609
- this._setKebabActions([]);
2610
- }
2611
- updateActionsVisibility() {
2612
- this._allActions.forEach((action) => action.updateVisibility());
2613
- this._classifyActions();
2472
+ isolateChange(filter) {
2473
+ if (filter.isolate.enabled) {
2474
+ filter.model = filter.isolate.value;
2475
+ }
2476
+ else {
2477
+ filter.model = null;
2478
+ }
2614
2479
  }
2615
- updateDisabledState() {
2616
- this.actions.forEach((action) => action.updateDisabledState());
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
+ }] } });
2497
+
2498
+ class SelectGroupsComponent {
2499
+ constructor(cd) {
2500
+ this.cd = cd;
2617
2501
  }
2618
- _setKebabActions(actions) {
2619
- this._menuActions$.next(actions);
2502
+ compare(o1, o2) {
2503
+ return o1 == o2;
2620
2504
  }
2621
- _setActions(actions) {
2622
- this._actions$.next(actions);
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;
2623
2530
  }
2624
- _classifyActions() {
2625
- const kebabActions = [];
2626
- const actions = [];
2627
- const mobileMode = this.mobileMode;
2628
- this._allActions
2629
- .filter((action) => {
2630
- return action.visible;
2631
- })
2632
- .forEach((action) => {
2633
- if (action.menu || mobileMode) {
2634
- kebabActions.push(action);
2635
- }
2636
- else {
2637
- actions.push(action);
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
+ }
2638
2539
  }
2639
- });
2640
- this._setKebabActions(kebabActions);
2641
- this._setActions(actions);
2642
- }
2643
- _classifyAction(action) {
2644
- if (action.menu) {
2645
- this._setKebabActions([...this.menuActions, action]);
2646
2540
  }
2647
- else {
2648
- this._setActions([...this.actions, action]);
2649
- }
2650
- }
2651
- _listenMobileMedia() {
2652
- this._breakpointObserver.observe(this._mobileMedia)
2653
- .pipe(skip(1), takeUntil(this._destroy$))
2654
- .subscribe(() => {
2655
- this._classifyActions();
2656
- });
2657
2541
  }
2658
- };
2659
- ActionsController.ctorParameters = () => [
2660
- { type: BreakpointObserver }
2661
- ];
2662
- ActionsController = __decorate([
2663
- Injectable(),
2664
- __metadata("design:paramtypes", [BreakpointObserver])
2665
- ], ActionsController);
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
+ }] } });
2666
2556
 
2667
- let FilterComponent = class FilterComponent {
2668
- constructor(_filterOverlay, _zone, _externalParams, _filterItems, _actions, _defaultConfig) {
2669
- this._filterOverlay = _filterOverlay;
2670
- this._zone = _zone;
2671
- this._externalParams = _externalParams;
2672
- this._filterItems = _filterItems;
2673
- this._actions = _actions;
2674
- this._defaultConfig = _defaultConfig;
2675
- this.showSortBy = true;
2676
- this.showFilterInput = true;
2677
- this.closed = new EventEmitter();
2678
- this.opened = new EventEmitter();
2679
- this.ready = new EventEmitter();
2680
- this.showFilterMenu = false;
2681
- this.windowDesktop = false;
2682
- this.fsFilterClass = true;
2683
- this.searchText = new FormControl();
2684
- this.searchPlaceholder = 'Search';
2685
- this._config = null;
2686
- this._filtersBtnVisible$ = new BehaviorSubject(true);
2687
- this._keywordVisible$ = new BehaviorSubject(true);
2688
- this._hasFilterChips$ = new BehaviorSubject(false);
2689
- this._destroy$ = new Subject();
2690
- this._listenWhenFilterReady();
2691
- this._updateWindowWidth();
2692
- this._filterOverlay.attach$
2693
- .pipe(takeUntil(this._destroy$))
2694
- .subscribe(() => {
2695
- this.showFilterMenu = true;
2696
- });
2697
- this._filterOverlay.detach$
2698
- .pipe(takeUntil(this._destroy$))
2699
- .subscribe(() => {
2700
- this.showFilterMenu = false;
2701
- });
2702
- this._listenWindowResize();
2703
- }
2704
- set setConfig(config) {
2705
- this._initFilterWithConfig(config);
2557
+ class ChipsComponent extends BaseItemComponent {
2558
+ constructor(_kvDiffers, _cd) {
2559
+ super(_kvDiffers, _cd);
2560
+ this._kvDiffers = _kvDiffers;
2561
+ this._cd = _cd;
2706
2562
  }
2707
- set setFilter(config) {
2708
- this._initFilterWithConfig(config);
2563
+ modelChange() {
2564
+ this.itemChange();
2709
2565
  }
2710
- get config() {
2711
- return this._config;
2566
+ compareFn(modelValue, chipValue) {
2567
+ return modelValue.value === chipValue.value;
2712
2568
  }
2713
- get filterParams() {
2714
- return this._filterItems.values();
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;
2715
2587
  }
2716
- get filterParamsQuery() {
2717
- return this._filterItems.valuesAsQuery();
2588
+ ngOnInit() {
2589
+ this.listenChanges();
2718
2590
  }
2719
- get items() {
2720
- return this._filterItems.items;
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
+ });
2721
2601
  }
2722
- get visibleItems() {
2723
- return this._filterItems.visibleItems;
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
+ };
2724
2632
  }
2725
- get itemsReady$() {
2726
- return this._filterItems.ready$;
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
+ };
2727
2653
  }
2728
- get hasFilterChips$() {
2729
- return this._hasFilterChips$.asObservable();
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();
2730
2660
  }
2731
- get hasVisibleItemOrSorting() {
2732
- return this.visibleItems.length > 0 || !!this._filterItems.sortByItem;
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
+ }
2733
2666
  }
2734
- get hasKeyword() {
2735
- return this._filterItems.hasKeyword;
2667
+ removeAutocompleteChipItem(event) {
2668
+ remove(this.item.model, { value: event.data.value });
2669
+ this.itemChange();
2736
2670
  }
2737
- get filtersBtnVisible$() {
2738
- return this._filtersBtnVisible$.asObservable();
2671
+ clearAutocompleteChipItem() {
2672
+ this.item.clear();
2673
+ this.itemChange();
2739
2674
  }
2740
- get keywordVisible$() {
2741
- return this._keywordVisible$.asObservable();
2675
+ compareItems(item1, item2) {
2676
+ return (item1 === null || item1 === void 0 ? void 0 : item1.value) === (item2 === null || item2 === void 0 ? void 0 : item2.value);
2742
2677
  }
2743
- get actionsVisible$() {
2744
- return this._actions.visible$;
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;
2745
2700
  }
2746
- get actions$() {
2747
- return this._actions.actions$;
2701
+ ngOnInit() {
2702
+ if (this.item.type === ItemType.DateTime) {
2703
+ this.viewType = 'datetime';
2704
+ }
2705
+ else {
2706
+ this.viewType = 'date';
2707
+ }
2708
+ if (this.item.mode === ItemDateMode.ScrollMonthYear) {
2709
+ this.showDay = false;
2710
+ }
2748
2711
  }
2749
- get menuActions$() {
2750
- return this._actions.menuActions$;
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';
2751
2730
  }
2752
2731
  ngOnInit() {
2753
- // Avoid ngChanges error
2754
- setTimeout(() => {
2755
- if (this.config.autofocus) {
2756
- this.focus();
2757
- }
2758
- });
2759
- this._listenInternalItemsChange();
2760
- this._initOverlay();
2732
+ if (this.item.type === ItemType.DateTimeRange) {
2733
+ this.viewType = 'datetime';
2734
+ }
2735
+ else {
2736
+ this.viewType = 'date';
2737
+ }
2761
2738
  }
2762
- ngAfterViewInit() {
2763
- this._listenInputKeyEvents();
2764
- // FIXME prevent fire change after init
2765
- setTimeout(() => {
2766
- this._listenInputChanges();
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 }]; } });
2750
+
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;
2773
+ this._destroy$ = new Subject();
2774
+ this.itemType = ItemType;
2775
+ }
2776
+ ngOnInit() {
2777
+ this.item.value$
2778
+ .pipe(takeUntil(this._destroy$))
2779
+ .subscribe(() => {
2780
+ this._cdRef.markForCheck();
2767
2781
  });
2768
2782
  }
2769
2783
  ngOnDestroy() {
2770
- this._destroyFilterDrawer();
2771
2784
  this._destroy$.next();
2772
2785
  this._destroy$.complete();
2773
2786
  }
2774
- focus() {
2775
- if (this.searchTextMatInput) {
2776
- this.searchTextMatInput.focus();
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();
2806
+ }
2807
+ get savedFilters() {
2808
+ return this.externalParams.savedFiltersController;
2809
+ }
2810
+ done() {
2811
+ this._done.emit();
2812
+ }
2813
+ clear() {
2814
+ this._clear.emit();
2815
+ }
2816
+ saveFilters() {
2817
+ this.externalParams
2818
+ .savedFiltersController
2819
+ .openSavedFilterEditDialog();
2820
+ }
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();
2851
+ }
2852
+ updateWindowWidth() {
2853
+ this.windowDesktop = window.innerWidth > 1200;
2854
+ }
2855
+ get items$() {
2856
+ return this._itemsStore.visibleItems$;
2857
+ }
2858
+ get sortItem() {
2859
+ return this._itemsStore.sortByItem;
2860
+ }
2861
+ get sortDirectionItem() {
2862
+ return this._itemsStore.sortDirectionItem;
2863
+ }
2864
+ clear() {
2865
+ this._clear();
2866
+ // this.overlayRef.detach();
2867
+ }
2868
+ done() {
2869
+ this._done();
2870
+ this.overlayRef.detach();
2871
+ }
2872
+ backdropClick() {
2873
+ this.done();
2874
+ }
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
+ };
2905
+ }
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();
2918
+ }
2919
+ get isOpened() {
2920
+ return !!this._overlayRef;
2921
+ }
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();
2777
2933
  }
2778
2934
  }
2779
- updateSort(sort) {
2780
- this._filterItems.updateSort(sort);
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();
2951
+ });
2952
+ this.addFilterClass();
2953
+ return this.openPortalPreview();
2781
2954
  }
2782
- /**
2783
- *
2784
- * Do update value of some field
2785
- *
2786
- * @param values - values for update
2787
- *
2788
- * To update text value just pass new text value
2789
- *
2790
- * public updateSelectValue(val) {
2791
- * this.filterEl.updateValues({ keyword: val });
2792
- * }
2793
- *
2794
- * To update select or observable select you could pass suitable value
2795
- *
2796
- * public updateSelectValue(val: number) {
2797
- * this.filterEl.updateValues({ simple_select: val }, { observable_select: val });
2798
- * }
2799
- *
2800
- * To update checkbox value just pass true/false as value
2801
- *
2802
- * public updateCheckox(val: boolean) {
2803
- * this.filterEl.updateValues({ checkbox: val });
2804
- * }
2805
- *
2806
- * To update range value just pass object with min&max object or just with one of targets
2807
- *
2808
- * Ex.: { min: 10, max 15 }, { min: 5 }, { max 5 }
2809
- *
2810
- * public updateRange(val) {
2811
- * this.filterEl.updateValues({ range: val });
2812
- * }
2813
- *
2814
- * To update autocomplete just pass object with name/value fields
2815
- *
2816
- * Ex.: { name: 'John Doe', value: 1 }
2817
- *
2818
- * public updateAutocomplete(val) {
2819
- * this.filterEl.updateValues({ autocomplete_user_id: val });
2820
- * }
2821
- *
2822
- * To update autocompletechips just pass:
2823
- *
2824
- * 1) object with name/value fields - will be appended to existing set of values
2825
- *
2826
- * { name: 'John Doe', value: 1 }
2827
- *
2828
- * 2) array of objects - will be appended to existing set of values
2829
- *
2830
- * [{ name: 'John Doe', value: 1 }, { name: 'Darya Filipova', value: 2 }]
2831
- *
2832
- * 3) null - clear existing set of values
2833
- *
2834
- * public updateAutocomplete(val) {
2835
- * this.filterEl.updateValues({ autocompletechips_user_id: val });
2836
- * }
2837
- *
2838
- */
2839
- updateValues(values) {
2840
- Object.keys(values).forEach((key) => {
2841
- const filterItem = this.items
2842
- .find((item) => item.name === key);
2843
- if (!filterItem) {
2844
- return;
2955
+ ngOnDestroy() {
2956
+ this._destroy$.next();
2957
+ this._destroy$.complete();
2958
+ }
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');
2984
+ }
2985
+ }
2986
+ addFilterClass() {
2987
+ this._filterMeta.openedFilters++;
2988
+ if (this._filterMeta.openedFilters === 1) {
2989
+ window.document.body.classList.add('fs-filter-open');
2990
+ }
2991
+ }
2992
+ _openWhenChipClicked() {
2993
+ this._focusController.focusOn$
2994
+ .pipe(filter$1((v) => !!v), takeUntil(this._destroy$))
2995
+ .subscribe(() => {
2996
+ if (!this.isOpened) {
2997
+ this.open();
2845
2998
  }
2846
- filterItem.model = values[key];
2847
2999
  });
2848
3000
  }
2849
- hide() {
2850
- 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);
3046
+ }
3047
+ get isGroup() {
3048
+ return this._isGroup;
2851
3049
  }
2852
- show() {
2853
- this.changeVisibility(true);
3050
+ get visible() {
3051
+ return this._visible$.getValue();
2854
3052
  }
2855
- changeVisibilityClick(value, event = null) {
2856
- if (event) {
2857
- event.stopPropagation();
2858
- }
2859
- this.changeVisibility(value);
3053
+ get visible$() {
3054
+ return this._visible$.asObservable();
2860
3055
  }
2861
- filterInputEvent(event) {
2862
- if (!this.windowDesktop) {
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);
2863
3069
  return;
2864
3070
  }
2865
- if (['Enter', 'NumpadEnter', 'Escape'].indexOf(event.code) >= 0) {
2866
- this.changeVisibility(false);
2867
- if (this.searchTextInput) {
2868
- this.searchTextInput.nativeElement.blur();
3071
+ const numberOfVisibleChildren = this.items
3072
+ .reduce((acc, item) => {
3073
+ item.updateVisibility();
3074
+ if (item.visible) {
3075
+ acc++;
2869
3076
  }
2870
- }
3077
+ return acc;
3078
+ }, 0);
3079
+ this._visible$.next(!!numberOfVisibleChildren);
2871
3080
  }
2872
- getItemValue(name) {
2873
- const item = this.items
2874
- .find((item) => item.name === name);
2875
- if (item) {
2876
- 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();
2877
3093
  }
2878
3094
  else {
2879
- return null;
3095
+ this.click = config.click;
3096
+ this.routerLink = config.link;
3097
+ if (!this._parent) {
3098
+ this.updateVisibility();
3099
+ }
2880
3100
  }
2881
3101
  }
2882
- showItem(name) {
2883
- const item = this.getItem(name);
2884
- if (item) {
2885
- item.hide = false;
2886
- this._filterItems.updateVisibleItems();
2887
- }
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);
2888
3113
  }
2889
- hideItem(name) {
2890
- const item = this.getItem(name);
2891
- if (!item) {
2892
- return;
2893
- }
2894
- item.hide = true;
2895
- this._filterItems.updateVisibleItems();
3114
+ get visible() {
3115
+ return this._visible$.getValue();
2896
3116
  }
2897
- clearItem(name) {
2898
- const item = this.getItem(name);
2899
- if (!item) {
2900
- return;
2901
- }
2902
- item.clear();
3117
+ get visible$() {
3118
+ return this._visible$.asObservable();
2903
3119
  }
2904
- updateItemConfig(name, params) {
2905
- var _a, _b;
2906
- const item = this.getItem(name);
2907
- if (!item) {
2908
- return;
2909
- }
2910
- item.label = (_a = params.label) !== null && _a !== void 0 ? _a : item.label;
2911
- item.chipLabel = (_b = params.chipLabel) !== null && _b !== void 0 ? _b : item.chipLabel;
2912
- this._filterItems.updateVisibleItems();
3120
+ set disabled(value) {
3121
+ this._disabled$.next(value);
2913
3122
  }
2914
- getItemValueChange$(name) {
2915
- const item = this.items.find((i) => i.name === name);
2916
- if (item) {
2917
- return item.value$
2918
- .pipe(map(() => {
2919
- return item.model;
2920
- }));
2921
- }
2922
- else {
2923
- return null;
2924
- }
3123
+ get disabled() {
3124
+ return this._disabled$.getValue();
2925
3125
  }
2926
- changeVisibility(state) {
2927
- if (state === this.showFilterMenu) {
2928
- return;
2929
- }
2930
- if (!state) {
2931
- this.closed.emit();
2932
- return this._destroyFilterDrawer();
2933
- }
2934
- if (!this.hasVisibleItemOrSorting) {
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);
2935
3133
  return;
2936
3134
  }
2937
- this._listenEscButton();
2938
- this.opened.emit();
2939
- this._filterOverlay.open();
2940
- }
2941
- clearSearchText(event) {
2942
- event.stopPropagation();
2943
- this._filterItems.keywordItem.clear();
2944
- this.searchTextInput.nativeElement.focus();
2945
- }
2946
- init() {
2947
- const data = this._filterItems.valuesAsQuery();
2948
- this._sort = this._filterItems.getSort();
2949
- this.config.init(data, this._sort);
2950
- this._updateChipsVisibility();
3135
+ const hasVisibleChildren = this.items.some((item) => item.visible);
3136
+ this._visible$.next(hasVisibleChildren);
2951
3137
  }
2952
- clear(event = null) {
2953
- if (event) {
2954
- event.stopPropagation();
2955
- }
2956
- this._filterItems.filtersClear();
2957
- if (this.config.clear) {
2958
- this.config.clear();
3138
+ updateDisabledState() {
3139
+ if (this._disabledFn) {
3140
+ this.disabled = this._disabledFn();
2959
3141
  }
2960
3142
  }
2961
- /**
2962
- * Close filter window and do change callback
2963
- */
2964
- search(event) {
2965
- this.changeVisibilityClick(false, event);
2966
- }
2967
- reload(event = null) {
2968
- if (event) {
2969
- event.preventDefault();
2970
- event.stopPropagation();
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;
2971
3157
  }
2972
- const data = this._filterItems.valuesAsQuery();
2973
- if (this.config.reload) {
2974
- this.config.reload(data, this._filterItems.getSort());
3158
+ if (config.className) {
3159
+ this.className = config.className;
3160
+ this.classArray = this.className
3161
+ .split(' ');
2975
3162
  }
2976
- }
2977
- getItem(name) {
2978
- return this.items
2979
- .find((item) => item.name === name);
2980
- }
2981
- /**
2982
- * Call change callback and apply new filter values
2983
- */
2984
- change() {
2985
- const data = this._filterItems.valuesAsQuery();
2986
- const sort = this._filterItems.getSort();
2987
- const sortingChanged = ((!sort || !this._sort) && sort !== this._sort)
2988
- || (sort && this._sort && !objectsAreEquals(this._sort, sort));
2989
- if (sortingChanged) {
2990
- this._sort = sort;
2991
- if (this.config.sortChange) {
2992
- this.config.sortChange(data, sort);
2993
- }
3163
+ if (this.primary) {
3164
+ this.color = 'primary';
2994
3165
  }
2995
- if (this.config.change) {
2996
- this.config.change(data, sort);
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;
2997
3198
  }
2998
- this._updateChipsVisibility();
3199
+ this.updateVisibility();
2999
3200
  }
3000
- /**
3001
- * Update filter actions config
3002
- * @param actions
3003
- */
3004
- updateActions(actions) {
3005
- this._actions.initActions(actions);
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();
3006
3213
  }
3007
- /**
3008
- * Show "Filters" button
3009
- */
3010
- showFiltersBtn() {
3011
- this._filtersBtnVisible$.next(true);
3214
+ get menuActions() {
3215
+ return this._menuActions$.value;
3012
3216
  }
3013
- /**
3014
- * Hide "Filters" button
3015
- */
3016
- hideFiltersBtn() {
3017
- this._filtersBtnVisible$.next(false);
3217
+ get actions() {
3218
+ return this._actions$.value;
3018
3219
  }
3019
- /**
3020
- * Show "Keyword" field if it present
3021
- */
3022
- showKeywordField() {
3023
- this._keywordVisible$.next(true);
3220
+ get actions$() {
3221
+ return this._actions$.asObservable();
3024
3222
  }
3025
- /**
3026
- * Hide "Keyword" field if it present
3027
- */
3028
- hideKeywordField() {
3029
- this._keywordVisible$.next(false);
3223
+ get menuActions$() {
3224
+ return this._menuActions$.asObservable();
3030
3225
  }
3031
- /**
3032
- * Go through actions and check show() callback and update visible actions
3033
- */
3034
- updateActionsVisibility() {
3035
- this._actions.updateActionsVisibility();
3226
+ get visible$() {
3227
+ return this._visible$.asObservable();
3036
3228
  }
3037
- /**
3038
- * Go through actions and check disabled() callback and update disabled state
3039
- */
3040
- updateDisabledState() {
3041
- this._actions.updateDisabledState();
3229
+ get mobileMode() {
3230
+ return this._breakpointObserver.isMatched(this._mobileMedia);
3042
3231
  }
3043
- _initFilterWithConfig(config) {
3044
- if (this.config) {
3045
- this._filterItems.destroyItems();
3046
- }
3047
- config = Object.assign(Object.assign({}, (this._defaultConfig || {})), config);
3048
- this._config = new FsFilterConfig(config);
3049
- this._actions.initActions(this._config.actions);
3050
- this._filterItems.setConfig(this._config);
3051
- this._externalParams.setConfig(this._config);
3052
- const keywordItem = this._filterItems.keywordItem;
3053
- if (keywordItem) {
3054
- this.searchText.setValue(keywordItem.model);
3055
- this.searchPlaceholder = keywordItem.label || 'Search';
3232
+ ngOnDestroy() {
3233
+ this._destroy$.next();
3234
+ this._destroy$.complete();
3235
+ }
3236
+ initActions(rawActions) {
3237
+ if (!rawActions || !Array.isArray(rawActions)) {
3238
+ return;
3056
3239
  }
3057
- if (!!this.config.reloadWhenConfigChanged) {
3058
- this.change();
3240
+ this.show();
3241
+ this._allActions = rawActions
3242
+ .map((action) => new Action(action));
3243
+ if (this._reorderAction) {
3244
+ this._allActions.unshift(this._reorderAction);
3059
3245
  }
3060
- this._listenKeywordItemClear();
3061
- }
3062
- _destroyFilterDrawer() {
3063
- this._filterOverlay.close();
3246
+ this._classifyActions();
3064
3247
  }
3065
- _updateWindowWidth() {
3066
- this.windowDesktop = window.innerWidth > 1200;
3248
+ show() {
3249
+ this._visible$.next(true);
3067
3250
  }
3068
- _listenEscButton() {
3069
- this._zone.runOutsideAngular(() => {
3070
- fromEvent(window, 'keyup')
3071
- .pipe(filter$1((event) => event.code === 'Escape'), takeUntil(this.closed), takeUntil(this._destroy$))
3072
- .subscribe(() => {
3073
- this._zone.run(() => {
3074
- this.changeVisibility(false);
3075
- });
3076
- });
3077
- });
3251
+ hide() {
3252
+ this._visible$.next(false);
3078
3253
  }
3079
- _listenInputKeyEvents() {
3080
- if (!this.searchTextInput) {
3081
- return;
3082
- }
3083
- this._zone.runOutsideAngular(() => {
3084
- fromEvent(this.searchTextInput.nativeElement, 'keydown')
3085
- .pipe(debounceTime(500), filter$1((event) => {
3086
- return ['Enter', 'NumpadEnter', 'Escape'].indexOf(event.code) > -1;
3087
- }), takeUntil(this._destroy$))
3088
- .subscribe((event) => {
3089
- this._zone.run(() => {
3090
- this.filterInputEvent(event);
3091
- });
3092
- });
3093
- });
3254
+ addReorderAction(action) {
3255
+ this._allActions.unshift(action);
3256
+ action.isReorderAction = true;
3257
+ this._classifyAction(action);
3258
+ this._reorderAction = action;
3094
3259
  }
3095
- _listenWindowResize() {
3096
- this._zone.runOutsideAngular(() => {
3097
- fromEvent(window, 'resize')
3098
- .pipe(debounceTime(100), takeUntil(this._destroy$))
3099
- .subscribe(() => {
3100
- this._zone.run(() => {
3101
- this._updateWindowWidth();
3102
- });
3103
- });
3104
- });
3260
+ clearActions() {
3261
+ this._allActions = [];
3262
+ this._setActions([]);
3263
+ this._setKebabActions([]);
3105
3264
  }
3106
- _listenInputChanges() {
3107
- if (!this._filterItems.keywordItem) {
3108
- return;
3109
- }
3110
- this._zone.runOutsideAngular(() => {
3111
- this.searchText.valueChanges
3112
- .pipe(debounceTime(200), distinctUntilChanged(), filter$1((value) => {
3113
- var _a;
3114
- return value !== ((_a = this._filterItems.keywordItem) === null || _a === void 0 ? void 0 : _a.model);
3115
- }), takeUntil(this._destroy$))
3116
- .subscribe((value) => {
3117
- this._zone.run(() => {
3118
- const keywordItem = this._filterItems.keywordItem;
3119
- if (keywordItem && keywordItem.value !== value) {
3120
- keywordItem.model = value;
3121
- }
3122
- });
3123
- });
3124
- });
3265
+ updateActionsVisibility() {
3266
+ this._allActions.forEach((action) => action.updateVisibility());
3267
+ this._classifyActions();
3125
3268
  }
3126
- _listenKeywordItemClear() {
3127
- var _a;
3128
- (_a = this._filterItems
3129
- .keywordItem) === null || _a === void 0 ? void 0 : _a.clear$.pipe(takeUntil(this._filterItems.keywordItem.destroy$), takeUntil(this._destroy$)).subscribe(() => {
3130
- this.searchText.setValue('');
3131
- });
3269
+ updateDisabledState() {
3270
+ this.actions.forEach((action) => action.updateDisabledState());
3132
3271
  }
3133
- _listenInternalItemsChange() {
3134
- this._filterItems
3135
- .itemsChange$
3136
- .pipe(takeUntil(this._destroy$))
3137
- .subscribe(() => {
3138
- this.change();
3139
- });
3272
+ _setKebabActions(actions) {
3273
+ this._menuActions$.next(actions);
3140
3274
  }
3141
- _initOverlay() {
3142
- this._filterOverlay.setClearFn(this.clear.bind(this));
3143
- this._filterOverlay.setDoneFn(this.hide.bind(this));
3275
+ _setActions(actions) {
3276
+ this._actions$.next(actions);
3144
3277
  }
3145
- // We may need some time to recieve external params and after that ready can be emitted
3146
- _listenWhenFilterReady() {
3147
- combineLatest([
3148
- this._externalParams.pending$,
3149
- this.itemsReady$,
3150
- ])
3151
- .pipe(filter$1(([pendingParams, itemsReady]) => !pendingParams && itemsReady), takeUntil(this._destroy$))
3152
- .subscribe(() => {
3153
- if (this.config.init) {
3154
- this.init();
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);
3155
3292
  }
3156
- this.ready.emit();
3157
- });
3158
- }
3159
- _updateChipsVisibility() {
3160
- const hasFilterChips = this._filterItems.items
3161
- .some((item) => {
3162
- return item.isChipVisible;
3163
3293
  });
3164
- this._hasFilterChips$.next(hasFilterChips);
3294
+ this._setKebabActions(kebabActions);
3295
+ this._setActions(actions);
3165
3296
  }
3166
- };
3167
- FilterComponent.ctorParameters = () => [
3168
- { type: FsFilterOverlayService },
3169
- { type: NgZone },
3170
- { type: ExternalParamsController },
3171
- { type: FsFilterItemsStore },
3172
- { type: ActionsController },
3173
- { type: FsFilterConfig, decorators: [{ type: Optional }, { type: Inject, args: [FS_FILTER_CONFIG,] }] }
3174
- ];
3175
- __decorate([
3176
- Input('config'),
3177
- __metadata("design:type", Object),
3178
- __metadata("design:paramtypes", [Object])
3179
- ], FilterComponent.prototype, "setConfig", null);
3180
- __decorate([
3181
- Input('filter'),
3182
- __metadata("design:type", Object),
3183
- __metadata("design:paramtypes", [Object])
3184
- ], FilterComponent.prototype, "setFilter", null);
3185
- __decorate([
3186
- Input(),
3187
- __metadata("design:type", Object)
3188
- ], FilterComponent.prototype, "showSortBy", void 0);
3189
- __decorate([
3190
- Input(),
3191
- __metadata("design:type", Object)
3192
- ], FilterComponent.prototype, "showFilterInput", void 0);
3193
- __decorate([
3194
- Output(),
3195
- __metadata("design:type", Object)
3196
- ], FilterComponent.prototype, "closed", void 0);
3197
- __decorate([
3198
- Output(),
3199
- __metadata("design:type", Object)
3200
- ], FilterComponent.prototype, "opened", void 0);
3201
- __decorate([
3202
- Output(),
3203
- __metadata("design:type", Object)
3204
- ], FilterComponent.prototype, "ready", void 0);
3205
- __decorate([
3206
- ContentChild(FilterStatusBarDirective, { read: TemplateRef }),
3207
- __metadata("design:type", Object)
3208
- ], FilterComponent.prototype, "statusBar", void 0);
3209
- __decorate([
3210
- ViewChild('searchTextInput'),
3211
- __metadata("design:type", ElementRef)
3212
- ], FilterComponent.prototype, "searchTextInput", void 0);
3213
- __decorate([
3214
- ViewChild('searchTextInput', { read: MatInput }),
3215
- __metadata("design:type", MatInput)
3216
- ], FilterComponent.prototype, "searchTextMatInput", void 0);
3217
- __decorate([
3218
- HostBinding('class.filters-open'),
3219
- __metadata("design:type", Object)
3220
- ], FilterComponent.prototype, "showFilterMenu", void 0);
3221
- __decorate([
3222
- HostBinding('class.window-desktop'),
3223
- __metadata("design:type", Object)
3224
- ], FilterComponent.prototype, "windowDesktop", void 0);
3225
- __decorate([
3226
- HostBinding('class.fs-filter'),
3227
- __metadata("design:type", Object)
3228
- ], FilterComponent.prototype, "fsFilterClass", void 0);
3229
- FilterComponent = __decorate([
3230
- Component({
3231
- selector: 'fs-filter',
3232
- 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",
3233
- encapsulation: ViewEncapsulation.None,
3234
- providers: [
3235
- FsFilterOverlayService,
3236
- ExternalParamsController,
3237
- PersistanceParamsController,
3238
- QueryParamsController,
3239
- FocusControllerService,
3240
- FsFilterItemsStore,
3241
- SavedFiltersController,
3242
- ActionsController,
3243
- ],
3244
- changeDetection: ChangeDetectionStrategy.OnPush,
3245
- 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}"]
3246
- }),
3247
- __param(5, Optional()), __param(5, Inject(FS_FILTER_CONFIG)),
3248
- __metadata("design:paramtypes", [FsFilterOverlayService,
3249
- NgZone,
3250
- ExternalParamsController,
3251
- FsFilterItemsStore,
3252
- ActionsController,
3253
- FsFilterConfig])
3254
- ], FilterComponent);
3297
+ _classifyAction(action) {
3298
+ if (action.menu) {
3299
+ this._setKebabActions([...this.menuActions, action]);
3300
+ }
3301
+ else {
3302
+ this._setActions([...this.actions, action]);
3303
+ }
3304
+ }
3305
+ _listenMobileMedia() {
3306
+ this._breakpointObserver.observe(this._mobileMedia)
3307
+ .pipe(skip(1), takeUntil(this._destroy$))
3308
+ .subscribe(() => {
3309
+ this._classifyActions();
3310
+ });
3311
+ }
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 = [];
3357
+ }
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
+ }] } });
3255
3376
 
3256
- let FilterItemComponent = class FilterItemComponent {
3377
+ class FsFilterChipContentComponent {
3257
3378
  constructor(_cdRef) {
3258
3379
  this._cdRef = _cdRef;
3259
3380
  this._destroy$ = new Subject();
3260
- this.itemType = ItemType;
3261
3381
  }
3262
3382
  ngOnInit() {
3383
+ this.listenValueChangesForRanges();
3384
+ }
3385
+ ngOnDestroy() {
3386
+ this._destroy$.next();
3387
+ this._destroy$.complete();
3388
+ }
3389
+ listenValueChangesForRanges() {
3263
3390
  this.item.value$
3264
3391
  .pipe(takeUntil(this._destroy$))
3265
3392
  .subscribe(() => {
3266
- this._cdRef.markForCheck();
3393
+ this.content = this._getContent();
3394
+ this._cdRef.detectChanges();
3267
3395
  });
3268
3396
  }
3269
- ngOnDestroy() {
3270
- this._destroy$.next();
3271
- this._destroy$.complete();
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
+ }
3272
3427
  }
3273
- };
3274
- FilterItemComponent.ctorParameters = () => [
3275
- { type: ChangeDetectorRef }
3276
- ];
3277
- __decorate([
3278
- Input(),
3279
- __metadata("design:type", BaseItem)
3280
- ], FilterItemComponent.prototype, "item", void 0);
3281
- FilterItemComponent = __decorate([
3282
- Component({
3283
- selector: 'filter-item',
3284
- 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",
3285
- changeDetection: ChangeDetectionStrategy.OnPush
3286
- }),
3287
- __metadata("design:paramtypes", [ChangeDetectorRef])
3288
- ], FilterItemComponent);
3289
-
3290
- let BaseItemComponent = class BaseItemComponent {
3291
- constructor(_kvDiffers, _cd) {
3292
- this._kvDiffers = _kvDiffers;
3293
- this._cd = _cd;
3294
- this.inline = false;
3295
- this._destroy$ = new Subject();
3296
- this._debouncer$ = new Subject();
3297
- this._kvDiffer = this._kvDiffers.find(this.item || {}).create();
3298
- this.listenWithDebounce();
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]}`;
3299
3447
  }
3300
- set item(value) {
3301
- this._item = value;
3448
+ else if (type === 'to' && labelArr[1]) {
3449
+ return `${labelArr[1]}`;
3302
3450
  }
3303
- ;
3304
- get item() {
3305
- return this._item;
3451
+ else {
3452
+ return '';
3306
3453
  }
3307
- ngDoCheck() {
3308
- if (this._kvDiffer) {
3309
- const changes = this._kvDiffer.diff(this.item);
3310
- if (changes) {
3311
- this._cd.detectChanges();
3312
- }
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();
3313
3479
  }
3314
3480
  }
3315
3481
  ngOnDestroy() {
3316
3482
  this._destroy$.next();
3317
3483
  this._destroy$.complete();
3318
3484
  }
3319
- listenWithDebounce() {
3320
- this._debouncer$
3321
- .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$))
3322
3502
  .subscribe(() => {
3323
- this.item.valueChanged();
3503
+ this._updateVisibility();
3504
+ this._cdRef.markForCheck();
3324
3505
  });
3325
3506
  }
3326
- itemChange() {
3327
- this._debouncer$.next();
3328
- }
3329
- };
3330
- BaseItemComponent.ctorParameters = () => [
3331
- { type: KeyValueDiffers },
3332
- { type: ChangeDetectorRef }
3333
- ];
3334
- __decorate([
3335
- Input(),
3336
- __metadata("design:type", Object),
3337
- __metadata("design:paramtypes", [Object])
3338
- ], BaseItemComponent.prototype, "item", null);
3339
- __decorate([
3340
- Input(),
3341
- __metadata("design:type", Object)
3342
- ], BaseItemComponent.prototype, "inline", void 0);
3343
- BaseItemComponent = __decorate([
3344
- Component({
3345
- selector: 'base-item',
3346
- template: '',
3347
- changeDetection: ChangeDetectionStrategy.OnPush
3348
- }),
3349
- __metadata("design:paramtypes", [KeyValueDiffers,
3350
- ChangeDetectorRef])
3351
- ], BaseItemComponent);
3352
-
3353
- let SelectComponent = class SelectComponent extends BaseItemComponent {
3354
- constructor(_kvDiffers, _cd) {
3355
- super(_kvDiffers, _cd);
3356
- this._kvDiffers = _kvDiffers;
3357
- this._cd = _cd;
3358
- // For case when we have multiple selection with __all option
3359
- // If _all has been selected than we must disable all other items
3360
- this.allItemsOptionSelected = false;
3507
+ _updateVisibility() {
3508
+ this.itemVisible = this.item.isChipVisible;
3361
3509
  }
3362
- ngDoCheck() {
3363
- if (this._kvDiffer) {
3364
- const changes = this._kvDiffer.diff(this.item);
3365
- if (changes) {
3366
- this._cd.markForCheck();
3367
- if (this.selectedItem) {
3368
- this.selectedItem.cd.markForCheck();
3369
- }
3370
- }
3371
- }
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
+ }));
3372
3518
  }
3373
- };
3374
- SelectComponent.ctorParameters = () => [
3375
- { type: KeyValueDiffers },
3376
- { type: ChangeDetectorRef }
3377
- ];
3378
- __decorate([
3379
- ViewChild('selectItem'),
3380
- __metadata("design:type", Object)
3381
- ], SelectComponent.prototype, "selectedItem", void 0);
3382
- SelectComponent = __decorate([
3383
- Component({
3384
- selector: 'filter-item-select',
3385
- 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",
3386
- changeDetection: ChangeDetectionStrategy.OnPush
3387
- }),
3388
- __metadata("design:paramtypes", [KeyValueDiffers,
3389
- ChangeDetectorRef])
3390
- ], 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
+ }] } });
3391
3533
 
3392
- let SelectGroupsComponent = class SelectGroupsComponent {
3393
- constructor(cd) {
3394
- this.cd = cd;
3395
- }
3396
- compare(o1, o2) {
3397
- return o1 == o2;
3534
+ class FsFilterChipsComponent {
3535
+ constructor() {
3536
+ this.chips = [];
3398
3537
  }
3399
- };
3400
- SelectGroupsComponent.ctorParameters = () => [
3401
- { type: ChangeDetectorRef }
3402
- ];
3403
- __decorate([
3404
- ViewChild('select', { static: true }),
3405
- __metadata("design:type", MatSelect)
3406
- ], SelectGroupsComponent.prototype, "select", void 0);
3407
- __decorate([
3408
- Input(),
3409
- __metadata("design:type", Object)
3410
- ], SelectGroupsComponent.prototype, "item", void 0);
3411
- SelectGroupsComponent = __decorate([
3412
- Component({
3413
- selector: 'filter-item-select-groups',
3414
- 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",
3415
- changeDetection: ChangeDetectionStrategy.OnPush
3416
- }),
3417
- __metadata("design:paramtypes", [ChangeDetectorRef])
3418
- ], 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
+ }] } });
3419
3552
 
3420
- let SelectSimpleComponent = class SelectSimpleComponent {
3421
- constructor(cd) {
3422
- 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();
3423
3589
  }
3424
- changed() {
3425
- if (this.item.isolate) {
3426
- this.item.isolate.enabled = false;
3427
- }
3590
+ set setConfig(config) {
3591
+ this._initFilterWithConfig(config);
3428
3592
  }
3429
- isolateChange(filter) {
3430
- if (filter.isolate.enabled) {
3431
- filter.model = filter.isolate.value;
3432
- }
3433
- else {
3434
- filter.model = null;
3435
- }
3593
+ set setFilter(config) {
3594
+ this._initFilterWithConfig(config);
3436
3595
  }
3437
- };
3438
- SelectSimpleComponent.ctorParameters = () => [
3439
- { type: ChangeDetectorRef }
3440
- ];
3441
- __decorate([
3442
- Input(),
3443
- __metadata("design:type", SimpleSelectItem)
3444
- ], SelectSimpleComponent.prototype, "item", void 0);
3445
- __decorate([
3446
- ViewChild('select', { static: true }),
3447
- __metadata("design:type", MatSelect)
3448
- ], SelectSimpleComponent.prototype, "select", void 0);
3449
- SelectSimpleComponent = __decorate([
3450
- Component({
3451
- selector: 'filter-item-select-simple',
3452
- 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",
3453
- changeDetection: ChangeDetectionStrategy.OnPush,
3454
- styles: [".isolate{margin-bottom:25px}"]
3455
- }),
3456
- __metadata("design:paramtypes", [ChangeDetectorRef])
3457
- ], SelectSimpleComponent);
3458
-
3459
- let SelectMultipleComponent = class SelectMultipleComponent {
3460
- constructor(cd) {
3461
- this.cd = cd;
3596
+ get config() {
3597
+ return this._config;
3462
3598
  }
3463
- changed() {
3464
- if (this.item.isolate) {
3465
- this.item.isolate.enabled = false;
3466
- if (this.item.multiple && Array.isArray(this.item.model)) {
3467
- const index = this.item.model.indexOf(this.item.isolate.value);
3468
- if (index > -1) {
3469
- this.item.model.splice(index, 1);
3470
- }
3471
- }
3472
- }
3599
+ get filterParams() {
3600
+ return this._filterItems.values();
3473
3601
  }
3474
- close() {
3475
- this.select.close();
3602
+ get filterParamsQuery() {
3603
+ return this._filterItems.valuesAsQuery();
3476
3604
  }
3477
- isolateChange(filter) {
3478
- if (filter.isolate.enabled) {
3479
- filter.model = filter.multiple ? [filter.isolate.value] : filter.isolate.value;
3480
- }
3481
- else {
3482
- if (filter.multiple) {
3483
- filter.model = filter.defaultValue ? filter.defaultValue : [];
3484
- }
3485
- else {
3486
- filter.model = filter.defaultValue ? filter.defaultValue : null;
3487
- }
3488
- }
3605
+ get items() {
3606
+ return this._filterItems.items;
3489
3607
  }
3490
- };
3491
- SelectMultipleComponent.ctorParameters = () => [
3492
- { type: ChangeDetectorRef }
3493
- ];
3494
- __decorate([
3495
- Input(),
3496
- __metadata("design:type", Object)
3497
- ], SelectMultipleComponent.prototype, "item", void 0);
3498
- __decorate([
3499
- ViewChild('select', { static: true }),
3500
- __metadata("design:type", MatSelect)
3501
- ], SelectMultipleComponent.prototype, "select", void 0);
3502
- SelectMultipleComponent = __decorate([
3503
- Component({
3504
- selector: 'filter-item-select-multiple',
3505
- 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",
3506
- changeDetection: ChangeDetectionStrategy.OnPush,
3507
- styles: [".isolate{margin-bottom:25px}"]
3508
- }),
3509
- __metadata("design:paramtypes", [ChangeDetectorRef])
3510
- ], SelectMultipleComponent);
3511
-
3512
- let ChipsComponent = class ChipsComponent extends BaseItemComponent {
3513
- constructor(_kvDiffers, _cd) {
3514
- super(_kvDiffers, _cd);
3515
- this._kvDiffers = _kvDiffers;
3516
- this._cd = _cd;
3608
+ get visibleItems() {
3609
+ return this._filterItems.visibleItems;
3517
3610
  }
3518
- modelChange() {
3519
- this.itemChange();
3611
+ get itemsReady$() {
3612
+ return this._filterItems.ready$;
3520
3613
  }
3521
- compareFn(modelValue, chipValue) {
3522
- return modelValue.value === chipValue.value;
3614
+ get hasFilterChips$() {
3615
+ return this._hasFilterChips$.asObservable();
3523
3616
  }
3524
- };
3525
- ChipsComponent.ctorParameters = () => [
3526
- { type: KeyValueDiffers },
3527
- { type: ChangeDetectorRef }
3528
- ];
3529
- ChipsComponent = __decorate([
3530
- Component({
3531
- selector: 'filter-item-chips',
3532
- 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",
3533
- changeDetection: ChangeDetectionStrategy.OnPush,
3534
- styles: ["fs-chip{line-height:40px}"]
3535
- }),
3536
- __metadata("design:paramtypes", [KeyValueDiffers,
3537
- ChangeDetectorRef])
3538
- ], ChipsComponent);
3539
-
3540
- let TextComponent = class TextComponent extends BaseItemComponent {
3541
- constructor(_kvDiffers, _cd) {
3542
- super(_kvDiffers, _cd);
3543
- this._kvDiffers = _kvDiffers;
3544
- this._cd = _cd;
3545
- this.textControl = new FormControl();
3546
- this.destroy$ = new Subject();
3617
+ get hasVisibleItemOrSorting() {
3618
+ return this.visibleItems.length > 0 || !!this._filterItems.sortByItem;
3547
3619
  }
3548
- ngOnInit() {
3549
- this._listenControlValueChanges();
3550
- this._listenModelChanges();
3620
+ get hasKeyword() {
3621
+ return this._filterItems.hasKeyword;
3551
3622
  }
3552
- ngOnDestroy() {
3553
- this.destroy$.next();
3554
- this.destroy$.complete();
3623
+ get filtersBtnVisible$() {
3624
+ return this._filtersBtnVisible$.asObservable();
3555
3625
  }
3556
- _listenControlValueChanges() {
3557
- this.textControl.valueChanges
3558
- .pipe(distinctUntilChanged(), debounceTime(200), takeUntil(this.destroy$))
3559
- .subscribe((value) => {
3560
- this.item.model = value;
3561
- });
3626
+ get keywordVisible$() {
3627
+ return this._keywordVisible$.asObservable();
3562
3628
  }
3563
- _listenModelChanges() {
3564
- this._item.value$
3565
- .pipe(takeUntil(this.destroy$))
3566
- .subscribe(() => {
3567
- this.textControl.setValue(this.item.model, { emitEvent: false });
3568
- });
3629
+ get actionsVisible$() {
3630
+ return this._actions.visible$;
3569
3631
  }
3570
- };
3571
- TextComponent.ctorParameters = () => [
3572
- { type: KeyValueDiffers },
3573
- { type: ChangeDetectorRef }
3574
- ];
3575
- TextComponent = __decorate([
3576
- Component({
3577
- selector: 'filter-item-text',
3578
- 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",
3579
- changeDetection: ChangeDetectionStrategy.OnPush,
3580
- styles: [""]
3581
- }),
3582
- __metadata("design:paramtypes", [KeyValueDiffers,
3583
- ChangeDetectorRef])
3584
- ], TextComponent);
3585
-
3586
- let RangeComponent = class RangeComponent extends BaseItemComponent {
3587
- constructor(_kvDiffers, _cd) {
3588
- super(_kvDiffers, _cd);
3589
- this._kvDiffers = _kvDiffers;
3590
- this._cd = _cd;
3632
+ get actions$() {
3633
+ return this._actions.actions$;
3634
+ }
3635
+ get menuActions$() {
3636
+ return this._actions.menuActions$;
3591
3637
  }
3592
3638
  ngOnInit() {
3593
- this.listenChanges();
3639
+ // Avoid ngChanges error
3640
+ setTimeout(() => {
3641
+ if (this.config.autofocus) {
3642
+ this.focus();
3643
+ }
3644
+ });
3645
+ this._listenInternalItemsChange();
3646
+ this._initOverlay();
3594
3647
  }
3595
- listenChanges() {
3596
- const fromListener = fromEvent(this.from.nativeElement, 'keyup')
3597
- .pipe(distinctUntilChanged());
3598
- const toListener = fromEvent(this.to.nativeElement, 'keyup')
3599
- .pipe(distinctUntilChanged());
3600
- merge(fromListener, toListener)
3601
- .pipe(takeUntil(this._destroy$))
3602
- .subscribe(() => {
3603
- this.itemChange();
3648
+ ngAfterViewInit() {
3649
+ this._listenInputKeyEvents();
3650
+ // FIXME prevent fire change after init
3651
+ setTimeout(() => {
3652
+ this._listenInputChanges();
3604
3653
  });
3605
3654
  }
3606
- };
3607
- RangeComponent.ctorParameters = () => [
3608
- { type: KeyValueDiffers },
3609
- { type: ChangeDetectorRef }
3610
- ];
3611
- __decorate([
3612
- ViewChild('from', { static: true }),
3613
- __metadata("design:type", ElementRef)
3614
- ], RangeComponent.prototype, "from", void 0);
3615
- __decorate([
3616
- ViewChild('to', { static: true }),
3617
- __metadata("design:type", Object)
3618
- ], RangeComponent.prototype, "to", void 0);
3619
- RangeComponent = __decorate([
3620
- Component({
3621
- selector: 'filter-item-range',
3622
- 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",
3623
- changeDetection: ChangeDetectionStrategy.OnPush,
3624
- 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}"]
3625
- }),
3626
- __metadata("design:paramtypes", [KeyValueDiffers,
3627
- ChangeDetectorRef])
3628
- ], RangeComponent);
3629
-
3630
- let AutocompleteComponent = class AutocompleteComponent extends BaseItemComponent {
3631
- constructor(_kvDiffers, _cd) {
3632
- super(_kvDiffers, _cd);
3633
- this._kvDiffers = _kvDiffers;
3634
- this._cd = _cd;
3635
- this.displayWith = (data) => {
3636
- return data ? data.name : data;
3637
- };
3638
- this.fetch = (keyword) => {
3639
- return this.item.valuesFn(keyword);
3640
- };
3655
+ ngOnDestroy() {
3656
+ this._destroyFilterDrawer();
3657
+ this._destroy$.next();
3658
+ this._destroy$.complete();
3641
3659
  }
3642
- };
3643
- AutocompleteComponent.ctorParameters = () => [
3644
- { type: KeyValueDiffers },
3645
- { type: ChangeDetectorRef }
3646
- ];
3647
- AutocompleteComponent = __decorate([
3648
- Component({
3649
- selector: 'filter-item-autocomplete',
3650
- 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",
3651
- changeDetection: ChangeDetectionStrategy.OnPush
3652
- }),
3653
- __metadata("design:paramtypes", [KeyValueDiffers,
3654
- ChangeDetectorRef])
3655
- ], AutocompleteComponent);
3656
-
3657
- let AutocompletechipsComponent = class AutocompletechipsComponent extends BaseItemComponent {
3658
- constructor(_kvDiffers, _cd) {
3659
- super(_kvDiffers, _cd);
3660
- this._kvDiffers = _kvDiffers;
3661
- this._cd = _cd;
3662
- this.fetch = (keyword) => {
3663
- return this.item.valuesFn(keyword);
3664
- };
3660
+ focus() {
3661
+ if (this.searchTextMatInput) {
3662
+ this.searchTextMatInput.focus();
3663
+ }
3665
3664
  }
3666
- // SP-T1747
3667
- clicked() {
3668
- this.chipBackground = this.item.chipBackground;
3669
- this.chipColor = this.item.chipColor;
3670
- this.chipIcon = this.item.chipIcon;
3671
- this._cd.markForCheck();
3665
+ updateSort(sort) {
3666
+ this._filterItems.updateSort(sort);
3672
3667
  }
3673
- addAutocompleteChipItem(event) {
3674
- if (event.data && this.item.model.indexOf(event.data.value) === -1) {
3675
- this.item.model.push(event.data);
3676
- this.itemChange();
3677
- }
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
+ });
3678
3734
  }
3679
- removeAutocompleteChipItem(event) {
3680
- remove(this.item.model, { value: event.data.value });
3681
- this.itemChange();
3735
+ hide() {
3736
+ this.changeVisibility(false);
3682
3737
  }
3683
- clearAutocompleteChipItem() {
3684
- this.item.clear();
3685
- this.itemChange();
3738
+ show() {
3739
+ this.changeVisibility(true);
3686
3740
  }
3687
- compareItems(item1, item2) {
3688
- 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);
3689
3746
  }
3690
- };
3691
- AutocompletechipsComponent.ctorParameters = () => [
3692
- { type: KeyValueDiffers },
3693
- { type: ChangeDetectorRef }
3694
- ];
3695
- AutocompletechipsComponent = __decorate([
3696
- Component({
3697
- selector: 'filter-item-autocompletechips',
3698
- 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",
3699
- changeDetection: ChangeDetectionStrategy.OnPush
3700
- }),
3701
- __metadata("design:paramtypes", [KeyValueDiffers,
3702
- ChangeDetectorRef])
3703
- ], AutocompletechipsComponent);
3704
-
3705
- let DateComponent = class DateComponent extends BaseItemComponent {
3706
- constructor(_kvDiffers, _cd) {
3707
- super(_kvDiffers, _cd);
3708
- this._kvDiffers = _kvDiffers;
3709
- this._cd = _cd;
3710
- this.viewType = 'date';
3711
- this.itemDateMode = ItemDateMode;
3712
- this.showYear = true;
3713
- this.showMonth = true;
3714
- 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
+ }
3715
3757
  }
3716
- ngOnInit() {
3717
- if (this.item.type === ItemType.DateTime) {
3718
- this.viewType = 'datetime';
3758
+ getItemValue(name) {
3759
+ const item = this.items
3760
+ .find((item) => item.name === name);
3761
+ if (item) {
3762
+ return item.model;
3719
3763
  }
3720
3764
  else {
3721
- this.viewType = 'date';
3765
+ return null;
3722
3766
  }
3723
- if (this.item.mode === ItemDateMode.ScrollMonthYear) {
3724
- this.showDay = false;
3767
+ }
3768
+ showItem(name) {
3769
+ const item = this.getItem(name);
3770
+ if (item) {
3771
+ item.hide = false;
3772
+ this._filterItems.updateVisibleItems();
3725
3773
  }
3726
3774
  }
3727
- };
3728
- DateComponent.ctorParameters = () => [
3729
- { type: KeyValueDiffers },
3730
- { type: ChangeDetectorRef }
3731
- ];
3732
- DateComponent = __decorate([
3733
- Component({
3734
- selector: 'filter-item-date',
3735
- 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",
3736
- changeDetection: ChangeDetectionStrategy.OnPush
3737
- }),
3738
- __metadata("design:paramtypes", [KeyValueDiffers,
3739
- ChangeDetectorRef])
3740
- ], DateComponent);
3741
-
3742
- let DateRangeComponent = class DateRangeComponent extends BaseItemComponent {
3743
- constructor(_kvDiffers, _cd) {
3744
- super(_kvDiffers, _cd);
3745
- this._kvDiffers = _kvDiffers;
3746
- this._cd = _cd;
3747
- this.viewType = 'date';
3775
+ hideItem(name) {
3776
+ const item = this.getItem(name);
3777
+ if (!item) {
3778
+ return;
3779
+ }
3780
+ item.hide = true;
3781
+ this._filterItems.updateVisibleItems();
3748
3782
  }
3749
- ngOnInit() {
3750
- if (this.item.type === ItemType.DateTimeRange) {
3751
- this.viewType = 'datetime';
3783
+ clearItem(name) {
3784
+ const item = this.getItem(name);
3785
+ if (!item) {
3786
+ return;
3787
+ }
3788
+ item.clear();
3789
+ }
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();
3799
+ }
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
+ }));
3752
3807
  }
3753
3808
  else {
3754
- this.viewType = 'date';
3809
+ return null;
3755
3810
  }
3756
3811
  }
3757
- };
3758
- DateRangeComponent.ctorParameters = () => [
3759
- { type: KeyValueDiffers },
3760
- { type: ChangeDetectorRef }
3761
- ];
3762
- DateRangeComponent = __decorate([
3763
- Component({
3764
- selector: 'filter-item-date-range',
3765
- 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",
3766
- changeDetection: ChangeDetectionStrategy.OnPush
3767
- }),
3768
- __metadata("design:paramtypes", [KeyValueDiffers,
3769
- ChangeDetectorRef])
3770
- ], DateRangeComponent);
3771
-
3772
- let CheckboxComponent = class CheckboxComponent extends BaseItemComponent {
3773
- constructor(_kvDiffers, _cd) {
3774
- super(_kvDiffers, _cd);
3775
- this._kvDiffers = _kvDiffers;
3776
- 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();
3777
3826
  }
3778
- };
3779
- CheckboxComponent.ctorParameters = () => [
3780
- { type: KeyValueDiffers },
3781
- { type: ChangeDetectorRef }
3782
- ];
3783
- CheckboxComponent = __decorate([
3784
- Component({
3785
- selector: 'filter-item-checkbox',
3786
- template: "<fs-label-field>\n <mat-checkbox [(ngModel)]=\"item.model\">\n {{ item.label }}\n </mat-checkbox>\n</fs-label-field>\n",
3787
- changeDetection: ChangeDetectionStrategy.OnPush,
3788
- styles: ["fs-label-field{margin:0}"]
3789
- }),
3790
- __metadata("design:paramtypes", [KeyValueDiffers,
3791
- ChangeDetectorRef])
3792
- ], CheckboxComponent);
3793
-
3794
- let FsFilterChipsComponent = class FsFilterChipsComponent {
3795
- constructor() {
3796
- this.chips = [];
3827
+ clearSearchText(event) {
3828
+ event.stopPropagation();
3829
+ this._filterItems.keywordItem.clear();
3830
+ this.searchTextInput.nativeElement.focus();
3797
3831
  }
3798
- };
3799
- __decorate([
3800
- Input(),
3801
- __metadata("design:type", Array)
3802
- ], FsFilterChipsComponent.prototype, "filters", void 0);
3803
- FsFilterChipsComponent = __decorate([
3804
- Component({
3805
- selector: 'fs-filter-chips',
3806
- 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",
3807
- changeDetection: ChangeDetectionStrategy.OnPush,
3808
- styles: [""]
3809
- })
3810
- ], FsFilterChipsComponent);
3811
-
3812
- let SelectBackdropComponent = class SelectBackdropComponent {
3813
- constructor() { }
3814
- };
3815
- SelectBackdropComponent = __decorate([
3816
- Component({
3817
- selector: 'filter-item-select-backdrop',
3818
- template: "",
3819
- changeDetection: ChangeDetectionStrategy.OnPush,
3820
- styles: [":host{position:absolute;top:0;bottom:0;right:0;z-index:1002;left:0}"]
3821
- }),
3822
- __metadata("design:paramtypes", [])
3823
- ], SelectBackdropComponent);
3824
-
3825
- let FsFilterChipComponent = class FsFilterChipComponent {
3826
- constructor(_cdRef, _focusController) {
3827
- this._cdRef = _cdRef;
3828
- this._focusController = _focusController;
3829
- this._chipRenderTimer$ = timer(500)
3830
- .pipe(mapTo(true));
3831
- 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();
3832
3837
  }
3833
- ngOnInit() {
3834
- this.rangeItem = this.item.isTypeDateRange
3835
- || this.item.isTypeRange
3836
- || this.item.isTypeDateTimeRange;
3837
- this.listenValueChangesForRanges();
3838
- this._updateVisibility();
3839
- if (this.item.hasPendingValues) {
3840
- this.item.loadAsyncValues(false);
3841
- this.item.values$
3842
- .pipe(take(2), takeUntil(this._destroy$))
3843
- .subscribe(() => {
3844
- this._updateVisibility();
3845
- this._cdRef.markForCheck();
3846
- });
3847
- 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();
3848
3845
  }
3849
3846
  }
3850
- ngOnDestroy() {
3851
- this._destroy$.next();
3852
- this._destroy$.complete();
3853
- }
3854
- focusOnItem(type = null) {
3855
- this._focusController.click(this.item, type);
3847
+ /**
3848
+ * Close filter window and do change callback
3849
+ */
3850
+ search(event) {
3851
+ this.changeVisibilityClick(false, event);
3856
3852
  }
3857
- removeItem(event, type = null) {
3858
- if (this.item instanceof RangeItem) {
3859
- this.item.clearRange(type);
3853
+ reload(event = null) {
3854
+ if (event) {
3855
+ event.preventDefault();
3856
+ event.stopPropagation();
3860
3857
  }
3861
- else if (this.item instanceof DateRangeItem || this.item instanceof DateTimeRangeItem) {
3862
- this.item.clearDateRange(type);
3858
+ const data = this._filterItems.valuesAsQuery();
3859
+ if (this.config.reload) {
3860
+ this.config.reload(data, this._filterItems.getSort());
3863
3861
  }
3864
- else {
3865
- 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
+ }
3881
+ if (this.config.change) {
3882
+ this.config.change(data, sort);
3866
3883
  }
3884
+ this._updateChipsVisibility();
3867
3885
  }
3868
- listenValueChangesForRanges() {
3869
- this.item.value$
3870
- .pipe(distinctUntilChanged(), takeUntil(this._destroy$))
3871
- .subscribe(() => {
3872
- this._updateVisibility();
3873
- this._cdRef.markForCheck();
3874
- });
3886
+ /**
3887
+ * Update filter actions config
3888
+ * @param actions
3889
+ */
3890
+ updateActions(actions) {
3891
+ this._actions.initActions(actions);
3875
3892
  }
3876
- _updateVisibility() {
3877
- this.itemVisible = this.item.isChipVisible;
3893
+ /**
3894
+ * Show "Filters" button
3895
+ */
3896
+ showFiltersBtn() {
3897
+ this._filtersBtnVisible$.next(true);
3878
3898
  }
3879
- _initDelayRender() {
3880
- this.chipDelayedRender$ = combineLatest([
3881
- this.item.values$,
3882
- this._chipRenderTimer$.pipe(startWith(false))
3883
- ])
3884
- .pipe(map(([values, timerValue]) => {
3885
- return !!values || timerValue;
3886
- }));
3899
+ /**
3900
+ * Hide "Filters" button
3901
+ */
3902
+ hideFiltersBtn() {
3903
+ this._filtersBtnVisible$.next(false);
3887
3904
  }
3888
- };
3889
- FsFilterChipComponent.ctorParameters = () => [
3890
- { type: ChangeDetectorRef },
3891
- { type: FocusControllerService }
3892
- ];
3893
- __decorate([
3894
- Input(),
3895
- __metadata("design:type", BaseItem)
3896
- ], FsFilterChipComponent.prototype, "item", void 0);
3897
- FsFilterChipComponent = __decorate([
3898
- Component({
3899
- selector: 'fs-filter-chip',
3900
- 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",
3901
- changeDetection: ChangeDetectionStrategy.OnPush,
3902
- styles: ["fs-chip{cursor:pointer;color:#6f6f6f}"]
3903
- }),
3904
- __metadata("design:paramtypes", [ChangeDetectorRef,
3905
- FocusControllerService])
3906
- ], FsFilterChipComponent);
3907
-
3908
- let FsFilterDrawerActionsComponent = class FsFilterDrawerActionsComponent {
3909
- constructor(externalParams) {
3910
- this.externalParams = externalParams;
3911
- this._clear = new EventEmitter();
3912
- this._done = new EventEmitter();
3905
+ /**
3906
+ * Show "Keyword" field if it present
3907
+ */
3908
+ showKeywordField() {
3909
+ this._keywordVisible$.next(true);
3913
3910
  }
3914
- get savedFilters() {
3915
- return this.externalParams.savedFiltersController;
3911
+ /**
3912
+ * Hide "Keyword" field if it present
3913
+ */
3914
+ hideKeywordField() {
3915
+ this._keywordVisible$.next(false);
3916
3916
  }
3917
- done() {
3918
- this._done.emit();
3917
+ /**
3918
+ * Go through actions and check show() callback and update visible actions
3919
+ */
3920
+ updateActionsVisibility() {
3921
+ this._actions.updateActionsVisibility();
3919
3922
  }
3920
- clear() {
3921
- this._clear.emit();
3923
+ /**
3924
+ * Go through actions and check disabled() callback and update disabled state
3925
+ */
3926
+ updateDisabledState() {
3927
+ this._actions.updateDisabledState();
3922
3928
  }
3923
- saveFilters() {
3924
- this.externalParams
3925
- .savedFiltersController
3926
- .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();
3927
3936
  }
3928
- };
3929
- FsFilterDrawerActionsComponent.ctorParameters = () => [
3930
- { type: ExternalParamsController }
3931
- ];
3932
- __decorate([
3933
- Output('clear'),
3934
- __metadata("design:type", Object)
3935
- ], FsFilterDrawerActionsComponent.prototype, "_clear", void 0);
3936
- __decorate([
3937
- Output('done'),
3938
- __metadata("design:type", Object)
3939
- ], FsFilterDrawerActionsComponent.prototype, "_done", void 0);
3940
- FsFilterDrawerActionsComponent = __decorate([
3941
- Component({
3942
- selector: 'fs-filter-drawer-actions',
3943
- 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"
3944
- }),
3945
- __metadata("design:paramtypes", [ExternalParamsController])
3946
- ], FsFilterDrawerActionsComponent);
3947
-
3948
- let FsFilterIsolateValues = class FsFilterIsolateValues {
3949
- transform(values, isolate) {
3950
- if (!isolate) {
3951
- return values;
3937
+ _initFilterWithConfig(config) {
3938
+ if (this.config) {
3939
+ this._filterItems.destroyItems();
3952
3940
  }
3953
- else {
3954
- return values.filter((value) => {
3955
- return value.value !== isolate.value;
3956
- });
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();
3957
3949
  }
3950
+ this._listenKeywordItemClear();
3958
3951
  }
3959
- };
3960
- FsFilterIsolateValues = __decorate([
3961
- Pipe({
3962
- name: 'fsFilterIsolateValues'
3963
- })
3964
- ], FsFilterIsolateValues);
3965
-
3966
- let FocusToItemDirective = class FocusToItemDirective {
3967
- constructor(_el, _focusController, _targetSelect, _targetDate, _targetDateScroll, _targetDateRangeFrom, _targetDateRangeTo, _targetAutocomplete, _targetAutocompleteChips) {
3968
- this._el = _el;
3969
- this._focusController = _focusController;
3970
- this._targetSelect = _targetSelect;
3971
- this._targetDate = _targetDate;
3972
- this._targetDateScroll = _targetDateScroll;
3973
- this._targetDateRangeFrom = _targetDateRangeFrom;
3974
- this._targetDateRangeTo = _targetDateRangeTo;
3975
- this._targetAutocomplete = _targetAutocomplete;
3976
- this._targetAutocompleteChips = _targetAutocompleteChips;
3977
- this._destroy$ = new Subject();
3952
+ _destroyFilterDrawer() {
3953
+ this._filterOverlay.close();
3978
3954
  }
3979
- ngOnInit() {
3980
- this._focusController
3981
- .listenFocusFor$(this._item, this._focusTargetType)
3982
- .pipe(delay(500), takeUntil(this._destroy$))
3983
- .subscribe(() => {
3984
- this._focus();
3985
- });
3955
+ _updateWindowWidth() {
3956
+ this.windowDesktop = window.innerWidth > 1200;
3986
3957
  }
3987
- ngOnDestroy() {
3988
- this._destroy$.next();
3989
- 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
+ });
3990
3968
  }
3991
- _focus() {
3992
- switch (this._item.type) {
3993
- case ItemType.Select:
3994
- {
3995
- this._targetSelect.open();
3996
- }
3997
- break;
3998
- case ItemType.Text:
3999
- case ItemType.Range:
4000
- {
4001
- this._el.nativeElement.focus();
4002
- }
4003
- break;
4004
- case ItemType.Date:
4005
- {
4006
- if (this._item.mode === ItemDateMode.Calendar) {
4007
- this._targetDate.open();
4008
- }
4009
- else {
4010
- this._targetDateScroll.inputClick();
4011
- }
4012
- }
4013
- break;
4014
- case ItemType.DateRange:
4015
- {
4016
- if (this._focusTargetType === 'from') {
4017
- this._targetDateRangeFrom.open();
4018
- }
4019
- else {
4020
- this._targetDateRangeTo.open();
4021
- }
4022
- }
4023
- break;
4024
- case ItemType.AutoComplete:
4025
- {
4026
- this._targetAutocomplete.focus();
4027
- }
4028
- break;
4029
- case ItemType.AutoCompleteChips:
4030
- {
4031
- this._targetAutocompleteChips.focus();
4032
- }
4033
- break;
3969
+ _listenInputKeyEvents() {
3970
+ if (!this.searchTextInput) {
3971
+ return;
4034
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
+ });
4035
3984
  }
4036
- };
4037
- FocusToItemDirective.ctorParameters = () => [
4038
- { type: ElementRef },
4039
- { type: FocusControllerService },
4040
- { type: MatSelect, decorators: [{ type: Optional }, { type: Self }] },
4041
- { type: FsDatePickerComponent, decorators: [{ type: Optional }, { type: Self }] },
4042
- { type: FsDateScrollPickerComponent, decorators: [{ type: Optional }, { type: Self }] },
4043
- { type: DateRangePickerFromComponent, decorators: [{ type: Optional }, { type: Self }] },
4044
- { type: DateRangePickerToComponent, decorators: [{ type: Optional }, { type: Self }] },
4045
- { type: FsAutocompleteComponent, decorators: [{ type: Optional }, { type: Self }] },
4046
- { type: FsAutocompleteChipsComponent, decorators: [{ type: Optional }, { type: Self }] }
4047
- ];
4048
- __decorate([
4049
- Input('fsFilterFocusTrigger'),
4050
- __metadata("design:type", Object)
4051
- ], FocusToItemDirective.prototype, "_item", void 0);
4052
- __decorate([
4053
- Input('focusTargetType'),
4054
- __metadata("design:type", Object)
4055
- ], FocusToItemDirective.prototype, "_focusTargetType", void 0);
4056
- FocusToItemDirective = __decorate([
4057
- Directive({
4058
- selector: '[fsFilterFocusTrigger]',
4059
- }),
4060
- __param(2, Optional()), __param(2, Self()),
4061
- __param(3, Optional()), __param(3, Self()),
4062
- __param(4, Optional()), __param(4, Self()),
4063
- __param(5, Optional()), __param(5, Self()),
4064
- __param(6, Optional()), __param(6, Self()),
4065
- __param(7, Optional()), __param(7, Self()),
4066
- __param(8, Optional()), __param(8, Self()),
4067
- __metadata("design:paramtypes", [ElementRef,
4068
- FocusControllerService,
4069
- MatSelect,
4070
- FsDatePickerComponent,
4071
- FsDateScrollPickerComponent,
4072
- DateRangePickerFromComponent,
4073
- DateRangePickerToComponent,
4074
- FsAutocompleteComponent,
4075
- FsAutocompleteChipsComponent])
4076
- ], FocusToItemDirective);
4077
-
4078
- let FsFilterChipContentComponent = class FsFilterChipContentComponent {
4079
- constructor(_cdRef) {
4080
- this._cdRef = _cdRef;
4081
- 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
+ });
4082
3995
  }
4083
- ngOnInit() {
4084
- 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
+ });
4085
4015
  }
4086
- ngOnDestroy() {
4087
- this._destroy$.next();
4088
- 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
+ }
4089
4022
  }
4090
- listenValueChangesForRanges() {
4091
- 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$
4092
4033
  .pipe(takeUntil(this._destroy$))
4093
4034
  .subscribe(() => {
4094
- this.content = this._getContent();
4095
- this._cdRef.detectChanges();
4035
+ this.change();
4096
4036
  });
4097
4037
  }
4098
- _getContent() {
4099
- const result = this.item.getChipsContent(this.type);
4100
- if (this.item.chipLabel !== undefined) {
4101
- if (this.item.chipLabel === '') {
4102
- return `${result}`;
4103
- }
4104
- else {
4105
- if (Array.isArray(this.item.chipLabel)) {
4106
- const label = getLabelFromArray(this.item.chipLabel, this.type);
4107
- return `${label}: ${result}`;
4108
- }
4109
- else {
4110
- return `${this.item.chipLabel}: ${result}`;
4111
- }
4112
- }
4113
- }
4114
- else {
4115
- if (Array.isArray(this.item.label)) {
4116
- const label = getLabelFromArray(this.item.label, this.type);
4117
- return `${label}: ${result}`;
4118
- }
4119
- else {
4120
- if (this.item.isTypeCheckbox) {
4121
- return result;
4122
- }
4123
- else {
4124
- return `${this.item.label}: ${result}`;
4125
- }
4126
- }
4127
- }
4128
- }
4129
- };
4130
- FsFilterChipContentComponent.ctorParameters = () => [
4131
- { type: ChangeDetectorRef }
4132
- ];
4133
- __decorate([
4134
- Input(),
4135
- __metadata("design:type", BaseItem)
4136
- ], FsFilterChipContentComponent.prototype, "item", void 0);
4137
- __decorate([
4138
- Input(),
4139
- __metadata("design:type", String)
4140
- ], FsFilterChipContentComponent.prototype, "type", void 0);
4141
- FsFilterChipContentComponent = __decorate([
4142
- Component({
4143
- selector: 'fs-filter-chip-content',
4144
- template: "{{ content }}\n",
4145
- changeDetection: ChangeDetectionStrategy.OnPush,
4146
- styles: [""]
4147
- }),
4148
- __metadata("design:paramtypes", [ChangeDetectorRef])
4149
- ], FsFilterChipContentComponent);
4150
- function getLabelFromArray(labelArr, type) {
4151
- if (type === 'from' && labelArr[0]) {
4152
- return `${labelArr[0]}`;
4038
+ _initOverlay() {
4039
+ this._filterOverlay.setClearFn(this.clear.bind(this));
4040
+ this._filterOverlay.setDoneFn(this.hide.bind(this));
4153
4041
  }
4154
- else if (type === 'to' && labelArr[1]) {
4155
- 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
+ });
4156
4055
  }
4157
- else {
4158
- return '';
4056
+ _updateChipsVisibility() {
4057
+ const hasFilterChips = this._filterItems.items
4058
+ .some((item) => {
4059
+ return item.isChipVisible;
4060
+ });
4061
+ this._hasFilterChips$.next(hasFilterChips);
4159
4062
  }
4160
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 []; } });
4161
4149
 
4162
- let FsSavedFiltersMenuComponent = class FsSavedFiltersMenuComponent {
4150
+ class FsSavedFiltersMenuComponent {
4163
4151
  constructor(_itemsStore, _externalParams, _savedFilters) {
4164
4152
  this._itemsStore = _itemsStore;
4165
4153
  this._externalParams = _externalParams;
@@ -4186,105 +4174,99 @@ let FsSavedFiltersMenuComponent = class FsSavedFiltersMenuComponent {
4186
4174
  manageFilters() {
4187
4175
  this.manage.emit();
4188
4176
  }
4189
- };
4190
- FsSavedFiltersMenuComponent.ctorParameters = () => [
4191
- { type: FsFilterItemsStore },
4192
- { type: ExternalParamsController },
4193
- { type: SavedFiltersController }
4194
- ];
4195
- __decorate([
4196
- Output(),
4197
- __metadata("design:type", Object)
4198
- ], FsSavedFiltersMenuComponent.prototype, "select", void 0);
4199
- __decorate([
4200
- Output(),
4201
- __metadata("design:type", Object)
4202
- ], FsSavedFiltersMenuComponent.prototype, "clear", void 0);
4203
- __decorate([
4204
- Output(),
4205
- __metadata("design:type", Object)
4206
- ], FsSavedFiltersMenuComponent.prototype, "manage", void 0);
4207
- FsSavedFiltersMenuComponent = __decorate([
4208
- Component({
4209
- selector: 'fs-filter-saved-filters-menu',
4210
- 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",
4211
- changeDetection: ChangeDetectionStrategy.OnPush,
4212
- styles: [":host ::ng-deep .selector{cursor:pointer}"]
4213
- }),
4214
- __metadata("design:paramtypes", [FsFilterItemsStore,
4215
- ExternalParamsController,
4216
- SavedFiltersController])
4217
- ], FsSavedFiltersMenuComponent);
4218
-
4219
- let FsFilterActionsComponent = class FsFilterActionsComponent {
4220
- constructor() {
4221
- this.kebabActions = [];
4222
- this.actions = [];
4223
- }
4224
- };
4225
- __decorate([
4226
- Input(),
4227
- __metadata("design:type", Array)
4228
- ], FsFilterActionsComponent.prototype, "kebabActions", void 0);
4229
- __decorate([
4230
- Input(),
4231
- __metadata("design:type", Array)
4232
- ], FsFilterActionsComponent.prototype, "actions", void 0);
4233
- FsFilterActionsComponent = __decorate([
4234
- Component({
4235
- selector: 'fs-filter-actions',
4236
- 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",
4237
- changeDetection: ChangeDetectionStrategy.OnPush,
4238
- 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}"]
4239
- })
4240
- ], FsFilterActionsComponent);
4241
-
4242
- let FsFilterActionButtonComponent = class FsFilterActionButtonComponent {
4243
- };
4244
- __decorate([
4245
- Input(),
4246
- __metadata("design:type", Action)
4247
- ], FsFilterActionButtonComponent.prototype, "action", void 0);
4248
- FsFilterActionButtonComponent = __decorate([
4249
- Component({
4250
- selector: 'fs-filter-action-button',
4251
- 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",
4252
- host: {
4253
- class: 'action-button',
4254
- },
4255
- changeDetection: ChangeDetectionStrategy.OnPush
4256
- })
4257
- ], FsFilterActionButtonComponent);
4258
-
4259
- let FsFilterActionKebabActionsComponent = class FsFilterActionKebabActionsComponent {
4260
- };
4261
- __decorate([
4262
- Input(),
4263
- __metadata("design:type", Array)
4264
- ], FsFilterActionKebabActionsComponent.prototype, "kebabActions", void 0);
4265
- FsFilterActionKebabActionsComponent = __decorate([
4266
- Component({
4267
- selector: 'fs-filter-action-kebab-actions',
4268
- 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",
4269
- changeDetection: ChangeDetectionStrategy.OnPush,
4270
- styles: [".menu-button{width:36px;height:36px;line-height:36px}"]
4271
- })
4272
- ], 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
+ }] } });
4273
4197
 
4274
- var FsFilterModule_1;
4275
- let FsFilterModule = FsFilterModule_1 = class FsFilterModule {
4198
+ class FsFilterModule {
4276
4199
  static forRoot(config = {}) {
4277
4200
  return {
4278
- ngModule: FsFilterModule_1,
4201
+ ngModule: FsFilterModule,
4279
4202
  providers: [
4280
4203
  { provide: FS_FILTER_CONFIG, useValue: config || {} }
4281
4204
  ]
4282
4205
  };
4283
4206
  }
4284
- };
4285
- FsFilterModule = FsFilterModule_1 = __decorate([
4286
- NgModule({
4287
- 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: [[
4288
4270
  CommonModule,
4289
4271
  RouterModule,
4290
4272
  FormsModule,
@@ -4312,52 +4294,84 @@ FsFilterModule = FsFilterModule_1 = __decorate([
4312
4294
  FsSkeletonModule,
4313
4295
  FsFormModule,
4314
4296
  FsFileModule,
4315
- ],
4316
- declarations: [
4317
- BaseItemComponent,
4318
- FilterComponent,
4319
- FilterItemComponent,
4320
- FsFilterChipsComponent,
4321
- SelectComponent,
4322
- SelectGroupsComponent,
4323
- SelectSimpleComponent,
4324
- SelectMultipleComponent,
4325
- ChipsComponent,
4326
- TextComponent,
4327
- RangeComponent,
4328
- AutocompleteComponent,
4329
- AutocompletechipsComponent,
4330
- DateComponent,
4331
- DateRangeComponent,
4332
- CheckboxComponent,
4333
- FilterDrawerComponent,
4334
- SelectBackdropComponent,
4335
- FsFilterChipComponent,
4336
- FsFilterChipContentComponent,
4337
- FsFilterDrawerActionsComponent,
4338
- FsFilterSavedFilterEditComponent,
4339
- FsSavedFiltersMenuComponent,
4340
- FsFilterActionsComponent,
4341
- FsFilterActionButtonComponent,
4342
- FsFilterActionKebabActionsComponent,
4343
- FilterStatusBarDirective,
4344
- FocusToItemDirective,
4345
- // Pipes
4346
- FsFilterIsolateValues,
4347
- ],
4348
- providers: [
4349
- FsStore,
4350
- ],
4351
- exports: [
4352
- FilterComponent,
4353
- FilterStatusBarDirective,
4354
- FsSavedFiltersMenuComponent,
4355
- ],
4356
- entryComponents: [
4357
- FilterDrawerComponent
4358
- ]
4359
- })
4360
- ], 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
+ }] });
4361
4375
 
4362
4376
  // Controllers
4363
4377
 
@@ -4365,5 +4379,5 @@ FsFilterModule = FsFilterModule_1 = __decorate([
4365
4379
  * Generated bundle index. Do not edit.
4366
4380
  */
4367
4381
 
4368
- 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 };
4369
4383
  //# sourceMappingURL=firestitch-filter.js.map