import React from 'react' ; import { FieldProps , Widget , WidgetProps } from '@rjsf/core' ; import Select from '../Select' ; import Slider from '../Slider' ; const SelectWidget = ( { options , onChange , value , onBlur , defaultValue , tabIndex , onFocus , 'aria-invalid' : ariaInvalid , ... rest } ) => ( < Select < { label : string ; value : string ; } > options = { options . enumOptions as { label : string ; value : string ; } [ ] } onChange = { ( option ) => { onChange ( option ?. value ) ; } } value = { ( options . enumOptions as { label : string ; value : string ; } [ ] ) . find ( ( option ) => option . value === value ) } { ... rest } />); const RangeWidget = ( ( { schema , disabled , label , options , formContext , registry , ... rest } ) => ( < Slider { ... rest } disabled = { disabled } min = { schema . minimum } max = { schema . maximum } withValue />) as unknown) as Widget; export default { SelectWidget , RangeWidget } ;