ontotext-reusable-ui-components
Version:
Unified reusable UI components designed for the Ontotext ecosystem.
48 lines (47 loc) • 1.65 kB
TypeScript
import { ElementRef, OnInit, QueryList } from '@angular/core';
import { ControlValueAccessor } from '@angular/forms';
import { MatOption } from '@angular/material/core';
import { MatSelect } from '@angular/material/select';
import { OnDestroyMixin } from '@w11k/ngx-componentdestroyed';
export declare class DropdownMultiSelectComponent extends OnDestroyMixin implements OnInit, ControlValueAccessor {
matSelect: MatSelect;
searchSelectInput: ElementRef;
options: QueryList<MatOption>;
/** Current search value */
get searchValue(): string;
private value;
private onChange;
private onTouched;
private previousSelected;
private change;
private ENTER;
private previousSelectedValues;
constructor(matSelect: MatSelect);
ngOnInit(): void;
initMultiSelectedValues(): void;
/**
* Handles the key down event with MatSelect.
* Do not handles ENTER key press
* @param {KeyboardEvent} event
*/
handleKeydown(event: KeyboardEvent): void;
writeValue(value: string): void;
onInputChange(value: any): void;
onBlur(value: string): void;
registerOnChange(fn: Function): void;
registerOnTouched(fn: Function): void;
/**
* Focuses the search input field
*/
focus(): void;
/**
* Resets the current search value
* @param {boolean} focus whether to focus after resetting
*/
reset(focus?: boolean): void;
/**
* Initializes handling <mat-select [multiple]="true">
* Note: to improve this code, mat-select should be extended to allow disabling resetting the selection while filtering.
*/
private init;
}