Merge branch 'feat-vue3' of github.com:vueComponent/ant-design-vue into feat-vue3

pull/2750/head
undefined 2020-08-21 23:08:57 +08:00
commit 9eebd8da23
8 changed files with 252 additions and 238 deletions

151
types/card.d.ts vendored
View File

@ -2,6 +2,7 @@
// Definitions by: akki-jat <https://github.com/akki-jat> // Definitions by: akki-jat <https://github.com/akki-jat>
// Definitions: https://github.com/vueComponent/ant-design-vue/types // Definitions: https://github.com/vueComponent/ant-design-vue/types
import { VNodeChild, CSSProperties } from 'vue';
import { AntdComponent } from './component'; import { AntdComponent } from './component';
import { Meta } from './meta'; import { Meta } from './meta';
@ -11,91 +12,93 @@ export declare class Card extends AntdComponent {
static Grid: any; static Grid: any;
static Meta: typeof Meta; static Meta: typeof Meta;
tabBarExtraContent: any; $props: {
/** tabBarExtraContent: any;
* The action list, shows at the bottom of the Card. /**
* @type any (slots) * The action list, shows at the bottom of the Card.
*/ * @type any (slots)
actions: any; */
actions: VNodeChild | JSX.Element;
/** /**
* Current TabPane's key * Current TabPane's key
* @type string * @type string
*/ */
activeTabKey: string; activeTabKey?: string;
/** /**
* Inline style to apply to the card head * Inline style to apply to the card head
* @type object * @type object
*/ */
headStyle: object; headStyle?: CSSProperties;
/** /**
* Inline style to apply to the card content * Inline style to apply to the card content
* @type object * @type object
*/ */
bodyStyle: object; bodyStyle?: CSSProperties;
/** /**
* Toggles rendering of the border around the card * Toggles rendering of the border around the card
* @default true * @default true
* @type boolean * @type boolean
*/ */
bordered: boolean; bordered?: boolean;
/** /**
* Card cover * Card cover
* @type any (slot) * @type any (slot)
*/ */
cover: any; cover?: VNodeChild | JSX.Element;
/** /**
* Initial active TabPane's key, if activeTabKey is not set. * Initial active TabPane's key, if activeTabKey is not set.
* @type string * @type string
*/ */
defaultActiveTabKey: string; defaultActiveTabKey?: string;
/** /**
* Content to render in the top-right corner of the card * Content to render in the top-right corner of the card
* @type any (string | slot) * @type any (string | slot)
*/ */
extra: any; extra?: VNodeChild | JSX.Element;
/** /**
* Lift up when hovering card * Lift up when hovering card
* @default false * @default false
* @type boolean * @type boolean
*/ */
hoverable: boolean; hoverable?: boolean;
/** /**
* Shows a loading indicator while the contents of the card are being fetched * Shows a loading indicator while the contents of the card are being fetched
* @default false * @default false
* @type boolean * @type boolean
*/ */
loading: boolean; loading?: boolean;
/** /**
* List of TabPane's head, Custom tabs can be created with the scopedSlots property * List of TabPane's head, Custom tabs can be created with the scopedSlots property
* @type Array<{key: string, tab: any, scopedSlots: {tab: string}}> * @type Array<{key: string, tab: any, scopedSlots: {tab: string}}>
*/ */
tabList: Array<{ key: string; tab: any; scopedSlots: { tab: string } }>; tabList?: Array<{ key: string; tab: any; scopedSlots: { tab: string } }>;
/** /**
* Card title * Card title
* @type any (string | slot) * @type any (string | slot)
*/ */
title: any; title?: VNodeChild | JSX.Element;
/** /**
* Card style type, can be set to inner or not set * Card style type, can be set to inner or not set
* @type string * @type string
*/ */
type: string; type?: string;
/** /**
* Size of card * Size of card
* @type string * @type string
*/ */
size: CardSize; size?: CardSize;
};
} }

4
types/meta.d.ts vendored
View File

@ -16,12 +16,12 @@ export declare class Meta {
* The description of list item * The description of list item
* @type any (string | slot) * @type any (string | slot)
*/ */
description?: string | VNodeChild; description?: VNodeChild | JSX.Element;
/** /**
* The title of list item * The title of list item
* @type any (string | slot) * @type any (string | slot)
*/ */
title?: string | VNodeChild; title?: VNodeChild | JSX.Element;
}; };
} }

View File

@ -4,7 +4,8 @@
import { TooltipCommon } from './tootip/common'; import { TooltipCommon } from './tootip/common';
import { VNodeChild } from 'vue'; import { VNodeChild } from 'vue';
export declare class Popconfirm extends TooltipCommon { import { AntdComponent } from './component';
export declare class Popconfirm extends AntdComponent {
$props: { $props: {
/** /**
* text of the Cancel button * text of the Cancel button
@ -45,6 +46,6 @@ export declare class Popconfirm extends TooltipCommon {
* @type boolean * @type boolean
*/ */
disabled?: boolean; disabled?: boolean;
} } & TooltipCommon
} }

