input.d.ts 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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. export interface IconClickEventHandler {
  13. /** The handler function of on-icon-click property */
  14. (this: Window, ev: MouseEvent): any
  15. }
  16. /** Input Component */
  17. export declare class ElInput extends ElementUIComponent {
  18. /** Type of input */
  19. type: InputType
  20. /** Binding value */
  21. value: string | number
  22. /** Maximum Input text length */
  23. maxlength: number
  24. /** Minimum Input text length */
  25. minlength: number
  26. /** Placeholder of Input */
  27. placeholder: string
  28. /** Whether Input is disabled */
  29. disabled: boolean
  30. /** Size of Input, works when type is not 'textarea' */
  31. size: ElementUIComponentSize
  32. /** Prefix icon class */
  33. prefixIcon: string
  34. /** Suffix icon class */
  35. suffixIcon: string
  36. /** Number of rows of textarea, only works when type is 'textarea' */
  37. rows: number
  38. /** Whether textarea has an adaptive height, only works when type is 'textarea' */
  39. autosize: boolean | AutoSize
  40. /** Same as auto-complete in native input */
  41. autoComplete: string
  42. /** Same as name in native input */
  43. name: string
  44. /** Same as readonly in native input */
  45. readonly: boolean
  46. /** Same as max in native input */
  47. max: any
  48. /** Same as min in native input */
  49. min: any
  50. /** Same as step in native input */
  51. step: any
  52. /** Control the resizability */
  53. resize: Resizability
  54. /** Same as autofocus in native input */
  55. autofocus: boolean
  56. /** Same as form in native input */
  57. form: string
  58. /** Hook function when clicking on the input icon */
  59. onIconClick: IconClickEventHandler
  60. }