@enigmatry/entry-components 15.1.0-preview → 15.1.0-preview.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2020/search-filter/autocomplete/autocomplete-search-filter.component.mjs +50 -0
- package/esm2020/search-filter/autocomplete/autocomplete-search-filter.model.mjs +19 -0
- package/esm2020/search-filter/control-type.mjs +7 -0
- package/esm2020/search-filter/entry-search-filter.component.mjs +19 -6
- package/esm2020/search-filter/entry-search-filter.module.mjs +14 -8
- package/esm2020/search-filter/public-api.mjs +6 -5
- package/esm2020/search-filter/search-filter-base.model.mjs +26 -0
- package/esm2020/search-filter/select/select-search-filter.component.mjs +28 -0
- package/esm2020/search-filter/select/select-search-filter.model.mjs +23 -0
- package/esm2020/search-filter/select-option.model.mjs +12 -0
- package/esm2020/search-filter/text/text-search-filter.component.mjs +18 -0
- package/esm2020/search-filter/text/text-search-filter.model.mjs +12 -0
- package/fesm2015/enigmatry-entry-components-search-filter.mjs +116 -33
- package/fesm2015/enigmatry-entry-components-search-filter.mjs.map +1 -1
- package/fesm2020/enigmatry-entry-components-search-filter.mjs +115 -33
- package/fesm2020/enigmatry-entry-components-search-filter.mjs.map +1 -1
- package/package.json +1 -1
- package/search-filter/README.md +45 -17
- package/search-filter/autocomplete/autocomplete-search-filter.component.d.ts +21 -0
- package/search-filter/autocomplete/autocomplete-search-filter.model.d.ts +19 -0
- package/search-filter/control-type.d.ts +5 -0
- package/search-filter/entry-search-filter.component.d.ts +9 -1
- package/search-filter/entry-search-filter.module.d.ts +11 -9
- package/search-filter/public-api.d.ts +5 -4
- package/search-filter/{search-filter-input/search-filter-base.model.d.ts → search-filter-base.model.d.ts} +3 -2
- package/search-filter/select/select-search-filter.component.d.ts +14 -0
- package/search-filter/{search-filter-input/inputs → select}/select-search-filter.model.d.ts +5 -4
- package/search-filter/{search-filter-input/inputs/select-filter-option.model.d.ts → select-option.model.d.ts} +2 -2
- package/search-filter/text/text-search-filter.component.d.ts +10 -0
- package/search-filter/{search-filter-input/inputs → text}/text-search-filter.model.d.ts +2 -1
- package/styles/modules/_default-theme.scss +12 -4
- package/styles/modules/vendors/angular-material/_typography-generator.scss +14 -7
- package/esm2020/search-filter/search-filter-input/control-type.model.mjs +0 -5
- package/esm2020/search-filter/search-filter-input/inputs/select-filter-option.model.mjs +0 -12
- package/esm2020/search-filter/search-filter-input/inputs/select-search-filter.model.mjs +0 -23
- package/esm2020/search-filter/search-filter-input/inputs/text-search-filter.model.mjs +0 -12
- package/esm2020/search-filter/search-filter-input/search-filter-base.model.mjs +0 -25
- package/esm2020/search-filter/search-filter-input/search-filter-input.component.mjs +0 -36
- package/search-filter/search-filter-input/control-type.model.d.ts +0 -4
- package/search-filter/search-filter-input/search-filter-input.component.d.ts +0 -18
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Component, ChangeDetectionStrategy, Inject,
|
|
2
|
+
import { Component, ChangeDetectionStrategy, Input, Inject, ViewChild, EventEmitter, Output, NgModule } from '@angular/core';
|
|
3
3
|
import * as i2 from '@angular/forms';
|
|
4
|
-
import { UntypedFormGroup, FormControl, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
4
|
+
import { FormControlName, UntypedFormGroup, FormControl, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
5
5
|
import { createInjectionToken, provideConfig } from '@enigmatry/entry-components/common';
|
|
6
6
|
import * as i1 from '@angular/common';
|
|
7
7
|
import { CommonModule } from '@angular/common';
|
|
@@ -9,13 +9,16 @@ import * as i3$1 from '@angular/material/button';
|
|
|
9
9
|
import { MatButtonModule } from '@angular/material/button';
|
|
10
10
|
import * as i4$1 from '@enigmatry/entry-components/button';
|
|
11
11
|
import { EntryButtonModule } from '@enigmatry/entry-components/button';
|
|
12
|
-
import * as
|
|
12
|
+
import * as i2$1 from '@angular/material/input';
|
|
13
13
|
import { MatInputModule } from '@angular/material/input';
|
|
14
|
-
import * as
|
|
15
|
-
import * as
|
|
14
|
+
import * as i3 from '@angular/material/form-field';
|
|
15
|
+
import * as i4 from '@angular/material/select';
|
|
16
16
|
import { MatSelectModule } from '@angular/material/select';
|
|
17
|
-
import * as
|
|
18
|
-
import {
|
|
17
|
+
import * as i5 from '@angular/material/core';
|
|
18
|
+
import { of, Subject } from 'rxjs';
|
|
19
|
+
import { takeUntil, filter, debounceTime, tap } from 'rxjs/operators';
|
|
20
|
+
import * as i6 from '@angular/material/autocomplete';
|
|
21
|
+
import { MatAutocompleteModule } from '@angular/material/autocomplete';
|
|
19
22
|
|
|
20
23
|
/**
|
|
21
24
|
* Used to provide entry search filter configuration on module level.
|
|
@@ -34,27 +37,36 @@ function provideEntrySearchFilterConfig(config) {
|
|
|
34
37
|
return provideConfig(ENTRY_SEARCH_FILTER_CONFIG, () => new EntrySearchFilterConfig(config));
|
|
35
38
|
}
|
|
36
39
|
|
|
37
|
-
|
|
40
|
+
var ControlType;
|
|
41
|
+
(function (ControlType) {
|
|
42
|
+
ControlType["text"] = "text-input";
|
|
43
|
+
ControlType["select"] = "select-input";
|
|
44
|
+
ControlType["autocomplete"] = "autocomplete-input";
|
|
45
|
+
})(ControlType || (ControlType = {}));
|
|
46
|
+
|
|
47
|
+
class TextSearchFilterComponent {
|
|
38
48
|
}
|
|
39
|
-
|
|
40
|
-
|
|
49
|
+
TextSearchFilterComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: TextSearchFilterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
50
|
+
TextSearchFilterComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: TextSearchFilterComponent, selector: "entry-text-search-filter", inputs: { searchFilter: "searchFilter", form: "form" }, ngImport: i0, template: "<mat-form-field [formGroup]=\"form\" subscriptSizing=\"dynamic\">\n <mat-label [attr.for]=\"searchFilter.key\">{{searchFilter.label}}</mat-label>\n <input [formControlName]=\"searchFilter.key\" [id]=\"searchFilter.key\" [type]=\"searchFilter.type\" matInput\n [placeholder]=\"searchFilter.placeholder\" [maxlength]=\"searchFilter.maxLength\">\n</mat-form-field>", dependencies: [{ kind: "directive", type: i2.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.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i2$1.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.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3.MatLabel, selector: "mat-label" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
51
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: TextSearchFilterComponent, decorators: [{
|
|
52
|
+
type: Component,
|
|
53
|
+
args: [{ selector: 'entry-text-search-filter', changeDetection: ChangeDetectionStrategy.OnPush, template: "<mat-form-field [formGroup]=\"form\" subscriptSizing=\"dynamic\">\n <mat-label [attr.for]=\"searchFilter.key\">{{searchFilter.label}}</mat-label>\n <input [formControlName]=\"searchFilter.key\" [id]=\"searchFilter.key\" [type]=\"searchFilter.type\" matInput\n [placeholder]=\"searchFilter.placeholder\" [maxlength]=\"searchFilter.maxLength\">\n</mat-form-field>" }]
|
|
54
|
+
}], propDecorators: { searchFilter: [{
|
|
55
|
+
type: Input
|
|
56
|
+
}], form: [{
|
|
57
|
+
type: Input
|
|
58
|
+
}] } });
|
|
41
59
|
|
|
42
|
-
class
|
|
60
|
+
class SelectSearchFilterComponent {
|
|
43
61
|
constructor(config) {
|
|
44
62
|
this.config = config;
|
|
45
63
|
}
|
|
46
|
-
get textSearchFilter() {
|
|
47
|
-
return this.searchFilter.controlType === ControlType.text && this.searchFilter;
|
|
48
|
-
}
|
|
49
|
-
get selectSearchFilter() {
|
|
50
|
-
return this.searchFilter.controlType === ControlType.select && this.searchFilter;
|
|
51
|
-
}
|
|
52
64
|
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type:
|
|
65
|
+
SelectSearchFilterComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: SelectSearchFilterComponent, deps: [{ token: ENTRY_SEARCH_FILTER_CONFIG }], target: i0.ɵɵFactoryTarget.Component });
|
|
66
|
+
SelectSearchFilterComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: SelectSearchFilterComponent, selector: "entry-select-search-filter", inputs: { searchFilter: "searchFilter", form: "form" }, ngImport: i0, template: "<mat-form-field [formGroup]=\"form\" subscriptSizing=\"dynamic\">\n <mat-label [attr.for]=\"searchFilter.key\">{{searchFilter.label}}</mat-label>\n <mat-select [formControlName]=\"searchFilter.key\" [id]=\"searchFilter.key\" [multiple]=\"searchFilter.multiSelect\">\n <mat-option *ngIf=\"!searchFilter.multiSelect\" [value]=\"undefined\">\n {{config.noneSelectedOptionText}}\n </mat-option>\n <ng-container *ngIf=\"searchFilter.options$ !== undefined; else fixedSelectValues\">\n <mat-option *ngFor=\"let option of searchFilter.options$ | async\"\n [value]=\"option.key\">{{option.label}}</mat-option>\n </ng-container>\n <ng-template #fixedSelectValues>\n <mat-option *ngFor=\"let option of searchFilter.options\" [value]=\"option.key\">{{option.label}}</mat-option>\n </ng-template>\n </mat-select>\n</mat-form-field>", dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i3.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3.MatLabel, selector: "mat-label" }, { kind: "component", type: i4.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator"], exportAs: ["matSelect"] }, { kind: "component", type: i5.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
67
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: SelectSearchFilterComponent, decorators: [{
|
|
56
68
|
type: Component,
|
|
57
|
-
args: [{ selector: 'entry-search-filter
|
|
69
|
+
args: [{ selector: 'entry-select-search-filter', changeDetection: ChangeDetectionStrategy.OnPush, template: "<mat-form-field [formGroup]=\"form\" subscriptSizing=\"dynamic\">\n <mat-label [attr.for]=\"searchFilter.key\">{{searchFilter.label}}</mat-label>\n <mat-select [formControlName]=\"searchFilter.key\" [id]=\"searchFilter.key\" [multiple]=\"searchFilter.multiSelect\">\n <mat-option *ngIf=\"!searchFilter.multiSelect\" [value]=\"undefined\">\n {{config.noneSelectedOptionText}}\n </mat-option>\n <ng-container *ngIf=\"searchFilter.options$ !== undefined; else fixedSelectValues\">\n <mat-option *ngFor=\"let option of searchFilter.options$ | async\"\n [value]=\"option.key\">{{option.label}}</mat-option>\n </ng-container>\n <ng-template #fixedSelectValues>\n <mat-option *ngFor=\"let option of searchFilter.options\" [value]=\"option.key\">{{option.label}}</mat-option>\n </ng-template>\n </mat-select>\n</mat-form-field>" }]
|
|
58
70
|
}], ctorParameters: function () { return [{ type: EntrySearchFilterConfig, decorators: [{
|
|
59
71
|
type: Inject,
|
|
60
72
|
args: [ENTRY_SEARCH_FILTER_CONFIG]
|
|
@@ -64,6 +76,45 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
64
76
|
type: Input
|
|
65
77
|
}] } });
|
|
66
78
|
|
|
79
|
+
class AutocompleteSearchFilterComponent {
|
|
80
|
+
constructor(cdr) {
|
|
81
|
+
this.cdr = cdr;
|
|
82
|
+
this.options$ = of([]);
|
|
83
|
+
this.options = [];
|
|
84
|
+
this.destroy$ = new Subject();
|
|
85
|
+
this.displayFn = (selectedKey) => this.options.find(x => x.key === selectedKey)?.label;
|
|
86
|
+
}
|
|
87
|
+
ngAfterViewInit() {
|
|
88
|
+
this.searchField
|
|
89
|
+
.valueChanges
|
|
90
|
+
.pipe(takeUntil(this.destroy$), filter(value => value?.length >= this.searchFilter.minimumCharacters), debounceTime(this.searchFilter.debounceTime))
|
|
91
|
+
.subscribe(searchValue => {
|
|
92
|
+
// call search and retrieve options
|
|
93
|
+
this.options$ = this.searchFilter.search(searchValue)
|
|
94
|
+
.pipe(tap(options => this.options = options));
|
|
95
|
+
// mark for check because of the debounce
|
|
96
|
+
this.cdr.markForCheck();
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
ngOnDestroy() {
|
|
100
|
+
this.destroy$.next();
|
|
101
|
+
this.destroy$.complete();
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
AutocompleteSearchFilterComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AutocompleteSearchFilterComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
105
|
+
AutocompleteSearchFilterComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: AutocompleteSearchFilterComponent, selector: "entry-autocomplete-search-filter", inputs: { searchFilter: "searchFilter", form: "form" }, viewQueries: [{ propertyName: "searchField", first: true, predicate: FormControlName, descendants: true }], ngImport: i0, template: "<mat-form-field [formGroup]=\"form\" subscriptSizing=\"dynamic\">\n <mat-label>{{searchFilter.label}}</mat-label>\n <input type=\"text\" matInput [placeholder]=\"searchFilter.placeholder\"\n [formControlName]=\"searchFilter.key\" [id]=\"searchFilter.key\" [matAutocomplete]=\"auto\">\n <mat-autocomplete [displayWith]=\"displayFn\" #auto=\"matAutocomplete\">\n <mat-option *ngFor=\"let option of options$ | async\" [value]=\"option.key\">\n {{option.label}}\n </mat-option>\n </mat-autocomplete>\n</mat-form-field>", dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.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.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i2$1.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.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3.MatLabel, selector: "mat-label" }, { kind: "component", type: i5.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { kind: "component", type: i6.MatAutocomplete, selector: "mat-autocomplete", inputs: ["disableRipple", "hideSingleSelectionIndicator"], exportAs: ["matAutocomplete"] }, { kind: "directive", type: i6.MatAutocompleteTrigger, selector: "input[matAutocomplete], textarea[matAutocomplete]", exportAs: ["matAutocompleteTrigger"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
106
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AutocompleteSearchFilterComponent, decorators: [{
|
|
107
|
+
type: Component,
|
|
108
|
+
args: [{ selector: 'entry-autocomplete-search-filter', changeDetection: ChangeDetectionStrategy.OnPush, template: "<mat-form-field [formGroup]=\"form\" subscriptSizing=\"dynamic\">\n <mat-label>{{searchFilter.label}}</mat-label>\n <input type=\"text\" matInput [placeholder]=\"searchFilter.placeholder\"\n [formControlName]=\"searchFilter.key\" [id]=\"searchFilter.key\" [matAutocomplete]=\"auto\">\n <mat-autocomplete [displayWith]=\"displayFn\" #auto=\"matAutocomplete\">\n <mat-option *ngFor=\"let option of options$ | async\" [value]=\"option.key\">\n {{option.label}}\n </mat-option>\n </mat-autocomplete>\n</mat-form-field>" }]
|
|
109
|
+
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { searchFilter: [{
|
|
110
|
+
type: Input
|
|
111
|
+
}], form: [{
|
|
112
|
+
type: Input
|
|
113
|
+
}], searchField: [{
|
|
114
|
+
type: ViewChild,
|
|
115
|
+
args: [FormControlName]
|
|
116
|
+
}] } });
|
|
117
|
+
|
|
67
118
|
/**
|
|
68
119
|
* Entry SearchFilter component.
|
|
69
120
|
*/
|
|
@@ -76,6 +127,7 @@ class EntrySearchFilterComponent {
|
|
|
76
127
|
* Emits the change in SearchFilterParams so the containing component can apply them and retrieve the filtered results.
|
|
77
128
|
*/
|
|
78
129
|
this.searchFilterChange = new EventEmitter();
|
|
130
|
+
this.controlType = ControlType;
|
|
79
131
|
}
|
|
80
132
|
ngOnInit() {
|
|
81
133
|
this.searchFilterForm = this.toFormGroup(this.searchFilters);
|
|
@@ -93,12 +145,21 @@ class EntrySearchFilterComponent {
|
|
|
93
145
|
});
|
|
94
146
|
return new UntypedFormGroup(group);
|
|
95
147
|
}
|
|
148
|
+
asTextSearchFilter(searchFilter) {
|
|
149
|
+
return searchFilter;
|
|
150
|
+
}
|
|
151
|
+
asSelectSearchFilter(searchFilter) {
|
|
152
|
+
return searchFilter;
|
|
153
|
+
}
|
|
154
|
+
asAutocompleteSearchFilter(searchFilter) {
|
|
155
|
+
return searchFilter;
|
|
156
|
+
}
|
|
96
157
|
}
|
|
97
158
|
EntrySearchFilterComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: EntrySearchFilterComponent, deps: [{ token: ENTRY_SEARCH_FILTER_CONFIG }], target: i0.ɵɵFactoryTarget.Component });
|
|
98
|
-
EntrySearchFilterComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: EntrySearchFilterComponent, selector: "entry-search-filter", inputs: { searchFilters: "searchFilters" }, outputs: { searchFilterChange: "searchFilterChange" }, ngImport: i0, template: "<form (ngSubmit)=\"onSubmit()\" [formGroup]=\"searchFilterForm\" class=\"search-form-container entry-form\">\r\n <div *ngFor=\"let searchFilter of searchFilters\" class=\"form-field\">\r\n <entry-search-filter-
|
|
159
|
+
EntrySearchFilterComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: EntrySearchFilterComponent, selector: "entry-search-filter", inputs: { searchFilters: "searchFilters" }, outputs: { searchFilterChange: "searchFilterChange" }, ngImport: i0, template: "<form (ngSubmit)=\"onSubmit()\" [formGroup]=\"searchFilterForm\" class=\"search-form-container entry-form\">\r\n <div *ngFor=\"let searchFilter of searchFilters\" class=\"form-field\">\r\n <ng-container [ngSwitch]=\"searchFilter.controlType\">\r\n <entry-text-search-filter *ngSwitchCase=\"controlType.text\" [searchFilter]=\"asTextSearchFilter(searchFilter)\" [form]=\"searchFilterForm\"></entry-text-search-filter>\r\n <entry-select-search-filter *ngSwitchCase=\"controlType.select\" [searchFilter]=\"asSelectSearchFilter(searchFilter)\" [form]=\"searchFilterForm\"></entry-select-search-filter>\r\n <entry-autocomplete-search-filter *ngSwitchCase=\"controlType.autocomplete\" [searchFilter]=\"asAutocompleteSearchFilter(searchFilter)\" [form]=\"searchFilterForm\"></entry-autocomplete-search-filter>\r\n </ng-container>\r\n </div>\r\n <div class=\"entry-search-filter-actions\">\r\n <button mat-button entry-submit-button>\r\n <span>{{config.applyButtonText}}</span>\r\n </button>\r\n </div>\r\n</form>", dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: i2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: i3$1.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "directive", type: i4$1.EntryButtonDirective, selector: "[mat-button][entry-submit-button],[mat-button][entry-cancel-button]" }, { kind: "component", type: TextSearchFilterComponent, selector: "entry-text-search-filter", inputs: ["searchFilter", "form"] }, { kind: "component", type: SelectSearchFilterComponent, selector: "entry-select-search-filter", inputs: ["searchFilter", "form"] }, { kind: "component", type: AutocompleteSearchFilterComponent, selector: "entry-autocomplete-search-filter", inputs: ["searchFilter", "form"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
99
160
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: EntrySearchFilterComponent, decorators: [{
|
|
100
161
|
type: Component,
|
|
101
|
-
args: [{ selector: 'entry-search-filter', changeDetection: ChangeDetectionStrategy.OnPush, template: "<form (ngSubmit)=\"onSubmit()\" [formGroup]=\"searchFilterForm\" class=\"search-form-container entry-form\">\r\n <div *ngFor=\"let searchFilter of searchFilters\" class=\"form-field\">\r\n <entry-search-filter-
|
|
162
|
+
args: [{ selector: 'entry-search-filter', changeDetection: ChangeDetectionStrategy.OnPush, template: "<form (ngSubmit)=\"onSubmit()\" [formGroup]=\"searchFilterForm\" class=\"search-form-container entry-form\">\r\n <div *ngFor=\"let searchFilter of searchFilters\" class=\"form-field\">\r\n <ng-container [ngSwitch]=\"searchFilter.controlType\">\r\n <entry-text-search-filter *ngSwitchCase=\"controlType.text\" [searchFilter]=\"asTextSearchFilter(searchFilter)\" [form]=\"searchFilterForm\"></entry-text-search-filter>\r\n <entry-select-search-filter *ngSwitchCase=\"controlType.select\" [searchFilter]=\"asSelectSearchFilter(searchFilter)\" [form]=\"searchFilterForm\"></entry-select-search-filter>\r\n <entry-autocomplete-search-filter *ngSwitchCase=\"controlType.autocomplete\" [searchFilter]=\"asAutocompleteSearchFilter(searchFilter)\" [form]=\"searchFilterForm\"></entry-autocomplete-search-filter>\r\n </ng-container>\r\n </div>\r\n <div class=\"entry-search-filter-actions\">\r\n <button mat-button entry-submit-button>\r\n <span>{{config.applyButtonText}}</span>\r\n </button>\r\n </div>\r\n</form>" }]
|
|
102
163
|
}], ctorParameters: function () { return [{ type: EntrySearchFilterConfig, decorators: [{
|
|
103
164
|
type: Inject,
|
|
104
165
|
args: [ENTRY_SEARCH_FILTER_CONFIG]
|
|
@@ -117,8 +178,8 @@ class SearchFilterBase {
|
|
|
117
178
|
this.key = options.key || '';
|
|
118
179
|
this.label = options.label || '';
|
|
119
180
|
this.placeholder = options.placeholder || '';
|
|
120
|
-
this.controlType = options.controlType ||
|
|
121
|
-
this.type = options.type ||
|
|
181
|
+
this.controlType = options.controlType || ControlType.text;
|
|
182
|
+
this.type = options.type || ControlType.text;
|
|
122
183
|
this.maxLength = options.maxLength || 256;
|
|
123
184
|
}
|
|
124
185
|
setValue(value) {
|
|
@@ -163,8 +224,25 @@ class SelectSearchFilter extends SearchFilterBase {
|
|
|
163
224
|
}
|
|
164
225
|
}
|
|
165
226
|
|
|
166
|
-
/**
|
|
167
|
-
|
|
227
|
+
/**
|
|
228
|
+
* Search filter autocomplete field configuration. Options for the autocomplete are provided
|
|
229
|
+
* indirectly via the search function that takes a string and returns an observable array of
|
|
230
|
+
* SelectOption<T>
|
|
231
|
+
*/
|
|
232
|
+
class AutocompleteSearchFilter extends SearchFilterBase {
|
|
233
|
+
constructor(options = {}) {
|
|
234
|
+
super(options);
|
|
235
|
+
this.controlType = ControlType.autocomplete;
|
|
236
|
+
this.search = options.search;
|
|
237
|
+
this.placeholder = options.placeholder;
|
|
238
|
+
this.label = options.label;
|
|
239
|
+
this.debounceTime = options.debounceTime ?? 300;
|
|
240
|
+
this.minimumCharacters = options.minimumCharacters ?? 3;
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
/** Model used to populate select or autocomplete options. */
|
|
245
|
+
class SelectOption {
|
|
168
246
|
constructor(
|
|
169
247
|
/** Key used as a value for selected option */
|
|
170
248
|
key,
|
|
@@ -179,14 +257,16 @@ class EntrySearchFilterModule {
|
|
|
179
257
|
}
|
|
180
258
|
EntrySearchFilterModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: EntrySearchFilterModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
181
259
|
EntrySearchFilterModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: EntrySearchFilterModule, declarations: [EntrySearchFilterComponent,
|
|
182
|
-
|
|
260
|
+
TextSearchFilterComponent,
|
|
261
|
+
SelectSearchFilterComponent,
|
|
262
|
+
AutocompleteSearchFilterComponent], imports: [CommonModule,
|
|
183
263
|
FormsModule,
|
|
184
264
|
ReactiveFormsModule,
|
|
185
265
|
MatInputModule,
|
|
186
266
|
MatButtonModule,
|
|
187
267
|
EntryButtonModule,
|
|
188
268
|
MatSelectModule,
|
|
189
|
-
|
|
269
|
+
MatAutocompleteModule], exports: [EntrySearchFilterComponent] });
|
|
190
270
|
EntrySearchFilterModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: EntrySearchFilterModule, imports: [CommonModule,
|
|
191
271
|
FormsModule,
|
|
192
272
|
ReactiveFormsModule,
|
|
@@ -194,13 +274,15 @@ EntrySearchFilterModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0",
|
|
|
194
274
|
MatButtonModule,
|
|
195
275
|
EntryButtonModule,
|
|
196
276
|
MatSelectModule,
|
|
197
|
-
|
|
277
|
+
MatAutocompleteModule] });
|
|
198
278
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: EntrySearchFilterModule, decorators: [{
|
|
199
279
|
type: NgModule,
|
|
200
280
|
args: [{
|
|
201
281
|
declarations: [
|
|
202
282
|
EntrySearchFilterComponent,
|
|
203
|
-
|
|
283
|
+
TextSearchFilterComponent,
|
|
284
|
+
SelectSearchFilterComponent,
|
|
285
|
+
AutocompleteSearchFilterComponent
|
|
204
286
|
],
|
|
205
287
|
imports: [
|
|
206
288
|
CommonModule,
|
|
@@ -210,7 +292,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
210
292
|
MatButtonModule,
|
|
211
293
|
EntryButtonModule,
|
|
212
294
|
MatSelectModule,
|
|
213
|
-
|
|
295
|
+
MatAutocompleteModule
|
|
214
296
|
],
|
|
215
297
|
exports: [
|
|
216
298
|
EntrySearchFilterComponent
|
|
@@ -222,5 +304,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
222
304
|
* Generated bundle index. Do not edit.
|
|
223
305
|
*/
|
|
224
306
|
|
|
225
|
-
export { ENTRY_SEARCH_FILTER_CONFIG, EntrySearchFilterComponent, EntrySearchFilterConfig, EntrySearchFilterModule, SearchFilterBase,
|
|
307
|
+
export { AutocompleteSearchFilter, ENTRY_SEARCH_FILTER_CONFIG, EntrySearchFilterComponent, EntrySearchFilterConfig, EntrySearchFilterModule, SearchFilterBase, SelectOption, SelectSearchFilter, TextSearchFilter, provideEntrySearchFilterConfig };
|
|
226
308
|
//# sourceMappingURL=enigmatry-entry-components-search-filter.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"enigmatry-entry-components-search-filter.mjs","sources":["../../../../libs/entry-components/search-filter/search-filter-config.model.ts","../../../../libs/entry-components/search-filter/search-filter-input/control-type.model.ts","../../../../libs/entry-components/search-filter/search-filter-input/search-filter-input.component.ts","../../../../libs/entry-components/search-filter/search-filter-input/search-filter-input.component.html","../../../../libs/entry-components/search-filter/entry-search-filter.component.ts","../../../../libs/entry-components/search-filter/entry-search-filter.component.html","../../../../libs/entry-components/search-filter/search-filter-input/search-filter-base.model.ts","../../../../libs/entry-components/search-filter/search-filter-input/inputs/text-search-filter.model.ts","../../../../libs/entry-components/search-filter/search-filter-input/inputs/select-search-filter.model.ts","../../../../libs/entry-components/search-filter/search-filter-input/inputs/select-filter-option.model.ts","../../../../libs/entry-components/search-filter/entry-search-filter.module.ts","../../../../libs/entry-components/search-filter/enigmatry-entry-components-search-filter.ts"],"sourcesContent":["import { Provider } from '@angular/core';\nimport { createInjectionToken, provideConfig } from '@enigmatry/entry-components/common';\n\n/**\n * Used to provide entry search filter configuration on module level.\n */\nexport class EntrySearchFilterConfig {\n /** Apply search filters button label (default 'Apply') */\n applyButtonText: string;\n /** Label for 'none selected' select filter option */\n noneSelectedOptionText: string;\n\n constructor(config: Partial<EntrySearchFilterConfig> = {}) {\n this.applyButtonText = config.applyButtonText ?? 'Apply';\n this.noneSelectedOptionText = config.noneSelectedOptionText ?? 'None';\n }\n}\nexport const ENTRY_SEARCH_FILTER_CONFIG = createInjectionToken(new EntrySearchFilterConfig());\n\n/**\n * Can be used to provide entry search filter configuration.\n */\nexport function provideEntrySearchFilterConfig(config: Partial<EntrySearchFilterConfig>): Provider {\n return provideConfig(ENTRY_SEARCH_FILTER_CONFIG, () => new EntrySearchFilterConfig(config));\n}\n","export class ControlType {\n static text = 'text-input';\n static select = 'select-input';\n}\n","import { ChangeDetectionStrategy, Component, Inject, Input } from '@angular/core';\nimport { UntypedFormGroup } from '@angular/forms';\nimport { ControlType } from './control-type.model';\nimport { ENTRY_SEARCH_FILTER_CONFIG, EntrySearchFilterConfig } from '../search-filter-config.model';\nimport { SearchFilterBase } from './search-filter-base.model';\nimport { SelectSearchFilter } from './inputs/select-search-filter.model';\nimport { TextSearchFilter } from './inputs/text-search-filter.model';\n\n@Component({\n selector: 'entry-search-filter-input',\n templateUrl: './search-filter-input.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class EntrySearchFilterInputComponent<T> {\n /** Configuration of the search filters inputs that will be displayed in the search-filter component. */\n @Input() searchFilter: SearchFilterBase<T>;\n /** Form group to which the search-filter input component will be added. */\n @Input() form: UntypedFormGroup;\n\n constructor(@Inject(ENTRY_SEARCH_FILTER_CONFIG) public config: EntrySearchFilterConfig) { }\n\n get textSearchFilter(): TextSearchFilter | undefined {\n return this.searchFilter.controlType === ControlType.text && this.searchFilter as TextSearchFilter;\n }\n get selectSearchFilter(): SelectSearchFilter<T> | undefined {\n return this.searchFilter.controlType === ControlType.select && this.searchFilter as SelectSearchFilter<T>;\n }\n}\n","<mat-form-field [formGroup]=\"form\" subscriptSizing=\"dynamic\">\n <mat-label [attr.for]=\"searchFilter.key\">{{searchFilter.label}}</mat-label>\n\n <ng-container *ngIf=\"textSearchFilter as searchFilter\">\n <input [formControlName]=\"searchFilter.key\" [id]=\"searchFilter.key\" [type]=\"searchFilter.type\" matInput\n [placeholder]=\"searchFilter.placeholder\" [maxlength]=\"searchFilter.maxLength\">\n </ng-container>\n\n <ng-container *ngIf=\"selectSearchFilter as searchFilter\">\n <mat-select [formControlName]=\"searchFilter.key\" [id]=\"searchFilter.key\" [multiple]=\"searchFilter.multiSelect\">\n <mat-option *ngIf=\"!searchFilter.multiSelect\" [value]=\"undefined\">\n {{config.noneSelectedOptionText}}\n </mat-option>\n <div *ngIf=\"searchFilter.options$ !== undefined; else fixedSelectValues\">\n <mat-option *ngFor=\"let option of searchFilter.options$ | async\"\n [value]=\"option.key\">{{option.label}}</mat-option>\n </div>\n <ng-template #fixedSelectValues>\n <mat-option *ngFor=\"let option of searchFilter.options\" [value]=\"option.key\">{{option.label}}</mat-option>\n </ng-template>\n </mat-select>\n </ng-container>\n\n</mat-form-field>","import { ChangeDetectionStrategy, Component, EventEmitter, Inject, Input, OnInit, Output } from '@angular/core';\r\nimport { UntypedFormGroup } from '@angular/forms';\r\nimport { SearchFilterParams } from './search-filter-params.type';\r\nimport { ENTRY_SEARCH_FILTER_CONFIG, EntrySearchFilterConfig } from './search-filter-config.model';\r\nimport { SearchFilterBase } from './search-filter-input/search-filter-base.model';\r\n\r\n/**\r\n * Entry SearchFilter component.\r\n */\r\n@Component({\r\n selector: 'entry-search-filter',\r\n templateUrl: './entry-search-filter.component.html',\r\n styleUrls: ['./entry-search-filter.component.scss'],\r\n changeDetection: ChangeDetectionStrategy.OnPush\r\n})\r\nexport class EntrySearchFilterComponent implements OnInit {\r\n\r\n /** Configuration of the search filters inputs that will be displayed in the search-filter component. */\r\n @Input() searchFilters: SearchFilterBase<any>[] = [];\r\n /**\r\n * Emits the change in SearchFilterParams so the containing component can apply them and retrieve the filtered results.\r\n */\r\n @Output() searchFilterChange = new EventEmitter<SearchFilterParams>();\r\n\r\n searchFilterForm!: UntypedFormGroup;\r\n\r\n constructor(@Inject(ENTRY_SEARCH_FILTER_CONFIG) public config: EntrySearchFilterConfig) { }\r\n\r\n ngOnInit() {\r\n this.searchFilterForm = this.toFormGroup(this.searchFilters);\r\n }\r\n\r\n onSubmit() {\r\n const formValue = this.searchFilterForm.value;\r\n this.searchFilterChange.emit(formValue);\r\n }\r\n\r\n toFormGroup(searchFilters: SearchFilterBase<any>[]) {\r\n const group: any = {};\r\n searchFilters.forEach(searchFilter => {\r\n const formControl = searchFilter.toFormControl();\r\n group[searchFilter.key] = formControl;\r\n searchFilter.formControl = formControl;\r\n });\r\n return new UntypedFormGroup(group);\r\n }\r\n}\r\n\r\n","<form (ngSubmit)=\"onSubmit()\" [formGroup]=\"searchFilterForm\" class=\"search-form-container entry-form\">\r\n <div *ngFor=\"let searchFilter of searchFilters\" class=\"form-field\">\r\n <entry-search-filter-input [searchFilter]=\"searchFilter\" [form]=\"searchFilterForm\">\r\n </entry-search-filter-input>\r\n </div>\r\n <div class=\"entry-search-filter-actions\">\r\n <button mat-button entry-submit-button>\r\n <span>{{config.applyButtonText}}</span>\r\n </button>\r\n </div>\r\n</form>","import { FormControl } from '@angular/forms';\n\n/**\n * Base Entry search filter input component.\n */\nexport class SearchFilterBase<T> {\n /** Unique search-filter input key */\n key: string;\n /** Default value to be displayed/selected in the input control */\n value: T | undefined;\n /** Label text to be displayed for the search-filter input control */\n label: string;\n /** Placeholder text for search-filter input control */\n placeholder: string;\n /** Type of input control e.g. 'email' */\n type: string;\n /** Control type to be overridden in implementing class, used to render the proper input type e.g. 'text-input' */\n controlType: string;\n /** Max text length to be entered in the input component (default is 256) */\n maxLength: number;\n /** A reference to the form control it represents */\n formControl: FormControl<T>;\n\n constructor(options: Partial<SearchFilterBase<T>> = {}) {\n this.value = options.value;\n this.key = options.key || '';\n this.label = options.label || '';\n this.placeholder = options.placeholder || '';\n this.controlType = options.controlType || '';\n this.type = options.type || '';\n this.maxLength = options.maxLength || 256;\n }\n\n setValue(value: T | undefined) {\n this.value = value;\n if (this.formControl) {\n this.formControl.patchValue(value);\n }\n }\n\n toFormControl(): FormControl<T> {\n return new FormControl<T>(this.value);\n }\n}\n","import { ControlType } from '../control-type.model';\nimport { SearchFilterBase } from '../search-filter-base.model';\n\n/**\n * Search filter text input filed configuration.\n */\nexport class TextSearchFilter extends SearchFilterBase<string> {\n override controlType = ControlType.text;\n}\n","import { Observable } from 'rxjs';\nimport { ControlType } from '../control-type.model';\nimport { SearchFilterBase } from '../search-filter-base.model';\nimport { SelectFilterOption } from './select-filter-option.model';\n\n/**\n * Search filter select input field configuration. Select options can be provided as fixed list (`options`)\n * or observable (dynamic) list (`options$`).\n */\nexport class SelectSearchFilter<T> extends SearchFilterBase<T> {\n override controlType = ControlType.select;\n /** Fixed list of select filter options (default is empty list) */\n options: SelectFilterOption<T>[] = [];\n /** Observable (dynamic) list of select filter options */\n options$: Observable<SelectFilterOption<T>[]> | undefined;\n /**\n * Enables selection of multiple options (default is true).\n * If it is set to false, 'none selected' option becomes available as a first option.\n * */\n multiSelect = true;\n\n constructor(options: Partial<SelectSearchFilter<T>> = {}) {\n super(options);\n this.options = options.options;\n this.options$ = options.options$;\n this.multiSelect = options.multiSelect;\n }\n}\n","/** Model used to populate select filter options. */\nexport class SelectFilterOption<T> {\n constructor(\n /** Key used as a value for selected option */\n public key: T,\n /** String value used as display label of select option */\n public label: string) {}\n}\n","import { NgModule } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\nimport { FormsModule, ReactiveFormsModule } from '@angular/forms';\r\nimport { MatInputModule } from '@angular/material/input';\r\nimport { MatButtonModule } from '@angular/material/button';\r\nimport { MatSelectModule } from '@angular/material/select';\r\nimport { EntryButtonModule } from '@enigmatry/entry-components/button';\r\nimport { MatTooltipModule } from '@angular/material/tooltip';\r\nimport { EntrySearchFilterComponent } from './entry-search-filter.component';\r\nimport { EntrySearchFilterInputComponent } from './search-filter-input/search-filter-input.component';\r\n\r\n@NgModule({\r\n declarations: [\r\n EntrySearchFilterComponent,\r\n EntrySearchFilterInputComponent\r\n ],\r\n imports: [\r\n CommonModule,\r\n FormsModule,\r\n ReactiveFormsModule,\r\n MatInputModule,\r\n MatButtonModule,\r\n EntryButtonModule,\r\n MatSelectModule,\r\n MatTooltipModule\r\n ],\r\n exports: [\r\n EntrySearchFilterComponent\r\n ]\r\n})\r\nexport class EntrySearchFilterModule { }\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i3","i4","i5.EntrySearchFilterInputComponent"],"mappings":";;;;;;;;;;;;;;;;;;;AAGA;;AAEG;MACU,uBAAuB,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iBAAiB;QACjB,eAAe;AACf,QAAA,gBAAgB,aAGhB,0BAA0B,CAAA,EAAA,CAAA,CAAA;AAGjB,uBAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,uBAAuB,YAbhC,YAAY;QACZ,WAAW;QACX,mBAAmB;QACnB,cAAc;QACd,eAAe;QACf,iBAAiB;QACjB,eAAe;QACf,gBAAgB,CAAA,EAAA,CAAA,CAAA;4FAMP,uBAAuB,EAAA,UAAA,EAAA,CAAA;kBAnBnC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,YAAY,EAAE;wBACZ,0BAA0B;wBAC1B,+BAA+B;AAChC,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACP,YAAY;wBACZ,WAAW;wBACX,mBAAmB;wBACnB,cAAc;wBACd,eAAe;wBACf,iBAAiB;wBACjB,eAAe;wBACf,gBAAgB;AACjB,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACP,0BAA0B;AAC3B,qBAAA;AACF,iBAAA,CAAA;;;AC7BD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"enigmatry-entry-components-search-filter.mjs","sources":["../../../../libs/entry-components/search-filter/search-filter-config.model.ts","../../../../libs/entry-components/search-filter/control-type.ts","../../../../libs/entry-components/search-filter/text/text-search-filter.component.ts","../../../../libs/entry-components/search-filter/text/text-search-filter.component.html","../../../../libs/entry-components/search-filter/select/select-search-filter.component.ts","../../../../libs/entry-components/search-filter/select/select-search-filter.component.html","../../../../libs/entry-components/search-filter/autocomplete/autocomplete-search-filter.component.ts","../../../../libs/entry-components/search-filter/autocomplete/autocomplete-search-filter.component.html","../../../../libs/entry-components/search-filter/entry-search-filter.component.ts","../../../../libs/entry-components/search-filter/entry-search-filter.component.html","../../../../libs/entry-components/search-filter/search-filter-base.model.ts","../../../../libs/entry-components/search-filter/text/text-search-filter.model.ts","../../../../libs/entry-components/search-filter/select/select-search-filter.model.ts","../../../../libs/entry-components/search-filter/autocomplete/autocomplete-search-filter.model.ts","../../../../libs/entry-components/search-filter/select-option.model.ts","../../../../libs/entry-components/search-filter/entry-search-filter.module.ts","../../../../libs/entry-components/search-filter/enigmatry-entry-components-search-filter.ts"],"sourcesContent":["import { Provider } from '@angular/core';\nimport { createInjectionToken, provideConfig } from '@enigmatry/entry-components/common';\n\n/**\n * Used to provide entry search filter configuration on module level.\n */\nexport class EntrySearchFilterConfig {\n /** Apply search filters button label (default 'Apply') */\n applyButtonText: string;\n /** Label for 'none selected' select filter option */\n noneSelectedOptionText: string;\n\n constructor(config: Partial<EntrySearchFilterConfig> = {}) {\n this.applyButtonText = config.applyButtonText ?? 'Apply';\n this.noneSelectedOptionText = config.noneSelectedOptionText ?? 'None';\n }\n}\nexport const ENTRY_SEARCH_FILTER_CONFIG = createInjectionToken(new EntrySearchFilterConfig());\n\n/**\n * Can be used to provide entry search filter configuration.\n */\nexport function provideEntrySearchFilterConfig(config: Partial<EntrySearchFilterConfig>): Provider {\n return provideConfig(ENTRY_SEARCH_FILTER_CONFIG, () => new EntrySearchFilterConfig(config));\n}\n","export enum ControlType {\n text = 'text-input',\n select = 'select-input',\n autocomplete = 'autocomplete-input'\n}\n","import { ChangeDetectionStrategy, Component, Input } from '@angular/core';\nimport { UntypedFormGroup } from '@angular/forms';\nimport { TextSearchFilter } from './text-search-filter.model';\n\n@Component({\n selector: 'entry-text-search-filter',\n templateUrl: './text-search-filter.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class TextSearchFilterComponent {\n @Input() searchFilter: TextSearchFilter;\n /** Form group to which the search-filter input component will be added. */\n @Input() form: UntypedFormGroup;\n}\n","<mat-form-field [formGroup]=\"form\" subscriptSizing=\"dynamic\">\n <mat-label [attr.for]=\"searchFilter.key\">{{searchFilter.label}}</mat-label>\n <input [formControlName]=\"searchFilter.key\" [id]=\"searchFilter.key\" [type]=\"searchFilter.type\" matInput\n [placeholder]=\"searchFilter.placeholder\" [maxlength]=\"searchFilter.maxLength\">\n</mat-form-field>","import { ChangeDetectionStrategy, Component, Inject, Input } from '@angular/core';\nimport { SelectSearchFilter } from './select-search-filter.model';\nimport { UntypedFormGroup } from '@angular/forms';\nimport { ENTRY_SEARCH_FILTER_CONFIG, EntrySearchFilterConfig } from '../search-filter-config.model';\n\n@Component({\n selector: 'entry-select-search-filter',\n templateUrl: './select-search-filter.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class SelectSearchFilterComponent<T> {\n /** Configuration of the search filters inputs that will be displayed in the search-filter component. */\n @Input() searchFilter: SelectSearchFilter<T>;\n /** Form group to which the search-filter input component will be added. */\n @Input() form: UntypedFormGroup;\n\n constructor(@Inject(ENTRY_SEARCH_FILTER_CONFIG) public config: EntrySearchFilterConfig) { }\n}\n","<mat-form-field [formGroup]=\"form\" subscriptSizing=\"dynamic\">\n <mat-label [attr.for]=\"searchFilter.key\">{{searchFilter.label}}</mat-label>\n <mat-select [formControlName]=\"searchFilter.key\" [id]=\"searchFilter.key\" [multiple]=\"searchFilter.multiSelect\">\n <mat-option *ngIf=\"!searchFilter.multiSelect\" [value]=\"undefined\">\n {{config.noneSelectedOptionText}}\n </mat-option>\n <ng-container *ngIf=\"searchFilter.options$ !== undefined; else fixedSelectValues\">\n <mat-option *ngFor=\"let option of searchFilter.options$ | async\"\n [value]=\"option.key\">{{option.label}}</mat-option>\n </ng-container>\n <ng-template #fixedSelectValues>\n <mat-option *ngFor=\"let option of searchFilter.options\" [value]=\"option.key\">{{option.label}}</mat-option>\n </ng-template>\n </mat-select>\n</mat-form-field>","import { AfterViewInit, ChangeDetectionStrategy, ChangeDetectorRef, Component, Input, OnDestroy, ViewChild } from '@angular/core';\nimport { FormControlName, UntypedFormGroup } from '@angular/forms';\nimport { Observable, Subject, of } from 'rxjs';\nimport { filter, tap, takeUntil, debounceTime } from 'rxjs/operators';\nimport { SelectOption } from '../select-option.model';\nimport { AutocompleteSearchFilter } from './autocomplete-search-filter.model';\n\n@Component({\n selector: 'entry-autocomplete-search-filter',\n templateUrl: './autocomplete-search-filter.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class AutocompleteSearchFilterComponent<T> implements AfterViewInit, OnDestroy {\n @Input() searchFilter: AutocompleteSearchFilter<T>;\n @Input() form: UntypedFormGroup;\n\n @ViewChild(FormControlName) searchField: FormControlName;\n\n options$: Observable<SelectOption<T>[]> = of([]);\n options: SelectOption<T>[] = [];\n\n destroy$ = new Subject<void>();\n\n constructor(private cdr: ChangeDetectorRef) { }\n\n ngAfterViewInit(): void {\n this.searchField\n .valueChanges\n .pipe(\n takeUntil(this.destroy$),\n filter(value => value?.length >= this.searchFilter.minimumCharacters),\n debounceTime(this.searchFilter.debounceTime)\n )\n .subscribe(searchValue => {\n // call search and retrieve options\n this.options$ = this.searchFilter.search(searchValue)\n .pipe(\n tap(options => this.options = options)\n );\n\n // mark for check because of the debounce\n this.cdr.markForCheck();\n });\n }\n\n ngOnDestroy(): void {\n this.destroy$.next();\n this.destroy$.complete();\n }\n\n displayFn = (selectedKey: T): string => this.options.find(x => x.key === selectedKey)?.label;\n}\n","<mat-form-field [formGroup]=\"form\" subscriptSizing=\"dynamic\">\n <mat-label>{{searchFilter.label}}</mat-label>\n <input type=\"text\" matInput [placeholder]=\"searchFilter.placeholder\"\n [formControlName]=\"searchFilter.key\" [id]=\"searchFilter.key\" [matAutocomplete]=\"auto\">\n <mat-autocomplete [displayWith]=\"displayFn\" #auto=\"matAutocomplete\">\n <mat-option *ngFor=\"let option of options$ | async\" [value]=\"option.key\">\n {{option.label}}\n </mat-option>\n </mat-autocomplete>\n</mat-form-field>","import { ChangeDetectionStrategy, Component, EventEmitter, Inject, Input, OnInit, Output } from '@angular/core';\r\nimport { UntypedFormGroup } from '@angular/forms';\r\nimport { SearchFilterParams } from './search-filter-params.type';\r\nimport { ENTRY_SEARCH_FILTER_CONFIG, EntrySearchFilterConfig } from './search-filter-config.model';\r\nimport { SearchFilterBase } from './search-filter-base.model';\r\nimport { TextSearchFilter } from './text/text-search-filter.model';\r\nimport { SelectSearchFilter } from './select/select-search-filter.model';\r\nimport { AutocompleteSearchFilter } from './autocomplete/autocomplete-search-filter.model';\r\nimport { ControlType } from './control-type';\r\n\r\n/**\r\n * Entry SearchFilter component.\r\n */\r\n@Component({\r\n selector: 'entry-search-filter',\r\n templateUrl: './entry-search-filter.component.html',\r\n changeDetection: ChangeDetectionStrategy.OnPush\r\n})\r\nexport class EntrySearchFilterComponent implements OnInit {\r\n\r\n /** Configuration of the search filters inputs that will be displayed in the search-filter component. */\r\n @Input() searchFilters: SearchFilterBase<any>[] = [];\r\n /**\r\n * Emits the change in SearchFilterParams so the containing component can apply them and retrieve the filtered results.\r\n */\r\n @Output() searchFilterChange = new EventEmitter<SearchFilterParams>();\r\n\r\n searchFilterForm!: UntypedFormGroup;\r\n controlType = ControlType;\r\n\r\n constructor(@Inject(ENTRY_SEARCH_FILTER_CONFIG) public config: EntrySearchFilterConfig) { }\r\n\r\n ngOnInit() {\r\n this.searchFilterForm = this.toFormGroup(this.searchFilters);\r\n }\r\n\r\n onSubmit() {\r\n const formValue = this.searchFilterForm.value;\r\n this.searchFilterChange.emit(formValue);\r\n }\r\n\r\n toFormGroup(searchFilters: SearchFilterBase<any>[]) {\r\n const group: any = {};\r\n searchFilters.forEach(searchFilter => {\r\n const formControl = searchFilter.toFormControl();\r\n group[searchFilter.key] = formControl;\r\n searchFilter.formControl = formControl;\r\n });\r\n return new UntypedFormGroup(group);\r\n }\r\n\r\n asTextSearchFilter(searchFilter: SearchFilterBase<any>): TextSearchFilter {\r\n return searchFilter as TextSearchFilter;\r\n }\r\n asSelectSearchFilter<T>(searchFilter: SearchFilterBase<T>): SelectSearchFilter<T> {\r\n return searchFilter as SelectSearchFilter<T>;\r\n }\r\n asAutocompleteSearchFilter<T>(searchFilter: SearchFilterBase<T>): AutocompleteSearchFilter<T> {\r\n return searchFilter as AutocompleteSearchFilter<T>;\r\n }\r\n}\r\n\r\n","<form (ngSubmit)=\"onSubmit()\" [formGroup]=\"searchFilterForm\" class=\"search-form-container entry-form\">\r\n <div *ngFor=\"let searchFilter of searchFilters\" class=\"form-field\">\r\n <ng-container [ngSwitch]=\"searchFilter.controlType\">\r\n <entry-text-search-filter *ngSwitchCase=\"controlType.text\" [searchFilter]=\"asTextSearchFilter(searchFilter)\" [form]=\"searchFilterForm\"></entry-text-search-filter>\r\n <entry-select-search-filter *ngSwitchCase=\"controlType.select\" [searchFilter]=\"asSelectSearchFilter(searchFilter)\" [form]=\"searchFilterForm\"></entry-select-search-filter>\r\n <entry-autocomplete-search-filter *ngSwitchCase=\"controlType.autocomplete\" [searchFilter]=\"asAutocompleteSearchFilter(searchFilter)\" [form]=\"searchFilterForm\"></entry-autocomplete-search-filter>\r\n </ng-container>\r\n </div>\r\n <div class=\"entry-search-filter-actions\">\r\n <button mat-button entry-submit-button>\r\n <span>{{config.applyButtonText}}</span>\r\n </button>\r\n </div>\r\n</form>","import { FormControl } from '@angular/forms';\nimport { ControlType } from './control-type';\n\n/**\n * Base Entry search filter input component.\n */\nexport class SearchFilterBase<T> {\n /** Unique search-filter input key */\n key: string;\n /** Default value to be displayed/selected in the input control */\n value: T | undefined;\n /** Label text to be displayed for the search-filter input control */\n label: string;\n /** Placeholder text for search-filter input control */\n placeholder: string;\n /** Type of input control e.g. 'text' or 'email' */\n type: string;\n /** Control type to be overridden in implementing class, used to render the proper input type e.g. 'text-input' */\n controlType: ControlType;\n /** Max text length to be entered in the input component (default is 256) */\n maxLength: number;\n /** A reference to the form control it represents */\n formControl: FormControl<T>;\n\n constructor(options: Partial<SearchFilterBase<T>> = {}) {\n this.value = options.value;\n this.key = options.key || '';\n this.label = options.label || '';\n this.placeholder = options.placeholder || '';\n this.controlType = options.controlType || ControlType.text;\n this.type = options.type || ControlType.text;\n this.maxLength = options.maxLength || 256;\n }\n\n setValue(value: T | undefined) {\n this.value = value;\n if (this.formControl) {\n this.formControl.patchValue(value);\n }\n }\n\n toFormControl(): FormControl<T> {\n return new FormControl<T>(this.value);\n }\n}\n","import { SearchFilterBase } from '../search-filter-base.model';\nimport { ControlType } from '../control-type';\n\n/**\n * Search filter text input filed configuration.\n */\nexport class TextSearchFilter extends SearchFilterBase<string> {\n override controlType = ControlType.text;\n}\n","import { Observable } from 'rxjs';\nimport { SearchFilterBase } from '../search-filter-base.model';\nimport { ControlType } from '../control-type';\nimport { SelectOption } from '../select-option.model';\n\n/**\n * Search filter select input field configuration. Select options can be provided as fixed list (`options`)\n * or observable (dynamic) list (`options$`).\n */\nexport class SelectSearchFilter<T> extends SearchFilterBase<T> {\n override controlType = ControlType.select;\n /** Fixed list of select filter options (default is empty list) */\n options: SelectOption<T>[] = [];\n /** Observable (dynamic) list of select filter options */\n options$: Observable<SelectOption<T>[]> | undefined;\n /**\n * Enables selection of multiple options (default is true).\n * If it is set to false, 'none selected' option becomes available as a first option.\n * */\n multiSelect = true;\n\n constructor(options: Partial<SelectSearchFilter<T>> = {}) {\n super(options);\n this.options = options.options;\n this.options$ = options.options$;\n this.multiSelect = options.multiSelect;\n }\n}\n","import { ControlType } from '../control-type';\nimport { SearchFilterBase } from '../search-filter-base.model';\nimport { SelectOption } from '../select-option.model';\nimport { Observable } from 'rxjs';\n\n/**\n * Search filter autocomplete field configuration. Options for the autocomplete are provided\n * indirectly via the search function that takes a string and returns an observable array of\n * SelectOption<T>\n */\nexport class AutocompleteSearchFilter<T> extends SearchFilterBase<T>{\n controlType = ControlType.autocomplete;\n /** Callback function for autocomplete options */\n search: (input: string) => Observable<SelectOption<T>[]>;\n /** Minimum number of characters that must enter to trigger the search function(default is 3) */\n minimumCharacters: number;\n /** Delay in typing before triggering the search function in milliseconds(default is 300) */\n debounceTime: number;\n\n constructor(options: Partial<AutocompleteSearchFilter<T>> = {}) {\n super(options);\n this.search = options.search;\n this.placeholder = options.placeholder;\n this.label = options.label;\n this.debounceTime = options.debounceTime ?? 300;\n this.minimumCharacters = options.minimumCharacters ?? 3;\n }\n}\n","/** Model used to populate select or autocomplete options. */\nexport class SelectOption<T> {\n constructor(\n /** Key used as a value for selected option */\n public key: T,\n /** String value used as display label of select option */\n public label: string) { }\n}\n","import { NgModule } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\nimport { FormsModule, ReactiveFormsModule } from '@angular/forms';\r\nimport { MatInputModule } from '@angular/material/input';\r\nimport { MatButtonModule } from '@angular/material/button';\r\nimport { MatSelectModule } from '@angular/material/select';\r\nimport { EntryButtonModule } from '@enigmatry/entry-components/button';\r\nimport { EntrySearchFilterComponent } from './entry-search-filter.component';\r\nimport { TextSearchFilterComponent } from './text/text-search-filter.component';\r\nimport { SelectSearchFilterComponent } from './select/select-search-filter.component';\r\nimport { AutocompleteSearchFilterComponent } from './autocomplete/autocomplete-search-filter.component';\r\nimport { MatAutocompleteModule } from '@angular/material/autocomplete';\r\n\r\n@NgModule({\r\n declarations: [\r\n EntrySearchFilterComponent,\r\n TextSearchFilterComponent,\r\n SelectSearchFilterComponent,\r\n AutocompleteSearchFilterComponent\r\n ],\r\n imports: [\r\n CommonModule,\r\n FormsModule,\r\n ReactiveFormsModule,\r\n MatInputModule,\r\n MatButtonModule,\r\n EntryButtonModule,\r\n MatSelectModule,\r\n MatAutocompleteModule\r\n ],\r\n exports: [\r\n EntrySearchFilterComponent\r\n ]\r\n})\r\nexport class EntrySearchFilterModule { }\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1","i2","i3","i4","i5.TextSearchFilterComponent","i6.SelectSearchFilterComponent","i7.AutocompleteSearchFilterComponent"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAGA;;AAEG;MACU,uBAAuB,CAAA;AAMhC,IAAA,WAAA,CAAY,SAA2C,EAAE,EAAA;QACrD,IAAI,CAAC,eAAe,GAAG,MAAM,CAAC,eAAe,IAAI,OAAO,CAAC;QACzD,IAAI,CAAC,sBA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AA,CAAA;;;ACjCD;;AAEG;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@enigmatry/entry-components",
|
|
3
|
-
"version": "15.1.0-preview",
|
|
3
|
+
"version": "15.1.0-preview.2",
|
|
4
4
|
"author": "Enigmatry",
|
|
5
5
|
"description": "Enigmatry entry angular material components",
|
|
6
6
|
"homepage": "https://github.com/enigmatry/entry-angular-building-blocks/tree/master/libs/entry-components#readme",
|
package/search-filter/README.md
CHANGED
|
@@ -4,43 +4,70 @@ Entry component for providing standard filtering capabilities that can be consum
|
|
|
4
4
|
|
|
5
5
|
* Text filter
|
|
6
6
|
* Select filter (supports fixed and dynamic (Observable) options)
|
|
7
|
+
* Autocomplete filter
|
|
7
8
|
|
|
8
9
|
## Integration
|
|
9
10
|
|
|
10
|
-
```npm
|
|
11
|
-
npm i @enigmatry/entry-components
|
|
12
|
-
```
|
|
13
|
-
|
|
14
11
|
Import component package:
|
|
15
12
|
|
|
16
13
|
```ts
|
|
17
14
|
import { EntrySearchFilterModule } from '@enigmatry/entry-components/search-filter';
|
|
18
15
|
```
|
|
19
16
|
|
|
20
|
-
|
|
17
|
+
## Basic usage
|
|
21
18
|
|
|
22
|
-
|
|
23
|
-
@use 'entry-components/styles/generate' as entry;
|
|
19
|
+
Provide filters
|
|
24
20
|
|
|
25
|
-
|
|
21
|
+
```ts
|
|
22
|
+
import {
|
|
23
|
+
AutocompleteSearchFilter,
|
|
24
|
+
SelectOption,
|
|
25
|
+
SelectSearchFilter,
|
|
26
|
+
TextSearchFilter,
|
|
27
|
+
} from '@enigmatry/entry-components/search-filter';
|
|
28
|
+
|
|
29
|
+
@Component({...})
|
|
30
|
+
export class ExampleComponent {
|
|
31
|
+
|
|
32
|
+
filters = [
|
|
33
|
+
new TextSearchFilter({
|
|
34
|
+
key: 'name',
|
|
35
|
+
label: 'Name',
|
|
36
|
+
placeholder: 'Name',
|
|
37
|
+
maxLength: 25
|
|
38
|
+
}),
|
|
39
|
+
new SelectSearchFilter({
|
|
40
|
+
key: 'username',
|
|
41
|
+
label: 'Username',
|
|
42
|
+
placeholder: 'Select username',
|
|
43
|
+
multiSelect: false,
|
|
44
|
+
options$: this._usersService
|
|
45
|
+
.getUsernames()
|
|
46
|
+
.pipe(map(usernames => usernames.map(un => new SelectOption(un, un))))
|
|
47
|
+
}),
|
|
48
|
+
new AutocompleteSearchFilter({
|
|
49
|
+
key: 'country',
|
|
50
|
+
label: 'Country',
|
|
51
|
+
placeholder: 'Select country',
|
|
52
|
+
minimumCharacters: 0,
|
|
53
|
+
search: (input: string) => of(Object.values(Country)
|
|
54
|
+
.filter(value => value.toLocaleLowerCase().includes(input.toLocaleLowerCase()))
|
|
55
|
+
.map((country => new SelectOption(country, country))))
|
|
56
|
+
})
|
|
57
|
+
];
|
|
58
|
+
}
|
|
26
59
|
```
|
|
27
60
|
|
|
28
|
-
Where `APP_THEME` represents application theming configuration, while `APP_TYPOGRAPHY` represents application fonts configuration.
|
|
29
|
-
|
|
30
|
-
## Basic usage
|
|
31
|
-
|
|
32
|
-
`entry-search-filter` is used to provide simple configuration and usage of data filtering:
|
|
33
|
-
|
|
34
61
|
```html
|
|
35
62
|
<entry-search-filter
|
|
36
|
-
[searchFilters]="
|
|
63
|
+
[searchFilters]="filters"
|
|
37
64
|
(searchFilterChange)="searchFilterChange($event)">
|
|
38
65
|
</entry-search-filter>
|
|
39
66
|
```
|
|
40
67
|
|
|
41
68
|
## Configuration
|
|
42
69
|
|
|
43
|
-
|
|
70
|
+
Optional configuration used to override defaults.
|
|
44
71
|
|
|
45
72
|
```ts
|
|
46
73
|
import { EntrySearchFilterModule, provideEntrySearchFilterConfig } from '@enigmatry/entry-components/search-filter';
|
|
@@ -52,7 +79,8 @@ import { EntrySearchFilterModule, provideEntrySearchFilterConfig } from '@enigma
|
|
|
52
79
|
],
|
|
53
80
|
providers: [
|
|
54
81
|
provideEntrySearchFilterConfig({
|
|
55
|
-
applyButtonText: 'Filter'
|
|
82
|
+
applyButtonText: 'Filter',
|
|
83
|
+
noneSelectedOptionText: '-'
|
|
56
84
|
})
|
|
57
85
|
]
|
|
58
86
|
})
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { AfterViewInit, ChangeDetectorRef, OnDestroy } from '@angular/core';
|
|
2
|
+
import { FormControlName, UntypedFormGroup } from '@angular/forms';
|
|
3
|
+
import { Observable, Subject } from 'rxjs';
|
|
4
|
+
import { SelectOption } from '../select-option.model';
|
|
5
|
+
import { AutocompleteSearchFilter } from './autocomplete-search-filter.model';
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
export declare class AutocompleteSearchFilterComponent<T> implements AfterViewInit, OnDestroy {
|
|
8
|
+
private cdr;
|
|
9
|
+
searchFilter: AutocompleteSearchFilter<T>;
|
|
10
|
+
form: UntypedFormGroup;
|
|
11
|
+
searchField: FormControlName;
|
|
12
|
+
options$: Observable<SelectOption<T>[]>;
|
|
13
|
+
options: SelectOption<T>[];
|
|
14
|
+
destroy$: Subject<void>;
|
|
15
|
+
constructor(cdr: ChangeDetectorRef);
|
|
16
|
+
ngAfterViewInit(): void;
|
|
17
|
+
ngOnDestroy(): void;
|
|
18
|
+
displayFn: (selectedKey: T) => string;
|
|
19
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AutocompleteSearchFilterComponent<any>, never>;
|
|
20
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<AutocompleteSearchFilterComponent<any>, "entry-autocomplete-search-filter", never, { "searchFilter": "searchFilter"; "form": "form"; }, {}, never, never, false, never>;
|
|
21
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ControlType } from '../control-type';
|
|
2
|
+
import { SearchFilterBase } from '../search-filter-base.model';
|
|
3
|
+
import { SelectOption } from '../select-option.model';
|
|
4
|
+
import { Observable } from 'rxjs';
|
|
5
|
+
/**
|
|
6
|
+
* Search filter autocomplete field configuration. Options for the autocomplete are provided
|
|
7
|
+
* indirectly via the search function that takes a string and returns an observable array of
|
|
8
|
+
* SelectOption<T>
|
|
9
|
+
*/
|
|
10
|
+
export declare class AutocompleteSearchFilter<T> extends SearchFilterBase<T> {
|
|
11
|
+
controlType: ControlType;
|
|
12
|
+
/** Callback function for autocomplete options */
|
|
13
|
+
search: (input: string) => Observable<SelectOption<T>[]>;
|
|
14
|
+
/** Minimum number of characters that must enter to trigger the search function(default is 3) */
|
|
15
|
+
minimumCharacters: number;
|
|
16
|
+
/** Delay in typing before triggering the search function in milliseconds(default is 300) */
|
|
17
|
+
debounceTime: number;
|
|
18
|
+
constructor(options?: Partial<AutocompleteSearchFilter<T>>);
|
|
19
|
+
}
|
|
@@ -2,7 +2,11 @@ import { EventEmitter, OnInit } from '@angular/core';
|
|
|
2
2
|
import { UntypedFormGroup } from '@angular/forms';
|
|
3
3
|
import { SearchFilterParams } from './search-filter-params.type';
|
|
4
4
|
import { EntrySearchFilterConfig } from './search-filter-config.model';
|
|
5
|
-
import { SearchFilterBase } from './search-filter-
|
|
5
|
+
import { SearchFilterBase } from './search-filter-base.model';
|
|
6
|
+
import { TextSearchFilter } from './text/text-search-filter.model';
|
|
7
|
+
import { SelectSearchFilter } from './select/select-search-filter.model';
|
|
8
|
+
import { AutocompleteSearchFilter } from './autocomplete/autocomplete-search-filter.model';
|
|
9
|
+
import { ControlType } from './control-type';
|
|
6
10
|
import * as i0 from "@angular/core";
|
|
7
11
|
/**
|
|
8
12
|
* Entry SearchFilter component.
|
|
@@ -16,10 +20,14 @@ export declare class EntrySearchFilterComponent implements OnInit {
|
|
|
16
20
|
*/
|
|
17
21
|
searchFilterChange: EventEmitter<SearchFilterParams>;
|
|
18
22
|
searchFilterForm: UntypedFormGroup;
|
|
23
|
+
controlType: typeof ControlType;
|
|
19
24
|
constructor(config: EntrySearchFilterConfig);
|
|
20
25
|
ngOnInit(): void;
|
|
21
26
|
onSubmit(): void;
|
|
22
27
|
toFormGroup(searchFilters: SearchFilterBase<any>[]): UntypedFormGroup;
|
|
28
|
+
asTextSearchFilter(searchFilter: SearchFilterBase<any>): TextSearchFilter;
|
|
29
|
+
asSelectSearchFilter<T>(searchFilter: SearchFilterBase<T>): SelectSearchFilter<T>;
|
|
30
|
+
asAutocompleteSearchFilter<T>(searchFilter: SearchFilterBase<T>): AutocompleteSearchFilter<T>;
|
|
23
31
|
static ɵfac: i0.ɵɵFactoryDeclaration<EntrySearchFilterComponent, never>;
|
|
24
32
|
static ɵcmp: i0.ɵɵComponentDeclaration<EntrySearchFilterComponent, "entry-search-filter", never, { "searchFilters": "searchFilters"; }, { "searchFilterChange": "searchFilterChange"; }, never, never, false, never>;
|
|
25
33
|
}
|