|
|
|
@ -4,7 +4,7 @@ import { useLocation } from 'react-router'; |
|
|
|
|
|
|
|
|
|
import { locationUtil, textUtil } from '@grafana/data'; |
|
|
|
|
import { SceneComponentProps, sceneGraph } from '@grafana/scenes'; |
|
|
|
|
import { Tab, useElementSelection, usePointerDistance, useStyles2 } from '@grafana/ui'; |
|
|
|
|
import { Box, Icon, Tab, Tooltip, useElementSelection, usePointerDistance, useStyles2 } from '@grafana/ui'; |
|
|
|
|
import { t } from 'app/core/internationalization'; |
|
|
|
|
|
|
|
|
|
import { useIsConditionallyHidden } from '../../conditional-rendering/useIsConditionallyHidden'; |
|
|
|
@ -66,6 +66,7 @@ export function TabItemRenderer({ model }: SceneComponentProps<TabItem>) { |
|
|
|
|
)} |
|
|
|
|
active={isActive} |
|
|
|
|
title={titleInterpolated} |
|
|
|
|
suffix={isConditionallyHidden ? IsHiddenSuffix : undefined} |
|
|
|
|
href={href} |
|
|
|
|
aria-selected={isActive} |
|
|
|
|
onPointerDown={(evt) => { |
|
|
|
@ -91,6 +92,21 @@ export function TabItemRenderer({ model }: SceneComponentProps<TabItem>) { |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function IsHiddenSuffix() { |
|
|
|
|
return ( |
|
|
|
|
<Box paddingLeft={1} display={'inline'}> |
|
|
|
|
<Tooltip |
|
|
|
|
content={t( |
|
|
|
|
'dashboard.conditional-rendering.overlay.tooltip', |
|
|
|
|
'Element is hidden due to conditional rendering.' |
|
|
|
|
)} |
|
|
|
|
> |
|
|
|
|
<Icon name="eye-slash" /> |
|
|
|
|
</Tooltip> |
|
|
|
|
</Box> |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const getStyles = () => ({ |
|
|
|
|
dragging: css({ |
|
|
|
|
cursor: 'move', |
|
|
|
|