mirror of
https://gitee.com/ant-design-vue/ant-design-vue.git
synced 2024-12-04 04:58:16 +08:00
chore: update type tooltip & TooltipCommon (#2742)
This commit is contained in:
parent
16575da13c
commit
8694abf14b
5
types/popconfirm.d.ts
vendored
5
types/popconfirm.d.ts
vendored
@ -4,7 +4,8 @@
|
||||
|
||||
import { TooltipCommon } from './tootip/common';
|
||||
import { VNodeChild } from 'vue';
|
||||
export declare class Popconfirm extends TooltipCommon {
|
||||
import { AntdComponent } from './component';
|
||||
export declare class Popconfirm extends AntdComponent {
|
||||
$props: {
|
||||
/**
|
||||
* text of the Cancel button
|
||||
@ -45,6 +46,6 @@ export declare class Popconfirm extends TooltipCommon {
|
||||
* @type boolean
|
||||
*/
|
||||
disabled?: boolean;
|
||||
}
|
||||
} & TooltipCommon
|
||||
|
||||
}
|
||||
|
5
types/popover.d.ts
vendored
5
types/popover.d.ts
vendored
@ -4,7 +4,8 @@
|
||||
|
||||
import { TooltipCommon } from './tootip/common';
|
||||
import { VNodeChild } from 'vue';
|
||||
export declare class Popover extends TooltipCommon {
|
||||
import { AntdComponent } from './component';
|
||||
export declare class Popover extends AntdComponent {
|
||||
$props: {
|
||||
/**
|
||||
* Content of the card
|
||||
@ -17,5 +18,5 @@ export declare class Popover extends TooltipCommon {
|
||||
* @type any (string | slot | VNode)
|
||||
*/
|
||||
title?: VNodeChild | JSX.Element;
|
||||
}
|
||||
} & TooltipCommon
|
||||
}
|
||||
|
159
types/tootip/common.d.ts
vendored
159
types/tootip/common.d.ts
vendored
@ -2,72 +2,72 @@
|
||||
// Definitions by: akki-jat <https://github.com/akki-jat>
|
||||
// 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 class TooltipCommon extends AntdComponent {
|
||||
/**
|
||||
* Whether the arrow is pointed at the center of target
|
||||
* @default false
|
||||
* @type boolean
|
||||
*/
|
||||
arrowPointAtCenter: boolean;
|
||||
export declare class TooltipCommon {
|
||||
// $props: {
|
||||
/**
|
||||
* Whether the arrow is pointed at the center of target
|
||||
* @default false
|
||||
* @type boolean
|
||||
*/
|
||||
arrowPointAtCenter?: boolean;
|
||||
|
||||
/**
|
||||
* Whether to adjust popup placement automatically when popup is off screen
|
||||
* @default true
|
||||
* @type boolean
|
||||
*/
|
||||
autoAdjustOverflow: boolean | object;
|
||||
/**
|
||||
* Whether to adjust popup placement automatically when popup is off screen
|
||||
* @default true
|
||||
* @type boolean
|
||||
*/
|
||||
autoAdjustOverflow?: boolean | object;
|
||||
|
||||
/**
|
||||
* Whether the floating tooltip card is visible by default
|
||||
* @default false
|
||||
* @type boolean
|
||||
*/
|
||||
defaultVisible: boolean;
|
||||
/**
|
||||
* Whether the floating tooltip card is visible by default
|
||||
* @default false
|
||||
* @type boolean
|
||||
*/
|
||||
defaultVisible?: boolean;
|
||||
|
||||
/**
|
||||
* The DOM container of the tip, the default behavior is to create a div element in body.
|
||||
* @default () => document.body
|
||||
* @type Function
|
||||
*/
|
||||
getPopupContainer: (triggerNode: any) => any;
|
||||
/**
|
||||
* The DOM container of the tip, the default behavior is to create a div element in body.
|
||||
* @default () => document.body
|
||||
* @type Function
|
||||
*/
|
||||
getPopupContainer?: (triggerNode: HTMLElement) => HTMLElement;
|
||||
|
||||
/**
|
||||
* Delay in seconds, before tooltip is shown on mouse enter
|
||||
* @default 0
|
||||
* @type number
|
||||
*/
|
||||
mouseEnterDelay: number;
|
||||
/**
|
||||
* Delay in seconds, before tooltip is shown on mouse enter
|
||||
* @default 0
|
||||
* @type number
|
||||
*/
|
||||
mouseEnterDelay?: number;
|
||||
|
||||
/**
|
||||
* Delay in seconds, before tooltip is hidden on mouse leave
|
||||
* @default 0.1
|
||||
* @type number
|
||||
*/
|
||||
mouseLeaveDelay: number;
|
||||
/**
|
||||
* Delay in seconds, before tooltip is hidden on mouse leave
|
||||
* @default 0.1
|
||||
* @type number
|
||||
*/
|
||||
mouseLeaveDelay?: number;
|
||||
|
||||
/**
|
||||
* Class name of the tooltip card
|
||||
* @type string
|
||||
*/
|
||||
overlayClassName: string;
|
||||
/**
|
||||
* Class name of the tooltip card
|
||||
* @type string
|
||||
*/
|
||||
overlayClassName?: string;
|
||||
|
||||
/**
|
||||
* Style of the tooltip card
|
||||
* @type undefined
|
||||
*/
|
||||
overlayStyle: object;
|
||||
/**
|
||||
* Style of the tooltip card
|
||||
* @type undefined
|
||||
*/
|
||||
overlayStyle?: CSSProperties;
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @default 'top'
|
||||
* @type string
|
||||
*/
|
||||
placement:
|
||||
/**
|
||||
* 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
|
||||
* @default 'top'
|
||||
* @type string
|
||||
*/
|
||||
placement?:
|
||||
| 'top'
|
||||
| 'left'
|
||||
| 'right'
|
||||
@ -81,30 +81,31 @@ export declare class TooltipCommon extends AntdComponent {
|
||||
| 'rightTop'
|
||||
| 'rightBottom';
|
||||
|
||||
/**
|
||||
* Tooltip trigger mode
|
||||
* @default 'hover'
|
||||
* @type triggerType | triggerType[]
|
||||
*/
|
||||
trigger: triggerType | triggerType[];
|
||||
/**
|
||||
* Tooltip trigger mode
|
||||
* @default 'hover'
|
||||
* @type triggerType | triggerType[]
|
||||
*/
|
||||
trigger?: triggerType | triggerType[];
|
||||
|
||||
/**
|
||||
* Whether the floating tooltip card is visible or not
|
||||
* @default false
|
||||
* @type boolean
|
||||
*/
|
||||
visible: boolean;
|
||||
/**
|
||||
* Whether the floating tooltip card is visible or not
|
||||
* @default false
|
||||
* @type boolean
|
||||
*/
|
||||
visible?: boolean;
|
||||
|
||||
/**
|
||||
* Whether to destroy tooltip on hide
|
||||
* @default false
|
||||
* @type boolean
|
||||
*/
|
||||
destroyTooltipOnHide: boolean;
|
||||
/**
|
||||
* Whether to destroy tooltip on hide
|
||||
* @default false
|
||||
* @type boolean
|
||||
*/
|
||||
destroyTooltipOnHide?: boolean;
|
||||
|
||||
/**
|
||||
* this value will be merged into placement's config, please refer to the settings dom-align
|
||||
* @type object
|
||||
*/
|
||||
align: object;
|
||||
/**
|
||||
* this value will be merged into placement's config, please refer to the settings dom-align
|
||||
* @type object
|
||||
*/
|
||||
align?: unknown;
|
||||
// }
|
||||
}
|
||||
|
17
types/tootip/tooltip.d.ts
vendored
17
types/tootip/tooltip.d.ts
vendored
@ -2,13 +2,16 @@
|
||||
// Definitions by: akki-jat <https://github.com/akki-jat>
|
||||
// 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';
|
||||
|
||||
export declare class Tooltip extends TooltipCommon {
|
||||
/**
|
||||
* The text shown in the tooltip
|
||||
* @type any (string | slot)
|
||||
*/
|
||||
title: any;
|
||||
export declare class Tooltip extends AntdComponent {
|
||||
$props: {
|
||||
/**
|
||||
* The text shown in the tooltip
|
||||
* @type any (string | slot)
|
||||
*/
|
||||
title: VNodeChild | JSX.Element
|
||||
} & TooltipCommon
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user