office-ui-fabric-react
Version: 
Reusable React components for building experiences for Office 365.
63 lines (62 loc) • 2.41 kB
TypeScript
import * as React from 'react';
import { IDropdownProps } from './Dropdown.Props';
import { FocusZone } from '../../FocusZone';
import { IWithResponsiveModeState } from '../../utilities/decorators/withResponsiveMode';
import { BaseComponent } from '../../Utilities';
export interface IDropdownInternalProps extends IDropdownProps, IWithResponsiveModeState {
}
export interface IDropdownState {
    isOpen?: boolean;
    selectedIndex?: number;
    selectedIndexes?: number[];
}
export declare class Dropdown extends BaseComponent<IDropdownInternalProps, IDropdownState> {
    static defaultProps: {
        options: any[];
    };
    private static Option;
    refs: {
        [key: string]: React.ReactInstance;
        root: HTMLElement;
        focusZone: FocusZone;
    };
    private _focusZone;
    private _dropDown;
    private _dropdownLabel;
    private _id;
    constructor(props: IDropdownProps);
    componentWillReceiveProps(newProps: IDropdownProps): void;
    componentDidUpdate(prevProps: IDropdownProps, prevState: IDropdownState): void;
    render(): JSX.Element;
    focus(): void;
    setSelectedIndex(index: number): void;
    private _copyArray(array);
    /**
     * Finds the next valid Dropdown option and sets the selected index to it.
     * @param stepValue Value of how many items the function should traverse.  Should be -1 or 1.
     * @param index Index of where the search should start
     * @param selectedIndex The selectedIndex Dropdown's state
     * @returns The next valid dropdown option's index
     */
    private _moveIndex(stepValue, index, selectedIndex);
    private _onRenderTitle(item);
    private _onRenderPlaceHolder(props);
    private _onRenderContainer(props);
    private _onRenderList(props);
    private _onRenderItem(item);
    private _renderSeparator(item);
    private _renderHeader(item);
    private _renderOption(item);
    private _onRenderOption(item);
    private _onPositioned();
    private _onItemClick(index);
    private _onDismiss();
    private _getSelectedIndexes(options, selectedKey);
    private _getAllSelectedOptions(options, selectedIndex);
    private _getSelectedIndex(options, selectedKey);
    private _onDropdownBlur(ev);
    private _onDropdownKeyDown(ev);
    private _onDropdownKeyUp(ev);
    private _onZoneKeyDown(ev);
    private _onDropdownClick(ev);
}