415dd7797c2cd185f8a4efcaa409ef7491eb11216039a96821f45ca29f0989857f699f0bf68c1de74e07eac8ddda98953dcc9bb30acbc75bc4bcada8279683 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. import { CircleClose } from '@element-plus/icons-vue';
  2. import { useSizeProp } from '../../../hooks/use-size/index.mjs';
  3. import { iconPropType } from '../../../utils/vue/icon.mjs';
  4. import { mutable } from '../../../utils/typescript.mjs';
  5. import { useAriaProps } from '../../../hooks/use-aria/index.mjs';
  6. import { UPDATE_MODEL_EVENT } from '../../../constants/event.mjs';
  7. import { buildProps, definePropType } from '../../../utils/vue/props/runtime.mjs';
  8. import { isString } from '@vue/shared';
  9. const inputProps = buildProps({
  10. id: {
  11. type: String,
  12. default: void 0
  13. },
  14. size: useSizeProp,
  15. disabled: Boolean,
  16. modelValue: {
  17. type: definePropType([
  18. String,
  19. Number,
  20. Object
  21. ]),
  22. default: ""
  23. },
  24. maxlength: {
  25. type: [String, Number]
  26. },
  27. minlength: {
  28. type: [String, Number]
  29. },
  30. type: {
  31. type: String,
  32. default: "text"
  33. },
  34. resize: {
  35. type: String,
  36. values: ["none", "both", "horizontal", "vertical"]
  37. },
  38. autosize: {
  39. type: definePropType([Boolean, Object]),
  40. default: false
  41. },
  42. autocomplete: {
  43. type: definePropType(String),
  44. default: "off"
  45. },
  46. formatter: {
  47. type: Function
  48. },
  49. parser: {
  50. type: Function
  51. },
  52. placeholder: {
  53. type: String
  54. },
  55. form: {
  56. type: String
  57. },
  58. readonly: Boolean,
  59. clearable: Boolean,
  60. clearIcon: {
  61. type: iconPropType,
  62. default: CircleClose
  63. },
  64. showPassword: Boolean,
  65. showWordLimit: Boolean,
  66. suffixIcon: {
  67. type: iconPropType
  68. },
  69. prefixIcon: {
  70. type: iconPropType
  71. },
  72. containerRole: {
  73. type: String,
  74. default: void 0
  75. },
  76. tabindex: {
  77. type: [String, Number],
  78. default: 0
  79. },
  80. validateEvent: {
  81. type: Boolean,
  82. default: true
  83. },
  84. inputStyle: {
  85. type: definePropType([Object, Array, String]),
  86. default: () => mutable({})
  87. },
  88. autofocus: Boolean,
  89. rows: {
  90. type: Number,
  91. default: 2
  92. },
  93. ...useAriaProps(["ariaLabel"]),
  94. inputmode: {
  95. type: definePropType(String),
  96. default: void 0
  97. },
  98. name: String
  99. });
  100. const inputEmits = {
  101. [UPDATE_MODEL_EVENT]: (value) => isString(value),
  102. input: (value) => isString(value),
  103. change: (value) => isString(value),
  104. focus: (evt) => evt instanceof FocusEvent,
  105. blur: (evt) => evt instanceof FocusEvent,
  106. clear: () => true,
  107. mouseleave: (evt) => evt instanceof MouseEvent,
  108. mouseenter: (evt) => evt instanceof MouseEvent,
  109. keydown: (evt) => evt instanceof Event,
  110. compositionstart: (evt) => evt instanceof CompositionEvent,
  111. compositionupdate: (evt) => evt instanceof CompositionEvent,
  112. compositionend: (evt) => evt instanceof CompositionEvent
  113. };
  114. export { inputEmits, inputProps };
  115. //# sourceMappingURL=input.mjs.map