@@ -42,8 +42,20 @@ import { disabledPropertyView, hiddenPropertyView } from "comps/utils/propertyUt
42
42
import { DisabledContext } from "comps/generators/uiCompBuilder" ;
43
43
44
44
const ContainWrapper = styled . div < {
45
- $style : ContainerStyleType | undefined ;
45
+ $style : ContainerStyleType & {
46
+ display : string ,
47
+ gridTemplateColumns : string ,
48
+ columnGap : string ,
49
+ gridTemplateRows : string ,
50
+ rowGap : string ,
51
+ } | undefined ;
46
52
} > `
53
+ display: ${ ( props ) => props . $style ?. display } ;
54
+ grid-template-columns: ${ ( props ) => props . $style ?. gridTemplateColumns } ;
55
+ grid-template-rows: ${ ( props ) => props . $style ?. gridTemplateRows } ;
56
+ column-gap: ${ ( props ) => props . $style ?. columnGap } ;
57
+ row-gap: ${ ( props ) => props . $style ?. rowGap } ;
58
+
47
59
background-color: ${ ( props ) => props . $style ?. background } !important;
48
60
border-radius: ${ ( props ) => props . $style ?. radius } ;
49
61
border-width: ${ ( props ) => props . $style ?. borderWidth } ;
@@ -59,7 +71,7 @@ const ColWrapper = styled(Col)<{
59
71
$matchColumnsHeight : boolean ,
60
72
} > `
61
73
> div {
62
- height: ${ ( props ) => props . $matchColumnsHeight ? ' 100%' : 'auto' } ;
74
+ height: ${ ( props ) => props . $matchColumnsHeight ? `calc( 100% - ${ props . $style ?. padding || 0 } - ${ props . $style ?. padding || 0 } )` : 'auto' } ;
63
75
background-color: ${ ( props ) => props . $style ?. background } !important;
64
76
border-radius: ${ ( props ) => props . $style ?. radius } ;
65
77
border-width: ${ ( props ) => props . $style ?. borderWidth } ;
@@ -121,17 +133,24 @@ const ColumnLayout = (props: ColumnLayoutProps) => {
121
133
} = props ;
122
134
123
135
return (
124
- < BackgroundColorContext . Provider value = { "none" } >
136
+ < BackgroundColorContext . Provider value = { props . style . background } >
125
137
< DisabledContext . Provider value = { props . disabled } >
126
- < ContainWrapper $style = { props . style } >
127
- < div style = { { display : "grid" , gridTemplateColumns : templateColumns , columnGap, gridTemplateRows : templateRows , rowGap} } >
128
- { columns . map ( column => {
129
- const id = String ( column . id ) ;
130
- const childDispatch = wrapDispatch ( wrapDispatch ( dispatch , "containers" ) , id ) ;
131
- if ( ! containers [ id ] ) return null
132
- const containerProps = containers [ id ] . children ;
133
- const noOfColumns = columns . length ;
134
- return (
138
+ < ContainWrapper $style = { {
139
+ ...props . style ,
140
+ display : "grid" ,
141
+ gridTemplateColumns : templateColumns ,
142
+ columnGap,
143
+ gridTemplateRows : templateRows ,
144
+ rowGap,
145
+ } } >
146
+ { columns . map ( column => {
147
+ const id = String ( column . id ) ;
148
+ const childDispatch = wrapDispatch ( wrapDispatch ( dispatch , "containers" ) , id ) ;
149
+ if ( ! containers [ id ] ) return null
150
+ const containerProps = containers [ id ] . children ;
151
+ const noOfColumns = columns . length ;
152
+ return (
153
+ < BackgroundColorContext . Provider value = { props . columnStyle . background } >
135
154
< ColWrapper
136
155
key = { id }
137
156
$style = { props . columnStyle }
@@ -147,12 +166,12 @@ const ColumnLayout = (props: ColumnLayoutProps) => {
147
166
style = { columnStyle }
148
167
/>
149
168
</ ColWrapper >
150
- )
151
- } )
152
- }
153
- </ div >
169
+ </ BackgroundColorContext . Provider >
170
+ )
171
+ } )
172
+ }
154
173
</ ContainWrapper >
155
- </ DisabledContext . Provider >
174
+ </ DisabledContext . Provider >
156
175
</ BackgroundColorContext . Provider >
157
176
) ;
158
177
} ;
0 commit comments