5
types/popover.d.ts vendored
View File

@ -4,7 +4,8 @@
import { TooltipCommon } from './tootip/common'; import { TooltipCommon } from './tootip/common';
import { VNodeChild } from 'vue'; import { VNodeChild } from 'vue';
export declare class Popover extends TooltipCommon { import { AntdComponent } from './component';
export declare class Popover extends AntdComponent {
$props: { $props: {
/** /**
* Content of the card * Content of the card
@ -17,5 +18,5 @@ export declare class Popover extends TooltipCommon {
* @type any (string | slot | VNode) * @type any (string | slot | VNode)
*/ */
title?: VNodeChild | JSX.Element; title?: VNodeChild | JSX.Element;
} } & TooltipCommon
} }

View File

@ -3,24 +3,27 @@
// 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 TabPane extends AntdComponent { export declare class TabPane extends AntdComponent {
/** $props: {
* Forced render of content in tabs, not lazy render after clicking on tabs /**
* @default false * Forced render of content in tabs, not lazy render after clicking on tabs
* @type boolean * @default false
*/ * @type boolean
forceRender: boolean; */
forceRender?: boolean;
/** /**
* TabPane's key * TabPane's key
* @type string * @type string
*/ */
key: string; key?: string;
/** /**
* Show text in TabPane's head * Show text in TabPane's head
* @type any (string | slot) * @type any (string | slot)
*/ */
tab: any; tab?: VNodeChild | JSX.Element;
}
} }

114
types/tabs/tabs.d.ts vendored
View File

@ -4,72 +4,74 @@
import { AntdComponent } from '../component'; import { AntdComponent } from '../component';
import { TabPane } from './tab-pane'; import { TabPane } from './tab-pane';
import { CSSProperties, VNodeChild } from 'vue';
export declare class Tabs extends AntdComponent { export declare class Tabs extends AntdComponent {
static TabPane: typeof TabPane; static TabPane: typeof TabPane;
$props: {
/**
* Current TabPane's key
* @type string
*/
activeKey?: string;
/** /**
* Current TabPane's key * Whether to change tabs with animation. Only works while tabPosition="top"\|"bottom"
* @type string * @default true, false when type="card"
*/ * @type boolean | object
activeKey: string; */
animated?: boolean | { inkBar: boolean; tabPane: boolean };
/** /**
* Whether to change tabs with animation. Only works while tabPosition="top"\|"bottom" * Initial active TabPane's key, if activeKey is not set.
* @default true, false when type="card" * @type string
* @type boolean | object */
*/ defaultActiveKey?: string;
animated: boolean | { inkBar: boolean; tabPane: boolean };
/** /**
* Initial active TabPane's key, if activeKey is not set. * Hide plus icon or not. Only works while type="editable-card"
* @type string * @default false
*/ * @type boolean
defaultActiveKey: string; */
hideAdd?: boolean;
/** /**
* Hide plus icon or not. Only works while type="editable-card" * preset tab bar size
* @default false * @default 'default'
* @type boolean * @type string
*/ */
hideAdd: boolean; size?: 'default' | 'small' | 'large';
/** /**
* preset tab bar size * Extra content in tab bar
* @default 'default' * @type any
* @type string */
*/ tabBarExtraContent?: VNodeChild | JSX.Element;
size: 'default' | 'small' | 'large';
/** /**
* Extra content in tab bar * Tab bar style object
* @type any * @type object
*/ */
tabBarExtraContent: any; tabBarStyle?: CSSProperties;
/** /**
* Tab bar style object * Position of tabs
* @type object * @default 'top'
*/ * @type string
tabBarStyle: object; */
tabPosition?: 'top' | 'right' | 'bottom' | 'left';
/** /**
* Position of tabs * Basic style of tabs
* @default 'top' * @default 'line'
* @type string * @type string
*/ */
tabPosition: 'top' | 'right' | 'bottom' | 'left'; type?: 'line' | 'card' | 'editable-card';
/** /**
* Basic style of tabs * The gap between tabs
* @default 'line' * @type number
* @type string */
*/ tabBarGutter?: number;
type: 'line' | 'card' | 'editable-card'; }
/**
* The gap between tabs
* @type number
*/
tabBarGutter: number;
} }

View File

