| 1 |
import { Component } from 'react'; |
| 2 |
import { OUIAProps } from '@patternfly/react-core/dist/esm/helpers/OUIA/ouia'; |
| 3 |
import { RowWrapperProps } from '../../../components'; |
| 4 |
import { ISortBy, OnCollapse, OnExpand, OnSelect, OnRowEdit, OnSort, IActions, IActionsResolver, IAreActionsDisabled, IRow, ICell, OnFavorite, CustomActionsToggleProps } from '../../../components'; |
| 5 |
export interface TableProps extends OUIAProps { |
| 6 |
/** Adds an accessible name for the Table */ |
| 7 |
'aria-label'?: string; |
| 8 |
/** Content rendered inside the Table */ |
| 9 |
children?: React.ReactNode; |
| 10 |
/** Additional classes added to the Table */ |
| 11 |
className?: string; |
| 12 |
/** Style variant for the Table */ |
| 13 |
variant?: 'compact'; |
| 14 |
/** |
| 15 |
* Render borders |
| 16 |
* Borders can only currently be disabled if the variant is set to 'compact' |
| 17 |
* https://github.com/patternfly/patternfly/issues/3650 |
| 18 |
*/ |
| 19 |
borders?: boolean; |
| 20 |
/** Specifies the grid breakpoints */ |
| 21 |
gridBreakPoint?: '' | 'grid' | 'grid-md' | 'grid-lg' | 'grid-xl' | 'grid-2xl'; |
| 22 |
/** Specifies the initial sorting pattern for the table - asc/desc and the index of the column to sort by */ |
| 23 |
sortBy?: ISortBy; |
| 24 |
/** Function triggered when an expandable content is collapsed. When this is used, one expandable toggle button will be positioned in the first cell of a non-expandable row, preceding an expandable row */ |
| 25 |
onCollapse?: OnCollapse; |
| 26 |
/** Function triggered when a compound expandable item is clicked */ |
| 27 |
onExpand?: OnExpand; |
| 28 |
/** Function triggered when a row's checkbox is selected. When this is used, one checkbox/radio button will be positioned in the first or second cell of a non-expandable row */ |
| 29 |
onSelect?: OnSelect; |
| 30 |
/** Enables or disables the ability to select all - this is mutually exclusive with radio button select variant */ |
| 31 |
canSelectAll?: boolean; |
| 32 |
/** Enables or disables the ability to expand all */ |
| 33 |
canCollapseAll?: boolean; |
| 34 |
/** Flag indicating the select all checkbox is disabled */ |
| 35 |
isHeaderSelectDisabled?: boolean; |
| 36 |
/** Specifies the type of the select element variant - can be one of checkbox or radio button */ |
| 37 |
selectVariant?: 'checkbox' | 'radio'; |
| 38 |
/** An optional alternative aria label for the expand collapse all table header */ |
| 39 |
collapseAllAriaLabel?: string; |
| 40 |
/** Function triggered when a row's inline edit is activated. Adds a column for inline edit when present. */ |
| 41 |
onRowEdit?: OnRowEdit; |
| 42 |
/** Function triggered when sort icon is clicked */ |
| 43 |
onSort?: OnSort; |
| 44 |
/** Actions to add to the Table */ |
| 45 |
actions?: IActions; |
| 46 |
/** Resolver for the given action */ |
| 47 |
actionResolver?: IActionsResolver; |
| 48 |
/** Specifies if the Kebab for actions is disabled */ |
| 49 |
areActionsDisabled?: IAreActionsDisabled; |
| 50 |
/** Component to place in the header */ |
| 51 |
header?: React.ReactNode; |
| 52 |
/** Component used for caption*/ |
| 53 |
caption?: React.ReactNode; |
| 54 |
/** label for row */ |
| 55 |
rowLabeledBy?: string; |
| 56 |
/** ID for expand */ |
| 57 |
expandId?: string; |
| 58 |
/** ID for content */ |
| 59 |
contentId?: string; |
| 60 |
/** The desired position to show the dropdown when clicking on the actions Kebab. Can only be used together with `actions` property */ |
| 61 |
dropdownPosition?: 'right' | 'left'; |
| 62 |
/** The desired direction to show the dropdown when clicking on the actions Kebab. Can only be used together with `actions` property */ |
| 63 |
dropdownDirection?: 'up' | 'down'; |
| 64 |
/** The container to append the dropdown menu to. Defaults to 'inline'. |
| 65 |
* If your menu is being cut off you can append it to an element higher up the DOM tree. |
| 66 |
* Some examples: |
| 67 |
* actionsMenuAppendTo="parent" |
| 68 |
* actionsMenuAppendTo={() => document.body} |
| 69 |
* actionsMenuAppendTo={document.getElementById('target')} |
| 70 |
*/ |
| 71 |
actionsMenuAppendTo?: HTMLElement | (() => HTMLElement) | 'inline' | 'parent'; |
| 72 |
/** The toggle of the actions menu dropdown. A KebabToggle or DropdownToggle component */ |
| 73 |
actionsToggle?: (props: CustomActionsToggleProps) => React.ReactNode; |
| 74 |
/** Row data */ |
| 75 |
rows: (IRow | string[])[]; |
| 76 |
/** Cell/column data */ |
| 77 |
cells: (ICell | string)[]; |
| 78 |
/** Wrapper for the body */ |
| 79 |
bodyWrapper?: Function; |
| 80 |
/** Wrapper for the row */ |
| 81 |
rowWrapper?: (props: RowWrapperProps) => React.JSX.Element; |
| 82 |
/** A valid WAI-ARIA role to be applied to the table element */ |
| 83 |
role?: string; |
| 84 |
/** If set to true, the table header sticks to the top of its container */ |
| 85 |
isStickyHeader?: boolean; |
| 86 |
/** |
| 87 |
* Enables favorites column |
| 88 |
* Callback triggered when a row is favorited/unfavorited |
| 89 |
*/ |
| 90 |
onFavorite?: OnFavorite; |
| 91 |
/** Along with the onSort prop, enables favorites sorting, defaults to true */ |
| 92 |
canSortFavorites?: boolean; |
| 93 |
/** Flag indicating table is a tree table */ |
| 94 |
isTreeTable?: boolean; |
| 95 |
/** Flag indicating this table is nested within another table */ |
| 96 |
isNested?: boolean; |
| 97 |
/** Flag indicating this table is striped */ |
| 98 |
isStriped?: boolean; |
| 99 |
/** Flag indicating this table contains expandable rows to maintain proper striping */ |
| 100 |
isExpandable?: boolean; |
| 101 |
/** Value to overwrite the randomly generated data-ouia-component-id.*/ |
| 102 |
ouiaId?: number | string; |
| 103 |
/** Set the value of data-ouia-safe. Only set to true when the component is in a static state, i.e. no animations are occurring. At all other times, this value must be false. */ |
| 104 |
ouiaSafe?: boolean; |
| 105 |
} |
| 106 |
declare class Table extends Component<TableProps, {}> { |
| 107 |
static displayName: string; |
| 108 |
static hasWarnBeta: boolean; |
| 109 |
static defaultProps: Partial<TableProps>; |
| 110 |
state: { |
| 111 |
ouiaStateId: string; |
| 112 |
}; |
| 113 |
isSelected: (row: IRow) => boolean; |
| 114 |
areAllRowsSelected: (rows: IRow[]) => boolean; |
| 115 |
areAllExpanded: (rows: IRow[]) => boolean; |
| 116 |
render(): import("react/jsx-runtime").JSX.Element; |
| 117 |
} |
| 118 |
export { Table }; |
| 119 |
//# sourceMappingURL=Table.d.ts.map |