UNPKG

@devmn/multi-select

Version:

Angular multi select component that provides two lists controls side-by-side that allows items in one list to be selected and moved* to the other list via drag-and-drop and/or a button-based interface.

84 lines (83 loc) 2.9 kB
import { DoCheck, EventEmitter, IterableDiffers, OnChanges, SimpleChange } from '@angular/core'; import { BasicSelectData } from './multi-select.model'; export declare type compareFunction = (a: any, b: any) => number; export declare class MultiSelectComponent implements DoCheck, OnChanges { private differs; static AVAILABLE_LIST_NAME: string; static CONFIRMED_LIST_NAME: string; static LTR: string; static RTL: string; static DEFAULT_FORMAT: { add: string; remove: string; all: string; none: string; direction: string; draggable: boolean; locale: any; selectAll: string; removeAll: string; }; id: string; key: string; display: any; height: string; filter: boolean; format: { add: string; remove: string; all: string; none: string; direction: string; draggable: boolean; locale: any; selectAll: string; removeAll: string; }; sort: boolean; compare: compareFunction; disabled: boolean; source: Array<any>; destination: Array<any>; loading: boolean; emptySourceMessage: string; destinationChange: EventEmitter<any>; available: BasicSelectData; confirmed: BasicSelectData; sourceDiffer: any; destinationDiffer: any; sourceLoading: boolean; destinationLoading: boolean; private sorter; constructor(differs: IterableDiffers); ngOnChanges(changeRecord: { [key: string]: SimpleChange; }): void; ngDoCheck(): void; buildAvailable(source: Array<any>): boolean; buildConfirmed(destination: Array<any>): boolean; updatedSource(): void; updatedDestination(): void; direction(): boolean; dragEnd(list?: BasicSelectData): boolean; drag(event: DragEvent, item: any, list: BasicSelectData): void; allowDrop(event: DragEvent, list: BasicSelectData): boolean; dragLeave(): void; drop(event: DragEvent, list: BasicSelectData): void; private trueUp; findItemIndex(list: Array<any>, item: any, key?: any): number; private makeUnavailable; moveItem(source: BasicSelectData, target: BasicSelectData, item?: any, trueup?: boolean): void; isItemSelected(list: Array<any>, item: any): boolean; shiftClick(event: MouseEvent, index: number, source: BasicSelectData, item: any): void; selectItem(list: Array<any>, item: any): void; clickItem(list: Array<any>, item: any, isConfirm: boolean): void; selectAll(source: BasicSelectData, isConfirm: boolean): void; isAllSelected(source: BasicSelectData): boolean; isAnySelected(source: BasicSelectData): boolean; private unpick; clearFilter(source: BasicSelectData): void; onFilter(source: BasicSelectData): void; private makeId; protected makeName(item: any, separator?: string): string; }