@@ -5,6 +5,7 @@ import PropTypes from '../../_util/vue-types';
5
5
import type { RefObject } from '../../_util/createRef' ;
6
6
import antInput from '../../_util/antInputDirective' ;
7
7
import classNames from '../../_util/classNames' ;
8
+ import type { EventHandler } from '../../_util/EventInterface' ;
8
9
9
10
interface InputProps {
10
11
prefixCls : string ;
@@ -21,19 +22,43 @@ interface InputProps {
21
22
/** Pass accessibility props to input */
22
23
attrs : object ;
23
24
inputRef : RefObject ;
24
- onKeydown : EventHandlerNonNull ;
25
- onMousedown : EventHandlerNonNull ;
26
- onChange : EventHandlerNonNull ;
27
- onPaste : EventHandlerNonNull ;
28
- onCompositionstart : EventHandlerNonNull ;
29
- onCompositionend : EventHandlerNonNull ;
30
- onFocus : EventHandlerNonNull ;
31
- onBlur : EventHandlerNonNull ;
25
+ onKeydown : EventHandler ;
26
+ onMousedown : EventHandler ;
27
+ onChange : EventHandler ;
28
+ onPaste : EventHandler ;
29
+ onCompositionstart : EventHandler ;
30
+ onCompositionend : EventHandler ;
31
+ onFocus : EventHandler ;
32
+ onBlur : EventHandler ;
32
33
}
33
34
34
- const Input = defineComponent < InputProps , { VCSelectContainerEvent : any ; blurTimeout : any } > ( {
35
+ const Input = defineComponent ( {
35
36
name : 'Input' ,
36
37
inheritAttrs : false ,
38
+ props : {
39
+ inputRef : PropTypes . any ,
40
+ prefixCls : PropTypes . string ,
41
+ id : PropTypes . string ,
42
+ inputElement : PropTypes . any ,
43
+ disabled : PropTypes . looseBool ,
44
+ autofocus : PropTypes . looseBool ,
45
+ autocomplete : PropTypes . string ,
46
+ editable : PropTypes . looseBool ,
47
+ accessibilityIndex : PropTypes . number ,
48
+ value : PropTypes . string ,
49
+ open : PropTypes . looseBool ,
50
+ tabindex : PropTypes . oneOfType ( [ PropTypes . number , PropTypes . string ] ) ,
51
+ /** Pass accessibility props to input */
52
+ attrs : PropTypes . object ,
53
+ onKeydown : PropTypes . func ,
54
+ onMousedown : PropTypes . func ,
55
+ onChange : PropTypes . func ,
56
+ onPaste : PropTypes . func ,
57
+ onCompositionstart : PropTypes . func ,
58
+ onCompositionend : PropTypes . func ,
59
+ onFocus : PropTypes . func ,
60
+ onBlur : PropTypes . func ,
61
+ } ,
37
62
setup ( props ) {
38
63
if ( process . env . NODE_ENV === 'test' ) {
39
64
onMounted ( ( ) => {
@@ -47,7 +72,7 @@ const Input = defineComponent<InputProps, { VCSelectContainerEvent: any; blurTim
47
72
}
48
73
return {
49
74
blurTimeout : null ,
50
- VCSelectContainerEvent : inject ( 'VCSelectContainerEvent' ) ,
75
+ VCSelectContainerEvent : inject ( 'VCSelectContainerEvent' ) as any ,
51
76
} ;
52
77
} ,
53
78
render ( ) {
@@ -164,29 +189,29 @@ const Input = defineComponent<InputProps, { VCSelectContainerEvent: any; blurTim
164
189
} ,
165
190
} ) ;
166
191
167
- Input . props = {
168
- inputRef : PropTypes . any ,
169
- prefixCls : PropTypes . string ,
170
- id : PropTypes . string ,
171
- inputElement : PropTypes . any ,
172
- disabled : PropTypes . looseBool ,
173
- autofocus : PropTypes . looseBool ,
174
- autocomplete : PropTypes . string ,
175
- editable : PropTypes . looseBool ,
176
- accessibilityIndex : PropTypes . number ,
177
- value : PropTypes . string ,
178
- open : PropTypes . looseBool ,
179
- tabindex : PropTypes . oneOfType ( [ PropTypes . number , PropTypes . string ] ) ,
180
- /** Pass accessibility props to input */
181
- attrs : PropTypes . object ,
182
- onKeydown : PropTypes . func ,
183
- onMousedown : PropTypes . func ,
184
- onChange : PropTypes . func ,
185
- onPaste : PropTypes . func ,
186
- onCompositionstart : PropTypes . func ,
187
- onCompositionend : PropTypes . func ,
188
- onFocus : PropTypes . func ,
189
- onBlur : PropTypes . func ,
190
- } ;
192
+ // Input.props = {
193
+ // inputRef: PropTypes.any,
194
+ // prefixCls: PropTypes.string,
195
+ // id: PropTypes.string,
196
+ // inputElement: PropTypes.any,
197
+ // disabled: PropTypes.looseBool,
198
+ // autofocus: PropTypes.looseBool,
199
+ // autocomplete: PropTypes.string,
200
+ // editable: PropTypes.looseBool,
201
+ // accessibilityIndex: PropTypes.number,
202
+ // value: PropTypes.string,
203
+ // open: PropTypes.looseBool,
204
+ // tabindex: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
205
+ // /** Pass accessibility props to input */
206
+ // attrs: PropTypes.object,
207
+ // onKeydown: PropTypes.func,
208
+ // onMousedown: PropTypes.func,
209
+ // onChange: PropTypes.func,
210
+ // onPaste: PropTypes.func,
211
+ // onCompositionstart: PropTypes.func,
212
+ // onCompositionend: PropTypes.func,
213
+ // onFocus: PropTypes.func,
214
+ // onBlur: PropTypes.func,
215
+ // };
191
216
192
217
export default Input ;
0 commit comments