@refinedev/antd 5.46.1 → 5.46.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@refinedev/antd",
3
- "version": "5.46.1",
3
+ "version": "5.46.2",
4
4
  "private": false,
5
5
  "description": "Ant Design UI support for Refine, offering enterprise-level UI components.",
6
6
  "repository": {
@@ -47,7 +47,7 @@
47
47
  "devDependencies": {
48
48
  "@esbuild-plugins/node-resolve": "^0.1.4",
49
49
  "@refinedev/cli": "^2.16.46",
50
- "@refinedev/core": "^4.57.9",
50
+ "@refinedev/core": "^4.57.10",
51
51
  "@refinedev/ui-tests": "^1.15.1",
52
52
  "@testing-library/jest-dom": "^5.16.4",
53
53
  "@testing-library/react": "^13.1.1",
@@ -89,6 +89,7 @@ export type UseModalFormProps<
89
89
  defaultVisible?: boolean;
90
90
  autoSubmitClose?: boolean;
91
91
  autoResetForm?: boolean;
92
+ autoResetFormWhenClose?: boolean;
92
93
  };
93
94
  /**
94
95
  * `useModalForm` hook allows you to manage a form within a modal. It returns Ant Design {@link https://ant.design/components/form/ Form} and {@link https://ant.design/components/modal/ Modal} components props.
@@ -113,6 +114,7 @@ export const useModalForm = <
113
114
  defaultVisible = false,
114
115
  autoSubmitClose = true,
115
116
  autoResetForm = true,
117
+ autoResetFormWhenClose = true,
116
118
  autoSave,
117
119
  invalidates,
118
120
  ...rest
@@ -291,6 +293,10 @@ export const useModalForm = <
291
293
 
292
294
  setId?.(undefined);
293
295
  sunflowerUseModal.close();
296
+
297
+ if (autoResetFormWhenClose) {
298
+ form.resetFields();
299
+ }
294
300
  }, [warnWhen, autoSaveProps.status]);
295
301
 
296
302
  const handleShow = useCallback(