UNPKG

@stratio/egeo

Version:

Stratio egeo library of components in Angular 2

36 lines (35 loc) 1.52 kB
import { ChangeDetectorRef, EventEmitter, SimpleChanges } from '@angular/core'; import { StTwoListSelectionElement } from './st-two-list-selection.model'; export declare type List = StTwoListSelectionElement[]; export declare type IdList = Array<string | number>; export declare class StTwoListSelection { private _cd; originalAll: List; originalSelected: List; copyAllElement: List; copySelectedElements: List; allSearch: string; selectedSearch: string; searchBy: string; private emitter; private sortLists; constructor(_cd: ChangeDetectorRef); onSelectAllElement(selection: StTwoListSelectionElement): void; onSelectSelectedElement(selection: StTwoListSelectionElement): void; onSearchOverAll(search: string): void; onSearchOverSelected(search: string): void; onMoveToSelected(event: Event): void; onMoveToAll(event: Event): void; onMoveAllToSelected(event: Event): void; onMoveAllToAll(event: Event): void; init(all: List, selected: List, changeEmitter: EventEmitter<List>, sorted: 'id' | 'name'): void; checkChanges(changes: SimpleChanges, allList: string, selectedList: string): void; private generateWorkLists(); private copyLists(newValue, prevState, without?); private searchAndSelect(list, selected); private getIdsToMove(list); private moveIdsFromAllToSelected(all, selected, ids); private removeIdsFromSelected(selected, ids); private orderListBy(list, by); private canSelect(selection, list); }