2017-10-17 16:36:12 +08:00
|
|
|
import { ElementUIComponent } from './component'
|
|
|
|
|
2018-03-30 14:42:23 +08:00
|
|
|
export type SuggestionPlacement = 'top' | 'top-start' | 'top-end' | 'bottom' | 'bottom-start' | 'bottom-end'
|
|
|
|
|
2017-10-17 16:36:12 +08:00
|
|
|
export interface FetchSuggestionsCallback {
|
|
|
|
/**
|
|
|
|
* Callback function used in fetch-suggestions function
|
|
|
|
*
|
|
|
|
* @param data Suggestions to use
|
|
|
|
*/
|
|
|
|
(data: any[]): void
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface FetchSuggestions {
|
|
|
|
/**
|
|
|
|
* The function passed into the fetch-suggestions property
|
|
|
|
*
|
|
|
|
* @param queryString Current value of the text input
|
|
|
|
* @param callback Callback function used to indicate that suggestions have completely fetched
|
|
|
|
*/
|
|
|
|
(queryString: string, callback: FetchSuggestionsCallback): void
|
|
|
|
}
|
|
|
|
|
|
|
|
/** Autocomplete Component */
|
|
|
|
export declare class ElAutocomplete extends ElementUIComponent {
|
|
|
|
/** The placeholder of Autocomplete */
|
|
|
|
placeholder: string
|
|
|
|
|
2018-11-13 18:33:33 +08:00
|
|
|
/** Whether to show clear button */
|
|
|
|
clearable: boolean
|
|
|
|
|
2017-10-17 16:36:12 +08:00
|
|
|
/** Whether Autocomplete is disabled */
|
|
|
|
disabled: boolean
|
|
|
|
|
|
|
|
/** Binding value */
|
|
|
|
value: string
|
|
|
|
|
2017-10-18 18:31:03 +08:00
|
|
|
/** Debounce delay when typing */
|
|
|
|
debounce: number
|
|
|
|
|
2018-03-30 14:42:23 +08:00
|
|
|
/** Placement of the popup menu */
|
|
|
|
placement: SuggestionPlacement
|
|
|
|
|
2017-10-24 15:24:35 +08:00
|
|
|
/** Name for the inner native input */
|
2017-10-18 18:31:03 +08:00
|
|
|
name: string
|
|
|
|
|
2017-10-24 15:24:35 +08:00
|
|
|
/** Key name of the input suggestion object for display */
|
|
|
|
valueKey: string
|
2017-10-18 18:31:03 +08:00
|
|
|
|
2017-10-24 15:24:35 +08:00
|
|
|
/** Whether to emit select event on enter when there is no autocomplete match */
|
|
|
|
selectWhenUnmatched: boolean
|
2017-10-17 16:36:12 +08:00
|
|
|
|
|
|
|
/** A method to fetch input suggestions. When suggestions are ready, invoke callback(data:[]) to return them to Autocomplete */
|
|
|
|
fetchSuggestions: FetchSuggestions
|
|
|
|
|
|
|
|
/** Custom class name for autocomplete's dropdown */
|
|
|
|
popperClass: string
|
|
|
|
|
|
|
|
/** Whether show suggestions when input focus */
|
|
|
|
triggerOnFocus: boolean
|
2018-03-18 11:59:02 +08:00
|
|
|
|
2018-05-21 17:27:42 +08:00
|
|
|
/** Prefix icon class */
|
|
|
|
prefixIcon: string
|
|
|
|
|
|
|
|
/** Suffix icon class */
|
|
|
|
suffixIcon: string
|
|
|
|
|
|
|
|
/** Whether to hide the loading icon in remote search */
|
|
|
|
hideLoading: boolean
|
|
|
|
|
2018-08-06 19:14:16 +08:00
|
|
|
/** Whether to append the dropdown to body */
|
|
|
|
popperAppendToBody: boolean
|
|
|
|
|
2018-03-18 11:59:02 +08:00
|
|
|
/**
|
|
|
|
* Focus the Input component
|
|
|
|
*/
|
|
|
|
focus (): void
|
2017-10-17 16:36:12 +08:00
|
|
|
}
|