From fc09d5a8a7c10df8b5053790e4b6fc5d3e03546b Mon Sep 17 00:00:00 2001 From: Marcus Andersson Date: Wed, 28 Sep 2022 21:35:46 +0200 Subject: [PATCH] GrafanaUI: Expose data links context types externally (#55905) --- .../src/components/DataLinks/DataLinksContextMenu.tsx | 2 +- packages/grafana-ui/src/components/index.ts | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/grafana-ui/src/components/DataLinks/DataLinksContextMenu.tsx b/packages/grafana-ui/src/components/DataLinks/DataLinksContextMenu.tsx index 1bb1236eee8a..2823c7c77c2c 100644 --- a/packages/grafana-ui/src/components/DataLinks/DataLinksContextMenu.tsx +++ b/packages/grafana-ui/src/components/DataLinks/DataLinksContextMenu.tsx @@ -9,7 +9,7 @@ import { WithContextMenu } from '../ContextMenu/WithContextMenu'; import { MenuGroup, MenuItemsGroup } from '../Menu/MenuGroup'; import { MenuItem } from '../Menu/MenuItem'; -interface DataLinksContextMenuProps { +export interface DataLinksContextMenuProps { children: (props: DataLinksContextMenuApi) => JSX.Element; links: () => LinkModel[]; style?: CSSProperties; diff --git a/packages/grafana-ui/src/components/index.ts b/packages/grafana-ui/src/components/index.ts index 5e5f3db47818..5db63c342c79 100644 --- a/packages/grafana-ui/src/components/index.ts +++ b/packages/grafana-ui/src/components/index.ts @@ -156,7 +156,11 @@ export { MenuItem, type MenuItemProps } from './Menu/MenuItem'; export { WithContextMenu } from './ContextMenu/WithContextMenu'; export { DataLinksInlineEditor } from './DataLinks/DataLinksInlineEditor/DataLinksInlineEditor'; export { DataLinkInput } from './DataLinks/DataLinkInput'; -export { DataLinksContextMenu } from './DataLinks/DataLinksContextMenu'; +export { + DataLinksContextMenu, + type DataLinksContextMenuProps, + type DataLinksContextMenuApi, +} from './DataLinks/DataLinksContextMenu'; export { SeriesIcon } from './VizLegend/SeriesIcon'; export { InfoBox } from './InfoBox/InfoBox'; export { FeatureBadge, FeatureInfoBox } from './InfoBox/FeatureInfoBox';