input.d.ts 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  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. /** Whether to trigger form validatio */
  57. validateEvent: boolean
  58. /** Whether the input is clearable */
  59. clearable: boolean
  60. /** Whether to show password */
  61. showPassword: boolean
  62. /** Whether to show wordCount when setting maxLength */
  63. showWordLimit: boolean
  64. /**
  65. * Focus the Input component
  66. */
  67. focus (): void
  68. /**
  69. * Blur the Input component
  70. */
  71. blur (): void
  72. /**
  73. * Select the text in input element
  74. */
  75. select (): void
  76. }