office-ui-fabric-react
Version:
Reusable React components for building experiences for Office 365.
70 lines (69 loc) • 2.65 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 _host;
private _focusZone;
private _dropDown;
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;
private _onRenderPlaceHolder;
private _onRenderContainer;
private _onRenderCaretDown;
private _onRenderList;
private _onRenderItem;
private _renderSeparator(item);
private _renderHeader(item);
private _renderOption;
private _onRenderOption;
private _onRenderLabel;
private _onPositioned;
private _onItemClick;
/**
* 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;
private _onDismiss;
private _getSelectedIndexes(options, selectedKey);
private _getAllSelectedOptions(options, selectedIndices);
private _getAllSelectedIndices(options);
private _getSelectedIndex(options, selectedKey);
private _onDropdownBlur;
private _onDropdownKeyDown;
private _onDropdownKeyUp;
private _onZoneKeyDown;
private _onDropdownClick;
}