autocomplete.d.ts 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. import { ElementUIComponent } from './component'
  2. export type SuggestionPlacement = 'top' | 'top-start' | 'top-end' | 'bottom' | 'bottom-start' | 'bottom-end'
  3. export interface FetchSuggestionsCallback {
  4. /**
  5. * Callback function used in fetch-suggestions function
  6. *
  7. * @param data Suggestions to use
  8. */
  9. (data: any[]): void
  10. }
  11. export interface FetchSuggestions {
  12. /**
  13. * The function passed into the fetch-suggestions property
  14. *
  15. * @param queryString Current value of the text input
  16. * @param callback Callback function used to indicate that suggestions have completely fetched
  17. */
  18. (queryString: string, callback: FetchSuggestionsCallback): void
  19. }
  20. /** Autocomplete Component */
  21. export declare class ElAutocomplete extends ElementUIComponent {
  22. /** The placeholder of Autocomplete */
  23. placeholder: string
  24. /** Whether Autocomplete is disabled */
  25. disabled: boolean
  26. /** Binding value */
  27. value: string
  28. /** Debounce delay when typing */
  29. debounce: number
  30. /** Placement of the popup menu */
  31. placement: SuggestionPlacement
  32. /** Name for the inner native input */
  33. name: string
  34. /** Key name of the input suggestion object for display */
  35. valueKey: string
  36. /** Whether to emit select event on enter when there is no autocomplete match */
  37. selectWhenUnmatched: boolean
  38. /** A method to fetch input suggestions. When suggestions are ready, invoke callback(data:[]) to return them to Autocomplete */
  39. fetchSuggestions: FetchSuggestions
  40. /** Custom class name for autocomplete's dropdown */
  41. popperClass: string
  42. /** Whether show suggestions when input focus */
  43. triggerOnFocus: boolean
  44. /** Prefix icon class */
  45. prefixIcon: string
  46. /** Suffix icon class */
  47. suffixIcon: string
  48. /** Whether to hide the loading icon in remote search */
  49. hideLoading: boolean
  50. /** Whether to append the dropdown to body */
  51. popperAppendToBody: boolean
  52. /**
  53. * Focus the Input component
  54. */
  55. focus (): void
  56. }