office-ui-fabric-react
Version: 
Reusable React components for building experiences for Office 365.
55 lines (54 loc) • 2.66 kB
TypeScript
/// <reference types="react" />
import * as React from 'react';
import { BaseComponent } from '../../Utilities';
import { IBaseFloatingPicker, IBaseFloatingPickerProps } from './BaseFloatingPicker.types';
import { ISuggestionsControlProps } from './Suggestions/Suggestions.types';
import { SuggestionsControl } from './Suggestions/SuggestionsControl';
import { SuggestionsStore } from './Suggestions/SuggestionsStore';
export interface IBaseFloatingPickerState {
    queryString: string;
    suggestionsVisible?: boolean;
    didBind: boolean;
}
export declare class BaseFloatingPicker<T, P extends IBaseFloatingPickerProps<T>> extends BaseComponent<P, IBaseFloatingPickerState> implements IBaseFloatingPicker {
    protected selection: Selection;
    protected root: {
        (component: HTMLDivElement | null): void;
        current: HTMLDivElement | null;
        value: HTMLDivElement | null;
    };
    protected suggestionStore: SuggestionsStore<T>;
    protected suggestionsControl: SuggestionsControl<T>;
    protected SuggestionsControlOfProperType: new (props: ISuggestionsControlProps<T>) => SuggestionsControl<T>;
    protected currentPromise: PromiseLike<any>;
    constructor(basePickerProps: P);
    readonly inputText: string;
    readonly suggestions: any[];
    forceResolveSuggestion(): void;
    readonly currentSelectedSuggestionIndex: number;
    readonly isSuggestionsShown: boolean;
    onQueryStringChanged: (queryString: string) => void;
    hidePicker: () => void;
    showPicker: (updateValue?: boolean) => void;
    componentDidMount(): void;
    componentDidUpdate(): void;
    componentWillUnmount(): void;
    componentWillReceiveProps(newProps: P): void;
    completeSuggestion: () => void;
    updateSuggestions(suggestions: T[], forceUpdate?: boolean): void;
    render(): JSX.Element;
    protected renderSuggestions(): JSX.Element | null;
    protected onSelectionChange(): void;
    protected updateValue(updatedValue: string): void;
    protected updateSuggestionWithZeroState(): void;
    protected updateSuggestionsList(suggestions: T[] | PromiseLike<T[]>): void;
    protected onChange(item: T): void;
    protected onSuggestionClick: (ev: React.MouseEvent<HTMLElement>, item: T, index: number) => void;
    protected onSuggestionRemove: (ev: React.MouseEvent<HTMLElement>, item: T, index: number) => void;
    protected onKeyDown: (ev: MouseEvent) => void;
    private _onResolveSuggestions(updatedValue);
    private _onValidateInput;
    private _updateSuggestionsVisible(shouldShow);
    private _bindToInputElement();
    private _unbindFromInputElement();
}