Skip to content

Commit dc454aa

Browse files
committed
make tooltip ReactNode and add tooltipProps to Th
1 parent 7c595dd commit dc454aa

File tree

5 files changed

+5
-4
lines changed

5 files changed

+5
-4
lines changed

packages/react-table/src/components/Table/SelectColumn.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export interface SelectColumnProps {
1313
onSelect?: (event: React.FormEvent<HTMLInputElement>) => void;
1414
selectVariant?: RowSelectVariant;
1515
/** text to display on the tooltip */
16-
tooltip?: string;
16+
tooltip?: React.ReactNode;
1717
/** other props to pass to the tooltip */
1818
tooltipProps?: Omit<TooltipProps, 'content'>;
1919
}

packages/react-table/src/components/Table/SortColumn.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export interface SortColumnProps extends React.ButtonHTMLAttributes<HTMLButtonEl
1818
isSortedBy?: boolean;
1919
onSort?: Function;
2020
sortDirection?: string;
21-
tooltip?: string;
21+
tooltip?: React.ReactNode;
2222
tooltipProps?: Omit<TooltipProps, 'content'>;
2323
tooltipHasDefaultBehavior?: boolean;
2424
}

packages/react-table/src/components/Table/TableText.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export interface TableTextProps extends React.HTMLProps<HTMLDivElement> {
2626
/** Determines which wrapping modifier to apply to the table text */
2727
wrapModifier?: WrapModifier | 'wrap' | 'nowrap' | 'truncate' | 'breakWord' | 'fitContent';
2828
/** text to display on the tooltip */
29-
tooltip?: string;
29+
tooltip?: React.ReactNode;
3030
/** other props to pass to the tooltip */
3131
tooltipProps?: Omit<TooltipProps, 'content'>;
3232
/** callback used to create the tooltip if text is truncated */

packages/react-table/src/components/Table/TableTypes.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ export interface IExtra extends IExtraData {
132132
rowData?: IRowData;
133133
className?: string;
134134
ariaLabel?: string;
135-
tooltip?: string;
135+
tooltip?: React.ReactNode;
136136
tooltipProps?: Omit<TooltipProps, 'content'>;
137137
tooltipHasDefaultBehavior?: boolean;
138138
}

packages/react-table/src/components/Table/Th.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,7 @@ const ThBase: React.FunctionComponent<ThProps> = ({
225225
triggerRef={cellRef as React.RefObject<any>}
226226
content={tooltip || (tooltip === '' && children)}
227227
isVisible
228+
{...tooltipProps}
228229
/>
229230
</>
230231
) : (

0 commit comments

Comments
 (0)