@@ -4,15 +4,16 @@ import PropTypes from '../_util/vue-types';
4
4
import { cloneElement } from '../_util/vnode' ;
5
5
import type { CSSProperties , PropType , VNode } from 'vue' ;
6
6
import { defineComponent } from 'vue' ;
7
- import { tuple } from '../_util/type' ;
7
+ import type { VueNode } from '../_util/type' ;
8
+ import { anyType , tuple } from '../_util/type' ;
8
9
import type { Direction , SizeType } from '../config-provider' ;
9
10
import type { MouseEventHandler } from '../_util/EventInterface' ;
10
11
import { hasAddon } from './util' ;
11
12
import { FormItemInputContext } from '../form/FormItemContext' ;
12
13
import type { InputStatus } from '../_util/statusUtils' ;
13
14
import { getMergedStatus , getStatusClassNames } from '../_util/statusUtils' ;
14
15
15
- const ClearableInputType = [ 'text' , 'input' ] ;
16
+ const ClearableInputType = [ 'text' , 'input' ] as const ;
16
17
17
18
export default defineComponent ( {
18
19
compatConfig : { MODE : 3 } ,
@@ -21,18 +22,18 @@ export default defineComponent({
21
22
props : {
22
23
prefixCls : String ,
23
24
inputType : PropTypes . oneOf ( tuple ( 'text' , 'input' ) ) ,
24
- value : PropTypes . any ,
25
- defaultValue : PropTypes . any ,
25
+ value : anyType < VueNode > ( ) ,
26
+ defaultValue : anyType < VueNode > ( ) ,
26
27
allowClear : { type : Boolean , default : undefined } ,
27
- element : PropTypes . any ,
28
+ element : anyType < VueNode > ( ) ,
28
29
handleReset : Function as PropType < MouseEventHandler > ,
29
30
disabled : { type : Boolean , default : undefined } ,
30
31
direction : { type : String as PropType < Direction > } ,
31
32
size : { type : String as PropType < SizeType > } ,
32
- suffix : PropTypes . any ,
33
- prefix : PropTypes . any ,
34
- addonBefore : PropTypes . any ,
35
- addonAfter : PropTypes . any ,
33
+ suffix : anyType < VueNode > ( ) ,
34
+ prefix : anyType < VueNode > ( ) ,
35
+ addonBefore : anyType < VueNode > ( ) ,
36
+ addonAfter : anyType < VueNode > ( ) ,
36
37
readonly : { type : Boolean , default : undefined } ,
37
38
focused : { type : Boolean , default : undefined } ,
38
39
bordered : { type : Boolean , default : true } ,
@@ -114,7 +115,7 @@ export default defineComponent({
114
115
return ( ) => {
115
116
const { prefixCls, inputType, element = slots . element ?.( ) } = props ;
116
117
if ( inputType === ClearableInputType [ 0 ] ) {
117
- return renderTextAreaWithClearIcon ( prefixCls , element ) ;
118
+ return renderTextAreaWithClearIcon ( prefixCls , element as VNode ) ;
118
119
}
119
120
return null ;
120
121
} ;
0 commit comments