From c75582b4b6d4db21dbf9de0a5b0ea5393614d8bd Mon Sep 17 00:00:00 2001 From: binhaoCen Date: Tue, 18 Aug 2020 10:12:57 +0800 Subject: [PATCH] chror : Fix types popconfirm , page-header ... (#2692) * chore: update type popconfirm * chore: update type page-header * chore: update type popover * chore: update type progress * chore: update type radio * chore: update type rate * chore: update type row * fix: remove string type * chore: update type Select * fix:add $props * chore: update type spin * chore: update type statistic * chore: update type step * fix : add $props * fix:popconfirm add $props * fix: page-header types * fix: add onChange * fix : select type * fix: add type * fix: defined PaginationRenderProps --- types/grid/row.d.ts | 54 +-- types/page-header.d.ts | 104 ++--- types/pagination.d.ts | 182 ++++----- types/popconfirm.d.ts | 69 ++-- types/popover.d.ts | 24 +- types/progress.d.ts | 146 +++---- types/radio/radio-button.d.ts | 15 +- types/radio/radio-group.d.ts | 76 ++-- types/radio/radio.d.ts | 29 +- types/rate.d.ts | 92 ++--- types/select/option-group.d.ts | 18 +- types/select/option.d.ts | 55 +-- types/select/select.d.ts | 466 ++++++++++++----------- types/spin.d.ts | 67 ++-- types/statistic/statistic-countdown.d.ts | 55 +-- types/statistic/statistic.d.ts | 80 ++-- types/steps/step.d.ts | 50 +-- types/steps/steps.d.ts | 88 ++--- 18 files changed, 872 insertions(+), 798 deletions(-) diff --git a/types/grid/row.d.ts b/types/grid/row.d.ts index cfcd338cc..708f39880 100644 --- a/types/grid/row.d.ts +++ b/types/grid/row.d.ts @@ -7,38 +7,40 @@ import { AntdComponent } from '../component'; type Gutter = | number | { - xs: number; - sm: number; - md: number; - lg: number; - xl: number; - xxl: number; - }; + xs: number; + sm: number; + md: number; + lg: number; + xl: number; + xxl: number; + }; export declare class Row extends AntdComponent { - /** + $props: { + /** * spacing between grids, could be a number or a object like { xs: 8, sm: 16, md: 24} * @default 0 * @type numner | object */ - gutter: Gutter | [Gutter, Gutter]; + gutter?: Gutter | [Gutter, Gutter]; - /** - * layout mode, optional flex - * @type string - */ - type: string; + /** + * layout mode, optional flex + * @type string + */ + type?: string; - /** - * the vertical alignment of the flex layout: top middle bottom - * @default 'top' - * @type string - */ - align: 'top' | 'middle' | 'bottom'; + /** + * the vertical alignment of the flex layout: top middle bottom + * @default 'top' + * @type string + */ + align?: 'top' | 'middle' | 'bottom'; - /** - * horizontal arrangement of the flex layout: start end center space-around space-between - * @default 'start' - * @type string - */ - justify: 'start' | 'end' | 'center' | 'space-around' | 'space-between'; + /** + * horizontal arrangement of the flex layout: start end center space-around space-between + * @default 'start' + * @type string + */ + justify?: 'start' | 'end' | 'center' | 'space-around' | 'space-between'; + } } diff --git a/types/page-header.d.ts b/types/page-header.d.ts index b015c6874..5bc8cec7b 100644 --- a/types/page-header.d.ts +++ b/types/page-header.d.ts @@ -3,59 +3,73 @@ // Definitions: https://github.com/vueComponent/ant-design-vue/types import { AntdComponent } from './component'; +import { VNodeChild } from 'vue'; export declare class PageHeader extends AntdComponent { - /** - * Custom backIcon - * @default - * @type any (string | slot) - */ - backIcon: any; + $props: { + /** + * Custom backIcon + * @default + * @type any (string | slot) + */ + backIcon?: VNodeChild | JSX.Element; - /** - * Custom prefixCls - * @type string - */ - prefixCls: string; + /** + * Custom prefixCls + * @type string + */ + prefixCls?: string; - /** - * Custom title - * @type any (string | slot) - */ - title: any; + /** + * Custom title + * @type any (string | slot) + */ + title?: VNodeChild | JSX.Element; - /** - * Custom subTitle - * @type any (string | slot) - */ - subTitle: any; + /** + * Custom subTitle + * @type any (string | slot) + */ + subTitle?: VNodeChild | JSX.Element; + /** + * Breadcrumb configuration + * @type breadcrumb + */ + breadcrumb?: object; - breadcrumb: object; + /** + * Tag list next to title + * @type any (string | slot) + */ + tags?: VNodeChild | JSX.Element; - /** - * Custom tags - * @type any (string | slot) - */ - tags: any; + /** + * PageHeader's footer, generally used to render TabBar + * @type any (string | slot) + */ + footer?: VNodeChild | JSX.Element; - /** - * Custom footer - * @type any (string | slot) - */ - footer: any; + /** + * Operating area, at the end of the line of the title line + * @type any (string | slot) + */ + extra?: VNodeChild | JSX.Element; + /** + * Avatar next to the title bar + * @type Avatar + */ + avatar?: object; + /** + * PageHeader type, will change background color + * @default true + * @type boolean + */ + ghost?: boolean; - /** - * Custom extra - * @type any (string | slot) - */ - extra: any; + /** + * Specify a callback that will be called when a user clicks backIcon. + */ + onBack(): () => void; + } - avatar: object; - - ghost: boolean; - - /** - * Specify a callback that will be called when a user clicks backIcon. - */ - back(): void; } diff --git a/types/pagination.d.ts b/types/pagination.d.ts index 13422eaa7..f3d41fdd5 100644 --- a/types/pagination.d.ts +++ b/types/pagination.d.ts @@ -3,92 +3,98 @@ // Definitions: https://github.com/vueComponent/ant-design-vue/types import { AntdComponent } from './component'; -import { VNode } from 'vue'; - -export declare class Pagination extends AntdComponent { - /** - * total number of data items - * @default 0 - * @type number - */ - total?: number; - - /** - * default initial page number - * @default 1 - * @type number - */ - defaultCurrent?: number; - - /** - * current page number - * @type number - */ - current?: number; - - /** - * default number of data items per page - * @default 10 - * @type number - */ - defaultPageSize?: number; - - /** - * number of data items per page - * @type number - */ - pageSize?: number; - - /** - * Whether to hide pager on single page - * @default false - * @type boolean - */ - hideOnSinglePage?: boolean; - - /** - * determine whether pageSize can be changed - * @default false - * @type boolean - */ - showSizeChanger?: boolean; - - /** - * specify the sizeChanger options - * @default ['10', '20', '30', '40'] - * @type string[] - */ - pageSizeOptions?: string[]; - - /** - * determine whether you can jump to pages directly - * @default false - * @type boolean - */ - showQuickJumper?: boolean | object; - - /** - * to display the total number and range - * @type Function - */ - showTotal?: (total: number, range: [number, number]) => any; - - /** - * specify the size of Pagination, can be set to small - * @default '' - * @type string - */ - size?: string; - - /** - * whether to use simple mode - * @type boolean - */ - simple?: boolean; - - /** - * to customize item innerHTML - * @type Function - */ - itemRender?: (page: number, type: 'page' | 'prev' | 'next', originalElement: any) => VNode; +import { VNodeChild } from 'vue'; +interface PaginationRenderProps { + page: number + type: 'page' | 'prev' | 'next' + originalElement: any +} +export declare class Pagination extends AntdComponent { + $props: { + /** + * total number of data items + * @default 0 + * @type number + */ + total?: number; + + /** + * default initial page number + * @default 1 + * @type number + */ + defaultCurrent?: number; + + /** + * current page number + * @type number + */ + current?: number; + + /** + * default number of data items per page + * @default 10 + * @type number + */ + defaultPageSize?: number; + + /** + * number of data items per page + * @type number + */ + pageSize?: number; + + /** + * Whether to hide pager on single page + * @default false + * @type boolean + */ + hideOnSinglePage?: boolean; + + /** + * determine whether pageSize can be changed + * @default false + * @type boolean + */ + showSizeChanger?: boolean; + + /** + * specify the sizeChanger options + * @default ['10', '20', '30', '40'] + * @type string[] + */ + pageSizeOptions?: string[]; + + /** + * determine whether you can jump to pages directly + * @default false + * @type boolean + */ + showQuickJumper?: boolean | object; + + /** + * to display the total number and range + * @type Function + */ + showTotal?: (total: number, range: [number, number]) => any; + + /** + * specify the size of Pagination, can be set to small + * @default '' + * @type string + */ + size?: string; + + /** + * whether to use simple mode + * @type boolean + */ + simple?: boolean; + + /** + * to customize item innerHTML + * @type Function + */ + itemRender?: (props:PaginationRenderProps) => VNodeChild | JSX.Element; + } } diff --git a/types/popconfirm.d.ts b/types/popconfirm.d.ts index 97bc38d11..b82fb4258 100644 --- a/types/popconfirm.d.ts +++ b/types/popconfirm.d.ts @@ -3,41 +3,48 @@ // Definitions: https://github.com/vueComponent/ant-design-vue/types import { TooltipCommon } from './tootip/common'; - +import { VNodeChild } from 'vue'; export declare class Popconfirm extends TooltipCommon { - /** - * text of the Cancel button - * @default 'Cancel' - * @type any (string | slot) - */ - cancelText: any; + $props: { + /** + * text of the Cancel button + * @default 'Cancel' + * @type any (string | slot) + */ + cancelText?: VNodeChild | JSX.Element; - /** - * text of the Confirm button - * @default 'Confirm' - * @type any (string | slot) - */ - okText: any; + /** + * text of the Confirm button + * @default 'Confirm' + * @type any (string | slot) + */ + okText?: VNodeChild | JSX.Element; - /** - * Button type of the Confirm button - * @default 'primary' - * @type string - */ - okType: 'primary' | 'danger' | 'dashed' | 'ghost' | 'default'; + /** + * Button type of the Confirm button + * @default 'primary' + * @type string + */ + okType?: 'primary' | 'danger' | 'dashed' | 'ghost' | 'default'; - /** - * title of the confirmation box - * @type any (string | slot) - */ - title: any; + /** + * title of the confirmation box + * @type any (string | slot) + */ + title?: VNodeChild | JSX.Element; - /** - * customize icon of confirmation - * @default - * @type any (VNode | slot) - */ - icon: any; + /** + * customize icon of confirmation + * @default + * @type any (VNode | slot) + */ + icon?: VNodeChild | JSX.Element; + /** + * is show popconfirm when click its childrenNode + * @default false + * @type boolean + */ + disabled?: boolean; + } - disabled: boolean; } diff --git a/types/popover.d.ts b/types/popover.d.ts index 04d6aef74..6289bc756 100644 --- a/types/popover.d.ts +++ b/types/popover.d.ts @@ -3,17 +3,19 @@ // Definitions: https://github.com/vueComponent/ant-design-vue/types import { TooltipCommon } from './tootip/common'; - +import { VNodeChild } from 'vue'; export declare class Popover extends TooltipCommon { - /** - * Content of the card - * @type any (string | slot | VNode) - */ - content: any; + $props: { + /** + * Content of the card + * @type any (string | slot | VNode) + */ + content?: VNodeChild | JSX.Element; - /** - * Title of the card - * @type any (string | slot | VNode) - */ - title: any; + /** + * Title of the card + * @type any (string | slot | VNode) + */ + title?: VNodeChild | JSX.Element; + } } diff --git a/types/progress.d.ts b/types/progress.d.ts index f8ed02ac4..a571fd096 100644 --- a/types/progress.d.ts +++ b/types/progress.d.ts @@ -8,87 +8,89 @@ export type StringGradients = { [percentage: string]: string }; type FromToGradients = { from: string; to: string }; export type ProgressGradient = { direction?: string } & (StringGradients | FromToGradients); export declare class Progress extends AntdComponent { - /** - * template function of the content - * @default percent => percent + '%' - * @type Function - */ - format: (percent?: number, successPercent?: number) => any; + $props: { + /** + * template function of the content + * @default percent => percent + '%' + * @type Function + */ + format?: (percent?: number, successPercent?: number) => any; - /** - * the gap degree of half circle, 0 ~ 360 - * @default 0 - * @type number - */ - gapDegree: number; + /** + * the gap degree of half circle, 0 ~ 360 + * @default 0 + * @type number + */ + gapDegree?: number; - /** - * the gap position, options: top bottom left right - * @default 'top' - * @type string - */ - gapPosition: 'top' | 'bottom' | 'left' | 'right'; + /** + * the gap position, options: top bottom left right + * @default 'top' + * @type string + */ + gapPosition?: 'top' | 'bottom' | 'left' | 'right'; - /** - * to set the completion percentage - * @default 0 - * @type number - */ - percent: number; + /** + * to set the completion percentage + * @default 0 + * @type number + */ + percent?: number; - /** - * whether to display the progress value and the status icon - * @default true - * @type boolean - */ - showInfo: boolean; + /** + * whether to display the progress value and the status icon + * @default true + * @type boolean + */ + showInfo?: boolean; - /** - * to set the status of the Progress, options: normal success exception active - * @default 'normal' - * @type string - */ - status: 'normal' | 'success' | 'active' | 'exception'; + /** + * to set the status of the Progress, options: normal success exception active + * @default 'normal' + * @type string + */ + status?: 'normal' | 'success' | 'active' | 'exception'; - /** - * to set the width of the progress bar, unit: px. - * to set the width of the circular progress bar, unit: percentage of the canvas width - * @default 10 if type = 'line', else 6 - * @type number - */ - strokeWidth: number; + /** + * to set the width of the progress bar, unit: px. + * to set the width of the circular progress bar, unit: percentage of the canvas width + * @default 10 if type = 'line', else 6 + * @type number + */ + strokeWidth?: number; - /** - * to set the style of the progress linecap - * @default 'round' - * @type Enum{ 'round', 'square' } - */ - strokeLinecap: 'butt' | 'square' | 'round'; + /** + * to set the style of the progress linecap + * @default 'round' + * @type Enum{ 'round', 'square' } + */ + strokeLinecap?: 'butt' | 'square' | 'round'; - /** - * color of progress bar - * @type string - */ - strokeColor: string | ProgressGradient; + /** + * color of progress bar + * @type string + */ + strokeColor?: string | ProgressGradient; - /** - * segmented success percent, works when type="line" - * @default 0 - * @type number - */ - successPercent: number; + /** + * segmented success percent, works when type="line" + * @default 0 + * @type number + */ + successPercent?: number; - /** - * to set the type, options: line circle dashboard - * @default 'line' - * @type string - */ - type: 'line' | 'circle' | 'dashboard'; + /** + * to set the type, options: line circle dashboard + * @default 'line' + * @type string + */ + type?: 'line' | 'circle' | 'dashboard'; - /** - * to set the canvas width of the circular progress bar, unit: px - * @default 120 - * @type number - */ - width: number; + /** + * to set the canvas width of the circular progress bar, unit: px + * @default 120 + * @type number + */ + width?: number; + } } diff --git a/types/radio/radio-button.d.ts b/types/radio/radio-button.d.ts index a19a52a5d..d8050edd8 100644 --- a/types/radio/radio-button.d.ts +++ b/types/radio/radio-button.d.ts @@ -2,12 +2,15 @@ // Definitions by: akki-jat // Definitions: https://github.com/vueComponent/ant-design-vue/types -import { Radio } from './radio'; +import { RadioProps, Radio } from './radio'; -export declare class RadioButton extends Radio { +declare class RadioButtonProps extends RadioProps { /** - * Type of radio button - * @type string - */ - type: 'primary' | 'danger' | 'dashed' | 'ghost' | 'default'; +* Type of radio button +* @type string +*/ + type?: 'primary' | 'danger' | 'dashed' | 'ghost' | 'default'; +} +export declare class RadioButton extends Radio { + $props: RadioButtonProps } diff --git a/types/radio/radio-group.d.ts b/types/radio/radio-group.d.ts index 68dc83970..4b099816c 100644 --- a/types/radio/radio-group.d.ts +++ b/types/radio/radio-group.d.ts @@ -5,48 +5,54 @@ import { AntdComponent } from '../component'; export declare class RadioGroup extends AntdComponent { - /** + $props: { + /** * Specifies the initial state: whether or not the radio is selected. * @type boolean */ - defaultValue: boolean; + defaultValue?: any; - /** - * Disable radio - * @default false - * @type boolean - */ - disabled: boolean; + /** + * Disable radio + * @default false + * @type boolean + */ + disabled?: boolean; - /** - * The name property of all input[type="radio"] children - * @type string - */ - name: string; + /** + * The name property of all input[type="radio"] children + * @type string + */ + name?: string; - /** - * set children optional - * @type Array - */ - options: Array; + /** + * set children optional + * @type Array + */ + options?: Array; - /** - * size for radio button style - * @default 'default' - * @type String - */ - size: 'large' | 'default' | 'small'; + /** + * size for radio button style + * @default 'default' + * @type String + */ + size?: 'large' | 'default' | 'small'; - /** - * Used for setting the currently selected value. - * @type any - */ - value: any; + /** + * Used for setting the currently selected value. + * @type any + */ + value?: any; - /** - * style type of radio button - * @default 'outline' - * @type string - */ - buttonStyle: 'outline' | 'solid'; + /** + * style type of radio button + * @default 'outline' + * @type string + */ + buttonStyle?: 'outline' | 'solid'; + /** + * The callback function that is triggered when the state changes. + */ + onChange?:(e:Event)=>void + } } diff --git a/types/radio/radio.d.ts b/types/radio/radio.d.ts index 24f921a6c..2f510359b 100644 --- a/types/radio/radio.d.ts +++ b/types/radio/radio.d.ts @@ -6,42 +6,43 @@ import { AntdComponent } from '../component'; import { RadioGroup } from './radio-group'; import { RadioButton } from './radio-button'; -export declare class Radio extends AntdComponent { - static Group: typeof RadioGroup; - static Button: typeof RadioButton; - +export declare class RadioProps { /** - * get focus when component mounted - * @default false - * @type boolean - */ - autofocus: boolean; + * get focus when component mounted + * @default false + * @type boolean + */ + autofocus?: boolean; /** * Specifies whether the radio is selected. * @type boolean */ - checked: boolean; + checked?: boolean; /** * Specifies the initial state: whether or not the radio is selected. * @type boolean */ - defaultChecked: boolean; + defaultChecked?: boolean; /** * Disable radio * @default false * @type boolean */ - disabled: boolean; + disabled?: boolean; /** * According to value for comparison, to determine whether the selected * @type any */ - value: any; - + value?: any; +} +export declare class Radio extends AntdComponent { + static Group: typeof RadioGroup; + static Button: typeof RadioButton; + $props: RadioProps /** * remove focus */ diff --git a/types/rate.d.ts b/types/rate.d.ts index 85d6b95fc..743e31a56 100644 --- a/types/rate.d.ts +++ b/types/rate.d.ts @@ -3,65 +3,67 @@ // Definitions: https://github.com/vueComponent/ant-design-vue/types import { AntdComponent } from './component'; - +import { VNodeChild } from 'vue'; export declare class Rate extends AntdComponent { - /** + $props: { + /** * whether to allow clear when click again * @default true * @type boolean */ - allowClear: boolean; + allowClear?: boolean; - /** - * whether to allow semi selection - * @default false - * @type boolean - */ - allowHalf: boolean; + /** + * whether to allow semi selection + * @default false + * @type boolean + */ + allowHalf?: boolean; - /** - * get focus when component mounted - * @default false - * @type boolean - */ - autofocus: boolean; + /** + * get focus when component mounted + * @default false + * @type boolean + */ + autofocus?: boolean; - /** - * custom character of rate - * @default - * @type any (String or slot="character") - */ - character: any; + /** + * custom character of rate + * @default + * @type any (String or slot="character") + */ + character?: VNodeChild | JSX.Element; - /** - * star count - * @default 5 - * @type number - */ - count: number; + /** + * star count + * @default 5 + * @type number + */ + count?: number; - /** - * default value - * @default 0 - * @type number - */ - defaultValue: number; + /** + * default value + * @default 0 + * @type number + */ + defaultValue?: number; - /** - * read only, unable to interact - * @default false - * @type boolean - */ - disabled: boolean; + /** + * read only, unable to interact + * @default false + * @type boolean + */ + disabled?: boolean; - /** - * current value - * @type number - */ - value: number; + /** + * current value + * @type number + */ + value?: number; - tooltips: Array; + tooltips?: Array; + } /** * remove focus */ diff --git a/types/select/option-group.d.ts b/types/select/option-group.d.ts index b7a2d97ef..ce98b7f45 100644 --- a/types/select/option-group.d.ts +++ b/types/select/option-group.d.ts @@ -3,17 +3,21 @@ // Definitions: https://github.com/vueComponent/ant-design-vue/types import { AntdComponent } from '../component'; +import { VNodeChild } from 'vue'; export declare class OptionGroup extends AntdComponent { - /** + $props: { + /** * Key * @type string */ - key: string; + key?: string; + + /** + * Group label + * @type any (string | slot) + */ + label?: VNodeChild | JSX.Element; + } - /** - * Group label - * @type any (string | slot) - */ - label: any; } diff --git a/types/select/option.d.ts b/types/select/option.d.ts index 96c7838b1..f8fedb603 100644 --- a/types/select/option.d.ts +++ b/types/select/option.d.ts @@ -5,34 +5,37 @@ import { AntdComponent } from '../component'; export declare class Option extends AntdComponent { - /** - * Disable this option - * @default false - * @type boolean - */ - disabled: boolean; + $props: { + /** + * Disable this option + * @default false + * @type boolean + */ + disabled?: boolean; - /** - * Same usage as value. If Vue request you to set this property, you can set it to value of option, and then omit value property. - * @type string - */ - key: string; + /** + * Same usage as value. If Vue request you to set this property, you can set it to value of option, and then omit value property. + * @type string + */ + key?: string; - /** - * title of Select after select this Option - * @type string - */ - title: string; + /** + * title of Select after select this Option + * @type string + */ + title?: string; - /** - * default to filter with this property - * @type string | number - */ - value: string | number; + /** + * default to filter with this property + * @type string | number + */ + value?: string | number; + + /** + * additional class to option + * @type string + */ + class?: string; + } - /** - * additional class to option - * @type string - */ - class: string; } diff --git a/types/select/select.d.ts b/types/select/select.d.ts index cbec40840..e6ef2d02d 100644 --- a/types/select/select.d.ts +++ b/types/select/select.d.ts @@ -5,248 +5,252 @@ import { AntdComponent } from '../component'; import { Option } from './option'; import { OptionGroup } from './option-group'; -import { VNode } from 'vue'; - +import { VNodeChild, CSSProperties } from 'vue'; +type dropdownRenderProps = { + menu?: VNodeChild, + props?: object +} export declare class Select extends AntdComponent { static Option: typeof Option; static OptGroup: typeof OptionGroup; + $props: { + /** + * Show clear button. + * @default false + * @type boolean + */ + allowClear?: boolean; - /** - * Show clear button. - * @default false - * @type boolean - */ - allowClear: boolean; + /** + * Whether the current search will be cleared on selecting an item. Only applies when mode is set to multiple or tags. + * @default true + * @type boolean + */ + autoClearSearchValue?: boolean; - /** - * Whether the current search will be cleared on selecting an item. Only applies when mode is set to multiple or tags. - * @default true - * @type boolean - */ - autoClearSearchValue: boolean; + /** + * Get focus by default + * @default false + * @type boolean + */ + autofocus?: boolean; - /** - * Get focus by default - * @default false - * @type boolean - */ - autofocus: boolean; + /** + * Whether active first option by default + * @default true + * @type boolean + */ + defaultActiveFirstOption?: boolean; - /** - * Whether active first option by default - * @default true - * @type boolean - */ - defaultActiveFirstOption: boolean; + /** + * Initial selected option. + * @type string | number | Array + */ + defaultValue?: string | number | Array; - /** - * Initial selected option. - * @type string | number | Array - */ - defaultValue: string | number | Array; - - /** - * Whether disabled select - * @default false - * @type boolean - */ - disabled: boolean; - - /** - * className of dropdown menu - * @type string - */ - dropdownClassName: string; - - /** - * Whether dropdown's width is same with select. - * @default true - * @type boolean - */ - dropdownMatchSelectWidth: boolean; - - /** - * Customize dropdown content - * @type function | slot-scope - */ - dropdownRender?: (menu?: VNode, props?: object) => VNode; - - /** - * style of dropdown menu - * @type object - */ - dropdownStyle: object; - - /** - * If true, filter options by input, if function, filter options against it. The function will receive two arguments, inputValue and option, - * if the function returns true, the option will be included in the filtered set; Otherwise, it will be excluded. - * @default true - * @type boolean | Function - */ - filterOption: boolean | Function; - - /** - * Value of action option by default - * @type string | string[] - */ - firstActiveValue: string | string[]; - - /** - * Parent Node which the selector should be rendered to. Default to body. - * When position issues happen, try to modify it into scrollable content and position it relative. - * @default () => document.body - * @type Function - */ - getPopupContainer: (triggerNode: any) => any; - - /** - * whether to embed label in value, turn the format of value from string to {key: string, label: vNodes} - * @default false - * @type boolean - */ - labelInValue: boolean; - - /** - * Max tag count to show - * @type number - */ - maxTagCount: number; - - /** - * Placeholder for not showing tags - * @type any (slot | Function) - */ - maxTagPlaceholder: any; - - /** - * Max text length to show - * @type number - */ - maxTagTextLength: number; - - /** - * Set mode of Select - * @default 'default' - * @type string - */ - mode: 'default' | 'multiple' | 'tags'; - - /** - * Specify content to show when no result matches.. - * @default 'Not Found' - * @type any (string | slot) - */ - notFoundContent: any; - - /** - * Which prop value of option will be used for filter if filterOption is true - * @default 'value' - * @type string - */ - optionFilterProp: string; - - /** - * Which prop value of option will render as content of select. - * @default 'value' for combobox, 'children' for other modes - * @type string - */ - optionLabelProp: string; - - /** - * Placeholder of select - * @type any (string | slot) - */ - placeholder: any; - - /** - * Whether show search input in single mode. - * @default false - * @type boolean - */ - showSearch: boolean; - - /** - * Whether to show the drop-down arrow - * @default true - * @type boolean - */ - showArrow: boolean; - - /** - * Size of Select input. default large small - * @default 'default' - * @type string - */ - size: 'default' | 'large' | 'small'; - - /** - * The custom suffix icon - * @type any (VNode | slot) - */ - suffixIcon: any; - - /** - * The custom remove icon - * @type any (VNode | slot) - */ - removeIcon: any; - - /** - * The custom clear icon - * @type any (VNode | slot) - */ - clearIcon: any; - - /** - * The custom menuItemSelected icon - * @type any (VNode | slot) - */ - menuItemSelectedIcon: any; - - /** - * Separator used to tokenize on tag/multiple mode - * @type string[] - */ - tokenSeparators: string[]; - - /** - * Current selected option. - * @type string | number | Array - */ - value: string | number | Array; - - /** - * Data of the selectOption, manual construction work is no longer needed if this property has been set - * @default [] - * @type Array<{ value; label; disabled?; key?; title? }> - */ - options: Array<{ - value: any; - label: any; + /** + * Whether disabled select + * @default false + * @type boolean + */ disabled?: boolean; - key?: any; - title?: any; - }>; - /** - * Initial open state of dropdown - * @type boolean - */ - defaultOpen: boolean; + /** + * className of dropdown menu + * @type string + */ + dropdownClassName?: string; - /** - * Controlled open state of dropdown - * @type boolean - */ - open: boolean; + /** + * Whether dropdown's width is same with select. + * @default true + * @type boolean + */ + dropdownMatchSelectWidth?: boolean; - /** - * remove focus - */ - blur(): void; + /** + * Customize dropdown content + * @type function | slot-scope + */ + dropdownRender?: (props:dropdownRenderProps) => VNodeChild; - /** - * get focus - */ - focus(): void; + /** + * style of dropdown menu + * @type object + */ + dropdownStyle?: CSSProperties; + + /** + * If true, filter options by input, if function, filter options against it. The function will receive two arguments, inputValue and option, + * if the function returns true, the option will be included in the filtered set; Otherwise, it will be excluded. + * @default true + * @type boolean | Function + */ + filterOption?: boolean | Function; + + /** + * Value of action option by default + * @type string | string[] + */ + firstActiveValue?: string | string[]; + + /** + * Parent Node which the selector should be rendered to. Default to body. + * When position issues happen, try to modify it into scrollable content and position it relative. + * @default () => document.body + * @type Function + */ + getPopupContainer?: (triggerNode: any) => any; + + /** + * whether to embed label in value, turn the format of value from string to {key: string, label: vNodes} + * @default false + * @type boolean + */ + labelInValue?: boolean; + + /** + * Max tag count to show + * @type number + */ + maxTagCount?: number; + + /** + * Placeholder for not showing tags + * @type any (slot | Function) + */ + maxTagPlaceholder?: VNodeChild | JSX.Element | Function; + + /** + * Max text length to show + * @type number + */ + maxTagTextLength?: number; + + /** + * Set mode of Select + * @default 'default' + * @type string + */ + mode?: 'default' | 'multiple' | 'tags'; + + /** + * Specify content to show when no result matches.. + * @default 'Not Found' + * @type any (string | slot) + */ + notFoundContent?: VNodeChild | JSX.Element; + + /** + * Which prop value of option will be used for filter if filterOption is true + * @default 'value' + * @type string + */ + optionFilterProp?: string; + + /** + * Which prop value of option will render as content of select. + * @default 'value' for combobox, 'children' for other modes + * @type string + */ + optionLabelProp?: string; + + /** + * Placeholder of select + * @type any (string | slot) + */ + placeholder?: VNodeChild | JSX.Element + + /** + * Whether show search input in single mode. + * @default false + * @type boolean + */ + showSearch?: boolean; + + /** + * Whether to show the drop-down arrow + * @default true + * @type boolean + */ + showArrow?: boolean; + + /** + * Size of Select input. default large small + * @default 'default' + * @type string + */ + size?: 'default' | 'large' | 'small'; + + /** + * The custom suffix icon + * @type any (VNode | slot) + */ + suffixIcon?: VNodeChild | JSX.Element + + /** + * The custom remove icon + * @type any (VNode | slot) + */ + removeIcon?: VNodeChild | JSX.Element + + /** + * The custom clear icon + * @type any (VNode | slot) + */ + clearIcon?: VNodeChild | JSX.Element + + /** + * The custom menuItemSelected icon + * @type any (VNode | slot) + */ + menuItemSelectedIcon?: VNodeChild | JSX.Element + + /** + * Separator used to tokenize on tag/multiple mode + * @type string[] + */ + tokenSeparators?: string[]; + + /** + * Current selected option. + * @type string | number | Array + */ + value?: string | number | Array; + + /** + * Data of the selectOption, manual construction work is no longer needed if this property has been set + * @default [] + * @type Array<{ value; label; disabled?; key?; title? }> + */ + options?: Array<{ + value: any; + label: any; + disabled?: boolean; + key?: any; + title?: any; + }>; + + /** + * Initial open state of dropdown + * @type boolean + */ + defaultOpen?: boolean; + + /** + * Controlled open state of dropdown + * @type boolean + */ + open?: boolean; + + /** + * remove focus + */ + onBlur: (e?: Event) => void + + /** + * get focus + */ + onFocus: (e?: Event) => void + } } diff --git a/types/spin.d.ts b/types/spin.d.ts index 1b17610ea..4725fa64a 100644 --- a/types/spin.d.ts +++ b/types/spin.d.ts @@ -3,6 +3,7 @@ // Definitions: https://github.com/vueComponent/ant-design-vue/types import { AntdComponent } from './component'; +import { VNodeChild } from 'vue'; export declare class Spin extends AntdComponent { /** @@ -10,42 +11,44 @@ export declare class Spin extends AntdComponent { * @param param0 indicator */ static setDefaultIndicator({ indicator }: { indicator: any }): void; + $props: { - /** - * specifies a delay in milliseconds for loading state (prevent flush) - * @type number (milliseconds) - */ - delay: number; + /** + * specifies a delay in milliseconds for loading state (prevent flush) + * @type number (milliseconds) + */ + delay?: number; - /** - * vue node of the spinning indicator - * @type any (VNode | slot) - */ - indicator: any; + /** + * vue node of the spinning indicator + * @type any (VNode | slot) + */ + indicator?: VNodeChild | JSX.Element; - /** - * size of Spin, options: small, default and large - * @default 'default' - * @type string - */ - size: 'small' | 'default' | 'large'; + /** + * size of Spin, options: small, default and large + * @default 'default' + * @type string + */ + size?: 'small' | 'default' | 'large'; - /** - * whether Spin is spinning - * @default true - * @type boolean - */ - spinning: boolean; + /** + * whether Spin is spinning + * @default true + * @type boolean + */ + spinning?: boolean; - /** - * customize description content when Spin has children - * @type string - */ - tip: string; + /** + * customize description content when Spin has children + * @type string + */ + tip?: string; - /** - * className of wrapper when Spin has children - * @type string - */ - wrapperClassName: string; + /** + * className of wrapper when Spin has children + * @type string + */ + wrapperClassName?: string; + } } diff --git a/types/statistic/statistic-countdown.d.ts b/types/statistic/statistic-countdown.d.ts index b4aa82966..ffa5d5dec 100644 --- a/types/statistic/statistic-countdown.d.ts +++ b/types/statistic/statistic-countdown.d.ts @@ -3,32 +3,41 @@ // Definitions: https://github.com/vueComponent/ant-design-vue/types import { AntdComponent } from '../component'; -import { VNode } from 'vue'; +import { VNodeChild, CSSProperties } from 'vue'; export declare class StatisticCountdown extends AntdComponent { - format: string; - /** - * prefix node of value - * @type string | VNode - */ - prefix: string | VNode; + $props:{ + /** + * Format as moment + * @default 'HH:mm:ss' + */ + format?: string; + /** + * prefix node of value + * @type string | VNode + */ + prefix?: VNodeChild | JSX.Element; - /** - * suffix node of value - * @type string | VNode - */ - suffix: string | VNode; + /** + * suffix node of value + * @type string | VNode + */ + suffix?: VNodeChild | JSX.Element; - /** - * Display title - * @type string | VNode - */ - title: string | VNode; + /** + * Display title + * @type string | VNode + */ + title?: VNodeChild | JSX.Element; - /** - * Display value - * @type string or number - */ - value: string | number; - valueStyle: object; + /** + * Display value + * @type string or number + */ + value?: string | number; + /** + * Set value css style + */ + valueStyle?: CSSProperties; + } } diff --git a/types/statistic/statistic.d.ts b/types/statistic/statistic.d.ts index 2ab212d22..dbdb3b5ae 100644 --- a/types/statistic/statistic.d.ts +++ b/types/statistic/statistic.d.ts @@ -3,58 +3,60 @@ // Definitions: https://github.com/vueComponent/ant-design-vue/types import { AntdComponent } from '../component'; -import { VNode } from 'vue'; +import { VNodeChild } from 'vue'; import { StatisticCountdown } from './statistic-countdown'; export declare class Statistic extends AntdComponent { static Countdown: typeof StatisticCountdown; - /** + $props: { + /** * decimal separator * @default '.' * @type string */ - decimalSeparator: string; + decimalSeparator?: string; - /** - * the shape of statistic - * @type string - */ - formatter: () => VNode; + /** + * the shape of statistic + * @type string + */ + formatter?: () => VNodeChild | JSX.Element; - /** - * group separator - * @default ',' - * @type string - */ - groupSeparator: string; + /** + * group separator + * @default ',' + * @type string + */ + groupSeparator?: string; - /** - * precision of input value - * @type number - */ - precision: number; + /** + * precision of input value + * @type number + */ + precision?: number; - /** - * prefix node of value - * @type string | VNode - */ - prefix: string | VNode; + /** + * prefix node of value + * @type string | VNodeChild + */ + prefix?: VNodeChild | JSX.Element; - /** - * suffix node of value - * @type string | VNode - */ - suffix: string | VNode; + /** + * suffix node of value + * @type string | VNodeChild + */ + suffix?: VNodeChild | JSX.Element; - /** - * Display title - * @type string | VNode - */ - title: string | VNode; + /** + * Display title + * @type string | VNodeChild + */ + title?: VNodeChild | JSX.Element; - /** - * Display value - * @type string or number - */ - value: string | number; + /** + * Display value + * @type string or number + */ + value?: string | number; + } } diff --git a/types/steps/step.d.ts b/types/steps/step.d.ts index c28784439..0130d4e8f 100644 --- a/types/steps/step.d.ts +++ b/types/steps/step.d.ts @@ -3,32 +3,34 @@ // Definitions: https://github.com/vueComponent/ant-design-vue/types import { AntdComponent } from '../component'; - +import {VNodeChild} from 'vue'; export declare class Step extends AntdComponent { - /** - * description of the step, optional property - * @type any (string | slot) - */ - description: any; + $props: { + /** + * description of the step, optional property + * @type any (string | slot) + */ + description?: VNodeChild | JSX.Element; - /** - * icon of the step, optional property - * @type any (string | slot) - */ - icon: any; + /** + * icon of the step, optional property + * @type any (string | slot) + */ + icon?: VNodeChild | JSX.Element; - /** - * to specify the status. It will be automatically set by current of Steps if not configured. Optional values are: wait process finish error - * @default 'wait' - * @type string - */ - status: 'wait' | 'process' | 'finish' | 'error'; + /** + * to specify the status. It will be automatically set by current of Steps if not configured. Optional values are: wait process finish error + * @default 'wait' + * @type string + */ + status?: 'wait' | 'process' | 'finish' | 'error'; - /** - * title of the step - * @type any (string | slot) - */ - title: any; - disabled: boolean; - subTitle: any; + /** + * title of the step + * @type any (string | slot) + */ + title?: VNodeChild | JSX.Element; + disabled?: boolean; + subTitle?: VNodeChild | JSX.Element; + } } diff --git a/types/steps/steps.d.ts b/types/steps/steps.d.ts index 8be06b1dd..cba8016e4 100644 --- a/types/steps/steps.d.ts +++ b/types/steps/steps.d.ts @@ -7,53 +7,55 @@ import { Step } from './step'; export declare class Steps extends AntdComponent { static Step: typeof Step; - type: 'default' | 'navigation'; - /** - * to set the current step, counting from 0. You can overwrite this state by using status of Step - * @default 0 - * @type number - */ - current: number; + $props: { + type?: 'default' | 'navigation'; + /** + * to set the current step, counting from 0. You can overwrite this state by using status of Step + * @default 0 + * @type number + */ + current?: number; - /** - * set the initial step, counting from 0 - * @default 0 - * @type number - */ - initial: number; + /** + * set the initial step, counting from 0 + * @default 0 + * @type number + */ + initial?: number; - /** - * support vertial title and description - * @default 'horizontal' - * @type string - */ - labelPlacement: 'horizontal' | 'vertical'; + /** + * support vertial title and description + * @default 'horizontal' + * @type string + */ + labelPlacement?: 'horizontal' | 'vertical'; - /** - * to specify the status of current step, can be set to one of the following values: wait process finish error - * @default 'process' - * @type string - */ - status: 'wait' | 'process' | 'finish' | 'error'; + /** + * to specify the status of current step, can be set to one of the following values: wait process finish error + * @default 'process' + * @type string + */ + status?: 'wait' | 'process' | 'finish' | 'error'; - /** - * to specify the size of the step bar, default and small are currently supported - * @default 'default' - * @type string - */ - size: 'default' | 'small'; + /** + * to specify the size of the step bar, default and small are currently supported + * @default 'default' + * @type string + */ + size?: 'default' | 'small'; - /** - * to specify the direction of the step bar, horizontal and vertical are currently supported - * @default 'horizontal' - * @type string - */ - direction: 'horizontal' | 'vertical'; + /** + * to specify the direction of the step bar, horizontal and vertical are currently supported + * @default 'horizontal' + * @type string + */ + direction?: 'horizontal' | 'vertical'; - /** - * Steps with progress dot style, customize the progress dot by setting a scoped slot. labelPlacement will be vertical - * @default false - * @type boolean | Funtion - */ - progressDot: boolean | Function; + /** + * Steps with progress dot style, customize the progress dot by setting a scoped slot. labelPlacement will be vertical + * @default false + * @type boolean | Funtion + */ + progressDot?: boolean | Function; + } }