input.d.ts 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. import { ElementUIComponent, ElementUIComponentSize } from './component'
  2. /** The resizability of el-input component */
  3. export type Resizability = 'none' | 'both' | 'horizontal' | 'vertical'
  4. export type InputType = 'text' | 'textarea'
  5. /** Controls how el-input component automatically sets size */
  6. export interface AutoSize {
  7. /** Minimum rows to show */
  8. minRows: number,
  9. /** Maximum rows to show */
  10. maxRows: number
  11. }
  12. /** Input Component */
  13. export declare class ElInput extends ElementUIComponent {
  14. /** Type of input */
  15. type: InputType
  16. /** Binding value */
  17. value: string | number
  18. /** Maximum Input text length */
  19. maxlength: number
  20. /** Minimum Input text length */
  21. minlength: number
  22. /** Placeholder of Input */
  23. placeholder: string
  24. /** Whether Input is disabled */
  25. disabled: boolean
  26. /** Size of Input, works when type is not 'textarea' */
  27. size: ElementUIComponentSize
  28. /** Prefix icon class */
  29. prefixIcon: string
  30. /** Suffix icon class */
  31. suffixIcon: string
  32. /** Number of rows of textarea, only works when type is 'textarea' */
  33. rows: number
  34. /** Whether textarea has an adaptive height, only works when type is 'textarea' */
  35. autosize: boolean | AutoSize
  36. /** @Deprecated in next major version */
  37. autoComplete: string
  38. /** Same as autocomplete in native input */
  39. autocomplete: string
  40. /** Same as name in native input */
  41. name: string
  42. /** Same as readonly in native input */
  43. readonly: boolean
  44. /** Same as max in native input */
  45. max: any
  46. /** Same as min in native input */
  47. min: any
  48. /** Same as step in native input */
  49. step: any
  50. /** Control the resizability */
  51. resize: Resizability
  52. /** Same as autofocus in native input */
  53. autofocus: boolean
  54. /** Same as form in native input */
  55. form: string
  56. /**
  57. * Focus the Input component
  58. */
  59. focus (): void
  60. /**
  61. * Blur the Input component
  62. */
  63. blur (): void
  64. /**
  65. * Select the text in input element
  66. */
  67. select (): void
  68. }