@elderbyte/ngx-starter 17.11.0-beta4 → 17.11.0-beta6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/esm2022/lib/components/forms/search/domain/input/search-input-state.mjs +6 -6
  2. package/esm2022/lib/components/forms/search/domain/input/search-input.mjs +1 -1
  3. package/esm2022/lib/components/forms/search/elder-search-context.directive.mjs +10 -10
  4. package/esm2022/lib/components/forms/search/elder-search-input.directive.mjs +14 -29
  5. package/esm2022/lib/components/forms/search/search-box/elder-search-box.component.mjs +4 -4
  6. package/esm2022/lib/components/select/elder-select.module.mjs +15 -15
  7. package/esm2022/lib/components/select/filter/elder-chip-filter-style-resolver.mjs +19 -15
  8. package/esm2022/lib/components/select/filter/elder-chips-include-exclude.directive.mjs +144 -0
  9. package/esm2022/lib/components/select/filter/elder-filter-chip-template/elder-filter-chip-template.component.mjs +24 -31
  10. package/esm2022/lib/components/select/filter/include-exclude-model-filter-adapter.mjs +63 -0
  11. package/esm2022/lib/components/select/filter/include-exclude-selection-model.mjs +76 -20
  12. package/esm2022/lib/components/select/multi/elder-multi-select-chips/elder-multi-select-chips.component.mjs +7 -2
  13. package/esm2022/lib/components/select/multi/elder-search-include-exclude.directive.mjs +117 -43
  14. package/fesm2022/elderbyte-ngx-starter.mjs +741 -649
  15. package/fesm2022/elderbyte-ngx-starter.mjs.map +1 -1
  16. package/lib/components/forms/search/domain/input/search-input-state.d.ts +3 -3
  17. package/lib/components/forms/search/domain/input/search-input.d.ts +2 -6
  18. package/lib/components/forms/search/elder-search-context.directive.d.ts +3 -3
  19. package/lib/components/forms/search/elder-search-input.directive.d.ts +7 -11
  20. package/lib/components/forms/search/search-box/elder-search-box.component.d.ts +2 -1
  21. package/lib/components/select/elder-select.module.d.ts +4 -4
  22. package/lib/components/select/filter/elder-chip-filter-style-resolver.d.ts +1 -1
  23. package/lib/components/select/filter/{elder-chips-filter.directive.d.ts → elder-chips-include-exclude.directive.d.ts} +20 -9
  24. package/lib/components/select/filter/elder-filter-chip-template/elder-filter-chip-template.component.d.ts +9 -14
  25. package/lib/components/select/filter/include-exclude-model-filter-adapter.d.ts +29 -0
  26. package/lib/components/select/filter/include-exclude-selection-model.d.ts +25 -7
  27. package/lib/components/select/multi/elder-multi-select-chips/elder-multi-select-chips.component.d.ts +2 -0
  28. package/lib/components/select/multi/elder-search-include-exclude.directive.d.ts +57 -17
  29. package/package.json +1 -1
  30. package/esm2022/lib/components/forms/search/filter/include-exclude-input-converter.mjs +0 -137
  31. package/esm2022/lib/components/select/filter/elder-chips-filter.directive.mjs +0 -93
  32. package/lib/components/forms/search/filter/include-exclude-input-converter.d.ts +0 -62
