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