office-ui-fabric-react
Version: 
Reusable React components for building experiences for Office 365.
72 lines (71 loc) • 2.8 kB
TypeScript
/// <reference types="react" />
import { IDropdownProps } from './Dropdown.types';
import { IWithResponsiveModeState } from '../../utilities/decorators/withResponsiveMode';
import { BaseComponent } from '../../Utilities';
export interface IDropdownInternalProps extends IDropdownProps, IWithResponsiveModeState {
}
export interface IDropdownState {
    isOpen?: boolean;
    selectedIndices?: number[];
}
export declare class Dropdown extends BaseComponent<IDropdownInternalProps, IDropdownState> {
    static defaultProps: {
        options: any[];
    };
    private static Option;
    private _root;
    private _host;
    private _focusZone;
    private _dropDown;
    private _dropdownLabel;
    private _id;
    private _isScrollIdle;
    private readonly _scrollIdleDelay;
    private _scrollIdleTimeoutId;
    constructor(props: IDropdownProps);
    componentWillReceiveProps(newProps: IDropdownProps): void;
    componentDidUpdate(prevProps: IDropdownProps, prevState: IDropdownState): void;
    render(): JSX.Element;
    focus(shouldOpenOnFocus?: boolean): 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 _onRenderCaretDown(props);
    private _onRenderList(props);
    private _onRenderItem(item);
    private _renderSeparator(item);
    private _renderHeader(item);
    private _renderOption(item);
    private _onRenderOption(item);
    private _onRenderLabel(item);
    private _onPositioned();
    private _onItemClick(item);
    /**
     * Scroll handler for the callout to make sure the mouse events
     * for updating focus are not interacting during scroll
     */
    private _onScroll();
    private _onItemMouseEnter(item, ev);
    private _onItemMouseMove(item, ev);
    private _onMouseItemLeave(item, ev);
    private _onDismiss();
    private _getSelectedIndexes(options, selectedKey);
    private _getAllSelectedOptions(options, selectedIndices);
    private _getAllSelectedIndices(options);
    private _getSelectedIndex(options, selectedKey);
    private _onDropdownBlur(ev);
    private _onDropdownKeyDown(ev);
    private _onDropdownKeyUp(ev);
    private _onZoneKeyDown(ev);
    private _onDropdownClick(ev);
}