@@ -18,17 +18,20 @@ import {
18
18
import { ContextContainerComp } from "./contextContainerComp" ;
19
19
import { ListViewImplComp } from "./listViewComp" ;
20
20
import { getCurrentItemParams , getData } from "./listViewUtils" ;
21
+ import { useMergeCompStyles } from "@lowcoder-ee/util/hooks" ;
21
22
import { childrenToProps } from "@lowcoder-ee/comps/generators/multi" ;
22
23
import { AnimationStyleType } from "@lowcoder-ee/comps/controls/styleControlConstants" ;
23
24
24
- const ListViewWrapper = styled . div < { $style : any ; $paddingWidth : string , $animationStyle :AnimationStyleType } > `
25
+ const ListViewWrapper = styled . div < { $style : any ; $paddingWidth : string , $animationStyle :AnimationStyleType , $autoHeight : boolean } > `
25
26
height: 100%;
27
+ overflow: ${ ( props ) => ( ! props . $autoHeight ? "scroll" : "hidden" ) } ;
26
28
border: 1px solid ${ ( props ) => props . $style . border } ;
27
29
border-radius: ${ ( props ) => props . $style . radius } ;
28
30
padding: 3px ${ ( props ) => props . $paddingWidth } ;
29
31
rotate: ${ ( props ) => props . $style . rotation } ;
30
32
background-color: ${ ( props ) => props . $style . background } ;
31
33
${ props => props . $animationStyle }
34
+
32
35
` ;
33
36
34
37
const FooterWrapper = styled . div `
@@ -190,7 +193,7 @@ export function ListView(props: Props) {
190
193
const horizontalGridCells = useMemo ( ( ) => children . horizontalGridCells . getView ( ) , [ children . horizontalGridCells ] ) ;
191
194
const autoHeight = useMemo ( ( ) => children . autoHeight . getView ( ) , [ children . autoHeight ] ) ;
192
195
const showHorizontalScrollbar = useMemo ( ( ) => children . showHorizontalScrollbar . getView ( ) , [ children . showHorizontalScrollbar ] ) ;
193
- const showVerticalScrollbar = useMemo ( ( ) => children . showVerticalScrollbar . getView ( ) , [ children . showVerticalScrollbar ] ) ;
196
+ const showVerticalScrollbar = useMemo ( ( ) => children . showVerticalScrollbar . getView ( ) , [ children . showVerticalScrollbar ] )
194
197
const horizontal = useMemo ( ( ) => children . horizontal . getView ( ) , [ children . horizontal ] ) ;
195
198
const minHorizontalWidth = useMemo ( ( ) => children . minHorizontalWidth . getView ( ) , [ children . minHorizontalWidth ] ) ;
196
199
const noOfColumns = useMemo (
@@ -284,12 +287,14 @@ export function ListView(props: Props) {
284
287
285
288
const childrenProps = childrenToProps ( comp . children ) ;
286
289
290
+ useMergeCompStyles ( childrenProps , comp . dispatch ) ;
291
+
287
292
// log.debug("renders: ", renders);
288
293
return (
289
294
< BackgroundColorContext . Provider value = { style . background } >
290
- < ListViewWrapper $style = { style } $paddingWidth = { paddingWidth } $animationStyle = { animationStyle } >
295
+ < ListViewWrapper $style = { style } $paddingWidth = { paddingWidth } $animationStyle = { animationStyle } $autoHeight = { autoHeight } >
291
296
< BodyWrapper ref = { ref } $autoHeight = { autoHeight } >
292
- < ScrollBar style = { { height : autoHeight ? "auto" : "100%" , margin : "0px" , padding : "0px" } } hideScrollbar = { horizontal ? ! showHorizontalScrollbar : ! showVerticalScrollbar } overflow = { autoHeight ? horizontal ? 'scroll' : 'hidden' : 'scroll' } >
297
+ < ScrollBar style = { { height : autoHeight ? "auto" : "100%" , margin : "0px" , padding : "0px" } } hideScrollbar = { horizontal ? ! showHorizontalScrollbar : ! showVerticalScrollbar } overflow = { autoHeight ? horizontal ? 'scroll' : 'hidden' : 'scroll' } >
293
298
< ReactResizeDetector
294
299
onResize = { ( width ?: number , height ?: number ) => {
295
300
if ( height ) setListHeight ( height ) ;
@@ -315,3 +320,4 @@ export function ListView(props: Props) {
315
320
</ BackgroundColorContext . Provider >
316
321
) ;
317
322
}
323
+
0 commit comments