chore: update type input (#2720)

pull/2722/head
binhaoCen 2020-08-19 21:01:12 +08:00 committed by GitHub
parent 45562123d4
commit 6681b50892
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 99 additions and 79 deletions

View File

@ -5,17 +5,19 @@
import { AntdComponent } from '../component'; import { AntdComponent } from '../component';
export declare class InputGroup extends AntdComponent { export declare class InputGroup extends AntdComponent {
/** $props: {
* Whether use compact style /**
* @default false * Whether use compact style
* @type boolean * @default false
*/ * @type boolean
compact: boolean; */
compact?: boolean;
/** /**
* The size of Input.Group specifies the size of the included Input fields. Available: large default small * The size of Input.Group specifies the size of the included Input fields. Available: large default small
* @default 'default' * @default 'default'
* @type string * @type string
*/ */
size: 'small' | 'large' | 'default'; size?: 'small' | 'large' | 'default';
}
} }

View File

@ -3,12 +3,15 @@
// Definitions: https://github.com/vueComponent/ant-design-vue/types // Definitions: https://github.com/vueComponent/ant-design-vue/types
import { AntdComponent } from '../component'; import { AntdComponent } from '../component';
import { VNodeChild } from 'vue';
export declare class InputSearch extends AntdComponent { export declare class InputSearch extends AntdComponent {
/** $props: {
* to show an enter button after input /**
* @default false * to show an enter button after input
* @type any (boolean | slot) * @default false
*/ * @type any (boolean | slot)
enterButton: any; */
enterButton?: boolean | VNodeChild | JSX.Element;
}
} }

116
types/input/input.d.ts vendored
View File

@ -7,75 +7,79 @@ import { InputGroup } from './input-group';
import { InputSearch } from './input-search'; import { InputSearch } from './input-search';
import { TextArea } from './textarea'; import { TextArea } from './textarea';
import { Password } from './password'; import { Password } from './password';
import { VNodeChild } from 'vue';
export declare class Input extends AntdComponent { export declare class Input extends AntdComponent {
static Group: typeof InputGroup; static Group: typeof InputGroup;
static Search: typeof InputSearch; static Search: typeof InputSearch;
static TextArea: typeof TextArea; static TextArea: typeof TextArea;
static Password: typeof Password; static Password: typeof Password;
$props: {
/**
* The label text displayed after (on the right side of) the input field.
* @type any (string | slot)
*/
addonAfter?: VNodeChild | JSX.Element;
/** /**
* The label text displayed after (on the right side of) the input field. * The label text displayed before (on the left side of) the input field.
* @type any (string | slot) * @type any (string | slot)
*/ */
addonAfter: any; addonBefore?: VNodeChild | JSX.Element;
/** /**
* The label text displayed before (on the left side of) the input field. * The initial input content
* @type any (string | slot) * @type string | number
*/ */
addonBefore: any; defaultValue?: string | number;
/** /**
* The initial input content * Whether the input is disabled.
* @type string | number * @default false
*/ * @type boolean
defaultValue: string | number; */
disabled?: boolean;
/** /**
* Whether the input is disabled. * The ID for input
* @default false * @type string
* @type boolean */
*/ id?: string;
disabled: boolean;
/** /**
* The ID for input * The prefix icon for the Input.
* @type string * @type any (string | slot)
*/ */
id: string; prefix?: VNodeChild | JSX.Element;
/** /**
* The prefix icon for the Input. * The size of the input box. Note: in the context of a form, the large size is used. Available: large default small
* @type any (string | slot) * @default 'default'
*/ * @type string
prefix: any; */
size?: 'small' | 'large' | 'default';
/** /**
* The size of the input box. Note: in the context of a form, the large size is used. Available: large default small * The suffix icon for the Input.
* @default 'default' * @type any (string | slot)
* @type string */
*/ suffix?: VNodeChild | JSX.Element;
size: 'small' | 'large' | 'default';
/** /**
* The suffix icon for the Input. * The type of input, see: MDN (use Input.TextArea instead of type="textarea")
* @type any (string | slot) * @default 'text'
*/ * @type string
suffix: any; */
type?: string;
/** /**
* The type of input, see: MDN (use Input.TextArea instead of type="textarea") * The input content value
* @default 'text' * @type string | number
* @type string */
*/ value?: string | number;
type: string; /**
* allow to remove input content with clear icon
/** */
* The input content value allowClear?: boolean;
* @type string | number }
*/
value: string | number;
allowClear?: boolean;
} }

View File

@ -5,5 +5,12 @@
import { AntdComponent } from '../component'; import { AntdComponent } from '../component';
export declare class Password extends AntdComponent { export declare class Password extends AntdComponent {
visibilityToggle?: boolean; $props:{
/**
* Whether show toggle button
* @default true
*/
visibilityToggle?: boolean;
}
} }

View File

@ -10,18 +10,22 @@ export declare class TextArea extends AntdComponent {
* @default false * @default false
* @type boolean | object * @type boolean | object
*/ */
autosize: boolean | { minRows: number; maxRows: number }; autosize?: boolean | { minRows: number; maxRows: number };
autoSize: boolean | { minRows: number; maxRows: number };
/** /**
* The initial input content * The initial input content
* @type string | number * @type string | number
*/ */
defaultValue: string | number; defaultValue?: string | number;
/** /**
* The input content value * The input content value
* @type string | number * @type string | number
*/ */
value: string | number; value?: string | number;
/**
*allow to remove input content with clear icon (1.5.0)
* @type boolean
*/
allowClear?: boolean
} }