UNPKG

@itwin/itwinui-react

Version:

A react component library for iTwinUI

42 lines (41 loc) 1.4 kB
import * as React from 'react'; import type { HeaderProps } from '../../../react-table/react-table.js'; import { Popover } from '../../Popover/Popover.js'; type ActionColumnProps = { columnManager?: boolean | { dropdownMenuProps: React.ComponentPropsWithoutRef<'div'> & Pick<React.ComponentPropsWithoutRef<typeof Popover>, 'visible' | 'onVisibleChange' | 'placement' | 'portal'>; }; }; /** * Action column that adds column manager to the Table header. * It is recommended to add this column to the end of the Table * and to override its `Cell` prop with your row actions menu. * @example * { * ...ActionColumn({ columnManager: true }), * Cell: () => ( * <DropdownMenu menuItems={menuItems}> * <IconButton * styleType='borderless' * onClick={(e) => e.stopPropagation()} * > * <SvgMore /> * </IconButton> * </DropdownMenu> * ), * }, */ export declare const ActionColumn: <T extends Record<string, unknown>>({ columnManager, }?: ActionColumnProps) => { id: string; disableResizing: boolean; canResize: boolean; disableGroupBy: boolean; minWidth: number; width: number; maxWidth: number; columnClassName: string; cellClassName: string; disableReordering: boolean; Header: ({ allColumns, dispatch, state }: HeaderProps<T>) => React.JSX.Element | null; }; export {};