add seperator keycodes for schematics field
This commit is contained in:
parent
681f73b865
commit
5d7e2cb307
|
@ -228,7 +228,7 @@
|
|||
|
||||
<mat-form-field class="col-6">
|
||||
<mat-label>Schematics</mat-label>
|
||||
<app-multiple-auto-complete placeholder="Schematics" [hidePlaceholder]="true" required='false' [formControl]="this.form.get('schematics')" [configuration]="schematicsAutoCompleteConfiguration">
|
||||
<app-multiple-auto-complete placeholder="Schematics" [hidePlaceholder]="true" required='false' [separatorKeysCodes]="separatorKeysCodes" [formControl]="this.form.get('schematics')" [configuration]="schematicsAutoCompleteConfiguration">
|
||||
</app-multiple-auto-complete>
|
||||
</mat-form-field>
|
||||
|
||||
|
|
|
@ -46,6 +46,7 @@ import {
|
|||
import {ConfigurationService} from "@app/core/services/configuration/configuration.service";
|
||||
import { MultipleAutoCompleteConfiguration } from '@app/library/auto-complete/multiple/multiple-auto-complete-configuration';
|
||||
import { map } from 'rxjs/operators';
|
||||
import { COMMA, ENTER } from '@angular/cdk/keycodes';
|
||||
|
||||
@Component({
|
||||
selector: 'app-dataset-profile-editor-field-component',
|
||||
|
@ -72,6 +73,8 @@ export class DatasetProfileEditorFieldComponent extends BaseComponent implements
|
|||
|
||||
@Output() delete = new EventEmitter<void>();
|
||||
|
||||
readonly separatorKeysCodes: number[] = [ENTER, COMMA];
|
||||
|
||||
schematicsAutoCompleteConfiguration: MultipleAutoCompleteConfiguration = {
|
||||
filterFn: this.filterSchematics.bind(this),
|
||||
initialItems: (excludedItems: any[]) => this.filterSchematics('').pipe(map(result => result.filter(resultItem => (excludedItems || []).map(x => x !== resultItem)))),
|
||||
|
|
Loading…
Reference in New Issue