import { FocusEvent } from 'react'; import { NumberInput, NumberDecrementStepper, NumberIncrementStepper, NumberInputField, NumberInputStepper, FormControl, FormLabel, } from '@chakra-ui/react'; import { ariaDescribedByIds, labelValue, FormContextType, RJSFSchema, StrictRJSFSchema, WidgetProps, } from '@rjsf/utils'; import { getChakra } from '../utils'; export default function UpDownWidget( props: WidgetProps ) { const { id, uiSchema, readonly, disabled, label, hideLabel, value, onChange, onBlur, onFocus, rawErrors, required } = props; const chakraProps = getChakra({ uiSchema }); const _onChange = (value: string | number) => onChange(value); const _onBlur = ({ target: { value } }: FocusEvent) => onBlur(id, value); const _onFocus = ({ target: { value } }: FocusEvent) => onFocus(id, value); return ( 0} > {labelValue({label}, hideLabel || !label)} (id)} > ); }