@ -2,72 +2,72 @@
// Definitions by: akki-jat <https://github.com/akki-jat> // Definitions by: akki-jat <https://github.com/akki-jat>
// Definitions: https://github.com/vueComponent/ant-design-vue/types // Definitions: https://github.com/vueComponent/ant-design-vue/types
import { AntdComponent } from '../component'; import { CSSProperties } from 'vue';
export declare type triggerType = 'hover' | 'focus' | 'click' | 'contextmenu'; export declare type triggerType = 'hover' | 'focus' | 'click' | 'contextmenu';
export declare class TooltipCommon extends AntdComponent { export declare class TooltipCommon {
/** // $props: {
* Whether the arrow is pointed at the center of target /**
* @default false * Whether the arrow is pointed at the center of target
* @type boolean * @default false
*/ * @type boolean
arrowPointAtCenter: boolean; */
arrowPointAtCenter?: boolean;
/** /**
* Whether to adjust popup placement automatically when popup is off screen * Whether to adjust popup placement automatically when popup is off screen
* @default true * @default true
* @type boolean * @type boolean
*/ */
autoAdjustOverflow: boolean | object; autoAdjustOverflow?: boolean | object;
/** /**
* Whether the floating tooltip card is visible by default * Whether the floating tooltip card is visible by default
* @default false * @default false
* @type boolean * @type boolean
*/ */
defaultVisible: boolean; defaultVisible?: boolean;
/** /**
* The DOM container of the tip, the default behavior is to create a div element in body. * The DOM container of the tip, the default behavior is to create a div element in body.
* @default () => document.body * @default () => document.body
* @type Function * @type Function
*/ */
getPopupContainer: (triggerNode: any) => any; getPopupContainer?: (triggerNode: HTMLElement) => HTMLElement;
/** /**
* Delay in seconds, before tooltip is shown on mouse enter * Delay in seconds, before tooltip is shown on mouse enter
* @default 0 * @default 0
* @type number * @type number
*/ */
mouseEnterDelay: number; mouseEnterDelay?: number;
/** /**
* Delay in seconds, before tooltip is hidden on mouse leave * Delay in seconds, before tooltip is hidden on mouse leave
* @default 0.1 * @default 0.1
* @type number * @type number
*/ */
mouseLeaveDelay: number; mouseLeaveDelay?: number;
/** /**
* Class name of the tooltip card * Class name of the tooltip card
* @type string * @type string
*/ */
overlayClassName: string; overlayClassName?: string;
/** /**
* Style of the tooltip card * Style of the tooltip card
* @type undefined * @type undefined
*/ */
overlayStyle: object; overlayStyle?: CSSProperties;
/** /**
* The position of the tooltip relative to the target, which can be one of top * The position of the tooltip relative to the target, which can be one of top
* left right bottom topLeft topRight bottomLeft bottomRight leftTop leftBottom rightTop rightBottom * left right bottom topLeft topRight bottomLeft bottomRight leftTop leftBottom rightTop rightBottom
* @default 'top' * @default 'top'
* @type string * @type string
*/ */
placement: placement?:
| 'top' | 'top'
| 'left' | 'left'
| 'right' | 'right'
@ -81,30 +81,31 @@ export declare class TooltipCommon extends AntdComponent {
| 'rightTop' | 'rightTop'
| 'rightBottom'; | 'rightBottom';
/** /**
* Tooltip trigger mode * Tooltip trigger mode
* @default 'hover' * @default 'hover'
* @type triggerType | triggerType[] * @type triggerType | triggerType[]
*/ */
trigger: triggerType | triggerType[]; trigger?: triggerType | triggerType[];
/** /**
* Whether the floating tooltip card is visible or not * Whether the floating tooltip card is visible or not
* @default false * @default false
* @type boolean * @type boolean
*/ */
visible: boolean; visible?: boolean;
/** /**
* Whether to destroy tooltip on hide * Whether to destroy tooltip on hide
* @default false * @default false
* @type boolean * @type boolean
*/ */
destroyTooltipOnHide: boolean; destroyTooltipOnHide?: boolean;
/** /**
* this value will be merged into placement's config, please refer to the settings dom-align * this value will be merged into placement's config, please refer to the settings dom-align
* @type object * @type object
*/ */
align: object; align?: unknown;
// }
} }

View File

@ -2,13 +2,16 @@
// Definitions by: akki-jat <https://github.com/akki-jat> // Definitions by: akki-jat <https://github.com/akki-jat>
// Definitions: https://github.com/vueComponent/ant-design-vue/types // Definitions: https://github.com/vueComponent/ant-design-vue/types
import Vue from 'vue'; import Vue, { VNodeChild } from 'vue';
import { AntdComponent } from '../component';
import { TooltipCommon } from './common'; import { TooltipCommon } from './common';
export declare class Tooltip extends TooltipCommon { export declare class Tooltip extends AntdComponent {
/** $props: {
* The text shown in the tooltip /**
* @type any (string | slot) * The text shown in the tooltip
*/ * @type any (string | slot)
title: any; */
title: VNodeChild | JSX.Element
} & TooltipCommon
} }