|
|
@ -1,16 +1,14 @@ |
|
|
|
import { OutlinedInputProps } from '@mui/material'; |
|
|
|
import { OutlinedInputProps } from '@mui/material'; |
|
|
|
import { FormikValues, useFormik } from 'formik'; |
|
|
|
import { FormikConfig, FormikValues, useFormik } from 'formik'; |
|
|
|
import { useCallback, useMemo } from 'react'; |
|
|
|
import { useCallback, useMemo } from 'react'; |
|
|
|
|
|
|
|
|
|
|
|
import debounce from '../lib/debounce'; |
|
|
|
import debounce from '../lib/debounce'; |
|
|
|
import getFormikErrorMessages from '../lib/getFormikErrorMessages'; |
|
|
|
import getFormikErrorMessages from '../lib/getFormikErrorMessages'; |
|
|
|
|
|
|
|
|
|
|
|
const useFormikUtils = <Values extends FormikValues = FormikValues>( |
|
|
|
const useFormikUtils = <Values extends FormikValues = FormikValues>( |
|
|
|
...formikArgs: Parameters<UseFormik<Values>> |
|
|
|
formikConfig: FormikConfig<Values>, |
|
|
|
): FormikUtils<Values> => { |
|
|
|
): FormikUtils<Values> => { |
|
|
|
const [formikConfig, ...restFormikArgs] = formikArgs; |
|
|
|
const formik = useFormik<Values>({ ...formikConfig }); |
|
|
|
|
|
|
|
|
|
|
|
const formik = useFormik<Values>({ ...formikConfig }, ...restFormikArgs); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const getFieldChanged = useCallback( |
|
|
|
const getFieldChanged = useCallback( |
|
|
|
(field: string) => { |
|
|
|
(field: string) => { |
|
|
|