@@ -18,6 +18,9 @@ import { RefControl } from "comps/controls/refControl";
18
18
import { dropdownControl } from "comps/controls/dropdownControl" ;
19
19
import { useContext , useState , useEffect } from "react" ;
20
20
import { EditorContext } from "comps/editorState" ;
21
+ import { ThemeContext } from "@lowcoder-ee/comps/utils/themeContext" ;
22
+ import { setInitialCompStyles } from "@lowcoder-ee/comps/utils/themeUtil" ;
23
+ import { CompTypeContext } from "@lowcoder-ee/comps/utils/compTypeContext" ;
21
24
22
25
23
26
const sizeOptions = [
@@ -91,13 +94,29 @@ const StepsChildrenMap = {
91
94
disabled : BoolCodeControl ,
92
95
onEvent : ChangeEventHandlerControl ,
93
96
options : StepOptionControl ,
94
- style : withDefault ( styleControl ( StepsStyle ) , { text : '#D7D9E0' } ) ,
97
+ style : styleControl ( StepsStyle , 'style' ) ,
95
98
viewRef : RefControl < HTMLDivElement > ,
96
- animationStyle : styleControl ( AnimationStyle )
99
+ animationStyle : styleControl ( AnimationStyle , 'animationStyle' )
97
100
} ;
98
101
99
102
let StepControlBasicComp = ( function ( ) {
100
- return new UICompBuilder ( StepsChildrenMap , ( props ) => {
103
+ return new UICompBuilder ( StepsChildrenMap , ( props , dispatch ) => {
104
+
105
+ const theme = useContext ( ThemeContext ) ;
106
+ const compType = useContext ( CompTypeContext ) ;
107
+ const compTheme = theme ?. theme ?. components ?. [ compType ] ;
108
+ const styleProps : Record < string , any > = { } ;
109
+ [ 'style' , 'animationStyle' ] . forEach ( ( key : string ) => {
110
+ styleProps [ key ] = ( props as any ) [ key ] ;
111
+ } ) ;
112
+
113
+ useEffect ( ( ) => {
114
+ setInitialCompStyles ( {
115
+ dispatch,
116
+ compTheme,
117
+ styleProps,
118
+ } ) ;
119
+ } , [ ] ) ;
101
120
102
121
const StyledWrapper = styled . div < { style : StepsStyleType , $animationStyle : AnimationStyleType } > `
103
122
${ props => props . $animationStyle }
0 commit comments