|
|
@ -1,6 +1,6 @@ |
|
|
|
import React from 'react'; |
|
|
|
import React from 'react'; |
|
|
|
import { Fragment } from 'react'; |
|
|
|
import { Fragment } from 'react'; |
|
|
|
import { OverlayTrigger, Tooltip, Popover } from 'react-bootstrap'; |
|
|
|
import { OverlayTrigger, Popover } from 'react-bootstrap'; |
|
|
|
import { CustomTooltipType } from '../../types/customtooltip' |
|
|
|
import { CustomTooltipType } from '../../types/customtooltip' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -8,7 +8,7 @@ export function CustomTooltip({ children, placement, tooltipId, tooltipClasses, |
|
|
|
|
|
|
|
|
|
|
|
if (typeof tooltipText !== 'string') { |
|
|
|
if (typeof tooltipText !== 'string') { |
|
|
|
const newTooltipText = React.cloneElement(tooltipText, { |
|
|
|
const newTooltipText = React.cloneElement(tooltipText, { |
|
|
|
className: " bg-secondary text-danger text-wrap " |
|
|
|
className: " bg-secondary text-wrap " |
|
|
|
}) |
|
|
|
}) |
|
|
|
tooltipText = newTooltipText |
|
|
|
tooltipText = newTooltipText |
|
|
|
} |
|
|
|
} |
|
|
@ -19,8 +19,8 @@ export function CustomTooltip({ children, placement, tooltipId, tooltipClasses, |
|
|
|
placement={placement} |
|
|
|
placement={placement} |
|
|
|
overlay={ |
|
|
|
overlay={ |
|
|
|
<Popover id={`popover-positioned-${placement}`}> |
|
|
|
<Popover id={`popover-positioned-${placement}`}> |
|
|
|
<Popover.Content id={!tooltipId ? `${tooltipText}Tooltip` : tooltipId} style={{minWidth: "fit-content"}} className={"text-wrap bg-secondary w-100 text-success " + tooltipClasses}> |
|
|
|
<Popover.Content id={!tooltipId ? `${tooltipText}Tooltip` : tooltipId} style={{minWidth: "fit-content"}} className={"text-wrap bg-secondary w-100" + tooltipClasses}> |
|
|
|
{typeof tooltipText === 'string' ? (<span className={"text-wrap bg-secondary text-warning p-1 " + {tooltipTextClasses}}>{tooltipText}</span>) : (tooltipText)} |
|
|
|
{typeof tooltipText === 'string' ? (<span className={"text-wrap bg-secondary p-1 " + {tooltipTextClasses}}>{tooltipText}</span>) : (tooltipText)} |
|
|
|
</Popover.Content> |
|
|
|
</Popover.Content> |
|
|
|
</Popover> |
|
|
|
</Popover> |
|
|
|
} |
|
|
|
} |
|
|
|