1 | import { SetupContext, RenderFunction, Ref, ComponentPublicInstance } from 'vue'
|
2 | import { VXEComponent, VxeComponentBase, VxeEvent, SizeType, ValueOf, VNodeStyle } from './component'
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 | export const VxeTooltip: VXEComponent<VxeTooltipProps, VxeTooltipEventProps, VxeTooltipSlots>
|
11 |
|
12 |
|
13 |
|
14 | export const Tooltip: typeof VxeTooltip
|
15 |
|
16 | export type VxeTooltipInstance = ComponentPublicInstance<VxeTooltipProps, VxeTooltipConstructor>
|
17 |
|
18 | export interface VxeTooltipConstructor extends VxeComponentBase, VxeTooltipMethods {
|
19 | props: VxeTooltipProps
|
20 | context: SetupContext<VxeTooltipEmits>
|
21 | reactData: TooltipReactData
|
22 | getRefMaps(): TooltipPrivateRef
|
23 | renderVN: RenderFunction
|
24 | }
|
25 |
|
26 | export interface TooltipPrivateRef {
|
27 | refElem: Ref<HTMLDivElement>
|
28 | }
|
29 | export interface VxeTooltipPrivateRef extends TooltipPrivateRef { }
|
30 |
|
31 | export interface TooltipReactData {
|
32 | target: HTMLElement | null
|
33 | isUpdate: boolean
|
34 | visible: boolean
|
35 | tipContent: string | number | undefined,
|
36 | tipActive: boolean
|
37 | tipTarget: HTMLElement | null
|
38 | tipZindex: number
|
39 | tipStore: {
|
40 | style: VNodeStyle
|
41 | placement: any
|
42 | arrowStyle: VNodeStyle
|
43 | }
|
44 | }
|
45 |
|
46 | export namespace VxeTooltipPropTypes {
|
47 | export type Size = SizeType
|
48 | export type ModelValue = boolean
|
49 | export type Trigger = 'hover' | 'click' | 'manual' | '' | null
|
50 | export type Theme = string
|
51 | export type Content = string | number
|
52 | export type UseHTML = boolean
|
53 | export type ZIndex = string | number
|
54 | export type PopupClassName = string | ((params: { $tooltip: VxeTooltipConstructor }) => string)
|
55 | export type IsArrow = boolean
|
56 | export type Enterable = boolean
|
57 | export type EnterDelay = number
|
58 | export type LeaveDelay = number
|
59 | export type LeaveMethod = (params: { $event: MouseEvent }) => boolean
|
60 | }
|
61 |
|
62 | export type VxeTooltipProps = {
|
63 | size?: VxeTooltipPropTypes.Size
|
64 | modelValue?: VxeTooltipPropTypes.ModelValue
|
65 | trigger?: VxeTooltipPropTypes.Trigger
|
66 | theme?: VxeTooltipPropTypes.Theme
|
67 | content?: VxeTooltipPropTypes.Content
|
68 | useHTML?: VxeTooltipPropTypes.UseHTML
|
69 | popupClassName?: VxeTooltipPropTypes.PopupClassName
|
70 | zIndex?: VxeTooltipPropTypes.ZIndex
|
71 | isArrow?: VxeTooltipPropTypes.IsArrow
|
72 | enterable?: VxeTooltipPropTypes.Enterable
|
73 | enterDelay?: VxeTooltipPropTypes.EnterDelay
|
74 | leaveDelay?: VxeTooltipPropTypes.LeaveDelay
|
75 | leaveMethod?: VxeTooltipPropTypes.LeaveMethod
|
76 | }
|
77 |
|
78 | export interface TooltipMethods {
|
79 | dispatchEvent(type: ValueOf<VxeTooltipEmits>, params: any, evnt: Event): void
|
80 | |
81 |
|
82 |
|
83 |
|
84 |
|
85 | open(target?: any, content?: VxeTooltipPropTypes.Content): Promise<void>
|
86 | toVisible(target?: HTMLElement, content?: VxeTooltipPropTypes.Content): Promise<void>
|
87 | |
88 |
|
89 |
|
90 | close(): Promise<any>
|
91 | updatePlacement(): Promise<any>
|
92 | isActived(): boolean
|
93 | setActived(actived: boolean): void
|
94 | }
|
95 | export interface VxeTooltipMethods extends TooltipMethods { }
|
96 |
|
97 | export interface TooltipPrivateMethods { }
|
98 | export interface VxeTooltipPrivateMethods extends TooltipPrivateMethods { }
|
99 |
|
100 | export type VxeTooltipEmits = [
|
101 | 'update:modelValue'
|
102 | ]
|
103 |
|
104 | export namespace VxeTooltipDefines {
|
105 | export interface TooltipEventParams extends VxeEvent {
|
106 | $tooltip: VxeTooltipConstructor
|
107 | }
|
108 | }
|
109 |
|
110 | export type VxeTooltipEventProps = {
|
111 | [key: string]: any
|
112 | }
|
113 |
|
114 | export interface VxeTooltipListeners { }
|
115 |
|
116 | export namespace VxeTooltipEvents { }
|
117 |
|
118 | export interface VxeTooltipSlots {
|
119 | |
120 |
|
121 |
|
122 | [key: string]: ((params: {
|
123 | [key: string]: any
|
124 | }) => any) | undefined
|
125 | }
|