import { ChangeEvent, ForwardedRef, forwardRef, useRef } from 'react'; import { RtData, RtFormFieldNumericProps, } from '../types/rt-form-field-text.types'; import { RtFormField } from './rt-form-field'; import { RtText } from '@dpa/react-text'; import mergeRefs from 'merge-refs'; const RtDataComponent: RtData = (props) => { const localRef = useRef(null); function handleChange(e: ChangeEvent) { const v = e.target.value; let newValue = `${v}`; newValue = newValue.replaceAll('e', '').replace(/\D/g, ''); if (newValue !== v) e.target.value = newValue; props.onChange(e); } return ( ); }; export const RtFormFieldNumeric = forwardRef(function RtFormFieldNumeric( props: RtFormFieldNumericProps, ref: ForwardedRef ) { return ( ); }); RtFormFieldNumeric.displayName = 'RtFormFieldNumeric';