input.d.ts 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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. /** Same as auto-complete in native input */
  37. autoComplete: string
  38. /** Same as name in native input */
  39. name: string
  40. /** Same as readonly in native input */
  41. readonly: boolean
  42. /** Same as max in native input */
  43. max: any
  44. /** Same as min in native input */
  45. min: any
  46. /** Same as step in native input */
  47. step: any
  48. /** Control the resizability */
  49. resize: Resizability
  50. /** Same as autofocus in native input */
  51. autofocus: boolean
  52. /** Same as form in native input */
  53. form: string
  54. /**
  55. * Focus the Input component
  56. */
  57. focus (): void
  58. /**
  59. * Select the text in input element
  60. */
  61. select (): void
  62. }