@firestitch/filter 9.9.6 → 12.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (242) 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/interfaces/action.interface.d.ts +5 -0
  32. package/app/models/action.model.d.ts +6 -0
  33. package/app/pipes/remove-isolate-value.pipe.d.ts +3 -0
  34. package/app/services/external-params/persistance-params-controller.service.d.ts +3 -0
  35. package/app/services/external-params/query-params-controller.service.d.ts +3 -0
  36. package/app/services/external-params/saved-filters-controller.service.d.ts +3 -0
  37. package/app/services/external-params-controller.service.d.ts +4 -0
  38. package/app/services/filter-overlay.service.d.ts +7 -1
  39. package/app/services/focus-controller.service.d.ts +4 -3
  40. package/app/services/items-store.service.d.ts +3 -0
  41. package/bundles/firestitch-filter.umd.js +3007 -2886
  42. package/bundles/firestitch-filter.umd.js.map +1 -1
  43. package/esm2015/app/classes/actions-controller.js +10 -12
  44. package/esm2015/app/components/action-button/action-button.component.js +23 -19
  45. package/esm2015/app/components/action-kebab-actions/action-kebab-actions.component.js +22 -17
  46. package/esm2015/app/components/actions/actions.component.js +27 -21
  47. package/esm2015/app/components/filter/filter.component.js +102 -96
  48. package/esm2015/app/components/filter-chip/filter-chip.component.js +22 -24
  49. package/esm2015/app/components/filter-chip-content/filter-chip-content.component.js +20 -26
  50. package/esm2015/app/components/filter-chips/filter-chips.component.js +21 -17
  51. package/esm2015/app/components/filter-drawer/filter-drawer.component.js +35 -37
  52. package/esm2015/app/components/filter-drawer-actions/filter-drawer-actions.component.js +22 -23
  53. package/esm2015/app/components/filters-item/autocomplete/autocomplete.component.js +17 -18
  54. package/esm2015/app/components/filters-item/autocompletechips/autocompletechips.component.js +17 -18
  55. package/esm2015/app/components/filters-item/base-item/base-item.component.js +19 -28
  56. package/esm2015/app/components/filters-item/checkbox/checkbox.component.js +18 -19
  57. package/esm2015/app/components/filters-item/chips/chips.component.js +19 -19
  58. package/esm2015/app/components/filters-item/date/date.component.js +21 -19
  59. package/esm2015/app/components/filters-item/date-range/date-range.component.js +20 -19
  60. package/esm2015/app/components/filters-item/filter-item.component.js +27 -21
  61. package/esm2015/app/components/filters-item/range/range.component.js +29 -28
  62. package/esm2015/app/components/filters-item/select/backdrop/backdrop.component.js +15 -14
  63. package/esm2015/app/components/filters-item/select/groups/groups.component.js +27 -25
  64. package/esm2015/app/components/filters-item/select/multiple/multiple.component.js +30 -26
  65. package/esm2015/app/components/filters-item/select/select.component.js +24 -23
  66. package/esm2015/app/components/filters-item/select/simple/simple.component.js +29 -25
  67. package/esm2015/app/components/filters-item/text/text.component.js +21 -20
  68. package/esm2015/app/components/saved-filter-edit/saved-filter-edit.component.js +25 -17
  69. package/esm2015/app/components/saved-filters-menu/saved-filters-menu.component.js +28 -33
  70. package/esm2015/app/consts/query-param-delimiter.js +1 -1
  71. package/esm2015/app/directives/focus-to-item/focus-to-item.directive.js +53 -47
  72. package/esm2015/app/directives/status-bar/status-bar.directive.js +12 -10
  73. package/esm2015/app/enums/action-mode.enum.js +1 -1
  74. package/esm2015/app/enums/action-type.enum.js +1 -1
  75. package/esm2015/app/enums/item-date-mode.enum.js +1 -1
  76. package/esm2015/app/enums/item-type.enum.js +1 -1
  77. package/esm2015/app/fs-filter.module.js +145 -56
  78. package/esm2015/app/helpers/build-query-params.js +1 -1
  79. package/esm2015/app/helpers/compare.js +1 -1
  80. package/esm2015/app/helpers/create-filter-item.js +1 -1
  81. package/esm2015/app/helpers/find-value.js +1 -1
  82. package/esm2015/app/helpers/get-range-name.js +1 -1
  83. package/esm2015/app/helpers/parse-item-value-from-stored.js +1 -1
  84. package/esm2015/app/helpers/query-param-transformers.js +1 -1
  85. package/esm2015/app/helpers/restore-items.js +1 -1
  86. package/esm2015/app/helpers/try-convert-to-number.js +1 -1
  87. package/esm2015/app/injectors/filter-config.js +1 -1
  88. package/esm2015/app/injectors/filter-drawer-data.js +1 -1
  89. package/esm2015/app/injectors/filter-drawer-overlay.js +1 -1
  90. package/esm2015/app/interfaces/action.interface.js +2 -1
  91. package/esm2015/app/interfaces/config.interface.js +2 -1
  92. package/esm2015/app/interfaces/external-params.interface.js +2 -1
  93. package/esm2015/app/interfaces/filter.interface.js +2 -1
  94. package/esm2015/app/interfaces/items/autocomplete-chips.interface.js +2 -1
  95. package/esm2015/app/interfaces/items/autocomplete.interface.js +2 -1
  96. package/esm2015/app/interfaces/items/base.interface.js +2 -1
  97. package/esm2015/app/interfaces/items/checkbox.interface.js +2 -1
  98. package/esm2015/app/interfaces/items/chips.interface.js +2 -1
  99. package/esm2015/app/interfaces/items/date-range.interface.js +2 -1
  100. package/esm2015/app/interfaces/items/date.interface.js +2 -1
  101. package/esm2015/app/interfaces/items/range.interface.js +2 -1
  102. package/esm2015/app/interfaces/items/select.interface.js +2 -1
  103. package/esm2015/app/interfaces/items/text.interface.js +2 -1
  104. package/esm2015/app/interfaces/saved-filters.interface.js +2 -1
  105. package/esm2015/app/interfaces/update-filter-item.interface.js +2 -1
  106. package/esm2015/app/models/action-menu-item.model.js +1 -1
  107. package/esm2015/app/models/action.model.js +7 -1
  108. package/esm2015/app/models/filter-config.js +1 -1
  109. package/esm2015/app/models/items/autocomplete/base-autocomplete-item.js +1 -1
  110. package/esm2015/app/models/items/autocomplete-chips-item.js +1 -1
  111. package/esm2015/app/models/items/autocomplete-item.js +1 -1
  112. package/esm2015/app/models/items/base-item.js +1 -1
  113. package/esm2015/app/models/items/checkbox-item.js +1 -1
  114. package/esm2015/app/models/items/chips-item.js +1 -1
  115. package/esm2015/app/models/items/date/base-date-item.js +1 -1
  116. package/esm2015/app/models/items/date-item.js +1 -1
  117. package/esm2015/app/models/items/date-range/base-date-range-item.js +1 -1
  118. package/esm2015/app/models/items/date-range-item.js +1 -1
  119. package/esm2015/app/models/items/date-time-item.js +1 -1
  120. package/esm2015/app/models/items/date-time-range-item.js +1 -1
  121. package/esm2015/app/models/items/range-item.js +1 -1
  122. package/esm2015/app/models/items/select/base-select-item.js +1 -1
  123. package/esm2015/app/models/items/select/multiple-select-item.js +1 -1
  124. package/esm2015/app/models/items/select/simple-select-item.js +1 -1
  125. package/esm2015/app/models/items/select-item.js +1 -1
  126. package/esm2015/app/models/items/text-item.js +1 -1
  127. package/esm2015/app/pipes/remove-isolate-value.pipe.js +12 -10
  128. package/esm2015/app/providers/filter-meta.js +1 -1
  129. package/esm2015/app/services/external-params/persistance-params-controller.service.js +19 -24
  130. package/esm2015/app/services/external-params/query-params-controller.service.js +11 -16
  131. package/esm2015/app/services/external-params/saved-filters-controller.service.js +11 -14
  132. package/esm2015/app/services/external-params-controller.service.js +29 -32
  133. package/esm2015/app/services/filter-overlay.service.js +30 -19
  134. package/esm2015/app/services/focus-controller.service.js +10 -18
  135. package/esm2015/app/services/items-store.service.js +9 -9
  136. package/esm2015/firestitch-filter.js +1 -40
  137. package/esm2015/public_api.js +2 -1
  138. package/fesm2015/firestitch-filter.js +2015 -1995
  139. package/fesm2015/firestitch-filter.js.map +1 -1
  140. package/firestitch-filter.d.ts +1 -39
  141. package/package.json +12 -15
  142. package/public_api.d.ts +1 -0
  143. package/bundles/firestitch-filter.umd.min.js +0 -16
  144. package/bundles/firestitch-filter.umd.min.js.map +0 -1
  145. package/esm5/app/classes/actions-controller.js +0 -151
  146. package/esm5/app/components/action-button/action-button.component.js +0 -24
  147. package/esm5/app/components/action-kebab-actions/action-kebab-actions.component.js +0 -21
  148. package/esm5/app/components/actions/actions.component.js +0 -27
  149. package/esm5/app/components/filter/filter.component.js +0 -690
  150. package/esm5/app/components/filter-chip/filter-chip.component.js +0 -99
  151. package/esm5/app/components/filter-chip-content/filter-chip-content.component.js +0 -92
  152. package/esm5/app/components/filter-chips/filter-chips.component.js +0 -22
  153. package/esm5/app/components/filter-drawer/filter-drawer.component.js +0 -91
  154. package/esm5/app/components/filter-drawer-actions/filter-drawer-actions.component.js +0 -49
  155. package/esm5/app/components/filters-item/autocomplete/autocomplete.component.js +0 -34
  156. package/esm5/app/components/filters-item/autocompletechips/autocompletechips.component.js +0 -56
  157. package/esm5/app/components/filters-item/base-item/base-item.component.js +0 -74
  158. package/esm5/app/components/filters-item/checkbox/checkbox.component.js +0 -29
  159. package/esm5/app/components/filters-item/chips/chips.component.js +0 -35
  160. package/esm5/app/components/filters-item/date/date.component.js +0 -46
  161. package/esm5/app/components/filters-item/date-range/date-range.component.js +0 -38
  162. package/esm5/app/components/filters-item/filter-item.component.js +0 -43
  163. package/esm5/app/components/filters-item/range/range.component.js +0 -54
  164. package/esm5/app/components/filters-item/select/backdrop/backdrop.component.js +0 -18
  165. package/esm5/app/components/filters-item/select/groups/groups.component.js +0 -33
  166. package/esm5/app/components/filters-item/select/multiple/multiple.component.js +0 -58
  167. package/esm5/app/components/filters-item/select/select.component.js +0 -46
  168. package/esm5/app/components/filters-item/select/simple/simple.component.js +0 -45
  169. package/esm5/app/components/filters-item/text/text.component.js +0 -58
  170. package/esm5/app/components/saved-filter-edit/saved-filter-edit.component.js +0 -49
  171. package/esm5/app/components/saved-filters-menu/saved-filters-menu.component.js +0 -72
  172. package/esm5/app/consts/query-param-delimiter.js +0 -2
  173. package/esm5/app/directives/focus-to-item/focus-to-item.directive.js +0 -126
  174. package/esm5/app/directives/status-bar/status-bar.directive.js +0 -14
  175. package/esm5/app/enums/action-mode.enum.js +0 -7
  176. package/esm5/app/enums/action-type.enum.js +0 -9
  177. package/esm5/app/enums/item-date-mode.enum.js +0 -7
  178. package/esm5/app/enums/item-type.enum.js +0 -16
  179. package/esm5/app/fs-filter.module.js +0 -152
  180. package/esm5/app/helpers/build-query-params.js +0 -32
  181. package/esm5/app/helpers/compare.js +0 -50
  182. package/esm5/app/helpers/create-filter-item.js +0 -51
  183. package/esm5/app/helpers/find-value.js +0 -13
  184. package/esm5/app/helpers/get-range-name.js +0 -9
  185. package/esm5/app/helpers/parse-item-value-from-stored.js +0 -77
  186. package/esm5/app/helpers/query-param-transformers.js +0 -9
  187. package/esm5/app/helpers/restore-items.js +0 -43
  188. package/esm5/app/helpers/try-convert-to-number.js +0 -6
  189. package/esm5/app/injectors/filter-config.js +0 -3
  190. package/esm5/app/injectors/filter-drawer-data.js +0 -3
  191. package/esm5/app/injectors/filter-drawer-overlay.js +0 -3
  192. package/esm5/app/interfaces/action.interface.js +0 -1
  193. package/esm5/app/interfaces/config.interface.js +0 -1
  194. package/esm5/app/interfaces/external-params.interface.js +0 -1
  195. package/esm5/app/interfaces/filter.interface.js +0 -1
  196. package/esm5/app/interfaces/items/autocomplete-chips.interface.js +0 -1
  197. package/esm5/app/interfaces/items/autocomplete.interface.js +0 -1
  198. package/esm5/app/interfaces/items/base.interface.js +0 -1
  199. package/esm5/app/interfaces/items/checkbox.interface.js +0 -1
  200. package/esm5/app/interfaces/items/chips.interface.js +0 -1
  201. package/esm5/app/interfaces/items/date-range.interface.js +0 -1
  202. package/esm5/app/interfaces/items/date.interface.js +0 -1
  203. package/esm5/app/interfaces/items/range.interface.js +0 -1
  204. package/esm5/app/interfaces/items/select.interface.js +0 -1
  205. package/esm5/app/interfaces/items/text.interface.js +0 -1
  206. package/esm5/app/interfaces/saved-filters.interface.js +0 -1
  207. package/esm5/app/interfaces/update-filter-item.interface.js +0 -1
  208. package/esm5/app/models/action-menu-item.model.js +0 -91
  209. package/esm5/app/models/action.model.js +0 -116
  210. package/esm5/app/models/filter-config.js +0 -139
  211. package/esm5/app/models/items/autocomplete/base-autocomplete-item.js +0 -25
  212. package/esm5/app/models/items/autocomplete-chips-item.js +0 -82
  213. package/esm5/app/models/items/autocomplete-item.js +0 -48
  214. package/esm5/app/models/items/base-item.js +0 -353
  215. package/esm5/app/models/items/checkbox-item.js +0 -73
  216. package/esm5/app/models/items/chips-item.js +0 -114
  217. package/esm5/app/models/items/date/base-date-item.js +0 -68
  218. package/esm5/app/models/items/date-item.js +0 -28
  219. package/esm5/app/models/items/date-range/base-date-range-item.js +0 -173
  220. package/esm5/app/models/items/date-range-item.js +0 -14
  221. package/esm5/app/models/items/date-time-item.js +0 -18
  222. package/esm5/app/models/items/date-time-range-item.js +0 -14
  223. package/esm5/app/models/items/range-item.js +0 -110
  224. package/esm5/app/models/items/select/base-select-item.js +0 -43
  225. package/esm5/app/models/items/select/multiple-select-item.js +0 -82
  226. package/esm5/app/models/items/select/simple-select-item.js +0 -79
  227. package/esm5/app/models/items/select-item.js +0 -17
  228. package/esm5/app/models/items/text-item.js +0 -46
  229. package/esm5/app/pipes/remove-isolate-value.pipe.js +0 -24
  230. package/esm5/app/providers/filter-meta.js +0 -10
  231. package/esm5/app/services/external-params/persistance-params-controller.service.js +0 -65
  232. package/esm5/app/services/external-params/query-params-controller.service.js +0 -66
  233. package/esm5/app/services/external-params/saved-filters-controller.service.js +0 -199
  234. package/esm5/app/services/external-params-controller.service.js +0 -190
  235. package/esm5/app/services/filter-overlay.service.js +0 -111
  236. package/esm5/app/services/focus-controller.service.js +0 -47
  237. package/esm5/app/services/items-store.service.js +0 -342
  238. package/esm5/firestitch-filter.js +0 -44
  239. package/esm5/public_api.js +0 -35
  240. package/fesm5/firestitch-filter.js +0 -5099
  241. package/fesm5/firestitch-filter.js.map +0 -1
  242. 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,1804 +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.click = (_f = config.click) !== null && _f !== void 0 ? _f : (() => { });
