@refinedev/antd 5.3.14 → 5.4.0

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.3.14",
3
+ "version": "5.4.0",
4
4
  "description": "refine is a React-based framework for building internal tools, rapidly. It ships with Ant Design System, an enterprise-level UI toolkit.",
5
5
  "private": false,
6
6
  "main": "dist/index.js",
@@ -5,6 +5,10 @@ import { Sider as DefaultSider } from "./sider";
5
5
  import { Header as DefaultHeader } from "./header";
6
6
  import { RefineLayoutLayoutProps } from "./types";
7
7
 
8
+ /**
9
+ * @deprecated use `<ThemedLayout>` instead with 100% backward compatibility.
10
+ * @see https://refine.dev/docs/api-reference/antd/components/antd-themed-layout
11
+ **/
8
12
  export const Layout: React.FC<RefineLayoutLayoutProps> = ({
9
13
  children,
10
14
  Header,
@@ -207,11 +207,17 @@ export const useDrawerForm = <
207
207
  setId?.(undefined);
208
208
  }, [warnWhen]);
209
209
 
210
- const handleShow = useCallback((id?: BaseKey) => {
211
- setId?.(id);
212
-
213
- show();
214
- }, []);
210
+ const handleShow = useCallback(
211
+ (showId?: BaseKey) => {
212
+ if (typeof showId !== "undefined") {
213
+ setId?.(showId);
214
+ }
215
+ if (typeof showId !== "undefined" || typeof id !== "undefined") {
216
+ show();
217
+ }
218
+ },
219
+ [id],
220
+ );
215
221
 
216
222
  return {
217
223
  ...useFormProps,
@@ -202,11 +202,17 @@ export const useModalForm = <
202
202
  sunflowerUseModal.close();
203
203
  }, [warnWhen]);
204
204
 
205
- const handleShow = useCallback((id?: BaseKey) => {
206
- setId?.(id);
207
-
208
- sunflowerUseModal.show();
209
- }, []);
205
+ const handleShow = useCallback(
206
+ (showId?: BaseKey) => {
207
+ if (typeof showId !== "undefined") {
208
+ setId?.(showId);
209
+ }
210
+ if (typeof showId !== "undefined" || typeof id !== "undefined") {
211
+ sunflowerUseModal.show();
212
+ }
213
+ },
214
+ [id],
215
+ );
210
216
 
211
217
  const { visible: _visible, ...otherModalProps } = modalProps;
212
218
  const newModalProps = { open: _visible, ...otherModalProps };