1 | import * as React from 'react';
|
2 | import { Autofill } from '../../Autofill';
|
3 | import { IBaseExtendedPickerProps, IBaseExtendedPicker } from './BaseExtendedPicker.types';
|
4 | import { IBaseFloatingPickerProps, BaseFloatingPicker } from '../../FloatingPicker';
|
5 | import { BaseSelectedItemsList, IBaseSelectedItemsListProps } from '../../SelectedItemsList';
|
6 | import { Selection } from '../../Selection';
|
7 | export interface IBaseExtendedPickerState<T> {
|
8 | queryString: string | null;
|
9 | selectedItems: T[] | null;
|
10 | suggestionItems: T[] | null;
|
11 | }
|
12 | export declare class BaseExtendedPicker<T, P extends IBaseExtendedPickerProps<T>> extends React.Component<P, IBaseExtendedPickerState<T>> implements IBaseExtendedPicker<T> {
|
13 | floatingPicker: React.RefObject<BaseFloatingPicker<T, IBaseFloatingPickerProps<T>>>;
|
14 | selectedItemsList: React.RefObject<BaseSelectedItemsList<T, IBaseSelectedItemsListProps<T>>>;
|
15 | protected root: React.RefObject<HTMLDivElement>;
|
16 | protected input: React.RefObject<Autofill>;
|
17 | protected selection: Selection;
|
18 | protected floatingPickerProps: IBaseFloatingPickerProps<T>;
|
19 | protected selectedItemsListProps: IBaseSelectedItemsListProps<T>;
|
20 | constructor(basePickerProps: P);
|
21 | readonly items: any;
|
22 | componentDidMount(): void;
|
23 | UNSAFE_componentWillReceiveProps(newProps: P): void;
|
24 | focus(): void;
|
25 | clearInput(): void;
|
26 | readonly inputElement: HTMLInputElement | null;
|
27 | readonly highlightedItems: T[];
|
28 | render(): JSX.Element;
|
29 | protected onSelectionChange: () => void;
|
30 | protected canAddItems(): boolean;
|
31 | protected renderFloatingPicker(): JSX.Element;
|
32 | protected renderSelectedItemsList(): JSX.Element;
|
33 | protected onInputChange: (value: string, composing?: boolean | undefined) => void;
|
34 | protected onInputFocus: (ev: React.FocusEvent<HTMLInputElement | Autofill>) => void;
|
35 | protected onInputClick: (ev: React.MouseEvent<HTMLInputElement | Autofill, MouseEvent>) => void;
|
36 | protected onBackspace: (ev: React.KeyboardEvent<HTMLElement>) => void;
|
37 | protected onCopy: (ev: React.ClipboardEvent<HTMLElement>) => void;
|
38 | protected onPaste: (ev: React.ClipboardEvent<HTMLInputElement | Autofill>) => void;
|
39 | protected _onSuggestionSelected: (item: T) => void;
|
40 | protected _onSelectedItemsChanged: () => void;
|
41 | /**
|
42 | * The floating picker is the source of truth for if the menu has been opened or not.
|
43 | *
|
44 | * Because this isn't tracked inside the state of this component, we need to
|
45 | * force an update here to keep the rendered output that depends on the picker being open
|
46 | * in sync with the state
|
47 | *
|
48 | * Called when the suggestions is shown or closed
|
49 | */
|
50 | private _onSuggestionsShownOrHidden;
|
51 | private _addProcessedItem;
|
52 | }
|