1+ import { Show } from 'solid-js'
12import { Dynamic } from 'solid-js/web'
23import { PositionedColumn } from './types'
34import { Renameable } from 'src/components/Renameable'
@@ -8,6 +9,7 @@ export interface ColumnHeaderProps<K, T> {
89 column : PositionedColumn < K , T >
910 height : number
1011 columnsEditable ?: boolean
12+ columnsResizeable ?: boolean
1113 setColumnName ?: ( id : K , name : string ) => void
1214 setColumnSize ?: ( id : K , width : number ) => void
1315 resetColumnSize ?: ( id : K ) => void
@@ -37,20 +39,22 @@ export function ColumnHeader<K, T>(props: ColumnHeaderProps<K, T>) {
3739 < Dynamic component = { props . column . icon } />
3840 </ div >
3941 </ div >
40- < ResizeBar
41- style = { {
42- position : 'absolute' ,
43- top : '0' ,
44- margin : '0 0 0 -4px' ,
45- width : '9px' ,
46- height : `${ props . height - 1 } px` ,
47- transform : `translate(${ props . column . right } px, 0px)` ,
48- 'z-index' : 10 ,
49- } }
50- size = { props . column . width }
51- setSize = { width => props . setColumnSize ?.( props . column . id , width ) }
52- resetSize = { ( ) => props . resetColumnSize ?.( props . column . id ) }
53- />
42+ < Show when = { props . columnsResizeable } >
43+ < ResizeBar
44+ style = { {
45+ position : 'absolute' ,
46+ top : '0' ,
47+ margin : '0 0 0 -4px' ,
48+ width : '9px' ,
49+ height : `${ props . height - 1 } px` ,
50+ transform : `translate(${ props . column . right } px, 0px)` ,
51+ 'z-index' : 10 ,
52+ } }
53+ size = { props . column . width }
54+ setSize = { width => props . setColumnSize ?.( props . column . id , width ) }
55+ resetSize = { ( ) => props . resetColumnSize ?.( props . column . id ) }
56+ />
57+ </ Show >
5458 </ >
5559 )
5660}
0 commit comments