@firestitch/filter 12.13.3 → 13.0.2
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.
- package/app/classes/actions-controller.d.ts +41 -41
- package/app/components/action-button/action-button.component.d.ts +9 -9
- package/app/components/action-kebab-actions/action-kebab-actions.component.d.ts +7 -7
- package/app/components/actions/actions.component.d.ts +8 -8
- package/app/components/filter/filter.component.d.ts +192 -192
- package/app/components/filter-chip/filter-chip.component.d.ts +26 -26
- package/app/components/filter-chip-content/filter-chip-content.component.d.ts +18 -18
- package/app/components/filter-chips/filter-chips.component.d.ts +10 -10
- package/app/components/filter-drawer/filter-drawer.component.d.ts +30 -30
- package/app/components/filter-drawer-actions/filter-drawer-actions.component.d.ts +15 -15
- package/app/components/filters-item/autocomplete/autocomplete.component.d.ts +14 -13
- package/app/components/filters-item/autocompletechips/autocompletechips.component.d.ts +16 -16
- package/app/components/filters-item/base-item/base-item.component.d.ts +25 -25
- package/app/components/filters-item/checkbox/checkbox.component.d.ts +11 -11
- package/app/components/filters-item/chips/chips.component.d.ts +13 -13
- package/app/components/filters-item/date/date.component.d.ts +20 -20
- package/app/components/filters-item/date-range/date-range.component.d.ts +15 -15
- package/app/components/filters-item/filter-item.component.d.ts +39 -39
- package/app/components/filters-item/range/range.component.d.ts +15 -15
- package/app/components/filters-item/select/backdrop/backdrop.component.d.ts +6 -6
- package/app/components/filters-item/select/groups/groups.component.d.ts +12 -12
- package/app/components/filters-item/select/multiple/multiple.component.d.ts +15 -15
- package/app/components/filters-item/select/select.component.d.ts +23 -23
- package/app/components/filters-item/select/simple/simple.component.d.ts +14 -14
- package/app/components/filters-item/text/text.component.d.ts +19 -19
- package/app/components/filters-item/week/week.component.d.ts +12 -12
- package/app/components/saved-filter-edit/saved-filter-edit.component.d.ts +18 -18
- package/app/components/saved-filters-menu/saved-filters-menu.component.d.ts +23 -23
- package/app/consts/query-param-delimiter.d.ts +1 -1
- package/app/directives/focus-to-item/focus-to-item.directive.d.ts +27 -27
- package/app/directives/status-bar/status-bar.directive.d.ts +8 -8
- package/app/enums/action-mode.enum.d.ts +5 -5
- package/app/enums/action-type.enum.d.ts +9 -9
- package/app/enums/button-style.d.ts +9 -9
- package/app/enums/index.d.ts +6 -6
- package/app/enums/item-date-mode.enum.d.ts +5 -5
- package/app/enums/item-type.enum.d.ts +15 -15
- package/app/enums/picker-view-type.enum.d.ts +7 -7
- package/app/fs-filter.module.d.ts +65 -65
- package/app/helpers/build-query-params.d.ts +3 -3
- package/app/helpers/compare.d.ts +2 -2
- package/app/helpers/create-filter-item.d.ts +14 -14
- package/app/helpers/find-value.d.ts +1 -1
- package/app/helpers/get-range-name.d.ts +1 -1
- package/app/helpers/parse-date.d.ts +1 -1
- package/app/helpers/parse-item-value-from-stored.d.ts +1 -1
- package/app/helpers/query-param-transformers.d.ts +2 -2
- package/app/helpers/restore-items.d.ts +12 -12
- package/app/helpers/try-convert-to-number.d.ts +1 -1
- package/app/injectors/filter-config.d.ts +2 -2
- package/app/injectors/filter-drawer-data.d.ts +2 -2
- package/app/injectors/filter-drawer-overlay.d.ts +2 -2
- package/app/interfaces/action.interface.d.ts +70 -70
- package/app/interfaces/config.interface.d.ts +62 -62
- package/app/interfaces/external-params.interface.d.ts +3 -3
- package/app/interfaces/filter.interface.d.ts +4 -4
- package/app/interfaces/items/autocomplete-chips.interface.d.ts +15 -15
- package/app/interfaces/items/autocomplete.interface.d.ts +9 -9
- package/app/interfaces/items/base.interface.d.ts +29 -29
- package/app/interfaces/items/checkbox.interface.d.ts +7 -7
- package/app/interfaces/items/chips.interface.d.ts +6 -6
- package/app/interfaces/items/date-range.interface.d.ts +8 -8
- package/app/interfaces/items/date.interface.d.ts +7 -7
- package/app/interfaces/items/range.interface.d.ts +13 -13
- package/app/interfaces/items/select.interface.d.ts +20 -20
- package/app/interfaces/items/text.interface.d.ts +9 -9
- package/app/interfaces/items/week.interface.d.ts +7 -7
- package/app/interfaces/saved-filters.interface.d.ts +18 -18
- package/app/interfaces/update-filter-item.interface.d.ts +4 -4
- package/app/models/action-menu-item.model.d.ts +23 -23
- package/app/models/action.model.d.ts +47 -47
- package/app/models/filter-config.d.ts +30 -30
- package/app/models/items/autocomplete/base-autocomplete-item.d.ts +12 -12
- package/app/models/items/autocomplete-chips-item.d.ts +20 -20
- package/app/models/items/autocomplete-item.d.ts +11 -11
- package/app/models/items/base-item.d.ts +80 -79
- package/app/models/items/checkbox-item.d.ts +17 -17
- package/app/models/items/chips-item.d.ts +18 -18
- package/app/models/items/date/base-date-item.d.ts +14 -14
- package/app/models/items/date-item.d.ts +8 -8
- package/app/models/items/date-range/base-date-range-item.d.ts +21 -21
- package/app/models/items/date-range-item.d.ts +6 -6
- package/app/models/items/date-time-item.d.ts +7 -7
- package/app/models/items/date-time-range-item.d.ts +6 -6
- package/app/models/items/range-item.d.ts +23 -23
- package/app/models/items/select/base-select-item.d.ts +13 -13
- package/app/models/items/select/multiple-select-item.d.ts +14 -14
- package/app/models/items/select/simple-select-item.d.ts +14 -14
- package/app/models/items/select-item.d.ts +8 -8
- package/app/models/items/text-item.d.ts +15 -15
- package/app/models/items/week-item.d.ts +18 -18
- package/app/pipes/remove-isolate-value.pipe.d.ts +8 -8
- package/app/providers/filter-meta.d.ts +5 -5
- package/app/services/external-params/persistance-params-controller.service.d.ts +22 -22
- package/app/services/external-params/query-params-controller.service.d.ts +24 -24
- package/app/services/external-params/saved-filters-controller.service.d.ts +40 -40
- package/app/services/external-params-controller.service.d.ts +42 -42
- package/app/services/filter-overlay.service.d.ts +34 -34
- package/app/services/focus-controller.service.d.ts +18 -18
- package/app/services/items-store.service.d.ts +67 -67
- package/{esm2015/app/classes/actions-controller.js → esm2020/app/classes/actions-controller.mjs} +127 -127
- package/esm2020/app/components/action-button/action-button.component.mjs +24 -0
- package/esm2020/app/components/action-kebab-actions/action-kebab-actions.component.mjs +17 -0
- package/esm2020/app/components/actions/actions.component.mjs +26 -0
- package/esm2020/app/components/filter/filter.component.mjs +572 -0
- package/esm2020/app/components/filter-chip/filter-chip.component.mjs +86 -0
- package/{esm2015/app/components/filter-chip-content/filter-chip-content.component.js → esm2020/app/components/filter-chip-content/filter-chip-content.component.mjs} +79 -84
- package/esm2020/app/components/filter-chips/filter-chips.component.mjs +23 -0
- package/esm2020/app/components/filter-drawer/filter-drawer.component.mjs +71 -0
- package/esm2020/app/components/filter-drawer-actions/filter-drawer-actions.component.mjs +41 -0
- package/esm2020/app/components/filters-item/autocomplete/autocomplete.component.mjs +27 -0
- package/esm2020/app/components/filters-item/autocompletechips/autocompletechips.component.mjs +42 -0
- package/{esm2015/app/components/filters-item/base-item/base-item.component.js → esm2020/app/components/filters-item/base-item/base-item.component.mjs} +63 -63
- package/esm2020/app/components/filters-item/checkbox/checkbox.component.mjs +21 -0
- package/esm2020/app/components/filters-item/chips/chips.component.mjs +28 -0
- package/esm2020/app/components/filters-item/date/date.component.mjs +43 -0
- package/esm2020/app/components/filters-item/date-range/date-range.component.mjs +34 -0
- package/esm2020/app/components/filters-item/filter-item.component.mjs +80 -0
- package/esm2020/app/components/filters-item/range/range.component.mjs +45 -0
- package/esm2020/app/components/filters-item/select/backdrop/backdrop.component.mjs +12 -0
- package/esm2020/app/components/filters-item/select/groups/groups.component.mjs +30 -0
- package/esm2020/app/components/filters-item/select/multiple/multiple.component.mjs +57 -0
- package/esm2020/app/components/filters-item/select/select.component.mjs +51 -0
- package/esm2020/app/components/filters-item/select/simple/simple.component.mjs +43 -0
- package/esm2020/app/components/filters-item/text/text.component.mjs +49 -0
- package/esm2020/app/components/filters-item/week/week.component.mjs +25 -0
- package/esm2020/app/components/saved-filter-edit/saved-filter-edit.component.mjs +55 -0
- package/esm2020/app/components/saved-filters-menu/saved-filters-menu.component.mjs +51 -0
- package/{esm2015/app/consts/query-param-delimiter.js → esm2020/app/consts/query-param-delimiter.mjs} +1 -1
- package/{esm2015/app/directives/focus-to-item/focus-to-item.directive.js → esm2020/app/directives/focus-to-item/focus-to-item.directive.mjs} +130 -130
- package/{esm2015/app/directives/status-bar/status-bar.directive.js → esm2020/app/directives/status-bar/status-bar.directive.mjs} +16 -16
- package/{esm2015/app/enums/action-mode.enum.js → esm2020/app/enums/action-mode.enum.mjs} +6 -6
- package/{esm2015/app/enums/action-type.enum.js → esm2020/app/enums/action-type.enum.mjs} +10 -10
- package/{esm2015/app/enums/button-style.js → esm2020/app/enums/button-style.mjs} +10 -10
- package/{esm2015/app/enums/index.js → esm2020/app/enums/index.mjs} +6 -6
- package/{esm2015/app/enums/item-date-mode.enum.js → esm2020/app/enums/item-date-mode.enum.mjs} +6 -6
- package/{esm2015/app/enums/item-type.enum.js → esm2020/app/enums/item-type.enum.mjs} +16 -16
- package/{esm2015/app/enums/picker-view-type.enum.js → esm2020/app/enums/picker-view-type.enum.mjs} +8 -8
- package/{esm2015/app/fs-filter.module.js → esm2020/app/fs-filter.module.mjs} +244 -241
- package/{esm2015/app/helpers/build-query-params.js → esm2020/app/helpers/build-query-params.mjs} +31 -31
- package/{esm2015/app/helpers/compare.js → esm2020/app/helpers/compare.mjs} +37 -37
- package/{esm2015/app/helpers/create-filter-item.js → esm2020/app/helpers/create-filter-item.mjs} +54 -54
- package/{esm2015/app/helpers/find-value.js → esm2020/app/helpers/find-value.mjs} +12 -12
- package/{esm2015/app/helpers/get-range-name.js → esm2020/app/helpers/get-range-name.mjs} +8 -8
- package/{esm2015/app/helpers/parse-date.js → esm2020/app/helpers/parse-date.mjs} +7 -7
- package/{esm2015/app/helpers/parse-item-value-from-stored.js → esm2020/app/helpers/parse-item-value-from-stored.mjs} +81 -81
- package/{esm2015/app/helpers/query-param-transformers.js → esm2020/app/helpers/query-param-transformers.mjs} +8 -8
- package/{esm2015/app/helpers/restore-items.js → esm2020/app/helpers/restore-items.mjs} +48 -48
- package/{esm2015/app/helpers/try-convert-to-number.js → esm2020/app/helpers/try-convert-to-number.mjs} +5 -5
- package/{esm2015/app/injectors/filter-config.js → esm2020/app/injectors/filter-config.mjs} +2 -2
- package/{esm2015/app/injectors/filter-drawer-data.js → esm2020/app/injectors/filter-drawer-data.mjs} +2 -2
- package/{esm2015/app/injectors/filter-drawer-overlay.js → esm2020/app/injectors/filter-drawer-overlay.mjs} +2 -2
- package/{esm2015/app/interfaces/action.interface.js → esm2020/app/interfaces/action.interface.mjs} +1 -1
- package/{esm2015/app/interfaces/config.interface.js → esm2020/app/interfaces/config.interface.mjs} +1 -1
- package/{esm2015/app/interfaces/external-params.interface.js → esm2020/app/interfaces/external-params.interface.mjs} +1 -1
- package/{esm2015/app/interfaces/filter.interface.js → esm2020/app/interfaces/filter.interface.mjs} +1 -1
- package/{esm2015/app/interfaces/items/autocomplete-chips.interface.js → esm2020/app/interfaces/items/autocomplete-chips.interface.mjs} +1 -1
- package/{esm2015/app/interfaces/items/autocomplete.interface.js → esm2020/app/interfaces/items/autocomplete.interface.mjs} +1 -1
- package/{esm2015/app/interfaces/items/base.interface.js → esm2020/app/interfaces/items/base.interface.mjs} +1 -1
- package/{esm2015/app/interfaces/items/checkbox.interface.js → esm2020/app/interfaces/items/checkbox.interface.mjs} +1 -1
- package/{esm2015/app/interfaces/items/chips.interface.js → esm2020/app/interfaces/items/chips.interface.mjs} +1 -1
- package/{esm2015/app/interfaces/items/date-range.interface.js → esm2020/app/interfaces/items/date-range.interface.mjs} +1 -1
- package/{esm2015/app/interfaces/items/date.interface.js → esm2020/app/interfaces/items/date.interface.mjs} +1 -1
- package/{esm2015/app/interfaces/items/range.interface.js → esm2020/app/interfaces/items/range.interface.mjs} +1 -1
- package/{esm2015/app/interfaces/items/select.interface.js → esm2020/app/interfaces/items/select.interface.mjs} +1 -1
- package/{esm2015/app/interfaces/items/text.interface.js → esm2020/app/interfaces/items/text.interface.mjs} +1 -1
- package/{esm2015/app/interfaces/items/week.interface.js → esm2020/app/interfaces/items/week.interface.mjs} +1 -1
- package/{esm2015/app/interfaces/saved-filters.interface.js → esm2020/app/interfaces/saved-filters.interface.mjs} +1 -1
- package/{esm2015/app/interfaces/update-filter-item.interface.js → esm2020/app/interfaces/update-filter-item.interface.mjs} +1 -1
- package/{esm2015/app/models/action-menu-item.model.js → esm2020/app/models/action-menu-item.model.mjs} +66 -66
- package/esm2020/app/models/action.model.mjs +108 -0
- package/esm2020/app/models/filter-config.mjs +66 -0
- package/esm2020/app/models/items/autocomplete/base-autocomplete-item.mjs +14 -0
- package/esm2020/app/models/items/autocomplete-chips-item.mjs +61 -0
- package/{esm2015/app/models/items/autocomplete-item.js → esm2020/app/models/items/autocomplete-item.mjs} +33 -33
- package/esm2020/app/models/items/base-item.mjs +237 -0
- package/{esm2015/app/models/items/checkbox-item.js → esm2020/app/models/items/checkbox-item.mjs} +50 -50
- package/{esm2015/app/models/items/chips-item.js → esm2020/app/models/items/chips-item.mjs} +84 -84
- package/{esm2015/app/models/items/date/base-date-item.js → esm2020/app/models/items/date/base-date-item.mjs} +47 -47
- package/{esm2015/app/models/items/date-item.js → esm2020/app/models/items/date-item.mjs} +19 -19
- package/esm2020/app/models/items/date-range/base-date-range-item.mjs +135 -0
- package/{esm2015/app/models/items/date-range-item.js → esm2020/app/models/items/date-range-item.mjs} +6 -6
- package/esm2020/app/models/items/date-time-item.mjs +10 -0
- package/{esm2015/app/models/items/date-time-range-item.js → esm2020/app/models/items/date-time-range-item.mjs} +6 -6
- package/esm2020/app/models/items/range-item.mjs +83 -0
- package/esm2020/app/models/items/select/base-select-item.mjs +37 -0
- package/esm2020/app/models/items/select/multiple-select-item.mjs +88 -0
- package/esm2020/app/models/items/select/simple-select-item.mjs +66 -0
- package/{esm2015/app/models/items/select-item.js → esm2020/app/models/items/select-item.mjs} +10 -10
- package/{esm2015/app/models/items/text-item.js → esm2020/app/models/items/text-item.mjs} +34 -34
- package/esm2020/app/models/items/week-item.mjs +94 -0
- package/{esm2015/app/pipes/remove-isolate-value.pipe.js → esm2020/app/pipes/remove-isolate-value.pipe.mjs} +21 -21
- package/{esm2015/app/providers/filter-meta.js → esm2020/app/providers/filter-meta.mjs} +9 -9
- package/esm2020/app/services/external-params/persistance-params-controller.service.mjs +58 -0
- package/{esm2015/app/services/external-params/query-params-controller.service.js → esm2020/app/services/external-params/query-params-controller.service.mjs} +67 -67
- package/esm2020/app/services/external-params/saved-filters-controller.service.mjs +164 -0
- package/esm2020/app/services/external-params-controller.service.mjs +162 -0
- package/{esm2015/app/services/filter-overlay.service.js → esm2020/app/services/filter-overlay.service.mjs} +119 -119
- package/{esm2015/app/services/focus-controller.service.js → esm2020/app/services/focus-controller.service.mjs} +30 -30
- package/esm2020/app/services/items-store.service.mjs +337 -0
- package/{esm2015/firestitch-filter.js → esm2020/firestitch-filter.mjs} +4 -4
- package/{esm2015/public_api.js → esm2020/public_api.mjs} +36 -36
- package/fesm2015/{firestitch-filter.js → firestitch-filter.mjs} +4247 -4359
- package/fesm2015/firestitch-filter.mjs.map +1 -0
- package/fesm2020/firestitch-filter.mjs +4442 -0
- package/fesm2020/firestitch-filter.mjs.map +1 -0
- package/firestitch-filter.d.ts +5 -5
- package/package.json +20 -7
- package/public_api.d.ts +40 -40
- package/bundles/firestitch-filter.umd.js +0 -5746
- package/bundles/firestitch-filter.umd.js.map +0 -1
- package/esm2015/app/components/action-button/action-button.component.js +0 -28
- package/esm2015/app/components/action-kebab-actions/action-kebab-actions.component.js +0 -22
- package/esm2015/app/components/actions/actions.component.js +0 -31
- package/esm2015/app/components/filter/filter.component.js +0 -577
- package/esm2015/app/components/filter-chip/filter-chip.component.js +0 -91
- package/esm2015/app/components/filter-chips/filter-chips.component.js +0 -27
- package/esm2015/app/components/filter-drawer/filter-drawer.component.js +0 -76
- package/esm2015/app/components/filter-drawer-actions/filter-drawer-actions.component.js +0 -44
- package/esm2015/app/components/filters-item/autocomplete/autocomplete.component.js +0 -30
- package/esm2015/app/components/filters-item/autocompletechips/autocompletechips.component.js +0 -45
- package/esm2015/app/components/filters-item/checkbox/checkbox.component.js +0 -25
- package/esm2015/app/components/filters-item/chips/chips.component.js +0 -32
- package/esm2015/app/components/filters-item/date/date.component.js +0 -46
- package/esm2015/app/components/filters-item/date-range/date-range.component.js +0 -37
- package/esm2015/app/components/filters-item/filter-item.component.js +0 -84
- package/esm2015/app/components/filters-item/range/range.component.js +0 -48
- package/esm2015/app/components/filters-item/select/backdrop/backdrop.component.js +0 -17
- package/esm2015/app/components/filters-item/select/groups/groups.component.js +0 -33
- package/esm2015/app/components/filters-item/select/multiple/multiple.component.js +0 -61
- package/esm2015/app/components/filters-item/select/select.component.js +0 -55
- package/esm2015/app/components/filters-item/select/simple/simple.component.js +0 -47
- package/esm2015/app/components/filters-item/text/text.component.js +0 -54
- package/esm2015/app/components/filters-item/week/week.component.js +0 -28
- package/esm2015/app/components/saved-filter-edit/saved-filter-edit.component.js +0 -55
- package/esm2015/app/components/saved-filters-menu/saved-filters-menu.component.js +0 -58
- package/esm2015/app/models/action.model.js +0 -109
- package/esm2015/app/models/filter-config.js +0 -67
- package/esm2015/app/models/items/autocomplete/base-autocomplete-item.js +0 -15
- package/esm2015/app/models/items/autocomplete-chips-item.js +0 -62
- package/esm2015/app/models/items/base-item.js +0 -241
- package/esm2015/app/models/items/date-range/base-date-range-item.js +0 -137
- package/esm2015/app/models/items/date-time-item.js +0 -10
- package/esm2015/app/models/items/range-item.js +0 -84
- package/esm2015/app/models/items/select/base-select-item.js +0 -34
- package/esm2015/app/models/items/select/multiple-select-item.js +0 -89
- package/esm2015/app/models/items/select/simple-select-item.js +0 -66
- package/esm2015/app/models/items/week-item.js +0 -94
- package/esm2015/app/services/external-params/persistance-params-controller.service.js +0 -58
- package/esm2015/app/services/external-params/saved-filters-controller.service.js +0 -165
- package/esm2015/app/services/external-params-controller.service.js +0 -163
- package/esm2015/app/services/items-store.service.js +0 -341
- package/fesm2015/firestitch-filter.js.map +0 -1
|
@@ -0,0 +1,4442 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Injectable, Optional, Component, ChangeDetectionStrategy, Inject, Input, EventEmitter, Output, InjectionToken, Directive, Self, Pipe, ViewChild, HostListener, ViewEncapsulation, ContentChild, HostBinding, NgModule } from '@angular/core';
|
|
3
|
+
import { BehaviorSubject, Subject, isObservable, forkJoin, of, timer, combineLatest, fromEvent, merge } from 'rxjs';
|
|
4
|
+
import { tap, finalize, take, takeUntil, debounceTime, filter as filter$1, distinctUntilChanged, switchMap, mapTo, startWith, map, delay, skip } from 'rxjs/operators';
|
|
5
|
+
import { filter, isArrayEqual, list, isEmpty, getNormalizedPath, remove, FsCommonModule } from '@firestitch/common';
|
|
6
|
+
import { isObject, isFunction, clone, isString, toString, pickBy } from 'lodash-es';
|
|
7
|
+
import * as i3 from '@angular/common';
|
|
8
|
+
import { CommonModule } from '@angular/common';
|
|
9
|
+
import * as i1$1 from '@angular/router';
|
|
10
|
+
import { RouterModule } from '@angular/router';
|
|
11
|
+
import * as i1$2 from '@angular/material/dialog';
|
|
12
|
+
import { MAT_DIALOG_DATA, MatDialogModule } from '@angular/material/dialog';
|
|
13
|
+
import * as i6 from '@firestitch/drawer';
|
|
14
|
+
import * as i1 from '@firestitch/store';
|
|
15
|
+
import { FsPersistanceStore, FsStoreModule, FsStore } from '@firestitch/store';
|
|
16
|
+
import { simpleFormat, format } from '@firestitch/date';
|
|
17
|
+
import { parseISO, isValid, isDate } from 'date-fns';
|
|
18
|
+
import * as i3$4 from '@firestitch/datepicker';
|
|
19
|
+
import { formatPeriodObject, FsDatePickerModule } from '@firestitch/datepicker';
|
|
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 i4 from '@angular/forms';
|
|
27
|
+
import { FormControl, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
28
|
+
import * as i7 from '@firestitch/form';
|
|
29
|
+
import { FsFormModule } from '@firestitch/form';
|
|
30
|
+
import * as i3$2 from '@angular/material/input';
|
|
31
|
+
import { MatInput, MatInputModule } from '@angular/material/input';
|
|
32
|
+
import { ComponentPortal, PortalInjector, PortalModule } from '@angular/cdk/portal';
|
|
33
|
+
import { MatAutocompleteModule } from '@angular/material/autocomplete';
|
|
34
|
+
import * as i4$3 from '@angular/material/checkbox';
|
|
35
|
+
import { MatCheckboxModule } from '@angular/material/checkbox';
|
|
36
|
+
import { MatChipsModule } from '@angular/material/chips';
|
|
37
|
+
import * as i2$1 from '@angular/material/icon';
|
|
38
|
+
import { MatIconModule } from '@angular/material/icon';
|
|
39
|
+
import * as i4$2 from '@firestitch/autocomplete';
|
|
40
|
+
import { FsAutocompleteModule } from '@firestitch/autocomplete';
|
|
41
|
+
import * as i5 from '@firestitch/autocomplete-chips';
|
|
42
|
+
import { FsAutocompleteChipsModule } from '@firestitch/autocomplete-chips';
|
|
43
|
+
import * as i2$2 from '@firestitch/chip';
|
|
44
|
+
import { FsChipModule } from '@firestitch/chip';
|
|
45
|
+
import * as i8 from '@firestitch/clear';
|
|
46
|
+
import { FsClearModule } from '@firestitch/clear';
|
|
47
|
+
import * as i4$1 from '@firestitch/file';
|
|
48
|
+
import { FsFileModule } from '@firestitch/file';
|
|
49
|
+
import * as i1$5 from '@firestitch/label';
|
|
50
|
+
import { FsLabelModule } from '@firestitch/label';
|
|
51
|
+
import * as i3$3 from '@firestitch/menu';
|
|
52
|
+
import { FsMenuModule } from '@firestitch/menu';
|
|
53
|
+
import * as i7$1 from '@firestitch/popover';
|
|
54
|
+
import { FsPopoverModule } from '@firestitch/popover';
|
|
55
|
+
import { FsScrollModule } from '@firestitch/scroll';
|
|
56
|
+
import * as i6$1 from '@firestitch/skeleton';
|
|
57
|
+
import { FsSkeletonModule } from '@firestitch/skeleton';
|
|
58
|
+
import * as i1$6 from '@angular/cdk/overlay';
|
|
59
|
+
import { OverlayConfig } from '@angular/cdk/overlay';
|
|
60
|
+
import * as i1$7 from '@angular/cdk/layout';
|
|
61
|
+
|
|
62
|
+
const QUERY_PARAM_DELIMITER = ':';
|
|
63
|
+
|
|
64
|
+
function filterToQueryParam(value, name) {
|
|
65
|
+
return `${encodeURIComponent(value)}${QUERY_PARAM_DELIMITER}${encodeURIComponent(name)}`;
|
|
66
|
+
}
|
|
67
|
+
function filterFromQueryParam(param) {
|
|
68
|
+
const parts = param.split(QUERY_PARAM_DELIMITER);
|
|
69
|
+
return [decodeURIComponent(parts[0]), decodeURIComponent(parts[1])];
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
function objectsAreEquals(obj1, obj2) {
|
|
73
|
+
const oldKeys = Object.keys(obj1);
|
|
74
|
+
const currKeys = Object.keys(obj2);
|
|
75
|
+
if (oldKeys.length !== currKeys.length) {
|
|
76
|
+
return false;
|
|
77
|
+
}
|
|
78
|
+
for (const key in obj1) {
|
|
79
|
+
if (obj1.hasOwnProperty(key)) {
|
|
80
|
+
const oldItem = obj1[key];
|
|
81
|
+
const currItem = obj2[key];
|
|
82
|
+
const isArrays = Array.isArray(oldItem) && Array.isArray(currItem);
|
|
83
|
+
const isObjects = isObject(oldItem) && isObject(currItem);
|
|
84
|
+
if (isArrays && !arraysAreEquals(oldItem, currItem)) {
|
|
85
|
+
return false;
|
|
86
|
+
}
|
|
87
|
+
else if (isObjects && !objectsAreEquals(oldItem, currItem)) {
|
|
88
|
+
return false;
|
|
89
|
+
}
|
|
90
|
+
else if (!isArrays && !isObjects && oldItem !== currItem) {
|
|
91
|
+
return false;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
return true;
|
|
96
|
+
}
|
|
97
|
+
function arraysAreEquals(arr1, arr2) {
|
|
98
|
+
if (arr1.length !== arr2.length) {
|
|
99
|
+
return false;
|
|
100
|
+
}
|
|
101
|
+
for (const el of arr1) {
|
|
102
|
+
if (arr2.indexOf(el) === -1) {
|
|
103
|
+
return false;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
return true;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
var ItemType;
|
|
110
|
+
(function (ItemType) {
|
|
111
|
+
ItemType["Text"] = "text";
|
|
112
|
+
ItemType["Select"] = "select";
|
|
113
|
+
ItemType["Range"] = "range";
|
|
114
|
+
ItemType["Date"] = "date";
|
|
115
|
+
ItemType["DateTime"] = "datetime";
|
|
116
|
+
ItemType["DateRange"] = "daterange";
|
|
117
|
+
ItemType["Week"] = "week";
|
|
118
|
+
ItemType["DateTimeRange"] = "datetimerange";
|
|
119
|
+
ItemType["AutoComplete"] = "autocomplete";
|
|
120
|
+
ItemType["AutoCompleteChips"] = "autocompletechips";
|
|
121
|
+
ItemType["Checkbox"] = "checkbox";
|
|
122
|
+
ItemType["Chips"] = "chips";
|
|
123
|
+
ItemType["Keyword"] = "keyword";
|
|
124
|
+
})(ItemType || (ItemType = {}));
|
|
125
|
+
|
|
126
|
+
class BaseItem {
|
|
127
|
+
constructor(itemConfig, _additionalConfig, _filter) {
|
|
128
|
+
this._additionalConfig = _additionalConfig;
|
|
129
|
+
this._filter = _filter;
|
|
130
|
+
this._pendingValues = false;
|
|
131
|
+
this._pendingDefaultValue = false;
|
|
132
|
+
this._initializedValues = false;
|
|
133
|
+
this._loading$ = new BehaviorSubject(false);
|
|
134
|
+
this._value$ = new BehaviorSubject(null);
|
|
135
|
+
this._valueChange$ = new Subject();
|
|
136
|
+
this._values$ = new BehaviorSubject(null);
|
|
137
|
+
this._destroy$ = new Subject();
|
|
138
|
+
this._clear$ = new Subject();
|
|
139
|
+
this._type = itemConfig.type;
|
|
140
|
+
this._parseConfig(itemConfig);
|
|
141
|
+
}
|
|
142
|
+
get filter() {
|
|
143
|
+
return this._filter;
|
|
144
|
+
}
|
|
145
|
+
get isTypeAutocomplete() {
|
|
146
|
+
return this.type === ItemType.AutoComplete;
|
|
147
|
+
}
|
|
148
|
+
get isTypeAutocompleteChips() {
|
|
149
|
+
return this.type === ItemType.AutoCompleteChips;
|
|
150
|
+
}
|
|
151
|
+
get isTypeChips() {
|
|
152
|
+
return this.type === ItemType.Chips;
|
|
153
|
+
}
|
|
154
|
+
get isTypeCheckbox() {
|
|
155
|
+
return this.type === ItemType.Checkbox;
|
|
156
|
+
}
|
|
157
|
+
get isTypeSelect() {
|
|
158
|
+
return this.type === ItemType.Select;
|
|
159
|
+
}
|
|
160
|
+
get isTypeDate() {
|
|
161
|
+
return this.type === ItemType.Date;
|
|
162
|
+
}
|
|
163
|
+
get isTypeDateRange() {
|
|
164
|
+
return this.type === ItemType.DateRange;
|
|
165
|
+
}
|
|
166
|
+
get isTypeRange() {
|
|
167
|
+
return this.type === ItemType.Range;
|
|
168
|
+
}
|
|
169
|
+
get isTypeDateTimeRange() {
|
|
170
|
+
return this.type === ItemType.DateTimeRange;
|
|
171
|
+
}
|
|
172
|
+
get isTypeDateTime() {
|
|
173
|
+
return this.type === ItemType.DateTime;
|
|
174
|
+
}
|
|
175
|
+
get isTypeKeyword() {
|
|
176
|
+
return this.type === ItemType.Keyword;
|
|
177
|
+
}
|
|
178
|
+
get isChipVisible() {
|
|
179
|
+
return !!this.model;
|
|
180
|
+
}
|
|
181
|
+
get destroy$() {
|
|
182
|
+
return this._destroy$.asObservable();
|
|
183
|
+
}
|
|
184
|
+
get type() {
|
|
185
|
+
return this._type;
|
|
186
|
+
}
|
|
187
|
+
get hasPendingValues() {
|
|
188
|
+
return this._pendingValues;
|
|
189
|
+
}
|
|
190
|
+
get hasPendingDefaultValue() {
|
|
191
|
+
return this._pendingDefaultValue;
|
|
192
|
+
}
|
|
193
|
+
get model() {
|
|
194
|
+
return this._model;
|
|
195
|
+
}
|
|
196
|
+
set model(value) {
|
|
197
|
+
this._setModel(value);
|
|
198
|
+
this.valueChanged();
|
|
199
|
+
}
|
|
200
|
+
set values(values) {
|
|
201
|
+
this._values$.next(values);
|
|
202
|
+
}
|
|
203
|
+
get values() {
|
|
204
|
+
return this._values$.getValue();
|
|
205
|
+
}
|
|
206
|
+
get values$() {
|
|
207
|
+
return this._values$.asObservable();
|
|
208
|
+
}
|
|
209
|
+
get valueChange$() {
|
|
210
|
+
return this._valueChange$.asObservable();
|
|
211
|
+
}
|
|
212
|
+
get value$() {
|
|
213
|
+
return this._value$.asObservable();
|
|
214
|
+
}
|
|
215
|
+
get clear$() {
|
|
216
|
+
return this._clear$.asObservable();
|
|
217
|
+
}
|
|
218
|
+
get initialized() {
|
|
219
|
+
return this._initialized;
|
|
220
|
+
}
|
|
221
|
+
get loading$() {
|
|
222
|
+
return this._loading$.asObservable();
|
|
223
|
+
}
|
|
224
|
+
get loading() {
|
|
225
|
+
return this._loading$.getValue();
|
|
226
|
+
}
|
|
227
|
+
set loading(value) {
|
|
228
|
+
this._loading$.next(value);
|
|
229
|
+
}
|
|
230
|
+
get _initialized() {
|
|
231
|
+
return !this._pendingDefaultValue && !this._pendingValues && this._initializedValues;
|
|
232
|
+
}
|
|
233
|
+
valueChanged() {
|
|
234
|
+
this._value$.next(this.value);
|
|
235
|
+
if (this.change) {
|
|
236
|
+
this.change(this, this._filter);
|
|
237
|
+
}
|
|
238
|
+
if (this.initialized) {
|
|
239
|
+
this._valueChange$.next();
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
get queryObject() {
|
|
243
|
+
const value = this.value;
|
|
244
|
+
const name = this.name;
|
|
245
|
+
const params = {};
|
|
246
|
+
if (Array.isArray(value)) {
|
|
247
|
+
params[this.name] = value.join(',');
|
|
248
|
+
}
|
|
249
|
+
else {
|
|
250
|
+
params[name] = value;
|
|
251
|
+
}
|
|
252
|
+
return params;
|
|
253
|
+
}
|
|
254
|
+
get persistanceObject() {
|
|
255
|
+
return this.queryObject;
|
|
256
|
+
}
|
|
257
|
+
loadDefaultValue() {
|
|
258
|
+
this._pendingDefaultValue = true;
|
|
259
|
+
return this.defaultValueFn()
|
|
260
|
+
.pipe(tap((value) => {
|
|
261
|
+
this.defaultValue = value;
|
|
262
|
+
this._initDefaultModel();
|
|
263
|
+
}), finalize(() => {
|
|
264
|
+
this._pendingDefaultValue = false;
|
|
265
|
+
}));
|
|
266
|
+
}
|
|
267
|
+
initValues(persistedValue) {
|
|
268
|
+
this._initializedValues = false;
|
|
269
|
+
this.persistedValue = persistedValue;
|
|
270
|
+
this._initDefaultModel();
|
|
271
|
+
const isAutocomplete = this.type === ItemType.AutoComplete || this.type === ItemType.AutoCompleteChips;
|
|
272
|
+
if (this._valuesFn && !isAutocomplete) {
|
|
273
|
+
const valuesResult = this._valuesFn(null, this._filter);
|
|
274
|
+
if (isObservable(valuesResult)) {
|
|
275
|
+
this._pendingValues = true;
|
|
276
|
+
}
|
|
277
|
+
else {
|
|
278
|
+
this.values = valuesResult;
|
|
279
|
+
this._init();
|
|
280
|
+
this._initializedValues = true;
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
else {
|
|
284
|
+
this._init();
|
|
285
|
+
this._initializedValues = true;
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
loadAsyncValues(reload = true) {
|
|
289
|
+
if (reload || (!this.loading && this.hasPendingValues)) {
|
|
290
|
+
this.loading = true;
|
|
291
|
+
this._valuesFn(null, this._filter)
|
|
292
|
+
.pipe(take(1), takeUntil(this._destroy$))
|
|
293
|
+
.subscribe((values) => {
|
|
294
|
+
this.values = values;
|
|
295
|
+
this._pendingValues = false;
|
|
296
|
+
this.loading = false;
|
|
297
|
+
this._init();
|
|
298
|
+
this._validateModel();
|
|
299
|
+
this._initializedValues = true;
|
|
300
|
+
});
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
clear(defaultValue = undefined) {
|
|
304
|
+
if (this.isTypeRange || this.isTypeDateRange || this.isTypeDateTimeRange) {
|
|
305
|
+
console.warn(`
|
|
306
|
+
Filter ${this.name} can not be cleared with .clear() method!
|
|
307
|
+
Use special .clearRange() or clearDateRange() instead.
|
|
308
|
+
`);
|
|
309
|
+
}
|
|
310
|
+
this._clear$.next(defaultValue);
|
|
311
|
+
this._clearValue(defaultValue);
|
|
312
|
+
}
|
|
313
|
+
getChipsContent(type) {
|
|
314
|
+
return '';
|
|
315
|
+
}
|
|
316
|
+
destroy() {
|
|
317
|
+
this._destroy$.next();
|
|
318
|
+
this._destroy$.complete();
|
|
319
|
+
}
|
|
320
|
+
_setModel(value) {
|
|
321
|
+
this._model = value;
|
|
322
|
+
}
|
|
323
|
+
_parseConfig(item) {
|
|
324
|
+
this.name = item.name;
|
|
325
|
+
this.label = item.label;
|
|
326
|
+
this.chipLabel = item.chipLabel;
|
|
327
|
+
if (typeof item.default === 'function') {
|
|
328
|
+
this.defaultValueFn = item.default;
|
|
329
|
+
}
|
|
330
|
+
else {
|
|
331
|
+
this.defaultValue = item.default;
|
|
332
|
+
}
|
|
333
|
+
this.change = item.change;
|
|
334
|
+
this.init = item.init || ((_) => {
|
|
335
|
+
//
|
|
336
|
+
});
|
|
337
|
+
this.hide = item.hide;
|
|
338
|
+
this.showClear = item.clear ?? true;
|
|
339
|
+
this.persistanceDisabled = item.disablePersist ?? false;
|
|
340
|
+
this.queryParamsDisabled = item.disableQueryParams ?? false;
|
|
341
|
+
if (isFunction(item.values)) {
|
|
342
|
+
this._valuesFn = item.values;
|
|
343
|
+
}
|
|
344
|
+
else {
|
|
345
|
+
this.values = item.values;
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
_initDefaultModel() {
|
|
349
|
+
const model = this.persistedValue ?? this.defaultValue;
|
|
350
|
+
if (model !== undefined) {
|
|
351
|
+
this._setModel(model);
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
_clearValue(defaultValue = undefined) {
|
|
355
|
+
this.model = defaultValue ?? undefined;
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
class BaseSelectItem extends BaseItem {
|
|
360
|
+
_parseConfig(item) {
|
|
361
|
+
this.multiple = item.multiple;
|
|
362
|
+
this.children = item.children;
|
|
363
|
+
// TODO nullish
|
|
364
|
+
if (item.isolate) {
|
|
365
|
+
this.isolate = {
|
|
366
|
+
...item.isolate,
|
|
367
|
+
enabled: false,
|
|
368
|
+
};
|
|
369
|
+
}
|
|
370
|
+
super._parseConfig(item);
|
|
371
|
+
}
|
|
372
|
+
_init() {
|
|
373
|
+
if (!Array.isArray(this.values)) {
|
|
374
|
+
this.values = [];
|
|
375
|
+
}
|
|
376
|
+
// TODO Refactor
|
|
377
|
+
if (this.isolate) {
|
|
378
|
+
this.values = this.values.filter((item) => {
|
|
379
|
+
if (Array.isArray(this.isolate.value)) {
|
|
380
|
+
return this.isolate.value.indexOf(item.value) === -1;
|
|
381
|
+
}
|
|
382
|
+
else {
|
|
383
|
+
return item.value !== this.isolate.value;
|
|
384
|
+
}
|
|
385
|
+
});
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
_clearValue(defaultValue = undefined) {
|
|
389
|
+
if (this.isolate) {
|
|
390
|
+
this.isolate.enabled = false;
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
class MultipleSelectItem extends BaseSelectItem {
|
|
396
|
+
constructor(itemConfig, _persistedValues, _filter) {
|
|
397
|
+
super(itemConfig, _persistedValues, _filter);
|
|
398
|
+
}
|
|
399
|
+
get value() {
|
|
400
|
+
let value = clone(this.model);
|
|
401
|
+
if (this.isolateOptionNotSelected) {
|
|
402
|
+
value = this.values?.map((v) => v.value);
|
|
403
|
+
}
|
|
404
|
+
else if (!Array.isArray(value) || value.length === 0 || value.indexOf('__all') > -1) {
|
|
405
|
+
value = undefined;
|
|
406
|
+
}
|
|
407
|
+
return value;
|
|
408
|
+
}
|
|
409
|
+
get isChipVisible() {
|
|
410
|
+
return Array.isArray(this.model) && this.model.length > 0;
|
|
411
|
+
}
|
|
412
|
+
get isolateOptionNotSelected() {
|
|
413
|
+
const modelValue = this.model;
|
|
414
|
+
const isolate = this.isolate;
|
|
415
|
+
return isolate && !isolate.enabled && modelValue?.length === 0;
|
|
416
|
+
}
|
|
417
|
+
getChipsContent(type = null) {
|
|
418
|
+
const options = this.model.reduce((acc, key) => {
|
|
419
|
+
const itemValue = this.values.find((val) => val.value === key);
|
|
420
|
+
let itemLabel;
|
|
421
|
+
if (itemValue) {
|
|
422
|
+
itemLabel = itemValue.name;
|
|
423
|
+
}
|
|
424
|
+
else if (this.isolate && this.isolate.enabled) {
|
|
425
|
+
itemLabel = this.isolate.label;
|
|
426
|
+
}
|
|
427
|
+
if (!acc.includes(itemLabel)) {
|
|
428
|
+
acc.push(itemLabel);
|
|
429
|
+
}
|
|
430
|
+
return acc;
|
|
431
|
+
}, []);
|
|
432
|
+
return options.join(', ');
|
|
433
|
+
}
|
|
434
|
+
_init() {
|
|
435
|
+
super._init();
|
|
436
|
+
const values = this.values.map((itemv) => itemv.value);
|
|
437
|
+
const wrongDefaultValue = !this.model && !Array.isArray(this.defaultValue);
|
|
438
|
+
/**
|
|
439
|
+
* When multiple select is in isolate mode and have no options selected
|
|
440
|
+
* it should send to the server all it's possible values,
|
|
441
|
+
* but should not show them as selected in interfaces as well as in query params & persistance
|
|
442
|
+
*
|
|
443
|
+
* Code below prevents filling model with values from query params if query params contain all possible values
|
|
444
|
+
*/
|
|
445
|
+
const isolate = !wrongDefaultValue
|
|
446
|
+
&& !this.isolateOptionNotSelected
|
|
447
|
+
&& arraysAreEquals(this.model, values);
|
|
448
|
+
if (wrongDefaultValue || isolate) {
|
|
449
|
+
this.model = [];
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
_setModel(value) {
|
|
453
|
+
if (Array.isArray(value)) {
|
|
454
|
+
value = value.map((val) => {
|
|
455
|
+
if (isNaN(val)) {
|
|
456
|
+
return val;
|
|
457
|
+
}
|
|
458
|
+
return +val;
|
|
459
|
+
});
|
|
460
|
+
}
|
|
461
|
+
super._setModel(value);
|
|
462
|
+
}
|
|
463
|
+
_validateModel() {
|
|
464
|
+
const possibleValues = filter(this.model || [], (item) => {
|
|
465
|
+
return this.values.find((value) => {
|
|
466
|
+
return value.value === item;
|
|
467
|
+
});
|
|
468
|
+
});
|
|
469
|
+
if (!isArrayEqual(this.model, possibleValues)) {
|
|
470
|
+
this.model = possibleValues;
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
_clearValue(defaultValue = undefined) {
|
|
474
|
+
super._clearValue(defaultValue);
|
|
475
|
+
this.model = defaultValue ?? [];
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
function buildQueryParams(flattenedParams, items) {
|
|
480
|
+
items.forEach(filterItem => {
|
|
481
|
+
if (filterItem instanceof MultipleSelectItem && filterItem.isolate) {
|
|
482
|
+
if (filterItem.multiple && filterItem.value) {
|
|
483
|
+
const isolated = list(filterItem.values, 'value').sort();
|
|
484
|
+
const value = filterItem.value.sort();
|
|
485
|
+
if (arraysAreEquals(value, isolated)) {
|
|
486
|
+
flattenedParams[filterItem.name] = null;
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
if (filterItem.isTypeAutocomplete) {
|
|
491
|
+
if (isObject(filterItem.model)) {
|
|
492
|
+
flattenedParams[filterItem.name] = filterToQueryParam(filterItem.model.value, filterItem.model.name);
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
else if (filterItem.isTypeAutocompleteChips || filterItem.isTypeChips) {
|
|
496
|
+
if (Array.isArray(filterItem.model) && filterItem.model.length) {
|
|
497
|
+
flattenedParams[filterItem.name] = filterItem.model.map((item) => {
|
|
498
|
+
return filterToQueryParam(item.value, item.name);
|
|
499
|
+
}).join(',');
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
});
|
|
503
|
+
return flattenedParams;
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
function getRangeName(configCase, name, range) {
|
|
507
|
+
if (configCase === 'snake') {
|
|
508
|
+
return name.concat('_').concat(range);
|
|
509
|
+
}
|
|
510
|
+
if (configCase === 'camel') {
|
|
511
|
+
return name.concat(range.charAt(0).toUpperCase()).concat(range.slice(1));
|
|
512
|
+
}
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
class RangeItem extends BaseItem {
|
|
516
|
+
static create(config, additionalConfig, filter) {
|
|
517
|
+
return new RangeItem(config, additionalConfig, filter);
|
|
518
|
+
}
|
|
519
|
+
get value() {
|
|
520
|
+
let value = clone(this.model);
|
|
521
|
+
if (!isObject(this.model) ||
|
|
522
|
+
(isEmpty(this.model.max, { zero: true }) && isEmpty(this.model.min, { zero: true }))) {
|
|
523
|
+
value = undefined;
|
|
524
|
+
}
|
|
525
|
+
return value;
|
|
526
|
+
}
|
|
527
|
+
get queryObject() {
|
|
528
|
+
const value = this.value;
|
|
529
|
+
const name = this.name;
|
|
530
|
+
const params = {};
|
|
531
|
+
const paramMinName = getRangeName(this.case, name, 'min');
|
|
532
|
+
const paramMaxName = getRangeName(this.case, name, 'max');
|
|
533
|
+
if (isObject(value)) {
|
|
534
|
+
params[paramMinName] = value.min || undefined;
|
|
535
|
+
params[paramMaxName] = value.max || undefined;
|
|
536
|
+
}
|
|
537
|
+
else {
|
|
538
|
+
params[paramMinName] = undefined;
|
|
539
|
+
params[paramMaxName] = undefined;
|
|
540
|
+
}
|
|
541
|
+
return params;
|
|
542
|
+
}
|
|
543
|
+
get isChipVisible() {
|
|
544
|
+
return this.model && (this.model.min !== undefined || this.model.max !== undefined);
|
|
545
|
+
}
|
|
546
|
+
getChipsContent(type) {
|
|
547
|
+
if (type === 'from') {
|
|
548
|
+
const min = this.model.min;
|
|
549
|
+
return `${min}`;
|
|
550
|
+
}
|
|
551
|
+
else if (type === 'to') {
|
|
552
|
+
const max = this.model.max;
|
|
553
|
+
return `${max}`;
|
|
554
|
+
}
|
|
555
|
+
}
|
|
556
|
+
clearRange(type = null, defaultValue = undefined) {
|
|
557
|
+
if (type === 'from') {
|
|
558
|
+
delete this.model.min;
|
|
559
|
+
if (defaultValue?.min) {
|
|
560
|
+
this.model.min = defaultValue.min;
|
|
561
|
+
}
|
|
562
|
+
this.model = { ...this.model };
|
|
563
|
+
}
|
|
564
|
+
else if (type === 'to') {
|
|
565
|
+
delete this.model.max;
|
|
566
|
+
if (defaultValue?.max) {
|
|
567
|
+
this.model.max = defaultValue.max;
|
|
568
|
+
}
|
|
569
|
+
this.model = { ...this.model };
|
|
570
|
+
}
|
|
571
|
+
else {
|
|
572
|
+
this.model = defaultValue ? { ...defaultValue } : {};
|
|
573
|
+
}
|
|
574
|
+
}
|
|
575
|
+
_validateModel() {
|
|
576
|
+
}
|
|
577
|
+
_parseConfig(item) {
|
|
578
|
+
this.options = item.options;
|
|
579
|
+
this.prefix = item.prefix;
|
|
580
|
+
this.suffix = item.suffix;
|
|
581
|
+
this.case = this._additionalConfig?.case ?? 'camel';
|
|
582
|
+
super._parseConfig(item);
|
|
583
|
+
}
|
|
584
|
+
_init() {
|
|
585
|
+
if (!this.label) {
|
|
586
|
+
this.label = ['Min', 'Max'];
|
|
587
|
+
}
|
|
588
|
+
if (!this.model) {
|
|
589
|
+
this.model = this.defaultValue || {};
|
|
590
|
+
}
|
|
591
|
+
}
|
|
592
|
+
}
|
|
593
|
+
|
|
594
|
+
class BaseDateRangeItem extends BaseItem {
|
|
595
|
+
get isTypeDateRange() {
|
|
596
|
+
return this.type === ItemType.DateRange;
|
|
597
|
+
}
|
|
598
|
+
get isTypeDateTimeRange() {
|
|
599
|
+
return this.type === ItemType.DateTimeRange;
|
|
600
|
+
}
|
|
601
|
+
get isChipVisible() {
|
|
602
|
+
return this.model && (this.model.from !== undefined || this.model.to !== undefined);
|
|
603
|
+
}
|
|
604
|
+
get value() {
|
|
605
|
+
let value = clone(this.model);
|
|
606
|
+
if (!isObject(this.model) ||
|
|
607
|
+
(isEmpty(this.model.from, { zero: true }) && isEmpty(this.model.to, { zero: true }))) {
|
|
608
|
+
value = undefined;
|
|
609
|
+
}
|
|
610
|
+
if (isEmpty(value, { zero: true })) {
|
|
611
|
+
return undefined;
|
|
612
|
+
}
|
|
613
|
+
let from = value.from;
|
|
614
|
+
let to = value.to;
|
|
615
|
+
value = {};
|
|
616
|
+
if (from) {
|
|
617
|
+
if (isString(from)) {
|
|
618
|
+
from = parseISO(from);
|
|
619
|
+
}
|
|
620
|
+
if (isValid(from) && isDate(from)) {
|
|
621
|
+
value.from = from;
|
|
622
|
+
}
|
|
623
|
+
}
|
|
624
|
+
if (to) {
|
|
625
|
+
if (isString(to)) {
|
|
626
|
+
to = parseISO(to);
|
|
627
|
+
}
|
|
628
|
+
if (isValid(to) && isDate(to)) {
|
|
629
|
+
value.to = to;
|
|
630
|
+
}
|
|
631
|
+
}
|
|
632
|
+
return value;
|
|
633
|
+
}
|
|
634
|
+
get queryObject() {
|
|
635
|
+
const value = this.value || {};
|
|
636
|
+
const name = this.name;
|
|
637
|
+
const paramFromName = getRangeName(this.case, name, 'from');
|
|
638
|
+
const paramToName = getRangeName(this.case, name, 'to');
|
|
639
|
+
return {
|
|
640
|
+
[paramFromName]: value.from || undefined,
|
|
641
|
+
[paramToName]: value.to || undefined,
|
|
642
|
+
};
|
|
643
|
+
}
|
|
644
|
+
get persistanceObject() {
|
|
645
|
+
const query = this.queryObject;
|
|
646
|
+
return Object.keys(this.queryObject)
|
|
647
|
+
.reduce((acc, key) => {
|
|
648
|
+
if (!!query[key]) {
|
|
649
|
+
acc[key] = simpleFormat(query[key]);
|
|
650
|
+
}
|
|
651
|
+
else {
|
|
652
|
+
acc[key] = query[key];
|
|
653
|
+
}
|
|
654
|
+
return acc;
|
|
655
|
+
}, {});
|
|
656
|
+
}
|
|
657
|
+
getChipsContent(type = null) {
|
|
658
|
+
const formatTo = this.type === ItemType.DateRange ? 'date' : 'date-time';
|
|
659
|
+
if (type === 'from') {
|
|
660
|
+
const from = this.model.from;
|
|
661
|
+
return `${format(from, formatTo)}`;
|
|
662
|
+
}
|
|
663
|
+
else if (type === 'to') {
|
|
664
|
+
const to = this.model.to;
|
|
665
|
+
return `${format(to, formatTo)}`;
|
|
666
|
+
}
|
|
667
|
+
}
|
|
668
|
+
clearDateRange(type = null, defaultValue = undefined) {
|
|
669
|
+
if (type === 'from') {
|
|
670
|
+
delete this.model.from;
|
|
671
|
+
if (defaultValue?.from) {
|
|
672
|
+
this.model.from = defaultValue.from;
|
|
673
|
+
}
|
|
674
|
+
this.model = { ...this.model };
|
|
675
|
+
}
|
|
676
|
+
else if (type === 'to') {
|
|
677
|
+
delete this.model.to;
|
|
678
|
+
if (defaultValue?.to) {
|
|
679
|
+
this.model.to = defaultValue.to;
|
|
680
|
+
}
|
|
681
|
+
this.model = { ...this.model };
|
|
682
|
+
}
|
|
683
|
+
else {
|
|
684
|
+
if (defaultValue) {
|
|
685
|
+
this.model = { ...defaultValue };
|
|
686
|
+
}
|
|
687
|
+
else {
|
|
688
|
+
this.model = {};
|
|
689
|
+
}
|
|
690
|
+
}
|
|
691
|
+
}
|
|
692
|
+
_validateModel() {
|
|
693
|
+
}
|
|
694
|
+
_setModel(value) {
|
|
695
|
+
if (value) {
|
|
696
|
+
if (value.from && (!isDate(value.from) || !isValid(value.from))) {
|
|
697
|
+
value.from = parseISO(value.from);
|
|
698
|
+
}
|
|
699
|
+
if (value.to && (!isDate(value.to) || !isValid(value.to))) {
|
|
700
|
+
value.to = parseISO(value.to);
|
|
701
|
+
}
|
|
702
|
+
}
|
|
703
|
+
super._setModel(value);
|
|
704
|
+
}
|
|
705
|
+
_parseConfig(item) {
|
|
706
|
+
this.case = this._additionalConfig?.case ?? 'camel';
|
|
707
|
+
super._parseConfig(item);
|
|
708
|
+
}
|
|
709
|
+
_init() {
|
|
710
|
+
if (!this.label) {
|
|
711
|
+
this.label = ['Date From', 'Date To'];
|
|
712
|
+
}
|
|
713
|
+
if (!this.model) {
|
|
714
|
+
this.model = this.defaultValue || {};
|
|
715
|
+
}
|
|
716
|
+
}
|
|
717
|
+
_clearValue(defaultValue = undefined) {
|
|
718
|
+
this.model = this.defaultValue ?? {};
|
|
719
|
+
}
|
|
720
|
+
}
|
|
721
|
+
|
|
722
|
+
class DateRangeItem extends BaseDateRangeItem {
|
|
723
|
+
static create(config, filter) {
|
|
724
|
+
return new DateRangeItem(config, null, filter);
|
|
725
|
+
}
|
|
726
|
+
}
|
|
727
|
+
|
|
728
|
+
class DateTimeRangeItem extends BaseDateRangeItem {
|
|
729
|
+
static create(config, filter) {
|
|
730
|
+
return new DateTimeRangeItem(config, null, filter);
|
|
731
|
+
}
|
|
732
|
+
}
|
|
733
|
+
|
|
734
|
+
function tryConvertToNumber(val) {
|
|
735
|
+
return isNaN(val)
|
|
736
|
+
? val
|
|
737
|
+
: +val;
|
|
738
|
+
}
|
|
739
|
+
|
|
740
|
+
function parseItemValueFromStored(item, params, paramCase) {
|
|
741
|
+
const param = params[item.name];
|
|
742
|
+
switch (item.type) {
|
|
743
|
+
case ItemType.Range: {
|
|
744
|
+
const min = params[getRangeName(paramCase, item.name, 'min')];
|
|
745
|
+
const max = params[getRangeName(paramCase, item.name, 'max')];
|
|
746
|
+
return { min: min, max: max };
|
|
747
|
+
}
|
|
748
|
+
case ItemType.DateRange:
|
|
749
|
+
case ItemType.DateTimeRange: {
|
|
750
|
+
const from = params[getRangeName(item.case, item.name, 'from')];
|
|
751
|
+
const to = params[getRangeName(item.case, item.name, 'to')];
|
|
752
|
+
return { from: from, to: to };
|
|
753
|
+
}
|
|
754
|
+
case ItemType.Week: {
|
|
755
|
+
const from = params[getRangeName('camel', item.name, 'from')];
|
|
756
|
+
const to = params[getRangeName('camel', item.name, 'to')];
|
|
757
|
+
const period = params[`${item.name}Period`];
|
|
758
|
+
return { from, to, period };
|
|
759
|
+
}
|
|
760
|
+
case ItemType.Select: {
|
|
761
|
+
if (item.multiple && !!param) {
|
|
762
|
+
const values = param.split(',');
|
|
763
|
+
if (item.isolate) {
|
|
764
|
+
const isolatedValue = Array.isArray(item.isolate.value)
|
|
765
|
+
? item.isolate.value
|
|
766
|
+
: [item.isolate.value];
|
|
767
|
+
item.isolate.enabled = arraysHaveSameElements(isolatedValue, values);
|
|
768
|
+
return item.isolate.enabled
|
|
769
|
+
? isolatedValue
|
|
770
|
+
: values;
|
|
771
|
+
}
|
|
772
|
+
return values;
|
|
773
|
+
}
|
|
774
|
+
else {
|
|
775
|
+
return param;
|
|
776
|
+
}
|
|
777
|
+
}
|
|
778
|
+
case ItemType.Checkbox: {
|
|
779
|
+
if (param === 'true') {
|
|
780
|
+
return true === item.checked;
|
|
781
|
+
}
|
|
782
|
+
else {
|
|
783
|
+
return param === item.checked;
|
|
784
|
+
}
|
|
785
|
+
}
|
|
786
|
+
case ItemType.AutoComplete: {
|
|
787
|
+
const filterParts = filterFromQueryParam(param);
|
|
788
|
+
return {
|
|
789
|
+
name: filterParts[1],
|
|
790
|
+
value: tryConvertToNumber(filterParts[0])
|
|
791
|
+
};
|
|
792
|
+
}
|
|
793
|
+
case ItemType.AutoCompleteChips:
|
|
794
|
+
case ItemType.Chips: {
|
|
795
|
+
const filterParts = param.split(',');
|
|
796
|
+
return filterParts.reduce((arry, value) => {
|
|
797
|
+
const chipParts = filterFromQueryParam(value);
|
|
798
|
+
arry.push({
|
|
799
|
+
name: chipParts[1],
|
|
800
|
+
value: tryConvertToNumber(chipParts[0]),
|
|
801
|
+
});
|
|
802
|
+
return arry;
|
|
803
|
+
}, []);
|
|
804
|
+
}
|
|
805
|
+
default: {
|
|
806
|
+
return param;
|
|
807
|
+
}
|
|
808
|
+
}
|
|
809
|
+
}
|
|
810
|
+
function arraysHaveSameElements(arr1, arr2) {
|
|
811
|
+
arr1 = [...arr1].sort();
|
|
812
|
+
arr2 = [...arr2].sort();
|
|
813
|
+
return arr1.some((item) => {
|
|
814
|
+
return arr2.includes(item);
|
|
815
|
+
});
|
|
816
|
+
}
|
|
817
|
+
|
|
818
|
+
function parseDate(value) {
|
|
819
|
+
if (value && (!isDate(value) || !isValid(value))) {
|
|
820
|
+
return parseISO(value);
|
|
821
|
+
}
|
|
822
|
+
return value;
|
|
823
|
+
}
|
|
824
|
+
|
|
825
|
+
class WeekItem extends BaseItem {
|
|
826
|
+
static create(config, filter) {
|
|
827
|
+
return new WeekItem(config, null, filter);
|
|
828
|
+
}
|
|
829
|
+
get value() {
|
|
830
|
+
let value = clone(this.model);
|
|
831
|
+
if (!isObject(this.model) ||
|
|
832
|
+
(isEmpty(this.model.from, { zero: true }) && isEmpty(this.model.to, { zero: true }))) {
|
|
833
|
+
value = undefined;
|
|
834
|
+
}
|
|
835
|
+
if (isEmpty(value, { zero: true })) {
|
|
836
|
+
return undefined;
|
|
837
|
+
}
|
|
838
|
+
let from = value.from;
|
|
839
|
+
let to = value.to;
|
|
840
|
+
const period = value.period;
|
|
841
|
+
value = {};
|
|
842
|
+
if (from) {
|
|
843
|
+
if (isString(from)) {
|
|
844
|
+
from = parseISO(from);
|
|
845
|
+
}
|
|
846
|
+
if (isValid(from) && isDate(from)) {
|
|
847
|
+
value.from = from;
|
|
848
|
+
}
|
|
849
|
+
}
|
|
850
|
+
if (to) {
|
|
851
|
+
if (isString(to)) {
|
|
852
|
+
to = parseISO(to);
|
|
853
|
+
}
|
|
854
|
+
if (isValid(to) && isDate(to)) {
|
|
855
|
+
value.to = to;
|
|
856
|
+
}
|
|
857
|
+
}
|
|
858
|
+
if (period) {
|
|
859
|
+
value.period = isString(period) ? parseInt(period, 10) : period;
|
|
860
|
+
}
|
|
861
|
+
return value;
|
|
862
|
+
}
|
|
863
|
+
get queryObject() {
|
|
864
|
+
const value = this.value;
|
|
865
|
+
const name = this.name;
|
|
866
|
+
const paramFromName = getRangeName('camel', name, 'from');
|
|
867
|
+
const paramToName = getRangeName('camel', name, 'to');
|
|
868
|
+
const paramPeriodName = `${name}Period`;
|
|
869
|
+
return {
|
|
870
|
+
[paramFromName]: value?.from || undefined,
|
|
871
|
+
[paramToName]: value?.to || undefined,
|
|
872
|
+
[paramPeriodName]: value?.period || undefined,
|
|
873
|
+
};
|
|
874
|
+
}
|
|
875
|
+
get persistanceObject() {
|
|
876
|
+
const query = this.queryObject;
|
|
877
|
+
const name = this.name;
|
|
878
|
+
const paramFromName = getRangeName('camel', name, 'from');
|
|
879
|
+
const paramFromValue = query[paramFromName] && simpleFormat(query[paramFromName]) || query[paramFromName];
|
|
880
|
+
const paramToName = getRangeName('camel', name, 'to');
|
|
881
|
+
const paramToValue = query[paramToName] && simpleFormat(query[paramToName]) || query[paramToName];
|
|
882
|
+
const paramPeriodName = `${name}Period`;
|
|
883
|
+
return {
|
|
884
|
+
[paramFromName]: paramFromValue,
|
|
885
|
+
[paramToName]: paramToValue,
|
|
886
|
+
[paramPeriodName]: query[paramPeriodName],
|
|
887
|
+
};
|
|
888
|
+
}
|
|
889
|
+
getChipsContent(type = null) {
|
|
890
|
+
return formatPeriodObject(this.value);
|
|
891
|
+
}
|
|
892
|
+
_validateModel() { }
|
|
893
|
+
_setModel(value) {
|
|
894
|
+
if (value) {
|
|
895
|
+
value.from = parseDate(value.from);
|
|
896
|
+
value.to = parseDate(value.to);
|
|
897
|
+
value.period = parseInt(value.period, 10) || undefined;
|
|
898
|
+
}
|
|
899
|
+
super._setModel(value);
|
|
900
|
+
}
|
|
901
|
+
_parseConfig(item) {
|
|
902
|
+
super._parseConfig(item);
|
|
903
|
+
this.seedDate = item.seedDate;
|
|
904
|
+
}
|
|
905
|
+
_init() { }
|
|
906
|
+
_clearValue(defaultValue = undefined) {
|
|
907
|
+
this.model = defaultValue ?? undefined;
|
|
908
|
+
}
|
|
909
|
+
}
|
|
910
|
+
|
|
911
|
+
/**
|
|
912
|
+
* We need this function because when we store persisted/query/remote filter values
|
|
913
|
+
* it stores with different format, ex.: Range will be stored as RangeFrom && RangeTo
|
|
914
|
+
* and in this case we don't know how to restroe those values.
|
|
915
|
+
*
|
|
916
|
+
* This function do convertation for those kinds of stored values
|
|
917
|
+
*
|
|
918
|
+
* @param params
|
|
919
|
+
* @param items
|
|
920
|
+
* @param paramsCase
|
|
921
|
+
*/
|
|
922
|
+
function restoreItems(params, items, paramsCase) {
|
|
923
|
+
const result = {};
|
|
924
|
+
Object.keys(params)
|
|
925
|
+
.forEach((name) => {
|
|
926
|
+
const item = findItemWidthName(items, name);
|
|
927
|
+
if (item) {
|
|
928
|
+
result[item.name] = parseItemValueFromStored(item, params, paramsCase);
|
|
929
|
+
}
|
|
930
|
+
});
|
|
931
|
+
return result;
|
|
932
|
+
}
|
|
933
|
+
function findItemWidthName(items, name) {
|
|
934
|
+
return items
|
|
935
|
+
.find((filterItem) => {
|
|
936
|
+
if (filterItem instanceof RangeItem) {
|
|
937
|
+
return name === getRangeName(filterItem.case, filterItem.name, 'min') ||
|
|
938
|
+
name === getRangeName(filterItem.case, filterItem.name, 'max') ||
|
|
939
|
+
name === filterItem.name;
|
|
940
|
+
}
|
|
941
|
+
else if (filterItem instanceof DateRangeItem || filterItem instanceof DateTimeRangeItem) {
|
|
942
|
+
return name === getRangeName(filterItem.case, filterItem.name, 'from') ||
|
|
943
|
+
name === getRangeName(filterItem.case, filterItem.name, 'to');
|
|
944
|
+
}
|
|
945
|
+
else if (filterItem instanceof WeekItem) {
|
|
946
|
+
return name === getRangeName('camel', filterItem.name, 'from')
|
|
947
|
+
|| name === getRangeName('camel', filterItem.name, 'to')
|
|
948
|
+
|| name === `${filterItem.name}Period`;
|
|
949
|
+
}
|
|
950
|
+
return filterItem.name === name;
|
|
951
|
+
});
|
|
952
|
+
}
|
|
953
|
+
|
|
954
|
+
class BaseAutocompleteItem extends BaseItem {
|
|
955
|
+
get valuesFn() {
|
|
956
|
+
return this._valuesFn;
|
|
957
|
+
}
|
|
958
|
+
_validateModel() {
|
|
959
|
+
//
|
|
960
|
+
}
|
|
961
|
+
_parseConfig(item) {
|
|
962
|
+
this.fetchOnFocus = item.fetchOnFocus ?? true;
|
|
963
|
+
super._parseConfig(item);
|
|
964
|
+
}
|
|
965
|
+
}
|
|
966
|
+
|
|
967
|
+
class AutocompleteChipsItem extends BaseAutocompleteItem {
|
|
968
|
+
static create(config, filter) {
|
|
969
|
+
return new AutocompleteChipsItem(config, null, filter);
|
|
970
|
+
}
|
|
971
|
+
get value() {
|
|
972
|
+
if (Array.isArray(this.model) && this.model.length === 0) {
|
|
973
|
+
return undefined;
|
|
974
|
+
}
|
|
975
|
+
return clone(this.model);
|
|
976
|
+
}
|
|
977
|
+
get queryObject() {
|
|
978
|
+
const value = this.value;
|
|
979
|
+
const name = this.name;
|
|
980
|
+
const params = {};
|
|
981
|
+
if (Array.isArray(value)) {
|
|
982
|
+
params[this.name] = value
|
|
983
|
+
.filter((item) => !!item.value)
|
|
984
|
+
.map((item) => item.value)
|
|
985
|
+
.join(',');
|
|
986
|
+
}
|
|
987
|
+
else {
|
|
988
|
+
params[name] = value;
|
|
989
|
+
}
|
|
990
|
+
return params;
|
|
991
|
+
}
|
|
992
|
+
get isChipVisible() {
|
|
993
|
+
return Array.isArray(this.model) && this.model.length > 0;
|
|
994
|
+
}
|
|
995
|
+
getChipsContent() {
|
|
996
|
+
return this.model
|
|
997
|
+
.reduce((acc, i) => {
|
|
998
|
+
acc.push(i.name);
|
|
999
|
+
return acc;
|
|
1000
|
+
}, [])
|
|
1001
|
+
.join(', ');
|
|
1002
|
+
}
|
|
1003
|
+
_init() {
|
|
1004
|
+
if (this.model === undefined) {
|
|
1005
|
+
this._model = [];
|
|
1006
|
+
}
|
|
1007
|
+
}
|
|
1008
|
+
_parseConfig(item) {
|
|
1009
|
+
this.chipImage = item.chipImage ?? 'image';
|
|
1010
|
+
this.chipIcon = item.chipIcon;
|
|
1011
|
+
this.chipIconColor = item.chipIconColor;
|
|
1012
|
+
this.chipColor = item.chipColor;
|
|
1013
|
+
this.chipBackground = item.chipBackground;
|
|
1014
|
+
this.chipClass = item.chipClass;
|
|
1015
|
+
super._parseConfig(item);
|
|
1016
|
+
}
|
|
1017
|
+
_clearValue(defaultValue = undefined) {
|
|
1018
|
+
this.model = defaultValue ?? [];
|
|
1019
|
+
this.search = '';
|
|
1020
|
+
}
|
|
1021
|
+
_setModel(value) {
|
|
1022
|
+
super._setModel(value || []);
|
|
1023
|
+
}
|
|
1024
|
+
}
|
|
1025
|
+
|
|
1026
|
+
class AutocompleteItem extends BaseAutocompleteItem {
|
|
1027
|
+
static create(config, filter) {
|
|
1028
|
+
return new AutocompleteItem(config, null, filter);
|
|
1029
|
+
}
|
|
1030
|
+
get value() {
|
|
1031
|
+
let value = clone(this.model);
|
|
1032
|
+
if (!this.model || this.model.value === undefined) {
|
|
1033
|
+
return undefined;
|
|
1034
|
+
}
|
|
1035
|
+
value = this.model.value;
|
|
1036
|
+
return value;
|
|
1037
|
+
}
|
|
1038
|
+
get queryObject() {
|
|
1039
|
+
const value = this.value;
|
|
1040
|
+
const name = this.name;
|
|
1041
|
+
const params = {};
|
|
1042
|
+
params[name] = value;
|
|
1043
|
+
return params;
|
|
1044
|
+
}
|
|
1045
|
+
getChipsContent() {
|
|
1046
|
+
return this.model ? this.model.name : '';
|
|
1047
|
+
}
|
|
1048
|
+
_init() {
|
|
1049
|
+
//
|
|
1050
|
+
}
|
|
1051
|
+
_clearValue(defaultValue = undefined) {
|
|
1052
|
+
this.model = defaultValue ?? undefined;
|
|
1053
|
+
this.search = '';
|
|
1054
|
+
}
|
|
1055
|
+
}
|
|
1056
|
+
|
|
1057
|
+
class CheckboxItem extends BaseItem {
|
|
1058
|
+
static create(config, filter) {
|
|
1059
|
+
return new CheckboxItem(config, null, filter);
|
|
1060
|
+
}
|
|
1061
|
+
get isTypeCheckbox() {
|
|
1062
|
+
return true;
|
|
1063
|
+
}
|
|
1064
|
+
get isChipVisible() {
|
|
1065
|
+
return this.value === this.checked;
|
|
1066
|
+
}
|
|
1067
|
+
get value() {
|
|
1068
|
+
const value = this.model ? this.checked : this.unchecked;
|
|
1069
|
+
if (!value) {
|
|
1070
|
+
return undefined;
|
|
1071
|
+
}
|
|
1072
|
+
return value;
|
|
1073
|
+
}
|
|
1074
|
+
get queryObject() {
|
|
1075
|
+
const value = this.value;
|
|
1076
|
+
const name = this.name;
|
|
1077
|
+
const params = {};
|
|
1078
|
+
params[name] = this.model ? value : undefined;
|
|
1079
|
+
return params;
|
|
1080
|
+
}
|
|
1081
|
+
getChipsContent(type = null) {
|
|
1082
|
+
return this.label;
|
|
1083
|
+
}
|
|
1084
|
+
_validateModel() {
|
|
1085
|
+
//
|
|
1086
|
+
}
|
|
1087
|
+
_parseConfig(item) {
|
|
1088
|
+
this.checked = item.checked;
|
|
1089
|
+
this.unchecked = item.unchecked;
|
|
1090
|
+
this.checked = item.checked ? toString(item.checked) : true;
|
|
1091
|
+
this.unchecked = item.unchecked ? toString(item.unchecked) : false;
|
|
1092
|
+
this.defaultValue = item.default === undefined ? this.unchecked : toString(this.defaultValue);
|
|
1093
|
+
super._parseConfig(item);
|
|
1094
|
+
}
|
|
1095
|
+
_init() {
|
|
1096
|
+
if (this.model === undefined) {
|
|
1097
|
+
this._model = this.checked === this.defaultValue;
|
|
1098
|
+
}
|
|
1099
|
+
}
|
|
1100
|
+
_clearValue(defaultValue = undefined) {
|
|
1101
|
+
this.model = defaultValue ?? false;
|
|
1102
|
+
}
|
|
1103
|
+
}
|
|
1104
|
+
|
|
1105
|
+
class ChipsItem extends BaseItem {
|
|
1106
|
+
static create(config, filter) {
|
|
1107
|
+
return new ChipsItem(config, null, filter);
|
|
1108
|
+
}
|
|
1109
|
+
get isTypeChips() {
|
|
1110
|
+
return true;
|
|
1111
|
+
}
|
|
1112
|
+
get value() {
|
|
1113
|
+
const value = clone(this.model);
|
|
1114
|
+
if (Array.isArray(value) && value.length === 0) {
|
|
1115
|
+
return undefined;
|
|
1116
|
+
}
|
|
1117
|
+
return value;
|
|
1118
|
+
}
|
|
1119
|
+
get isChipVisible() {
|
|
1120
|
+
return !!this.value;
|
|
1121
|
+
}
|
|
1122
|
+
get queryObject() {
|
|
1123
|
+
const value = this.value;
|
|
1124
|
+
const name = this.name;
|
|
1125
|
+
return {
|
|
1126
|
+
[name]: value,
|
|
1127
|
+
};
|
|
1128
|
+
}
|
|
1129
|
+
get persistanceObject() {
|
|
1130
|
+
const value = this.value;
|
|
1131
|
+
const name = this.name;
|
|
1132
|
+
const params = {};
|
|
1133
|
+
if (Array.isArray(value)) {
|
|
1134
|
+
params[name] = value.join(',');
|
|
1135
|
+
}
|
|
1136
|
+
else {
|
|
1137
|
+
params[name] = undefined;
|
|
1138
|
+
}
|
|
1139
|
+
return params;
|
|
1140
|
+
}
|
|
1141
|
+
getChipsContent() {
|
|
1142
|
+
return this.model
|
|
1143
|
+
.reduce((acc, i) => {
|
|
1144
|
+
acc.push(i.name);
|
|
1145
|
+
return acc;
|
|
1146
|
+
}, [])
|
|
1147
|
+
.join(', ');
|
|
1148
|
+
}
|
|
1149
|
+
_validateModel() {
|
|
1150
|
+
//
|
|
1151
|
+
}
|
|
1152
|
+
_setModel(value) {
|
|
1153
|
+
if (Array.isArray(value)) {
|
|
1154
|
+
value = value.map((val) => {
|
|
1155
|
+
if (isNaN(val)) {
|
|
1156
|
+
return val;
|
|
1157
|
+
}
|
|
1158
|
+
return +val;
|
|
1159
|
+
});
|
|
1160
|
+
}
|
|
1161
|
+
this._model = value;
|
|
1162
|
+
}
|
|
1163
|
+
_parseConfig(item) {
|
|
1164
|
+
this.multiple = item.multiple;
|
|
1165
|
+
super._parseConfig(item);
|
|
1166
|
+
}
|
|
1167
|
+
_init() {
|
|
1168
|
+
if (!Array.isArray(this.values)) {
|
|
1169
|
+
this.values = [];
|
|
1170
|
+
}
|
|
1171
|
+
if (this.model && Array.isArray(this.model) && this.values.length) {
|
|
1172
|
+
if (Number.isInteger(this.model[0])) {
|
|
1173
|
+
this._model = this.model.map((id) => {
|
|
1174
|
+
return this.values.find((value) => value.value === id);
|
|
1175
|
+
});
|
|
1176
|
+
}
|
|
1177
|
+
}
|
|
1178
|
+
if (this.model === undefined) {
|
|
1179
|
+
this._model = [];
|
|
1180
|
+
}
|
|
1181
|
+
}
|
|
1182
|
+
_clearValue(defaultValue = undefined) {
|
|
1183
|
+
this.model = defaultValue ?? [];
|
|
1184
|
+
}
|
|
1185
|
+
}
|
|
1186
|
+
|
|
1187
|
+
var ItemDateMode;
|
|
1188
|
+
(function (ItemDateMode) {
|
|
1189
|
+
ItemDateMode["Calendar"] = "calendar";
|
|
1190
|
+
ItemDateMode["ScrollMonthYear"] = "monthyear";
|
|
1191
|
+
ItemDateMode["ScrollMonthDayYear"] = "monthdayyear";
|
|
1192
|
+
})(ItemDateMode || (ItemDateMode = {}));
|
|
1193
|
+
|
|
1194
|
+
class BaseDateItem extends BaseItem {
|
|
1195
|
+
get value() {
|
|
1196
|
+
const value = clone(this.model);
|
|
1197
|
+
if (!value || !isValid(value) || !isDate(value)) {
|
|
1198
|
+
return undefined;
|
|
1199
|
+
}
|
|
1200
|
+
return value;
|
|
1201
|
+
}
|
|
1202
|
+
get queryObject() {
|
|
1203
|
+
const value = this.value;
|
|
1204
|
+
const name = this.name;
|
|
1205
|
+
const params = {};
|
|
1206
|
+
params[name] = value;
|
|
1207
|
+
return params;
|
|
1208
|
+
}
|
|
1209
|
+
get persistanceObject() {
|
|
1210
|
+
const value = this.queryObject[this.name];
|
|
1211
|
+
return {
|
|
1212
|
+
[this.name]: value ? simpleFormat(value) : undefined,
|
|
1213
|
+
};
|
|
1214
|
+
}
|
|
1215
|
+
_validateModel() {
|
|
1216
|
+
}
|
|
1217
|
+
_setModel(value) {
|
|
1218
|
+
if (value) {
|
|
1219
|
+
if (!isDate(value) || !isValid(value)) {
|
|
1220
|
+
value = parseISO(value);
|
|
1221
|
+
}
|
|
1222
|
+
}
|
|
1223
|
+
super._setModel(value);
|
|
1224
|
+
}
|
|
1225
|
+
_parseConfig(item) {
|
|
1226
|
+
this.maxYear = item.maxYear;
|
|
1227
|
+
this.mode = item.mode || ItemDateMode.Calendar;
|
|
1228
|
+
super._parseConfig(item);
|
|
1229
|
+
}
|
|
1230
|
+
_init() {
|
|
1231
|
+
if (!this.label) {
|
|
1232
|
+
this.label = ['Min', 'Max'];
|
|
1233
|
+
}
|
|
1234
|
+
}
|
|
1235
|
+
}
|
|
1236
|
+
|
|
1237
|
+
class DateItem extends BaseDateItem {
|
|
1238
|
+
static create(config, filter) {
|
|
1239
|
+
return new DateItem(config, null, filter);
|
|
1240
|
+
}
|
|
1241
|
+
getChipsContent(type = null) {
|
|
1242
|
+
let dateFormat = 'date';
|
|
1243
|
+
if (this.mode === ItemDateMode.ScrollMonthYear) {
|
|
1244
|
+
dateFormat = 'full-date-dayless';
|
|
1245
|
+
}
|
|
1246
|
+
return format(this.model, dateFormat);
|
|
1247
|
+
}
|
|
1248
|
+
_clearValue(defaultValue = undefined) {
|
|
1249
|
+
this.model = defaultValue ?? undefined;
|
|
1250
|
+
}
|
|
1251
|
+
}
|
|
1252
|
+
|
|
1253
|
+
class DateTimeItem extends BaseDateItem {
|
|
1254
|
+
static create(config, filter) {
|
|
1255
|
+
return new DateTimeItem(config, null, filter);
|
|
1256
|
+
}
|
|
1257
|
+
_clearValue(defaultValue = undefined) {
|
|
1258
|
+
this.model = defaultValue ?? undefined;
|
|
1259
|
+
}
|
|
1260
|
+
}
|
|
1261
|
+
|
|
1262
|
+
function findValue(values, value, children) {
|
|
1263
|
+
for (let i = 0; i < values.length; i++) {
|
|
1264
|
+
const val = values[i];
|
|
1265
|
+
if (val[children]) {
|
|
1266
|
+
return findValue(val[children], value, children);
|
|
1267
|
+
}
|
|
1268
|
+
if (val.value === value) {
|
|
1269
|
+
return val;
|
|
1270
|
+
}
|
|
1271
|
+
}
|
|
1272
|
+
return undefined;
|
|
1273
|
+
}
|
|
1274
|
+
|
|
1275
|
+
class SimpleSelectItem extends BaseSelectItem {
|
|
1276
|
+
constructor(itemConfig, _persistedValues, _filter) {
|
|
1277
|
+
super(itemConfig, _persistedValues, _filter);
|
|
1278
|
+
}
|
|
1279
|
+
get value() {
|
|
1280
|
+
let value = this.model;
|
|
1281
|
+
if (value === '__all' || value === undefined) {
|
|
1282
|
+
value = undefined;
|
|
1283
|
+
}
|
|
1284
|
+
return value;
|
|
1285
|
+
}
|
|
1286
|
+
getChipsContent(type = null) {
|
|
1287
|
+
if (this.children) {
|
|
1288
|
+
const itemValue = findValue(this.values, this.model, this.children);
|
|
1289
|
+
return itemValue && itemValue.name;
|
|
1290
|
+
}
|
|
1291
|
+
const itemValue = this.values.find((val) => val.value === this.model);
|
|
1292
|
+
if (itemValue) {
|
|
1293
|
+
return itemValue.name;
|
|
1294
|
+
}
|
|
1295
|
+
else if (this.isolate) {
|
|
1296
|
+
return this.isolate.label;
|
|
1297
|
+
}
|
|
1298
|
+
}
|
|
1299
|
+
get isChipVisible() {
|
|
1300
|
+
return this.model !== '__all' && this.model !== undefined;
|
|
1301
|
+
}
|
|
1302
|
+
_init() {
|
|
1303
|
+
super._init();
|
|
1304
|
+
if (this.model === undefined && this.defaultValue === undefined) {
|
|
1305
|
+
this._model = '__all';
|
|
1306
|
+
}
|
|
1307
|
+
}
|
|
1308
|
+
get isolateOptionNotSelected() {
|
|
1309
|
+
const modelValue = this.model;
|
|
1310
|
+
const isolate = this.isolate;
|
|
1311
|
+
return isolate && !isolate.enabled && modelValue?.length === 0;
|
|
1312
|
+
}
|
|
1313
|
+
_setModel(value) {
|
|
1314
|
+
if (value) {
|
|
1315
|
+
if (!isNaN(value)) {
|
|
1316
|
+
value = +value;
|
|
1317
|
+
}
|
|
1318
|
+
}
|
|
1319
|
+
super._setModel(value);
|
|
1320
|
+
}
|
|
1321
|
+
_validateModel() {
|
|
1322
|
+
const item = this.values.find((value) => {
|
|
1323
|
+
return value.value == this.model;
|
|
1324
|
+
});
|
|
1325
|
+
const value = item ? item.value : '__all';
|
|
1326
|
+
if (this._model !== value) {
|
|
1327
|
+
this.model = value;
|
|
1328
|
+
}
|
|
1329
|
+
}
|
|
1330
|
+
_clearValue(defaultValue = undefined) {
|
|
1331
|
+
super._clearValue(defaultValue);
|
|
1332
|
+
const value = Array.isArray(this.values) && this.values.some((val) => val.value === '__all')
|
|
1333
|
+
? '__all'
|
|
1334
|
+
: undefined;
|
|
1335
|
+
this.model = defaultValue ?? value;
|
|
1336
|
+
}
|
|
1337
|
+
}
|
|
1338
|
+
|
|
1339
|
+
class SelectItem {
|
|
1340
|
+
static create(config, filter) {
|
|
1341
|
+
if (config.multiple) {
|
|
1342
|
+
return new MultipleSelectItem(config, null, filter);
|
|
1343
|
+
}
|
|
1344
|
+
return new SimpleSelectItem(config, null, filter);
|
|
1345
|
+
}
|
|
1346
|
+
}
|
|
1347
|
+
|
|
1348
|
+
class TextItem extends BaseItem {
|
|
1349
|
+
static create(config, filter) {
|
|
1350
|
+
return new TextItem(config, null, filter);
|
|
1351
|
+
}
|
|
1352
|
+
get value() {
|
|
1353
|
+
return !!this.model ? this.model : undefined;
|
|
1354
|
+
}
|
|
1355
|
+
get queryObject() {
|
|
1356
|
+
const value = this.value;
|
|
1357
|
+
const name = this.name;
|
|
1358
|
+
const params = {};
|
|
1359
|
+
params[name] = value;
|
|
1360
|
+
return params;
|
|
1361
|
+
}
|
|
1362
|
+
getChipsContent() {
|
|
1363
|
+
return this.model;
|
|
1364
|
+
}
|
|
1365
|
+
_validateModel() {
|
|
1366
|
+
//
|
|
1367
|
+
}
|
|
1368
|
+
_parseConfig(item) {
|
|
1369
|
+
this.prefix = item.prefix;
|
|
1370
|
+
this.suffix = item.suffix;
|
|
1371
|
+
super._parseConfig(item);
|
|
1372
|
+
}
|
|
1373
|
+
_init() {
|
|
1374
|
+
//
|
|
1375
|
+
}
|
|
1376
|
+
_clearValue(defaultValue = undefined) {
|
|
1377
|
+
this.model = defaultValue ?? '';
|
|
1378
|
+
}
|
|
1379
|
+
}
|
|
1380
|
+
|
|
1381
|
+
function createFilterItem(item, config, filter) {
|
|
1382
|
+
switch (item.type) {
|
|
1383
|
+
case ItemType.Select: {
|
|
1384
|
+
return SelectItem.create(item, filter);
|
|
1385
|
+
}
|
|
1386
|
+
case ItemType.Chips: {
|
|
1387
|
+
return ChipsItem.create(item, filter);
|
|
1388
|
+
}
|
|
1389
|
+
case ItemType.Range: {
|
|
1390
|
+
return RangeItem.create(item, config, filter);
|
|
1391
|
+
}
|
|
1392
|
+
case ItemType.DateRange: {
|
|
1393
|
+
return DateRangeItem.create(item, filter);
|
|
1394
|
+
}
|
|
1395
|
+
case ItemType.DateTimeRange: {
|
|
1396
|
+
return DateTimeRangeItem.create(item, filter);
|
|
1397
|
+
}
|
|
1398
|
+
case ItemType.Date: {
|
|
1399
|
+
return DateItem.create(item, filter);
|
|
1400
|
+
}
|
|
1401
|
+
case ItemType.Week: {
|
|
1402
|
+
return WeekItem.create(item, filter);
|
|
1403
|
+
}
|
|
1404
|
+
case ItemType.DateTime: {
|
|
1405
|
+
return DateTimeItem.create(item, filter);
|
|
1406
|
+
}
|
|
1407
|
+
case ItemType.AutoComplete: {
|
|
1408
|
+
return AutocompleteItem.create(item, filter);
|
|
1409
|
+
}
|
|
1410
|
+
case ItemType.AutoCompleteChips: {
|
|
1411
|
+
return AutocompleteChipsItem.create(item, filter);
|
|
1412
|
+
}
|
|
1413
|
+
case ItemType.Checkbox: {
|
|
1414
|
+
return CheckboxItem.create(item, filter);
|
|
1415
|
+
}
|
|
1416
|
+
case ItemType.Keyword:
|
|
1417
|
+
case ItemType.Text: {
|
|
1418
|
+
return TextItem.create(item, filter);
|
|
1419
|
+
}
|
|
1420
|
+
}
|
|
1421
|
+
}
|
|
1422
|
+
|
|
1423
|
+
var ActionMode;
|
|
1424
|
+
(function (ActionMode) {
|
|
1425
|
+
ActionMode["Button"] = "button";
|
|
1426
|
+
ActionMode["Menu"] = "menu";
|
|
1427
|
+
ActionMode["File"] = "file";
|
|
1428
|
+
})(ActionMode || (ActionMode = {}));
|
|
1429
|
+
|
|
1430
|
+
var ActionType;
|
|
1431
|
+
(function (ActionType) {
|
|
1432
|
+
ActionType["Basic"] = "basic";
|
|
1433
|
+
ActionType["Raised"] = "raised";
|
|
1434
|
+
ActionType["Icon"] = "icon";
|
|
1435
|
+
ActionType["Fab"] = "fab";
|
|
1436
|
+
ActionType["MiniFab"] = "mini-fab";
|
|
1437
|
+
ActionType["Flat"] = "flat";
|
|
1438
|
+
ActionType["Stroked"] = "stroked";
|
|
1439
|
+
})(ActionType || (ActionType = {}));
|
|
1440
|
+
|
|
1441
|
+
var ButtonStyle;
|
|
1442
|
+
(function (ButtonStyle) {
|
|
1443
|
+
ButtonStyle["Basic"] = "basic";
|
|
1444
|
+
ButtonStyle["Raised"] = "raised";
|
|
1445
|
+
ButtonStyle["Icon"] = "icon";
|
|
1446
|
+
ButtonStyle["Fab"] = "fab";
|
|
1447
|
+
ButtonStyle["MiniFab"] = "mini-fab";
|
|
1448
|
+
ButtonStyle["Flat"] = "flat";
|
|
1449
|
+
ButtonStyle["Stroked"] = "stroked";
|
|
1450
|
+
})(ButtonStyle || (ButtonStyle = {}));
|
|
1451
|
+
|
|
1452
|
+
var PickerViewType;
|
|
1453
|
+
(function (PickerViewType) {
|
|
1454
|
+
PickerViewType["Date"] = "date";
|
|
1455
|
+
PickerViewType["DateTime"] = "datetime";
|
|
1456
|
+
PickerViewType["Time"] = "time";
|
|
1457
|
+
PickerViewType["Week"] = "week";
|
|
1458
|
+
PickerViewType["MonthRange"] = "monthrange";
|
|
1459
|
+
})(PickerViewType || (PickerViewType = {}));
|
|
1460
|
+
|
|
1461
|
+
const SORT_BY_FIELD = 'sortName';
|
|
1462
|
+
const SORT_DIRECTION_FIELD = 'sortDirection';
|
|
1463
|
+
class FsFilterConfig {
|
|
1464
|
+
constructor(data = {}) {
|
|
1465
|
+
this.load = true;
|
|
1466
|
+
this.persist = false;
|
|
1467
|
+
this.inline = false;
|
|
1468
|
+
this.autofocus = false;
|
|
1469
|
+
this.chips = false;
|
|
1470
|
+
this.sortValues = null;
|
|
1471
|
+
this.sort = null;
|
|
1472
|
+
// public sortDirection = null;
|
|
1473
|
+
this.queryParam = false;
|
|
1474
|
+
this.case = 'camel';
|
|
1475
|
+
this._init(data);
|
|
1476
|
+
}
|
|
1477
|
+
_init(data = {}) {
|
|
1478
|
+
this.load = data.load ?? true;
|
|
1479
|
+
this.persist = data.persist;
|
|
1480
|
+
this.savedFilters = data.savedFilters;
|
|
1481
|
+
this.inline = data.inline ?? false;
|
|
1482
|
+
this.autofocus = data.autofocus ?? false;
|
|
1483
|
+
this.chips = data.chips ?? false;
|
|
1484
|
+
this.sortValues = data.sorts;
|
|
1485
|
+
this.sort = data.sort;
|
|
1486
|
+
this.queryParam = data.queryParam ?? false;
|
|
1487
|
+
this.init = data.init;
|
|
1488
|
+
this.change = data.change;
|
|
1489
|
+
this.reload = data.reload;
|
|
1490
|
+
this.clear = data.clear;
|
|
1491
|
+
this.sortChange = data.sortChange;
|
|
1492
|
+
this.case = data.case ?? 'camel';
|
|
1493
|
+
this.reloadWhenConfigChanged = data.reloadWhenConfigChanged;
|
|
1494
|
+
this.button = data.button;
|
|
1495
|
+
this.items = data.items;
|
|
1496
|
+
this.actions = data.actions;
|
|
1497
|
+
this.case = data.case ?? 'camel';
|
|
1498
|
+
if (this.persist) {
|
|
1499
|
+
if (typeof this.persist === 'object') {
|
|
1500
|
+
if (this.persist.name) {
|
|
1501
|
+
this.namespace = this.persist.name;
|
|
1502
|
+
}
|
|
1503
|
+
}
|
|
1504
|
+
}
|
|
1505
|
+
if (!this.button) {
|
|
1506
|
+
this.button = {};
|
|
1507
|
+
}
|
|
1508
|
+
if (this.button.label === undefined) {
|
|
1509
|
+
this.button.label = 'Filters';
|
|
1510
|
+
}
|
|
1511
|
+
if (this.button.icon === undefined) {
|
|
1512
|
+
this.button.icon = 'tune';
|
|
1513
|
+
}
|
|
1514
|
+
if (this.button.style === undefined) {
|
|
1515
|
+
this.button.style = ButtonStyle.Raised;
|
|
1516
|
+
}
|
|
1517
|
+
if (this.button.color === undefined) {
|
|
1518
|
+
this.button.color = 'default';
|
|
1519
|
+
}
|
|
1520
|
+
if (this.clear === undefined) {
|
|
1521
|
+
this.clear = () => { };
|
|
1522
|
+
}
|
|
1523
|
+
}
|
|
1524
|
+
}
|
|
1525
|
+
|
|
1526
|
+
class FsFilterItemsStore {
|
|
1527
|
+
constructor() {
|
|
1528
|
+
this.sortByItem = null;
|
|
1529
|
+
this.sortDirectionItem = null;
|
|
1530
|
+
this.keywordItem = null;
|
|
1531
|
+
this._ready$ = new BehaviorSubject(false);
|
|
1532
|
+
this._items = [];
|
|
1533
|
+
this._visibleItems$ = new BehaviorSubject([]);
|
|
1534
|
+
this._itemsByName = new Map();
|
|
1535
|
+
this._itemsValuesLoaded = false;
|
|
1536
|
+
this._hasKeyword = false;
|
|
1537
|
+
this._itemsChange$ = new Subject();
|
|
1538
|
+
this._destroy$ = new Subject();
|
|
1539
|
+
this._lazyInit();
|
|
1540
|
+
}
|
|
1541
|
+
get items() {
|
|
1542
|
+
return this._items;
|
|
1543
|
+
}
|
|
1544
|
+
get visibleItems() {
|
|
1545
|
+
return this._visibleItems$.getValue();
|
|
1546
|
+
}
|
|
1547
|
+
set visibleItems(items) {
|
|
1548
|
+
this._visibleItems$.next(items);
|
|
1549
|
+
}
|
|
1550
|
+
get visibleItems$() {
|
|
1551
|
+
return this._visibleItems$.asObservable();
|
|
1552
|
+
}
|
|
1553
|
+
get hasKeyword() {
|
|
1554
|
+
return this._hasKeyword;
|
|
1555
|
+
}
|
|
1556
|
+
get itemsChange$() {
|
|
1557
|
+
return this._itemsChange$.pipe(debounceTime(30));
|
|
1558
|
+
}
|
|
1559
|
+
get ready$() {
|
|
1560
|
+
return this._ready$.asObservable();
|
|
1561
|
+
}
|
|
1562
|
+
ngOnDestroy() {
|
|
1563
|
+
this.destroyItems();
|
|
1564
|
+
this._destroy$.next();
|
|
1565
|
+
this._destroy$.complete();
|
|
1566
|
+
}
|
|
1567
|
+
setConfig(config) {
|
|
1568
|
+
this._itemsByName.clear();
|
|
1569
|
+
this._config = config;
|
|
1570
|
+
this.initItems(config.items);
|
|
1571
|
+
}
|
|
1572
|
+
getItemByName(name) {
|
|
1573
|
+
return this._itemsByName.get(name);
|
|
1574
|
+
}
|
|
1575
|
+
initItems(items) {
|
|
1576
|
+
this._itemsValuesLoaded = false;
|
|
1577
|
+
if (Array.isArray(items)) {
|
|
1578
|
+
this._createItems(items);
|
|
1579
|
+
}
|
|
1580
|
+
}
|
|
1581
|
+
filtersClear() {
|
|
1582
|
+
this.items.forEach((item) => {
|
|
1583
|
+
if (item instanceof RangeItem) {
|
|
1584
|
+
item.clearRange(null, item.defaultValue);
|
|
1585
|
+
}
|
|
1586
|
+
else if (item instanceof BaseDateRangeItem) {
|
|
1587
|
+
item.clearDateRange(null, item.defaultValue);
|
|
1588
|
+
}
|
|
1589
|
+
else {
|
|
1590
|
+
item.clear(item.defaultValue);
|
|
1591
|
+
}
|
|
1592
|
+
});
|
|
1593
|
+
if (this.sortByItem) {
|
|
1594
|
+
if (this._config.sort) {
|
|
1595
|
+
this.sortByItem.model = this._config.sort.value;
|
|
1596
|
+
}
|
|
1597
|
+
else {
|
|
1598
|
+
this.sortByItem.clear(this.sortByItem.defaultValue);
|
|
1599
|
+
}
|
|
1600
|
+
}
|
|
1601
|
+
if (this.sortDirectionItem) {
|
|
1602
|
+
if (this._config.sort) {
|
|
1603
|
+
this.sortDirectionItem.model = this._config.sort.direction;
|
|
1604
|
+
}
|
|
1605
|
+
else {
|
|
1606
|
+
this.sortDirectionItem.clear(this.sortDirectionItem.defaultValue);
|
|
1607
|
+
}
|
|
1608
|
+
}
|
|
1609
|
+
this.keywordItem?.clear();
|
|
1610
|
+
}
|
|
1611
|
+
loadAsyncValues() {
|
|
1612
|
+
this.items
|
|
1613
|
+
.filter((item) => item.hasPendingValues)
|
|
1614
|
+
.forEach((item) => item.loadAsyncValues());
|
|
1615
|
+
}
|
|
1616
|
+
loadAsyncDefaults() {
|
|
1617
|
+
// default values can be asynchronous, and we must load them if there is no persisted value instead
|
|
1618
|
+
const defaultValuesToBeLoaded = this.items
|
|
1619
|
+
.filter((item) => {
|
|
1620
|
+
return item.defaultValueFn
|
|
1621
|
+
&& (item.persistedValue === null || item.persistedValue === undefined);
|
|
1622
|
+
});
|
|
1623
|
+
// special hack for isolate multiple select
|
|
1624
|
+
// values for this type of select must be preloaded
|
|
1625
|
+
// Read more in class MultipleSelectItem._init()
|
|
1626
|
+
const valuesToBeLoaded = this.items
|
|
1627
|
+
.filter((item) => {
|
|
1628
|
+
return (item instanceof MultipleSelectItem) && item.hasPendingValues && item.isolate;
|
|
1629
|
+
});
|
|
1630
|
+
if (defaultValuesToBeLoaded.length > 0 || valuesToBeLoaded.length > 0) {
|
|
1631
|
+
forkJoin([
|
|
1632
|
+
...defaultValuesToBeLoaded
|
|
1633
|
+
.map((item) => item.loadDefaultValue()),
|
|
1634
|
+
...valuesToBeLoaded
|
|
1635
|
+
.map((item) => {
|
|
1636
|
+
item.loadAsyncValues();
|
|
1637
|
+
return item.loading$
|
|
1638
|
+
.pipe();
|
|
1639
|
+
}),
|
|
1640
|
+
])
|
|
1641
|
+
.pipe(finalize(() => {
|
|
1642
|
+
this._ready$.next(true);
|
|
1643
|
+
}), takeUntil(this._destroy$))
|
|
1644
|
+
.subscribe();
|
|
1645
|
+
}
|
|
1646
|
+
else {
|
|
1647
|
+
this._ready$.next(true);
|
|
1648
|
+
}
|
|
1649
|
+
}
|
|
1650
|
+
getSort() {
|
|
1651
|
+
let sortBy = this.getSortByValue();
|
|
1652
|
+
sortBy = sortBy === '__all' ? null : sortBy;
|
|
1653
|
+
let sortDirection = this.getSortDirectionValue();
|
|
1654
|
+
sortDirection = sortDirection === '__all' ? null : sortDirection;
|
|
1655
|
+
return {
|
|
1656
|
+
value: sortBy,
|
|
1657
|
+
direction: sortDirection,
|
|
1658
|
+
};
|
|
1659
|
+
}
|
|
1660
|
+
getSortByValue() {
|
|
1661
|
+
return this.sortByItem ? this.sortByItem.model : null;
|
|
1662
|
+
}
|
|
1663
|
+
getSortDirectionValue() {
|
|
1664
|
+
return this.sortDirectionItem ? this.sortDirectionItem.model : null;
|
|
1665
|
+
}
|
|
1666
|
+
updateSort(sort) {
|
|
1667
|
+
if (sort.sortBy) {
|
|
1668
|
+
this.sortByItem.model = sort.sortBy;
|
|
1669
|
+
}
|
|
1670
|
+
if (sort.sortDirection) {
|
|
1671
|
+
this.sortDirectionItem.model = sort.sortDirection;
|
|
1672
|
+
}
|
|
1673
|
+
}
|
|
1674
|
+
values(onlyPresented = false) {
|
|
1675
|
+
return this.items.reduce((acc, item) => {
|
|
1676
|
+
const value = item.value;
|
|
1677
|
+
if (!onlyPresented || value !== null) {
|
|
1678
|
+
acc[item.name] = value;
|
|
1679
|
+
}
|
|
1680
|
+
return acc;
|
|
1681
|
+
}, {});
|
|
1682
|
+
}
|
|
1683
|
+
valuesAsQuery({ onlyPresented = true, items = null, persisted = false, } = {}) {
|
|
1684
|
+
const params = {};
|
|
1685
|
+
(items || this.items).forEach((filterItem) => {
|
|
1686
|
+
const values = persisted
|
|
1687
|
+
? filterItem.persistanceObject
|
|
1688
|
+
: filterItem.queryObject;
|
|
1689
|
+
Object.assign(params, values);
|
|
1690
|
+
});
|
|
1691
|
+
if (onlyPresented) {
|
|
1692
|
+
return pickBy(params, (val) => {
|
|
1693
|
+
return val !== void 0;
|
|
1694
|
+
});
|
|
1695
|
+
}
|
|
1696
|
+
return params;
|
|
1697
|
+
}
|
|
1698
|
+
init(p) {
|
|
1699
|
+
this.items
|
|
1700
|
+
.forEach((item) => {
|
|
1701
|
+
item.initValues(p[item.name]);
|
|
1702
|
+
});
|
|
1703
|
+
this._initSortingItems(p);
|
|
1704
|
+
this.loadAsyncDefaults();
|
|
1705
|
+
this._subscribeToItemsChanges();
|
|
1706
|
+
}
|
|
1707
|
+
updateItemsWithValues(values) {
|
|
1708
|
+
this.items
|
|
1709
|
+
.forEach((item) => {
|
|
1710
|
+
if (values[item.name]) {
|
|
1711
|
+
item.model = values[item.name];
|
|
1712
|
+
}
|
|
1713
|
+
else {
|
|
1714
|
+
if (item instanceof RangeItem) {
|
|
1715
|
+
item.clearRange(null, item.defaultValue);
|
|
1716
|
+
}
|
|
1717
|
+
else if (item instanceof BaseDateRangeItem) {
|
|
1718
|
+
item.clearDateRange(null, item.defaultValue);
|
|
1719
|
+
}
|
|
1720
|
+
else {
|
|
1721
|
+
item.clear();
|
|
1722
|
+
}
|
|
1723
|
+
}
|
|
1724
|
+
});
|
|
1725
|
+
if (this.sortByItem) {
|
|
1726
|
+
this.sortByItem.clear();
|
|
1727
|
+
}
|
|
1728
|
+
if (this.sortDirectionItem) {
|
|
1729
|
+
this.sortDirectionItem.clear();
|
|
1730
|
+
}
|
|
1731
|
+
}
|
|
1732
|
+
destroyItems() {
|
|
1733
|
+
this.items
|
|
1734
|
+
.forEach((item) => item.destroy());
|
|
1735
|
+
this.sortByItem?.destroy();
|
|
1736
|
+
this.sortDirectionItem?.destroy();
|
|
1737
|
+
this._items = [];
|
|
1738
|
+
this.sortByItem = null;
|
|
1739
|
+
this.sortDirectionItem = null;
|
|
1740
|
+
}
|
|
1741
|
+
/**
|
|
1742
|
+
* Some items might need to load async values before they will be shown
|
|
1743
|
+
*/
|
|
1744
|
+
prepareItems() {
|
|
1745
|
+
if (!this._itemsValuesLoaded) {
|
|
1746
|
+
this._itemsValuesLoaded = true;
|
|
1747
|
+
this.loadAsyncValues();
|
|
1748
|
+
}
|
|
1749
|
+
}
|
|
1750
|
+
updateItemsVisiblity() {
|
|
1751
|
+
this.visibleItems = this.items
|
|
1752
|
+
.filter((item) => !item.isTypeKeyword && !item.hide);
|
|
1753
|
+
}
|
|
1754
|
+
_createItems(items) {
|
|
1755
|
+
this._items = items
|
|
1756
|
+
.filter((item) => !item.disable)
|
|
1757
|
+
.filter((item) => {
|
|
1758
|
+
if (this._itemsByName.has(item.name)) {
|
|
1759
|
+
throw Error('Filter init error. Items name must be unique.');
|
|
1760
|
+
}
|
|
1761
|
+
else {
|
|
1762
|
+
this._itemsByName.set(item.name, null);
|
|
1763
|
+
return true;
|
|
1764
|
+
}
|
|
1765
|
+
})
|
|
1766
|
+
.map((item) => {
|
|
1767
|
+
const filterItem = createFilterItem(item, { case: this._config.case }, this.filter);
|
|
1768
|
+
if (filterItem.type === ItemType.Keyword) {
|
|
1769
|
+
this._hasKeyword = true;
|
|
1770
|
+
}
|
|
1771
|
+
this._itemsByName.set(item.name, filterItem);
|
|
1772
|
+
return filterItem;
|
|
1773
|
+
});
|
|
1774
|
+
this._createSortingItems();
|
|
1775
|
+
}
|
|
1776
|
+
_subscribeToItemsChanges() {
|
|
1777
|
+
this.items
|
|
1778
|
+
.forEach((item) => {
|
|
1779
|
+
item.valueChange$
|
|
1780
|
+
.pipe(takeUntil(item.destroy$))
|
|
1781
|
+
.subscribe(() => {
|
|
1782
|
+
this._itemsChange$.next(item);
|
|
1783
|
+
});
|
|
1784
|
+
});
|
|
1785
|
+
if (this._config.sortValues?.length) {
|
|
1786
|
+
this.sortByItem.valueChange$
|
|
1787
|
+
.pipe(takeUntil(this.sortByItem.destroy$))
|
|
1788
|
+
.subscribe(() => {
|
|
1789
|
+
this._itemsChange$.next(this.sortByItem);
|
|
1790
|
+
});
|
|
1791
|
+
this.sortDirectionItem.valueChange$
|
|
1792
|
+
.pipe(takeUntil(this.sortDirectionItem.destroy$))
|
|
1793
|
+
.subscribe(() => {
|
|
1794
|
+
this._itemsChange$.next(this.sortDirectionItem);
|
|
1795
|
+
});
|
|
1796
|
+
}
|
|
1797
|
+
}
|
|
1798
|
+
_lazyInit() {
|
|
1799
|
+
this.ready$
|
|
1800
|
+
.pipe(filter$1((state) => state), takeUntil(this._destroy$))
|
|
1801
|
+
.subscribe(() => {
|
|
1802
|
+
this.updateItemsVisiblity();
|
|
1803
|
+
this._setKeywordItem();
|
|
1804
|
+
});
|
|
1805
|
+
}
|
|
1806
|
+
_initSortingItems(p) {
|
|
1807
|
+
if (this.sortByItem && this.sortDirectionItem) {
|
|
1808
|
+
this.sortByItem.initValues(p[this.sortByItem.name]);
|
|
1809
|
+
this.sortDirectionItem.initValues(p[this.sortDirectionItem.name]);
|
|
1810
|
+
}
|
|
1811
|
+
}
|
|
1812
|
+
_createSortingItems() {
|
|
1813
|
+
if (this._config.sortValues?.length > 0) {
|
|
1814
|
+
const sortByItem = {
|
|
1815
|
+
name: SORT_BY_FIELD,
|
|
1816
|
+
type: ItemType.Select,
|
|
1817
|
+
label: 'Sort By',
|
|
1818
|
+
values: this._config.sortValues,
|
|
1819
|
+
};
|
|
1820
|
+
if (this._config.sort && this._config.sort.value) {
|
|
1821
|
+
sortByItem.default = this._config.sort.value;
|
|
1822
|
+
}
|
|
1823
|
+
this.sortByItem = new SimpleSelectItem(sortByItem, null, this.filter);
|
|
1824
|
+
const sortDirectionItem = {
|
|
1825
|
+
name: SORT_DIRECTION_FIELD,
|
|
1826
|
+
type: ItemType.Select,
|
|
1827
|
+
label: 'Sort Direction',
|
|
1828
|
+
values: [
|
|
1829
|
+
{ name: 'Ascending', value: 'asc' },
|
|
1830
|
+
{ name: 'Descending', value: 'desc' },
|
|
1831
|
+
],
|
|
1832
|
+
};
|
|
1833
|
+
if (this._config.sort && this._config.sort.direction) {
|
|
1834
|
+
sortDirectionItem.default = this._config.sort.direction;
|
|
1835
|
+
}
|
|
1836
|
+
this.sortDirectionItem = new SimpleSelectItem(sortDirectionItem, null, this.filter);
|
|
1837
|
+
}
|
|
1838
|
+
}
|
|
1839
|
+
_setKeywordItem() {
|
|
1840
|
+
this.keywordItem = this
|
|
1841
|
+
.items
|
|
1842
|
+
.find((item) => item.isTypeKeyword);
|
|
1843
|
+
}
|
|
1844
|
+
}
|
|
1845
|
+
FsFilterItemsStore.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsFilterItemsStore, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1846
|
+
FsFilterItemsStore.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsFilterItemsStore });
|
|
1847
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsFilterItemsStore, decorators: [{
|
|
1848
|
+
type: Injectable
|
|
1849
|
+
}], ctorParameters: function () { return []; } });
|
|
1850
|
+
|
|
1851
|
+
const FILTER_STORE_KEY = 'fs-filter-persist';
|
|
1852
|
+
class PersistanceParamsController extends FsPersistanceStore {
|
|
1853
|
+
constructor(_store, _route, _location, _itemsStore, _dialogRef, _drawerRef) {
|
|
1854
|
+
super(_store, _route);
|
|
1855
|
+
this._location = _location;
|
|
1856
|
+
this._itemsStore = _itemsStore;
|
|
1857
|
+
this._dialogRef = _dialogRef;
|
|
1858
|
+
this._drawerRef = _drawerRef;
|
|
1859
|
+
this.STORE_KEY = FILTER_STORE_KEY;
|
|
1860
|
+
}
|
|
1861
|
+
init(persistanceConfig, namespace, paramsCase) {
|
|
1862
|
+
this._paramsCase = paramsCase;
|
|
1863
|
+
namespace = namespace ?? getNormalizedPath(this._location);
|
|
1864
|
+
const persistanceDisabled = !!this._dialogRef || !!this._drawerRef;
|
|
1865
|
+
this.setConfig(persistanceConfig, namespace, persistanceDisabled);
|
|
1866
|
+
}
|
|
1867
|
+
restore() {
|
|
1868
|
+
if (!this.enabled) {
|
|
1869
|
+
return;
|
|
1870
|
+
}
|
|
1871
|
+
super.restore();
|
|
1872
|
+
const items = [
|
|
1873
|
+
...this._itemsStore.items,
|
|
1874
|
+
this._itemsStore.sortByItem,
|
|
1875
|
+
this._itemsStore.sortDirectionItem,
|
|
1876
|
+
].filter((item) => !!item);
|
|
1877
|
+
if (this._value) {
|
|
1878
|
+
this._value.data = restoreItems(this._value.data, items, this._paramsCase);
|
|
1879
|
+
}
|
|
1880
|
+
}
|
|
1881
|
+
}
|
|
1882
|
+
PersistanceParamsController.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", 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 });
|
|
1883
|
+
PersistanceParamsController.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: PersistanceParamsController });
|
|
1884
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: PersistanceParamsController, decorators: [{
|
|
1885
|
+
type: Injectable
|
|
1886
|
+
}], ctorParameters: function () { return [{ type: i1.FsStore }, { type: i1$1.ActivatedRoute }, { type: i3.Location }, { type: FsFilterItemsStore }, { type: i1$2.MatDialogRef, decorators: [{
|
|
1887
|
+
type: Optional
|
|
1888
|
+
}] }, { type: i6.DrawerRef, decorators: [{
|
|
1889
|
+
type: Optional
|
|
1890
|
+
}] }]; } });
|
|
1891
|
+
|
|
1892
|
+
class QueryParamsController {
|
|
1893
|
+
constructor(_router, _route, _location, _itemsStore) {
|
|
1894
|
+
this._router = _router;
|
|
1895
|
+
this._route = _route;
|
|
1896
|
+
this._location = _location;
|
|
1897
|
+
this._itemsStore = _itemsStore;
|
|
1898
|
+
this._enabled = false;
|
|
1899
|
+
}
|
|
1900
|
+
get enabled() {
|
|
1901
|
+
return this._enabled;
|
|
1902
|
+
}
|
|
1903
|
+
get fetchedParams() {
|
|
1904
|
+
return this._fetchedParams;
|
|
1905
|
+
}
|
|
1906
|
+
init(enabled, paramsCase) {
|
|
1907
|
+
this._enabled = enabled;
|
|
1908
|
+
this._paramsCase = paramsCase;
|
|
1909
|
+
if (this.enabled) {
|
|
1910
|
+
this.fetchFromQueryParams();
|
|
1911
|
+
}
|
|
1912
|
+
}
|
|
1913
|
+
writeStateToQueryParams(params) {
|
|
1914
|
+
if (!this._enabled) {
|
|
1915
|
+
return;
|
|
1916
|
+
}
|
|
1917
|
+
this._location.replaceState(this._router.createUrlTree([], {
|
|
1918
|
+
relativeTo: this._route,
|
|
1919
|
+
queryParams: params,
|
|
1920
|
+
queryParamsHandling: 'merge',
|
|
1921
|
+
preserveFragment: true,
|
|
1922
|
+
}).toString());
|
|
1923
|
+
// Trying replacing the URL without triggering an Angular navigation change
|
|
1924
|
+
// // Update query
|
|
1925
|
+
// this._router.navigate([], {
|
|
1926
|
+
// replaceUrl: true,
|
|
1927
|
+
// relativeTo: this._route,
|
|
1928
|
+
// queryParams: params,
|
|
1929
|
+
// queryParamsHandling: 'merge',
|
|
1930
|
+
// }).then(() => {});
|
|
1931
|
+
}
|
|
1932
|
+
/**
|
|
1933
|
+
* Parse query and update filter values
|
|
1934
|
+
*/
|
|
1935
|
+
fetchFromQueryParams() {
|
|
1936
|
+
const items = [
|
|
1937
|
+
...this._itemsStore.items,
|
|
1938
|
+
this._itemsStore.sortByItem,
|
|
1939
|
+
this._itemsStore.sortDirectionItem,
|
|
1940
|
+
].filter((item) => !!item);
|
|
1941
|
+
this._fetchedParams = restoreItems(this._route.snapshot.queryParams, items, this._paramsCase);
|
|
1942
|
+
}
|
|
1943
|
+
}
|
|
1944
|
+
QueryParamsController.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: QueryParamsController, deps: [{ token: i1$1.Router }, { token: i1$1.ActivatedRoute }, { token: i3.Location }, { token: FsFilterItemsStore }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1945
|
+
QueryParamsController.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: QueryParamsController });
|
|
1946
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: QueryParamsController, decorators: [{
|
|
1947
|
+
type: Injectable
|
|
1948
|
+
}], ctorParameters: function () { return [{ type: i1$1.Router }, { type: i1$1.ActivatedRoute }, { type: i3.Location }, { type: FsFilterItemsStore }]; } });
|
|
1949
|
+
|
|
1950
|
+
class FsFilterSavedFilterEditComponent {
|
|
1951
|
+
constructor(data, _dialogRef) {
|
|
1952
|
+
this.data = data;
|
|
1953
|
+
this._dialogRef = _dialogRef;
|
|
1954
|
+
this.saveAsFilter = 'new';
|
|
1955
|
+
this.savedFilterName = '';
|
|
1956
|
+
this._destroy$ = new Subject();
|
|
1957
|
+
this.save = () => {
|
|
1958
|
+
let savedFilter;
|
|
1959
|
+
if (this.saveAsFilter === 'new') {
|
|
1960
|
+
savedFilter = {
|
|
1961
|
+
name: this.savedFilterName,
|
|
1962
|
+
active: true,
|
|
1963
|
+
filters: this.data.params,
|
|
1964
|
+
};
|
|
1965
|
+
}
|
|
1966
|
+
else {
|
|
1967
|
+
savedFilter = {
|
|
1968
|
+
...this.saveAsFilter,
|
|
1969
|
+
filters: this.data.params,
|
|
1970
|
+
};
|
|
1971
|
+
}
|
|
1972
|
+
return this._saveCallback(savedFilter)
|
|
1973
|
+
.pipe(tap((filter) => {
|
|
1974
|
+
this._dialogRef.close(filter);
|
|
1975
|
+
}), takeUntil(this._destroy$));
|
|
1976
|
+
};
|
|
1977
|
+
this.savedFilters = this.data.savedFilters;
|
|
1978
|
+
this._saveCallback = this.data.saveCallback;
|
|
1979
|
+
}
|
|
1980
|
+
}
|
|
1981
|
+
FsFilterSavedFilterEditComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsFilterSavedFilterEditComponent, deps: [{ token: MAT_DIALOG_DATA }, { token: i1$2.MatDialogRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
1982
|
+
FsFilterSavedFilterEditComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", 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", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], 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: i4.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i4.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i4.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", "deactivationGuard"], outputs: ["fsForm", "invalid", "valid", "submitted", "reseted", "cleared"], exportAs: ["fsForm"] }, { 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: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i7.FsFormNoFsValidatorsDirective, selector: "[ngModel]:not([required]):not([fsFormRequired]):not([fsFormCompare]):not([fsFormDateRange]):not([fsFormEmail]):not([fsFormEmails]):not([fsFormFunction]):not([fsFormGreater]):not([fsFormInteger]):not([fsFormLesser]):not([fsFormMax]):not([fsFormMaxLength]):not([fsFormMin]):not([fsFormMinLength]):not([fsFormNumeric]):not([fsFormPattern]):not([fsFormPhone]):not([fsFormUrl]):not([validate])" }, { type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3$2.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { type: i4.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: i4.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.FsButtonDirective, selector: "[mat-raised-button],[mat-button],[mat-flat-button],[mat-stroked-button]", inputs: ["name", "dirtySubmit", "form"] }, { type: i1$2.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1983
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsFilterSavedFilterEditComponent, decorators: [{
|
|
1984
|
+
type: Component,
|
|
1985
|
+
args: [{ changeDetection: ChangeDetectionStrategy.OnPush, 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" }]
|
|
1986
|
+
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
1987
|
+
type: Inject,
|
|
1988
|
+
args: [MAT_DIALOG_DATA]
|
|
1989
|
+
}] }, { type: i1$2.MatDialogRef }]; } });
|
|
1990
|
+
|
|
1991
|
+
class SavedFiltersController {
|
|
1992
|
+
constructor(_itemsStore, _dialog) {
|
|
1993
|
+
this._itemsStore = _itemsStore;
|
|
1994
|
+
this._dialog = _dialog;
|
|
1995
|
+
this._savedFilters$ = new BehaviorSubject([]);
|
|
1996
|
+
this._activeFilter$ = new BehaviorSubject(null);
|
|
1997
|
+
this._enabled$ = new BehaviorSubject(false);
|
|
1998
|
+
this._destroy$ = new Subject();
|
|
1999
|
+
}
|
|
2000
|
+
get enabled() {
|
|
2001
|
+
return this._enabled$.getValue();
|
|
2002
|
+
}
|
|
2003
|
+
get enabled$() {
|
|
2004
|
+
return this._enabled$
|
|
2005
|
+
.pipe(distinctUntilChanged());
|
|
2006
|
+
}
|
|
2007
|
+
get savedFilters() {
|
|
2008
|
+
return this._savedFilters$.getValue();
|
|
2009
|
+
}
|
|
2010
|
+
get savedFilters$() {
|
|
2011
|
+
return this._savedFilters$
|
|
2012
|
+
.pipe(distinctUntilChanged());
|
|
2013
|
+
}
|
|
2014
|
+
get activeFilter() {
|
|
2015
|
+
return this._activeFilter$.getValue();
|
|
2016
|
+
}
|
|
2017
|
+
get activeFilter$() {
|
|
2018
|
+
return this._activeFilter$
|
|
2019
|
+
.pipe(distinctUntilChanged());
|
|
2020
|
+
}
|
|
2021
|
+
get activeFilterData() {
|
|
2022
|
+
return this._activeFilter$.getValue()?.filters;
|
|
2023
|
+
}
|
|
2024
|
+
set savedFilters(filters) {
|
|
2025
|
+
this._savedFilters$.next(filters);
|
|
2026
|
+
}
|
|
2027
|
+
ngOnDestroy() {
|
|
2028
|
+
this._destroy$.next();
|
|
2029
|
+
this._destroy$.complete();
|
|
2030
|
+
}
|
|
2031
|
+
init(remoteParamsConfig, paramsCase) {
|
|
2032
|
+
if (!remoteParamsConfig) {
|
|
2033
|
+
this._setEnabledStatus(false);
|
|
2034
|
+
return;
|
|
2035
|
+
}
|
|
2036
|
+
this._setEnabledStatus(true);
|
|
2037
|
+
this._paramsCase = paramsCase;
|
|
2038
|
+
this._config = remoteParamsConfig;
|
|
2039
|
+
}
|
|
2040
|
+
initSavedFilters(filters) {
|
|
2041
|
+
filters = [...filters];
|
|
2042
|
+
filters.forEach((savedFilter) => {
|
|
2043
|
+
savedFilter.filters = restoreItems(savedFilter.filters, this._itemsStore.items, this._paramsCase);
|
|
2044
|
+
});
|
|
2045
|
+
this.savedFilters = filters;
|
|
2046
|
+
}
|
|
2047
|
+
load() {
|
|
2048
|
+
return this._config.load()
|
|
2049
|
+
.pipe(tap((response) => {
|
|
2050
|
+
this.initSavedFilters(response);
|
|
2051
|
+
}));
|
|
2052
|
+
}
|
|
2053
|
+
save(savedFilter) {
|
|
2054
|
+
return this._config.save(savedFilter);
|
|
2055
|
+
}
|
|
2056
|
+
order(savedFilters) {
|
|
2057
|
+
return this._config.order(savedFilters)
|
|
2058
|
+
.pipe(tap((response) => {
|
|
2059
|
+
this.savedFilters = [
|
|
2060
|
+
...response,
|
|
2061
|
+
];
|
|
2062
|
+
}));
|
|
2063
|
+
}
|
|
2064
|
+
delete(savedFilter) {
|
|
2065
|
+
return this._config.delete(savedFilter)
|
|
2066
|
+
.pipe(tap((response) => {
|
|
2067
|
+
this.savedFilters = this.savedFilters
|
|
2068
|
+
.filter((f) => f.id !== response.id);
|
|
2069
|
+
}));
|
|
2070
|
+
}
|
|
2071
|
+
setActiveFilter(savedFilter) {
|
|
2072
|
+
if (savedFilter) {
|
|
2073
|
+
const existingFilter = this.savedFilters
|
|
2074
|
+
.find((f) => f.id === savedFilter.id);
|
|
2075
|
+
if (!existingFilter) {
|
|
2076
|
+
throw new Error('Saved filter cannot be activated, because it does not exists. Filter ID = ' + savedFilter.id);
|
|
2077
|
+
}
|
|
2078
|
+
this._activeFilter$.next(existingFilter);
|
|
2079
|
+
}
|
|
2080
|
+
else {
|
|
2081
|
+
this._activeFilter$.next(null);
|
|
2082
|
+
}
|
|
2083
|
+
}
|
|
2084
|
+
openSavedFilterEditDialog() {
|
|
2085
|
+
const params = buildQueryParams(this._itemsStore.valuesAsQuery(), this._itemsStore.items);
|
|
2086
|
+
const values = this._itemsStore.values(true);
|
|
2087
|
+
const dialogConfig = {
|
|
2088
|
+
data: {
|
|
2089
|
+
params: params,
|
|
2090
|
+
savedFilters: this.savedFilters,
|
|
2091
|
+
saveCallback: this.save.bind(this),
|
|
2092
|
+
},
|
|
2093
|
+
};
|
|
2094
|
+
this._dialog
|
|
2095
|
+
.open(FsFilterSavedFilterEditComponent, dialogConfig)
|
|
2096
|
+
.beforeClosed()
|
|
2097
|
+
.pipe(take(1), takeUntil(this._destroy$))
|
|
2098
|
+
.subscribe((updatedFilter) => {
|
|
2099
|
+
if (updatedFilter) {
|
|
2100
|
+
// get already saved related filter object
|
|
2101
|
+
const savedFilter = this.savedFilters
|
|
2102
|
+
.find((f) => f.id === updatedFilter.id);
|
|
2103
|
+
// restore values from query string
|
|
2104
|
+
updatedFilter.filters = restoreItems(updatedFilter.filters, this._itemsStore.items, this._paramsCase);
|
|
2105
|
+
if (savedFilter) {
|
|
2106
|
+
Object.assign(savedFilter, updatedFilter);
|
|
2107
|
+
}
|
|
2108
|
+
else {
|
|
2109
|
+
this.resetActiveFilter();
|
|
2110
|
+
this.savedFilters = [
|
|
2111
|
+
...this.savedFilters,
|
|
2112
|
+
updatedFilter
|
|
2113
|
+
];
|
|
2114
|
+
}
|
|
2115
|
+
this.updateActiveFilter();
|
|
2116
|
+
}
|
|
2117
|
+
});
|
|
2118
|
+
}
|
|
2119
|
+
updateActiveFilter() {
|
|
2120
|
+
// Lookup active filter
|
|
2121
|
+
const acitveFilter = this.savedFilters
|
|
2122
|
+
.find((f) => f.active);
|
|
2123
|
+
if (acitveFilter) {
|
|
2124
|
+
this.setActiveFilter(acitveFilter);
|
|
2125
|
+
}
|
|
2126
|
+
}
|
|
2127
|
+
resetActiveFilter() {
|
|
2128
|
+
// Reset all previously activated filters
|
|
2129
|
+
this.savedFilters.forEach((savedFilter) => {
|
|
2130
|
+
savedFilter.active = false;
|
|
2131
|
+
});
|
|
2132
|
+
this.setActiveFilter(null);
|
|
2133
|
+
}
|
|
2134
|
+
_setEnabledStatus(value) {
|
|
2135
|
+
this._enabled$.next(value);
|
|
2136
|
+
}
|
|
2137
|
+
}
|
|
2138
|
+
SavedFiltersController.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SavedFiltersController, deps: [{ token: FsFilterItemsStore }, { token: i1$2.MatDialog }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2139
|
+
SavedFiltersController.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SavedFiltersController });
|
|
2140
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SavedFiltersController, decorators: [{
|
|
2141
|
+
type: Injectable
|
|
2142
|
+
}], ctorParameters: function () { return [{ type: FsFilterItemsStore }, { type: i1$2.MatDialog }]; } });
|
|
2143
|
+
|
|
2144
|
+
class ExternalParamsController {
|
|
2145
|
+
constructor(_itemsStore, _persistanceStore, _queryParams, _savedFilters) {
|
|
2146
|
+
this._itemsStore = _itemsStore;
|
|
2147
|
+
this._persistanceStore = _persistanceStore;
|
|
2148
|
+
this._queryParams = _queryParams;
|
|
2149
|
+
this._savedFilters = _savedFilters;
|
|
2150
|
+
this._pending$ = new BehaviorSubject(false);
|
|
2151
|
+
this._shouldResetSavedFilters = true;
|
|
2152
|
+
this._destroy$ = new Subject();
|
|
2153
|
+
}
|
|
2154
|
+
get params() {
|
|
2155
|
+
const result = {};
|
|
2156
|
+
if (this._persistanceStore.enabled) {
|
|
2157
|
+
Object.assign(result, this._persistanceStore.value?.data);
|
|
2158
|
+
}
|
|
2159
|
+
if (this._savedFilters.enabled && this._savedFilters.activeFilter) {
|
|
2160
|
+
Object.assign(result, this._savedFilters.activeFilterData);
|
|
2161
|
+
}
|
|
2162
|
+
if (this._queryParams.enabled) {
|
|
2163
|
+
Object.assign(result, this._queryParams.fetchedParams);
|
|
2164
|
+
}
|
|
2165
|
+
return result;
|
|
2166
|
+
}
|
|
2167
|
+
get pending() {
|
|
2168
|
+
return this._pending$.getValue();
|
|
2169
|
+
}
|
|
2170
|
+
get pending$() {
|
|
2171
|
+
return this._pending$.asObservable();
|
|
2172
|
+
}
|
|
2173
|
+
get savedFiltersController() {
|
|
2174
|
+
return this._savedFilters;
|
|
2175
|
+
}
|
|
2176
|
+
get savedFiltersEnabled() {
|
|
2177
|
+
return this._savedFilters.enabled;
|
|
2178
|
+
}
|
|
2179
|
+
ngOnDestroy() {
|
|
2180
|
+
this._destroy$.next();
|
|
2181
|
+
this._destroy$.complete();
|
|
2182
|
+
}
|
|
2183
|
+
setConfig(config) {
|
|
2184
|
+
this._config = config;
|
|
2185
|
+
this._initPersistance();
|
|
2186
|
+
this._initQueryParams();
|
|
2187
|
+
this._initSavedFilters();
|
|
2188
|
+
this.initItems();
|
|
2189
|
+
}
|
|
2190
|
+
setActiveSavedFilter(savedFilter) {
|
|
2191
|
+
this.savedFiltersController.setActiveFilter(savedFilter);
|
|
2192
|
+
if (savedFilter) {
|
|
2193
|
+
this.reloadFiltersWithValues(savedFilter.filters, false);
|
|
2194
|
+
}
|
|
2195
|
+
}
|
|
2196
|
+
reloadFiltersWithValues(params, shouldResetSavedFilters = true) {
|
|
2197
|
+
this._shouldResetSavedFilters = shouldResetSavedFilters;
|
|
2198
|
+
this._itemsStore.updateItemsWithValues(params);
|
|
2199
|
+
this._saveQueryParams();
|
|
2200
|
+
this._savePersistedParams();
|
|
2201
|
+
}
|
|
2202
|
+
initItems() {
|
|
2203
|
+
this._pending$.next(true);
|
|
2204
|
+
if (this._savedFilters.enabled) {
|
|
2205
|
+
this._savedFilters
|
|
2206
|
+
.load()
|
|
2207
|
+
.pipe(takeUntil(this._destroy$))
|
|
2208
|
+
.subscribe(() => {
|
|
2209
|
+
this._savedFilters.updateActiveFilter();
|
|
2210
|
+
this._initItemsValues();
|
|
2211
|
+
this._listenAndResetSavedFilters();
|
|
2212
|
+
this._pending$.next(false);
|
|
2213
|
+
});
|
|
2214
|
+
}
|
|
2215
|
+
else {
|
|
2216
|
+
this._initItemsValues();
|
|
2217
|
+
this._pending$.next(false);
|
|
2218
|
+
}
|
|
2219
|
+
this._listenItemsChange();
|
|
2220
|
+
}
|
|
2221
|
+
_initItemsValues() {
|
|
2222
|
+
this._itemsStore.init(this.params);
|
|
2223
|
+
this._saveQueryParams();
|
|
2224
|
+
this._savePersistedParams();
|
|
2225
|
+
}
|
|
2226
|
+
fetchQueryParams() {
|
|
2227
|
+
this._initQueryParams();
|
|
2228
|
+
this._itemsStore.updateItemsWithValues(this.params);
|
|
2229
|
+
}
|
|
2230
|
+
_initPersistance() {
|
|
2231
|
+
this._persistanceStore.init(this._config.persist, this._config.namespace, this._config.case);
|
|
2232
|
+
}
|
|
2233
|
+
_initQueryParams() {
|
|
2234
|
+
this._queryParams.init(this._config.queryParam, this._config.case);
|
|
2235
|
+
}
|
|
2236
|
+
_initSavedFilters() {
|
|
2237
|
+
this._savedFilters.init(this._config.savedFilters, this._config.case);
|
|
2238
|
+
}
|
|
2239
|
+
_listenItemsChange() {
|
|
2240
|
+
this._itemsStore.ready$
|
|
2241
|
+
.pipe(filter$1((v) => v), take(1), takeUntil(this._destroy$))
|
|
2242
|
+
.subscribe(() => {
|
|
2243
|
+
this._saveQueryParams();
|
|
2244
|
+
this._savePersistedParams();
|
|
2245
|
+
});
|
|
2246
|
+
this._itemsStore
|
|
2247
|
+
.itemsChange$
|
|
2248
|
+
.pipe(takeUntil(this._destroy$))
|
|
2249
|
+
.subscribe(() => {
|
|
2250
|
+
this._saveQueryParams();
|
|
2251
|
+
this._savePersistedParams();
|
|
2252
|
+
});
|
|
2253
|
+
}
|
|
2254
|
+
_listenAndResetSavedFilters() {
|
|
2255
|
+
this._itemsStore
|
|
2256
|
+
.itemsChange$
|
|
2257
|
+
.pipe(filter$1(() => !!this.savedFiltersController.activeFilter), switchMap(() => {
|
|
2258
|
+
const shouldReset = this._shouldResetSavedFilters;
|
|
2259
|
+
this._shouldResetSavedFilters = true;
|
|
2260
|
+
return of(shouldReset);
|
|
2261
|
+
}), filter$1((shouldReset) => shouldReset), takeUntil(this._destroy$))
|
|
2262
|
+
.subscribe(() => {
|
|
2263
|
+
this.savedFiltersController.resetActiveFilter();
|
|
2264
|
+
});
|
|
2265
|
+
}
|
|
2266
|
+
_saveQueryParams() {
|
|
2267
|
+
const targetItems = this._itemsStore.items
|
|
2268
|
+
.filter((item) => !item.queryParamsDisabled);
|
|
2269
|
+
const params = buildQueryParams(this._itemsStore.valuesAsQuery({
|
|
2270
|
+
onlyPresented: false,
|
|
2271
|
+
items: targetItems,
|
|
2272
|
+
persisted: true,
|
|
2273
|
+
}), targetItems);
|
|
2274
|
+
this._queryParams.writeStateToQueryParams(params);
|
|
2275
|
+
}
|
|
2276
|
+
_savePersistedParams() {
|
|
2277
|
+
const targetItems = this._itemsStore.items
|
|
2278
|
+
.filter((item) => !item.persistanceDisabled);
|
|
2279
|
+
const params = buildQueryParams(this._itemsStore.valuesAsQuery({
|
|
2280
|
+
onlyPresented: false,
|
|
2281
|
+
items: targetItems,
|
|
2282
|
+
persisted: true,
|
|
2283
|
+
}), targetItems);
|
|
2284
|
+
this._persistanceStore.save(params);
|
|
2285
|
+
}
|
|
2286
|
+
}
|
|
2287
|
+
ExternalParamsController.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: ExternalParamsController, deps: [{ token: FsFilterItemsStore }, { token: PersistanceParamsController }, { token: QueryParamsController }, { token: SavedFiltersController }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2288
|
+
ExternalParamsController.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: ExternalParamsController });
|
|
2289
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: ExternalParamsController, decorators: [{
|
|
2290
|
+
type: Injectable
|
|
2291
|
+
}], ctorParameters: function () { return [{ type: FsFilterItemsStore }, { type: PersistanceParamsController }, { type: QueryParamsController }, { type: SavedFiltersController }]; } });
|
|
2292
|
+
|
|
2293
|
+
class ActionMenuItem {
|
|
2294
|
+
constructor(config = {}, _parent) {
|
|
2295
|
+
this._parent = _parent;
|
|
2296
|
+
this.items = [];
|
|
2297
|
+
this._isGroup = false;
|
|
2298
|
+
this._visible$ = new BehaviorSubject(true);
|
|
2299
|
+
this._disabled$ = new BehaviorSubject(false);
|
|
2300
|
+
this._init(config);
|
|
2301
|
+
}
|
|
2302
|
+
get isGroup() {
|
|
2303
|
+
return this._isGroup;
|
|
2304
|
+
}
|
|
2305
|
+
get visible() {
|
|
2306
|
+
return this._visible$.getValue();
|
|
2307
|
+
}
|
|
2308
|
+
get visible$() {
|
|
2309
|
+
return this._visible$.asObservable();
|
|
2310
|
+
}
|
|
2311
|
+
set disabled(value) {
|
|
2312
|
+
this._disabled$.next(value);
|
|
2313
|
+
}
|
|
2314
|
+
get disabled() {
|
|
2315
|
+
return this._disabled$.getValue();
|
|
2316
|
+
}
|
|
2317
|
+
get disabled$() {
|
|
2318
|
+
return this._disabled$.asObservable();
|
|
2319
|
+
}
|
|
2320
|
+
updateVisibility() {
|
|
2321
|
+
const visible = !!this._showFn ? this._showFn() : true;
|
|
2322
|
+
if (!visible || !this.isGroup) {
|
|
2323
|
+
this._visible$.next(visible);
|
|
2324
|
+
return;
|
|
2325
|
+
}
|
|
2326
|
+
const numberOfVisibleChildren = this.items
|
|
2327
|
+
.reduce((acc, item) => {
|
|
2328
|
+
item.updateVisibility();
|
|
2329
|
+
if (item.visible) {
|
|
2330
|
+
acc++;
|
|
2331
|
+
}
|
|
2332
|
+
return acc;
|
|
2333
|
+
}, 0);
|
|
2334
|
+
this._visible$.next(!!numberOfVisibleChildren);
|
|
2335
|
+
}
|
|
2336
|
+
_init(config) {
|
|
2337
|
+
this.label = config.label;
|
|
2338
|
+
this.icon = config.icon;
|
|
2339
|
+
this._showFn = config.show;
|
|
2340
|
+
if ('items' in config) {
|
|
2341
|
+
this._isGroup = true;
|
|
2342
|
+
if (Array.isArray(config.items)) {
|
|
2343
|
+
this.items = config
|
|
2344
|
+
.items
|
|
2345
|
+
.map((item) => new ActionMenuItem(item, this));
|
|
2346
|
+
}
|
|
2347
|
+
this.updateVisibility();
|
|
2348
|
+
}
|
|
2349
|
+
else {
|
|
2350
|
+
this.click = config.click;
|
|
2351
|
+
this.routerLink = config.link;
|
|
2352
|
+
if (!this._parent) {
|
|
2353
|
+
this.updateVisibility();
|
|
2354
|
+
}
|
|
2355
|
+
}
|
|
2356
|
+
}
|
|
2357
|
+
}
|
|
2358
|
+
|
|
2359
|
+
class Action {
|
|
2360
|
+
constructor(filterConfig, actionConfig = {}) {
|
|
2361
|
+
this.primary = true;
|
|
2362
|
+
this.isReorderAction = false;
|
|
2363
|
+
this.classArray = [];
|
|
2364
|
+
this.items = [];
|
|
2365
|
+
this._visible$ = new BehaviorSubject(true);
|
|
2366
|
+
this._disabled$ = new BehaviorSubject(false);
|
|
2367
|
+
this._init(filterConfig, actionConfig);
|
|
2368
|
+
}
|
|
2369
|
+
get visible() {
|
|
2370
|
+
return this._visible$.getValue();
|
|
2371
|
+
}
|
|
2372
|
+
get visible$() {
|
|
2373
|
+
return this._visible$.asObservable();
|
|
2374
|
+
}
|
|
2375
|
+
set disabled(value) {
|
|
2376
|
+
this._disabled$.next(value);
|
|
2377
|
+
}
|
|
2378
|
+
get disabled() {
|
|
2379
|
+
return this._disabled$.getValue();
|
|
2380
|
+
}
|
|
2381
|
+
get disabled$() {
|
|
2382
|
+
return this._disabled$.asObservable();
|
|
2383
|
+
}
|
|
2384
|
+
updateVisibility() {
|
|
2385
|
+
const visible = !!this._showFn ? this._showFn() : true;
|
|
2386
|
+
if (!visible || this.mode !== ActionMode.Menu) {
|
|
2387
|
+
this._visible$.next(visible);
|
|
2388
|
+
return;
|
|
2389
|
+
}
|
|
2390
|
+
const hasVisibleChildren = this.items.some((item) => item.visible);
|
|
2391
|
+
this._visible$.next(hasVisibleChildren);
|
|
2392
|
+
}
|
|
2393
|
+
updateDisabledState() {
|
|
2394
|
+
if (this._disabledFn) {
|
|
2395
|
+
this.disabled = this._disabledFn();
|
|
2396
|
+
}
|
|
2397
|
+
}
|
|
2398
|
+
_init(filterConfig, config = {}) {
|
|
2399
|
+
config.mode = config.mode ?? ActionMode.Button;
|
|
2400
|
+
this.primary = config.primary ?? true;
|
|
2401
|
+
this.color = config.color;
|
|
2402
|
+
this.tooltip = config.tooltip;
|
|
2403
|
+
this.label = config.label;
|
|
2404
|
+
this.mode = config.mode;
|
|
2405
|
+
this.icon = config.icon;
|
|
2406
|
+
this.iconPlacement = config.iconPlacement;
|
|
2407
|
+
this._showFn = config.show;
|
|
2408
|
+
this.tabIndex = config.tabIndex ?? 0;
|
|
2409
|
+
this.menu = config.menu;
|
|
2410
|
+
if (!this.type) {
|
|
2411
|
+
this.type = (config.type || filterConfig.button?.style || ActionType.Raised);
|
|
2412
|
+
if (this.type === ActionType.Stroked && this.primary) {
|
|
2413
|
+
this.type = ActionType.Flat;
|
|
2414
|
+
}
|
|
2415
|
+
}
|
|
2416
|
+
if (config.multiple !== undefined) {
|
|
2417
|
+
this.multiple = config.multiple;
|
|
2418
|
+
}
|
|
2419
|
+
if (config.className) {
|
|
2420
|
+
this.className = config.className;
|
|
2421
|
+
this.classArray = this.className
|
|
2422
|
+
.split(' ');
|
|
2423
|
+
}
|
|
2424
|
+
if (this.primary) {
|
|
2425
|
+
this.color = 'primary';
|
|
2426
|
+
}
|
|
2427
|
+
switch (config.mode) {
|
|
2428
|
+
case ActionMode.Button:
|
|
2429
|
+
{
|
|
2430
|
+
this.customize = config.customize;
|
|
2431
|
+
this.click = config.click ?? (() => { });
|
|
2432
|
+
this._disabledFn = config.disabled;
|
|
2433
|
+
this.updateDisabledState();
|
|
2434
|
+
}
|
|
2435
|
+
break;
|
|
2436
|
+
case ActionMode.Menu:
|
|
2437
|
+
{
|
|
2438
|
+
if (config.items && Array.isArray(config.items)) {
|
|
2439
|
+
this.items = config.items.map((item) => new ActionMenuItem(item));
|
|
2440
|
+
}
|
|
2441
|
+
}
|
|
2442
|
+
break;
|
|
2443
|
+
case ActionMode.File:
|
|
2444
|
+
{
|
|
2445
|
+
this.fileSelected = config.select;
|
|
2446
|
+
this.fileError = config.error;
|
|
2447
|
+
this.accept = config.accept;
|
|
2448
|
+
this.imageQuality = config.imageQuality;
|
|
2449
|
+
this.minWidth = config.minWidth;
|
|
2450
|
+
this.minHeight = config.minHeight;
|
|
2451
|
+
this.maxWidth = config.maxWidth;
|
|
2452
|
+
this.maxHeight = config.maxHeight;
|
|
2453
|
+
this.click = config.click ?? (() => { });
|
|
2454
|
+
this._disabledFn = config.disabled;
|
|
2455
|
+
this.updateDisabledState();
|
|
2456
|
+
}
|
|
2457
|
+
break;
|
|
2458
|
+
}
|
|
2459
|
+
this.updateVisibility();
|
|
2460
|
+
}
|
|
2461
|
+
}
|
|
2462
|
+
|
|
2463
|
+
class FsFilterActionButtonComponent {
|
|
2464
|
+
constructor() {
|
|
2465
|
+
this.ActionType = ActionType;
|
|
2466
|
+
}
|
|
2467
|
+
}
|
|
2468
|
+
FsFilterActionButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsFilterActionButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2469
|
+
FsFilterActionButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: FsFilterActionButtonComponent, selector: "fs-filter-action-button", inputs: { action: "action" }, host: { classAttribute: "action-button" }, ngImport: i0, template: "<ng-container [ngSwitch]=\"action.type\">\n <button\n type=\"button\"\n *ngSwitchCase=\"ActionType.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 <ng-template [ngTemplateOutlet]=\"buttonContent\"></ng-template>\n </button>\n\n <!-- Fab button -->\n <button \n type=\"button\"\n *ngSwitchCase=\"ActionType.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 <ng-template [ngTemplateOutlet]=\"buttonContent\"></ng-template>\n </button>\n\n <!-- Mini Fab button -->\n <button \n type=\"button\"\n *ngSwitchCase=\"ActionType.MiniFab\"\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 <ng-template [ngTemplateOutlet]=\"buttonContent\"></ng-template>\n </button>\n\n <button \n type=\"button\"\n *ngSwitchDefault\n mat-button\n [ngClass]=\"{ \n 'mat-raised-button': action.type === 'raised',\n 'mat-flat-button': action.type === 'flat',\n 'mat-stroked-button': action.type === 'stroked',\n 'mat-button': action.type === 'basic',\n 'mat-icon-button': action.type === 'icon'\n }\"\n (click)=\"action.click && action.click($event)\"\n [color]=\"action.color\"\n [class]=\"action.classArray.join(' ')\"\n [disabled]=\"action.disabled$ | async\"\n [tabIndex]=\"action.tabIndex\">\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$1.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: i3.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i3.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { type: i7.FsButtonDirective, selector: "[mat-raised-button],[mat-button],[mat-flat-button],[mat-stroked-button]", inputs: ["name", "dirtySubmit", "form"] }, { type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "async": i3.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2470
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsFilterActionButtonComponent, decorators: [{
|
|
2471
|
+
type: Component,
|
|
2472
|
+
args: [{ selector: 'fs-filter-action-button', host: {
|
|
2473
|
+
class: 'action-button',
|
|
2474
|
+
}, changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container [ngSwitch]=\"action.type\">\n <button\n type=\"button\"\n *ngSwitchCase=\"ActionType.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 <ng-template [ngTemplateOutlet]=\"buttonContent\"></ng-template>\n </button>\n\n <!-- Fab button -->\n <button \n type=\"button\"\n *ngSwitchCase=\"ActionType.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 <ng-template [ngTemplateOutlet]=\"buttonContent\"></ng-template>\n </button>\n\n <!-- Mini Fab button -->\n <button \n type=\"button\"\n *ngSwitchCase=\"ActionType.MiniFab\"\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 <ng-template [ngTemplateOutlet]=\"buttonContent\"></ng-template>\n </button>\n\n <button \n type=\"button\"\n *ngSwitchDefault\n mat-button\n [ngClass]=\"{ \n 'mat-raised-button': action.type === 'raised',\n 'mat-flat-button': action.type === 'flat',\n 'mat-stroked-button': action.type === 'stroked',\n 'mat-button': action.type === 'basic',\n 'mat-icon-button': action.type === 'icon'\n }\"\n (click)=\"action.click && action.click($event)\"\n [color]=\"action.color\"\n [class]=\"action.classArray.join(' ')\"\n [disabled]=\"action.disabled$ | async\"\n [tabIndex]=\"action.tabIndex\">\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" }]
|
|
2475
|
+
}], propDecorators: { action: [{
|
|
2476
|
+
type: Input
|
|
2477
|
+
}] } });
|
|
2478
|
+
|
|
2479
|
+
class FsFilterActionKebabActionsComponent {
|
|
2480
|
+
}
|
|
2481
|
+
FsFilterActionKebabActionsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsFilterActionKebabActionsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2482
|
+
FsFilterActionKebabActionsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: FsFilterActionKebabActionsComponent, selector: "fs-filter-action-kebab-actions", inputs: { kebabActions: "kebabActions" }, ngImport: i0, template: "<button \n 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 \n 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 \n 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 \n fs-menu-file-item\n [fsClass]=\"action.classArray\"\n [multiple]=\"action.multiple\"\n [accept]=\"action.accept || '*'\"\n [minWidth]=\"action.minWidth\"\n [minHeight]=\"action.minHeight\"\n [imageWidth]=\"action.maxWidth\"\n [imageHeight]=\"action.maxHeight\"\n (error)=\"action.fileError($event)\"\n (select)=\"action.fileSelected($event)\"\n (click)=\"action.click($event)\">\n <mat-icon *ngIf=\"action.icon\">{{action.icon}}</mat-icon> {{action.label}}\n </ng-template>\n </ng-container>\n\n <ng-container *ngSwitchDefault>\n <ng-template \n fs-menu-item\n (click)=\"action.click($event)\"\n [fsClass]=\"action.classArray\">\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$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: i3$3.FsMenuComponent, selector: "fs-menu", inputs: ["class", "buttonClass", "buttonType", "buttonColor"], outputs: ["opened", "closed"] }], directives: [{ type: i3$3.FsMenuTriggerDirective, selector: "[fsMenuTriggerFor]", inputs: ["fsMenuTriggerFor"] }, { type: i3.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]" }, { type: i3$3.FsGroupMenuItemTemplateDirective, selector: "[fs-group-menu-item-template]" }, { type: i3$3.FsMenuFileItemDirective, selector: "[fs-menu-file-item]", inputs: ["multiple", "accept", "minWidth", "minHeight", "imageWidth", "imageHeight"], outputs: ["select", "error"] }, { type: i3.NgSwitchDefault, selector: "[ngSwitchDefault]" }], pipes: { "async": i3.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2483
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsFilterActionKebabActionsComponent, decorators: [{
|
|
2484
|
+
type: Component,
|
|
2485
|
+
args: [{ selector: 'fs-filter-action-kebab-actions', changeDetection: ChangeDetectionStrategy.OnPush, template: "<button \n 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 \n 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 \n 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 \n fs-menu-file-item\n [fsClass]=\"action.classArray\"\n [multiple]=\"action.multiple\"\n [accept]=\"action.accept || '*'\"\n [minWidth]=\"action.minWidth\"\n [minHeight]=\"action.minHeight\"\n [imageWidth]=\"action.maxWidth\"\n [imageHeight]=\"action.maxHeight\"\n (error)=\"action.fileError($event)\"\n (select)=\"action.fileSelected($event)\"\n (click)=\"action.click($event)\">\n <mat-icon *ngIf=\"action.icon\">{{action.icon}}</mat-icon> {{action.label}}\n </ng-template>\n </ng-container>\n\n <ng-container *ngSwitchDefault>\n <ng-template \n fs-menu-item\n (click)=\"action.click($event)\"\n [fsClass]=\"action.classArray\">\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"] }]
|
|
2486
|
+
}], propDecorators: { kebabActions: [{
|
|
2487
|
+
type: Input
|
|
2488
|
+
}] } });
|
|
2489
|
+
|
|
2490
|
+
class FsFilterActionsComponent {
|
|
2491
|
+
constructor() {
|
|
2492
|
+
this.kebabActions = [];
|
|
2493
|
+
this.actions = [];
|
|
2494
|
+
}
|
|
2495
|
+
}
|
|
2496
|
+
FsFilterActionsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsFilterActionsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2497
|
+
FsFilterActionsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: FsFilterActionsComponent, selector: "fs-filter-actions", inputs: { kebabActions: "kebabActions", actions: "actions" }, ngImport: i0, template: "<!-- Buttons -->\n<ng-container *ngFor=\"let action of actions\">\n <ng-container [ngSwitch]=\"action.mode\">\n <ng-container *ngSwitchCase=\"'button'\">\n <fs-filter-action-button\n [action]=\"action\"\n fsPopover\n [enabled]=\"!!action.tooltip\"\n [text]=\"action.tooltip\">\n </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 fsPopover\n [enabled]=\"!!action.tooltip\"\n [text]=\"action.tooltip\">\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\n 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\n 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 fsPopover\n [enabled]=\"!!action.tooltip\"\n [text]=\"action.tooltip\">\n <fs-filter-action-button \n [action]=\"action\">\n </fs-filter-action-button>\n </fs-file>\n </ng-container>\n </ng-container>\n</ng-container>\n<!-- /Buttons -->\n<!-- menu -->\n<ng-container *ngIf=\"kebabActions?.length\">\n <fs-filter-action-kebab-actions\n [kebabActions]=\"kebabActions\">\n </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", "buttonType", "buttonColor"], outputs: ["opened", "closed"] }, { type: i2$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: i4$1.FsFileComponent, selector: "fs-file", inputs: ["minHeight", "minWidth", "orientate", "multiple", "capture", "allowClick", "allowDrop", "accept", "disabled", "imageWidth", "imageHeight", "imageQuality"], outputs: ["select", "selectPreviews", "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: i7$1.FsPopoverDirective, selector: "[fsPopover]", inputs: ["text", "template", "data", "leaveDelay", "showDelay", "maxWidth", "wrapperClass", "autoShow", "autoClose", "loadingDiameter", "loading", "indication", "position", "theme", "size", "trigger", "enabled"] }, { 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]" }], pipes: { "async": i3.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2498
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsFilterActionsComponent, decorators: [{
|
|
2499
|
+
type: Component,
|
|
2500
|
+
args: [{ selector: 'fs-filter-actions', changeDetection: ChangeDetectionStrategy.OnPush, template: "<!-- Buttons -->\n<ng-container *ngFor=\"let action of actions\">\n <ng-container [ngSwitch]=\"action.mode\">\n <ng-container *ngSwitchCase=\"'button'\">\n <fs-filter-action-button\n [action]=\"action\"\n fsPopover\n [enabled]=\"!!action.tooltip\"\n [text]=\"action.tooltip\">\n </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 fsPopover\n [enabled]=\"!!action.tooltip\"\n [text]=\"action.tooltip\">\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\n 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\n 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 fsPopover\n [enabled]=\"!!action.tooltip\"\n [text]=\"action.tooltip\">\n <fs-filter-action-button \n [action]=\"action\">\n </fs-filter-action-button>\n </fs-file>\n </ng-container>\n </ng-container>\n</ng-container>\n<!-- /Buttons -->\n<!-- menu -->\n<ng-container *ngIf=\"kebabActions?.length\">\n <fs-filter-action-kebab-actions\n [kebabActions]=\"kebabActions\">\n </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"] }]
|
|
2501
|
+
}], propDecorators: { kebabActions: [{
|
|
2502
|
+
type: Input
|
|
2503
|
+
}], actions: [{
|
|
2504
|
+
type: Input
|
|
2505
|
+
}] } });
|
|
2506
|
+
|
|
2507
|
+
class FsFilterChipContentComponent {
|
|
2508
|
+
constructor(_cdRef) {
|
|
2509
|
+
this._cdRef = _cdRef;
|
|
2510
|
+
this._destroy$ = new Subject();
|
|
2511
|
+
}
|
|
2512
|
+
ngOnInit() {
|
|
2513
|
+
this.listenValueChangesForRanges();
|
|
2514
|
+
}
|
|
2515
|
+
ngOnDestroy() {
|
|
2516
|
+
this._destroy$.next();
|
|
2517
|
+
this._destroy$.complete();
|
|
2518
|
+
}
|
|
2519
|
+
listenValueChangesForRanges() {
|
|
2520
|
+
this.item.value$
|
|
2521
|
+
.pipe(takeUntil(this._destroy$))
|
|
2522
|
+
.subscribe(() => {
|
|
2523
|
+
this.content = this._getContent();
|
|
2524
|
+
this._cdRef.detectChanges();
|
|
2525
|
+
});
|
|
2526
|
+
}
|
|
2527
|
+
_getContent() {
|
|
2528
|
+
const result = this.item.getChipsContent(this.type);
|
|
2529
|
+
if (this.item.chipLabel !== undefined) {
|
|
2530
|
+
if (this.item.chipLabel === '') {
|
|
2531
|
+
return `${result}`;
|
|
2532
|
+
}
|
|
2533
|
+
else {
|
|
2534
|
+
if (Array.isArray(this.item.chipLabel)) {
|
|
2535
|
+
const label = getLabelFromArray(this.item.chipLabel, this.type);
|
|
2536
|
+
return `${label}: ${result}`;
|
|
2537
|
+
}
|
|
2538
|
+
else {
|
|
2539
|
+
return `${this.item.chipLabel}: ${result}`;
|
|
2540
|
+
}
|
|
2541
|
+
}
|
|
2542
|
+
}
|
|
2543
|
+
else {
|
|
2544
|
+
if (Array.isArray(this.item.label)) {
|
|
2545
|
+
const label = getLabelFromArray(this.item.label, this.type);
|
|
2546
|
+
return `${label}: ${result}`;
|
|
2547
|
+
}
|
|
2548
|
+
else {
|
|
2549
|
+
if (this.item.isTypeCheckbox) {
|
|
2550
|
+
return result;
|
|
2551
|
+
}
|
|
2552
|
+
else {
|
|
2553
|
+
return `${this.item.label}: ${result}`;
|
|
2554
|
+
}
|
|
2555
|
+
}
|
|
2556
|
+
}
|
|
2557
|
+
}
|
|
2558
|
+
}
|
|
2559
|
+
FsFilterChipContentComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsFilterChipContentComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
2560
|
+
FsFilterChipContentComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: FsFilterChipContentComponent, selector: "fs-filter-chip-content", inputs: { item: "item", type: "type" }, ngImport: i0, template: "{{ content }}\n", styles: [""], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2561
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsFilterChipContentComponent, decorators: [{
|
|
2562
|
+
type: Component,
|
|
2563
|
+
args: [{ selector: 'fs-filter-chip-content', changeDetection: ChangeDetectionStrategy.OnPush, template: "{{ content }}\n", styles: [""] }]
|
|
2564
|
+
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { item: [{
|
|
2565
|
+
type: Input
|
|
2566
|
+
}], type: [{
|
|
2567
|
+
type: Input
|
|
2568
|
+
}] } });
|
|
2569
|
+
function getLabelFromArray(labelArr, type) {
|
|
2570
|
+
if (type === 'from' && labelArr[0]) {
|
|
2571
|
+
return `${labelArr[0]}`;
|
|
2572
|
+
}
|
|
2573
|
+
else if (type === 'to' && labelArr[1]) {
|
|
2574
|
+
return `${labelArr[1]}`;
|
|
2575
|
+
}
|
|
2576
|
+
else {
|
|
2577
|
+
return '';
|
|
2578
|
+
}
|
|
2579
|
+
}
|
|
2580
|
+
|
|
2581
|
+
class FocusControllerService {
|
|
2582
|
+
constructor() {
|
|
2583
|
+
this._focusOn = new BehaviorSubject(null);
|
|
2584
|
+
}
|
|
2585
|
+
get focusOn$() {
|
|
2586
|
+
return this._focusOn.asObservable();
|
|
2587
|
+
}
|
|
2588
|
+
click(item, type = null) {
|
|
2589
|
+
this._focusOn.next({ item, type });
|
|
2590
|
+
}
|
|
2591
|
+
listenFocusFor$(targetItem, targetType = null) {
|
|
2592
|
+
return this._focusOn
|
|
2593
|
+
.pipe(filter$1((event) => !!event), filter$1(({ item, type }) => {
|
|
2594
|
+
return targetItem === item && targetType === type;
|
|
2595
|
+
}), tap(() => this.clearFocus()));
|
|
2596
|
+
}
|
|
2597
|
+
clearFocus() {
|
|
2598
|
+
this._focusOn.next(null);
|
|
2599
|
+
}
|
|
2600
|
+
}
|
|
2601
|
+
FocusControllerService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FocusControllerService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2602
|
+
FocusControllerService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FocusControllerService });
|
|
2603
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FocusControllerService, decorators: [{
|
|
2604
|
+
type: Injectable
|
|
2605
|
+
}], ctorParameters: function () { return []; } });
|
|
2606
|
+
|
|
2607
|
+
class FsFilterChipComponent {
|
|
2608
|
+
constructor(_cdRef, _focusController) {
|
|
2609
|
+
this._cdRef = _cdRef;
|
|
2610
|
+
this._focusController = _focusController;
|
|
2611
|
+
this._chipRenderTimer$ = timer(500)
|
|
2612
|
+
.pipe(mapTo(true));
|
|
2613
|
+
this._destroy$ = new Subject();
|
|
2614
|
+
}
|
|
2615
|
+
ngOnInit() {
|
|
2616
|
+
this.rangeItem = this.item.isTypeDateRange
|
|
2617
|
+
|| this.item.isTypeRange
|
|
2618
|
+
|| this.item.isTypeDateTimeRange;
|
|
2619
|
+
this.listenValueChangesForRanges();
|
|
2620
|
+
this._updateVisibility();
|
|
2621
|
+
if (this.item.hasPendingValues) {
|
|
2622
|
+
this.item.loadAsyncValues(false);
|
|
2623
|
+
this.item.values$
|
|
2624
|
+
.pipe(take(2), takeUntil(this._destroy$))
|
|
2625
|
+
.subscribe(() => {
|
|
2626
|
+
this._updateVisibility();
|
|
2627
|
+
this._cdRef.markForCheck();
|
|
2628
|
+
});
|
|
2629
|
+
this._initDelayRender();
|
|
2630
|
+
}
|
|
2631
|
+
}
|
|
2632
|
+
ngOnDestroy() {
|
|
2633
|
+
this._destroy$.next();
|
|
2634
|
+
this._destroy$.complete();
|
|
2635
|
+
}
|
|
2636
|
+
focusOnItem(type = null) {
|
|
2637
|
+
this._focusController.click(this.item, type);
|
|
2638
|
+
}
|
|
2639
|
+
removeItem(event, type = null) {
|
|
2640
|
+
if (this.item instanceof RangeItem) {
|
|
2641
|
+
this.item.clearRange(type);
|
|
2642
|
+
}
|
|
2643
|
+
else if (this.item instanceof DateRangeItem || this.item instanceof DateTimeRangeItem) {
|
|
2644
|
+
this.item.clearDateRange(type);
|
|
2645
|
+
}
|
|
2646
|
+
else {
|
|
2647
|
+
this.item.clear();
|
|
2648
|
+
}
|
|
2649
|
+
}
|
|
2650
|
+
listenValueChangesForRanges() {
|
|
2651
|
+
this.item.value$
|
|
2652
|
+
.pipe(distinctUntilChanged(), takeUntil(this._destroy$))
|
|
2653
|
+
.subscribe(() => {
|
|
2654
|
+
this._updateVisibility();
|
|
2655
|
+
this._cdRef.markForCheck();
|
|
2656
|
+
});
|
|
2657
|
+
}
|
|
2658
|
+
_updateVisibility() {
|
|
2659
|
+
this.itemVisible = this.item.isChipVisible;
|
|
2660
|
+
}
|
|
2661
|
+
_initDelayRender() {
|
|
2662
|
+
this.chipDelayedRender$ = combineLatest([
|
|
2663
|
+
this.item.values$,
|
|
2664
|
+
this._chipRenderTimer$.pipe(startWith(false)),
|
|
2665
|
+
])
|
|
2666
|
+
.pipe(map(([values, timerValue]) => {
|
|
2667
|
+
return !!values || timerValue;
|
|
2668
|
+
}));
|
|
2669
|
+
}
|
|
2670
|
+
}
|
|
2671
|
+
FsFilterChipComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsFilterChipComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: FocusControllerService }], target: i0.ɵɵFactoryTarget.Component });
|
|
2672
|
+
FsFilterChipComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", 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.showClear\"\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.showClear\"\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.showClear\"\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$2.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 });
|
|
2673
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsFilterChipComponent, decorators: [{
|
|
2674
|
+
type: Component,
|
|
2675
|
+
args: [{ selector: 'fs-filter-chip', changeDetection: ChangeDetectionStrategy.OnPush, 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.showClear\"\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.showClear\"\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.showClear\"\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"] }]
|
|
2676
|
+
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: FocusControllerService }]; }, propDecorators: { item: [{
|
|
2677
|
+
type: Input
|
|
2678
|
+
}] } });
|
|
2679
|
+
|
|
2680
|
+
class FsFilterChipsComponent {
|
|
2681
|
+
constructor() {
|
|
2682
|
+
this.ItemType = ItemType;
|
|
2683
|
+
this.chips = [];
|
|
2684
|
+
}
|
|
2685
|
+
}
|
|
2686
|
+
FsFilterChipsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsFilterChipsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2687
|
+
FsFilterChipsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", 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) !== undefined && item.type !== ItemType.Keyword\">\n <fs-filter-chip [item]=\"item\"></fs-filter-chip>\n </ng-container>\n </ng-container>\n</fs-chips>\n", styles: [""], components: [{ type: i2$2.FsChipsComponent, selector: "fs-chips", inputs: ["compare", "multiple"] }, { type: FsFilterChipComponent, selector: "fs-filter-chip", inputs: ["item"] }], directives: [{ type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i7.FsFormNoFsValidatorsDirective, selector: "[ngModel]:not([required]):not([fsFormRequired]):not([fsFormCompare]):not([fsFormDateRange]):not([fsFormEmail]):not([fsFormEmails]):not([fsFormFunction]):not([fsFormGreater]):not([fsFormInteger]):not([fsFormLesser]):not([fsFormMax]):not([fsFormMaxLength]):not([fsFormMin]):not([fsFormMinLength]):not([fsFormNumeric]):not([fsFormPattern]):not([fsFormPhone]):not([fsFormUrl]):not([validate])" }, { 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 });
|
|
2688
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsFilterChipsComponent, decorators: [{
|
|
2689
|
+
type: Component,
|
|
2690
|
+
args: [{ selector: 'fs-filter-chips', changeDetection: ChangeDetectionStrategy.OnPush, template: "<fs-chips [(ngModel)]=\"chips\">\n <ng-container *ngFor=\"let item of filters\">\n <ng-container *ngIf=\"(item.value$ | async) !== undefined && item.type !== ItemType.Keyword\">\n <fs-filter-chip [item]=\"item\"></fs-filter-chip>\n </ng-container>\n </ng-container>\n</fs-chips>\n", styles: [""] }]
|
|
2691
|
+
}], propDecorators: { filters: [{
|
|
2692
|
+
type: Input
|
|
2693
|
+
}] } });
|
|
2694
|
+
|
|
2695
|
+
class FsFilterDrawerActionsComponent {
|
|
2696
|
+
constructor(externalParams) {
|
|
2697
|
+
this.externalParams = externalParams;
|
|
2698
|
+
this._clear = new EventEmitter();
|
|
2699
|
+
this._done = new EventEmitter();
|
|
2700
|
+
}
|
|
2701
|
+
get savedFilters() {
|
|
2702
|
+
return this.externalParams.savedFiltersController;
|
|
2703
|
+
}
|
|
2704
|
+
done() {
|
|
2705
|
+
this._done.emit();
|
|
2706
|
+
}
|
|
2707
|
+
clear() {
|
|
2708
|
+
this._clear.emit();
|
|
2709
|
+
}
|
|
2710
|
+
saveFilters() {
|
|
2711
|
+
this.externalParams
|
|
2712
|
+
.savedFiltersController
|
|
2713
|
+
.openSavedFilterEditDialog();
|
|
2714
|
+
}
|
|
2715
|
+
}
|
|
2716
|
+
FsFilterDrawerActionsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsFilterDrawerActionsComponent, deps: [{ token: ExternalParamsController }], target: i0.ɵɵFactoryTarget.Component });
|
|
2717
|
+
FsFilterDrawerActionsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", 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: i7.FsButtonDirective, selector: "[mat-raised-button],[mat-button],[mat-flat-button],[mat-stroked-button]", inputs: ["name", "dirtySubmit", "form"] }, { type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "async": i3.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2718
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsFilterDrawerActionsComponent, decorators: [{
|
|
2719
|
+
type: Component,
|
|
2720
|
+
args: [{ selector: 'fs-filter-drawer-actions', changeDetection: ChangeDetectionStrategy.OnPush, 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" }]
|
|
2721
|
+
}], ctorParameters: function () { return [{ type: ExternalParamsController }]; }, propDecorators: { _clear: [{
|
|
2722
|
+
type: Output,
|
|
2723
|
+
args: ['clear']
|
|
2724
|
+
}], _done: [{
|
|
2725
|
+
type: Output,
|
|
2726
|
+
args: ['done']
|
|
2727
|
+
}] } });
|
|
2728
|
+
|
|
2729
|
+
const FILTER_DRAWER_DATA = new InjectionToken('fs.filter-drawer-data');
|
|
2730
|
+
|
|
2731
|
+
const FILTER_DRAWER_OVERLAY = new InjectionToken('fs.filter-drawer-overlay');
|
|
2732
|
+
|
|
2733
|
+
class BaseItemComponent {
|
|
2734
|
+
constructor(_kvDiffers, _cd) {
|
|
2735
|
+
this._kvDiffers = _kvDiffers;
|
|
2736
|
+
this._cd = _cd;
|
|
2737
|
+
this.inline = false;
|
|
2738
|
+
this._destroy$ = new Subject();
|
|
2739
|
+
this._debouncer$ = new Subject();
|
|
2740
|
+
this._kvDiffer = this._kvDiffers.find(this.item || {}).create();
|
|
2741
|
+
this.listenWithDebounce();
|
|
2742
|
+
}
|
|
2743
|
+
set item(value) {
|
|
2744
|
+
this._item = value;
|
|
2745
|
+
}
|
|
2746
|
+
get item() {
|
|
2747
|
+
return this._item;
|
|
2748
|
+
}
|
|
2749
|
+
ngDoCheck() {
|
|
2750
|
+
if (this._kvDiffer) {
|
|
2751
|
+
const changes = this._kvDiffer.diff(this.item);
|
|
2752
|
+
if (changes) {
|
|
2753
|
+
this._cd.detectChanges();
|
|
2754
|
+
}
|
|
2755
|
+
}
|
|
2756
|
+
}
|
|
2757
|
+
ngOnChanges(changes) {
|
|
2758
|
+
if (changes.item) {
|
|
2759
|
+
this.label = Array.isArray(this.item.label) ? this.item.label[0] : this.item.label;
|
|
2760
|
+
}
|
|
2761
|
+
}
|
|
2762
|
+
ngOnDestroy() {
|
|
2763
|
+
this._destroy$.next();
|
|
2764
|
+
this._destroy$.complete();
|
|
2765
|
+
}
|
|
2766
|
+
listenWithDebounce() {
|
|
2767
|
+
this._debouncer$
|
|
2768
|
+
.pipe(debounceTime(150), takeUntil(this._destroy$))
|
|
2769
|
+
.subscribe(() => {
|
|
2770
|
+
this.item.valueChanged();
|
|
2771
|
+
});
|
|
2772
|
+
}
|
|
2773
|
+
itemChange() {
|
|
2774
|
+
this._debouncer$.next();
|
|
2775
|
+
}
|
|
2776
|
+
}
|
|
2777
|
+
BaseItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: BaseItemComponent, deps: [{ token: i0.KeyValueDiffers }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
2778
|
+
BaseItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: BaseItemComponent, selector: "base-item", inputs: { item: "item", inline: "inline" }, usesOnChanges: true, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2779
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: BaseItemComponent, decorators: [{
|
|
2780
|
+
type: Component,
|
|
2781
|
+
args: [{
|
|
2782
|
+
selector: 'base-item',
|
|
2783
|
+
template: '',
|
|
2784
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
2785
|
+
}]
|
|
2786
|
+
}], ctorParameters: function () { return [{ type: i0.KeyValueDiffers }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { item: [{
|
|
2787
|
+
type: Input
|
|
2788
|
+
}], inline: [{
|
|
2789
|
+
type: Input
|
|
2790
|
+
}] } });
|
|
2791
|
+
|
|
2792
|
+
class FocusToItemDirective {
|
|
2793
|
+
constructor(_el, _focusController, _targetSelect, _targetDate, _targetDateScroll, _targetDateRangeFrom, _targetDateRangeTo, _targetAutocomplete, _targetAutocompleteChips) {
|
|
2794
|
+
this._el = _el;
|
|
2795
|
+
this._focusController = _focusController;
|
|
2796
|
+
this._targetSelect = _targetSelect;
|
|
2797
|
+
this._targetDate = _targetDate;
|
|
2798
|
+
this._targetDateScroll = _targetDateScroll;
|
|
2799
|
+
this._targetDateRangeFrom = _targetDateRangeFrom;
|
|
2800
|
+
this._targetDateRangeTo = _targetDateRangeTo;
|
|
2801
|
+
this._targetAutocomplete = _targetAutocomplete;
|
|
2802
|
+
this._targetAutocompleteChips = _targetAutocompleteChips;
|
|
2803
|
+
this._destroy$ = new Subject();
|
|
2804
|
+
}
|
|
2805
|
+
ngOnInit() {
|
|
2806
|
+
this._focusController
|
|
2807
|
+
.listenFocusFor$(this._item, this._focusTargetType)
|
|
2808
|
+
.pipe(delay(500), takeUntil(this._destroy$))
|
|
2809
|
+
.subscribe(() => {
|
|
2810
|
+
this._focus();
|
|
2811
|
+
});
|
|
2812
|
+
}
|
|
2813
|
+
ngOnDestroy() {
|
|
2814
|
+
this._destroy$.next();
|
|
2815
|
+
this._destroy$.complete();
|
|
2816
|
+
}
|
|
2817
|
+
_focus() {
|
|
2818
|
+
switch (this._item.type) {
|
|
2819
|
+
case ItemType.Select:
|
|
2820
|
+
{
|
|
2821
|
+
this._targetSelect.open();
|
|
2822
|
+
}
|
|
2823
|
+
break;
|
|
2824
|
+
case ItemType.Text:
|
|
2825
|
+
case ItemType.Range:
|
|
2826
|
+
{
|
|
2827
|
+
this._el.nativeElement.focus();
|
|
2828
|
+
}
|
|
2829
|
+
break;
|
|
2830
|
+
case ItemType.Date:
|
|
2831
|
+
{
|
|
2832
|
+
if (this._item.mode === ItemDateMode.Calendar) {
|
|
2833
|
+
this._targetDate.open();
|
|
2834
|
+
}
|
|
2835
|
+
else {
|
|
2836
|
+
this._targetDateScroll.open();
|
|
2837
|
+
}
|
|
2838
|
+
}
|
|
2839
|
+
break;
|
|
2840
|
+
case ItemType.DateRange:
|
|
2841
|
+
{
|
|
2842
|
+
if (this._focusTargetType === 'from') {
|
|
2843
|
+
this._targetDateRangeFrom.open();
|
|
2844
|
+
}
|
|
2845
|
+
else {
|
|
2846
|
+
this._targetDateRangeTo.open();
|
|
2847
|
+
}
|
|
2848
|
+
}
|
|
2849
|
+
break;
|
|
2850
|
+
case ItemType.AutoComplete:
|
|
2851
|
+
{
|
|
2852
|
+
this._targetAutocomplete.focus();
|
|
2853
|
+
}
|
|
2854
|
+
break;
|
|
2855
|
+
case ItemType.AutoCompleteChips:
|
|
2856
|
+
{
|
|
2857
|
+
this._targetAutocompleteChips.focus();
|
|
2858
|
+
}
|
|
2859
|
+
break;
|
|
2860
|
+
}
|
|
2861
|
+
}
|
|
2862
|
+
}
|
|
2863
|
+
FocusToItemDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FocusToItemDirective, deps: [{ token: i0.ElementRef }, { token: FocusControllerService }, { token: i2.MatSelect, optional: true, self: true }, { token: i3$4.FsDatePickerComponent, optional: true, self: true }, { token: i3$4.FsDateScrollPickerComponent, optional: true, self: true }, { token: i3$4.DateRangePickerFromComponent, optional: true, self: true }, { token: i3$4.DateRangePickerToComponent, optional: true, self: true }, { token: i4$2.FsAutocompleteComponent, optional: true, self: true }, { token: i5.FsAutocompleteChipsComponent, optional: true, self: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
2864
|
+
FocusToItemDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.4.0", type: FocusToItemDirective, selector: "[fsFilterFocusTrigger]", inputs: { _item: ["fsFilterFocusTrigger", "_item"], _focusTargetType: ["focusTargetType", "_focusTargetType"] }, ngImport: i0 });
|
|
2865
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FocusToItemDirective, decorators: [{
|
|
2866
|
+
type: Directive,
|
|
2867
|
+
args: [{
|
|
2868
|
+
selector: '[fsFilterFocusTrigger]',
|
|
2869
|
+
}]
|
|
2870
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: FocusControllerService }, { type: i2.MatSelect, decorators: [{
|
|
2871
|
+
type: Optional
|
|
2872
|
+
}, {
|
|
2873
|
+
type: Self
|
|
2874
|
+
}] }, { type: i3$4.FsDatePickerComponent, decorators: [{
|
|
2875
|
+
type: Optional
|
|
2876
|
+
}, {
|
|
2877
|
+
type: Self
|
|
2878
|
+
}] }, { type: i3$4.FsDateScrollPickerComponent, decorators: [{
|
|
2879
|
+
type: Optional
|
|
2880
|
+
}, {
|
|
2881
|
+
type: Self
|
|
2882
|
+
}] }, { type: i3$4.DateRangePickerFromComponent, decorators: [{
|
|
2883
|
+
type: Optional
|
|
2884
|
+
}, {
|
|
2885
|
+
type: Self
|
|
2886
|
+
}] }, { type: i3$4.DateRangePickerToComponent, decorators: [{
|
|
2887
|
+
type: Optional
|
|
2888
|
+
}, {
|
|
2889
|
+
type: Self
|
|
2890
|
+
}] }, { type: i4$2.FsAutocompleteComponent, decorators: [{
|
|
2891
|
+
type: Optional
|
|
2892
|
+
}, {
|
|
2893
|
+
type: Self
|
|
2894
|
+
}] }, { type: i5.FsAutocompleteChipsComponent, decorators: [{
|
|
2895
|
+
type: Optional
|
|
2896
|
+
}, {
|
|
2897
|
+
type: Self
|
|
2898
|
+
}] }]; }, propDecorators: { _item: [{
|
|
2899
|
+
type: Input,
|
|
2900
|
+
args: ['fsFilterFocusTrigger']
|
|
2901
|
+
}], _focusTargetType: [{
|
|
2902
|
+
type: Input,
|
|
2903
|
+
args: ['focusTargetType']
|
|
2904
|
+
}] } });
|
|
2905
|
+
|
|
2906
|
+
class TextComponent extends BaseItemComponent {
|
|
2907
|
+
constructor(_kvDiffers, _cd) {
|
|
2908
|
+
super(_kvDiffers, _cd);
|
|
2909
|
+
this._kvDiffers = _kvDiffers;
|
|
2910
|
+
this._cd = _cd;
|
|
2911
|
+
this.textControl = new FormControl();
|
|
2912
|
+
this.destroy$ = new Subject();
|
|
2913
|
+
}
|
|
2914
|
+
ngOnInit() {
|
|
2915
|
+
this._listenControlValueChanges();
|
|
2916
|
+
this._listenModelChanges();
|
|
2917
|
+
}
|
|
2918
|
+
ngOnDestroy() {
|
|
2919
|
+
this.destroy$.next();
|
|
2920
|
+
this.destroy$.complete();
|
|
2921
|
+
}
|
|
2922
|
+
_listenControlValueChanges() {
|
|
2923
|
+
this.textControl.valueChanges
|
|
2924
|
+
.pipe(distinctUntilChanged(), debounceTime(200), takeUntil(this.destroy$))
|
|
2925
|
+
.subscribe((value) => {
|
|
2926
|
+
this.item.model = value;
|
|
2927
|
+
});
|
|
2928
|
+
}
|
|
2929
|
+
_listenModelChanges() {
|
|
2930
|
+
this._item.value$
|
|
2931
|
+
.pipe(takeUntil(this.destroy$))
|
|
2932
|
+
.subscribe(() => {
|
|
2933
|
+
this.textControl.setValue(this.item.model, { emitEvent: false });
|
|
2934
|
+
});
|
|
2935
|
+
}
|
|
2936
|
+
}
|
|
2937
|
+
TextComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: TextComponent, deps: [{ token: i0.KeyValueDiffers }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
2938
|
+
TextComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", 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", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], 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: i3$2.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { type: i4.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: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: FocusToItemDirective, selector: "[fsFilterFocusTrigger]", inputs: ["fsFilterFocusTrigger", "focusTargetType"] }, { type: i1$3.MatSuffix, selector: "[matSuffix]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2939
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: TextComponent, decorators: [{
|
|
2940
|
+
type: Component,
|
|
2941
|
+
args: [{ selector: 'filter-item-text', changeDetection: ChangeDetectionStrategy.OnPush, 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: [""] }]
|
|
2942
|
+
}], ctorParameters: function () { return [{ type: i0.KeyValueDiffers }, { type: i0.ChangeDetectorRef }]; } });
|
|
2943
|
+
|
|
2944
|
+
class FsFilterIsolateValues {
|
|
2945
|
+
transform(values, isolate) {
|
|
2946
|
+
if (!isolate) {
|
|
2947
|
+
return values;
|
|
2948
|
+
}
|
|
2949
|
+
return values.filter((value) => {
|
|
2950
|
+
return value.value !== isolate.value;
|
|
2951
|
+
});
|
|
2952
|
+
}
|
|
2953
|
+
}
|
|
2954
|
+
FsFilterIsolateValues.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsFilterIsolateValues, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
2955
|
+
FsFilterIsolateValues.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsFilterIsolateValues, name: "fsFilterIsolateValues" });
|
|
2956
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsFilterIsolateValues, decorators: [{
|
|
2957
|
+
type: Pipe,
|
|
2958
|
+
args: [{
|
|
2959
|
+
name: 'fsFilterIsolateValues',
|
|
2960
|
+
}]
|
|
2961
|
+
}] });
|
|
2962
|
+
|
|
2963
|
+
class SelectMultipleComponent {
|
|
2964
|
+
constructor(cd) {
|
|
2965
|
+
this.cd = cd;
|
|
2966
|
+
}
|
|
2967
|
+
changed() {
|
|
2968
|
+
if (this.item.isolate) {
|
|
2969
|
+
this.item.isolate.enabled = false;
|
|
2970
|
+
if (this.item.multiple && Array.isArray(this.item.model)) {
|
|
2971
|
+
const index = this.item.model.indexOf(this.item.isolate.value);
|
|
2972
|
+
if (index > -1) {
|
|
2973
|
+
this.item.model.splice(index, 1);
|
|
2974
|
+
}
|
|
2975
|
+
}
|
|
2976
|
+
}
|
|
2977
|
+
}
|
|
2978
|
+
close() {
|
|
2979
|
+
this.select.close();
|
|
2980
|
+
}
|
|
2981
|
+
isolateChange(filter) {
|
|
2982
|
+
if (filter.isolate.enabled) {
|
|
2983
|
+
filter.model = filter.multiple ? [filter.isolate.value] : filter.isolate.value;
|
|
2984
|
+
}
|
|
2985
|
+
else {
|
|
2986
|
+
if (filter.multiple) {
|
|
2987
|
+
filter.model = filter.defaultValue ? filter.defaultValue : [];
|
|
2988
|
+
}
|
|
2989
|
+
else {
|
|
2990
|
+
filter.model = filter.defaultValue ? filter.defaultValue : null;
|
|
2991
|
+
}
|
|
2992
|
+
}
|
|
2993
|
+
}
|
|
2994
|
+
}
|
|
2995
|
+
SelectMultipleComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SelectMultipleComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
2996
|
+
SelectMultipleComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", 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", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], 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$3.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex", "aria-label", "aria-labelledby", "aria-describedby", "id", "required", "labelPosition", "name", "value", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }], directives: [{ type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i1$3.MatLabel, selector: "mat-label" }, { type: FocusToItemDirective, selector: "[fsFilterFocusTrigger]", inputs: ["fsFilterFocusTrigger", "focusTargetType"] }, { type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i7.FsFormNoFsValidatorsDirective, selector: "[ngModel]:not([required]):not([fsFormRequired]):not([fsFormCompare]):not([fsFormDateRange]):not([fsFormEmail]):not([fsFormEmails]):not([fsFormFunction]):not([fsFormGreater]):not([fsFormInteger]):not([fsFormLesser]):not([fsFormMax]):not([fsFormMaxLength]):not([fsFormMin]):not([fsFormMinLength]):not([fsFormNumeric]):not([fsFormPattern]):not([fsFormPhone]):not([fsFormUrl]):not([validate])" }, { 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 });
|
|
2997
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SelectMultipleComponent, decorators: [{
|
|
2998
|
+
type: Component,
|
|
2999
|
+
args: [{ selector: 'filter-item-select-multiple', changeDetection: ChangeDetectionStrategy.OnPush, 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"] }]
|
|
3000
|
+
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { item: [{
|
|
3001
|
+
type: Input
|
|
3002
|
+
}], select: [{
|
|
3003
|
+
type: ViewChild,
|
|
3004
|
+
args: ['select', { static: true }]
|
|
3005
|
+
}] } });
|
|
3006
|
+
|
|
3007
|
+
class SelectSimpleComponent {
|
|
3008
|
+
constructor(cd) {
|
|
3009
|
+
this.cd = cd;
|
|
3010
|
+
}
|
|
3011
|
+
changed() {
|
|
3012
|
+
if (this.item.isolate) {
|
|
3013
|
+
this.item.isolate.enabled = false;
|
|
3014
|
+
}
|
|
3015
|
+
}
|
|
3016
|
+
isolateChange(filter) {
|
|
3017
|
+
if (filter.isolate.enabled) {
|
|
3018
|
+
filter.model = filter.isolate.value;
|
|
3019
|
+
}
|
|
3020
|
+
else {
|
|
3021
|
+
filter.model = null;
|
|
3022
|
+
}
|
|
3023
|
+
}
|
|
3024
|
+
}
|
|
3025
|
+
SelectSimpleComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SelectSimpleComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
3026
|
+
SelectSimpleComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", 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", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], 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$3.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex", "aria-label", "aria-labelledby", "aria-describedby", "id", "required", "labelPosition", "name", "value", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }], directives: [{ type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i1$3.MatLabel, selector: "mat-label" }, { type: FocusToItemDirective, selector: "[fsFilterFocusTrigger]", inputs: ["fsFilterFocusTrigger", "focusTargetType"] }, { type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i7.FsFormNoFsValidatorsDirective, selector: "[ngModel]:not([required]):not([fsFormRequired]):not([fsFormCompare]):not([fsFormDateRange]):not([fsFormEmail]):not([fsFormEmails]):not([fsFormFunction]):not([fsFormGreater]):not([fsFormInteger]):not([fsFormLesser]):not([fsFormMax]):not([fsFormMaxLength]):not([fsFormMin]):not([fsFormMinLength]):not([fsFormNumeric]):not([fsFormPattern]):not([fsFormPhone]):not([fsFormUrl]):not([validate])" }, { 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 });
|
|
3027
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SelectSimpleComponent, decorators: [{
|
|
3028
|
+
type: Component,
|
|
3029
|
+
args: [{ selector: 'filter-item-select-simple', changeDetection: ChangeDetectionStrategy.OnPush, 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"] }]
|
|
3030
|
+
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { item: [{
|
|
3031
|
+
type: Input
|
|
3032
|
+
}], select: [{
|
|
3033
|
+
type: ViewChild,
|
|
3034
|
+
args: ['select', { static: true }]
|
|
3035
|
+
}] } });
|
|
3036
|
+
|
|
3037
|
+
class SelectGroupsComponent {
|
|
3038
|
+
constructor(cd) {
|
|
3039
|
+
this.cd = cd;
|
|
3040
|
+
}
|
|
3041
|
+
compare(o1, o2) {
|
|
3042
|
+
return o1 == o2;
|
|
3043
|
+
}
|
|
3044
|
+
}
|
|
3045
|
+
SelectGroupsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SelectGroupsComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
3046
|
+
SelectGroupsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", 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", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], 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: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i7.FsFormNoFsValidatorsDirective, selector: "[ngModel]:not([required]):not([fsFormRequired]):not([fsFormCompare]):not([fsFormDateRange]):not([fsFormEmail]):not([fsFormEmails]):not([fsFormFunction]):not([fsFormGreater]):not([fsFormInteger]):not([fsFormLesser]):not([fsFormMax]):not([fsFormMaxLength]):not([fsFormMin]):not([fsFormMinLength]):not([fsFormNumeric]):not([fsFormPattern]):not([fsFormPhone]):not([fsFormUrl]):not([validate])" }, { 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"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
3047
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SelectGroupsComponent, decorators: [{
|
|
3048
|
+
type: Component,
|
|
3049
|
+
args: [{ selector: 'filter-item-select-groups', changeDetection: ChangeDetectionStrategy.OnPush, 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" }]
|
|
3050
|
+
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { select: [{
|
|
3051
|
+
type: ViewChild,
|
|
3052
|
+
args: ['select', { static: true }]
|
|
3053
|
+
}], item: [{
|
|
3054
|
+
type: Input
|
|
3055
|
+
}] } });
|
|
3056
|
+
|
|
3057
|
+
class SelectComponent extends BaseItemComponent {
|
|
3058
|
+
constructor(_kvDiffers, _cd) {
|
|
3059
|
+
super(_kvDiffers, _cd);
|
|
3060
|
+
this._kvDiffers = _kvDiffers;
|
|
3061
|
+
this._cd = _cd;
|
|
3062
|
+
// For case when we have multiple selection with __all option
|
|
3063
|
+
// If _all has been selected than we must disable all other items
|
|
3064
|
+
this.allItemsOptionSelected = false;
|
|
3065
|
+
}
|
|
3066
|
+
get multipleSelectItem() {
|
|
3067
|
+
return this.item;
|
|
3068
|
+
}
|
|
3069
|
+
get simpleSelectItem() {
|
|
3070
|
+
return this.item;
|
|
3071
|
+
}
|
|
3072
|
+
ngOnChanges(changes) {
|
|
3073
|
+
if (changes.item) {
|
|
3074
|
+
this.values$ = this.item.values$;
|
|
3075
|
+
}
|
|
3076
|
+
}
|
|
3077
|
+
ngDoCheck() {
|
|
3078
|
+
if (this._kvDiffer) {
|
|
3079
|
+
const changes = this._kvDiffer.diff(this.item);
|
|
3080
|
+
if (changes) {
|
|
3081
|
+
this._cd.markForCheck();
|
|
3082
|
+
if (this.selectedItem) {
|
|
3083
|
+
this.selectedItem.cd.markForCheck();
|
|
3084
|
+
}
|
|
3085
|
+
}
|
|
3086
|
+
}
|
|
3087
|
+
}
|
|
3088
|
+
}
|
|
3089
|
+
SelectComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SelectComponent, deps: [{ token: i0.KeyValueDiffers }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
3090
|
+
SelectComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: SelectComponent, selector: "filter-item-select", viewQueries: [{ propertyName: "selectedItem", first: true, predicate: ["selectItem"], descendants: true }], usesInheritance: true, usesOnChanges: 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=\"(values$ | async)?.length\">\n <ng-container *ngIf=\"item.multiple && !item.children\">\n <filter-item-select-multiple\n [item]=\"multipleSelectItem\"\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]=\"simpleSelectItem\"\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", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], 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 });
|
|
3091
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SelectComponent, decorators: [{
|
|
3092
|
+
type: Component,
|
|
3093
|
+
args: [{ selector: 'filter-item-select', changeDetection: ChangeDetectionStrategy.OnPush, 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=\"(values$ | async)?.length\">\n <ng-container *ngIf=\"item.multiple && !item.children\">\n <filter-item-select-multiple\n [item]=\"multipleSelectItem\"\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]=\"simpleSelectItem\"\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" }]
|
|
3094
|
+
}], ctorParameters: function () { return [{ type: i0.KeyValueDiffers }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { selectedItem: [{
|
|
3095
|
+
type: ViewChild,
|
|
3096
|
+
args: ['selectItem']
|
|
3097
|
+
}] } });
|
|
3098
|
+
|
|
3099
|
+
class ChipsComponent extends BaseItemComponent {
|
|
3100
|
+
constructor(_kvDiffers, _cd) {
|
|
3101
|
+
super(_kvDiffers, _cd);
|
|
3102
|
+
this._kvDiffers = _kvDiffers;
|
|
3103
|
+
this._cd = _cd;
|
|
3104
|
+
}
|
|
3105
|
+
modelChange() {
|
|
3106
|
+
this.itemChange();
|
|
3107
|
+
}
|
|
3108
|
+
compareFn(modelValue, chipValue) {
|
|
3109
|
+
return modelValue.value === chipValue.value;
|
|
3110
|
+
}
|
|
3111
|
+
}
|
|
3112
|
+
ChipsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: ChipsComponent, deps: [{ token: i0.KeyValueDiffers }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
3113
|
+
ChipsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", 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$2.FsChipsComponent, selector: "fs-chips", inputs: ["compare", "multiple"] }, { type: i2$2.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: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i7.FsFormNoFsValidatorsDirective, selector: "[ngModel]:not([required]):not([fsFormRequired]):not([fsFormCompare]):not([fsFormDateRange]):not([fsFormEmail]):not([fsFormEmails]):not([fsFormFunction]):not([fsFormGreater]):not([fsFormInteger]):not([fsFormLesser]):not([fsFormMax]):not([fsFormMaxLength]):not([fsFormMin]):not([fsFormMinLength]):not([fsFormNumeric]):not([fsFormPattern]):not([fsFormPhone]):not([fsFormUrl]):not([validate])" }, { type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
3114
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: ChipsComponent, decorators: [{
|
|
3115
|
+
type: Component,
|
|
3116
|
+
args: [{ selector: 'filter-item-chips', changeDetection: ChangeDetectionStrategy.OnPush, 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"] }]
|
|
3117
|
+
}], ctorParameters: function () { return [{ type: i0.KeyValueDiffers }, { type: i0.ChangeDetectorRef }]; } });
|
|
3118
|
+
|
|
3119
|
+
class RangeComponent extends BaseItemComponent {
|
|
3120
|
+
constructor(_kvDiffers, _cd) {
|
|
3121
|
+
super(_kvDiffers, _cd);
|
|
3122
|
+
this._kvDiffers = _kvDiffers;
|
|
3123
|
+
this._cd = _cd;
|
|
3124
|
+
}
|
|
3125
|
+
ngOnInit() {
|
|
3126
|
+
this.listenChanges();
|
|
3127
|
+
}
|
|
3128
|
+
listenChanges() {
|
|
3129
|
+
const fromListener = fromEvent(this.from.nativeElement, 'keyup')
|
|
3130
|
+
.pipe(distinctUntilChanged());
|
|
3131
|
+
const toListener = fromEvent(this.to.nativeElement, 'keyup')
|
|
3132
|
+
.pipe(distinctUntilChanged());
|
|
3133
|
+
merge(fromListener, toListener)
|
|
3134
|
+
.pipe(takeUntil(this._destroy$))
|
|
3135
|
+
.subscribe(() => {
|
|
3136
|
+
this.itemChange();
|
|
3137
|
+
});
|
|
3138
|
+
}
|
|
3139
|
+
}
|
|
3140
|
+
RangeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: RangeComponent, deps: [{ token: i0.KeyValueDiffers }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
3141
|
+
RangeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", 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: "<div class=\"form-field\">\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 \n matInput\n [fsFilterFocusTrigger]=\"item\"\n [focusTargetType]=\"'from'\"\n type=\"text\"\n inputmode=\"decimal\"\n [(ngModel)]=\"item.model.min\"\n #from>\n <span matSuffix *ngIf=\"item.suffix\" [innerHtml]=\"item.suffix\"></span>\n </mat-form-field>\n\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 \n matInput\n [fsFilterFocusTrigger]=\"item\"\n [focusTargetType]=\"'to'\"\n type=\"text\"\n inputmode=\"decimal\"\n [(ngModel)]=\"item.model.max\"\n #to>\n <span matSuffix *ngIf=\"item.suffix\" [innerHtml]=\"item.suffix\"></span>\n </mat-form-field>\n</div>\n", styles: [".form-field{display:flex}.form-field mat-form-field{min-width:0}.form-field mat-form-field+mat-form-field{margin-left:10px}\n"], components: [{ type: i1$3.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], 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: i3$2.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { type: i4.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: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i7.FsFormNoFsValidatorsDirective, selector: "[ngModel]:not([required]):not([fsFormRequired]):not([fsFormCompare]):not([fsFormDateRange]):not([fsFormEmail]):not([fsFormEmails]):not([fsFormFunction]):not([fsFormGreater]):not([fsFormInteger]):not([fsFormLesser]):not([fsFormMax]):not([fsFormMaxLength]):not([fsFormMin]):not([fsFormMinLength]):not([fsFormNumeric]):not([fsFormPattern]):not([fsFormPhone]):not([fsFormUrl]):not([validate])" }, { type: i1$3.MatSuffix, selector: "[matSuffix]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
3142
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: RangeComponent, decorators: [{
|
|
3143
|
+
type: Component,
|
|
3144
|
+
args: [{ selector: 'filter-item-range', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"form-field\">\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 \n matInput\n [fsFilterFocusTrigger]=\"item\"\n [focusTargetType]=\"'from'\"\n type=\"text\"\n inputmode=\"decimal\"\n [(ngModel)]=\"item.model.min\"\n #from>\n <span matSuffix *ngIf=\"item.suffix\" [innerHtml]=\"item.suffix\"></span>\n </mat-form-field>\n\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 \n matInput\n [fsFilterFocusTrigger]=\"item\"\n [focusTargetType]=\"'to'\"\n type=\"text\"\n inputmode=\"decimal\"\n [(ngModel)]=\"item.model.max\"\n #to>\n <span matSuffix *ngIf=\"item.suffix\" [innerHtml]=\"item.suffix\"></span>\n </mat-form-field>\n</div>\n", styles: [".form-field{display:flex}.form-field mat-form-field{min-width:0}.form-field mat-form-field+mat-form-field{margin-left:10px}\n"] }]
|
|
3145
|
+
}], ctorParameters: function () { return [{ type: i0.KeyValueDiffers }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { from: [{
|
|
3146
|
+
type: ViewChild,
|
|
3147
|
+
args: ['from', { static: true }]
|
|
3148
|
+
}], to: [{
|
|
3149
|
+
type: ViewChild,
|
|
3150
|
+
args: ['to', { static: true }]
|
|
3151
|
+
}] } });
|
|
3152
|
+
|
|
3153
|
+
class AutocompleteComponent extends BaseItemComponent {
|
|
3154
|
+
constructor(_kvDiffers, _cd) {
|
|
3155
|
+
super(_kvDiffers, _cd);
|
|
3156
|
+
this._kvDiffers = _kvDiffers;
|
|
3157
|
+
this._cd = _cd;
|
|
3158
|
+
this.displayWith = (data) => {
|
|
3159
|
+
return data ? data.name : data;
|
|
3160
|
+
};
|
|
3161
|
+
this.fetch = (keyword) => {
|
|
3162
|
+
return this.item.valuesFn(keyword, this.item.filter);
|
|
3163
|
+
};
|
|
3164
|
+
}
|
|
3165
|
+
}
|
|
3166
|
+
AutocompleteComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: AutocompleteComponent, deps: [{ token: i0.KeyValueDiffers }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
3167
|
+
AutocompleteComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", 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]=\"label\"\n [fetchOnFocus]=\"item.fetchOnFocus\"\n [showClear]=\"item.showClear\"\n name=\"item.name\">\n <ng-template fsAutocompleteTemplate let-data=\"data\">\n {{data.name}}\n </ng-template>\n</fs-autocomplete>\n", components: [{ type: i4$2.FsAutocompleteComponent, selector: "fs-autocomplete", inputs: ["fetch", "displayWith", "placeholder", "fetchOnFocus", "readonly", "required", "disabled", "formFieldClass", "appearance", "hint", "panelWidth", "panelClass", "showClear"], outputs: ["cleared", "opened", "closed"] }], directives: [{ type: FocusToItemDirective, selector: "[fsFilterFocusTrigger]", inputs: ["fsFilterFocusTrigger", "focusTargetType"] }, { type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i7.FsFormNoFsValidatorsDirective, selector: "[ngModel]:not([required]):not([fsFormRequired]):not([fsFormCompare]):not([fsFormDateRange]):not([fsFormEmail]):not([fsFormEmails]):not([fsFormFunction]):not([fsFormGreater]):not([fsFormInteger]):not([fsFormLesser]):not([fsFormMax]):not([fsFormMaxLength]):not([fsFormMin]):not([fsFormMinLength]):not([fsFormNumeric]):not([fsFormPattern]):not([fsFormPhone]):not([fsFormUrl]):not([validate])" }, { type: i4$2.FsAutocompleteTemplateDirective, selector: "[fsAutocompleteTemplate]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
3168
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: AutocompleteComponent, decorators: [{
|
|
3169
|
+
type: Component,
|
|
3170
|
+
args: [{ selector: 'filter-item-autocomplete', changeDetection: ChangeDetectionStrategy.OnPush, template: "<fs-autocomplete\n [fsFilterFocusTrigger]=\"item\"\n [fetch]=\"fetch\"\n [displayWith]=\"displayWith\"\n [(ngModel)]=\"item.model\"\n [placeholder]=\"label\"\n [fetchOnFocus]=\"item.fetchOnFocus\"\n [showClear]=\"item.showClear\"\n name=\"item.name\">\n <ng-template fsAutocompleteTemplate let-data=\"data\">\n {{data.name}}\n </ng-template>\n</fs-autocomplete>\n" }]
|
|
3171
|
+
}], ctorParameters: function () { return [{ type: i0.KeyValueDiffers }, { type: i0.ChangeDetectorRef }]; } });
|
|
3172
|
+
|
|
3173
|
+
class AutocompletechipsComponent extends BaseItemComponent {
|
|
3174
|
+
constructor(_kvDiffers, _cd) {
|
|
3175
|
+
super(_kvDiffers, _cd);
|
|
3176
|
+
this._kvDiffers = _kvDiffers;
|
|
3177
|
+
this._cd = _cd;
|
|
3178
|
+
this.fetch = (keyword) => {
|
|
3179
|
+
return this.item.valuesFn(keyword, this.item.filter);
|
|
3180
|
+
};
|
|
3181
|
+
}
|
|
3182
|
+
addAutocompleteChipItem(event) {
|
|
3183
|
+
if (event.data && this.item.model.indexOf(event.data.value) === -1) {
|
|
3184
|
+
this.item.model.push(event.data);
|
|
3185
|
+
this.itemChange();
|
|
3186
|
+
}
|
|
3187
|
+
}
|
|
3188
|
+
removeAutocompleteChipItem(event) {
|
|
3189
|
+
remove(this.item.model, { value: event.data.value });
|
|
3190
|
+
this.itemChange();
|
|
3191
|
+
}
|
|
3192
|
+
clearAutocompleteChipItem() {
|
|
3193
|
+
this.item.clear();
|
|
3194
|
+
this.itemChange();
|
|
3195
|
+
}
|
|
3196
|
+
compareItems(item1, item2) {
|
|
3197
|
+
return item1?.value === item2?.value;
|
|
3198
|
+
}
|
|
3199
|
+
}
|
|
3200
|
+
AutocompletechipsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: AutocompletechipsComponent, deps: [{ token: i0.KeyValueDiffers }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
3201
|
+
AutocompletechipsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", 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 [allowText]=\"false\"\n [fetchOnFocus]=\"item.fetchOnFocus\"\n [placeholder]=\"label\"\n [chipImage]=\"item.chipImage\"\n [chipColor]=\"item.chipColor\"\n [chipIconColor]=\"item.chipIcon\"\n [chipBackground]=\"item.chipBackground\"\n [chipIcon]=\"item.chipIcon\"\n [chipClass]=\"item.chipClass\"\n [allowClear]=\"item.showClear\"\n [removable]=\"item.showClear\"\n [compareWith]=\"compareItems\"\n [panelWidth]=\"300\"\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.FsAutocompleteChipsComponent, selector: "fs-autocomplete-chips", inputs: ["fetch", "appearance", "readonly", "size", "placeholder", "chipImage", "chipBackground", "chipColor", "chipIcon", "chipIconColor", "chipClass", "hint", "allowText", "allowObject", "delay", "validateText", "removable", "allowClear", "color", "background", "orderable", "limit", "initOnClick", "fetchOnFocus", "multiple", "confirm", "disabled", "panelWidth", "panelClass", "compareWith"], outputs: ["selected", "removed", "reordered", "clear"] }], directives: [{ type: FocusToItemDirective, selector: "[fsFilterFocusTrigger]", inputs: ["fsFilterFocusTrigger", "focusTargetType"] }, { type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i7.FsFormNoFsValidatorsDirective, selector: "[ngModel]:not([required]):not([fsFormRequired]):not([fsFormCompare]):not([fsFormDateRange]):not([fsFormEmail]):not([fsFormEmails]):not([fsFormFunction]):not([fsFormGreater]):not([fsFormInteger]):not([fsFormLesser]):not([fsFormMax]):not([fsFormMaxLength]):not([fsFormMin]):not([fsFormMinLength]):not([fsFormNumeric]):not([fsFormPattern]):not([fsFormPhone]):not([fsFormUrl]):not([validate])" }, { type: i5.FsAutocompleteObjectDirective, selector: "[fsAutocompleteObject],[fsAutocompleteChipsTemplate]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
3202
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: AutocompletechipsComponent, decorators: [{
|
|
3203
|
+
type: Component,
|
|
3204
|
+
args: [{ selector: 'filter-item-autocompletechips', changeDetection: ChangeDetectionStrategy.OnPush, 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 [allowText]=\"false\"\n [fetchOnFocus]=\"item.fetchOnFocus\"\n [placeholder]=\"label\"\n [chipImage]=\"item.chipImage\"\n [chipColor]=\"item.chipColor\"\n [chipIconColor]=\"item.chipIcon\"\n [chipBackground]=\"item.chipBackground\"\n [chipIcon]=\"item.chipIcon\"\n [chipClass]=\"item.chipClass\"\n [allowClear]=\"item.showClear\"\n [removable]=\"item.showClear\"\n [compareWith]=\"compareItems\"\n [panelWidth]=\"300\"\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" }]
|
|
3205
|
+
}], ctorParameters: function () { return [{ type: i0.KeyValueDiffers }, { type: i0.ChangeDetectorRef }]; } });
|
|
3206
|
+
|
|
3207
|
+
class DateComponent extends BaseItemComponent {
|
|
3208
|
+
constructor(_kvDiffers, _cd) {
|
|
3209
|
+
super(_kvDiffers, _cd);
|
|
3210
|
+
this._kvDiffers = _kvDiffers;
|
|
3211
|
+
this._cd = _cd;
|
|
3212
|
+
this.viewType = PickerViewType.Date;
|
|
3213
|
+
this.itemDateMode = ItemDateMode;
|
|
3214
|
+
this.showYear = true;
|
|
3215
|
+
this.showMonth = true;
|
|
3216
|
+
this.showDay = true;
|
|
3217
|
+
}
|
|
3218
|
+
ngOnInit() {
|
|
3219
|
+
if (this.item.type === ItemType.DateTime) {
|
|
3220
|
+
this.viewType = PickerViewType.DateTime;
|
|
3221
|
+
}
|
|
3222
|
+
else {
|
|
3223
|
+
this.viewType = PickerViewType.Date;
|
|
3224
|
+
}
|
|
3225
|
+
if (this.item.mode === ItemDateMode.ScrollMonthYear) {
|
|
3226
|
+
this.showDay = false;
|
|
3227
|
+
}
|
|
3228
|
+
}
|
|
3229
|
+
}
|
|
3230
|
+
DateComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: DateComponent, deps: [{ token: i0.KeyValueDiffers }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
3231
|
+
DateComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", 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.showClear\"\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.showClear\"\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", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { type: i3$4.FsDatePickerComponent, selector: "[fsDatePicker]", inputs: ["minYear", "maxYear", "minDate", "maxDate", "startOfDay", "view", "format", "minutes", "weekStartsOn"], outputs: ["change"] }, { type: i3$4.FsDateScrollPickerComponent, selector: "[fsDateScrollPicker]", inputs: ["minYear", "maxYear", "minDate", "maxDate", "showMonth", "showYear", "showDay"] }], directives: [{ type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1$3.MatLabel, selector: "mat-label" }, { type: i3$2.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { type: i4.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: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i7.FsFormNoFsValidatorsDirective, selector: "[ngModel]:not([required]):not([fsFormRequired]):not([fsFormCompare]):not([fsFormDateRange]):not([fsFormEmail]):not([fsFormEmails]):not([fsFormFunction]):not([fsFormGreater]):not([fsFormInteger]):not([fsFormLesser]):not([fsFormMax]):not([fsFormMaxLength]):not([fsFormMin]):not([fsFormMinLength]):not([fsFormNumeric]):not([fsFormPattern]):not([fsFormPhone]):not([fsFormUrl]):not([validate])" }, { type: i1$3.MatPlaceholder, selector: "mat-placeholder" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
3232
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: DateComponent, decorators: [{
|
|
3233
|
+
type: Component,
|
|
3234
|
+
args: [{ selector: 'filter-item-date', changeDetection: ChangeDetectionStrategy.OnPush, 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.showClear\"\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.showClear\"\n [name]=\"item.name\">\n <mat-placeholder *ngIf=\"inline\">{{ item.label }}</mat-placeholder>\n </mat-form-field>\n</ng-template>\n" }]
|
|
3235
|
+
}], ctorParameters: function () { return [{ type: i0.KeyValueDiffers }, { type: i0.ChangeDetectorRef }]; } });
|
|
3236
|
+
|
|
3237
|
+
class DateRangeComponent extends BaseItemComponent {
|
|
3238
|
+
constructor(_kvDiffers, _cd) {
|
|
3239
|
+
super(_kvDiffers, _cd);
|
|
3240
|
+
this._kvDiffers = _kvDiffers;
|
|
3241
|
+
this._cd = _cd;
|
|
3242
|
+
this.viewType = PickerViewType.Date;
|
|
3243
|
+
}
|
|
3244
|
+
ngOnInit() {
|
|
3245
|
+
if (this.item.type === ItemType.DateTimeRange) {
|
|
3246
|
+
this.viewType = PickerViewType.DateTime;
|
|
3247
|
+
}
|
|
3248
|
+
else {
|
|
3249
|
+
this.viewType = PickerViewType.Date;
|
|
3250
|
+
}
|
|
3251
|
+
}
|
|
3252
|
+
}
|
|
3253
|
+
DateRangeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: DateRangeComponent, deps: [{ token: i0.KeyValueDiffers }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
3254
|
+
DateRangeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", 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.showClear\"\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.showClear\"\n [view]=\"viewType\"\n name=\"date_to\">\n</mat-form-field>\n", components: [{ type: i1$3.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { type: i3$4.DateRangePickerFromComponent, selector: "[fsDateRangeFrom],[fsDateRangeFromPicker]", inputs: ["fsDateRangeFrom", "fsDateRangeFromPicker"] }, { type: i3$4.DateRangePickerToComponent, selector: "[fsDateRangeTo],[fsDateRangeToPicker]", inputs: ["fsDateRangeTo", "fsDateRangeToPicker"] }], directives: [{ type: i1$3.MatLabel, selector: "mat-label" }, { type: i3$2.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { type: i4.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: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i7.FsFormNoFsValidatorsDirective, selector: "[ngModel]:not([required]):not([fsFormRequired]):not([fsFormCompare]):not([fsFormDateRange]):not([fsFormEmail]):not([fsFormEmails]):not([fsFormFunction]):not([fsFormGreater]):not([fsFormInteger]):not([fsFormLesser]):not([fsFormMax]):not([fsFormMaxLength]):not([fsFormMin]):not([fsFormMinLength]):not([fsFormNumeric]):not([fsFormPattern]):not([fsFormPhone]):not([fsFormUrl]):not([validate])" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
3255
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: DateRangeComponent, decorators: [{
|
|
3256
|
+
type: Component,
|
|
3257
|
+
args: [{ selector: 'filter-item-date-range', changeDetection: ChangeDetectionStrategy.OnPush, 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.showClear\"\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.showClear\"\n [view]=\"viewType\"\n name=\"date_to\">\n</mat-form-field>\n" }]
|
|
3258
|
+
}], ctorParameters: function () { return [{ type: i0.KeyValueDiffers }, { type: i0.ChangeDetectorRef }]; } });
|
|
3259
|
+
|
|
3260
|
+
class WeekComponent extends BaseItemComponent {
|
|
3261
|
+
constructor(_kvDiffers, _cd) {
|
|
3262
|
+
super(_kvDiffers, _cd);
|
|
3263
|
+
this._kvDiffers = _kvDiffers;
|
|
3264
|
+
this._cd = _cd;
|
|
3265
|
+
}
|
|
3266
|
+
ngOnInit() { }
|
|
3267
|
+
}
|
|
3268
|
+
WeekComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: WeekComponent, deps: [{ token: i0.KeyValueDiffers }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
3269
|
+
WeekComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: WeekComponent, selector: "filter-item-week", usesInheritance: true, ngImport: i0, template: "<mat-form-field>\n <mat-label>{{item.label}}</mat-label>\n <input matInput\n fsDateWeekPicker\n [fsFilterFocusTrigger]=\"item\"\n [(ngModel)]=\"item.model\"\n [seedDate]=\"item.seedDate\"\n [clear]=\"item.showClear\"\n [name]=\"item.name\">\n <mat-placeholder *ngIf=\"inline\">{{ item.label }}</mat-placeholder>\n</mat-form-field>\n", components: [{ type: i1$3.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { type: i3$4.FsDateWeekPickerComponent, selector: "[fsDateWeekPicker]", inputs: ["minYear", "maxYear", "minDate", "maxDate", "seedDate", "period", "view", "weekStartsOn"], outputs: ["change"] }], directives: [{ type: i1$3.MatLabel, selector: "mat-label" }, { type: i3$2.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { type: i4.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: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i7.FsFormNoFsValidatorsDirective, selector: "[ngModel]:not([required]):not([fsFormRequired]):not([fsFormCompare]):not([fsFormDateRange]):not([fsFormEmail]):not([fsFormEmails]):not([fsFormFunction]):not([fsFormGreater]):not([fsFormInteger]):not([fsFormLesser]):not([fsFormMax]):not([fsFormMaxLength]):not([fsFormMin]):not([fsFormMinLength]):not([fsFormNumeric]):not([fsFormPattern]):not([fsFormPhone]):not([fsFormUrl]):not([validate])" }, { type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1$3.MatPlaceholder, selector: "mat-placeholder" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
3270
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: WeekComponent, decorators: [{
|
|
3271
|
+
type: Component,
|
|
3272
|
+
args: [{ selector: 'filter-item-week', changeDetection: ChangeDetectionStrategy.OnPush, template: "<mat-form-field>\n <mat-label>{{item.label}}</mat-label>\n <input matInput\n fsDateWeekPicker\n [fsFilterFocusTrigger]=\"item\"\n [(ngModel)]=\"item.model\"\n [seedDate]=\"item.seedDate\"\n [clear]=\"item.showClear\"\n [name]=\"item.name\">\n <mat-placeholder *ngIf=\"inline\">{{ item.label }}</mat-placeholder>\n</mat-form-field>\n" }]
|
|
3273
|
+
}], ctorParameters: function () { return [{ type: i0.KeyValueDiffers }, { type: i0.ChangeDetectorRef }]; } });
|
|
3274
|
+
|
|
3275
|
+
class CheckboxComponent extends BaseItemComponent {
|
|
3276
|
+
constructor(_kvDiffers, _cd) {
|
|
3277
|
+
super(_kvDiffers, _cd);
|
|
3278
|
+
this._kvDiffers = _kvDiffers;
|
|
3279
|
+
this._cd = _cd;
|
|
3280
|
+
}
|
|
3281
|
+
}
|
|
3282
|
+
CheckboxComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: CheckboxComponent, deps: [{ token: i0.KeyValueDiffers }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
3283
|
+
CheckboxComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", 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$3.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex", "aria-label", "aria-labelledby", "aria-describedby", "id", "required", "labelPosition", "name", "value", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }], directives: [{ type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i7.FsFormNoFsValidatorsDirective, selector: "[ngModel]:not([required]):not([fsFormRequired]):not([fsFormCompare]):not([fsFormDateRange]):not([fsFormEmail]):not([fsFormEmails]):not([fsFormFunction]):not([fsFormGreater]):not([fsFormInteger]):not([fsFormLesser]):not([fsFormMax]):not([fsFormMaxLength]):not([fsFormMin]):not([fsFormMinLength]):not([fsFormNumeric]):not([fsFormPattern]):not([fsFormPhone]):not([fsFormUrl]):not([validate])" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
3284
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: CheckboxComponent, decorators: [{
|
|
3285
|
+
type: Component,
|
|
3286
|
+
args: [{ selector: 'filter-item-checkbox', changeDetection: ChangeDetectionStrategy.OnPush, 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"] }]
|
|
3287
|
+
}], ctorParameters: function () { return [{ type: i0.KeyValueDiffers }, { type: i0.ChangeDetectorRef }]; } });
|
|
3288
|
+
|
|
3289
|
+
class FilterItemComponent {
|
|
3290
|
+
constructor(_cdRef) {
|
|
3291
|
+
this._cdRef = _cdRef;
|
|
3292
|
+
this.itemType = ItemType;
|
|
3293
|
+
this._destroy$ = new Subject();
|
|
3294
|
+
}
|
|
3295
|
+
get textItem() {
|
|
3296
|
+
return this.item;
|
|
3297
|
+
}
|
|
3298
|
+
get chipsItem() {
|
|
3299
|
+
return this.item;
|
|
3300
|
+
}
|
|
3301
|
+
get baseSelectItem() {
|
|
3302
|
+
return this.item;
|
|
3303
|
+
}
|
|
3304
|
+
get rangeItem() {
|
|
3305
|
+
return this.item;
|
|
3306
|
+
}
|
|
3307
|
+
get autocompleteItem() {
|
|
3308
|
+
return this.item;
|
|
3309
|
+
}
|
|
3310
|
+
get autocompleteChipsItem() {
|
|
3311
|
+
return this.item;
|
|
3312
|
+
}
|
|
3313
|
+
get dateItem() {
|
|
3314
|
+
return this.item;
|
|
3315
|
+
}
|
|
3316
|
+
get dateRangeItem() {
|
|
3317
|
+
return this.item;
|
|
3318
|
+
}
|
|
3319
|
+
get dateTimeItem() {
|
|
3320
|
+
return this.item;
|
|
3321
|
+
}
|
|
3322
|
+
get dateTimeRangeItem() {
|
|
3323
|
+
return this.item;
|
|
3324
|
+
}
|
|
3325
|
+
get weekItem() {
|
|
3326
|
+
return this.item;
|
|
3327
|
+
}
|
|
3328
|
+
get checkboxItem() {
|
|
3329
|
+
return this.item;
|
|
3330
|
+
}
|
|
3331
|
+
ngOnInit() {
|
|
3332
|
+
this.item.value$
|
|
3333
|
+
.pipe(takeUntil(this._destroy$))
|
|
3334
|
+
.subscribe(() => {
|
|
3335
|
+
this._cdRef.markForCheck();
|
|
3336
|
+
});
|
|
3337
|
+
}
|
|
3338
|
+
ngOnDestroy() {
|
|
3339
|
+
this._destroy$.next();
|
|
3340
|
+
this._destroy$.complete();
|
|
3341
|
+
}
|
|
3342
|
+
}
|
|
3343
|
+
FilterItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FilterItemComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
3344
|
+
FilterItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", 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 \n class=\"interface\"\n *ngSwitchCase=\"itemType.Text\"\n [item]=\"textItem\">\n </filter-item-text>\n\n <filter-item-select \n class=\"interface\"\n *ngSwitchCase=\"itemType.Select\"\n [item]=\"baseSelectItem\">\n </filter-item-select>\n\n <filter-item-chips \n class=\"interface\"\n *ngSwitchCase=\"itemType.Chips\"\n [item]=\"chipsItem\">\n </filter-item-chips>\n\n <filter-item-range \n class=\"interface interface-range\"\n *ngSwitchCase=\"itemType.Range\"\n [item]=\"rangeItem\">\n </filter-item-range>\n\n <filter-item-autocomplete \n class=\"interface\"\n *ngSwitchCase=\"itemType.AutoComplete\"\n [item]=\"autocompleteItem\">\n </filter-item-autocomplete>\n\n <filter-item-autocompletechips \n class=\"interface\"\n *ngSwitchCase=\"itemType.AutoCompleteChips\"\n [item]=\"autocompleteChipsItem\">\n </filter-item-autocompletechips>\n\n <filter-item-date \n class=\"interface interface-date\"\n *ngSwitchCase=\"itemType.Date\"\n [item]=\"dateItem\">\n </filter-item-date>\n\n <filter-item-date \n class=\"interface interface-date\"\n *ngSwitchCase=\"itemType.DateTime\"\n [item]=\"dateTimeItem\">\n </filter-item-date>\n\n <filter-item-date-range \n class=\"interface interface-date\"\n *ngSwitchCase=\"itemType.DateRange\"\n [item]=\"dateRangeItem\">\n </filter-item-date-range>\n\n <filter-item-date-range \n class=\"interface interface-date\"\n *ngSwitchCase=\"itemType.DateTimeRange\"\n [item]=\"dateTimeRangeItem\">\n </filter-item-date-range>\n\n <filter-item-week \n class=\"interface\"\n *ngSwitchCase=\"itemType.Week\"\n [item]=\"weekItem\">\n </filter-item-week>\n\n <filter-item-checkbox \n class=\"interface interface-checkbox\"\n *ngSwitchCase=\"itemType.Checkbox\"\n [item]=\"checkboxItem\">\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: WeekComponent, selector: "filter-item-week" }, { 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 });
|
|
3345
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FilterItemComponent, decorators: [{
|
|
3346
|
+
type: Component,
|
|
3347
|
+
args: [{ selector: 'filter-item', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"filter filter-{{ item.type }}\">\n\n <ng-container [ngSwitch]=\"item.type\">\n <filter-item-text \n class=\"interface\"\n *ngSwitchCase=\"itemType.Text\"\n [item]=\"textItem\">\n </filter-item-text>\n\n <filter-item-select \n class=\"interface\"\n *ngSwitchCase=\"itemType.Select\"\n [item]=\"baseSelectItem\">\n </filter-item-select>\n\n <filter-item-chips \n class=\"interface\"\n *ngSwitchCase=\"itemType.Chips\"\n [item]=\"chipsItem\">\n </filter-item-chips>\n\n <filter-item-range \n class=\"interface interface-range\"\n *ngSwitchCase=\"itemType.Range\"\n [item]=\"rangeItem\">\n </filter-item-range>\n\n <filter-item-autocomplete \n class=\"interface\"\n *ngSwitchCase=\"itemType.AutoComplete\"\n [item]=\"autocompleteItem\">\n </filter-item-autocomplete>\n\n <filter-item-autocompletechips \n class=\"interface\"\n *ngSwitchCase=\"itemType.AutoCompleteChips\"\n [item]=\"autocompleteChipsItem\">\n </filter-item-autocompletechips>\n\n <filter-item-date \n class=\"interface interface-date\"\n *ngSwitchCase=\"itemType.Date\"\n [item]=\"dateItem\">\n </filter-item-date>\n\n <filter-item-date \n class=\"interface interface-date\"\n *ngSwitchCase=\"itemType.DateTime\"\n [item]=\"dateTimeItem\">\n </filter-item-date>\n\n <filter-item-date-range \n class=\"interface interface-date\"\n *ngSwitchCase=\"itemType.DateRange\"\n [item]=\"dateRangeItem\">\n </filter-item-date-range>\n\n <filter-item-date-range \n class=\"interface interface-date\"\n *ngSwitchCase=\"itemType.DateTimeRange\"\n [item]=\"dateTimeRangeItem\">\n </filter-item-date-range>\n\n <filter-item-week \n class=\"interface\"\n *ngSwitchCase=\"itemType.Week\"\n [item]=\"weekItem\">\n </filter-item-week>\n\n <filter-item-checkbox \n class=\"interface interface-checkbox\"\n *ngSwitchCase=\"itemType.Checkbox\"\n [item]=\"checkboxItem\">\n </filter-item-checkbox>\n </ng-container>\n\n</div>\n" }]
|
|
3348
|
+
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { item: [{
|
|
3349
|
+
type: Input
|
|
3350
|
+
}] } });
|
|
3351
|
+
|
|
3352
|
+
class FilterDrawerComponent {
|
|
3353
|
+
constructor(_overlayRef, _data, externalParams, _cd, _itemsStore) {
|
|
3354
|
+
this._overlayRef = _overlayRef;
|
|
3355
|
+
this._data = _data;
|
|
3356
|
+
this.externalParams = externalParams;
|
|
3357
|
+
this._cd = _cd;
|
|
3358
|
+
this._itemsStore = _itemsStore;
|
|
3359
|
+
this.inline = false;
|
|
3360
|
+
this.windowDesktop = false;
|
|
3361
|
+
this._itemsStore.prepareItems();
|
|
3362
|
+
this._clear = this._data.clear;
|
|
3363
|
+
this._done = this._data.done;
|
|
3364
|
+
this.updateWindowWidth();
|
|
3365
|
+
}
|
|
3366
|
+
updateWindowWidth() {
|
|
3367
|
+
this.windowDesktop = window.innerWidth > 1200;
|
|
3368
|
+
}
|
|
3369
|
+
get items$() {
|
|
3370
|
+
return this._itemsStore.visibleItems$;
|
|
3371
|
+
}
|
|
3372
|
+
get sortItem() {
|
|
3373
|
+
return this._itemsStore.sortByItem;
|
|
3374
|
+
}
|
|
3375
|
+
get sortDirectionItem() {
|
|
3376
|
+
return this._itemsStore.sortDirectionItem;
|
|
3377
|
+
}
|
|
3378
|
+
clear() {
|
|
3379
|
+
this._clear();
|
|
3380
|
+
// this.overlayRef.detach();
|
|
3381
|
+
}
|
|
3382
|
+
done() {
|
|
3383
|
+
this._done();
|
|
3384
|
+
this._overlayRef.detach();
|
|
3385
|
+
}
|
|
3386
|
+
backdropClick() {
|
|
3387
|
+
this.done();
|
|
3388
|
+
}
|
|
3389
|
+
}
|
|
3390
|
+
FilterDrawerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FilterDrawerComponent, deps: [{ token: FILTER_DRAWER_OVERLAY }, { token: FILTER_DRAWER_DATA }, { token: ExternalParamsController }, { token: i0.ChangeDetectorRef }, { token: FsFilterItemsStore }], target: i0.ɵɵFactoryTarget.Component });
|
|
3391
|
+
FilterDrawerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", 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 \n *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 \n class=\"filter-group sort\"\n [item]=\"sortItem\">\n </filter-item>\n <filter-item \n 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 \n 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%;padding-top:env(safe-area-inset-top)}.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,.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;inset:0;z-index:900;outline:none}\n"], components: [{ type: i2$1.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$1.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 });
|
|
3392
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FilterDrawerComponent, decorators: [{
|
|
3393
|
+
type: Component,
|
|
3394
|
+
args: [{ changeDetection: ChangeDetectionStrategy.OnPush, 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 \n *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 \n class=\"filter-group sort\"\n [item]=\"sortItem\">\n </filter-item>\n <filter-item \n 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 \n 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%;padding-top:env(safe-area-inset-top)}.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,.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;inset:0;z-index:900;outline:none}\n"] }]
|
|
3395
|
+
}], ctorParameters: function () { return [{ type: i1$6.OverlayRef, decorators: [{
|
|
3396
|
+
type: Inject,
|
|
3397
|
+
args: [FILTER_DRAWER_OVERLAY]
|
|
3398
|
+
}] }, { type: undefined, decorators: [{
|
|
3399
|
+
type: Inject,
|
|
3400
|
+
args: [FILTER_DRAWER_DATA]
|
|
3401
|
+
}] }, { type: ExternalParamsController }, { type: i0.ChangeDetectorRef }, { type: FsFilterItemsStore }]; }, propDecorators: { inline: [{
|
|
3402
|
+
type: Input
|
|
3403
|
+
}], updateWindowWidth: [{
|
|
3404
|
+
type: HostListener,
|
|
3405
|
+
args: ['window:resize']
|
|
3406
|
+
}] } });
|
|
3407
|
+
|
|
3408
|
+
class ActionsController {
|
|
3409
|
+
constructor(_breakpointObserver) {
|
|
3410
|
+
this._breakpointObserver = _breakpointObserver;
|
|
3411
|
+
this._visible$ = new BehaviorSubject(false);
|
|
3412
|
+
this._actions$ = new BehaviorSubject([]);
|
|
3413
|
+
this._menuActions$ = new BehaviorSubject([]);
|
|
3414
|
+
this._destroy$ = new Subject();
|
|
3415
|
+
this._mobileMedia = '(max-width: 799px)';
|
|
3416
|
+
this._allActions = [];
|
|
3417
|
+
this._listenMobileMedia();
|
|
3418
|
+
}
|
|
3419
|
+
get menuActions() {
|
|
3420
|
+
return this._menuActions$.value;
|
|
3421
|
+
}
|
|
3422
|
+
get actions() {
|
|
3423
|
+
return this._actions$.value;
|
|
3424
|
+
}
|
|
3425
|
+
get actions$() {
|
|
3426
|
+
return this._actions$.asObservable();
|
|
3427
|
+
}
|
|
3428
|
+
get menuActions$() {
|
|
3429
|
+
return this._menuActions$.asObservable();
|
|
3430
|
+
}
|
|
3431
|
+
get visible$() {
|
|
3432
|
+
return this._visible$.asObservable();
|
|
3433
|
+
}
|
|
3434
|
+
get mobileMode() {
|
|
3435
|
+
return this._breakpointObserver.isMatched(this._mobileMedia);
|
|
3436
|
+
}
|
|
3437
|
+
ngOnDestroy() {
|
|
3438
|
+
this._destroy$.next();
|
|
3439
|
+
this._destroy$.complete();
|
|
3440
|
+
}
|
|
3441
|
+
setConfig(config) {
|
|
3442
|
+
this._config = config;
|
|
3443
|
+
this.initActions(config.actions);
|
|
3444
|
+
}
|
|
3445
|
+
initActions(rawActions) {
|
|
3446
|
+
if (!rawActions || !Array.isArray(rawActions)) {
|
|
3447
|
+
return;
|
|
3448
|
+
}
|
|
3449
|
+
this.show();
|
|
3450
|
+
this._allActions = rawActions
|
|
3451
|
+
.map((action) => new Action(this._config, action));
|
|
3452
|
+
if (this._reorderAction) {
|
|
3453
|
+
this._allActions.unshift(this._reorderAction);
|
|
3454
|
+
}
|
|
3455
|
+
this._classifyActions();
|
|
3456
|
+
}
|
|
3457
|
+
show() {
|
|
3458
|
+
this._visible$.next(true);
|
|
3459
|
+
}
|
|
3460
|
+
hide() {
|
|
3461
|
+
this._visible$.next(false);
|
|
3462
|
+
}
|
|
3463
|
+
addReorderAction(action) {
|
|
3464
|
+
this._allActions.unshift(action);
|
|
3465
|
+
action.isReorderAction = true;
|
|
3466
|
+
this._classifyAction(action);
|
|
3467
|
+
this._reorderAction = action;
|
|
3468
|
+
}
|
|
3469
|
+
clearActions() {
|
|
3470
|
+
this._allActions = [];
|
|
3471
|
+
this._setActions([]);
|
|
3472
|
+
this._setKebabActions([]);
|
|
3473
|
+
}
|
|
3474
|
+
updateActionsVisibility() {
|
|
3475
|
+
this._allActions.forEach((action) => action.updateVisibility());
|
|
3476
|
+
this._classifyActions();
|
|
3477
|
+
}
|
|
3478
|
+
updateDisabledState() {
|
|
3479
|
+
this.actions.forEach((action) => action.updateDisabledState());
|
|
3480
|
+
}
|
|
3481
|
+
_setKebabActions(actions) {
|
|
3482
|
+
this._menuActions$.next(actions);
|
|
3483
|
+
}
|
|
3484
|
+
_setActions(actions) {
|
|
3485
|
+
this._actions$.next(actions);
|
|
3486
|
+
}
|
|
3487
|
+
_classifyActions() {
|
|
3488
|
+
const kebabActions = [];
|
|
3489
|
+
const actions = [];
|
|
3490
|
+
const mobileMode = this.mobileMode;
|
|
3491
|
+
this._allActions
|
|
3492
|
+
.filter((action) => {
|
|
3493
|
+
return action.visible;
|
|
3494
|
+
})
|
|
3495
|
+
.forEach((action) => {
|
|
3496
|
+
if (action.menu !== false && (action.menu || mobileMode)) {
|
|
3497
|
+
kebabActions.push(action);
|
|
3498
|
+
}
|
|
3499
|
+
else {
|
|
3500
|
+
actions.push(action);
|
|
3501
|
+
}
|
|
3502
|
+
});
|
|
3503
|
+
this._setKebabActions(kebabActions);
|
|
3504
|
+
this._setActions(actions);
|
|
3505
|
+
}
|
|
3506
|
+
_classifyAction(action) {
|
|
3507
|
+
if (action.menu) {
|
|
3508
|
+
this._setKebabActions([...this.menuActions, action]);
|
|
3509
|
+
}
|
|
3510
|
+
else {
|
|
3511
|
+
this._setActions([...this.actions, action]);
|
|
3512
|
+
}
|
|
3513
|
+
}
|
|
3514
|
+
_listenMobileMedia() {
|
|
3515
|
+
this._breakpointObserver.observe(this._mobileMedia)
|
|
3516
|
+
.pipe(skip(1), takeUntil(this._destroy$))
|
|
3517
|
+
.subscribe(() => {
|
|
3518
|
+
this._classifyActions();
|
|
3519
|
+
});
|
|
3520
|
+
}
|
|
3521
|
+
}
|
|
3522
|
+
ActionsController.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: ActionsController, deps: [{ token: i1$7.BreakpointObserver }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
3523
|
+
ActionsController.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: ActionsController });
|
|
3524
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: ActionsController, decorators: [{
|
|
3525
|
+
type: Injectable
|
|
3526
|
+
}], ctorParameters: function () { return [{ type: i1$7.BreakpointObserver }]; } });
|
|
3527
|
+
|
|
3528
|
+
const FS_FILTER_META = new InjectionToken('fs.filter.meta', {
|
|
3529
|
+
providedIn: 'root',
|
|
3530
|
+
factory: () => {
|
|
3531
|
+
return {
|
|
3532
|
+
openedFilters: 0,
|
|
3533
|
+
};
|
|
3534
|
+
}
|
|
3535
|
+
});
|
|
3536
|
+
|
|
3537
|
+
class FsFilterOverlayService {
|
|
3538
|
+
constructor(_filterMeta, _injector, _overlay, _focusController) {
|
|
3539
|
+
this._filterMeta = _filterMeta;
|
|
3540
|
+
this._injector = _injector;
|
|
3541
|
+
this._overlay = _overlay;
|
|
3542
|
+
this._focusController = _focusController;
|
|
3543
|
+
this.detach$ = new Subject();
|
|
3544
|
+
this.attach$ = new Subject();
|
|
3545
|
+
this._destroy$ = new Subject();
|
|
3546
|
+
this._openWhenChipClicked();
|
|
3547
|
+
}
|
|
3548
|
+
get isOpened() {
|
|
3549
|
+
return !!this._overlayRef;
|
|
3550
|
+
}
|
|
3551
|
+
setClearFn(fn) {
|
|
3552
|
+
this._clearFn = fn;
|
|
3553
|
+
}
|
|
3554
|
+
setDoneFn(fn) {
|
|
3555
|
+
this._doneFn = fn;
|
|
3556
|
+
}
|
|
3557
|
+
close() {
|
|
3558
|
+
if (this._overlayRef) {
|
|
3559
|
+
this._overlayRef.detach();
|
|
3560
|
+
this._overlayRef = null;
|
|
3561
|
+
this._removeFilterClass();
|
|
3562
|
+
}
|
|
3563
|
+
}
|
|
3564
|
+
open() {
|
|
3565
|
+
this._overlayRef = this._createOverlay();
|
|
3566
|
+
this._overlayRef.backdropClick()
|
|
3567
|
+
.pipe(takeUntil(this._destroy$))
|
|
3568
|
+
.subscribe(() => {
|
|
3569
|
+
this._overlayRef.detach();
|
|
3570
|
+
});
|
|
3571
|
+
this._overlayRef.detachments()
|
|
3572
|
+
.pipe(takeUntil(this._destroy$))
|
|
3573
|
+
.subscribe(() => {
|
|
3574
|
+
this.detach$.next();
|
|
3575
|
+
});
|
|
3576
|
+
this._overlayRef.attachments()
|
|
3577
|
+
.pipe(takeUntil(this._destroy$))
|
|
3578
|
+
.subscribe(() => {
|
|
3579
|
+
this.attach$.next();
|
|
3580
|
+
});
|
|
3581
|
+
this._addFilterClass();
|
|
3582
|
+
return this._openPortalPreview();
|
|
3583
|
+
}
|
|
3584
|
+
ngOnDestroy() {
|
|
3585
|
+
this._destroy$.next();
|
|
3586
|
+
this._destroy$.complete();
|
|
3587
|
+
}
|
|
3588
|
+
_createOverlay() {
|
|
3589
|
+
const overlayConfig = new OverlayConfig({
|
|
3590
|
+
hasBackdrop: true,
|
|
3591
|
+
backdropClass: 'fs-filter-backdrop',
|
|
3592
|
+
});
|
|
3593
|
+
return this._overlay.create(overlayConfig);
|
|
3594
|
+
}
|
|
3595
|
+
_openPortalPreview() {
|
|
3596
|
+
const data = {
|
|
3597
|
+
done: this._doneFn,
|
|
3598
|
+
clear: this._clearFn,
|
|
3599
|
+
};
|
|
3600
|
+
const injector = this._createInjector(this._injector, data, this._overlayRef);
|
|
3601
|
+
const containerPortal = new ComponentPortal(FilterDrawerComponent, undefined, injector);
|
|
3602
|
+
const containerRef = this._overlayRef.attach(containerPortal);
|
|
3603
|
+
return containerRef.instance;
|
|
3604
|
+
}
|
|
3605
|
+
_createInjector(parentInjector, data, overlayRef) {
|
|
3606
|
+
const injectionTokens = new WeakMap([
|
|
3607
|
+
[FILTER_DRAWER_DATA, data],
|
|
3608
|
+
[FILTER_DRAWER_OVERLAY, overlayRef],
|
|
3609
|
+
]);
|
|
3610
|
+
return new PortalInjector(parentInjector, injectionTokens);
|
|
3611
|
+
}
|
|
3612
|
+
_removeFilterClass() {
|
|
3613
|
+
this._filterMeta.openedFilters--;
|
|
3614
|
+
if (this._filterMeta.openedFilters === 0) {
|
|
3615
|
+
window.document.body.classList.remove('fs-filter-open');
|
|
3616
|
+
}
|
|
3617
|
+
}
|
|
3618
|
+
_addFilterClass() {
|
|
3619
|
+
this._filterMeta.openedFilters++;
|
|
3620
|
+
if (this._filterMeta.openedFilters === 1) {
|
|
3621
|
+
window.document.body.classList.add('fs-filter-open');
|
|
3622
|
+
}
|
|
3623
|
+
}
|
|
3624
|
+
_openWhenChipClicked() {
|
|
3625
|
+
this._focusController.focusOn$
|
|
3626
|
+
.pipe(filter$1((v) => !!v), takeUntil(this._destroy$))
|
|
3627
|
+
.subscribe(() => {
|
|
3628
|
+
if (!this.isOpened) {
|
|
3629
|
+
this.open();
|
|
3630
|
+
}
|
|
3631
|
+
});
|
|
3632
|
+
}
|
|
3633
|
+
}
|
|
3634
|
+
FsFilterOverlayService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsFilterOverlayService, deps: [{ token: FS_FILTER_META }, { token: i0.Injector }, { token: i1$6.Overlay }, { token: FocusControllerService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
3635
|
+
FsFilterOverlayService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsFilterOverlayService });
|
|
3636
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsFilterOverlayService, decorators: [{
|
|
3637
|
+
type: Injectable
|
|
3638
|
+
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
3639
|
+
type: Inject,
|
|
3640
|
+
args: [FS_FILTER_META]
|
|
3641
|
+
}] }, { type: i0.Injector }, { type: i1$6.Overlay }, { type: FocusControllerService }]; } });
|
|
3642
|
+
|
|
3643
|
+
class FilterStatusBarDirective {
|
|
3644
|
+
constructor(templateRef) {
|
|
3645
|
+
this.templateRef = templateRef;
|
|
3646
|
+
}
|
|
3647
|
+
}
|
|
3648
|
+
FilterStatusBarDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FilterStatusBarDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
3649
|
+
FilterStatusBarDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.4.0", type: FilterStatusBarDirective, selector: "[fsFilterStatusBar]", ngImport: i0 });
|
|
3650
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FilterStatusBarDirective, decorators: [{
|
|
3651
|
+
type: Directive,
|
|
3652
|
+
args: [{
|
|
3653
|
+
selector: '[fsFilterStatusBar]',
|
|
3654
|
+
}]
|
|
3655
|
+
}], ctorParameters: function () { return [{ type: i0.TemplateRef }]; } });
|
|
3656
|
+
|
|
3657
|
+
const FS_FILTER_CONFIG = new InjectionToken('fs.filter-config');
|
|
3658
|
+
|
|
3659
|
+
class FilterComponent {
|
|
3660
|
+
constructor(_defaultConfig, _filterOverlay, _zone, _externalParams, _filterItems, _actions) {
|
|
3661
|
+
this._defaultConfig = _defaultConfig;
|
|
3662
|
+
this._filterOverlay = _filterOverlay;
|
|
3663
|
+
this._zone = _zone;
|
|
3664
|
+
this._externalParams = _externalParams;
|
|
3665
|
+
this._filterItems = _filterItems;
|
|
3666
|
+
this._actions = _actions;
|
|
3667
|
+
this.showSortBy = true;
|
|
3668
|
+
this.showFilterInput = true;
|
|
3669
|
+
this.closed = new EventEmitter();
|
|
3670
|
+
this.opened = new EventEmitter();
|
|
3671
|
+
this.ready = new EventEmitter();
|
|
3672
|
+
this.showFilterMenu = false;
|
|
3673
|
+
this.windowDesktop = false;
|
|
3674
|
+
this.fsFilterClass = true;
|
|
3675
|
+
this.searchPlaceholder = 'Search';
|
|
3676
|
+
this.keyword = '';
|
|
3677
|
+
this._config = null;
|
|
3678
|
+
this._filtersBtnVisible$ = new BehaviorSubject(true);
|
|
3679
|
+
this._keywordVisible$ = new BehaviorSubject(true);
|
|
3680
|
+
this._hasFilterChips$ = new BehaviorSubject(false);
|
|
3681
|
+
this._keyword$ = new Subject();
|
|
3682
|
+
this._destroy$ = new Subject();
|
|
3683
|
+
this._filterItems.filter = this;
|
|
3684
|
+
this._listenWhenFilterReady();
|
|
3685
|
+
this._updateWindowWidth();
|
|
3686
|
+
this._filterOverlay.attach$
|
|
3687
|
+
.pipe(takeUntil(this._destroy$))
|
|
3688
|
+
.subscribe(() => {
|
|
3689
|
+
this.showFilterMenu = true;
|
|
3690
|
+
});
|
|
3691
|
+
this._filterOverlay.detach$
|
|
3692
|
+
.pipe(takeUntil(this._destroy$))
|
|
3693
|
+
.subscribe(() => {
|
|
3694
|
+
this.showFilterMenu = false;
|
|
3695
|
+
});
|
|
3696
|
+
this._listenWindowResize();
|
|
3697
|
+
}
|
|
3698
|
+
set setConfig(config) {
|
|
3699
|
+
this._initFilterWithConfig(config);
|
|
3700
|
+
}
|
|
3701
|
+
set setFilter(config) {
|
|
3702
|
+
this._initFilterWithConfig(config);
|
|
3703
|
+
}
|
|
3704
|
+
get hasKeyword() {
|
|
3705
|
+
return this._filterItems.hasKeyword;
|
|
3706
|
+
}
|
|
3707
|
+
get config() {
|
|
3708
|
+
return this._config;
|
|
3709
|
+
}
|
|
3710
|
+
get filterParams() {
|
|
3711
|
+
return this._filterItems.values();
|
|
3712
|
+
}
|
|
3713
|
+
get filterParamsQuery() {
|
|
3714
|
+
return this._filterItems.valuesAsQuery();
|
|
3715
|
+
}
|
|
3716
|
+
get items() {
|
|
3717
|
+
return this._filterItems.items;
|
|
3718
|
+
}
|
|
3719
|
+
get visibleItems() {
|
|
3720
|
+
return this._filterItems.visibleItems;
|
|
3721
|
+
}
|
|
3722
|
+
get itemsReady$() {
|
|
3723
|
+
return this._filterItems.ready$;
|
|
3724
|
+
}
|
|
3725
|
+
get hasFilterChips$() {
|
|
3726
|
+
return this._hasFilterChips$.asObservable();
|
|
3727
|
+
}
|
|
3728
|
+
get hasVisibleItemOrSorting() {
|
|
3729
|
+
return this.visibleItems.length > 0 || !!this._filterItems.sortByItem;
|
|
3730
|
+
}
|
|
3731
|
+
get filtersBtnVisible$() {
|
|
3732
|
+
return this._filtersBtnVisible$.asObservable();
|
|
3733
|
+
}
|
|
3734
|
+
get keywordVisible$() {
|
|
3735
|
+
return this._keywordVisible$.asObservable();
|
|
3736
|
+
}
|
|
3737
|
+
get actionsVisible$() {
|
|
3738
|
+
return this._actions.visible$;
|
|
3739
|
+
}
|
|
3740
|
+
get actions$() {
|
|
3741
|
+
return this._actions.actions$;
|
|
3742
|
+
}
|
|
3743
|
+
get menuActions$() {
|
|
3744
|
+
return this._actions.menuActions$;
|
|
3745
|
+
}
|
|
3746
|
+
ngOnInit() {
|
|
3747
|
+
// Avoid ngChanges error
|
|
3748
|
+
setTimeout(() => {
|
|
3749
|
+
if (this.config.autofocus) {
|
|
3750
|
+
this.focus();
|
|
3751
|
+
}
|
|
3752
|
+
});
|
|
3753
|
+
this._listenInputChanges();
|
|
3754
|
+
this._listenInternalItemsChange();
|
|
3755
|
+
this._initOverlay();
|
|
3756
|
+
}
|
|
3757
|
+
ngOnDestroy() {
|
|
3758
|
+
this._destroyFilterDrawer();
|
|
3759
|
+
this._destroy$.next();
|
|
3760
|
+
this._destroy$.complete();
|
|
3761
|
+
}
|
|
3762
|
+
focus() {
|
|
3763
|
+
this.keywordMatInput?.focus();
|
|
3764
|
+
}
|
|
3765
|
+
updateSort(sort) {
|
|
3766
|
+
this._filterItems.updateSort(sort);
|
|
3767
|
+
}
|
|
3768
|
+
/**
|
|
3769
|
+
*
|
|
3770
|
+
* Do update value of some field
|
|
3771
|
+
*
|
|
3772
|
+
* @param values - values for update
|
|
3773
|
+
*
|
|
3774
|
+
* To update text value just pass new text value
|
|
3775
|
+
*
|
|
3776
|
+
* public updateSelectValue(val) {
|
|
3777
|
+
* this.filterEl.updateValues({ keyword: val });
|
|
3778
|
+
* }
|
|
3779
|
+
*
|
|
3780
|
+
* To update select or observable select you could pass suitable value
|
|
3781
|
+
*
|
|
3782
|
+
* public updateSelectValue(val: number) {
|
|
3783
|
+
* this.filterEl.updateValues({ simple_select: val }, { observable_select: val });
|
|
3784
|
+
* }
|
|
3785
|
+
*
|
|
3786
|
+
* To update checkbox value just pass true/false as value
|
|
3787
|
+
*
|
|
3788
|
+
* public updateCheckox(val: boolean) {
|
|
3789
|
+
* this.filterEl.updateValues({ checkbox: val });
|
|
3790
|
+
* }
|
|
3791
|
+
*
|
|
3792
|
+
* To update range value just pass object with min&max object or just with one of targets
|
|
3793
|
+
*
|
|
3794
|
+
* Ex.: { min: 10, max 15 }, { min: 5 }, { max 5 }
|
|
3795
|
+
*
|
|
3796
|
+
* public updateRange(val) {
|
|
3797
|
+
* this.filterEl.updateValues({ range: val });
|
|
3798
|
+
* }
|
|
3799
|
+
*
|
|
3800
|
+
* To update autocomplete just pass object with name/value fields
|
|
3801
|
+
*
|
|
3802
|
+
* Ex.: { name: 'John Doe', value: 1 }
|
|
3803
|
+
*
|
|
3804
|
+
* public updateAutocomplete(val) {
|
|
3805
|
+
* this.filterEl.updateValues({ autocomplete_user_id: val });
|
|
3806
|
+
* }
|
|
3807
|
+
*
|
|
3808
|
+
* To update autocompletechips just pass:
|
|
3809
|
+
*
|
|
3810
|
+
* 1) object with name/value fields - will be appended to existing set of values
|
|
3811
|
+
*
|
|
3812
|
+
* { name: 'John Doe', value: 1 }
|
|
3813
|
+
*
|
|
3814
|
+
* 2) array of objects - will be appended to existing set of values
|
|
3815
|
+
*
|
|
3816
|
+
* [{ name: 'John Doe', value: 1 }, { name: 'Darya Filipova', value: 2 }]
|
|
3817
|
+
*
|
|
3818
|
+
* 3) null - clear existing set of values
|
|
3819
|
+
*
|
|
3820
|
+
* public updateAutocomplete(val) {
|
|
3821
|
+
* this.filterEl.updateValues({ autocompletechips_user_id: val });
|
|
3822
|
+
* }
|
|
3823
|
+
*
|
|
3824
|
+
*/
|
|
3825
|
+
updateValues(values) {
|
|
3826
|
+
Object.keys(values).forEach((key) => {
|
|
3827
|
+
const filterItem = this.items
|
|
3828
|
+
.find((item) => item.name === key);
|
|
3829
|
+
if (!filterItem) {
|
|
3830
|
+
return;
|
|
3831
|
+
}
|
|
3832
|
+
filterItem.model = values[key];
|
|
3833
|
+
});
|
|
3834
|
+
}
|
|
3835
|
+
hide() {
|
|
3836
|
+
this.changeVisibility(false);
|
|
3837
|
+
}
|
|
3838
|
+
show() {
|
|
3839
|
+
this.changeVisibility(true);
|
|
3840
|
+
}
|
|
3841
|
+
changeVisibilityClick(value, event = null) {
|
|
3842
|
+
if (event) {
|
|
3843
|
+
event.stopPropagation();
|
|
3844
|
+
}
|
|
3845
|
+
this.changeVisibility(value);
|
|
3846
|
+
}
|
|
3847
|
+
get itemValues() {
|
|
3848
|
+
return this.items
|
|
3849
|
+
.map((item) => item.value);
|
|
3850
|
+
}
|
|
3851
|
+
get nonEmptyItemValues() {
|
|
3852
|
+
return this.items
|
|
3853
|
+
.filter((item) => item.value !== undefined)
|
|
3854
|
+
.map((item) => item.value);
|
|
3855
|
+
}
|
|
3856
|
+
get hasItemValues() {
|
|
3857
|
+
return this.items
|
|
3858
|
+
.some((item) => item.value !== undefined);
|
|
3859
|
+
}
|
|
3860
|
+
getItemValue(name) {
|
|
3861
|
+
const item = this.items
|
|
3862
|
+
.find((item) => item.name === name);
|
|
3863
|
+
return item?.value;
|
|
3864
|
+
}
|
|
3865
|
+
showItem(name) {
|
|
3866
|
+
const item = this.getItem(name);
|
|
3867
|
+
if (item) {
|
|
3868
|
+
item.hide = false;
|
|
3869
|
+
this._filterItems.updateItemsVisiblity();
|
|
3870
|
+
}
|
|
3871
|
+
}
|
|
3872
|
+
hideItem(name) {
|
|
3873
|
+
const item = this.getItem(name);
|
|
3874
|
+
if (!item) {
|
|
3875
|
+
return;
|
|
3876
|
+
}
|
|
3877
|
+
item.hide = true;
|
|
3878
|
+
this._filterItems.updateItemsVisiblity();
|
|
3879
|
+
}
|
|
3880
|
+
clearItem(name) {
|
|
3881
|
+
const item = this.getItem(name);
|
|
3882
|
+
if (!item) {
|
|
3883
|
+
return;
|
|
3884
|
+
}
|
|
3885
|
+
item.clear();
|
|
3886
|
+
}
|
|
3887
|
+
updateItemConfig(name, params) {
|
|
3888
|
+
const item = this.getItem(name);
|
|
3889
|
+
if (!item) {
|
|
3890
|
+
return;
|
|
3891
|
+
}
|
|
3892
|
+
item.label = params.label ?? item.label;
|
|
3893
|
+
item.chipLabel = params.chipLabel ?? item.chipLabel;
|
|
3894
|
+
this._filterItems.updateItemsVisiblity();
|
|
3895
|
+
}
|
|
3896
|
+
getItemValueChange$(name) {
|
|
3897
|
+
const item = this.items.find((i) => i.name === name);
|
|
3898
|
+
if (item) {
|
|
3899
|
+
return item.value$
|
|
3900
|
+
.pipe(map(() => {
|
|
3901
|
+
return item.model;
|
|
3902
|
+
}));
|
|
3903
|
+
}
|
|
3904
|
+
return null;
|
|
3905
|
+
}
|
|
3906
|
+
changeVisibility(state) {
|
|
3907
|
+
if (state === this.showFilterMenu) {
|
|
3908
|
+
return;
|
|
3909
|
+
}
|
|
3910
|
+
if (!state) {
|
|
3911
|
+
this.closed.emit();
|
|
3912
|
+
return this._destroyFilterDrawer();
|
|
3913
|
+
}
|
|
3914
|
+
if (!this.hasVisibleItemOrSorting) {
|
|
3915
|
+
return;
|
|
3916
|
+
}
|
|
3917
|
+
this._listenEscButton();
|
|
3918
|
+
this.opened.emit();
|
|
3919
|
+
this._filterOverlay.open();
|
|
3920
|
+
}
|
|
3921
|
+
init() {
|
|
3922
|
+
const data = this._filterItems.valuesAsQuery();
|
|
3923
|
+
this._sort = this._filterItems.getSort();
|
|
3924
|
+
if (this.config.init) {
|
|
3925
|
+
this.config.init(data, this._sort, this);
|
|
3926
|
+
}
|
|
3927
|
+
this._updateChipsVisibility();
|
|
3928
|
+
this.items
|
|
3929
|
+
.forEach((item) => {
|
|
3930
|
+
item.init(item, this);
|
|
3931
|
+
});
|
|
3932
|
+
}
|
|
3933
|
+
clear(event = null) {
|
|
3934
|
+
if (event) {
|
|
3935
|
+
event.stopPropagation();
|
|
3936
|
+
}
|
|
3937
|
+
this._filterItems.filtersClear();
|
|
3938
|
+
if (this.config.clear) {
|
|
3939
|
+
this.config.clear();
|
|
3940
|
+
}
|
|
3941
|
+
this.keyword = '';
|
|
3942
|
+
}
|
|
3943
|
+
/**
|
|
3944
|
+
* Close filter window and do change callback
|
|
3945
|
+
*/
|
|
3946
|
+
search(event) {
|
|
3947
|
+
this.changeVisibilityClick(false, event);
|
|
3948
|
+
}
|
|
3949
|
+
reload(event = null) {
|
|
3950
|
+
if (event) {
|
|
3951
|
+
event.preventDefault();
|
|
3952
|
+
event.stopPropagation();
|
|
3953
|
+
}
|
|
3954
|
+
const data = this._filterItems.valuesAsQuery();
|
|
3955
|
+
if (this.config.reload) {
|
|
3956
|
+
this.config.reload(data, this._filterItems.getSort());
|
|
3957
|
+
}
|
|
3958
|
+
}
|
|
3959
|
+
getItem(name) {
|
|
3960
|
+
return this.items
|
|
3961
|
+
.find((item) => item.name === name);
|
|
3962
|
+
}
|
|
3963
|
+
fetchQueryParams() {
|
|
3964
|
+
this._externalParams.fetchQueryParams();
|
|
3965
|
+
}
|
|
3966
|
+
/**
|
|
3967
|
+
* Call change callback and apply new filter values
|
|
3968
|
+
*/
|
|
3969
|
+
change() {
|
|
3970
|
+
const data = this._filterItems.valuesAsQuery();
|
|
3971
|
+
const sort = this._filterItems.getSort();
|
|
3972
|
+
const sortingChanged = ((!sort || !this._sort) && sort !== this._sort)
|
|
3973
|
+
|| (sort && this._sort && !objectsAreEquals(this._sort, sort));
|
|
3974
|
+
if (sortingChanged) {
|
|
3975
|
+
this._sort = sort;
|
|
3976
|
+
if (this.config.sortChange) {
|
|
3977
|
+
this.config.sortChange(data, sort);
|
|
3978
|
+
}
|
|
3979
|
+
}
|
|
3980
|
+
if (this.config.change) {
|
|
3981
|
+
this.config.change(data, sort);
|
|
3982
|
+
}
|
|
3983
|
+
this._updateChipsVisibility();
|
|
3984
|
+
// visibility for actions can depend on filters state
|
|
3985
|
+
this._actions.updateActionsVisibility();
|
|
3986
|
+
}
|
|
3987
|
+
/**
|
|
3988
|
+
* Update filter actions config
|
|
3989
|
+
*
|
|
3990
|
+
* @param actions
|
|
3991
|
+
*/
|
|
3992
|
+
updateActions(actions) {
|
|
3993
|
+
this._actions.initActions(actions);
|
|
3994
|
+
}
|
|
3995
|
+
/**
|
|
3996
|
+
* Show "Filters" button
|
|
3997
|
+
*/
|
|
3998
|
+
showFiltersBtn() {
|
|
3999
|
+
this._filtersBtnVisible$.next(true);
|
|
4000
|
+
}
|
|
4001
|
+
/**
|
|
4002
|
+
* Hide "Filters" button
|
|
4003
|
+
*/
|
|
4004
|
+
hideFiltersBtn() {
|
|
4005
|
+
this._filtersBtnVisible$.next(false);
|
|
4006
|
+
}
|
|
4007
|
+
/**
|
|
4008
|
+
* Show "Keyword" field if it present
|
|
4009
|
+
*/
|
|
4010
|
+
showKeywordField() {
|
|
4011
|
+
this._keywordVisible$.next(true);
|
|
4012
|
+
}
|
|
4013
|
+
/**
|
|
4014
|
+
* Hide "Keyword" field if it present
|
|
4015
|
+
*/
|
|
4016
|
+
hideKeywordField() {
|
|
4017
|
+
this._keywordVisible$.next(false);
|
|
4018
|
+
}
|
|
4019
|
+
/**
|
|
4020
|
+
* Go through actions and check show() callback and update visible actions
|
|
4021
|
+
*/
|
|
4022
|
+
updateActionsVisibility() {
|
|
4023
|
+
this._actions.updateActionsVisibility();
|
|
4024
|
+
}
|
|
4025
|
+
/**
|
|
4026
|
+
* Go through actions and check disabled() callback and update disabled state
|
|
4027
|
+
*/
|
|
4028
|
+
updateDisabledState() {
|
|
4029
|
+
this._actions.updateDisabledState();
|
|
4030
|
+
}
|
|
4031
|
+
setItems(items) {
|
|
4032
|
+
this._filterItems.destroyItems();
|
|
4033
|
+
this.config.items = items;
|
|
4034
|
+
this._filterItems.setConfig(this._config);
|
|
4035
|
+
this._externalParams.initItems();
|
|
4036
|
+
this._syncSearchInputWithKeyword();
|
|
4037
|
+
}
|
|
4038
|
+
keywordChange(keyword) {
|
|
4039
|
+
this._keyword$.next(keyword);
|
|
4040
|
+
}
|
|
4041
|
+
_initFilterWithConfig(config) {
|
|
4042
|
+
if (this.config) {
|
|
4043
|
+
this._filterItems.destroyItems();
|
|
4044
|
+
}
|
|
4045
|
+
config = {
|
|
4046
|
+
...(this._defaultConfig || {}),
|
|
4047
|
+
...config,
|
|
4048
|
+
};
|
|
4049
|
+
this._config = new FsFilterConfig(config);
|
|
4050
|
+
this._actions.setConfig(this._config);
|
|
4051
|
+
this._filterItems.setConfig(this._config);
|
|
4052
|
+
this._externalParams.setConfig(this._config);
|
|
4053
|
+
this._syncSearchInputWithKeyword();
|
|
4054
|
+
if (!!this.config.reloadWhenConfigChanged) {
|
|
4055
|
+
this.change();
|
|
4056
|
+
}
|
|
4057
|
+
}
|
|
4058
|
+
_destroyFilterDrawer() {
|
|
4059
|
+
this._filterOverlay.close();
|
|
4060
|
+
}
|
|
4061
|
+
_updateWindowWidth() {
|
|
4062
|
+
this.windowDesktop = window.innerWidth > 1200;
|
|
4063
|
+
}
|
|
4064
|
+
_listenEscButton() {
|
|
4065
|
+
this._zone.runOutsideAngular(() => {
|
|
4066
|
+
fromEvent(window, 'keyup')
|
|
4067
|
+
.pipe(filter$1((event) => event.code === 'Escape'), takeUntil(this.closed), takeUntil(this._destroy$))
|
|
4068
|
+
.subscribe(() => {
|
|
4069
|
+
this._zone.run(() => {
|
|
4070
|
+
this.changeVisibility(false);
|
|
4071
|
+
});
|
|
4072
|
+
});
|
|
4073
|
+
});
|
|
4074
|
+
}
|
|
4075
|
+
_listenWindowResize() {
|
|
4076
|
+
this._zone.runOutsideAngular(() => {
|
|
4077
|
+
fromEvent(window, 'resize')
|
|
4078
|
+
.pipe(debounceTime(100), takeUntil(this._destroy$))
|
|
4079
|
+
.subscribe(() => {
|
|
4080
|
+
this._zone.run(() => {
|
|
4081
|
+
this._updateWindowWidth();
|
|
4082
|
+
});
|
|
4083
|
+
});
|
|
4084
|
+
});
|
|
4085
|
+
}
|
|
4086
|
+
_listenInputChanges() {
|
|
4087
|
+
this._keyword$
|
|
4088
|
+
.pipe(debounceTime(200), distinctUntilChanged(), takeUntil(this._destroy$))
|
|
4089
|
+
.subscribe((value) => {
|
|
4090
|
+
const keywordItem = this._filterItems.keywordItem;
|
|
4091
|
+
keywordItem.model = value;
|
|
4092
|
+
this.change();
|
|
4093
|
+
});
|
|
4094
|
+
}
|
|
4095
|
+
_syncSearchInputWithKeyword() {
|
|
4096
|
+
const keywordItem = this._filterItems.keywordItem;
|
|
4097
|
+
if (keywordItem) {
|
|
4098
|
+
this.keyword = keywordItem.model;
|
|
4099
|
+
this.searchPlaceholder = keywordItem.label || 'Search';
|
|
4100
|
+
}
|
|
4101
|
+
}
|
|
4102
|
+
_listenInternalItemsChange() {
|
|
4103
|
+
this._filterItems
|
|
4104
|
+
.itemsChange$
|
|
4105
|
+
.pipe(takeUntil(this._destroy$))
|
|
4106
|
+
.subscribe(() => {
|
|
4107
|
+
this.change();
|
|
4108
|
+
});
|
|
4109
|
+
}
|
|
4110
|
+
_initOverlay() {
|
|
4111
|
+
this._filterOverlay.setClearFn(this.clear.bind(this));
|
|
4112
|
+
this._filterOverlay.setDoneFn(this.hide.bind(this));
|
|
4113
|
+
}
|
|
4114
|
+
// We may need some time to recieve external params and after that ready can be emitted
|
|
4115
|
+
_listenWhenFilterReady() {
|
|
4116
|
+
combineLatest([
|
|
4117
|
+
this._externalParams.pending$,
|
|
4118
|
+
this.itemsReady$,
|
|
4119
|
+
])
|
|
4120
|
+
.pipe(filter$1(([pendingParams, itemsReady]) => !pendingParams && itemsReady), takeUntil(this._destroy$))
|
|
4121
|
+
.subscribe(() => {
|
|
4122
|
+
this.init();
|
|
4123
|
+
this._syncSearchInputWithKeyword();
|
|
4124
|
+
this.ready.emit();
|
|
4125
|
+
});
|
|
4126
|
+
}
|
|
4127
|
+
_updateChipsVisibility() {
|
|
4128
|
+
const hasFilterChips = this._filterItems.items
|
|
4129
|
+
.some((item) => {
|
|
4130
|
+
return item.isChipVisible;
|
|
4131
|
+
});
|
|
4132
|
+
this._hasFilterChips$.next(hasFilterChips);
|
|
4133
|
+
}
|
|
4134
|
+
}
|
|
4135
|
+
FilterComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FilterComponent, deps: [{ token: FS_FILTER_CONFIG, optional: true }, { token: FsFilterOverlayService }, { token: i0.NgZone }, { token: ExternalParamsController }, { token: FsFilterItemsStore }, { token: ActionsController }], target: i0.ɵɵFactoryTarget.Component });
|
|
4136
|
+
FilterComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: FilterComponent, selector: "fs-filter", inputs: { setConfig: ["config", "setConfig"], setFilter: ["filter", "setFilter"], showSortBy: "showSortBy", showFilterInput: "showFilterInput" }, outputs: { closed: "closed", opened: "opened", ready: "ready" }, host: { properties: { "class.filters-open": "this.showFilterMenu", "class.window-desktop": "this.windowDesktop", "class.fs-filter": "this.fsFilterClass", "class.has-keyword": "this.hasKeyword" } }, providers: [
|
|
4137
|
+
FsFilterOverlayService,
|
|
4138
|
+
ExternalParamsController,
|
|
4139
|
+
PersistanceParamsController,
|
|
4140
|
+
QueryParamsController,
|
|
4141
|
+
FocusControllerService,
|
|
4142
|
+
FsFilterItemsStore,
|
|
4143
|
+
SavedFiltersController,
|
|
4144
|
+
ActionsController,
|
|
4145
|
+
], queries: [{ propertyName: "statusBar", first: true, predicate: FilterStatusBarDirective, descendants: true }], viewQueries: [{ propertyName: "keywordMatInput", first: true, predicate: ["keywordMatInput"], descendants: true, read: MatInput }], ngImport: i0, template: "<div class=\"filter-container\">\n <div class=\"filter-inner-container\">\n <ng-container *ngIf=\"!hasKeyword; else filterKeyword\">\n <div>\n <ng-container *ngTemplateOutlet=\"filterStatusBarChips\"></ng-container> \n </div>\n </ng-container>\n \n <ng-container [ngTemplateOutlet]=\"filterToolbar\"></ng-container>\n <ng-container [ngTemplateOutlet]=\"filterActions\"></ng-container>\n </div>\n\n <ng-container *ngIf=\"hasKeyword\">\n <ng-container *ngTemplateOutlet=\"filterStatusBarChips\"></ng-container>\n </ng-container>\n</div>\n\n<ng-template #filterStatusBarChips>\n <ng-container *ngIf=\"statusBar\">\n <div class=\"filter-status-container\" [ngClass]=\"{ 'has-status': !!filterStatus.textContent }\">\n <div class=\"filter-status\" #filterStatus>\n <ng-container *ngTemplateOutlet=\"statusBar.templateRef\"></ng-container>\n </div>\n </div>\n </ng-container>\n\n <ng-container *ngIf=\"config.chips && hasFilterChips$ | async\">\n <fs-filter-chips \n class=\"filter-chips\"\n [filters]=\"items\">\n </fs-filter-chips>\n </ng-container>\n</ng-template>\n\n<ng-template #filterKeyword>\n <div class=\"filter-keyword\">\n <ng-container *ngIf=\"keywordVisible$ | async\">\n <mat-form-field \n [floatLabel]=\"'never'\" \n class=\"form-field-padless\" \n [ngClass]=\"search\"\n appearance=\"outline\">\n <span matPrefix>\n <mat-icon matPrefix>search</mat-icon>\n </span>\n <input\n #keywordMatInput\n matInput\n [(ngModel)]=\"keyword\"\n (ngModelChange)=\"keywordChange($event)\"\n name=\"filter-input\"\n [fsClear]=\"true\"\n [placeholder]=\"searchPlaceholder\">\n </mat-form-field>\n </ng-container>\n </div>\n</ng-template>\n\n<ng-template #filterActions>\n <div class=\"filter-actions\">\n <fs-filter-actions\n *ngIf=\"actionsVisible$ | async\"\n [actions]=\"actions$ | async\"\n [kebabActions]=\"menuActions$ | async\">\n </fs-filter-actions>\n </div>\n</ng-template>\n\n<ng-template #filterToolbar>\n <div class=\"filter-toobar\">\n <ng-container *ngIf=\"filtersBtnVisible$ | async\">\n <ng-container *ngIf=\"hasVisibleItemOrSorting\">\n <a\n mat-button\n class=\"filters-button\"\n [ngClass]=\"{\n 'mat-raised-button': config.button.style === 'raised' && config.button.label,\n 'mat-flat-button': config.button.style === 'flat' && config.button.label,\n 'mat-stroked-button': config.button.style === 'stroked' && config.button.label,\n 'mat-button': config.button.style === 'basic' && config.button.label,\n 'mat-icon-button': config.button.style === 'icon' || !config.button.label \n }\"\n (click)=\"changeVisibilityClick(!showFilterMenu, $event)\"\n [color]=\"config.button.color\">\n <mat-icon *ngIf=\"config.button.icon\">{{config.button.icon}}</mat-icon>\n {{ config.button.label }}\n </a>\n </ng-container>\n </ng-container>\n <a \n mat-icon-button\n (click)=\"reload($event)\"\n class=\"reload\"\n *ngIf=\"config.reload\">\n <mat-icon>refresh</mat-icon>\n </a>\n </div>\n</ng-template>", styles: [".fs-filter{margin-bottom:20px;display:block}.fs-filter.has-keyword .filter-status-container.has-status{margin-top:4px}.fs-filter:not(.has-keyword) .filter-status-container:not(.has-status)+fs-filter-chips{margin-top:0}.fs-filter:not(.has-keyword) .filter-inner-container{display:flex}.fs-filter:not(.has-keyword) .filter-toobar{justify-content:flex-end}.fs-filter .filter-status-container{flex-grow:1;display:flex;justify-content:center;flex-direction:column;align-self:flex-end}.fs-filter .filter-status-container .filter-status{overflow:hidden;text-overflow:ellipsis;line-height:17px}.fs-filter .filter-container{width:100%}.fs-filter .filter-inner-container{flex-direction:row;box-sizing:border-box;display:flex;position:relative;align-items:center}.fs-filter .filter-inner-container .filter-keyword{flex-direction:row;box-sizing:border-box;display:flex;align-items:center;min-width:0}.fs-filter .filter-inner-container .filter-keyword mat-form-field{max-width:100%;min-width:100px;margin-right:6px}.fs-filter .filter-inner-container .filter-keyword mat-form-field .mat-form-field-wrapper{margin-bottom:0}.fs-filter .filter-inner-container .filter-keyword mat-form-field .mat-form-field-prefix .mat-icon{font-size:22px;color:#626262}.fs-filter .filter-inner-container .filter-keyword mat-form-field .mat-form-field-infix{width:250px}.fs-filter .filter-inner-container .filter-keyword mat-form-field .mat-form-field-prefix,.fs-filter .filter-inner-container .filter-keyword mat-form-field .mat-form-field-suffix{top:.45em}.fs-filter .filter-inner-container .filter-keyword .mat-form-field-suffix{display:flex}.fs-filter .filter-inner-container .filter-keyword .mat-form-field-suffix .mat-icon-button{height:24px;width:24px}.fs-filter .filter-actions{display:flex;align-items:center}.fs-filter .filter-toobar{flex:1;white-space:nowrap;display:flex;align-items:center}.fs-filter .filter-toobar .reload{margin-left:-6px}.fs-filter .results{min-height:90px;position:relative;overflow-x:auto;overflow-y:hidden}.fs-filter fs-filter-chips{margin-top:4px;display:block}@media screen and (min-width: 599px){.filter-actions{margin-left:10px}.filters-button+fs-filter-actions:not(:empty){margin-left:5px}}@media screen and (max-width: 600px){.filter-actions{margin-left:5px}.filter-actions .filters-button{font-size:0;padding:0;min-width:unset;width:36px;height:36px;border-radius:50%;box-shadow:unset!important}}@media screen and (min-width: 1200px){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: FsFilterChipsComponent, selector: "fs-filter-chips", inputs: ["filters"] }, { type: i1$3.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { type: i2$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: i8.FsClearComponent, selector: "[fsClear]", inputs: ["ngModel", "fsClear"], outputs: ["ngModelChange", "cleared"] }, { type: FsFilterActionsComponent, selector: "fs-filter-actions", inputs: ["kebabActions", "actions"] }, { type: i1$4.MatAnchor, selector: "a[mat-button], a[mat-raised-button], a[mat-icon-button], a[mat-fab], a[mat-mini-fab], a[mat-stroked-button], a[mat-flat-button]", inputs: ["disabled", "disableRipple", "color", "tabIndex"], exportAs: ["matButton", "matAnchor"] }], directives: [{ type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i1$3.MatPrefix, selector: "[matPrefix]" }, { type: i3$2.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { type: i4.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: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i7.FsFormNoFsValidatorsDirective, selector: "[ngModel]:not([required]):not([fsFormRequired]):not([fsFormCompare]):not([fsFormDateRange]):not([fsFormEmail]):not([fsFormEmails]):not([fsFormFunction]):not([fsFormGreater]):not([fsFormInteger]):not([fsFormLesser]):not([fsFormMax]):not([fsFormMaxLength]):not([fsFormMin]):not([fsFormMinLength]):not([fsFormNumeric]):not([fsFormPattern]):not([fsFormPhone]):not([fsFormUrl]):not([validate])" }, { type: i7.FsButtonDirective, selector: "[mat-raised-button],[mat-button],[mat-flat-button],[mat-stroked-button]", inputs: ["name", "dirtySubmit", "form"] }], pipes: { "async": i3.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
4146
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FilterComponent, decorators: [{
|
|
4147
|
+
type: Component,
|
|
4148
|
+
args: [{ selector: 'fs-filter', encapsulation: ViewEncapsulation.None, providers: [
|
|
4149
|
+
FsFilterOverlayService,
|
|
4150
|
+
ExternalParamsController,
|
|
4151
|
+
PersistanceParamsController,
|
|
4152
|
+
QueryParamsController,
|
|
4153
|
+
FocusControllerService,
|
|
4154
|
+
FsFilterItemsStore,
|
|
4155
|
+
SavedFiltersController,
|
|
4156
|
+
ActionsController,
|
|
4157
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"filter-container\">\n <div class=\"filter-inner-container\">\n <ng-container *ngIf=\"!hasKeyword; else filterKeyword\">\n <div>\n <ng-container *ngTemplateOutlet=\"filterStatusBarChips\"></ng-container> \n </div>\n </ng-container>\n \n <ng-container [ngTemplateOutlet]=\"filterToolbar\"></ng-container>\n <ng-container [ngTemplateOutlet]=\"filterActions\"></ng-container>\n </div>\n\n <ng-container *ngIf=\"hasKeyword\">\n <ng-container *ngTemplateOutlet=\"filterStatusBarChips\"></ng-container>\n </ng-container>\n</div>\n\n<ng-template #filterStatusBarChips>\n <ng-container *ngIf=\"statusBar\">\n <div class=\"filter-status-container\" [ngClass]=\"{ 'has-status': !!filterStatus.textContent }\">\n <div class=\"filter-status\" #filterStatus>\n <ng-container *ngTemplateOutlet=\"statusBar.templateRef\"></ng-container>\n </div>\n </div>\n </ng-container>\n\n <ng-container *ngIf=\"config.chips && hasFilterChips$ | async\">\n <fs-filter-chips \n class=\"filter-chips\"\n [filters]=\"items\">\n </fs-filter-chips>\n </ng-container>\n</ng-template>\n\n<ng-template #filterKeyword>\n <div class=\"filter-keyword\">\n <ng-container *ngIf=\"keywordVisible$ | async\">\n <mat-form-field \n [floatLabel]=\"'never'\" \n class=\"form-field-padless\" \n [ngClass]=\"search\"\n appearance=\"outline\">\n <span matPrefix>\n <mat-icon matPrefix>search</mat-icon>\n </span>\n <input\n #keywordMatInput\n matInput\n [(ngModel)]=\"keyword\"\n (ngModelChange)=\"keywordChange($event)\"\n name=\"filter-input\"\n [fsClear]=\"true\"\n [placeholder]=\"searchPlaceholder\">\n </mat-form-field>\n </ng-container>\n </div>\n</ng-template>\n\n<ng-template #filterActions>\n <div class=\"filter-actions\">\n <fs-filter-actions\n *ngIf=\"actionsVisible$ | async\"\n [actions]=\"actions$ | async\"\n [kebabActions]=\"menuActions$ | async\">\n </fs-filter-actions>\n </div>\n</ng-template>\n\n<ng-template #filterToolbar>\n <div class=\"filter-toobar\">\n <ng-container *ngIf=\"filtersBtnVisible$ | async\">\n <ng-container *ngIf=\"hasVisibleItemOrSorting\">\n <a\n mat-button\n class=\"filters-button\"\n [ngClass]=\"{\n 'mat-raised-button': config.button.style === 'raised' && config.button.label,\n 'mat-flat-button': config.button.style === 'flat' && config.button.label,\n 'mat-stroked-button': config.button.style === 'stroked' && config.button.label,\n 'mat-button': config.button.style === 'basic' && config.button.label,\n 'mat-icon-button': config.button.style === 'icon' || !config.button.label \n }\"\n (click)=\"changeVisibilityClick(!showFilterMenu, $event)\"\n [color]=\"config.button.color\">\n <mat-icon *ngIf=\"config.button.icon\">{{config.button.icon}}</mat-icon>\n {{ config.button.label }}\n </a>\n </ng-container>\n </ng-container>\n <a \n mat-icon-button\n (click)=\"reload($event)\"\n class=\"reload\"\n *ngIf=\"config.reload\">\n <mat-icon>refresh</mat-icon>\n </a>\n </div>\n</ng-template>", styles: [".fs-filter{margin-bottom:20px;display:block}.fs-filter.has-keyword .filter-status-container.has-status{margin-top:4px}.fs-filter:not(.has-keyword) .filter-status-container:not(.has-status)+fs-filter-chips{margin-top:0}.fs-filter:not(.has-keyword) .filter-inner-container{display:flex}.fs-filter:not(.has-keyword) .filter-toobar{justify-content:flex-end}.fs-filter .filter-status-container{flex-grow:1;display:flex;justify-content:center;flex-direction:column;align-self:flex-end}.fs-filter .filter-status-container .filter-status{overflow:hidden;text-overflow:ellipsis;line-height:17px}.fs-filter .filter-container{width:100%}.fs-filter .filter-inner-container{flex-direction:row;box-sizing:border-box;display:flex;position:relative;align-items:center}.fs-filter .filter-inner-container .filter-keyword{flex-direction:row;box-sizing:border-box;display:flex;align-items:center;min-width:0}.fs-filter .filter-inner-container .filter-keyword mat-form-field{max-width:100%;min-width:100px;margin-right:6px}.fs-filter .filter-inner-container .filter-keyword mat-form-field .mat-form-field-wrapper{margin-bottom:0}.fs-filter .filter-inner-container .filter-keyword mat-form-field .mat-form-field-prefix .mat-icon{font-size:22px;color:#626262}.fs-filter .filter-inner-container .filter-keyword mat-form-field .mat-form-field-infix{width:250px}.fs-filter .filter-inner-container .filter-keyword mat-form-field .mat-form-field-prefix,.fs-filter .filter-inner-container .filter-keyword mat-form-field .mat-form-field-suffix{top:.45em}.fs-filter .filter-inner-container .filter-keyword .mat-form-field-suffix{display:flex}.fs-filter .filter-inner-container .filter-keyword .mat-form-field-suffix .mat-icon-button{height:24px;width:24px}.fs-filter .filter-actions{display:flex;align-items:center}.fs-filter .filter-toobar{flex:1;white-space:nowrap;display:flex;align-items:center}.fs-filter .filter-toobar .reload{margin-left:-6px}.fs-filter .results{min-height:90px;position:relative;overflow-x:auto;overflow-y:hidden}.fs-filter fs-filter-chips{margin-top:4px;display:block}@media screen and (min-width: 599px){.filter-actions{margin-left:10px}.filters-button+fs-filter-actions:not(:empty){margin-left:5px}}@media screen and (max-width: 600px){.filter-actions{margin-left:5px}.filter-actions .filters-button{font-size:0;padding:0;min-width:unset;width:36px;height:36px;border-radius:50%;box-shadow:unset!important}}@media screen and (min-width: 1200px){body.fs-filter-open{margin-right:350px}.fs-filter-backdrop{display:none}}body.fs-filter-open::-webkit-scrollbar{width:0;background:transparent}\n"] }]
|
|
4158
|
+
}], ctorParameters: function () { return [{ type: FsFilterConfig, decorators: [{
|
|
4159
|
+
type: Optional
|
|
4160
|
+
}, {
|
|
4161
|
+
type: Inject,
|
|
4162
|
+
args: [FS_FILTER_CONFIG]
|
|
4163
|
+
}] }, { type: FsFilterOverlayService }, { type: i0.NgZone }, { type: ExternalParamsController }, { type: FsFilterItemsStore }, { type: ActionsController }]; }, propDecorators: { setConfig: [{
|
|
4164
|
+
type: Input,
|
|
4165
|
+
args: ['config']
|
|
4166
|
+
}], setFilter: [{
|
|
4167
|
+
type: Input,
|
|
4168
|
+
args: ['filter']
|
|
4169
|
+
}], showSortBy: [{
|
|
4170
|
+
type: Input
|
|
4171
|
+
}], showFilterInput: [{
|
|
4172
|
+
type: Input
|
|
4173
|
+
}], closed: [{
|
|
4174
|
+
type: Output
|
|
4175
|
+
}], opened: [{
|
|
4176
|
+
type: Output
|
|
4177
|
+
}], ready: [{
|
|
4178
|
+
type: Output
|
|
4179
|
+
}], statusBar: [{
|
|
4180
|
+
type: ContentChild,
|
|
4181
|
+
args: [FilterStatusBarDirective]
|
|
4182
|
+
}], keywordMatInput: [{
|
|
4183
|
+
type: ViewChild,
|
|
4184
|
+
args: ['keywordMatInput', { read: MatInput }]
|
|
4185
|
+
}], showFilterMenu: [{
|
|
4186
|
+
type: HostBinding,
|
|
4187
|
+
args: ['class.filters-open']
|
|
4188
|
+
}], windowDesktop: [{
|
|
4189
|
+
type: HostBinding,
|
|
4190
|
+
args: ['class.window-desktop']
|
|
4191
|
+
}], fsFilterClass: [{
|
|
4192
|
+
type: HostBinding,
|
|
4193
|
+
args: ['class.fs-filter']
|
|
4194
|
+
}], hasKeyword: [{
|
|
4195
|
+
type: HostBinding,
|
|
4196
|
+
args: ['class.has-keyword']
|
|
4197
|
+
}] } });
|
|
4198
|
+
|
|
4199
|
+
class SelectBackdropComponent {
|
|
4200
|
+
constructor() { }
|
|
4201
|
+
}
|
|
4202
|
+
SelectBackdropComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SelectBackdropComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
4203
|
+
SelectBackdropComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: SelectBackdropComponent, selector: "filter-item-select-backdrop", ngImport: i0, template: "", styles: [":host{position:absolute;z-index:1002;inset:0}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
4204
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SelectBackdropComponent, decorators: [{
|
|
4205
|
+
type: Component,
|
|
4206
|
+
args: [{ selector: 'filter-item-select-backdrop', changeDetection: ChangeDetectionStrategy.OnPush, template: "", styles: [":host{position:absolute;z-index:1002;inset:0}\n"] }]
|
|
4207
|
+
}], ctorParameters: function () { return []; } });
|
|
4208
|
+
|
|
4209
|
+
class FsSavedFiltersMenuComponent {
|
|
4210
|
+
constructor(_itemsStore, _externalParams, _savedFilters) {
|
|
4211
|
+
this._itemsStore = _itemsStore;
|
|
4212
|
+
this._externalParams = _externalParams;
|
|
4213
|
+
this._savedFilters = _savedFilters;
|
|
4214
|
+
this.select = new EventEmitter();
|
|
4215
|
+
this.clear = new EventEmitter();
|
|
4216
|
+
this.manage = new EventEmitter();
|
|
4217
|
+
}
|
|
4218
|
+
get filters$() {
|
|
4219
|
+
return this._savedFilters.savedFilters$;
|
|
4220
|
+
}
|
|
4221
|
+
get activeFilter$() {
|
|
4222
|
+
return this._savedFilters.activeFilter$;
|
|
4223
|
+
}
|
|
4224
|
+
selectFilter(savedFilter) {
|
|
4225
|
+
this._externalParams.setActiveSavedFilter(savedFilter);
|
|
4226
|
+
this.select.emit(savedFilter);
|
|
4227
|
+
}
|
|
4228
|
+
removeActiveFilter() {
|
|
4229
|
+
this._itemsStore.filtersClear();
|
|
4230
|
+
this._externalParams.setActiveSavedFilter(null);
|
|
4231
|
+
this.clear.emit();
|
|
4232
|
+
}
|
|
4233
|
+
manageFilters() {
|
|
4234
|
+
this.manage.emit();
|
|
4235
|
+
}
|
|
4236
|
+
}
|
|
4237
|
+
FsSavedFiltersMenuComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsSavedFiltersMenuComponent, deps: [{ token: FsFilterItemsStore }, { token: ExternalParamsController }, { token: SavedFiltersController }], target: i0.ɵɵFactoryTarget.Component });
|
|
4238
|
+
FsSavedFiltersMenuComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", 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", "buttonType", "buttonColor"], outputs: ["opened", "closed"] }], directives: [{ type: i3$3.FsMenuTriggerDirective, selector: "[fsMenuTriggerFor]", inputs: ["fsMenuTriggerFor"] }, { type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3$3.FsMenuItemDirective, selector: "fs-menu-group,[fs-menu-item]" }, { type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], pipes: { "async": i3.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
4239
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsSavedFiltersMenuComponent, decorators: [{
|
|
4240
|
+
type: Component,
|
|
4241
|
+
args: [{ selector: 'fs-filter-saved-filters-menu', changeDetection: ChangeDetectionStrategy.OnPush, template: "<a [fsMenuTriggerFor]=\"menu\" class=\"selector\">{{ (activeFilter$ | async)?.name || 'Not selected' }}</a>\n\n<fs-menu #menu>\n <ng-container *ngIf=\"activeFilter$ | async\">\n <ng-template fs-menu-item (click)=\"removeActiveFilter()\">\n None\n </ng-template>\n </ng-container>\n <ng-container *ngFor=\"let filter of filters$ | async\">\n <ng-template fs-menu-item (click)=\"selectFilter(filter)\">\n {{ filter.name }}\n </ng-template>\n </ng-container>\n <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"] }]
|
|
4242
|
+
}], ctorParameters: function () { return [{ type: FsFilterItemsStore }, { type: ExternalParamsController }, { type: SavedFiltersController }]; }, propDecorators: { select: [{
|
|
4243
|
+
type: Output
|
|
4244
|
+
}], clear: [{
|
|
4245
|
+
type: Output
|
|
4246
|
+
}], manage: [{
|
|
4247
|
+
type: Output
|
|
4248
|
+
}] } });
|
|
4249
|
+
|
|
4250
|
+
class FsFilterModule {
|
|
4251
|
+
static forRoot(config = {}) {
|
|
4252
|
+
return {
|
|
4253
|
+
ngModule: FsFilterModule,
|
|
4254
|
+
providers: [
|
|
4255
|
+
{
|
|
4256
|
+
provide: FS_FILTER_CONFIG,
|
|
4257
|
+
useValue: {
|
|
4258
|
+
button: {
|
|
4259
|
+
label: '',
|
|
4260
|
+
},
|
|
4261
|
+
...config,
|
|
4262
|
+
},
|
|
4263
|
+
},
|
|
4264
|
+
],
|
|
4265
|
+
};
|
|
4266
|
+
}
|
|
4267
|
+
}
|
|
4268
|
+
FsFilterModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsFilterModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
4269
|
+
FsFilterModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsFilterModule, declarations: [BaseItemComponent,
|
|
4270
|
+
FilterComponent,
|
|
4271
|
+
FilterItemComponent,
|
|
4272
|
+
FsFilterChipsComponent,
|
|
4273
|
+
SelectComponent,
|
|
4274
|
+
SelectGroupsComponent,
|
|
4275
|
+
SelectSimpleComponent,
|
|
4276
|
+
SelectMultipleComponent,
|
|
4277
|
+
ChipsComponent,
|
|
4278
|
+
TextComponent,
|
|
4279
|
+
WeekComponent,
|
|
4280
|
+
RangeComponent,
|
|
4281
|
+
AutocompleteComponent,
|
|
4282
|
+
AutocompletechipsComponent,
|
|
4283
|
+
DateComponent,
|
|
4284
|
+
DateRangeComponent,
|
|
4285
|
+
CheckboxComponent,
|
|
4286
|
+
FilterDrawerComponent,
|
|
4287
|
+
SelectBackdropComponent,
|
|
4288
|
+
FsFilterChipComponent,
|
|
4289
|
+
FsFilterChipContentComponent,
|
|
4290
|
+
FsFilterDrawerActionsComponent,
|
|
4291
|
+
FsFilterSavedFilterEditComponent,
|
|
4292
|
+
FsSavedFiltersMenuComponent,
|
|
4293
|
+
FsFilterActionsComponent,
|
|
4294
|
+
FsFilterActionButtonComponent,
|
|
4295
|
+
FsFilterActionKebabActionsComponent,
|
|
4296
|
+
FilterStatusBarDirective,
|
|
4297
|
+
FocusToItemDirective,
|
|
4298
|
+
// Pipes
|
|
4299
|
+
FsFilterIsolateValues], imports: [CommonModule,
|
|
4300
|
+
RouterModule,
|
|
4301
|
+
FormsModule,
|
|
4302
|
+
ReactiveFormsModule,
|
|
4303
|
+
MatIconModule,
|
|
4304
|
+
MatInputModule,
|
|
4305
|
+
MatSelectModule,
|
|
4306
|
+
MatChipsModule,
|
|
4307
|
+
MatCheckboxModule,
|
|
4308
|
+
MatAutocompleteModule,
|
|
4309
|
+
MatButtonModule,
|
|
4310
|
+
MatDialogModule,
|
|
4311
|
+
FsChipModule,
|
|
4312
|
+
FsCommonModule,
|
|
4313
|
+
FsStoreModule,
|
|
4314
|
+
FsDatePickerModule,
|
|
4315
|
+
FsLabelModule,
|
|
4316
|
+
FsAutocompleteModule,
|
|
4317
|
+
FsAutocompleteChipsModule,
|
|
4318
|
+
FsScrollModule,
|
|
4319
|
+
FsMenuModule,
|
|
4320
|
+
FsSkeletonModule,
|
|
4321
|
+
FsFormModule,
|
|
4322
|
+
FsFileModule,
|
|
4323
|
+
FsClearModule,
|
|
4324
|
+
FsPopoverModule,
|
|
4325
|
+
PortalModule], exports: [FilterComponent,
|
|
4326
|
+
FilterStatusBarDirective,
|
|
4327
|
+
FsSavedFiltersMenuComponent] });
|
|
4328
|
+
FsFilterModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsFilterModule, providers: [
|
|
4329
|
+
FsStore,
|
|
4330
|
+
], imports: [[
|
|
4331
|
+
CommonModule,
|
|
4332
|
+
RouterModule,
|
|
4333
|
+
FormsModule,
|
|
4334
|
+
ReactiveFormsModule,
|
|
4335
|
+
MatIconModule,
|
|
4336
|
+
MatInputModule,
|
|
4337
|
+
MatSelectModule,
|
|
4338
|
+
MatChipsModule,
|
|
4339
|
+
MatCheckboxModule,
|
|
4340
|
+
MatAutocompleteModule,
|
|
4341
|
+
MatButtonModule,
|
|
4342
|
+
MatDialogModule,
|
|
4343
|
+
FsChipModule,
|
|
4344
|
+
FsCommonModule,
|
|
4345
|
+
FsStoreModule,
|
|
4346
|
+
FsDatePickerModule,
|
|
4347
|
+
FsLabelModule,
|
|
4348
|
+
FsAutocompleteModule,
|
|
4349
|
+
FsAutocompleteChipsModule,
|
|
4350
|
+
FsScrollModule,
|
|
4351
|
+
FsMenuModule,
|
|
4352
|
+
FsSkeletonModule,
|
|
4353
|
+
FsFormModule,
|
|
4354
|
+
FsFileModule,
|
|
4355
|
+
FsClearModule,
|
|
4356
|
+
FsPopoverModule,
|
|
4357
|
+
PortalModule,
|
|
4358
|
+
]] });
|
|
4359
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsFilterModule, decorators: [{
|
|
4360
|
+
type: NgModule,
|
|
4361
|
+
args: [{
|
|
4362
|
+
imports: [
|
|
4363
|
+
CommonModule,
|
|
4364
|
+
RouterModule,
|
|
4365
|
+
FormsModule,
|
|
4366
|
+
ReactiveFormsModule,
|
|
4367
|
+
MatIconModule,
|
|
4368
|
+
MatInputModule,
|
|
4369
|
+
MatSelectModule,
|
|
4370
|
+
MatChipsModule,
|
|
4371
|
+
MatCheckboxModule,
|
|
4372
|
+
MatAutocompleteModule,
|
|
4373
|
+
MatButtonModule,
|
|
4374
|
+
MatDialogModule,
|
|
4375
|
+
FsChipModule,
|
|
4376
|
+
FsCommonModule,
|
|
4377
|
+
FsStoreModule,
|
|
4378
|
+
FsDatePickerModule,
|
|
4379
|
+
FsLabelModule,
|
|
4380
|
+
FsAutocompleteModule,
|
|
4381
|
+
FsAutocompleteChipsModule,
|
|
4382
|
+
FsScrollModule,
|
|
4383
|
+
FsMenuModule,
|
|
4384
|
+
FsSkeletonModule,
|
|
4385
|
+
FsFormModule,
|
|
4386
|
+
FsFileModule,
|
|
4387
|
+
FsClearModule,
|
|
4388
|
+
FsPopoverModule,
|
|
4389
|
+
PortalModule,
|
|
4390
|
+
],
|
|
4391
|
+
declarations: [
|
|
4392
|
+
BaseItemComponent,
|
|
4393
|
+
FilterComponent,
|
|
4394
|
+
FilterItemComponent,
|
|
4395
|
+
FsFilterChipsComponent,
|
|
4396
|
+
SelectComponent,
|
|
4397
|
+
SelectGroupsComponent,
|
|
4398
|
+
SelectSimpleComponent,
|
|
4399
|
+
SelectMultipleComponent,
|
|
4400
|
+
ChipsComponent,
|
|
4401
|
+
TextComponent,
|
|
4402
|
+
WeekComponent,
|
|
4403
|
+
RangeComponent,
|
|
4404
|
+
AutocompleteComponent,
|
|
4405
|
+
AutocompletechipsComponent,
|
|
4406
|
+
DateComponent,
|
|
4407
|
+
DateRangeComponent,
|
|
4408
|
+
CheckboxComponent,
|
|
4409
|
+
FilterDrawerComponent,
|
|
4410
|
+
SelectBackdropComponent,
|
|
4411
|
+
FsFilterChipComponent,
|
|
4412
|
+
FsFilterChipContentComponent,
|
|
4413
|
+
FsFilterDrawerActionsComponent,
|
|
4414
|
+
FsFilterSavedFilterEditComponent,
|
|
4415
|
+
FsSavedFiltersMenuComponent,
|
|
4416
|
+
FsFilterActionsComponent,
|
|
4417
|
+
FsFilterActionButtonComponent,
|
|
4418
|
+
FsFilterActionKebabActionsComponent,
|
|
4419
|
+
FilterStatusBarDirective,
|
|
4420
|
+
FocusToItemDirective,
|
|
4421
|
+
// Pipes
|
|
4422
|
+
FsFilterIsolateValues,
|
|
4423
|
+
],
|
|
4424
|
+
providers: [
|
|
4425
|
+
FsStore,
|
|
4426
|
+
],
|
|
4427
|
+
exports: [
|
|
4428
|
+
FilterComponent,
|
|
4429
|
+
FilterStatusBarDirective,
|
|
4430
|
+
FsSavedFiltersMenuComponent,
|
|
4431
|
+
],
|
|
4432
|
+
}]
|
|
4433
|
+
}] });
|
|
4434
|
+
|
|
4435
|
+
// Controllers
|
|
4436
|
+
|
|
4437
|
+
/**
|
|
4438
|
+
* Generated bundle index. Do not edit.
|
|
4439
|
+
*/
|
|
4440
|
+
|
|
4441
|
+
export { ActionMode, ActionType, AutocompleteChipsItem, AutocompleteItem, BaseItem, ButtonStyle, CheckboxItem, ChipsItem, DateItem, DateRangeItem, DateTimeItem, DateTimeRangeItem, ExternalParamsController, FS_FILTER_CONFIG, FilterComponent, FilterItemComponent, FilterStatusBarDirective, FsFilterModule, FsSavedFiltersMenuComponent, ItemDateMode, ItemType, QUERY_PARAM_DELIMITER, RangeItem, SavedFiltersController, SelectItem, TextItem, buildQueryParams, filterFromQueryParam, filterToQueryParam };
|
|
4442
|
+
//# sourceMappingURL=firestitch-filter.mjs.map
|