import React from 'react' ; import { ControlProps , isEnumControl , OwnPropsOfEnum , RankedTester , rankWith , } from '@jsonforms/core' ; import { withJsonFormsEnumProps } from '@jsonforms/react' ; import { MuiSelect } from '../mui-controls/MuiSelect' ; import merge from 'lodash/merge' ; import { MaterialInputControl } from './MaterialInputControl' ; import { MuiAutocomplete , WithOptionLabel } from '../mui-controls/MuiAutocomplete' ; export const MaterialEnumControl = ( props ) => { const { config , uischema } = props ; const appliedUiSchemaOptions = merge ( { } , config , uischema . options ) ; return ( < MaterialInputControl { ... props } input = { appliedUiSchemaOptions . autocomplete === false ? MuiSelect : MuiAutocomplete } / > ) ; } ; export const materialEnumControlTester = rankWith ( 2 , isEnumControl ) ; export default withJsonFormsEnumProps ( MaterialEnumControl ) ;