chore: update type tooltip & TooltipCommon (#2742)

pull/2750/head
binhaoCen 2020-08-21 22:10:10 +08:00 committed by GitHub
parent 16575da13c
commit 8694abf14b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 96 additions and 90 deletions

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

@ -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
} }