| @@ -28,7 +28,7 @@ import { DemoItem } from "@mui/x-date-pickers/internals/demo"; | |||||
| import { DatePicker } from "@mui/x-date-pickers/DatePicker"; | import { DatePicker } from "@mui/x-date-pickers/DatePicker"; | ||||
| import dayjs from "dayjs"; | import dayjs from "dayjs"; | ||||
| import { useCallback, useEffect, useState } from "react"; | import { useCallback, useEffect, useState } from "react"; | ||||
| import { Check, Close } from "@mui/icons-material"; | |||||
| import { Check, Close, RestartAlt } from "@mui/icons-material"; | |||||
| import { NumericFormat, NumericFormatProps } from "react-number-format"; | import { NumericFormat, NumericFormatProps } from "react-number-format"; | ||||
| import * as React from "react"; | import * as React from "react"; | ||||
| @@ -172,6 +172,12 @@ const CustomInputForm: React.FC<CustomInputFormProps> = ({ | |||||
| // setToDate(null); | // setToDate(null); | ||||
| }; | }; | ||||
| const handleReset = () => { | |||||
| reset(); | |||||
| setDateObj(null); | |||||
| setValue({}); | |||||
| }; | |||||
| fieldLists.forEach((list) => { | fieldLists.forEach((list) => { | ||||
| list.forEach((obj) => { | list.forEach((obj) => { | ||||
| if ( | if ( | ||||
| @@ -490,6 +496,13 @@ const CustomInputForm: React.FC<CustomInputFormProps> = ({ | |||||
| </Box> | </Box> | ||||
| ))} | ))} | ||||
| <Stack direction="row" justifyContent="flex-end" gap={1}> | <Stack direction="row" justifyContent="flex-end" gap={1}> | ||||
| <Button | |||||
| variant="text" | |||||
| startIcon={<RestartAlt />} | |||||
| onClick={handleReset} | |||||
| > | |||||
| {t("Reset")} | |||||
| </Button> | |||||
| <Button | <Button | ||||
| variant="outlined" | variant="outlined" | ||||
| startIcon={<Close />} | startIcon={<Close />} | ||||