Skip to content

Commit 6681b50

Browse files
author
binhaoCen
authored
chore: update type input (#2720)
1 parent 4556212 commit 6681b50

File tree

5 files changed

+99
-79
lines changed

5 files changed

+99
-79
lines changed

types/input/input-group.d.ts

+14-12
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,19 @@
55
import { AntdComponent } from '../component';
66

77
export declare class InputGroup extends AntdComponent {
8-
/**
9-
* Whether use compact style
10-
* @default false
11-
* @type boolean
12-
*/
13-
compact: boolean;
8+
$props: {
9+
/**
10+
* Whether use compact style
11+
* @default false
12+
* @type boolean
13+
*/
14+
compact?: boolean;
1415

15-
/**
16-
* The size of Input.Group specifies the size of the included Input fields. Available: large default small
17-
* @default 'default'
18-
* @type string
19-
*/
20-
size: 'small' | 'large' | 'default';
16+
/**
17+
* The size of Input.Group specifies the size of the included Input fields. Available: large default small
18+
* @default 'default'
19+
* @type string
20+
*/
21+
size?: 'small' | 'large' | 'default';
22+
}
2123
}

types/input/input-search.d.ts

+9-6
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,15 @@
33
// Definitions: https://github.com/vueComponent/ant-design-vue/types
44

55
import { AntdComponent } from '../component';
6+
import { VNodeChild } from 'vue';
67

78
export declare class InputSearch extends AntdComponent {
8-
/**
9-
* to show an enter button after input
10-
* @default false
11-
* @type any (boolean | slot)
12-
*/
13-
enterButton: any;
9+
$props: {
10+
/**
11+
* to show an enter button after input
12+
* @default false
13+
* @type any (boolean | slot)
14+
*/
15+
enterButton?: boolean | VNodeChild | JSX.Element;
16+
}
1417
}

types/input/input.d.ts

+60-56
Original file line numberDiff line numberDiff line change
@@ -7,75 +7,79 @@ import { InputGroup } from './input-group';
77
import { InputSearch } from './input-search';
88
import { TextArea } from './textarea';
99
import { Password } from './password';
10+
import { VNodeChild } from 'vue';
1011

1112
export declare class Input extends AntdComponent {
1213
static Group: typeof InputGroup;
1314
static Search: typeof InputSearch;
1415
static TextArea: typeof TextArea;
1516
static Password: typeof Password;
17+
$props: {
18+
/**
19+
* The label text displayed after (on the right side of) the input field.
20+
* @type any (string | slot)
21+
*/
22+
addonAfter?: VNodeChild | JSX.Element;
1623

17-
/**
18-
* The label text displayed after (on the right side of) the input field.
19-
* @type any (string | slot)
20-
*/
21-
addonAfter: any;
24+
/**
25+
* The label text displayed before (on the left side of) the input field.
26+
* @type any (string | slot)
27+
*/
28+
addonBefore?: VNodeChild | JSX.Element;
2229

23-
/**
24-
* The label text displayed before (on the left side of) the input field.
25-
* @type any (string | slot)
26-
*/
27-
addonBefore: any;
30+
/**
31+
* The initial input content
32+
* @type string | number
33+
*/
34+
defaultValue?: string | number;
2835

29-
/**
30-
* The initial input content
31-
* @type string | number
32-
*/
33-
defaultValue: string | number;
36+
/**
37+
* Whether the input is disabled.
38+
* @default false
39+
* @type boolean
40+
*/
41+
disabled?: boolean;
3442

35-
/**
36-
* Whether the input is disabled.
37-
* @default false
38-
* @type boolean
39-
*/
40-
disabled: boolean;
43+
/**
44+
* The ID for input
45+
* @type string
46+
*/
47+
id?: string;
4148

42-
/**
43-
* The ID for input
44-
* @type string
45-
*/
46-
id: string;
49+
/**
50+
* The prefix icon for the Input.
51+
* @type any (string | slot)
52+
*/
53+
prefix?: VNodeChild | JSX.Element;
4754

48-
/**
49-
* The prefix icon for the Input.
50-
* @type any (string | slot)
51-
*/
52-
prefix: any;
55+
/**
56+
* The size of the input box. Note: in the context of a form, the large size is used. Available: large default small
57+
* @default 'default'
58+
* @type string
59+
*/
60+
size?: 'small' | 'large' | 'default';
5361

54-
/**
55-
* The size of the input box. Note: in the context of a form, the large size is used. Available: large default small
56-
* @default 'default'
57-
* @type string
58-
*/
59-
size: 'small' | 'large' | 'default';
62+
/**
63+
* The suffix icon for the Input.
64+
* @type any (string | slot)
65+
*/
66+
suffix?: VNodeChild | JSX.Element;
6067

61-
/**
62-
* The suffix icon for the Input.
63-
* @type any (string | slot)
64-
*/
65-
suffix: any;
68+
/**
69+
* The type of input, see: MDN (use Input.TextArea instead of type="textarea")
70+
* @default 'text'
71+
* @type string
72+
*/
73+
type?: string;
6674

67-
/**
68-
* The type of input, see: MDN (use Input.TextArea instead of type="textarea")
69-
* @default 'text'
70-
* @type string
71-
*/
72-
type: string;
73-
74-
/**
75-
* The input content value
76-
* @type string | number
77-
*/
78-
value: string | number;
79-
80-
allowClear?: boolean;
75+
/**
76+
* The input content value
77+
* @type string | number
78+
*/
79+
value?: string | number;
80+
/**
81+
* allow to remove input content with clear icon
82+
*/
83+
allowClear?: boolean;
84+
}
8185
}

types/input/password.d.ts

+8-1
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,12 @@
55
import { AntdComponent } from '../component';
66

77
export declare class Password extends AntdComponent {
8-
visibilityToggle?: boolean;
8+
$props:{
9+
/**
10+
* Whether show toggle button
11+
* @default true
12+
*/
13+
visibilityToggle?: boolean;
14+
}
15+
916
}

types/input/textarea.d.ts

+8-4
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,22 @@ export declare class TextArea extends AntdComponent {
1010
* @default false
1111
* @type boolean | object
1212
*/
13-
autosize: boolean | { minRows: number; maxRows: number };
14-
autoSize: boolean | { minRows: number; maxRows: number };
13+
autosize?: boolean | { minRows: number; maxRows: number };
1514

1615
/**
1716
* The initial input content
1817
* @type string | number
1918
*/
20-
defaultValue: string | number;
19+
defaultValue?: string | number;
2120

2221
/**
2322
* The input content value
2423
* @type string | number
2524
*/
26-
value: string | number;
25+
value?: string | number;
26+
/**
27+
*allow to remove input content with clear icon (1.5.0)
28+
* @type boolean
29+
*/
30+
allowClear?: boolean
2731
}

0 commit comments

Comments
 (0)