mirror of
https://github.com/element-plus/element-plus.git
synced 2026-03-13 07:51:17 +08:00
* feat(types): [utils] add ExtractPublicPropTypes type * feat(types): [components] add props public type * chore(types): use type-only import for Prop from 'vue' Co-authored-by: Noblet Ouways <91417411+Dsaquel@users.noreply.github.com> --------- Co-authored-by: Noblet Ouways <91417411+Dsaquel@users.noreply.github.com>
47 lines
1.3 KiB
TypeScript
47 lines
1.3 KiB
TypeScript
import { buildProps } from '@element-plus/utils'
|
|
import { createModelToggleComposable } from '@element-plus/hooks'
|
|
import { popperArrowProps, popperProps } from '@element-plus/components/popper'
|
|
import { useTooltipContentProps } from './content'
|
|
import { useTooltipTriggerProps } from './trigger'
|
|
|
|
import type Tooltip from './tooltip.vue'
|
|
import type { ExtractPropTypes, __ExtractPublicPropTypes } from 'vue'
|
|
|
|
export const {
|
|
useModelToggleProps: useTooltipModelToggleProps,
|
|
useModelToggleEmits: useTooltipModelToggleEmits,
|
|
useModelToggle: useTooltipModelToggle,
|
|
} = createModelToggleComposable('visible' as const)
|
|
|
|
export const useTooltipProps = buildProps({
|
|
...popperProps,
|
|
...useTooltipModelToggleProps,
|
|
...useTooltipContentProps,
|
|
...useTooltipTriggerProps,
|
|
...popperArrowProps,
|
|
/**
|
|
* @description whether the tooltip content has an arrow
|
|
*/
|
|
showArrow: {
|
|
type: Boolean,
|
|
default: true,
|
|
},
|
|
})
|
|
|
|
export const tooltipEmits = [
|
|
...useTooltipModelToggleEmits,
|
|
'before-show',
|
|
'before-hide',
|
|
'show',
|
|
'hide',
|
|
'open',
|
|
'close',
|
|
]
|
|
|
|
export type ElTooltipProps = ExtractPropTypes<typeof useTooltipProps>
|
|
export type ElTooltipPropsPublic = __ExtractPublicPropTypes<
|
|
typeof useTooltipProps
|
|
>
|
|
|
|
export type TooltipInstance = InstanceType<typeof Tooltip> & unknown
|