import React from 'react' ; import { EnumCellProps , WithClassname } from '@jsonforms/core' ; import { MenuItem , Select } from '@mui/material' ; import merge from 'lodash/merge' ; export const MuiSelect = React . memo ( ( props ) => { const { data , className , id , enabled , uischema , path , handleChange , options , config } = props ; const appliedUiSchemaOptions = merge ( { } , config , uischema . options ) ; return ( < Select className = { className } id = { id } disabled = { ! enabled } autoFocus = { appliedUiSchemaOptions . focus } value = { data !== undefined ? data : '' } onChange = { ev => handleChange ( path , ev . target . value ) } fullWidth = { true } variant = { 'standard' } > { [ < MenuItem value = '' key = { 'empty' } / > ] . concat ( options . map ( optionValue => ( < MenuItem value = { optionValue . value } key = { optionValue . value } > { optionValue . label } < /MenuItem>)))} < /Select>); } ) ;