File tree Expand file tree Collapse file tree 4 files changed +20
-6
lines changed Expand file tree Collapse file tree 4 files changed +20
-6
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @devtron-labs/devtron-fe-common-lib" ,
3
- "version" : " 0.1.13-beta-6 " ,
3
+ "version" : " 0.1.13-beta-7 " ,
4
4
"description" : " Supporting common component library" ,
5
5
"type" : " module" ,
6
6
"main" : " dist/index.js" ,
Original file line number Diff line number Diff line change 14
14
* limitations under the License.
15
15
*/
16
16
17
+ import Tippy from '@tippyjs/react'
17
18
import { ReactComponent as SortIcon } from '../../Assets/Icon/ic-arrow-up-down.svg'
18
19
import { ReactComponent as SortArrowDown } from '../../Assets/Icon/ic-sort-arrow-down.svg'
19
20
import { SortingOrder } from '../Constants'
@@ -41,6 +42,7 @@ const SortableTableHeaderCell = ({
41
42
title,
42
43
disabled,
43
44
isSortable = true ,
45
+ showTippy = false ,
44
46
} : SortableTableHeaderCellProps ) => {
45
47
const renderSortIcon = ( ) => {
46
48
if ( ! isSortable ) {
@@ -50,22 +52,30 @@ const SortableTableHeaderCell = ({
50
52
if ( isSorted ) {
51
53
return (
52
54
< SortArrowDown
53
- className = { `icon-dim-12 mw-12 scn-7 dc__transition--transform ${ sortOrder === SortingOrder . DESC ? 'dc__flip-180' : '' } ` }
55
+ className = { `icon-dim-12 mw-12 scn-7 dc__no-shrink dc__transition--transform ${ sortOrder === SortingOrder . DESC ? 'dc__flip-180' : '' } ` }
54
56
/>
55
57
)
56
58
}
57
59
58
- return < SortIcon className = "icon-dim-12 mw-12 scn-7" />
60
+ return < SortIcon className = "icon-dim-12 mw-12 scn-7 dc__no-shrink " />
59
61
}
60
62
63
+ const renderTitle = ( ) => < span className = "dc__uppercase dc__truncate" > { title } </ span >
64
+
61
65
return (
62
66
< button
63
67
type = "button"
64
68
className = "dc__transparent p-0 bcn-0 cn-7 flex dc__content-start dc__gap-4 dc__select-text"
65
69
onClick = { isSortable ? triggerSorting : noop }
66
70
disabled = { disabled }
67
71
>
68
- < span className = "dc__uppercase dc__truncate" > { title } </ span >
72
+ { showTippy ? (
73
+ < Tippy arrow = { false } content = { title } className = "default-tt dc__mxw-200 dc__word-break" >
74
+ { renderTitle ( ) }
75
+ </ Tippy >
76
+ ) : (
77
+ renderTitle ( )
78
+ ) }
69
79
{ renderSortIcon ( ) }
70
80
</ button >
71
81
)
Original file line number Diff line number Diff line change @@ -44,4 +44,8 @@ export interface SortableTableHeaderCellProps {
44
44
* @default true
45
45
*/
46
46
isSortable ?: boolean
47
+ /**
48
+ * @default - false
49
+ */
50
+ showTippy ?: boolean
47
51
}
You can’t perform that action at this time.
0 commit comments