2534
- this._disabledFn = config.disabled;
2535
- 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();
2536
2302
  }
2537
2303
  break;
2538
2304
  }
2539
- this.updateVisibility();
2540
2305
  }
2541
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
+ }] } });
2542
2349
 
2543
- let ActionsController = class ActionsController {
2544
- constructor(_breakpointObserver) {
2545
- this._breakpointObserver = _breakpointObserver;
2546
- this._visible$ = new BehaviorSubject(false);
2547
- this._actions$ = new BehaviorSubject([]);
2548
- this._menuActions$ = new BehaviorSubject([]);
2549
- this._destroy$ = new Subject();
2550
- this._mobileMedia = '(max-width: 799px)';
2551
- this._allActions = [];
2552
- 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();
2553
2357
  }
2554
- get menuActions() {
2555
- return this._menuActions$.value;
2358
+ ngOnInit() {
2359
+ this._listenControlValueChanges();
2360
+ this._listenModelChanges();
2556
2361
  }
2557
- get actions() {
2558
- return this._actions$.value;
2362
+ ngOnDestroy() {
2363
+ this.destroy$.next();
2364
+ this.destroy$.complete();
2559
2365
  }
2560
- get actions$() {
2561
- 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
+ });
2562
2372
  }
2563
- get menuActions$() {
2564
- 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
+ });
2565
2379
  }
2566
- get visible$() {
2567
- 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
+ }
2568
2403
  }
2569
- get mobileMode() {
2570
- 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;
2571
2417
  }
2572
- ngOnDestroy() {
2573
- this._destroy$.next();
2574
- 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
+ }
2575
2428
  }
2576
- initActions(rawActions) {
2577
- if (!rawActions || !Array.isArray(rawActions)) {
2578
- 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;
2579
2435
  }
2580
- this.show();
2581
- this._allActions = rawActions
2582
- .map((action) => new Action(action));
2583
- if (this._reorderAction) {
2584
- 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
+ }
2585
2443
  }
2586
- this._classifyActions();
2587
- }
2588
- show() {
2589
- this._visible$.next(true);
2590
2444
  }
2591
- hide() {
2592
- this._visible$.next(false);
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;
2593
2466
  }
