UNPKG

ngx-multi-selector

Version:

A small plugin which generates multi-selector control, it supports web api loading. Only supported angular 5.

73 lines (72 loc) 2.63 kB
import { ElementRef, TemplateRef, OnDestroy, OnInit } from '@angular/core'; import { ControlValueAccessor } from '@angular/forms'; import { Observable } from 'rxjs'; export declare class NgxMultiSelectorComponent implements OnInit, OnDestroy, ControlValueAccessor { private readonly _defaultItemsInterval; private _selectedItems; private _separationCharacter; private _keyword; private _originalItems; private _availableItems; private _maximumContextItems; private _maximumSelectableItems; private _key; private _displayProperty; private _valueProperty; readonly loadAvailableItemsAsyncHandler: (keyword: string) => Observable<any[]>; private _updateAvailableItemsSubject; private _updateAvailableItemsSubscription; multiSelectorDropDown: ElementRef; shouldClearButtonAvailable: boolean; shouldSearchBoxAvailable: boolean; placeholderSearchDropDown: string; placeholderTitleDropDown: string; disabled: boolean; itemTemplate: TemplateRef<any>; protected ngOnTouchedCallback: () => void; protected ngOnChangeCallback: (_: any) => void; private _loadItemsInterval; /* * Keyword is used for searching for items. * */ keyword: string; separationCharacter: string; /* * Get selected items. * */ selectedItems: any[]; interval: number; /* * Get available items for displaying in drop-down list. * */ items: Array<any>; readonly maximumContextItem: number; maximumContextItems: number; /* * Update the maximum selectable items. * */ maximumSelectableItems: number; protected key: string; protected keyProperty: string; protected displayProperty: string; protected valueProperty: string; constructor(); ngOnDestroy(): void; hasItemSelected(item: any): boolean; protected loadSelectedItemIndex(item: any): number; loadSelectedItemsTitle(): string; deleteSelectedItems(shouldRaiseOnChangeCallback?: boolean): void; deleteSelectedValue(value: any): void; protected clickSelectItem(item: any): void; close(): void; open(): void; writeValue(selectedValues: any[]): void; registerOnChange(fn: any): void; registerOnTouched(fn: any): void; setDisabledState(isDisabled: boolean): void; protected loadAvailableItemsAsync(keyword: string): Observable<any[]>; loadItemDisplay(item: any): string; protected loadItemValue(item: any): string; protected loadItemUniqueValue(item: any): any; ngOnInit(): void; }