@@ -20,6 +20,9 @@ import { ButtonEventHandlerControl, CardEventHandlerControl, clickEvent, refresh
20
20
import { optionsControl } from "comps/controls/optionsControl" ;
21
21
import { dropdownControl } from "comps/controls/dropdownControl" ;
22
22
import { styleControl } from "comps/controls/styleControl" ;
23
+ import { ThemeContext } from "@lowcoder-ee/comps/utils/themeContext" ;
24
+ import { CompTypeContext } from "@lowcoder-ee/comps/utils/compTypeContext" ;
25
+ import { setInitialCompStyles } from "@lowcoder-ee/comps/utils/themeUtil" ;
23
26
const { Meta } = Card ;
24
27
25
28
const Wrapper = styled . div < {
@@ -186,13 +189,30 @@ export const ContainerBaseComp = (function () {
186
189
actionOptions : ActionOptionControl ,
187
190
188
191
onEvent : CardEventHandlerControl ,
189
- style : styleControl ( CardStyle ) ,
190
- headerStyle : styleControl ( CardHeaderStyle ) ,
191
- bodyStyle : styleControl ( CardHeaderStyle ) ,
192
- animationStyle : styleControl ( AnimationStyle ) ,
192
+ style : styleControl ( CardStyle , 'style' ) ,
193
+ headerStyle : styleControl ( CardHeaderStyle , 'headerStyle' ) ,
194
+ bodyStyle : styleControl ( CardHeaderStyle , 'bodyStyle' ) ,
195
+ animationStyle : styleControl ( AnimationStyle , 'animationStyle' ) ,
193
196
} ;
194
197
195
198
return new ContainerCompBuilder ( childrenMap , ( props , dispatch ) => {
199
+
200
+ const theme = useContext ( ThemeContext ) ;
201
+ const compType = useContext ( CompTypeContext ) ;
202
+ const compTheme = theme ?. theme ?. components ?. [ compType ] ;
203
+ const styleProps : Record < string , any > = { } ;
204
+ [ 'style' , 'headerStyle' , 'bodyStyle' , 'animationStyle' ] . forEach ( ( key : string ) => {
205
+ styleProps [ key ] = ( props as any ) [ key ] ;
206
+ } ) ;
207
+
208
+ useEffect ( ( ) => {
209
+ setInitialCompStyles ( {
210
+ dispatch,
211
+ compTheme,
212
+ styleProps,
213
+ } ) ;
214
+ } , [ ] ) ;
215
+
196
216
props . container . showHeader = false ;
197
217
// 注入容器参数
198
218
props . container . style = Object . assign ( props . container . style , {
0 commit comments