@@ -6,7 +6,7 @@ export declare class SearchInputState {
6
6
  /**
7
7
  * attribute The name
8
8
  */
9
- readonly attribute: string;
9
+ readonly queryKey: string;
10
10
  /**
11
11
  * value of the input
12
12
  */
@@ -19,7 +19,7 @@ export declare class SearchInputState {
19
19
  * Was the input changed by a user interaction
20
20
  */
21
21
  readonly userEvent: boolean;
22
- static of(attribute: string, filters: Filter[], pristine: boolean, userEvent: boolean): SearchInputState;
22
+ static of(queryKey: string, filters: Filter[], pristine: boolean, userEvent: boolean): SearchInputState;
23
23
  static unknown(): SearchInputState;
24
24
  /***************************************************************************
25
25
  * *
@@ -30,7 +30,7 @@ export declare class SearchInputState {
30
30
  /**
31
31
  * attribute The name
32
32
  */
33
- attribute: string,
33
+ queryKey: string,
34
34
  /**
35
35
  * value of the input
36
36
  */
@@ -6,13 +6,9 @@ import { Filter } from '../../../../../common/data/filters/filter';
6
6
  */
7
7
  export interface SearchInput {
8
8
  /**
9
- * The search input name
9
+ * The search input queryKey
10
10
  */
11
- readonly name: string;
12
- /**
13
- * The search input name query key
14
- */
15
- readonly queryKey?: string;
11
+ readonly queryKey: string;
16
12
  readonly state$: Observable<SearchInputState>;
17
13
  /**
18
14
  * States if the search name is cannot be changed.
@@ -69,7 +69,7 @@ export declare class ElderSearchContextDirective implements OnInit, AfterViewIni
69
69
  /**
70
70
  * Returns the current user touched attributes. (ignoring fallbacks)
71
71
  */
72
- get userDefinedAttributes$(): Observable<SearchInputState[]>;
72
+ get touchedSearchInputs$(): Observable<SearchInputState[]>;
73
73
  /***************************************************************************
74
74
  * *
75
75
  * Public API *
@@ -93,9 +93,9 @@ export declare class ElderSearchContextDirective implements OnInit, AfterViewIni
93
93
  private applyToBoundFilterContext;
94
94
  private applySearchContextToInputs;
95
95
  private applyFiltersToInputs;
96
- private saveInitialFitlers;
96
+ private saveInitialFilters;
97
97
  private buildFilterValueMap;
98
- private searchInputsByName;
98
+ private searchInputsByQueryKey;
99
99
  private convertToFilters;
100
100
  static ɵfac: i0.ɵɵFactoryDeclaration<ElderSearchContextDirective, never>;
101
101
  static ɵdir: i0.ɵɵDirectiveDeclaration<ElderSearchContextDirective, "[elderSearchContext]", ["elderSearchContext"], { "searchContextId": { "alias": "searchContextId"; "required": false; }; "filterContext": { "alias": "elderSearchContext"; "required": false; }; "forcedFilters": { "alias": "forcedFilters"; "required": false; }; }, {}, never, never, true, never>;
@@ -1,20 +1,20 @@
1
- import { AfterViewInit, OnDestroy, OnInit } from '@angular/core';
1
+ import { AfterViewInit, DestroyRef, OnInit } from '@angular/core';
2
2
  import { ElderSearchContextDirective } from './elder-search-context.directive';
3
3
  import { Observable } from 'rxjs/internal/Observable';
4
4
  import { NgModel } from '@angular/forms';
5
5
  import { SearchInput } from './domain/input/search-input';
6
6
  import { SearchInputState } from './domain/input/search-input-state';
7
- import { LocalPagedDataSource } from '../../../common/data/datasource/local/local-paged-data-source';
8
7
  import { BooleanInput } from '@angular/cdk/coercion';
9
8
  import { InputFilterConverter } from './filter/input-filter-converter';
10
9
  import { Filter } from '../../../common/data/filters/filter';
11
10
  import * as i0 from "@angular/core";
12
11
  /**
13
- * Search name adapter for input controls.
12
+ * Binds the control value (ngModel) to a SearchContexts Filter.
14
13
  */
15
- export declare class ElderSearchInputDirective implements SearchInput, OnInit, AfterViewInit, OnDestroy {
14
+ export declare class ElderSearchInputDirective implements SearchInput, OnInit, AfterViewInit {
16
15
  private searchContext;
17
16
  private ngModel;
17
+ private destroyRef;
18
18
  /***************************************************************************
19
19
  * *
20
20
  * Fields *
@@ -34,7 +34,6 @@ export declare class ElderSearchInputDirective implements SearchInput, OnInit, A
34
34
  * value = "type.id"
35
35
  */
36
36
  resolvePath: string;
37
- dataSource: LocalPagedDataSource<any>;
38
37
  /**
39
38
  * (Optional) Use this value for the query if none is provided.
40
39
  */
@@ -42,13 +41,12 @@ export declare class ElderSearchInputDirective implements SearchInput, OnInit, A
42
41
  valueAsId: BooleanInput;
43
42
  private _inputConverter;
44
43
  private readonly _state$;
45
- private readonly destroy$;
46
44
  /***************************************************************************
47
45
  * *
48
46
  * Constructor *
49
47
  * *
50
48
  **************************************************************************/
51
- constructor(searchContext: ElderSearchContextDirective, ngModel: NgModel);
49
+ constructor(searchContext: ElderSearchContextDirective, ngModel: NgModel, destroyRef: DestroyRef);
52
50
  /***************************************************************************
53
51
  * *
54
52
  * Life Cycle *
@@ -56,7 +54,6 @@ export declare class ElderSearchInputDirective implements SearchInput, OnInit, A
56
54
  **************************************************************************/
57
55
  ngOnInit(): void;
58
56
  ngAfterViewInit(): void;
59
- ngOnDestroy(): void;
60
57
  /***************************************************************************
61
58
  * *
62
59
  * Properties *
@@ -71,7 +68,6 @@ export declare class ElderSearchInputDirective implements SearchInput, OnInit, A
71
68
  set inputConverter(inputConverter: InputFilterConverter);
72
69
  get initialDone$(): Observable<void>;
73
70
  get state$(): Observable<SearchInputState>;
74
- get name(): string;
75
71
  get value(): any;
76
72
  get readonly(): boolean;
77
73
  private get hasFallback();
@@ -105,6 +101,6 @@ export declare class ElderSearchInputDirective implements SearchInput, OnInit, A
105
101
  private resolveSingleValue;
106
102
  private extractName;
107
103
  private concatIfNecessary;
108
- static ɵfac: i0.ɵɵFactoryDeclaration<ElderSearchInputDirective, [null, { host: true; }]>;
109
- static ɵdir: i0.ɵɵDirectiveDeclaration<ElderSearchInputDirective, "[elderSearchInput]", ["elderSearchInput"], { "valueTransform": { "alias": "elderSearchInputTransform"; "required": false; }; "resolvePath": { "alias": "elderSearchInput"; "required": false; }; "dataSource": { "alias": "dataSource"; "required": false; }; "fallbackValue": { "alias": "elderSearchInputFallback"; "required": false; }; "valueAsId": { "alias": "valueAsId"; "required": false; }; "queryKey": { "alias": "elderSearchInputKey"; "required": false; }; }, {}, never, never, true, never>;
104
+ static ɵfac: i0.ɵɵFactoryDeclaration<ElderSearchInputDirective, [null, { host: true; }, null]>;
105
+ static ɵdir: i0.ɵɵDirectiveDeclaration<ElderSearchInputDirective, "[elderSearchInput]", ["elderSearchInput"], { "valueTransform": { "alias": "elderSearchInputTransform"; "required": false; }; "resolvePath": { "alias": "elderSearchInput"; "required": false; }; "fallbackValue": { "alias": "elderSearchInputFallback"; "required": false; }; "valueAsId": { "alias": "valueAsId"; "required": false; }; "queryKey": { "alias": "elderSearchInputKey"; "required": false; }; }, {}, never, never, true, never>;
110
106
  }
@@ -4,6 +4,7 @@ import { ElderSearchPanelComponent } from './elder-search-panel.component';
4
4
  import { BehaviorSubject, Observable } from 'rxjs';
5
5
  import { BooleanInput } from '@angular/cdk/coercion';
6
6
  import { MatFormFieldAppearance } from '@angular/material/form-field';
7
+ import { SearchInputState } from '../domain/input/search-input-state';
7
8
  import * as i0 from "@angular/core";
8
9
  export declare class OverlayState {
9
10
  hasOverlay: boolean;
@@ -38,7 +39,7 @@ export declare class ElderSearchBoxComponent implements OnDestroy, AfterContentI
38
39
  private _dense;
39
40
  autocomplete: string;
40
41
  appearance: MatFormFieldAppearance;
41
- readonly userFilters$: Observable<any[]>;
42
+ readonly touchedSearchInputs$: Observable<SearchInputState[]>;
42
43
  /***************************************************************************
43
44
  * *
44
45
  * Constructor *
@@ -36,7 +36,7 @@ import * as i34 from "./multi/elder-multi-select-chip-options/elder-multi-select
36
36
  import * as i35 from "./multi/elder-chip-select-option/elder-select-option.component";
37
37
  import * as i36 from "./multi/elder-mutli-select-all-directive";
38
38
  import * as i37 from "./auto/elder-auto-select-suggest-first.directive";
39
- import * as i38 from "./filter/elder-chips-filter.directive";
39
+ import * as i38 from "./filter/elder-chips-include-exclude.directive";
40
40
  import * as i39 from "./filter/elder-filter-chip-template/elder-filter-chip-template.component";
41
41
  import * as i40 from "./multi/elder-search-include-exclude.directive";
42
42
  export { ElderSelectValueDirective } from './elder-select-value.directive';
@@ -54,12 +54,12 @@ export { ElderAutoSelectFirstDirective } from './auto/elder-auto-select-first.di
54
54
  export { ElderClearSelectDirective } from './single/elder-clear-select.directive';
55
55
  export { ElderMultiSelectAllInitialDirective } from './multi/elder-mutli-select-all-directive';
56
56
  export { ElderAutoSelectSuggestFirstDirective } from './auto/elder-auto-select-suggest-first.directive';
57
- export { ElderChipsFilterDirective } from './filter/elder-chips-filter.directive';
58
- export { ElderFilterChipTemplate } from './filter/elder-filter-chip-template/elder-filter-chip-template.component';
57
+ export { ElderChipsIncludeExcludeDirective } from './filter/elder-chips-include-exclude.directive';
58
+ export { ElderFilterChipTemplateComponent } from './filter/elder-filter-chip-template/elder-filter-chip-template.component';
59
59
  export * from './filter/include-exclude-selection-model';
60
60
  export { ElderSearchIncludeExcludeDirective } from './multi/elder-search-include-exclude.directive';
61
61
  export declare class ElderSelectModule {
62
62
  static ɵfac: i0.ɵɵFactoryDeclaration<ElderSelectModule, never>;
63
- static ɵmod: i0.ɵɵNgModuleDeclaration<ElderSelectModule, never, [typeof i1.CommonModule, typeof i2.FormsModule, typeof i2.ReactiveFormsModule, typeof i3.MatFormFieldModule, typeof i4.MatIconModule, typeof i5.MatSelectModule, typeof i6.MatDialogModule, typeof i7.MatButtonModule, typeof i8.MatInputModule, typeof i9.MatAutocompleteModule, typeof i10.MatToolbarModule, typeof i11.MatProgressBarModule, typeof i12.MatProgressSpinnerModule, typeof i13.MatChipsModule, typeof i14.MatTooltipModule, typeof i15.CdkDropList, typeof i15.CdkDrag, typeof i16.TranslateModule, typeof i17.ElderFormsDirectivesModule, typeof i18.ElderTableModule, typeof i19.ElderInfiniteScrollModule, typeof i20.ElderAutocompleteModule, typeof i21.ElderPipesModule, typeof i22.ElderThemeModule, typeof i23.ElderChipsModule, typeof i1.AsyncPipe, typeof i1.AsyncPipe, typeof i24.ElderSelectComponent, typeof i25.ElderSelectValueDirective, typeof i26.TemplatedSelectionDialogComponent, typeof i27.SelectionModelPopupDirective, typeof i28.ElderSelectionPopupTriggerAdapterDirective, typeof i29.ElderSelectOnTabDirective, typeof i30.ElderMultiSelectChipsComponent, typeof i31.ElderSelectChipDirective, typeof i31.ElderSelectChipAvatarDirective, typeof i32.ElderAutoSelectFirstDirective, typeof i33.ElderClearSelectDirective, typeof i31.ElderSelectCustomInputDirective, typeof i34.ElderMultiSelectChipOptionsComponent, typeof i35.ElderSelectOptionComponent, typeof i36.ElderMultiSelectAllInitialDirective, typeof i37.ElderAutoSelectSuggestFirstDirective, typeof i38.ElderChipsFilterDirective, typeof i39.ElderFilterChipTemplate, typeof i40.ElderSearchIncludeExcludeDirective], [typeof i24.ElderSelectComponent, typeof i25.ElderSelectValueDirective, typeof i26.TemplatedSelectionDialogComponent, typeof i27.SelectionModelPopupDirective, typeof i28.ElderSelectionPopupTriggerAdapterDirective, typeof i30.ElderMultiSelectChipsComponent, typeof i31.ElderSelectChipDirective, typeof i31.ElderSelectChipAvatarDirective, typeof i32.ElderAutoSelectFirstDirective, typeof i33.ElderClearSelectDirective, typeof i31.ElderSelectCustomInputDirective, typeof i34.ElderMultiSelectChipOptionsComponent, typeof i35.ElderSelectOptionComponent, typeof i36.ElderMultiSelectAllInitialDirective, typeof i37.ElderAutoSelectSuggestFirstDirective, typeof i38.ElderChipsFilterDirective, typeof i39.ElderFilterChipTemplate, typeof i40.ElderSearchIncludeExcludeDirective]>;
63
+ static ɵmod: i0.ɵɵNgModuleDeclaration<ElderSelectModule, never, [typeof i1.CommonModule, typeof i2.FormsModule, typeof i2.ReactiveFormsModule, typeof i3.MatFormFieldModule, typeof i4.MatIconModule, typeof i5.MatSelectModule, typeof i6.MatDialogModule, typeof i7.MatButtonModule, typeof i8.MatInputModule, typeof i9.MatAutocompleteModule, typeof i10.MatToolbarModule, typeof i11.MatProgressBarModule, typeof i12.MatProgressSpinnerModule, typeof i13.MatChipsModule, typeof i14.MatTooltipModule, typeof i15.CdkDropList, typeof i15.CdkDrag, typeof i16.TranslateModule, typeof i17.ElderFormsDirectivesModule, typeof i18.ElderTableModule, typeof i19.ElderInfiniteScrollModule, typeof i20.ElderAutocompleteModule, typeof i21.ElderPipesModule, typeof i22.ElderThemeModule, typeof i23.ElderChipsModule, typeof i1.AsyncPipe, typeof i1.AsyncPipe, typeof i24.ElderSelectComponent, typeof i25.ElderSelectValueDirective, typeof i26.TemplatedSelectionDialogComponent, typeof i27.SelectionModelPopupDirective, typeof i28.ElderSelectionPopupTriggerAdapterDirective, typeof i29.ElderSelectOnTabDirective, typeof i30.ElderMultiSelectChipsComponent, typeof i31.ElderSelectChipDirective, typeof i31.ElderSelectChipAvatarDirective, typeof i32.ElderAutoSelectFirstDirective, typeof i33.ElderClearSelectDirective, typeof i31.ElderSelectCustomInputDirective, typeof i34.ElderMultiSelectChipOptionsComponent, typeof i35.ElderSelectOptionComponent, typeof i36.ElderMultiSelectAllInitialDirective, typeof i37.ElderAutoSelectSuggestFirstDirective, typeof i38.ElderChipsIncludeExcludeDirective, typeof i39.ElderFilterChipTemplateComponent, typeof i40.ElderSearchIncludeExcludeDirective], [typeof i24.ElderSelectComponent, typeof i25.ElderSelectValueDirective, typeof i26.TemplatedSelectionDialogComponent, typeof i27.SelectionModelPopupDirective, typeof i28.ElderSelectionPopupTriggerAdapterDirective, typeof i30.ElderMultiSelectChipsComponent, typeof i31.ElderSelectChipDirective, typeof i31.ElderSelectChipAvatarDirective, typeof i32.ElderAutoSelectFirstDirective, typeof i33.ElderClearSelectDirective, typeof i31.ElderSelectCustomInputDirective, typeof i34.ElderMultiSelectChipOptionsComponent, typeof i35.ElderSelectOptionComponent, typeof i36.ElderMultiSelectAllInitialDirective, typeof i37.ElderAutoSelectSuggestFirstDirective, typeof i38.ElderChipsIncludeExcludeDirective, typeof i39.ElderFilterChipTemplateComponent, typeof i40.ElderSearchIncludeExcludeDirective]>;
64
64
  static ɵinj: i0.ɵɵInjectorDeclaration<ElderSelectModule>;
65
65
  }
@@ -15,5 +15,5 @@ export default class ElderChipFilterStyleResolver {
15
15
  * *
16
16
  **************************************************************************/
17
17
  resolveChipSpec(filterEntity: IncludeExcludeState): SelectChipSpec;
18
- resolveAvatar(filterEntity: IncludeExcludeState): string;
18
+ resolveAvatarIcon(filterEntity: IncludeExcludeState): string;
19
19
  }
@@ -1,11 +1,14 @@
1
1
  import { DestroyRef, ViewContainerRef } from '@angular/core';
2
2
  import { ElderMultiSelectChipsComponent } from '../multi/elder-multi-select-chips/elder-multi-select-chips.component';
3
- import { ElderSearchInputDirective } from '../../forms/search/elder-search-input.directive';
4
- import { IncludeExcludeSelectionModel } from './include-exclude-selection-model';
3
+ import { IncludeExcludeCycleStrategy, IncludeExcludeSelectionModel } from './include-exclude-selection-model';
5
4
  import * as i0 from "@angular/core";
6
- export declare class ElderChipsFilterDirective<T = any> {
5
+ /**
6
+ * Adds the ability to toggle select chips of a ElderMultiSelectChipsComponent by
7
+ * binding it to a IncludeExcludeSelectionModel.
8
+ */
9
+ export declare class ElderChipsIncludeExcludeDirective<T = any> {
7
10
  readonly elderMultiSelectChips: ElderMultiSelectChipsComponent;
8
- readonly elderSearchInput: ElderSearchInputDirective;
11
+ readonly selectionModel: IncludeExcludeSelectionModel;
9
12
  readonly vcr: ViewContainerRef;
10
13
  private readonly destroyRef;
11
14
  /***************************************************************************
@@ -14,26 +17,34 @@ export declare class ElderChipsFilterDirective<T = any> {
14
17
  * *
15
18
  **************************************************************************/
16
19
  private readonly log;
17
- readonly selectionModel: IncludeExcludeSelectionModel;
18
20
  private readonly chipStyleResolver;
19
21
  /***************************************************************************
20
22
  * *
21
23
  * Constructor *
22
24
  * *
23
25
  **************************************************************************/
24
- constructor(elderMultiSelectChips: ElderMultiSelectChipsComponent, elderSearchInput: ElderSearchInputDirective, vcr: ViewContainerRef, destroyRef: DestroyRef);
26
+ constructor(elderMultiSelectChips: ElderMultiSelectChipsComponent, selectionModel: IncludeExcludeSelectionModel, vcr: ViewContainerRef, destroyRef: DestroyRef);
27
+ /***************************************************************************
28
+ * *
29
+ * Properties *
30
+ * *
31
+ **************************************************************************/
32
+ set cycleStrategy(strategy: IncludeExcludeCycleStrategy);
25
33
  /***************************************************************************
26
34
  * *
27
35
  * Private methods *
28
36
  * *
29
37
  **************************************************************************/
30
38
  private setupFilterChips;
39
+ private createFilterChipTemplate;
31
40
  private setupElderMultiSelectChipsListeners;
32
41
  private resolveChipSpec;
33
- private resolveAvatar;
42
+ private resolveAvatarIcon;
34
43
  private handleChipClick;
44
+ private refreshChips;
45
+ private ensureChipsNoChanges;
35
46
  private findFilterEntityByEntity;
36
47
  private findFilterEntityById;
37
- static ɵfac: i0.ɵɵFactoryDeclaration<ElderChipsFilterDirective<any>, never>;
38
- static ɵdir: i0.ɵɵDirectiveDeclaration<ElderChipsFilterDirective<any>, "[elderChipsFilter]", never, {}, {}, never, never, true, never>;
48
+ static ɵfac: i0.ɵɵFactoryDeclaration<ElderChipsIncludeExcludeDirective<any>, never>;
49
+ static ɵdir: i0.ɵɵDirectiveDeclaration<ElderChipsIncludeExcludeDirective<any>, "[elderChipsIncludeExclude]", ["elderChipsIncludeExclude"], { "cycleStrategy": { "alias": "cycleStrategy"; "required": false; }; }, {}, never, never, true, never>;
39
50
  }
@@ -1,32 +1,27 @@
1
1
  import { TemplateRef } from '@angular/core';
2
2
  import { Observable } from 'rxjs';
3
3
  import * as i0 from "@angular/core";
4
- export declare class ElderFilterChipTemplate {
4
+ export declare class ElderFilterChipTemplateComponent {
5
5
  /***************************************************************************
6
6
  * *
7
7
  * Fields *
8
8
  * *
9
9
  **************************************************************************/
10
10
  private _avatarRef$;
11
- private _bodyRef$;
12
- private _resolveAvatar$;
11
+ avatarResolverFn: import("@angular/core").InputSignal<(id: string) => string>;
13
12
  /***************************************************************************
14
13
  * *
15
- * Constructor *
14
+ * Properties *
16
15
  * *
17
16
  **************************************************************************/
18
- constructor();
17
+ set avatarRef(avatarRef: TemplateRef<any>);
18
+ get avatarRef$(): Observable<TemplateRef<any>>;
19
19
  /***************************************************************************
20
20
  * *
21
- * Properties *
21
+ * Public API *
22
22
  * *
23
23
  **************************************************************************/
24
- set avatarRef(avatarRef: TemplateRef<any>);
25
- get avatarRef$(): Observable<TemplateRef<any>>;
26
- set bodyRef(avatarRef: TemplateRef<any>);
27
- get bodyRef$(): Observable<TemplateRef<any>>;
28
- set resolveAvatar(fn: (id: string) => string);
29
- get resolveAvatar$(): Observable<(id: string) => string>;
30
- static ɵfac: i0.ɵɵFactoryDeclaration<ElderFilterChipTemplate, never>;
31
- static ɵcmp: i0.ɵɵComponentDeclaration<ElderFilterChipTemplate, "elder-filter-chip-template", never, {}, {}, never, never, true, never>;
24
+ currentIcon(id: string): string;
25
+ static ɵfac: i0.ɵɵFactoryDeclaration<ElderFilterChipTemplateComponent, never>;
26
+ static ɵcmp: i0.ɵɵComponentDeclaration<ElderFilterChipTemplateComponent, "elder-filter-chip-template", never, { "avatarResolverFn": { "alias": "avatarResolverFn"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
32
27
  }
@@ -0,0 +1,29 @@
1
+ import { Filter } from '../../../common/data/filters/filter';
2
+ import { IncludeExcludeSelectionModel } from './include-exclude-selection-model';
3
+ export declare class IncludeExcludeModelFilterAdapter {
4
+ private readonly includeExcludeModel;
5
+ private readonly includeQueryKey;
6
+ private readonly excludeQueryKey;
7
+ /***************************************************************************
8
+ * *
9
+ * Constructors *
10
+ * *
11
+ **************************************************************************/
12
+ constructor(includeExcludeModel: IncludeExcludeSelectionModel, includeQueryKey: string, excludeQueryKey: string);
13
+ /***************************************************************************
14
+ * *
15
+ * Public API *
16
+ * *
17
+ **************************************************************************/
18
+ applyFilters(filters: Filter[]): void;
19
+ toFilters(): Filter[];
20
+ /***************************************************************************
21
+ * *
22
+ * Private methods *
23
+ * *
24
+ **************************************************************************/
25
+ private nonEmptyArrayOrNull;
26
+ private buildStates;
27
+ private convertFiltersToMap;
28
+ private findArrayOrNull;
29
+ }
@@ -1,14 +1,15 @@
1
1
  import { Observable } from 'rxjs';
2
2
  export declare class IncludeExcludeState {
3
3
  readonly id: string;
4
- mode: IncludeExcludeMode;
5
- constructor(id: string, mode: IncludeExcludeMode);
4
+ mode: IncludeExcludeValue;
5
+ constructor(id: string, mode: IncludeExcludeValue);
6
6
  }
7
- export declare enum IncludeExcludeMode {
7
+ export declare enum IncludeExcludeValue {
8
8
  NEUTRAL = "NEUTRAL",
9
9
  INCLUDE = "INCLUDE",
10
10
  EXCLUDE = "EXCLUDE"
11
11
  }
12
+ export type IncludeExcludeCycleStrategy = 'TOGGLE' | 'FULL_CYCLE';
12
13
  export declare class IncludeExcludeSelectionModel {
13
14
  /***************************************************************************
14
15
  * *
@@ -16,7 +17,15 @@ export declare class IncludeExcludeSelectionModel {
16
17
  * *
17
18
  **************************************************************************/
18
19
  private readonly log;
20
+ private _strategy;
21
+ private _defaultInitialValue;
19
22
  private readonly stateById$;
23
+ /***************************************************************************
24
+ * *
25
+ * Constructor *
26
+ * *
27
+ **************************************************************************/
28
+ constructor(strategy: IncludeExcludeCycleStrategy);
20
29
  /***************************************************************************
21
30
  * *
22
31
  * Properties *
@@ -24,23 +33,32 @@ export declare class IncludeExcludeSelectionModel {
24
33
  **************************************************************************/
25
34
  get selection(): IncludeExcludeState[];
26
35
  get selection$(): Observable<IncludeExcludeState[]>;
36
+ get strategy(): IncludeExcludeCycleStrategy;
37
+ set strategy(strategy: IncludeExcludeCycleStrategy);
38
+ get defaultInitialValue(): IncludeExcludeValue;
39
+ set defaultInitialValue(strategy: IncludeExcludeValue);
27
40
  /***************************************************************************
28
41
  * *
29
42
  * Public API *
30
43
  * *
31
44
  **************************************************************************/
45
+ findIncluded(): string[];
46
+ findExcluded(): string[];
32
47
  cycleExisting(id: string): IncludeExcludeState | null;
33
- initTo(ids: string[], initialMode?: IncludeExcludeMode): void;
48
+ initTo(ids: string[], initialValueOverride?: IncludeExcludeValue): void;
49
+ clear(): void;
34
50
  replaceSelection(newStates: IncludeExcludeState[]): void;
35
- updateState(id: string, mode: IncludeExcludeMode): IncludeExcludeState;
51
+ updateState(id: string, mode: IncludeExcludeValue): IncludeExcludeState;
36
52
  updateStates(newStates: IncludeExcludeState[]): void;
37
- isInMode(id: string, mode: IncludeExcludeMode): boolean;
53
+ isInMode(id: string, mode: IncludeExcludeValue): boolean;
38
54
  findStateById(searchedId: string): IncludeExcludeState | null;
39
55
  /***************************************************************************
40
56
  * *
41
57
  * Private methods *
42
58
  * *
43
59
  **************************************************************************/
44
- private cycleFilterEntitySelection;
60
+ private nextValueByStrategy;
61
+ private nextValueToggle;
62
+ private nextValueFullCycle;
45
63
  private toStateMap;
46
64
  }
@@ -46,6 +46,7 @@ export declare class ElderMultiSelectChipsComponent<TId = any, TEntity = any, TV
46
46
  private readonly chipTemplate$;
47
47
  private readonly chipAvatarTemplate$;
48
48
  private readonly customInputTemplate$;
49
+ private readonly refresh$;
49
50
  private readonly log;
50
51
  /***************************************************************************
51
52
  * *
@@ -78,6 +79,7 @@ export declare class ElderMultiSelectChipsComponent<TId = any, TEntity = any, TV
78
79
  onClickRemoveChip(event: MouseEvent, toRemove: TEntity): void;
79
80
  focus(options?: FocusOptions): void;
80
81
  blur(): void;
82
+ refresh(): void;
81
83
  /***************************************************************************
82
84
  * *
83
85
  * Private methods *
@@ -1,38 +1,78 @@
1
- import { DestroyRef } from '@angular/core';
2
- import { ElderSearchInputDirective } from '../../forms/search/elder-search-input.directive';
3
- import { ElderChipsFilterDirective } from '../filter/elder-chips-filter.directive';
1
+ import { DestroyRef, OnInit } from '@angular/core';
2
+ import { SearchInput } from '../../forms/search/domain/input/search-input';
3
+ import { Observable, Subject } from 'rxjs';
4
+ import { SearchInputState } from '../../forms/search/domain/input/search-input-state';
5
+ import { ElderSearchContextDirective } from '../../forms/search/elder-search-context.directive';
6
+ import { NgModel } from '@angular/forms';
7
+ import { Filter } from '../../../common/data/filters/filter';
8
+ import { IncludeExcludeSelectionModel } from '../filter/include-exclude-selection-model';
4
9
  import * as i0 from "@angular/core";
5
- export declare class ElderSearchIncludeExcludeDirective {
6
- private readonly elderSearchInput;
7
- private readonly elderChipsFilter;
10
+ /**
11
+ * Binds a IncludeExcludeModel to a SearchContexts Filter.
12
+ */
13
+ export declare class ElderSearchIncludeExcludeDirective implements SearchInput, OnInit {
14
+ private searchContext;
8
15
  private destroyRef;
16
+ private readonly selectionModel;
17
+ private ngModel;
9
18
  /***************************************************************************
10
19
  * *
11
20
  * Fields *
12
21
  * *
13
22
  **************************************************************************/
14
- private readonly _includeSuffix$;
15
- private readonly _excludeSuffix$;
23
+ private readonly log;
24
+ private readonly _queryKey$;
25
+ private _extractedName;
26
+ private _userQueryKey;
27
+ includeSuffix: string;
28
+ excludeSuffix: string;
29
+ private readonly _state$;
30
+ private includeExcludeAdapter;
31
+ readonly initialDone$: Subject<void>;
32
+ /***************************************************************************
33
+ * *
34
+ * Constructor *
35
+ * *
36
+ **************************************************************************/
37
+ constructor(searchContext: ElderSearchContextDirective, destroyRef: DestroyRef, selectionModel: IncludeExcludeSelectionModel, ngModel: NgModel);
38
+ /***************************************************************************
39
+ * *
40
+ * Life Cycle *
41
+ * *
42
+ **************************************************************************/
43
+ ngOnInit(): void;
16
44
  /***************************************************************************
17
45
  * *
18
46
  * Properties *
19
47
  * *
20
48
  **************************************************************************/
21
- set includeSuffix(suffix: string);
22
- set excludeSuffix(suffix: string);
49
+ /**
50
+ * (Optional) Usually the control name is used, this allows a custom query key
51
+ */
52
+ set queryKey(value: string);
53
+ get queryKey(): string;
54
+ get queryKey$(): Observable<string>;
55
+ get state$(): Observable<SearchInputState>;
56
+ get readonly(): boolean;
23
57
  /***************************************************************************
24
58
  * *
25
- * Constructor *
59
+ * Public API *
26
60
  * *
27
61
  **************************************************************************/
28
- constructor(elderSearchInput: ElderSearchInputDirective, elderChipsFilter: ElderChipsFilterDirective, destroyRef: DestroyRef);
62
+ applyFilters(filters: Filter[]): void;
63
+ reset(): void;
29
64
  /***************************************************************************
30
65
  * *
31
- * Private Methods *
66
+ * Private methods *
32
67
  * *
33
68
  **************************************************************************/
34
- private setupSearchQueryTransforms;
35
- private buildConverter;
36
- static ɵfac: i0.ɵɵFactoryDeclaration<ElderSearchIncludeExcludeDirective, never>;
37
- static ɵdir: i0.ɵɵDirectiveDeclaration<ElderSearchIncludeExcludeDirective, "[elderSearchIncludeExclude]", never, { "includeSuffix": { "alias": "includeSuffix"; "required": false; }; "excludeSuffix": { "alias": "excludeSuffix"; "required": true; }; }, {}, never, never, true, never>;
69
+ private updateQueryKey;
70
+ private buildInputStateObservable;
71
+ private buildInputState;
72
+ private areAllPristine;
73
+ private isPristine;
74
+ private isAttributeValuePresent;
75
+ private extractName;
76
+ static ɵfac: i0.ɵɵFactoryDeclaration<ElderSearchIncludeExcludeDirective, [null, null, null, { optional: true; host: true; }]>;
77
+ static ɵdir: i0.ɵɵDirectiveDeclaration<ElderSearchIncludeExcludeDirective, "[elderSearchIncludeExclude]", ["elderSearchInput"], { "includeSuffix": { "alias": "includeSuffix"; "required": false; }; "excludeSuffix": { "alias": "excludeSuffix"; "required": true; }; "queryKey": { "alias": "queryKey"; "required": false; }; }, {}, never, never, true, never>;
38
78
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elderbyte/ngx-starter",
3
- "version": "17.11.0-beta4",
3
+ "version": "17.11.0-beta6",
4
4
  "peerDependencies": {
5
5
  "@angular/core": "^17.0.0 || ^18.0.0",
6
6
  "@angular/common": "^17.0.0 || ^18.0.0",