diff --git a/src/ui/components/ContextMenu.js b/src/ui/components/ContextMenu.js index 604ee6893..1aae92bbd 100644 --- a/src/ui/components/ContextMenu.js +++ b/src/ui/components/ContextMenu.js @@ -9,7 +9,7 @@ import * as React from 'react'; import FlexColumn from './FlexColumn.js'; import PropTypes from 'prop-types'; -type MenuTemplate = Array; +export type MenuTemplate = Array; type Props = { /** List of items in the context menu. Used for static menus. */ diff --git a/src/ui/components/table/ManagedTable.js b/src/ui/components/table/ManagedTable.js index 544422935..44c1ca507 100644 --- a/src/ui/components/table/ManagedTable.js +++ b/src/ui/components/table/ManagedTable.js @@ -16,6 +16,8 @@ import type { TableOnAddFilter, } from './types.js'; +import type {MenuTemplate} from '../ContextMenu.js'; + import React from 'react'; import styled from '../../styled/index.js'; import AutoSizer from 'react-virtualized-auto-sizer'; @@ -106,6 +108,10 @@ export type ManagedTableProps = {| * Rows that are highlighted initially. */ highlightedRows?: Set, + /** + * Allows to create context menu items for rows + */ + buildContextMenuItems?: () => MenuTemplate, |}; type ManagedTableState = {| @@ -541,7 +547,11 @@ class ManagedTable extends React.Component< ) : ( {({width, height}) => ( - +