mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-05-12 08:19:13 +08:00
feat: add disabled support to tooltip-plus component (#7036)
This commit is contained in:
parent
11f9d2f124
commit
1a302ca957
@ -8,6 +8,7 @@ import { PortalToFollowElem, PortalToFollowElemContent, PortalToFollowElemTrigge
|
|||||||
export type TooltipProps = {
|
export type TooltipProps = {
|
||||||
position?: Placement
|
position?: Placement
|
||||||
triggerMethod?: 'hover' | 'click'
|
triggerMethod?: 'hover' | 'click'
|
||||||
|
disabled?: boolean
|
||||||
popupContent: React.ReactNode
|
popupContent: React.ReactNode
|
||||||
children: React.ReactNode
|
children: React.ReactNode
|
||||||
hideArrow?: boolean
|
hideArrow?: boolean
|
||||||
@ -23,6 +24,7 @@ const arrow = (
|
|||||||
const Tooltip: FC<TooltipProps> = ({
|
const Tooltip: FC<TooltipProps> = ({
|
||||||
position = 'top',
|
position = 'top',
|
||||||
triggerMethod = 'hover',
|
triggerMethod = 'hover',
|
||||||
|
disabled = false,
|
||||||
popupContent,
|
popupContent,
|
||||||
children,
|
children,
|
||||||
hideArrow,
|
hideArrow,
|
||||||
@ -67,7 +69,7 @@ const Tooltip: FC<TooltipProps> = ({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<PortalToFollowElem
|
<PortalToFollowElem
|
||||||
open={open}
|
open={disabled ? false : open}
|
||||||
onOpenChange={setOpen}
|
onOpenChange={setOpen}
|
||||||
placement={position}
|
placement={position}
|
||||||
offset={offset ?? 10}
|
offset={offset ?? 10}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user