From 6681b508922060fb2b56b3899bd4b0d3ec72aa3c Mon Sep 17 00:00:00 2001 From: binhaoCen Date: Wed, 19 Aug 2020 21:01:12 +0800 Subject: [PATCH] chore: update type input (#2720) --- types/input/input-group.d.ts | 26 ++++---- types/input/input-search.d.ts | 15 +++-- types/input/input.d.ts | 116 ++++++++++++++++++---------------- types/input/password.d.ts | 9 ++- types/input/textarea.d.ts | 12 ++-- 5 files changed, 99 insertions(+), 79 deletions(-) diff --git a/types/input/input-group.d.ts b/types/input/input-group.d.ts index c50424418..2c6197a13 100644 --- a/types/input/input-group.d.ts +++ b/types/input/input-group.d.ts @@ -5,17 +5,19 @@ import { AntdComponent } from '../component'; export declare class InputGroup extends AntdComponent { - /** - * Whether use compact style - * @default false - * @type boolean - */ - compact: boolean; + $props: { + /** + * Whether use compact style + * @default false + * @type boolean + */ + compact?: boolean; - /** - * The size of Input.Group specifies the size of the included Input fields. Available: large default small - * @default 'default' - * @type string - */ - size: 'small' | 'large' | 'default'; + /** + * The size of Input.Group specifies the size of the included Input fields. Available: large default small + * @default 'default' + * @type string + */ + size?: 'small' | 'large' | 'default'; + } } diff --git a/types/input/input-search.d.ts b/types/input/input-search.d.ts index a8546e01e..f83d7a1d3 100644 --- a/types/input/input-search.d.ts +++ b/types/input/input-search.d.ts @@ -3,12 +3,15 @@ // Definitions: https://github.com/vueComponent/ant-design-vue/types import { AntdComponent } from '../component'; +import { VNodeChild } from 'vue'; export declare class InputSearch extends AntdComponent { - /** - * to show an enter button after input - * @default false - * @type any (boolean | slot) - */ - enterButton: any; + $props: { + /** + * to show an enter button after input + * @default false + * @type any (boolean | slot) + */ + enterButton?: boolean | VNodeChild | JSX.Element; + } } diff --git a/types/input/input.d.ts b/types/input/input.d.ts index a8d4e7de9..63b15ccaf 100644 --- a/types/input/input.d.ts +++ b/types/input/input.d.ts @@ -7,75 +7,79 @@ import { InputGroup } from './input-group'; import { InputSearch } from './input-search'; import { TextArea } from './textarea'; import { Password } from './password'; +import { VNodeChild } from 'vue'; export declare class Input extends AntdComponent { static Group: typeof InputGroup; static Search: typeof InputSearch; static TextArea: typeof TextArea; 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. - * @type any (string | slot) - */ - addonAfter: any; + /** + * The label text displayed before (on the left side of) the input field. + * @type any (string | slot) + */ + addonBefore?: VNodeChild | JSX.Element; - /** - * The label text displayed before (on the left side of) the input field. - * @type any (string | slot) - */ - addonBefore: any; + /** + * The initial input content + * @type string | number + */ + defaultValue?: string | number; - /** - * The initial input content - * @type string | number - */ - defaultValue: string | number; + /** + * Whether the input is disabled. + * @default false + * @type boolean + */ + disabled?: boolean; - /** - * Whether the input is disabled. - * @default false - * @type boolean - */ - disabled: boolean; + /** + * The ID for input + * @type string + */ + id?: string; - /** - * The ID for input - * @type string - */ - id: string; + /** + * The prefix icon for the Input. + * @type any (string | slot) + */ + prefix?: VNodeChild | JSX.Element; - /** - * The prefix icon for the Input. - * @type any (string | slot) - */ - prefix: any; + /** + * The size of the input box. Note: in the context of a form, the large size is used. Available: large default small + * @default 'default' + * @type string + */ + 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 - * @default 'default' - * @type string - */ - size: 'small' | 'large' | 'default'; + /** + * The suffix icon for the Input. + * @type any (string | slot) + */ + suffix?: VNodeChild | JSX.Element; - /** - * The suffix icon for the Input. - * @type any (string | slot) - */ - suffix: any; + /** + * The type of input, see: MDN (use Input.TextArea instead of type="textarea") + * @default 'text' + * @type string + */ + type?: string; - /** - * The type of input, see: MDN (use Input.TextArea instead of type="textarea") - * @default 'text' - * @type string - */ - type: string; - - /** - * The input content value - * @type string | number - */ - value: string | number; - - allowClear?: boolean; + /** + * The input content value + * @type string | number + */ + value?: string | number; + /** + * allow to remove input content with clear icon + */ + allowClear?: boolean; + } } diff --git a/types/input/password.d.ts b/types/input/password.d.ts index e6d6138f4..a7e01c849 100644 --- a/types/input/password.d.ts +++ b/types/input/password.d.ts @@ -5,5 +5,12 @@ import { AntdComponent } from '../component'; export declare class Password extends AntdComponent { - visibilityToggle?: boolean; + $props:{ + /** + * Whether show toggle button + * @default true + */ + visibilityToggle?: boolean; + } + } diff --git a/types/input/textarea.d.ts b/types/input/textarea.d.ts index 89ae748b5..6a504cb45 100644 --- a/types/input/textarea.d.ts +++ b/types/input/textarea.d.ts @@ -10,18 +10,22 @@ export declare class TextArea extends AntdComponent { * @default false * @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 * @type string | number */ - defaultValue: string | number; + defaultValue?: string | number; /** * The input content value * @type string | number */ - value: string | number; + value?: string | number; + /** + *allow to remove input content with clear icon (1.5.0) + * @type boolean + */ + allowClear?: boolean }