input.d.ts 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. import { ElementUIComponent, ElementUIComponentSize } from './component'
  2. /** The resizability of el-input component */
  3. export type Resizability = 'none' | 'both' | 'horizontal' | 'vertical'
  4. /** Controls how el-input component automatically sets size */
  5. export interface AutoSize {
  6. /** Minimum rows to show */
  7. minRows: number,
  8. /** Maximum rows to show */
  9. maxRows: number
  10. }
  11. export interface IconClickEventHandler {
  12. /** The handler function of on-icon-click property */
  13. (this: Window, ev: MouseEvent): any
  14. }
  15. /** Input Component */
  16. export declare class ElInput extends ElementUIComponent {
  17. /** Same as the type attribute of native input, except that it can be textarea */
  18. type: string
  19. /** Binding value */
  20. value: string | number
  21. /** Maximum Input text length */
  22. maxlength: number
  23. /** Minimum Input text length */
  24. minlength: number
  25. /** Placeholder of Input */
  26. placeholder: string
  27. /** Whether Input is disabled */
  28. disabled: boolean
  29. /** Size of Input, works when type is not 'textarea' */
  30. size: ElementUIComponentSize
  31. /** Icon name */
  32. icon: string
  33. /** Number of rows of textarea, only works when type is 'textarea' */
  34. rows: number
  35. /** Whether textarea has an adaptive height, only works when type is 'textarea' */
  36. autosize: boolean | AutoSize
  37. /** Same as auto-complete in native input */
  38. autoComplete: string
  39. /** Same as name in native input */
  40. name: string
  41. /** Same as readonly in native input */
  42. readonly: boolean
  43. /** Same as max in native input */
  44. max: any
  45. /** Same as min in native input */
  46. min: any
  47. /** Same as step in native input */
  48. step: any
  49. /** Control the resizability */
  50. resize: Resizability
  51. /** Same as autofocus in native input */
  52. autofocus: boolean
  53. /** Same as form in native input */
  54. form: string
  55. /** Hook function when clicking on the input icon */
  56. onIconClick: IconClickEventHandler
  57. }