Skip to content

Commit

Permalink
make tooltip ReactNode and add tooltipProps to Th
Browse files Browse the repository at this point in the history
  • Loading branch information
kmcfaul committed Nov 8, 2023
1 parent 7c595dd commit dc454aa
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/react-table/src/components/Table/SelectColumn.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export interface SelectColumnProps {
onSelect?: (event: React.FormEvent<HTMLInputElement>) => void;
selectVariant?: RowSelectVariant;
/** text to display on the tooltip */
tooltip?: string;
tooltip?: React.ReactNode;
/** other props to pass to the tooltip */
tooltipProps?: Omit<TooltipProps, 'content'>;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/react-table/src/components/Table/SortColumn.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export interface SortColumnProps extends React.ButtonHTMLAttributes<HTMLButtonEl
isSortedBy?: boolean;
onSort?: Function;
sortDirection?: string;
tooltip?: string;
tooltip?: React.ReactNode;
tooltipProps?: Omit<TooltipProps, 'content'>;
tooltipHasDefaultBehavior?: boolean;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/react-table/src/components/Table/TableText.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export interface TableTextProps extends React.HTMLProps<HTMLDivElement> {
/** Determines which wrapping modifier to apply to the table text */
wrapModifier?: WrapModifier | 'wrap' | 'nowrap' | 'truncate' | 'breakWord' | 'fitContent';
/** text to display on the tooltip */
tooltip?: string;
tooltip?: React.ReactNode;
/** other props to pass to the tooltip */
tooltipProps?: Omit<TooltipProps, 'content'>;
/** callback used to create the tooltip if text is truncated */
Expand Down
2 changes: 1 addition & 1 deletion packages/react-table/src/components/Table/TableTypes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ export interface IExtra extends IExtraData {
rowData?: IRowData;
className?: string;
ariaLabel?: string;
tooltip?: string;
tooltip?: React.ReactNode;
tooltipProps?: Omit<TooltipProps, 'content'>;
tooltipHasDefaultBehavior?: boolean;
}
Expand Down
1 change: 1 addition & 0 deletions packages/react-table/src/components/Table/Th.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ const ThBase: React.FunctionComponent<ThProps> = ({
triggerRef={cellRef as React.RefObject<any>}
content={tooltip || (tooltip === '' && children)}
isVisible
{...tooltipProps}
/>
</>
) : (
Expand Down

0 comments on commit dc454aa

Please sign in to comment.