@@ -7,11 +7,12 @@ import { AutoHeightControl } from "comps/controls/autoHeightControl";
77import { ColumnOptionControl } from "comps/controls/optionsControl" ;
88import { styleControl } from "comps/controls/styleControl" ;
99import {
10- ResponsiveLayoutRowStyle ,
11- ResponsiveLayoutRowStyleType ,
10+ ContainerStyle ,
11+ ContainerStyleType ,
1212 ResponsiveLayoutColStyleType ,
1313 ResponsiveLayoutColStyle
1414} from "comps/controls/styleControlConstants" ;
15+
1516import { sameTypeMap , UICompBuilder , withDefault } from "comps/generators" ;
1617import { addMapChildAction } from "comps/generators/sameTypeMap" ;
1718import { NameConfigHidden , withExposingConfigs } from "comps/generators/withExposing" ;
@@ -40,14 +41,33 @@ import { EditorContext } from "comps/editorState";
4041import { disabledPropertyView , hiddenPropertyView } from "comps/utils/propertyUtils" ;
4142import { DisabledContext } from "comps/generators/uiCompBuilder" ;
4243
44+ const ContainWrapper = styled . div < {
45+ $style : ContainerStyleType | undefined ;
46+ } > `
47+ background-color: ${ ( props ) => props . $style ?. background } !important;
48+ border-radius: ${ ( props ) => props . $style ?. radius } ;
49+ border-width: ${ ( props ) => props . $style ?. borderWidth } ;
50+ border-color: ${ ( props ) => props . $style ?. border } ;
51+ border-style: ${ ( props ) => props . $style ?. borderStyle } ;
52+ rotate: ${ ( props ) => props . $style ?. rotation } ;
53+ margin: ${ ( props ) => props . $style ?. margin } ;
54+ padding: ${ ( props ) => props . $style ?. padding } ;
55+ ` ;
4356
4457const ColWrapper = styled ( Col ) < {
45- $style : ResponsiveLayoutColStyleType ,
58+ $style : ResponsiveLayoutColStyleType | undefined ,
4659 $minWidth ?: string ,
4760 $matchColumnsHeight : boolean ,
4861} > `
4962 > div {
5063 height: ${ ( props ) => props . $matchColumnsHeight ? '100%' : 'auto' } ;
64+ background-color: ${ ( props ) => props . $style ?. background } !important;
65+ border-radius: ${ ( props ) => props . $style ?. radius } ;
66+ border-width: ${ ( props ) => props . $style ?. borderWidth } ;
67+ border-color: ${ ( props ) => props . $style ?. border } ;
68+ border-style: ${ ( props ) => props . $style ?. borderStyle } ;
69+ margin: ${ ( props ) => props . $style ?. margin } ;
70+ padding: ${ ( props ) => props . $style ?. padding } ;
5171 }
5272` ;
5373
@@ -64,7 +84,8 @@ const childrenMap = {
6484 rowGap : withDefault ( StringControl , "20px" ) ,
6585 templateColumns : withDefault ( StringControl , "1fr 1fr" ) ,
6686 columnGap : withDefault ( StringControl , "20px" ) ,
67- columnStyle : withDefault ( styleControl ( ResponsiveLayoutColStyle ) , { } )
87+ style : withDefault ( styleControl ( ContainerStyle ) , { } ) ,
88+ columnStyle : withDefault ( styleControl ( ResponsiveLayoutColStyle ) , { borderWidth :'1px' } )
6889} ;
6990
7091type ViewProps = RecordConstructorToView < typeof childrenMap > ;
@@ -89,7 +110,7 @@ const ColumnContainer = (props: ColumnContainerProps) => {
89110
90111const ColumnLayout = ( props : ColumnLayoutProps ) => {
91112 let {
92- columns,
113+ columns,
93114 containers,
94115 dispatch,
95116 matchColumnsHeight,
@@ -103,15 +124,15 @@ const ColumnLayout = (props: ColumnLayoutProps) => {
103124 return (
104125 < BackgroundColorContext . Provider value = { "none" } >
105126 < DisabledContext . Provider value = { props . disabled } >
106- < div style = { { height : '100%' , backgroundColor : "pink" } } >
127+ < ContainWrapper $ style= { props . style } >
107128 < div style = { { display : "grid" , gridTemplateColumns : templateColumns , columnGap, gridTemplateRows : templateRows , rowGap} } >
108129 { columns . map ( column => {
109130 const id = String ( column . id ) ;
110131 const childDispatch = wrapDispatch ( wrapDispatch ( dispatch , "containers" ) , id ) ;
111132 if ( ! containers [ id ] ) return null
112133 const containerProps = containers [ id ] . children ;
113134
114- const columnCustomStyle = {
135+ /* const columnCustomStyle = {
115136 margin: "0",
116137 padding: !_.isEmpty(column.padding) ? column.padding : "0",
117138 radius: "0",
@@ -121,16 +142,16 @@ const ColumnLayout = (props: ColumnLayoutProps) => {
121142 backgroundImage: "linear-gradient(to bottom, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 1) 100%), linear-gradient(to bottom, rgba(253, 246, 199, 1) 0%, rgba(253, 246, 199, 1) 100%)",
122143 backgroundClip: "content-box, padding-box",
123144
124- }
145+ } */
125146 const noOfColumns = columns . length ;
126- let backgroundStyle = columnCustomStyle . background ;
147+ /* let backgroundStyle = columnCustomStyle.background;
127148 if(!_.isEmpty(column.backgroundImage)) {
128149 backgroundStyle = `center / cover url('${column.backgroundImage}') no-repeat, ${backgroundStyle}`;
129- }
150+ } */
130151 return (
131152 < ColWrapper
132153 key = { id }
133- $style = { columnCustomStyle }
154+ $style = { props . columnStyle }
134155 $minWidth = { column . minWidth }
135156 $matchColumnsHeight = { matchColumnsHeight }
136157 >
@@ -140,17 +161,14 @@ const ColumnLayout = (props: ColumnLayoutProps) => {
140161 positionParams = { containerProps . positionParams . getView ( ) }
141162 dispatch = { childDispatch }
142163 autoHeight = { props . autoHeight }
143- style = { {
144- ...columnCustomStyle ,
145- background : backgroundStyle ,
146- } }
164+ style = { columnStyle }
147165 />
148166 </ ColWrapper >
149167 )
150168 } )
151169 }
152170 </ div >
153- </ div >
171+ </ ContainWrapper >
154172 </ DisabledContext . Provider >
155173 </ BackgroundColorContext . Provider >
156174 ) ;
@@ -170,8 +188,6 @@ export const ResponsiveLayoutBaseComp = (function () {
170188 title : trans ( "responsiveLayout.column" ) ,
171189 newOptionLabel : "Column" ,
172190 } ) }
173- { children . templateColumns . propertyView ( { label : "Column Definition" } ) }
174- { children . templateRows . propertyView ( { label : "Row Definition" } ) }
175191 </ Section >
176192
177193 { ( useContext ( EditorContext ) . editorModeStatus === "logic" || useContext ( EditorContext ) . editorModeStatus === "both" ) && (
@@ -187,19 +203,29 @@ export const ResponsiveLayoutBaseComp = (function () {
187203 { children . autoHeight . getPropertyView ( ) }
188204 </ Section >
189205 < Section name = { trans ( "responsiveLayout.columnsLayout" ) } >
190- { children . matchColumnsHeight . propertyView ( {
191- label : trans ( "responsiveLayout.matchColumnsHeight" )
206+ { children . matchColumnsHeight . propertyView ( { label : trans ( "responsiveLayout.matchColumnsHeight" )
192207 } ) }
193208 { controlItem ( { } , (
194- < div style = { { marginTop : '8px' } } >
195- { trans ( "responsiveLayout.columnsSpacing" ) }
196- </ div >
209+ < div style = { { marginTop : '8px' } } > { trans ( "responsiveLayout.columnsSpacing" ) } </ div >
197210 ) ) }
211+ { children . templateColumns . propertyView ( { label : "Column Definition" } ) }
212+ { children . templateRows . propertyView ( { label : "Row Definition" } ) }
198213 { children . columnGap . propertyView ( { label : "Column Gap" } ) }
199214 { children . rowGap . propertyView ( { label : "Row Gap" } ) }
200215 </ Section >
201216 </ >
202217 ) }
218+
219+ { ( useContext ( EditorContext ) . editorModeStatus === "layout" || useContext ( EditorContext ) . editorModeStatus === "both" ) && (
220+ < >
221+ < Section name = { sectionNames . style } >
222+ { children . style . getPropertyView ( ) }
223+ </ Section >
224+ < Section name = { sectionNames . columnStyle } >
225+ { children . columnStyle . getPropertyView ( ) }
226+ </ Section >
227+ </ >
228+ ) }
203229 </ >
204230 ) ;
205231 } )
0 commit comments