office-ui-fabric-react
Version: 
Reusable React components for building experiences for Office 365.
46 lines (45 loc) • 2.24 kB
TypeScript
/// <reference types="react" />
import * as React from 'react';
import { BaseComponent } from '../../Utilities';
import { Selection } from '../../Selection';
import { IBaseSelectedItemsList, IBaseSelectedItemsListProps, ISelectedItemProps } from './BaseSelectedItemsList.types';
export interface IBaseSelectedItemsListState {
    items?: any;
    suggestedDisplayValue?: string;
    moreSuggestionsAvailable?: boolean;
    isSearching?: boolean;
    isMostRecentlyUsedVisible?: boolean;
    suggestionsVisible?: boolean;
    suggestionsLoading?: boolean;
    isResultsFooterVisible?: boolean;
}
export declare class BaseSelectedItemsList<T, P extends IBaseSelectedItemsListProps<T>> extends BaseComponent<P, IBaseSelectedItemsListState> implements IBaseSelectedItemsList<T> {
    protected root: HTMLElement;
    protected selection: Selection;
    constructor(basePickerProps: P);
    readonly items: T[];
    addItems: (items: T[]) => void;
    removeItemAt: (index: number) => void;
    removeItem: (item: ISelectedItemProps<T>) => void;
    removeItems: (itemsToRemove: any[]) => void;
    /**
     * Controls what happens whenever there is an action that impacts the selected items.
     * If selectedItems is provided as a property then this will act as a controlled component and it will not update it's own state.
    */
    updateItems(items: T[], focusIndex?: number): void;
    onCopy: (ev: React.ClipboardEvent<HTMLElement>) => void;
    unselectAll(): void;
    componentWillUpdate(newProps: P, newState: IBaseSelectedItemsListState): void;
    componentDidMount(): void;
    componentWillReceiveProps(newProps: P): void;
    render(): any;
    protected renderItems: () => JSX.Element[];
    protected onSelectionChanged: () => void;
    protected onChange(items?: T[]): void;
    protected onKeyDown: (ev: React.KeyboardEvent<HTMLElement>) => void;
    protected onItemChange: (changedItem: T, index: number) => void;
    protected onBackspace(ev: React.KeyboardEvent<HTMLElement>): void;
    protected copyItems(items: T[]): void;
    protected _isFocusZoneInnerKeystroke(ev: React.KeyboardEvent<HTMLElement>): boolean;
    private _onSelectedItemsUpdated(items?, focusIndex?);
}