inputProps.js 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. import _extends from "@babel/runtime/helpers/esm/extends";
  2. import PropTypes from '../_util/vue-types';
  3. import { stringType } from '../_util/type';
  4. export const inputDefaultValue = Symbol();
  5. export const commonInputProps = () => {
  6. return {
  7. addonBefore: PropTypes.any,
  8. addonAfter: PropTypes.any,
  9. prefix: PropTypes.any,
  10. suffix: PropTypes.any,
  11. clearIcon: PropTypes.any,
  12. affixWrapperClassName: String,
  13. groupClassName: String,
  14. wrapperClassName: String,
  15. inputClassName: String,
  16. allowClear: {
  17. type: Boolean,
  18. default: undefined
  19. }
  20. };
  21. };
  22. export const baseInputProps = () => {
  23. return _extends(_extends({}, commonInputProps()), {
  24. value: {
  25. type: [String, Number, Symbol],
  26. default: undefined
  27. },
  28. defaultValue: {
  29. type: [String, Number, Symbol],
  30. default: undefined
  31. },
  32. inputElement: PropTypes.any,
  33. prefixCls: String,
  34. disabled: {
  35. type: Boolean,
  36. default: undefined
  37. },
  38. focused: {
  39. type: Boolean,
  40. default: undefined
  41. },
  42. triggerFocus: Function,
  43. readonly: {
  44. type: Boolean,
  45. default: undefined
  46. },
  47. handleReset: Function,
  48. hidden: {
  49. type: Boolean,
  50. default: undefined
  51. }
  52. });
  53. };
  54. export const inputProps = () => _extends(_extends({}, baseInputProps()), {
  55. id: String,
  56. placeholder: {
  57. type: [String, Number]
  58. },
  59. autocomplete: String,
  60. type: stringType('text'),
  61. name: String,
  62. size: {
  63. type: String
  64. },
  65. autofocus: {
  66. type: Boolean,
  67. default: undefined
  68. },
  69. lazy: {
  70. type: Boolean,
  71. default: true
  72. },
  73. maxlength: Number,
  74. loading: {
  75. type: Boolean,
  76. default: undefined
  77. },
  78. bordered: {
  79. type: Boolean,
  80. default: undefined
  81. },
  82. showCount: {
  83. type: [Boolean, Object]
  84. },
  85. htmlSize: Number,
  86. onPressEnter: Function,
  87. onKeydown: Function,
  88. onKeyup: Function,
  89. onFocus: Function,
  90. onBlur: Function,
  91. onChange: Function,
  92. onInput: Function,
  93. 'onUpdate:value': Function,
  94. onCompositionstart: Function,
  95. onCompositionend: Function,
  96. valueModifiers: Object,
  97. hidden: {
  98. type: Boolean,
  99. default: undefined
  100. },
  101. status: String
  102. });