@elderbyte/ngx-starter 17.11.0-beta2 → 17.11.0-beta3
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/esm2022/lib/components/forms/search/domain/input/search-input-state.mjs +9 -19
- package/esm2022/lib/components/forms/search/elder-search-context.directive.mjs +3 -3
- package/esm2022/lib/components/forms/search/elder-search-input.directive.mjs +13 -6
- package/esm2022/lib/components/forms/search/filter/default-input-filter-converter.mjs +2 -1
- package/esm2022/lib/components/forms/search/filter/include-exclude-input-converter.mjs +25 -53
- package/esm2022/lib/components/select/elder-select.module.mjs +2 -1
- package/esm2022/lib/components/select/filter/elder-chip-filter-style-resolver.mjs +10 -10
- package/esm2022/lib/components/select/filter/elder-chips-filter.directive.mjs +18 -99
- package/esm2022/lib/components/select/filter/include-exclude-selection-model.mjs +108 -0
- package/esm2022/lib/components/select/multi/elder-search-include-exclude.directive.mjs +9 -18
- package/fesm2022/elderbyte-ngx-starter.mjs +180 -195
- package/fesm2022/elderbyte-ngx-starter.mjs.map +1 -1
- package/lib/components/forms/search/domain/input/search-input-state.d.ts +4 -20
- package/lib/components/forms/search/elder-search-input.directive.d.ts +3 -0
- package/lib/components/forms/search/filter/include-exclude-input-converter.d.ts +11 -27
- package/lib/components/select/elder-select.module.d.ts +1 -0
- package/lib/components/select/filter/elder-chip-filter-style-resolver.d.ts +3 -3
- package/lib/components/select/filter/elder-chips-filter.directive.d.ts +3 -32
- package/lib/components/select/filter/include-exclude-selection-model.d.ts +46 -0
- package/lib/components/select/multi/elder-search-include-exclude.directive.d.ts +2 -3
- package/package.json +1 -1
|
@@ -4,17 +4,9 @@ import { Filter } from '../../../../../common/data/filters/filter';
|
|
|
4
4
|
*/
|
|
5
5
|
export declare class SearchInputState {
|
|
6
6
|
/**
|
|
7
|
-
* attribute The name
|
|
7
|
+
* attribute The name
|
|
8
8
|
*/
|
|
9
9
|
readonly attribute: string;
|
|
10
|
-
/**
|
|
11
|
-
* queryKey The query key
|
|
12
|
-
*/
|
|
13
|
-
readonly queryKey: string;
|
|
14
|
-
/**
|
|
15
|
-
* queryValue The query value as string. Supports multi string value.
|
|
16
|
-
*/
|
|
17
|
-
readonly queryValue: string | string[] | null;
|
|
18
10
|
/**
|
|
19
11
|
* value of the input
|
|
20
12
|
*/
|
|
@@ -27,7 +19,7 @@ export declare class SearchInputState {
|
|
|
27
19
|
* Was the input changed by a user interaction
|
|
28
20
|
*/
|
|
29
21
|
readonly userEvent: boolean;
|
|
30
|
-
static of(attribute: string,
|
|
22
|
+
static of(attribute: string, filters: Filter[], pristine: boolean, userEvent: boolean): SearchInputState;
|
|
31
23
|
static unknown(): SearchInputState;
|
|
32
24
|
/***************************************************************************
|
|
33
25
|
* *
|
|
@@ -36,17 +28,9 @@ export declare class SearchInputState {
|
|
|
36
28
|
**************************************************************************/
|
|
37
29
|
constructor(
|
|
38
30
|
/**
|
|
39
|
-
* attribute The name
|
|
31
|
+
* attribute The name
|
|
40
32
|
*/
|
|
41
33
|
attribute: string,
|
|
42
|
-
/**
|
|
43
|
-
* queryKey The query key
|
|
44
|
-
*/
|
|
45
|
-
queryKey: string,
|
|
46
|
-
/**
|
|
47
|
-
* queryValue The query value as string. Supports multi string value.
|
|
48
|
-
*/
|
|
49
|
-
queryValue: string | string[] | null,
|
|
50
34
|
/**
|
|
51
35
|
* value of the input
|
|
52
36
|
*/
|
|
@@ -83,5 +67,5 @@ export declare class SearchInputState {
|
|
|
83
67
|
* Public Api *
|
|
84
68
|
* *
|
|
85
69
|
**************************************************************************/
|
|
86
|
-
|
|
70
|
+
withFilter(filter: Filter, pristine?: boolean): SearchInputState;
|
|
87
71
|
}
|
|
@@ -92,6 +92,9 @@ export declare class ElderSearchInputDirective implements SearchInput, OnInit, A
|
|
|
92
92
|
private get valueChanges$();
|
|
93
93
|
private buildInputStateObservable;
|
|
94
94
|
private buildInputState;
|
|
95
|
+
private isFallbackValue;
|
|
96
|
+
private areAllPristine;
|
|
97
|
+
private isPristine;
|
|
95
98
|
private convertQueryStringToRawModelValue;
|
|
96
99
|
private convertRawModelValueToQueryString;
|
|
97
100
|
private checkAndConvertFaultyValuesToNull;
|
|
@@ -1,31 +1,18 @@
|
|
|
1
1
|
import { InputFilterConverter } from './input-filter-converter';
|
|
2
2
|
import { Filter } from '../../../../common/data/filters/filter';
|
|
3
3
|
import { InputValue } from '../domain/input/input-value';
|
|
4
|
-
import {
|
|
5
|
-
import { ElderChipFilterEntity } from '../../../select/filter/elder-chips-filter.directive';
|
|
4
|
+
import { IncludeExcludeSelectionModel } from '../../../select/filter/include-exclude-selection-model';
|
|
6
5
|
export default class IncludeExcludeInputConverter implements InputFilterConverter {
|
|
7
|
-
readonly
|
|
8
|
-
private
|
|
9
|
-
private
|
|
10
|
-
|
|
11
|
-
* *
|
|
12
|
-
* Fields *
|
|
13
|
-
* *
|
|
14
|
-
**************************************************************************/
|
|
15
|
-
private readonly selections$;
|
|
16
|
-
private readonly _mergedSelections$;
|
|
17
|
-
/***************************************************************************
|
|
18
|
-
* *
|
|
19
|
-
* Static Builders *
|
|
20
|
-
* *
|
|
21
|
-
**************************************************************************/
|
|
22
|
-
static from(queryKey: string, includeSuffix: string, excludeSuffix: string): IncludeExcludeInputConverter;
|
|
6
|
+
private readonly selectionModel;
|
|
7
|
+
private readonly queryKey;
|
|
8
|
+
private readonly includeSuffix;
|
|
9
|
+
private readonly excludeSuffix;
|
|
23
10
|
/***************************************************************************
|
|
24
11
|
* *
|
|
25
12
|
* Constructors *
|
|
26
13
|
* *
|
|
27
14
|
**************************************************************************/
|
|
28
|
-
|
|
15
|
+
constructor(selectionModel: IncludeExcludeSelectionModel, queryKey: string, includeSuffix: string, excludeSuffix: string);
|
|
29
16
|
/***************************************************************************
|
|
30
17
|
* *
|
|
31
18
|
* Public API *
|
|
@@ -35,13 +22,11 @@ export default class IncludeExcludeInputConverter implements InputFilterConverte
|
|
|
35
22
|
convertToFilters(inputValue: InputValue): Filter[];
|
|
36
23
|
/***************************************************************************
|
|
37
24
|
* *
|
|
38
|
-
* Properties
|
|
25
|
+
* Private Properties *
|
|
39
26
|
* *
|
|
40
27
|
**************************************************************************/
|
|
41
|
-
|
|
42
|
-
get
|
|
43
|
-
get includeQueryKey(): string;
|
|
44
|
-
get excludeQueryKey(): string;
|
|
28
|
+
private get includeQueryKey();
|
|
29
|
+
private get excludeQueryKey();
|
|
45
30
|
/***************************************************************************
|
|
46
31
|
* *
|
|
47
32
|
* Private Methods *
|
|
@@ -52,9 +37,6 @@ export default class IncludeExcludeInputConverter implements InputFilterConverte
|
|
|
52
37
|
private flattenFilterValues;
|
|
53
38
|
private replaceEmptyArrayWithNull;
|
|
54
39
|
private validateArrayAndReturn;
|
|
55
|
-
private isIncluded;
|
|
56
|
-
private isExcluded;
|
|
57
|
-
private addAllSelections;
|
|
58
40
|
/***************************************************************************
|
|
59
41
|
* *
|
|
60
42
|
* Split *
|
|
@@ -73,6 +55,8 @@ export default class IncludeExcludeInputConverter implements InputFilterConverte
|
|
|
73
55
|
* *
|
|
74
56
|
**************************************************************************/
|
|
75
57
|
private mergeValues;
|
|
58
|
+
private updateSelectionModel;
|
|
59
|
+
private buildNewSelectionStates;
|
|
76
60
|
private buildMergeIncludeValues;
|
|
77
61
|
private buildMergeExcludeValues;
|
|
78
62
|
}
|
|
@@ -56,6 +56,7 @@ export { ElderMultiSelectAllInitialDirective } from './multi/elder-mutli-select-
|
|
|
56
56
|
export { ElderAutoSelectSuggestFirstDirective } from './auto/elder-auto-select-suggest-first.directive';
|
|
57
57
|
export { ElderChipsFilterDirective } from './filter/elder-chips-filter.directive';
|
|
58
58
|
export { ElderFilterChipTemplate } from './filter/elder-filter-chip-template/elder-filter-chip-template.component';
|
|
59
|
+
export * from './filter/include-exclude-selection-model';
|
|
59
60
|
export { ElderSearchIncludeExcludeDirective } from './multi/elder-search-include-exclude.directive';
|
|
60
61
|
export declare class ElderSelectModule {
|
|
61
62
|
static ɵfac: i0.ɵɵFactoryDeclaration<ElderSelectModule, never>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SelectChipSpec } from '../multi/elder-multi-select-chips/select-chip-spec';
|
|
2
|
-
import {
|
|
2
|
+
import { IncludeExcludeState } from './include-exclude-selection-model';
|
|
3
3
|
export default class ElderChipFilterStyleResolver {
|
|
4
4
|
/***************************************************************************
|
|
5
5
|
* *
|
|
@@ -14,6 +14,6 @@ export default class ElderChipFilterStyleResolver {
|
|
|
14
14
|
* Public API *
|
|
15
15
|
* *
|
|
16
16
|
**************************************************************************/
|
|
17
|
-
resolveChipSpec(filterEntity:
|
|
18
|
-
resolveAvatar(filterEntity:
|
|
17
|
+
resolveChipSpec(filterEntity: IncludeExcludeState): SelectChipSpec;
|
|
18
|
+
resolveAvatar(filterEntity: IncludeExcludeState): string;
|
|
19
19
|
}
|
|
@@ -1,17 +1,8 @@
|
|
|
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 { Observable } from 'rxjs';
|
|
4
3
|
import { ElderSearchInputDirective } from '../../forms/search/elder-search-input.directive';
|
|
4
|
+
import { IncludeExcludeSelectionModel } from './include-exclude-selection-model';
|
|
5
5
|
import * as i0 from "@angular/core";
|
|
6
|
-
export interface ElderChipFilterEntity {
|
|
7
|
-
id: string;
|
|
8
|
-
selection: ElderChipFilterSelection;
|
|
9
|
-
}
|
|
10
|
-
export declare enum ElderChipFilterSelection {
|
|
11
|
-
NEUTRAL = "NEUTRAL",
|
|
12
|
-
INCLUDE = "INCLUDE",
|
|
13
|
-
EXCLUDE = "EXCLUDE"
|
|
14
|
-
}
|
|
15
6
|
export declare class ElderChipsFilterDirective<T = any> {
|
|
16
7
|
readonly elderMultiSelectChips: ElderMultiSelectChipsComponent;
|
|
17
8
|
readonly elderSearchInput: ElderSearchInputDirective;
|
|
@@ -23,32 +14,14 @@ export declare class ElderChipsFilterDirective<T = any> {
|
|
|
23
14
|
* *
|
|
24
15
|
**************************************************************************/
|
|
25
16
|
private readonly log;
|
|
26
|
-
|
|
17
|
+
readonly selectionModel: IncludeExcludeSelectionModel;
|
|
27
18
|
private readonly chipStyleResolver;
|
|
28
|
-
private readonly initialDone$;
|
|
29
|
-
private readonly _includeSuffix$;
|
|
30
|
-
private readonly _excludeSuffix$;
|
|
31
|
-
/***************************************************************************
|
|
32
|
-
* *
|
|
33
|
-
* Properties *
|
|
34
|
-
* *
|
|
35
|
-
**************************************************************************/
|
|
36
|
-
set includeSuffix(suffix: string);
|
|
37
|
-
set excludeSuffix(suffix: string);
|
|
38
19
|
/***************************************************************************
|
|
39
20
|
* *
|
|
40
21
|
* Constructor *
|
|
41
22
|
* *
|
|
42
23
|
**************************************************************************/
|
|
43
24
|
constructor(elderMultiSelectChips: ElderMultiSelectChipsComponent, elderSearchInput: ElderSearchInputDirective, vcr: ViewContainerRef, destroyRef: DestroyRef);
|
|
44
|
-
/***************************************************************************
|
|
45
|
-
* *
|
|
46
|
-
* Properties *
|
|
47
|
-
* *
|
|
48
|
-
**************************************************************************/
|
|
49
|
-
get selection(): ElderChipFilterEntity[];
|
|
50
|
-
get selection$(): Observable<ElderChipFilterEntity[]>;
|
|
51
|
-
set selection(listedEntityIds: ElderChipFilterEntity[]);
|
|
52
25
|
/***************************************************************************
|
|
53
26
|
* *
|
|
54
27
|
* Private methods *
|
|
@@ -59,10 +32,8 @@ export declare class ElderChipsFilterDirective<T = any> {
|
|
|
59
32
|
private resolveChipSpec;
|
|
60
33
|
private resolveAvatar;
|
|
61
34
|
private handleChipClick;
|
|
62
|
-
private cycleFilterEntitySelection;
|
|
63
35
|
private findFilterEntityByEntity;
|
|
64
36
|
private findFilterEntityById;
|
|
65
|
-
private updateChipEntities;
|
|
66
37
|
static ɵfac: i0.ɵɵFactoryDeclaration<ElderChipsFilterDirective<any>, never>;
|
|
67
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<ElderChipsFilterDirective<any>, "[elderChipsFilter]", never, {
|
|
38
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<ElderChipsFilterDirective<any>, "[elderChipsFilter]", never, {}, {}, never, never, true, never>;
|
|
68
39
|
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { Observable } from 'rxjs';
|
|
2
|
+
export declare class IncludeExcludeState {
|
|
3
|
+
readonly id: string;
|
|
4
|
+
mode: IncludeExcludeMode;
|
|
5
|
+
constructor(id: string, mode: IncludeExcludeMode);
|
|
6
|
+
}
|
|
7
|
+
export declare enum IncludeExcludeMode {
|
|
8
|
+
NEUTRAL = "NEUTRAL",
|
|
9
|
+
INCLUDE = "INCLUDE",
|
|
10
|
+
EXCLUDE = "EXCLUDE"
|
|
11
|
+
}
|
|
12
|
+
export declare class IncludeExcludeSelectionModel {
|
|
13
|
+
/***************************************************************************
|
|
14
|
+
* *
|
|
15
|
+
* Fields *
|
|
16
|
+
* *
|
|
17
|
+
**************************************************************************/
|
|
18
|
+
private readonly log;
|
|
19
|
+
private readonly stateById$;
|
|
20
|
+
/***************************************************************************
|
|
21
|
+
* *
|
|
22
|
+
* Properties *
|
|
23
|
+
* *
|
|
24
|
+
**************************************************************************/
|
|
25
|
+
get selection(): IncludeExcludeState[];
|
|
26
|
+
get selection$(): Observable<IncludeExcludeState[]>;
|
|
27
|
+
/***************************************************************************
|
|
28
|
+
* *
|
|
29
|
+
* Public API *
|
|
30
|
+
* *
|
|
31
|
+
**************************************************************************/
|
|
32
|
+
cycleExisting(id: string): IncludeExcludeState | null;
|
|
33
|
+
initTo(ids: string[], initialMode?: IncludeExcludeMode): void;
|
|
34
|
+
replaceSelection(newStates: IncludeExcludeState[]): void;
|
|
35
|
+
updateState(id: string, mode: IncludeExcludeMode): IncludeExcludeState;
|
|
36
|
+
updateStates(newStates: IncludeExcludeState[]): void;
|
|
37
|
+
isInMode(id: string, mode: IncludeExcludeMode): boolean;
|
|
38
|
+
findStateById(searchedId: string): IncludeExcludeState | null;
|
|
39
|
+
/***************************************************************************
|
|
40
|
+
* *
|
|
41
|
+
* Private methods *
|
|
42
|
+
* *
|
|
43
|
+
**************************************************************************/
|
|
44
|
+
private cycleFilterEntitySelection;
|
|
45
|
+
private toStateMap;
|
|
46
|
+
}
|
|
@@ -32,8 +32,7 @@ export declare class ElderSearchIncludeExcludeDirective {
|
|
|
32
32
|
* *
|
|
33
33
|
**************************************************************************/
|
|
34
34
|
private setupSearchQueryTransforms;
|
|
35
|
-
private
|
|
36
|
-
private transformSelectionToMap;
|
|
35
|
+
private buildConverter;
|
|
37
36
|
static ɵfac: i0.ɵɵFactoryDeclaration<ElderSearchIncludeExcludeDirective, never>;
|
|
38
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<ElderSearchIncludeExcludeDirective, "[elderSearchIncludeExclude]", never, { "includeSuffix": { "alias": "includeSuffix"; "required": false; }; "excludeSuffix": { "alias": "excludeSuffix"; "required":
|
|
37
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<ElderSearchIncludeExcludeDirective, "[elderSearchIncludeExclude]", never, { "includeSuffix": { "alias": "includeSuffix"; "required": false; }; "excludeSuffix": { "alias": "excludeSuffix"; "required": true; }; }, {}, never, never, true, never>;
|
|
39
38
|
}
|