2594
- addReorderAction(action) {
2595
- this._allActions.unshift(action);
2596
- action.isReorderAction = true;
2597
- this._classifyAction(action);
2598
- this._reorderAction = action;
2467
+ changed() {
2468
+ if (this.item.isolate) {
2469
+ this.item.isolate.enabled = false;
2470
+ }
2599
2471
  }
2600
- clearActions() {
2601
- this._allActions = [];
2602
- this._setActions([]);
2603
- this._setKebabActions([]);
2604
- }
2605
- updateActionsVisibility() {
2606
- this._allActions.forEach((action) => action.updateVisibility());
2607
- this._classifyActions();
2472
+ isolateChange(filter) {
2473
+ if (filter.isolate.enabled) {
2474
+ filter.model = filter.isolate.value;
2475
+ }
2476
+ else {
2477
+ filter.model = null;
2478
+ }
2608
2479
  }
2609
- updateDisabledState() {
2610
- 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;
2611
2501
  }
2612
- _setKebabActions(actions) {
2613
- this._menuActions$.next(actions);
2502
+ compare(o1, o2) {
2503
+ return o1 == o2;
2614
2504
  }
2615
- _setActions(actions) {
2616
- 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;
2617
2530
  }
2618
- _classifyActions() {
2619
- const kebabActions = [];
2620
- const actions = [];
2621
- const mobileMode = this.mobileMode;
2622
- this._allActions
2623
- .filter((action) => {
2624
- return action.visible;
2625
- })
2626
- .forEach((action) => {
2627
- if (action.menu || mobileMode) {
2628
- kebabActions.push(action);
2629
- }
2630
- else {
2631
- 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
+ }
2632
2539
  }
2633
- });
2634
- this._setKebabActions(kebabActions);
2635
- this._setActions(actions);
2636
- }
2637
- _classifyAction(action) {
2638
- if (action.menu) {
2639
- this._setKebabActions([...this.menuActions, action]);
2640
- }
2641
- else {
2642
- this._setActions([...this.actions, action]);
2643
2540
  }
2644
2541
  }
2645
- _listenMobileMedia() {
2646
- this._breakpointObserver.observe(this._mobileMedia)
2647
- .pipe(skip(1), takeUntil(this._destroy$))
2648
- .subscribe(() => {
2649
- this._classifyActions();
2650
- });
2542
+ }
2543
+ SelectComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SelectComponent, deps: [{ token: i0.KeyValueDiffers }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
2544
+ SelectComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SelectComponent, selector: "filter-item-select", viewQueries: [{ propertyName: "selectedItem", first: true, predicate: ["selectItem"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<ng-container *ngIf=\"(item.loading$ | async) else itemSelect\">\n <mat-form-field>\n <mat-label>{{item.label}}</mat-label>\n <mat-select disabled></mat-select>\n </mat-form-field>\n</ng-container>\n\n<ng-template #itemSelect>\n <ng-container *ngIf=\"(item.values$ | async)?.length\">\n <ng-container *ngIf=\"item.multiple && !item.children\">\n <filter-item-select-multiple\n [item]=\"item\"\n #selectItem>\n </filter-item-select-multiple>\n </ng-container>\n\n <ng-container *ngIf=\"!item.multiple && !item.children\">\n <filter-item-select-simple\n [item]=\"item\"\n #selectItem>\n </filter-item-select-simple>\n </ng-container>\n\n <ng-container *ngIf=\"item.children\">\n <filter-item-select-groups\n [item]=\"item\"\n #selectItem>\n </filter-item-select-groups>\n </ng-container>\n </ng-container>\n</ng-template>\n", components: [{ type: i1$3.MatFormField, selector: "mat-form-field", inputs: ["color", "floatLabel", "appearance", "hideRequiredMarker", "hintLabel"], exportAs: ["matFormField"] }, { type: i2.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { type: SelectMultipleComponent, selector: "filter-item-select-multiple", inputs: ["item"] }, { type: SelectSimpleComponent, selector: "filter-item-select-simple", inputs: ["item"] }, { type: SelectGroupsComponent, selector: "filter-item-select-groups", inputs: ["item"] }], directives: [{ type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1$3.MatLabel, selector: "mat-label" }], pipes: { "async": i3.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
2545
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SelectComponent, decorators: [{
2546
+ type: Component,
2547
+ args: [{
2548
+ selector: 'filter-item-select',
2549
+ templateUrl: './select.component.html',
2550
+ changeDetection: ChangeDetectionStrategy.OnPush,
2551
+ }]
2552
+ }], ctorParameters: function () { return [{ type: i0.KeyValueDiffers }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { selectedItem: [{
2553
+ type: ViewChild,
2554
+ args: ['selectItem']
2555
+ }] } });
2556
+
2557
+ class ChipsComponent extends BaseItemComponent {
2558
+ constructor(_kvDiffers, _cd) {
2559
+ super(_kvDiffers, _cd);
2560
+ this._kvDiffers = _kvDiffers;
2561
+ this._cd = _cd;
2562
+ }
2563
+ modelChange() {
2564
+ this.itemChange();
2651
2565
  }
2652
- };
2653
- ActionsController.ctorParameters = () => [
2654
- { type: BreakpointObserver }
2655
- ];
2656
- ActionsController = __decorate([
2657
- Injectable(),
2658
- __metadata("design:paramtypes", [BreakpointObserver])
2659
- ], ActionsController);
2566
+ compareFn(modelValue, chipValue) {
2567
+ return modelValue.value === chipValue.value;
2568
+ }
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 }]; } });
2660
2581
 
2661
- let FilterComponent = class FilterComponent {
2662
- constructor(_filterOverlay, _zone, _externalParams, _filterItems, _actions, _defaultConfig) {
2663
- this._filterOverlay = _filterOverlay;
2664
- this._zone = _zone;
2665
- this._externalParams = _externalParams;
2666
- this._filterItems = _filterItems;
2667
- this._actions = _actions;
2668
- this._defaultConfig = _defaultConfig;
2669
- this.showSortBy = true;
2670
- this.showFilterInput = true;
2671
- this.closed = new EventEmitter();
2672
- this.opened = new EventEmitter();
2673
- this.ready = new EventEmitter();
2674
- this.showFilterMenu = false;
2675
- this.windowDesktop = false;
2676
- this.fsFilterClass = true;
2677
- this.searchText = new FormControl();
2678
- this.searchPlaceholder = 'Search';
2679
- this._config = null;
2680
- this._filtersBtnVisible$ = new BehaviorSubject(true);
2681
- this._keywordVisible$ = new BehaviorSubject(true);
2682
- this._hasFilterChips$ = new BehaviorSubject(false);
2683
- this._destroy$ = new Subject();
2684
- this._listenWhenFilterReady();
2685
- this._updateWindowWidth();
2686
- this._filterOverlay.attach$
2687
- .pipe(takeUntil(this._destroy$))
2688
- .subscribe(() => {
2689
- this.showFilterMenu = true;
2690
- });
2691
- this._filterOverlay.detach$
2582
+ class RangeComponent extends BaseItemComponent {
2583
+ constructor(_kvDiffers, _cd) {
2584
+ super(_kvDiffers, _cd);
2585
+ this._kvDiffers = _kvDiffers;
2586
+ this._cd = _cd;
2587
+ }
2588
+ ngOnInit() {
2589
+ this.listenChanges();
2590
+ }
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)
2692
2597
  .pipe(takeUntil(this._destroy$))
2693
2598
  .subscribe(() => {
2694
- this.showFilterMenu = false;
2599
+ this.itemChange();
2695
2600
  });
2696
- this._listenWindowResize();
2697
- }
2698
- set setConfig(config) {
2699
- this._initFilterWithConfig(config);
2700
- }
2701
- set setFilter(config) {
2702
- this._initFilterWithConfig(config);
2703
- }
2704
- get config() {
2705
- return this._config;
2706
2601
  }
2707
- get filterParams() {
2708
- return this._filterItems.values();
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
+ };
2709
2632
  }
2710
- get filterParamsQuery() {
2711
- return this._filterItems.valuesAsQuery();
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
+ };
2712
2653
  }
2713
- get items() {
2714
- return this._filterItems.items;
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();
2715
2660
  }
2716
- get visibleItems() {
2717
- return this._filterItems.visibleItems;
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
+ }
2718
2666
  }
2719
- get itemsReady$() {
2720
- return this._filterItems.ready$;
2667
+ removeAutocompleteChipItem(event) {
2668
+ remove(this.item.model, { value: event.data.value });
2669
+ this.itemChange();
2721
2670
  }
2722
- get hasFilterChips$() {
2723
- return this._hasFilterChips$.asObservable();
2671
+ clearAutocompleteChipItem() {
2672
+ this.item.clear();
2673
+ this.itemChange();
2724
2674
  }
2725
- get hasVisibleItemOrSorting() {
2726
- return this.visibleItems.length > 0 || !!this._filterItems.sortByItem;
2675
+ compareItems(item1, item2) {
2676
+ return (item1 === null || item1 === void 0 ? void 0 : item1.value) === (item2 === null || item2 === void 0 ? void 0 : item2.value);
2727
2677
  }
2728
- get hasKeyword() {
2729
- return this._filterItems.hasKeyword;
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;
2730
2700
  }
2731
- get filtersBtnVisible$() {
2732
- return this._filtersBtnVisible$.asObservable();
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
+ }
2733
2711
  }
2734
- get keywordVisible$() {
2735
- return this._keywordVisible$.asObservable();
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';
2736
2730
  }
2737
- get actionsVisible$() {
2738
- return this._actions.visible$;
2731
+ ngOnInit() {
2732
+ if (this.item.type === ItemType.DateTimeRange) {
2733
+ this.viewType = 'datetime';
2734
+ }
2735
+ else {
2736
+ this.viewType = 'date';
2737
+ }
2739
2738
  }
2740
- get actions$() {
2741
- return this._actions.actions$;
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;
2742
2756
  }
2743
- get menuActions$() {
2744
- return this._actions.menuActions$;
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;
2745
2775
  }
2746
2776
  ngOnInit() {
2747
- // Avoid ngChanges error
2748
- setTimeout(() => {
2749
- if (this.config.autofocus) {
2750
- this.focus();
2751
- }
2752
- });
2753
- this._listenInternalItemsChange();
2754
- this._initOverlay();
2755
- }
2756
- ngAfterViewInit() {
2757
- this._listenInputKeyEvents();
2758
- // FIXME prevent fire change after init
2759
- setTimeout(() => {
2760
- this._listenInputChanges();
2777
+ this.item.value$
2778
+ .pipe(takeUntil(this._destroy$))
2779
+ .subscribe(() => {
2780
+ this._cdRef.markForCheck();
2761
2781
  });
2762
2782
  }
2763
2783
  ngOnDestroy() {
2764
- this._destroyFilterDrawer();
2765
2784
  this._destroy$.next();
2766
2785
  this._destroy$.complete();
2767
2786
  }
2768
- focus() {
2769
- if (this.searchTextMatInput) {
2770
- 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();
2771
2933
  }
2772
2934
  }
2773
- updateSort(sort) {
2774
- 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();
2775
2954
  }
2776
- /**
2777
- *
2778
- * Do update value of some field
2779
- *
2780
- * @param values - values for update
2781
- *
2782
- * To update text value just pass new text value
2783
- *
2784
- * public updateSelectValue(val) {
2785
- * this.filterEl.updateValues({ keyword: val });
2786
- * }
2787
- *
2788
- * To update select or observable select you could pass suitable value
2789
- *
2790
- * public updateSelectValue(val: number) {
2791
- * this.filterEl.updateValues({ simple_select: val }, { observable_select: val });
2792
- * }
2793
- *
2794
- * To update checkbox value just pass true/false as value
2795
- *
2796
- * public updateCheckox(val: boolean) {
2797
- * this.filterEl.updateValues({ checkbox: val });
2798
- * }
2799
- *
2800
- * To update range value just pass object with min&max object or just with one of targets
2801
- *
2802
- * Ex.: { min: 10, max 15 }, { min: 5 }, { max 5 }
2803
- *
2804
- * public updateRange(val) {
2805
- * this.filterEl.updateValues({ range: val });
2806
- * }
2807
- *
2808
- * To update autocomplete just pass object with name/value fields
2809
- *
2810
- * Ex.: { name: 'John Doe', value: 1 }
2811
- *
2812
- * public updateAutocomplete(val) {
2813
- * this.filterEl.updateValues({ autocomplete_user_id: val });
2814
- * }
2815
- *
2816
- * To update autocompletechips just pass:
2817
- *
2818
- * 1) object with name/value fields - will be appended to existing set of values
2819
- *
2820
- * { name: 'John Doe', value: 1 }
2821
- *
2822
- * 2) array of objects - will be appended to existing set of values
2823
- *
2824
- * [{ name: 'John Doe', value: 1 }, { name: 'Darya Filipova', value: 2 }]
2825
- *
2826
- * 3) null - clear existing set of values
2827
- *
2828
- * public updateAutocomplete(val) {
2829
- * this.filterEl.updateValues({ autocompletechips_user_id: val });
2830
- * }
2831
- *
2832
- */
2833
- updateValues(values) {
2834
- Object.keys(values).forEach((key) => {
2835
- const filterItem = this.items
2836
- .find((item) => item.name === key);
2837
- if (!filterItem) {
2838
- return;
2839
- }
2840
- filterItem.model = values[key];
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'
2841
2963
  });
2964
+ return this._overlay.create(overlayConfig);
2842
2965
  }
2843
- hide() {
2844
- this.changeVisibility(false);
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;
2845
2972
  }
2846
- show() {
2847
- this.changeVisibility(true);
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);
2848
2979
  }
2849
- changeVisibilityClick(value, event = null) {
2850
- if (event) {
2851
- event.stopPropagation();
2980
+ removeFilterClass() {
2981
+ this._filterMeta.openedFilters--;
2982
+ if (this._filterMeta.openedFilters === 0) {
2983
+ window.document.body.classList.remove('fs-filter-open');
2852
2984
  }
2853
- this.changeVisibility(value);
2854
2985
  }
2855
- filterInputEvent(event) {
2856
- if (!this.windowDesktop) {
2857
- return;
2986
+ addFilterClass() {
2987
+ this._filterMeta.openedFilters++;
2988
+ if (this._filterMeta.openedFilters === 1) {
2989
+ window.document.body.classList.add('fs-filter-open');
2858
2990
  }
2859
- if (['Enter', 'NumpadEnter', 'Escape'].indexOf(event.code) >= 0) {
2860
- this.changeVisibility(false);
2861
- if (this.searchTextInput) {
2862
- this.searchTextInput.nativeElement.blur();
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();
2863
2998
  }
2864
- }
2999
+ });
2865
3000
  }
2866
- getItemValue(name) {
2867
- const item = this.items
2868
- .find((item) => item.name === name);
2869
- if (item) {
2870
- return item.model;
2871
- }
2872
- else {
2873
- return null;
2874
- }
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);
2875
3046
  }
2876
- showItem(name) {
2877
- const item = this.getItem(name);
2878
- if (item) {
2879
- item.hide = false;
2880
- this._filterItems.updateVisibleItems();
2881
- }
3047
+ get isGroup() {
3048
+ return this._isGroup;
2882
3049
  }
2883
- hideItem(name) {
2884
- const item = this.getItem(name);
2885
- if (!item) {
2886
- return;
2887
- }
2888
- item.hide = true;
2889
- this._filterItems.updateVisibleItems();
3050
+ get visible() {
3051
+ return this._visible$.getValue();
2890
3052
  }
2891
- clearItem(name) {
2892
- const item = this.getItem(name);
2893
- if (!item) {
2894
- return;
2895
- }
2896
- item.clear();
3053
+ get visible$() {
3054
+ return this._visible$.asObservable();
2897
3055
  }
2898
- updateItemConfig(name, params) {
2899
- var _a, _b;
2900
- const item = this.getItem(name);
2901
- if (!item) {
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);
2902
3069
  return;
2903
3070
  }
2904
- item.label = (_a = params.label) !== null && _a !== void 0 ? _a : item.label;
2905
- item.chipLabel = (_b = params.chipLabel) !== null && _b !== void 0 ? _b : item.chipLabel;
2906
- this._filterItems.updateVisibleItems();
3071
+ const numberOfVisibleChildren = this.items
3072
+ .reduce((acc, item) => {
3073
+ item.updateVisibility();
3074
+ if (item.visible) {
3075
+ acc++;
3076
+ }
3077
+ return acc;
3078
+ }, 0);
3079
+ this._visible$.next(!!numberOfVisibleChildren);
2907
3080
  }
2908
- getItemValueChange$(name) {
2909
- const item = this.items.find((i) => i.name === name);
2910
- if (item) {
2911
- return item.value$
2912
- .pipe(map(() => {
2913
- return item.model;
2914
- }));
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();
2915
3093
  }
2916
3094
  else {
2917
- return null;
3095
+ this.click = config.click;
3096
+ this.routerLink = config.link;
3097
+ if (!this._parent) {
3098
+ this.updateVisibility();
3099
+ }
2918
3100
  }
2919
3101
  }
2920
- changeVisibility(state) {
2921
- if (state === this.showFilterMenu) {
2922
- return;
2923
- }
2924
- if (!state) {
2925
- this.closed.emit();
2926
- return this._destroyFilterDrawer();
2927
- }
2928
- if (!this.hasVisibleItemOrSorting) {
2929
- return;
2930
- }
2931
- this._listenEscButton();
2932
- this.opened.emit();
2933
- this._filterOverlay.open();
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);
2934
3113
  }
2935
- clearSearchText(event) {
2936
- event.stopPropagation();
2937
- this._filterItems.keywordItem.clear();
2938
- this.searchTextInput.nativeElement.focus();
3114
+ get visible() {
3115
+ return this._visible$.getValue();
2939
3116
  }
2940
- init() {
2941
- const data = this._filterItems.valuesAsQuery();
2942
- this._sort = this._filterItems.getSort();
2943
- this.config.init(data, this._sort);
2944
- this._updateChipsVisibility();
3117
+ get visible$() {
3118
+ return this._visible$.asObservable();
2945
3119
  }
2946
- clear(event = null) {
2947
- if (event) {
2948
- event.stopPropagation();
2949
- }
2950
- this._filterItems.filtersClear();
2951
- if (this.config.clear) {
2952
- this.config.clear();
2953
- }
3120
+ set disabled(value) {
3121
+ this._disabled$.next(value);
2954
3122
  }
2955
- /**
2956
- * Close filter window and do change callback
2957
- */
2958
- search(event) {
2959
- this.changeVisibilityClick(false, event);
3123
+ get disabled() {
3124
+ return this._disabled$.getValue();
2960
3125
  }
2961
- reload(event = null) {
2962
- if (event) {
2963
- event.preventDefault();
2964
- event.stopPropagation();
2965
- }
2966
- const data = this._filterItems.valuesAsQuery();
2967
- if (this.config.reload) {
2968
- this.config.reload(data, this._filterItems.getSort());
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);
3133
+ return;
2969
3134
  }
3135
+ const hasVisibleChildren = this.items.some((item) => item.visible);
3136
+ this._visible$.next(hasVisibleChildren);
2970
3137
  }
2971
- getItem(name) {
2972
- return this.items
2973
- .find((item) => item.name === name);
3138
+ updateDisabledState() {
3139
+ if (this._disabledFn) {
3140
+ this.disabled = this._disabledFn();
3141
+ }
2974
3142
  }
2975
- /**
2976
- * Call change callback and apply new filter values
2977
- */
2978
- change() {
2979
- const data = this._filterItems.valuesAsQuery();
2980
- const sort = this._filterItems.getSort();
2981
- const sortingChanged = ((!sort || !this._sort) && sort !== this._sort)
2982
- || (sort && this._sort && !objectsAreEquals(this._sort, sort));
2983
- if (sortingChanged) {
2984
- this._sort = sort;
2985
- if (this.config.sortChange) {
2986
- this.config.sortChange(data, sort);
2987
- }
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;
2988
3157
  }
2989
- if (this.config.change) {
2990
- this.config.change(data, sort);
3158
+ if (config.className) {
3159
+ this.className = config.className;
3160
+ this.classArray = this.className
3161
+ .split(' ');
3162
+ }
3163
+ if (this.primary) {
3164
+ this.color = 'primary';
3165
+ }
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;
2991
3198
  }
2992
- this._updateChipsVisibility();
3199
+ this.updateVisibility();
2993
3200
  }
2994
- /**
2995
- * Update filter actions config
2996
- * @param actions
2997
- */
2998
- updateActions(actions) {
2999
- 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();
3000
3213
  }
3001
- /**
3002
- * Show "Filters" button
3003
- */
3004
- showFiltersBtn() {
3005
- this._filtersBtnVisible$.next(true);
3214
+ get menuActions() {
3215
+ return this._menuActions$.value;
3006
3216
  }
3007
- /**
3008
- * Hide "Filters" button
3009
- */
3010
- hideFiltersBtn() {
3011
- this._filtersBtnVisible$.next(false);
3217
+ get actions() {
3218
+ return this._actions$.value;
3012
3219
  }
3013
- /**
3014
- * Show "Keyword" field if it present
3015
- */
3016
- showKeywordField() {
3017
- this._keywordVisible$.next(true);
3220
+ get actions$() {
3221
+ return this._actions$.asObservable();
3018
3222
  }
3019
- /**
3020
- * Hide "Keyword" field if it present
3021
- */
3022
- hideKeywordField() {
3023
- this._keywordVisible$.next(false);
3223
+ get menuActions$() {
3224
+ return this._menuActions$.asObservable();
3024
3225
  }
3025
- /**
3026
- * Go through actions and check show() callback and update visible actions
3027
- */
3028
- updateActionsVisibility() {
3029
- this._actions.updateActionsVisibility();
3226
+ get visible$() {
3227
+ return this._visible$.asObservable();
3030
3228
  }
3031
- /**
3032
- * Go through actions and check disabled() callback and update disabled state
3033
- */
3034
- updateDisabledState() {
3035
- this._actions.updateDisabledState();
3229
+ get mobileMode() {
3230
+ return this._breakpointObserver.isMatched(this._mobileMedia);
3036
3231
  }
3037
- _initFilterWithConfig(config) {
3038
- if (this.config) {
3039
- this._filterItems.destroyItems();
3040
- }
3041
- config = Object.assign(Object.assign({}, (this._defaultConfig || {})), config);
3042
- this._config = new FsFilterConfig(config);
3043
- this._actions.initActions(this._config.actions);
3044
- this._filterItems.setConfig(this._config);
3045
- this._externalParams.setConfig(this._config);
3046
- const keywordItem = this._filterItems.keywordItem;
3047
- if (keywordItem) {
3048
- this.searchText.setValue(keywordItem.model);
3049
- 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;
3050
3239
  }
3051
- if (!!this.config.reloadWhenConfigChanged) {
3052
- 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);
3053
3245
  }
3054
- this._listenKeywordItemClear();
3055
- }
3056
- _destroyFilterDrawer() {
3057
- this._filterOverlay.close();
3246
+ this._classifyActions();
3058
3247
  }
3059
- _updateWindowWidth() {
3060
- this.windowDesktop = window.innerWidth > 1200;
3248
+ show() {
3249
+ this._visible$.next(true);
3061
3250
  }
3062
- _listenEscButton() {
3063
- this._zone.runOutsideAngular(() => {
3064
- fromEvent(window, 'keyup')
3065
- .pipe(filter$1((event) => event.code === 'Escape'), takeUntil(this.closed), takeUntil(this._destroy$))
3066
- .subscribe(() => {
3067
- this._zone.run(() => {
3068
- this.changeVisibility(false);
3069
- });
3070
- });
3071
- });
3251
+ hide() {
3252
+ this._visible$.next(false);
3072
3253
  }
3073
- _listenInputKeyEvents() {
3074
- if (!this.searchTextInput) {
3075
- return;
3076
- }
3077
- this._zone.runOutsideAngular(() => {
3078
- fromEvent(this.searchTextInput.nativeElement, 'keydown')
3079
- .pipe(debounceTime(500), filter$1((event) => {
3080
- return ['Enter', 'NumpadEnter', 'Escape'].indexOf(event.code) > -1;
3081
- }), takeUntil(this._destroy$))
3082
- .subscribe((event) => {
3083
- this._zone.run(() => {
3084
- this.filterInputEvent(event);
3085
- });
3086
- });
3087
- });
3254
+ addReorderAction(action) {
3255
+ this._allActions.unshift(action);
3256
+ action.isReorderAction = true;
3257
+ this._classifyAction(action);
3258
+ this._reorderAction = action;
3088
3259
  }
3089
- _listenWindowResize() {
3090
- this._zone.runOutsideAngular(() => {
3091
- fromEvent(window, 'resize')
3092
- .pipe(debounceTime(100), takeUntil(this._destroy$))
3093
- .subscribe(() => {
3094
- this._zone.run(() => {
3095
- this._updateWindowWidth();
3096
- });
3097
- });
3098
- });
3260
+ clearActions() {
3261
+ this._allActions = [];
3262
+ this._setActions([]);
3263
+ this._setKebabActions([]);
3099
3264
  }
3100
- _listenInputChanges() {
3101
- if (!this._filterItems.keywordItem) {
3102
- return;
3103
- }
3104
- this._zone.runOutsideAngular(() => {
3105
- this.searchText.valueChanges
3106
- .pipe(debounceTime(200), distinctUntilChanged(), filter$1((value) => {
3107
- var _a;
3108
- return value !== ((_a = this._filterItems.keywordItem) === null || _a === void 0 ? void 0 : _a.model);
3109
- }), takeUntil(this._destroy$))
3110
- .subscribe((value) => {
3111
- this._zone.run(() => {
3112
- const keywordItem = this._filterItems.keywordItem;
3113
- if (keywordItem && keywordItem.value !== value) {
3114
- keywordItem.model = value;
3115
- }
3116
- });
3117
- });
3118
- });
3265
+ updateActionsVisibility() {
3266
+ this._allActions.forEach((action) => action.updateVisibility());
3267
+ this._classifyActions();
3119
3268
  }
3120
- _listenKeywordItemClear() {
3121
- var _a;
3122
- (_a = this._filterItems
3123
- .keywordItem) === null || _a === void 0 ? void 0 : _a.clear$.pipe(takeUntil(this._filterItems.keywordItem.destroy$), takeUntil(this._destroy$)).subscribe(() => {
3124
- this.searchText.setValue('');
3125
- });
3269
+ updateDisabledState() {
3270
+ this.actions.forEach((action) => action.updateDisabledState());
3126
3271
  }
3127
- _listenInternalItemsChange() {
3128
- this._filterItems
3129
- .itemsChange$
3130
- .pipe(takeUntil(this._destroy$))
3131
- .subscribe(() => {
3132
- this.change();
3133
- });
3272
+ _setKebabActions(actions) {
3273
+ this._menuActions$.next(actions);
3134
3274
  }
3135
- _initOverlay() {
3136
- this._filterOverlay.setClearFn(this.clear.bind(this));
3137
- this._filterOverlay.setDoneFn(this.hide.bind(this));
3275
+ _setActions(actions) {
3276
+ this._actions$.next(actions);
3138
3277
  }
3139
- // We may need some time to recieve external params and after that ready can be emitted
3140
- _listenWhenFilterReady() {
3141
- combineLatest([
3142
- this._externalParams.pending$,
3143
- this.itemsReady$,
3144
- ])
3145
- .pipe(filter$1(([pendingParams, itemsReady]) => !pendingParams && itemsReady), takeUntil(this._destroy$))
3146
- .subscribe(() => {
3147
- if (this.config.init) {
3148
- 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);
3149
3292
  }
3150
- this.ready.emit();
3151
- });
3152
- }
3153
- _updateChipsVisibility() {
3154
- const hasFilterChips = this._filterItems.items
3155
- .some((item) => {
3156
- return item.isChipVisible;
3157
3293
  });
3158
- this._hasFilterChips$.next(hasFilterChips);
3294
+ this._setKebabActions(kebabActions);
3295
+ this._setActions(actions);
3159
3296
  }
3160
- };
3161
- FilterComponent.ctorParameters = () => [
3162
- { type: FsFilterOverlayService },
3163
- { type: NgZone },
3164
- { type: ExternalParamsController },
3165
- { type: FsFilterItemsStore },
3166
- { type: ActionsController },
3167
- { type: FsFilterConfig, decorators: [{ type: Optional }, { type: Inject, args: [FS_FILTER_CONFIG,] }] }
3168
- ];
3169
- __decorate([
3170
- Input('config'),
3171
- __metadata("design:type", Object),
3172
- __metadata("design:paramtypes", [Object])
3173
- ], FilterComponent.prototype, "setConfig", null);
3174
- __decorate([
3175
- Input('filter'),
3176
- __metadata("design:type", Object),
3177
- __metadata("design:paramtypes", [Object])
3178
- ], FilterComponent.prototype, "setFilter", null);
3179
- __decorate([
3180
- Input(),
3181
- __metadata("design:type", Object)
3182
- ], FilterComponent.prototype, "showSortBy", void 0);
3183
- __decorate([
3184
- Input(),
3185
- __metadata("design:type", Object)
3186
- ], FilterComponent.prototype, "showFilterInput", void 0);
3187
- __decorate([
3188
- Output(),
3189
- __metadata("design:type", Object)
3190
- ], FilterComponent.prototype, "closed", void 0);
3191
- __decorate([
3192
- Output(),
3193
- __metadata("design:type", Object)
3194
- ], FilterComponent.prototype, "opened", void 0);
3195
- __decorate([
3196
- Output(),
3197
- __metadata("design:type", Object)
3198
- ], FilterComponent.prototype, "ready", void 0);
3199
- __decorate([
3200
- ContentChild(FilterStatusBarDirective, { read: TemplateRef }),
3201
- __metadata("design:type", Object)
3202
- ], FilterComponent.prototype, "statusBar", void 0);
3203
- __decorate([
3204
- ViewChild('searchTextInput'),
3205
- __metadata("design:type", ElementRef)
3206
- ], FilterComponent.prototype, "searchTextInput", void 0);
3207
- __decorate([
3208
- ViewChild('searchTextInput', { read: MatInput }),
3209
- __metadata("design:type", MatInput)
3210
- ], FilterComponent.prototype, "searchTextMatInput", void 0);
3211
- __decorate([
3212
- HostBinding('class.filters-open'),
3213
- __metadata("design:type", Object)
3214
- ], FilterComponent.prototype, "showFilterMenu", void 0);
3215
- __decorate([
3216
- HostBinding('class.window-desktop'),
3217
- __metadata("design:type", Object)
3218
- ], FilterComponent.prototype, "windowDesktop", void 0);
3219
- __decorate([
3220
- HostBinding('class.fs-filter'),
3221
- __metadata("design:type", Object)
3222
- ], FilterComponent.prototype, "fsFilterClass", void 0);
3223
- FilterComponent = __decorate([
3224
- Component({
3225
- selector: 'fs-filter',
3226
- 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",
3227
- encapsulation: ViewEncapsulation.None,
3228
- providers: [
3229
- FsFilterOverlayService,
3230
- ExternalParamsController,
3231
- PersistanceParamsController,
3232
- QueryParamsController,
3233
- FocusControllerService,
3234
- FsFilterItemsStore,
3235
- SavedFiltersController,
3236
- ActionsController,
3237
- ],
3238
- changeDetection: ChangeDetectionStrategy.OnPush,
3239
- 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}"]
3240
- }),
3241
- __param(5, Optional()), __param(5, Inject(FS_FILTER_CONFIG)),
3242
- __metadata("design:paramtypes", [FsFilterOverlayService,
3243
- NgZone,
3244
- ExternalParamsController,
3245
- FsFilterItemsStore,
3246
- ActionsController,
3247
- FsFilterConfig])
3248
- ], 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
+ }] } });
3249
3376
 
3250
- let FilterItemComponent = class FilterItemComponent {
3377
+ class FsFilterChipContentComponent {
3251
3378
  constructor(_cdRef) {
3252
3379
  this._cdRef = _cdRef;
3253
3380
  this._destroy$ = new Subject();
3254
- this.itemType = ItemType;
3255
3381
  }
3256
3382
  ngOnInit() {
3383
+ this.listenValueChangesForRanges();
3384
+ }
3385
+ ngOnDestroy() {
3386
+ this._destroy$.next();
3387
+ this._destroy$.complete();
3388
+ }
3389
+ listenValueChangesForRanges() {
3257
3390
  this.item.value$
3258
3391
  .pipe(takeUntil(this._destroy$))
3259
3392
  .subscribe(() => {
3260
- this._cdRef.markForCheck();
3393
+ this.content = this._getContent();
3394
+ this._cdRef.detectChanges();
3261
3395
  });
3262
3396
  }
3263
- ngOnDestroy() {
3264
- this._destroy$.next();
3265
- 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
+ }
3266
3427
  }
3267
- };
3268
- FilterItemComponent.ctorParameters = () => [
3269
- { type: ChangeDetectorRef }
3270
- ];
3271
- __decorate([
3272
- Input(),
3273
- __metadata("design:type", BaseItem)
3274
- ], FilterItemComponent.prototype, "item", void 0);
3275
- FilterItemComponent = __decorate([
3276
- Component({
3277
- selector: 'filter-item',
3278
- 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",
3279
- changeDetection: ChangeDetectionStrategy.OnPush
3280
- }),
3281
- __metadata("design:paramtypes", [ChangeDetectorRef])
3282
- ], FilterItemComponent);
3283
-
3284
- let BaseItemComponent = class BaseItemComponent {
3285
- constructor(_kvDiffers, _cd) {
3286
- this._kvDiffers = _kvDiffers;
3287
- this._cd = _cd;
3288
- this.inline = false;
3289
- this._destroy$ = new Subject();
3290
- this._debouncer$ = new Subject();
3291
- this._kvDiffer = this._kvDiffers.find(this.item || {}).create();
3292
- 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]}`;
3293
3447
  }
3294
- set item(value) {
3295
- this._item = value;
3448
+ else if (type === 'to' && labelArr[1]) {
3449
+ return `${labelArr[1]}`;
3296
3450
  }
3297
- ;
3298
- get item() {
3299
- return this._item;
3451
+ else {
3452
+ return '';
3300
3453
  }
3301
- ngDoCheck() {
3302
- if (this._kvDiffer) {
3303
- const changes = this._kvDiffer.diff(this.item);
3304
- if (changes) {
3305
- this._cd.detectChanges();
3306
- }
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();
3307
3479
  }
3308
3480
  }
3309
3481
  ngOnDestroy() {
3310
3482
  this._destroy$.next();
3311
3483
  this._destroy$.complete();
3312
3484
  }
3313
- listenWithDebounce() {
3314
- this._debouncer$
3315
- .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$))
3316
3502
  .subscribe(() => {
3317
- this.item.valueChanged();
3503
+ this._updateVisibility();
3504
+ this._cdRef.markForCheck();
3318
3505
  });
3319
3506
  }
3320
- itemChange() {
3321
- this._debouncer$.next();
3322
- }
3323
- };
3324
- BaseItemComponent.ctorParameters = () => [
3325
- { type: KeyValueDiffers },
3326
- { type: ChangeDetectorRef }
3327
- ];
3328
- __decorate([
3329
- Input(),
3330
- __metadata("design:type", Object),
3331
- __metadata("design:paramtypes", [Object])
3332
- ], BaseItemComponent.prototype, "item", null);
3333
- __decorate([
3334
- Input(),
3335
- __metadata("design:type", Object)
3336
- ], BaseItemComponent.prototype, "inline", void 0);
3337
- BaseItemComponent = __decorate([
3338
- Component({
3339
- selector: 'base-item',
3340
- template: '',
3341
- changeDetection: ChangeDetectionStrategy.OnPush
3342
- }),
3343
- __metadata("design:paramtypes", [KeyValueDiffers,
3344
- ChangeDetectorRef])
3345
- ], BaseItemComponent);
3346
-
3347
- let SelectComponent = class SelectComponent extends BaseItemComponent {
3348
- constructor(_kvDiffers, _cd) {
3349
- super(_kvDiffers, _cd);
3350
- this._kvDiffers = _kvDiffers;
3351
- this._cd = _cd;
3352
- // For case when we have multiple selection with __all option
3353
- // If _all has been selected than we must disable all other items
3354
- this.allItemsOptionSelected = false;
3507
+ _updateVisibility() {
3508
+ this.itemVisible = this.item.isChipVisible;
3355
3509
  }
3356
- ngDoCheck() {
3357
- if (this._kvDiffer) {
3358
- const changes = this._kvDiffer.diff(this.item);
3359
- if (changes) {
3360
- this._cd.markForCheck();
3361
- if (this.selectedItem) {
3362
- this.selectedItem.cd.markForCheck();
3363
- }
3364
- }
3365
- }
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
+ }));
3366
3518
  }
3367
- };
3368
- SelectComponent.ctorParameters = () => [
3369
- { type: KeyValueDiffers },
3370
- { type: ChangeDetectorRef }
3371
- ];
3372
- __decorate([
3373
- ViewChild('selectItem'),
3374
- __metadata("design:type", Object)
3375
- ], SelectComponent.prototype, "selectedItem", void 0);
3376
- SelectComponent = __decorate([
3377
- Component({
3378
- selector: 'filter-item-select',
3379
- 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",
3380
- changeDetection: ChangeDetectionStrategy.OnPush
3381
- }),
3382
- __metadata("design:paramtypes", [KeyValueDiffers,
3383
- ChangeDetectorRef])
3384
- ], 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
+ }] } });
3385
3533
 
3386
- let SelectGroupsComponent = class SelectGroupsComponent {
3387
- constructor(cd) {
3388
- this.cd = cd;
3389
- }
3390
- compare(o1, o2) {
3391
- return o1 == o2;
3534
+ class FsFilterChipsComponent {
3535
+ constructor() {
3536
+ this.chips = [];
3392
3537
  }
3393
- };
3394
- SelectGroupsComponent.ctorParameters = () => [
3395
- { type: ChangeDetectorRef }
3396
- ];
3397
- __decorate([
3398
- ViewChild('select', { static: true }),
3399
- __metadata("design:type", MatSelect)
3400
- ], SelectGroupsComponent.prototype, "select", void 0);
3401
- __decorate([
3402
- Input(),
3403
- __metadata("design:type", Object)
3404
- ], SelectGroupsComponent.prototype, "item", void 0);
3405
- SelectGroupsComponent = __decorate([
3406
- Component({
3407
- selector: 'filter-item-select-groups',
3408
- 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",
3409
- changeDetection: ChangeDetectionStrategy.OnPush
3410
- }),
3411
- __metadata("design:paramtypes", [ChangeDetectorRef])
3412
- ], 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
+ }] } });
3413
3552
 
3414
- let SelectSimpleComponent = class SelectSimpleComponent {
3415
- constructor(cd) {
3416
- 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();
3417
3589
  }
3418
- changed() {
3419
- if (this.item.isolate) {
3420
- this.item.isolate.enabled = false;
3421
- }
3590
+ set setConfig(config) {
3591
+ this._initFilterWithConfig(config);
3422
3592
  }
3423
- isolateChange(filter) {
3424
- if (filter.isolate.enabled) {
3425
- filter.model = filter.isolate.value;
3426
- }
3427
- else {
3428
- filter.model = null;
3429
- }
3593
+ set setFilter(config) {
3594
+ this._initFilterWithConfig(config);
3430
3595
  }
3431
- };
3432
- SelectSimpleComponent.ctorParameters = () => [
3433
- { type: ChangeDetectorRef }
3434
- ];
3435
- __decorate([
3436
- Input(),
3437
- __metadata("design:type", SimpleSelectItem)
3438
- ], SelectSimpleComponent.prototype, "item", void 0);
3439
- __decorate([
3440
- ViewChild('select', { static: true }),
3441
- __metadata("design:type", MatSelect)
3442
- ], SelectSimpleComponent.prototype, "select", void 0);
3443
- SelectSimpleComponent = __decorate([
3444
- Component({
3445
- selector: 'filter-item-select-simple',
3446
- 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",
3447
- changeDetection: ChangeDetectionStrategy.OnPush,
3448
- styles: [".isolate{margin-bottom:25px}"]
3449
- }),
3450
- __metadata("design:paramtypes", [ChangeDetectorRef])
3451
- ], SelectSimpleComponent);
3452
-
3453
- let SelectMultipleComponent = class SelectMultipleComponent {
3454
- constructor(cd) {
3455
- this.cd = cd;
3596
+ get config() {
3597
+ return this._config;
3456
3598
  }
3457
- changed() {
3458
- if (this.item.isolate) {
3459
- this.item.isolate.enabled = false;
3460
- if (this.item.multiple && Array.isArray(this.item.model)) {
3461
- const index = this.item.model.indexOf(this.item.isolate.value);
3462
- if (index > -1) {
3463
- this.item.model.splice(index, 1);
3464
- }
3465
- }
3466
- }
3599
+ get filterParams() {
3600
+ return this._filterItems.values();
3467
3601
  }
3468
- close() {
3469
- this.select.close();
3602
+ get filterParamsQuery() {
3603
+ return this._filterItems.valuesAsQuery();
3470
3604
  }
3471
- isolateChange(filter) {
3472
- if (filter.isolate.enabled) {
3473
- filter.model = filter.multiple ? [filter.isolate.value] : filter.isolate.value;
3474
- }
3475
- else {
3476
- if (filter.multiple) {
3477
- filter.model = filter.defaultValue ? filter.defaultValue : [];
3478
- }
3479
- else {
3480
- filter.model = filter.defaultValue ? filter.defaultValue : null;
3481
- }
3482
- }
3605
+ get items() {
3606
+ return this._filterItems.items;
3483
3607
  }
3484
- };
3485
- SelectMultipleComponent.ctorParameters = () => [
3486
- { type: ChangeDetectorRef }
3487
- ];
3488
- __decorate([
3489
- Input(),
3490
- __metadata("design:type", Object)
3491
- ], SelectMultipleComponent.prototype, "item", void 0);
3492
- __decorate([
3493
- ViewChild('select', { static: true }),
3494
- __metadata("design:type", MatSelect)
3495
- ], SelectMultipleComponent.prototype, "select", void 0);
3496
- SelectMultipleComponent = __decorate([
3497
- Component({
3498
- selector: 'filter-item-select-multiple',
3499
- 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",
3500
- changeDetection: ChangeDetectionStrategy.OnPush,
3501
- styles: [".isolate{margin-bottom:25px}"]
3502
- }),
3503
- __metadata("design:paramtypes", [ChangeDetectorRef])
3504
- ], SelectMultipleComponent);
3505
-
3506
- let ChipsComponent = class ChipsComponent extends BaseItemComponent {
3507
- constructor(_kvDiffers, _cd) {
3508
- super(_kvDiffers, _cd);
3509
- this._kvDiffers = _kvDiffers;
3510
- this._cd = _cd;
3608
+ get visibleItems() {
3609
+ return this._filterItems.visibleItems;
3511
3610
  }
3512
- modelChange() {
3513
- this.itemChange();
3611
+ get itemsReady$() {
3612
+ return this._filterItems.ready$;
3514
3613
  }
3515
- compareFn(modelValue, chipValue) {
3516
- return modelValue.value === chipValue.value;
3614
+ get hasFilterChips$() {
3615
+ return this._hasFilterChips$.asObservable();
3517
3616
  }
3518
- };
3519
- ChipsComponent.ctorParameters = () => [
3520
- { type: KeyValueDiffers },
3521
- { type: ChangeDetectorRef }
3522
- ];
3523
- ChipsComponent = __decorate([
3524
- Component({
3525
- selector: 'filter-item-chips',
3526
- 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",
3527
- changeDetection: ChangeDetectionStrategy.OnPush,
3528
- styles: ["fs-chip{line-height:40px}"]
3529
- }),
3530
- __metadata("design:paramtypes", [KeyValueDiffers,
3531
- ChangeDetectorRef])
3532
- ], ChipsComponent);
3533
-
3534
- let TextComponent = class TextComponent extends BaseItemComponent {
3535
- constructor(_kvDiffers, _cd) {
3536
- super(_kvDiffers, _cd);
3537
- this._kvDiffers = _kvDiffers;
3538
- this._cd = _cd;
3539
- this.textControl = new FormControl();
3540
- this.destroy$ = new Subject();
3617
+ get hasVisibleItemOrSorting() {
3618
+ return this.visibleItems.length > 0 || !!this._filterItems.sortByItem;
3541
3619
  }
3542
- ngOnInit() {
3543
- this._listenControlValueChanges();
3544
- this._listenModelChanges();
3620
+ get hasKeyword() {
3621
+ return this._filterItems.hasKeyword;
3545
3622
  }
3546
- ngOnDestroy() {
3547
- this.destroy$.next();
3548
- this.destroy$.complete();
3623
+ get filtersBtnVisible$() {
3624
+ return this._filtersBtnVisible$.asObservable();
3549
3625
  }
3550
- _listenControlValueChanges() {
3551
- this.textControl.valueChanges
3552
- .pipe(distinctUntilChanged(), debounceTime(200), takeUntil(this.destroy$))
3553
- .subscribe((value) => {
3554
- this.item.model = value;
3555
- });
3626
+ get keywordVisible$() {
3627
+ return this._keywordVisible$.asObservable();
3556
3628
  }
3557
- _listenModelChanges() {
3558
- this._item.value$
3559
- .pipe(takeUntil(this.destroy$))
3560
- .subscribe(() => {
3561
- this.textControl.setValue(this.item.model, { emitEvent: false });
3562
- });
3629
+ get actionsVisible$() {
3630
+ return this._actions.visible$;
3563
3631
  }
3564
- };
3565
- TextComponent.ctorParameters = () => [
3566
- { type: KeyValueDiffers },
3567
- { type: ChangeDetectorRef }
3568
- ];
3569
- TextComponent = __decorate([
3570
- Component({
3571
- selector: 'filter-item-text',
3572
- 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",
3573
- changeDetection: ChangeDetectionStrategy.OnPush,
3574
- styles: [""]
3575
- }),
3576
- __metadata("design:paramtypes", [KeyValueDiffers,
3577
- ChangeDetectorRef])
3578
- ], TextComponent);
3579
-
3580
- let RangeComponent = class RangeComponent extends BaseItemComponent {
3581
- constructor(_kvDiffers, _cd) {
3582
- super(_kvDiffers, _cd);
3583
- this._kvDiffers = _kvDiffers;
3584
- this._cd = _cd;
3632
+ get actions$() {
3633
+ return this._actions.actions$;
3634
+ }
3635
+ get menuActions$() {
3636
+ return this._actions.menuActions$;
3585
3637
  }
3586
3638
  ngOnInit() {
3587
- this.listenChanges();
3639
+ // Avoid ngChanges error
3640
+ setTimeout(() => {
3641
+ if (this.config.autofocus) {
3642
+ this.focus();
3643
+ }
3644
+ });
3645
+ this._listenInternalItemsChange();
3646
+ this._initOverlay();
3588
3647
  }
3589
- listenChanges() {
3590
- const fromListener = fromEvent(this.from.nativeElement, 'keyup')
3591
- .pipe(distinctUntilChanged());
3592
- const toListener = fromEvent(this.to.nativeElement, 'keyup')
3593
- .pipe(distinctUntilChanged());
3594
- merge(fromListener, toListener)
3595
- .pipe(takeUntil(this._destroy$))
3596
- .subscribe(() => {
3597
- this.itemChange();
3648
+ ngAfterViewInit() {
3649
+ this._listenInputKeyEvents();
3650
+ // FIXME prevent fire change after init
3651
+ setTimeout(() => {
3652
+ this._listenInputChanges();
3598
3653
  });
3599
3654
  }
3600
- };
3601
- RangeComponent.ctorParameters = () => [
3602
- { type: KeyValueDiffers },
3603
- { type: ChangeDetectorRef }
3604
- ];
3605
- __decorate([
3606
- ViewChild('from', { static: true }),
3607
- __metadata("design:type", ElementRef)
3608
- ], RangeComponent.prototype, "from", void 0);
3609
- __decorate([
3610
- ViewChild('to', { static: true }),
3611
- __metadata("design:type", Object)
3612
- ], RangeComponent.prototype, "to", void 0);
3613
- RangeComponent = __decorate([
3614
- Component({
3615
- selector: 'filter-item-range',
3616
- 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",
3617
- changeDetection: ChangeDetectionStrategy.OnPush,
3618
- 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}"]
3619
- }),
3620
- __metadata("design:paramtypes", [KeyValueDiffers,
3621
- ChangeDetectorRef])
3622
- ], RangeComponent);
3623
-
3624
- let AutocompleteComponent = class AutocompleteComponent extends BaseItemComponent {
3625
- constructor(_kvDiffers, _cd) {
3626
- super(_kvDiffers, _cd);
3627
- this._kvDiffers = _kvDiffers;
3628
- this._cd = _cd;
3629
- this.displayWith = (data) => {
3630
- return data ? data.name : data;
3631
- };
3632
- this.fetch = (keyword) => {
3633
- return this.item.valuesFn(keyword);
3634
- };
3655
+ ngOnDestroy() {
3656
+ this._destroyFilterDrawer();
3657
+ this._destroy$.next();
3658
+ this._destroy$.complete();
3635
3659
  }
3636
- };
3637
- AutocompleteComponent.ctorParameters = () => [
3638
- { type: KeyValueDiffers },
3639
- { type: ChangeDetectorRef }
3640
- ];
3641
- AutocompleteComponent = __decorate([
3642
- Component({
3643
- selector: 'filter-item-autocomplete',
3644
- 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",
3645
- changeDetection: ChangeDetectionStrategy.OnPush
3646
- }),
3647
- __metadata("design:paramtypes", [KeyValueDiffers,
3648
- ChangeDetectorRef])
3649
- ], AutocompleteComponent);
3650
-
3651
- let AutocompletechipsComponent = class AutocompletechipsComponent extends BaseItemComponent {
3652
- constructor(_kvDiffers, _cd) {
3653
- super(_kvDiffers, _cd);
3654
- this._kvDiffers = _kvDiffers;
3655
- this._cd = _cd;
3656
- this.fetch = (keyword) => {
3657
- return this.item.valuesFn(keyword);
3658
- };
3660
+ focus() {
3661
+ if (this.searchTextMatInput) {
3662
+ this.searchTextMatInput.focus();
3663
+ }
3659
3664
  }
3660
- // SP-T1747
3661
- clicked() {
3662
- this.chipBackground = this.item.chipBackground;
3663
- this.chipColor = this.item.chipColor;
3664
- this.chipIcon = this.item.chipIcon;
3665
- this._cd.markForCheck();
3665
+ updateSort(sort) {
3666
+ this._filterItems.updateSort(sort);
3666
3667
  }
3667
- addAutocompleteChipItem(event) {
3668
- if (event.data && this.item.model.indexOf(event.data.value) === -1) {
3669
- this.item.model.push(event.data);
3670
- this.itemChange();
3671
- }
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
+ });
3672
3734
  }
3673
- removeAutocompleteChipItem(event) {
3674
- remove(this.item.model, { value: event.data.value });
3675
- this.itemChange();
3735
+ hide() {
3736
+ this.changeVisibility(false);
3676
3737
  }
3677
- clearAutocompleteChipItem() {
3678
- this.item.clear();
3679
- this.itemChange();
3738
+ show() {
3739
+ this.changeVisibility(true);
3680
3740
  }
3681
- compareItems(item1, item2) {
3682
- 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);
3683
3746
  }
3684
- };
3685
- AutocompletechipsComponent.ctorParameters = () => [
3686
- { type: KeyValueDiffers },
3687
- { type: ChangeDetectorRef }
3688
- ];
3689
- AutocompletechipsComponent = __decorate([
3690
- Component({
3691
- selector: 'filter-item-autocompletechips',
3692
- 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",
3693
- changeDetection: ChangeDetectionStrategy.OnPush
3694
- }),
3695
- __metadata("design:paramtypes", [KeyValueDiffers,
3696
- ChangeDetectorRef])
3697
- ], AutocompletechipsComponent);
3698
-
3699
- let DateComponent = class DateComponent extends BaseItemComponent {
3700
- constructor(_kvDiffers, _cd) {
3701
- super(_kvDiffers, _cd);
3702
- this._kvDiffers = _kvDiffers;
3703
- this._cd = _cd;
3704
- this.viewType = 'date';
3705
- this.itemDateMode = ItemDateMode;
3706
- this.showYear = true;
3707
- this.showMonth = true;
3708
- 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
+ }
3709
3757
  }
3710
- ngOnInit() {
3711
- if (this.item.type === ItemType.DateTime) {
3712
- this.viewType = 'datetime';
3758
+ getItemValue(name) {
3759
+ const item = this.items
3760
+ .find((item) => item.name === name);
3761
+ if (item) {
3762
+ return item.model;
3713
3763
  }
3714
3764
  else {
3715
- this.viewType = 'date';
3765
+ return null;
3716
3766
  }
3717
- if (this.item.mode === ItemDateMode.ScrollMonthYear) {
3718
- this.showDay = false;
3767
+ }
3768
+ showItem(name) {
3769
+ const item = this.getItem(name);
3770
+ if (item) {
3771
+ item.hide = false;
3772
+ this._filterItems.updateVisibleItems();
3719
3773
  }
3720
3774
  }
3721
- };
3722
- DateComponent.ctorParameters = () => [
3723
- { type: KeyValueDiffers },
3724
- { type: ChangeDetectorRef }
3725
- ];
3726
- DateComponent = __decorate([
3727
- Component({
3728
- selector: 'filter-item-date',
3729
- 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",
3730
- changeDetection: ChangeDetectionStrategy.OnPush
3731
- }),
3732
- __metadata("design:paramtypes", [KeyValueDiffers,
3733
- ChangeDetectorRef])
3734
- ], DateComponent);
3735
-
3736
- let DateRangeComponent = class DateRangeComponent extends BaseItemComponent {
3737
- constructor(_kvDiffers, _cd) {
3738
- super(_kvDiffers, _cd);
3739
- this._kvDiffers = _kvDiffers;
3740
- this._cd = _cd;
3741
- 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();
3742
3782
  }
3743
- ngOnInit() {
3744
- if (this.item.type === ItemType.DateTimeRange) {
3745
- 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
+ }));
3746
3807
  }
3747
3808
  else {
3748
- this.viewType = 'date';
3809
+ return null;
3749
3810
  }
3750
3811
  }
3751
- };
3752
- DateRangeComponent.ctorParameters = () => [
3753
- { type: KeyValueDiffers },
3754
- { type: ChangeDetectorRef }
3755
- ];
3756
- DateRangeComponent = __decorate([
3757
- Component({
3758
- selector: 'filter-item-date-range',
3759
- 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",
3760
- changeDetection: ChangeDetectionStrategy.OnPush
3761
- }),
3762
- __metadata("design:paramtypes", [KeyValueDiffers,
3763
- ChangeDetectorRef])
3764
- ], DateRangeComponent);
3765
-
3766
- let CheckboxComponent = class CheckboxComponent extends BaseItemComponent {
3767
- constructor(_kvDiffers, _cd) {
3768
- super(_kvDiffers, _cd);
3769
- this._kvDiffers = _kvDiffers;
3770
- 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();
3771
3826
  }
3772
- };
3773
- CheckboxComponent.ctorParameters = () => [
3774
- { type: KeyValueDiffers },
3775
- { type: ChangeDetectorRef }
3776
- ];
3777
- CheckboxComponent = __decorate([
3778
- Component({
3779
- selector: 'filter-item-checkbox',
3780
- template: "<fs-label-field>\n <mat-checkbox [(ngModel)]=\"item.model\">\n {{ item.label }}\n </mat-checkbox>\n</fs-label-field>\n",
3781
- changeDetection: ChangeDetectionStrategy.OnPush,
3782
- styles: ["fs-label-field{margin:0}"]
3783
- }),
3784
- __metadata("design:paramtypes", [KeyValueDiffers,
3785
- ChangeDetectorRef])
3786
- ], CheckboxComponent);
3787
-
3788
- let FsFilterChipsComponent = class FsFilterChipsComponent {
3789
- constructor() {
3790
- this.chips = [];
3827
+ clearSearchText(event) {
3828
+ event.stopPropagation();
3829
+ this._filterItems.keywordItem.clear();
3830
+ this.searchTextInput.nativeElement.focus();
3791
3831
  }
3792
- };
3793
- __decorate([
3794
- Input(),
3795
- __metadata("design:type", Array)
3796
- ], FsFilterChipsComponent.prototype, "filters", void 0);
3797
- FsFilterChipsComponent = __decorate([
3798
- Component({
3799
- selector: 'fs-filter-chips',
3800
- 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",
3801
- changeDetection: ChangeDetectionStrategy.OnPush,
3802
- styles: [""]
3803
- })
3804
- ], FsFilterChipsComponent);
3805
-
3806
- let SelectBackdropComponent = class SelectBackdropComponent {
3807
- constructor() { }
3808
- };
3809
- SelectBackdropComponent = __decorate([
3810
- Component({
3811
- selector: 'filter-item-select-backdrop',
3812
- template: "",
3813
- changeDetection: ChangeDetectionStrategy.OnPush,
3814
- styles: [":host{position:absolute;top:0;bottom:0;right:0;z-index:1002;left:0}"]
3815
- }),
3816
- __metadata("design:paramtypes", [])
3817
- ], SelectBackdropComponent);
3818
-
3819
- let FsFilterChipComponent = class FsFilterChipComponent {
3820
- constructor(_cdRef, _focusController) {
3821
- this._cdRef = _cdRef;
3822
- this._focusController = _focusController;
3823
- this._chipRenderTimer$ = timer(500)
3824
- .pipe(mapTo(true));
3825
- 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();
3826
3837
  }
3827
- ngOnInit() {
3828
- this.rangeItem = this.item.isTypeDateRange
3829
- || this.item.isTypeRange
3830
- || this.item.isTypeDateTimeRange;
3831
- this.listenValueChangesForRanges();
3832
- this._updateVisibility();
3833
- if (this.item.hasPendingValues) {
3834
- this.item.loadAsyncValues(false);
3835
- this.item.values$
3836
- .pipe(take(2), takeUntil(this._destroy$))
3837
- .subscribe(() => {
3838
- this._updateVisibility();
3839
- this._cdRef.markForCheck();
3840
- });
3841
- 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();
3842
3845
  }
3843
3846
  }
3844
- ngOnDestroy() {
3845
- this._destroy$.next();
3846
- this._destroy$.complete();
3847
- }
3848
- focusOnItem(type = null) {
3849
- this._focusController.click(this.item, type);
3847
+ /**
3848
+ * Close filter window and do change callback
3849
+ */
3850
+ search(event) {
3851
+ this.changeVisibilityClick(false, event);
3850
3852
  }
3851
- removeItem(event, type = null) {
3852
- if (this.item instanceof RangeItem) {
3853
- this.item.clearRange(type);
3853
+ reload(event = null) {
3854
+ if (event) {
3855
+ event.preventDefault();
3856
+ event.stopPropagation();
3854
3857
  }
3855
- else if (this.item instanceof DateRangeItem || this.item instanceof DateTimeRangeItem) {
3856
- this.item.clearDateRange(type);
3858
+ const data = this._filterItems.valuesAsQuery();
3859
+ if (this.config.reload) {
3860
+ this.config.reload(data, this._filterItems.getSort());
3857
3861
  }
3858
- else {
3859
- 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);
3860
3883
  }
3884
+ this._updateChipsVisibility();
3861
3885
  }
3862
- listenValueChangesForRanges() {
3863
- this.item.value$
3864
- .pipe(distinctUntilChanged(), takeUntil(this._destroy$))
3865
- .subscribe(() => {
3866
- this._updateVisibility();
3867
- this._cdRef.markForCheck();
3868
- });
3886
+ /**
3887
+ * Update filter actions config
3888
+ * @param actions
3889
+ */
3890
+ updateActions(actions) {
3891
+ this._actions.initActions(actions);
3869
3892
  }
3870
- _updateVisibility() {
3871
- this.itemVisible = this.item.isChipVisible;
3893
+ /**
3894
+ * Show "Filters" button
3895
+ */
3896
+ showFiltersBtn() {
3897
+ this._filtersBtnVisible$.next(true);
3872
3898
  }
3873
- _initDelayRender() {
3874
- this.chipDelayedRender$ = combineLatest([
3875
- this.item.values$,
3876
- this._chipRenderTimer$.pipe(startWith(false))
3877
- ])
3878
- .pipe(map(([values, timerValue]) => {
3879
- return !!values || timerValue;
3880
- }));
3899
+ /**
3900
+ * Hide "Filters" button
3901
+ */
3902
+ hideFiltersBtn() {
3903
+ this._filtersBtnVisible$.next(false);
3881
3904
  }
3882
- };
3883
- FsFilterChipComponent.ctorParameters = () => [
3884
- { type: ChangeDetectorRef },
3885
- { type: FocusControllerService }
3886
- ];
3887
- __decorate([
3888
- Input(),
3889
- __metadata("design:type", BaseItem)
3890
- ], FsFilterChipComponent.prototype, "item", void 0);
3891
- FsFilterChipComponent = __decorate([
3892
- Component({
3893
- selector: 'fs-filter-chip',
3894
- 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",
3895
- changeDetection: ChangeDetectionStrategy.OnPush,
3896
- styles: ["fs-chip{cursor:pointer;color:#6f6f6f}"]
3897
- }),
3898
- __metadata("design:paramtypes", [ChangeDetectorRef,
3899
- FocusControllerService])
3900
- ], FsFilterChipComponent);
3901
-
3902
- let FsFilterDrawerActionsComponent = class FsFilterDrawerActionsComponent {
3903
- constructor(externalParams) {
3904
- this.externalParams = externalParams;
3905
- this._clear = new EventEmitter();
3906
- this._done = new EventEmitter();
3905
+ /**
3906
+ * Show "Keyword" field if it present
3907
+ */
3908
+ showKeywordField() {
3909
+ this._keywordVisible$.next(true);
3907
3910
  }
3908
- get savedFilters() {
3909
- return this.externalParams.savedFiltersController;
3911
+ /**
3912
+ * Hide "Keyword" field if it present
3913
+ */
3914
+ hideKeywordField() {
3915
+ this._keywordVisible$.next(false);
3910
3916
  }
3911
- done() {
3912
- this._done.emit();
3917
+ /**
3918
+ * Go through actions and check show() callback and update visible actions
3919
+ */
3920
+ updateActionsVisibility() {
3921
+ this._actions.updateActionsVisibility();
3913
3922
  }
3914
- clear() {
3915
- this._clear.emit();
3923
+ /**
3924
+ * Go through actions and check disabled() callback and update disabled state
3925
+ */
3926
+ updateDisabledState() {
3927
+ this._actions.updateDisabledState();
3916
3928
  }
3917
- saveFilters() {
3918
- this.externalParams
3919
- .savedFiltersController
3920
- .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();
3921
3936
  }
3922
- };
3923
- FsFilterDrawerActionsComponent.ctorParameters = () => [
3924
- { type: ExternalParamsController }
3925
- ];
3926
- __decorate([
3927
- Output('clear'),
3928
- __metadata("design:type", Object)
3929
- ], FsFilterDrawerActionsComponent.prototype, "_clear", void 0);
3930
- __decorate([
3931
- Output('done'),
3932
- __metadata("design:type", Object)
3933
- ], FsFilterDrawerActionsComponent.prototype, "_done", void 0);
3934
- FsFilterDrawerActionsComponent = __decorate([
3935
- Component({
3936
- selector: 'fs-filter-drawer-actions',
3937
- 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"
3938
- }),
3939
- __metadata("design:paramtypes", [ExternalParamsController])
3940
- ], FsFilterDrawerActionsComponent);
3941
-
3942
- let FsFilterIsolateValues = class FsFilterIsolateValues {
3943
- transform(values, isolate) {
3944
- if (!isolate) {
3945
- return values;
3937
+ _initFilterWithConfig(config) {
3938
+ if (this.config) {
3939
+ this._filterItems.destroyItems();
3946
3940
  }
3947
- else {
3948
- return values.filter((value) => {
3949
- return value.value !== isolate.value;
3950
- });
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();
3951
3949
  }
3950
+ this._listenKeywordItemClear();
3952
3951
  }
3953
- };
3954
- FsFilterIsolateValues = __decorate([
3955
- Pipe({
3956
- name: 'fsFilterIsolateValues'
3957
- })
3958
- ], FsFilterIsolateValues);
3959
-
3960
- let FocusToItemDirective = class FocusToItemDirective {
3961
- constructor(_el, _focusController, _targetSelect, _targetDate, _targetDateScroll, _targetDateRangeFrom, _targetDateRangeTo, _targetAutocomplete, _targetAutocompleteChips) {
3962
- this._el = _el;
3963
- this._focusController = _focusController;
3964
- this._targetSelect = _targetSelect;
3965
- this._targetDate = _targetDate;
3966
- this._targetDateScroll = _targetDateScroll;
3967
- this._targetDateRangeFrom = _targetDateRangeFrom;
3968
- this._targetDateRangeTo = _targetDateRangeTo;
3969
- this._targetAutocomplete = _targetAutocomplete;
3970
- this._targetAutocompleteChips = _targetAutocompleteChips;
3971
- this._destroy$ = new Subject();
3952
+ _destroyFilterDrawer() {
3953
+ this._filterOverlay.close();
3972
3954
  }
3973
- ngOnInit() {
3974
- this._focusController
3975
- .listenFocusFor$(this._item, this._focusTargetType)
3976
- .pipe(delay(500), takeUntil(this._destroy$))
3977
- .subscribe(() => {
3978
- this._focus();
3979
- });
3955
+ _updateWindowWidth() {
3956
+ this.windowDesktop = window.innerWidth > 1200;
3980
3957
  }
3981
- ngOnDestroy() {
3982
- this._destroy$.next();
3983
- 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
+ });
3984
3968
  }
3985
- _focus() {
3986
- switch (this._item.type) {
3987
- case ItemType.Select:
3988
- {
3989
- this._targetSelect.open();
3990
- }
3991
- break;
3992
- case ItemType.Text:
3993
- case ItemType.Range:
3994
- {
3995
- this._el.nativeElement.focus();
3996
- }
3997
- break;
3998
- case ItemType.Date:
3999
- {
4000
- if (this._item.mode === ItemDateMode.Calendar) {
4001
- this._targetDate.open();
4002
- }
4003
- else {
4004
- this._targetDateScroll.inputClick();
4005
- }
4006
- }
4007
- break;
4008
- case ItemType.DateRange:
4009
- {
4010
- if (this._focusTargetType === 'from') {
4011
- this._targetDateRangeFrom.open();
4012
- }
4013
- else {
4014
- this._targetDateRangeTo.open();
4015
- }
4016
- }
4017
- break;
4018
- case ItemType.AutoComplete:
4019
- {
4020
- this._targetAutocomplete.focus();
4021
- }
4022
- break;
4023
- case ItemType.AutoCompleteChips:
4024
- {
4025
- this._targetAutocompleteChips.focus();
4026
- }
4027
- break;
3969
+ _listenInputKeyEvents() {
3970
+ if (!this.searchTextInput) {
3971
+ return;
4028
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
+ });
4029
3984
  }
4030
- };
4031
- FocusToItemDirective.ctorParameters = () => [
4032
- { type: ElementRef },
4033
- { type: FocusControllerService },
4034
- { type: MatSelect, decorators: [{ type: Optional }, { type: Self }] },
4035
- { type: FsDatePickerComponent, decorators: [{ type: Optional }, { type: Self }] },
4036
- { type: FsDateScrollPickerComponent, decorators: [{ type: Optional }, { type: Self }] },
4037
- { type: DateRangePickerFromComponent, decorators: [{ type: Optional }, { type: Self }] },
4038
- { type: DateRangePickerToComponent, decorators: [{ type: Optional }, { type: Self }] },
4039
- { type: FsAutocompleteComponent, decorators: [{ type: Optional }, { type: Self }] },
4040
- { type: FsAutocompleteChipsComponent, decorators: [{ type: Optional }, { type: Self }] }
4041
- ];
4042
- __decorate([
4043
- Input('fsFilterFocusTrigger'),
4044
- __metadata("design:type", Object)
4045
- ], FocusToItemDirective.prototype, "_item", void 0);
4046
- __decorate([
4047
- Input('focusTargetType'),
4048
- __metadata("design:type", Object)
4049
- ], FocusToItemDirective.prototype, "_focusTargetType", void 0);
4050
- FocusToItemDirective = __decorate([
4051
- Directive({
4052
- selector: '[fsFilterFocusTrigger]',
4053
- }),
4054
- __param(2, Optional()), __param(2, Self()),
4055
- __param(3, Optional()), __param(3, Self()),
4056
- __param(4, Optional()), __param(4, Self()),
4057
- __param(5, Optional()), __param(5, Self()),
4058
- __param(6, Optional()), __param(6, Self()),
4059
- __param(7, Optional()), __param(7, Self()),
4060
- __param(8, Optional()), __param(8, Self()),
4061
- __metadata("design:paramtypes", [ElementRef,
4062
- FocusControllerService,
4063
- MatSelect,
4064
- FsDatePickerComponent,
4065
- FsDateScrollPickerComponent,
4066
- DateRangePickerFromComponent,
4067
- DateRangePickerToComponent,
4068
- FsAutocompleteComponent,
4069
- FsAutocompleteChipsComponent])
4070
- ], FocusToItemDirective);
4071
-
4072
- let FsFilterChipContentComponent = class FsFilterChipContentComponent {
4073
- constructor(_cdRef) {
4074
- this._cdRef = _cdRef;
4075
- 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
+ });
4076
3995
  }
4077
- ngOnInit() {
4078
- 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
+ });
4079
4015
  }
4080
- ngOnDestroy() {
4081
- this._destroy$.next();
4082
- 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
+ }
4083
4022
  }
4084
- listenValueChangesForRanges() {
4085
- 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$
4086
4033
  .pipe(takeUntil(this._destroy$))
4087
4034
  .subscribe(() => {
4088
- this.content = this._getContent();
4089
- this._cdRef.detectChanges();
4035
+ this.change();
4090
4036
  });
4091
4037
  }
4092
- _getContent() {
4093
- const result = this.item.getChipsContent(this.type);
4094
- if (this.item.chipLabel !== undefined) {
4095
- if (this.item.chipLabel === '') {
4096
- return `${result}`;
4097
- }
4098
- else {
4099
- if (Array.isArray(this.item.chipLabel)) {
4100
- const label = getLabelFromArray(this.item.chipLabel, this.type);
4101
- return `${label}: ${result}`;
4102
- }
4103
- else {
4104
- return `${this.item.chipLabel}: ${result}`;
4105
- }
4106
- }
4107
- }
4108
- else {
4109
- if (Array.isArray(this.item.label)) {
4110
- const label = getLabelFromArray(this.item.label, this.type);
4111
- return `${label}: ${result}`;
4112
- }
4113
- else {
4114
- if (this.item.isTypeCheckbox) {
4115
- return result;
4116
- }
4117
- else {
4118
- return `${this.item.label}: ${result}`;
4119
- }
4120
- }
4121
- }
4122
- }
4123
- };
4124
- FsFilterChipContentComponent.ctorParameters = () => [
4125
- { type: ChangeDetectorRef }
4126
- ];
4127
- __decorate([
4128
- Input(),
4129
- __metadata("design:type", BaseItem)
4130
- ], FsFilterChipContentComponent.prototype, "item", void 0);
4131
- __decorate([
4132
- Input(),
4133
- __metadata("design:type", String)
4134
- ], FsFilterChipContentComponent.prototype, "type", void 0);
4135
- FsFilterChipContentComponent = __decorate([
4136
- Component({
4137
- selector: 'fs-filter-chip-content',
4138
- template: "{{ content }}\n",
4139
- changeDetection: ChangeDetectionStrategy.OnPush,
4140
- styles: [""]
4141
- }),
4142
- __metadata("design:paramtypes", [ChangeDetectorRef])
4143
- ], FsFilterChipContentComponent);
4144
- function getLabelFromArray(labelArr, type) {
4145
- if (type === 'from' && labelArr[0]) {
4146
- return `${labelArr[0]}`;
4038
+ _initOverlay() {
4039
+ this._filterOverlay.setClearFn(this.clear.bind(this));
4040
+ this._filterOverlay.setDoneFn(this.hide.bind(this));
4147
4041
  }
4148
- else if (type === 'to' && labelArr[1]) {
4149
- 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
+ });
4150
4055
  }
4151
- else {
4152
- return '';
4056
+ _updateChipsVisibility() {
4057
+ const hasFilterChips = this._filterItems.items
4058
+ .some((item) => {
4059
+ return item.isChipVisible;
4060
+ });
4061
+ this._hasFilterChips$.next(hasFilterChips);
4153
4062
  }
4154
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 []; } });
4155
4149
 
4156
- let FsSavedFiltersMenuComponent = class FsSavedFiltersMenuComponent {
4150
+ class FsSavedFiltersMenuComponent {
4157
4151
  constructor(_itemsStore, _externalParams, _savedFilters) {
4158
4152
  this._itemsStore = _itemsStore;
4159
4153
  this._externalParams = _externalParams;
@@ -4180,105 +4174,99 @@ let FsSavedFiltersMenuComponent = class FsSavedFiltersMenuComponent {
4180
4174
  manageFilters() {
4181
4175
  this.manage.emit();
4182
4176
  }
4183
- };
4184
- FsSavedFiltersMenuComponent.ctorParameters = () => [
4185
- { type: FsFilterItemsStore },
4186
- { type: ExternalParamsController },
4187
- { type: SavedFiltersController }
4188
- ];
4189
- __decorate([
4190
- Output(),
4191
- __metadata("design:type", Object)
4192
- ], FsSavedFiltersMenuComponent.prototype, "select", void 0);
4193
- __decorate([
4194
- Output(),
4195
- __metadata("design:type", Object)
4196
- ], FsSavedFiltersMenuComponent.prototype, "clear", void 0);
4197
- __decorate([
4198
- Output(),
4199
- __metadata("design:type", Object)
4200
- ], FsSavedFiltersMenuComponent.prototype, "manage", void 0);
4201
- FsSavedFiltersMenuComponent = __decorate([
4202
- Component({
4203
- selector: 'fs-filter-saved-filters-menu',
4204
- 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",
4205
- changeDetection: ChangeDetectionStrategy.OnPush,
4206
- styles: [":host ::ng-deep .selector{cursor:pointer}"]
4207
- }),
4208
- __metadata("design:paramtypes", [FsFilterItemsStore,
4209
- ExternalParamsController,
4210
- SavedFiltersController])
4211
- ], FsSavedFiltersMenuComponent);
4212
-
4213
- let FsFilterActionsComponent = class FsFilterActionsComponent {
4214
- constructor() {
4215
- this.kebabActions = [];
4216
- this.actions = [];
4217
- }
4218
- };
4219
- __decorate([
4220
- Input(),
4221
- __metadata("design:type", Array)
4222
- ], FsFilterActionsComponent.prototype, "kebabActions", void 0);
4223
- __decorate([
4224
- Input(),
4225
- __metadata("design:type", Array)
4226
- ], FsFilterActionsComponent.prototype, "actions", void 0);
4227
- FsFilterActionsComponent = __decorate([
4228
- Component({
4229
- selector: 'fs-filter-actions',
4230
- 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 [multiple]=\"action.multiple\"\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",
4231
- changeDetection: ChangeDetectionStrategy.OnPush,
4232
- 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}"]
4233
- })
4234
- ], FsFilterActionsComponent);
4235
-
4236
- let FsFilterActionButtonComponent = class FsFilterActionButtonComponent {
4237
- };
4238
- __decorate([
4239
- Input(),
4240
- __metadata("design:type", Action)
4241
- ], FsFilterActionButtonComponent.prototype, "action", void 0);
4242
- FsFilterActionButtonComponent = __decorate([
4243
- Component({
4244
- selector: 'fs-filter-action-button',
4245
- 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",
4246
- host: {
4247
- class: 'action-button',
4248
- },
4249
- changeDetection: ChangeDetectionStrategy.OnPush
4250
- })
4251
- ], FsFilterActionButtonComponent);
4252
-
4253
- let FsFilterActionKebabActionsComponent = class FsFilterActionKebabActionsComponent {
4254
- };
4255
- __decorate([
4256
- Input(),
4257
- __metadata("design:type", Array)
4258
- ], FsFilterActionKebabActionsComponent.prototype, "kebabActions", void 0);
4259
- FsFilterActionKebabActionsComponent = __decorate([
4260
- Component({
4261
- selector: 'fs-filter-action-kebab-actions',
4262
- 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 [multiple]=\"action.multiple\"\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",
4263
- changeDetection: ChangeDetectionStrategy.OnPush,
4264
- styles: [".menu-button{width:36px;height:36px;line-height:36px}"]
4265
- })
4266
- ], 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
+ }] } });
4267
4197
 
4268
- var FsFilterModule_1;
4269
- let FsFilterModule = FsFilterModule_1 = class FsFilterModule {
4198
+ class FsFilterModule {
4270
4199
  static forRoot(config = {}) {
4271
4200
  return {
4272
- ngModule: FsFilterModule_1,
4201
+ ngModule: FsFilterModule,
4273
4202
  providers: [
4274
4203
  { provide: FS_FILTER_CONFIG, useValue: config || {} }
4275
4204
  ]
4276
4205
  };
4277
4206
  }
4278
- };
4279
- FsFilterModule = FsFilterModule_1 = __decorate([
4280
- NgModule({
4281
- 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: [[
4282
4270
  CommonModule,
4283
4271
  RouterModule,
4284
4272
  FormsModule,
@@ -4306,52 +4294,84 @@ FsFilterModule = FsFilterModule_1 = __decorate([
4306
4294
  FsSkeletonModule,
4307
4295
  FsFormModule,
4308
4296
  FsFileModule,
4309
- ],
4310
- declarations: [
4311
- BaseItemComponent,
4312
- FilterComponent,
4313
- FilterItemComponent,
4314
- FsFilterChipsComponent,
4315
- SelectComponent,
4316
- SelectGroupsComponent,
4317
- SelectSimpleComponent,
4318
- SelectMultipleComponent,
4319
- ChipsComponent,
4320
- TextComponent,
4321
- RangeComponent,
4322
- AutocompleteComponent,
4323
- AutocompletechipsComponent,
4324
- DateComponent,
4325
- DateRangeComponent,
4326
- CheckboxComponent,
4327
- FilterDrawerComponent,
4328
- SelectBackdropComponent,
4329
- FsFilterChipComponent,
4330
- FsFilterChipContentComponent,
4331
- FsFilterDrawerActionsComponent,
4332
- FsFilterSavedFilterEditComponent,
4333
- FsSavedFiltersMenuComponent,
4334
- FsFilterActionsComponent,
4335
- FsFilterActionButtonComponent,
4336
- FsFilterActionKebabActionsComponent,
4337
- FilterStatusBarDirective,
4338
- FocusToItemDirective,
4339
- // Pipes
4340
- FsFilterIsolateValues,
4341
- ],
4342
- providers: [
4343
- FsStore,
4344
- ],
4345
- exports: [
4346
- FilterComponent,
4347
- FilterStatusBarDirective,
4348
- FsSavedFiltersMenuComponent,
4349
- ],
4350
- entryComponents: [
4351
- FilterDrawerComponent
4352
- ]
4353
- })
4354
- ], 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
+ }] });
4355
4375
 
4356
4376
  // Controllers
4357
4377
 
@@ -4359,5 +4379,5 @@ FsFilterModule = FsFilterModule_1 = __decorate([
4359
4379
  * Generated bundle index. Do not edit.
4360
4380
  */
4361
4381
 
4362
- 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 };
4363
4383
  //# sourceMappingURL=firestitch-filter.js.map