UNPKG

@minimaltech/ra-infra

Version:

Minimal Technology ReactJS Infrastructure

23 lines 829 B
import { jsx as _jsx } from "react/jsx-runtime"; import React from 'react'; import { TextField } from '@mui/material'; import { PatternFormat } from 'react-number-format'; const Ref = (props, ref) => { const { onChange, ...other } = props; return (_jsx(PatternFormat, { ...other, getInputRef: ref, onKeyUp: (e) => { onChange?.({ target: { name: props.name, value: e.target.value?.replace(/,/g, ''), }, }); }, format: "##:##:##" })); }; const TimeCustomFormat = React.forwardRef(Ref); export const TimeField = props => { return (_jsx(TextField, { ...props, InputProps: { ...(props?.InputProps ?? {}), inputComponent: TimeCustomFormat, } })); }; //# sourceMappingURL=TimeField.js.map