File tree Expand file tree Collapse file tree 5 files changed +13
-1
lines changed
Expand file tree Collapse file tree 5 files changed +13
-1
lines changed Original file line number Diff line number Diff line change 11{
22 "name" : " clever-components" ,
3- "version" : " 2.224 .0" ,
3+ "version" : " 2.225 .0" ,
44 "description" : " A library of helpful React components and less styles" ,
55 "repository" : {
66 "type" : " git" ,
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ export interface Props {
1212 } ;
1313 noWrap ?: boolean ;
1414 sortable ?: boolean ;
15+ tooltip ?: React . ReactNode ;
1516 sortValueFn ?: Function ;
1617 width ?: string ; // Not included in propTypes but appears to work and is commonly used.
1718}
@@ -32,6 +33,7 @@ Column.propTypes = {
3233 } ) ,
3334 noWrap : PropTypes . bool ,
3435 sortable : PropTypes . bool ,
36+ tooltip : PropTypes . node ,
3537 sortValueFn : PropTypes . func ,
3638} ;
3739
Original file line number Diff line number Diff line change @@ -41,6 +41,7 @@ export default function Header({
4141 key = { column . id }
4242 onSortChange = { ( ) => onSortChange ( column . id ) }
4343 sortable = { column . sortable && ! disableSort }
44+ tooltip = { column . tooltip ? column . tooltip : null }
4445 width = { column . width }
4546 >
4647 { column . header && column . header . content }
Original file line number Diff line number Diff line change 3636 fill : @neutral_black ;
3737 }
3838}
39+
40+ .Table--header--cell--tooltip {
41+ margin-left : 0.625rem ;
42+ cursor : pointer ;
43+ }
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ export interface Props {
1414 children ?: React . ReactNode ;
1515 onSortChange ?: Function ;
1616 sortable ?: boolean ;
17+ tooltip ?: React . ReactNode ;
1718 activeSortDirection ?: "asc" | "desc" ;
1819 width ?: string ;
1920}
@@ -24,13 +25,15 @@ export const cssClass = {
2425 LABEL : "Table--header--cell--label" ,
2526 SORTABLE : "Table--header--cell--sortable" ,
2627 SORT : "Table--header--cell--sort_icons" ,
28+ TOOLTIP : "Table--header--cell--tooltip" ,
2729} ;
2830
2931export default function HeaderCell ( {
3032 children,
3133 className,
3234 onSortChange,
3335 sortable,
36+ tooltip,
3437 activeSortDirection,
3538 width,
3639} : Props ) {
@@ -59,6 +62,7 @@ export default function HeaderCell({
5962 < SortIcons direction = { activeSortDirection } className = { cssClass . SORT } />
6063 </ div >
6164 ) }
65+ { tooltip && < div className = { cssClass . TOOLTIP } > { tooltip } </ div > }
6266 </ FlexBox >
6367 </ Cell >
6468 ) ;
You can’t perform that action at this time.
0 commit comments