@refinedev/antd 5.40.0 → 5.41.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.
Files changed (150) hide show
  1. package/CHANGELOG.md +79 -0
  2. package/dist/components/autoSaveIndicator/index.d.mts.map +4 -1
  3. package/dist/components/breadcrumb/index.d.mts.map +6 -1
  4. package/dist/components/buttons/clone/index.d.mts.map +11 -1
  5. package/dist/components/buttons/create/index.d.mts.map +11 -1
  6. package/dist/components/buttons/delete/index.d.mts.map +10 -1
  7. package/dist/components/buttons/edit/index.d.mts.map +11 -1
  8. package/dist/components/buttons/export/index.d.mts.map +10 -1
  9. package/dist/components/buttons/import/index.d.mts.map +11 -1
  10. package/dist/components/buttons/index.d.mts.map +12 -1
  11. package/dist/components/buttons/list/index.d.mts.map +11 -1
  12. package/dist/components/buttons/refresh/index.d.mts.map +10 -1
  13. package/dist/components/buttons/save/index.d.mts.map +10 -1
  14. package/dist/components/buttons/show/index.d.mts.map +11 -1
  15. package/dist/components/buttons/types.d.mts.map +24 -1
  16. package/dist/components/crud/create/index.d.mts.map +10 -1
  17. package/dist/components/crud/edit/index.d.mts.map +10 -1
  18. package/dist/components/crud/index.d.mts.map +6 -1
  19. package/dist/components/crud/list/index.d.mts.map +10 -1
  20. package/dist/components/crud/show/index.d.mts.map +10 -1
  21. package/dist/components/crud/types.d.mts.map +10 -1
  22. package/dist/components/fields/boolean/index.d.mts.map +9 -1
  23. package/dist/components/fields/date/index.d.mts.map +9 -1
  24. package/dist/components/fields/email/index.d.mts.map +10 -1
  25. package/dist/components/fields/file/index.d.mts.map +9 -1
  26. package/dist/components/fields/image/index.d.mts.map +9 -1
  27. package/dist/components/fields/index.d.mts.map +12 -1
  28. package/dist/components/fields/markdown/index.d.mts.map +9 -1
  29. package/dist/components/fields/number/index.d.mts.map +9 -1
  30. package/dist/components/fields/tag/index.d.mts.map +9 -1
  31. package/dist/components/fields/text/index.d.mts.map +9 -1
  32. package/dist/components/fields/types.d.mts.map +20 -1
  33. package/dist/components/fields/url/index.d.mts.map +10 -1
  34. package/dist/components/index.d.mts.map +24 -1
  35. package/dist/components/layout/header/index.d.mts.map +4 -1
  36. package/dist/components/layout/index.d.mts.map +8 -1
  37. package/dist/components/layout/sider/index.d.mts.map +4 -1
  38. package/dist/components/layout/sider/styles.d.mts.map +3 -1
  39. package/dist/components/layout/title/index.d.mts.map +4 -1
  40. package/dist/components/layout/types.d.mts.map +3 -1
  41. package/dist/components/pageHeader/index.d.cts.map +1 -1
  42. package/dist/components/pageHeader/index.d.mts.map +5 -1
  43. package/dist/components/pageHeader/index.d.ts.map +1 -1
  44. package/dist/components/pages/auth/components/forgotPassword/index.d.mts.map +12 -1
  45. package/dist/components/pages/auth/components/index.d.mts.map +5 -1
  46. package/dist/components/pages/auth/components/login/index.d.mts.map +12 -1
  47. package/dist/components/pages/auth/components/register/index.d.mts.map +12 -1
  48. package/dist/components/pages/auth/components/styles.d.mts.map +7 -1
  49. package/dist/components/pages/auth/components/updatePassword/index.d.mts.map +12 -1
  50. package/dist/components/pages/auth/index.d.mts.map +14 -1
  51. package/dist/components/pages/error/index.d.mts.map +10 -1
  52. package/dist/components/pages/index.d.mts.map +7 -1
  53. package/dist/components/pages/login/index.d.mts.map +15 -1
  54. package/dist/components/pages/login/styles.d.mts.map +6 -1
  55. package/dist/components/pages/ready/index.d.mts.map +9 -1
  56. package/dist/components/pages/welcome/index.d.mts.map +7 -1
  57. package/dist/components/table/components/filterDropdown/index.d.mts.map +16 -1
  58. package/dist/components/table/components/index.d.mts.map +3 -1
  59. package/dist/components/table/index.d.mts.map +2 -1
  60. package/dist/components/themedLayout/header/index.d.mts.map +7 -1
  61. package/dist/components/themedLayout/index.d.mts.map +7 -1
  62. package/dist/components/themedLayout/sider/index.d.mts.map +7 -1
  63. package/dist/components/themedLayout/sider/styles.d.mts.map +3 -1
  64. package/dist/components/themedLayout/title/index.d.mts.map +7 -1
  65. package/dist/components/themedLayout/types.d.mts.map +3 -1
  66. package/dist/components/themedLayoutV2/header/index.d.mts.map +4 -1
  67. package/dist/components/themedLayoutV2/index.d.mts.map +4 -1
  68. package/dist/components/themedLayoutV2/sider/index.d.cts.map +1 -1
  69. package/dist/components/themedLayoutV2/sider/index.d.mts.map +4 -1
  70. package/dist/components/themedLayoutV2/sider/index.d.ts.map +1 -1
  71. package/dist/components/themedLayoutV2/sider/styles.d.mts.map +3 -1
  72. package/dist/components/themedLayoutV2/title/index.d.mts.map +4 -1
  73. package/dist/components/themedLayoutV2/types.d.mts.map +6 -1
  74. package/dist/components/undoableNotification/index.d.mts.map +10 -1
  75. package/dist/contexts/index.d.mts.map +2 -1
  76. package/dist/contexts/themedLayoutContext/IThemedLayoutContext.d.mts.map +7 -1
  77. package/dist/contexts/themedLayoutContext/index.d.mts.map +8 -1
  78. package/dist/definitions/filter-mappers/index.d.mts.map +29 -1
  79. package/dist/definitions/index.d.mts.map +5 -1
  80. package/dist/definitions/table/index.d.mts.map +13 -1
  81. package/dist/definitions/themes/index.d.mts.map +6 -1
  82. package/dist/definitions/upload/index.d.mts.map +4 -1
  83. package/dist/hooks/fields/index.d.mts.map +4 -1
  84. package/dist/hooks/fields/useCheckboxGroup/index.d.cts +1 -1
  85. package/dist/hooks/fields/useCheckboxGroup/index.d.cts.map +1 -1
  86. package/dist/hooks/fields/useCheckboxGroup/index.d.mts +1 -1
  87. package/dist/hooks/fields/useCheckboxGroup/index.d.mts.map +29 -1
  88. package/dist/hooks/fields/useCheckboxGroup/index.d.ts +1 -1
  89. package/dist/hooks/fields/useCheckboxGroup/index.d.ts.map +1 -1
  90. package/dist/hooks/fields/useRadioGroup/index.d.cts +1 -1
  91. package/dist/hooks/fields/useRadioGroup/index.d.cts.map +1 -1
  92. package/dist/hooks/fields/useRadioGroup/index.d.mts +1 -1
  93. package/dist/hooks/fields/useRadioGroup/index.d.mts.map +29 -1
  94. package/dist/hooks/fields/useRadioGroup/index.d.ts +1 -1
  95. package/dist/hooks/fields/useRadioGroup/index.d.ts.map +1 -1
  96. package/dist/hooks/fields/useSelect/index.d.mts.map +20 -1
  97. package/dist/hooks/form/index.d.mts.map +5 -1
  98. package/dist/hooks/form/useDrawerForm/index.d.mts.map +2 -1
  99. package/dist/hooks/form/useDrawerForm/useDrawerForm.d.cts +1 -2
  100. package/dist/hooks/form/useDrawerForm/useDrawerForm.d.cts.map +1 -1
  101. package/dist/hooks/form/useDrawerForm/useDrawerForm.d.mts +1 -2
  102. package/dist/hooks/form/useDrawerForm/useDrawerForm.d.mts.map +36 -1
  103. package/dist/hooks/form/useDrawerForm/useDrawerForm.d.ts +1 -2
  104. package/dist/hooks/form/useDrawerForm/useDrawerForm.d.ts.map +1 -1
  105. package/dist/hooks/form/useForm.d.cts +4 -3
  106. package/dist/hooks/form/useForm.d.cts.map +1 -1
  107. package/dist/hooks/form/useForm.d.mts +4 -3
  108. package/dist/hooks/form/useForm.d.mts.map +41 -1
  109. package/dist/hooks/form/useForm.d.ts +4 -3
  110. package/dist/hooks/form/useForm.d.ts.map +1 -1
  111. package/dist/hooks/form/useModalForm/index.d.mts.map +2 -1
  112. package/dist/hooks/form/useModalForm/useModalForm.d.mts.map +42 -1
  113. package/dist/hooks/form/useStepsForm/index.d.mts.map +2 -1
  114. package/dist/hooks/form/useStepsForm/useStepsForm.d.mts.map +35 -1
  115. package/dist/hooks/import/index.d.mts.map +18 -1
  116. package/dist/hooks/index.d.mts.map +10 -1
  117. package/dist/hooks/list/index.d.mts.map +2 -1
  118. package/dist/hooks/list/useSimpleList/index.d.mts.map +2 -1
  119. package/dist/hooks/list/useSimpleList/useSimpleList.d.mts.map +24 -1
  120. package/dist/hooks/modal/index.d.mts.map +2 -1
  121. package/dist/hooks/modal/useModal/index.d.mts.map +18 -1
  122. package/dist/hooks/table/index.d.mts.map +3 -1
  123. package/dist/hooks/table/useEditableTable/index.d.mts.map +2 -1
  124. package/dist/hooks/table/useEditableTable/useEditableTable.d.mts.map +40 -1
  125. package/dist/hooks/table/useTable/index.d.mts.map +2 -1
  126. package/dist/hooks/table/useTable/paginationLink.d.mts.map +8 -1
  127. package/dist/hooks/table/useTable/useTable.d.mts.map +24 -1
  128. package/dist/hooks/useFileUploadState/index.d.mts.map +7 -1
  129. package/dist/hooks/useSiderVisible/index.d.mts.map +11 -1
  130. package/dist/hooks/useThemedLayoutContext/index.d.mts.map +4 -1
  131. package/dist/index.cjs +1 -1
  132. package/dist/index.cjs.map +1 -1
  133. package/dist/index.d.mts.map +9 -1
  134. package/dist/index.mjs +1 -1
  135. package/dist/index.mjs.map +1 -1
  136. package/dist/interfaces/field.d.mts.map +4 -1
  137. package/dist/interfaces/index.d.mts.map +19 -1
  138. package/dist/interfaces/upload.d.mts.map +10 -1
  139. package/dist/providers/index.d.mts.map +2 -1
  140. package/dist/providers/notificationProvider/index.d.mts.map +8 -1
  141. package/package.json +4 -4
  142. package/src/components/autoSaveIndicator/index.tsx +7 -7
  143. package/src/components/layout/sider/index.tsx +2 -2
  144. package/src/components/pageHeader/index.tsx +12 -9
  145. package/src/components/themedLayout/sider/index.tsx +2 -2
  146. package/src/components/themedLayoutV2/sider/index.tsx +23 -19
  147. package/src/hooks/fields/useCheckboxGroup/index.ts +2 -0
  148. package/src/hooks/fields/useRadioGroup/index.ts +2 -0
  149. package/src/hooks/form/useDrawerForm/useDrawerForm.ts +1 -2
  150. package/src/hooks/form/useForm.ts +12 -3
@@ -1 +1,4 @@
1
- {"version":3,"file":"field.d.ts","sourceRoot":"","sources":["../../src/interfaces/field.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,UAAU,CAAC,CAAC,IAAI;IAC1B,KAAK,EAAE,CAAC,CAAC;CACV,CAAC"}
1
+ export type FieldProps<T> = {
2
+ value: T;
3
+ };
4
+ //# sourceMappingURL=field.d.ts.map
@@ -1 +1,19 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/interfaces/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAErD,MAAM,MAAM,UAAU,GAAG;IACvB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB,CAAC;AACF,MAAM,WAAW,MAAM;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,MAAM,SAAS,GAAG,SAAS,GAAG;IAClC,QAAQ,EAAE,SAAS,EAAE,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG,aAAa,GAAG;IACtC,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC"}
1
+ import type { IResourceItem } from "@refinedev/core";
2
+ export type BaseRecord = {
3
+ id?: string;
4
+ [key: string]: any;
5
+ };
6
+ export interface Option {
7
+ label: string;
8
+ value: string;
9
+ }
10
+ export type ITreeMenu = IMenuItem & {
11
+ children: ITreeMenu[];
12
+ };
13
+ export type IMenuItem = IResourceItem & {
14
+ key: string;
15
+ route: string;
16
+ };
17
+ export * from "./field";
18
+ export * from "./upload";
19
+ //# sourceMappingURL=index.d.ts.map
@@ -1 +1,10 @@
1
- {"version":3,"file":"upload.d.ts","sourceRoot":"","sources":["../../src/interfaces/upload.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,YAAY;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,OAAO,GAAG,SAAS,GAAG,MAAM,GAAG,WAAW,GAAG,SAAS,CAAC;CAChE"}
1
+ export interface UploadedFile {
2
+ uid: string;
3
+ name: string;
4
+ url: string;
5
+ type: string;
6
+ size: number;
7
+ percent: number;
8
+ status: "error" | "success" | "done" | "uploading" | "removed";
9
+ }
10
+ //# sourceMappingURL=upload.d.ts.map
@@ -1 +1,2 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/providers/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC"}
1
+ export * from "./notificationProvider";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -1 +1,8 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/providers/notificationProvider/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAM5D;;;GAGG;AAEH,eAAO,MAAM,oBAAoB,EAAE,oBAqClC,CAAC;AAEF,eAAO,MAAM,uBAAuB,QAAO,oBA+C1C,CAAC"}
1
+ import type { NotificationProvider } from "@refinedev/core";
2
+ /**
3
+ * @deprecated `notificationProvider` is deprecated due to not being compatible with theme changes in Ant Design. Please use `useNotificationProvider` export as your notification provider.
4
+ * @see https://refine.dev/docs/api-reference/antd/theming/#usenotificationprovider-compatible-with-theme
5
+ */
6
+ export declare const notificationProvider: NotificationProvider;
7
+ export declare const useNotificationProvider: () => NotificationProvider;
8
+ //# sourceMappingURL=index.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@refinedev/antd",
3
- "version": "5.40.0",
3
+ "version": "5.41.0",
4
4
  "private": false,
5
5
  "description": "refine is a React-based framework for building internal tools, rapidly. It ships with Ant Design System, an enterprise-level UI toolkit.",
6
6
  "repository": {
@@ -46,9 +46,9 @@
46
46
  },
47
47
  "devDependencies": {
48
48
  "@esbuild-plugins/node-resolve": "^0.1.4",
49
- "@refinedev/cli": "^2.16.33",
50
- "@refinedev/core": "^4.51.0",
51
- "@refinedev/ui-tests": "^1.14.7",
49
+ "@refinedev/cli": "^2.16.35",
50
+ "@refinedev/core": "^4.52.0",
51
+ "@refinedev/ui-tests": "^1.14.8",
52
52
  "@testing-library/jest-dom": "^5.16.4",
53
53
  "@testing-library/react": "^13.1.1",
54
54
  "@testing-library/react-hooks": "^8.0.0",
@@ -17,7 +17,7 @@ export const AutoSaveIndicator: React.FC<AutoSaveIndicatorProps> = ({
17
17
  elements: {
18
18
  success = (
19
19
  <Message
20
- key="autoSave.success"
20
+ translationKey="autoSave.success"
21
21
  defaultMessage="saved"
22
22
  // @ts-expect-error Ant Design Icon's v5.0.1 has an issue with @types/react@^18.2.66
23
23
  icon={<CheckCircleOutlined />}
@@ -25,7 +25,7 @@ export const AutoSaveIndicator: React.FC<AutoSaveIndicatorProps> = ({
25
25
  ),
26
26
  error = (
27
27
  <Message
28
- key="autoSave.error"
28
+ translationKey="autoSave.error"
29
29
  defaultMessage="auto save failure"
30
30
  // @ts-expect-error Ant Design Icon's v5.0.1 has an issue with @types/react@^18.2.66
31
31
  icon={<ExclamationCircleOutlined />}
@@ -33,7 +33,7 @@ export const AutoSaveIndicator: React.FC<AutoSaveIndicatorProps> = ({
33
33
  ),
34
34
  loading = (
35
35
  <Message
36
- key="autoSave.loading"
36
+ translationKey="autoSave.loading"
37
37
  defaultMessage="saving..."
38
38
  // @ts-expect-error Ant Design Icon's v5.0.1 has an issue with @types/react@^18.2.66
39
39
  icon={<SyncOutlined />}
@@ -41,7 +41,7 @@ export const AutoSaveIndicator: React.FC<AutoSaveIndicatorProps> = ({
41
41
  ),
42
42
  idle = (
43
43
  <Message
44
- key="autoSave.idle"
44
+ translationKey="autoSave.idle"
45
45
  defaultMessage="waiting for changes"
46
46
  // @ts-expect-error Ant Design Icon's v5.0.1 has an issue with @types/react@^18.2.66
47
47
  icon={<EllipsisOutlined />}
@@ -63,11 +63,11 @@ export const AutoSaveIndicator: React.FC<AutoSaveIndicatorProps> = ({
63
63
  };
64
64
 
65
65
  const Message = ({
66
- key,
66
+ translationKey,
67
67
  defaultMessage,
68
68
  icon,
69
69
  }: {
70
- key: string;
70
+ translationKey: string;
71
71
  defaultMessage: string;
72
72
  icon: React.ReactNode;
73
73
  }) => {
@@ -82,7 +82,7 @@ const Message = ({
82
82
  fontSize: ".8rem",
83
83
  }}
84
84
  >
85
- {translate(key, defaultMessage)}
85
+ {translate(translationKey, defaultMessage)}
86
86
  <span style={{ marginLeft: ".2rem" }}>{icon}</span>
87
87
  </Typography.Text>
88
88
  );
@@ -74,7 +74,7 @@ export const Sider: React.FC<RefineLayoutSiderProps> = ({
74
74
  return (
75
75
  <CanAccess
76
76
  key={item.key}
77
- resource={name.toLowerCase()}
77
+ resource={name}
78
78
  action="list"
79
79
  params={{
80
80
  resource: item,
@@ -99,7 +99,7 @@ export const Sider: React.FC<RefineLayoutSiderProps> = ({
99
99
  return (
100
100
  <CanAccess
101
101
  key={item.key}
102
- resource={name.toLowerCase()}
102
+ resource={name}
103
103
  action="list"
104
104
  params={{
105
105
  resource: item,
@@ -1,22 +1,25 @@
1
- import React, { type FC } from "react";
1
+ import React, { useContext, type FC } from "react";
2
2
  import {
3
3
  PageHeader as AntdPageHeader,
4
4
  type PageHeaderProps as AntdPageHeaderProps,
5
5
  } from "@ant-design/pro-layout";
6
- import { Button, Typography } from "antd";
7
- import { ArrowLeftOutlined } from "@ant-design/icons";
6
+ import { Button, ConfigProvider, Typography } from "antd";
7
+ import { ArrowLeftOutlined, ArrowRightOutlined } from "@ant-design/icons";
8
8
  import { RefinePageHeaderClassNames } from "@refinedev/ui-types";
9
9
 
10
10
  export type PageHeaderProps = AntdPageHeaderProps;
11
11
 
12
12
  export const PageHeader: FC<AntdPageHeaderProps> = ({ children, ...props }) => {
13
+ const direction = useContext(ConfigProvider.ConfigContext)?.direction;
14
+ const renderBackButton = () => {
15
+ const BackIcon =
16
+ direction === "rtl" ? ArrowRightOutlined : ArrowLeftOutlined;
17
+
18
+ // @ts-expect-error Ant Design Icon's v5.0.1 has an issue with @types/react@^18.2.66
19
+ return <Button type="text" icon={<BackIcon />} />;
20
+ };
13
21
  const backIcon =
14
- typeof props.backIcon === "undefined" ? (
15
- // @ts-expect-error Ant Design Icon's v5.0.1 has an issue with @types/react@^18.2.66
16
- <Button type="text" icon={<ArrowLeftOutlined />} />
17
- ) : (
18
- props.backIcon
19
- );
22
+ typeof props.backIcon === "undefined" ? renderBackButton() : props.backIcon;
20
23
 
21
24
  const title =
22
25
  typeof props.title === "string" ? (
@@ -80,7 +80,7 @@ export const ThemedSider: React.FC<RefineThemedLayoutSiderProps> = ({
80
80
  return (
81
81
  <CanAccess
82
82
  key={item.key}
83
- resource={name.toLowerCase()}
83
+ resource={name}
84
84
  action="list"
85
85
  params={{
86
86
  resource: item,
@@ -106,7 +106,7 @@ export const ThemedSider: React.FC<RefineThemedLayoutSiderProps> = ({
106
106
  return (
107
107
  <CanAccess
108
108
  key={item.key}
109
- resource={name.toLowerCase()}
109
+ resource={name}
110
110
  action="list"
111
111
  params={{
112
112
  resource: item,
@@ -1,5 +1,13 @@
1
- import React from "react";
2
- import { Layout, Menu, Grid, Drawer, Button, theme } from "antd";
1
+ import React, { useContext } from "react";
2
+ import {
3
+ Layout,
4
+ Menu,
5
+ Grid,
6
+ Drawer,
7
+ Button,
8
+ theme,
9
+ ConfigProvider,
10
+ } from "antd";
3
11
  import {
4
12
  DashboardOutlined,
5
13
  LogoutOutlined,
@@ -46,6 +54,7 @@ export const ThemedSiderV2: React.FC<RefineThemedLayoutV2SiderProps> = ({
46
54
  } = useThemedLayoutContext();
47
55
 
48
56
  const isExistAuthentication = useIsExistAuthentication();
57
+ const direction = useContext(ConfigProvider.ConfigContext)?.direction;
49
58
  const routerType = useRouterType();
50
59
  const NewLink = useLink();
51
60
  const { warnWhen, setWarnWhen } = useWarnAboutChange();
@@ -84,7 +93,7 @@ export const ThemedSiderV2: React.FC<RefineThemedLayoutV2SiderProps> = ({
84
93
  return (
85
94
  <CanAccess
86
95
  key={item.key}
87
- resource={name.toLowerCase()}
96
+ resource={name}
88
97
  action="list"
89
98
  params={{
90
99
  resource: item,
@@ -113,7 +122,7 @@ export const ThemedSiderV2: React.FC<RefineThemedLayoutV2SiderProps> = ({
113
122
  return (
114
123
  <CanAccess
115
124
  key={item.key}
116
- resource={name.toLowerCase()}
125
+ resource={name}
117
126
  action="list"
118
127
  params={{
119
128
  resource: item,
@@ -282,6 +291,15 @@ export const ThemedSiderV2: React.FC<RefineThemedLayoutV2SiderProps> = ({
282
291
  siderStyles.height = "100vh";
283
292
  siderStyles.zIndex = 999;
284
293
  }
294
+ const renderClosingIcons = () => {
295
+ const iconProps = { style: { color: token.colorPrimary } };
296
+ const OpenIcon = direction === "rtl" ? RightOutlined : LeftOutlined;
297
+ const CollapsedIcon = direction === "rtl" ? LeftOutlined : RightOutlined;
298
+ const IconComponent = siderCollapsed ? CollapsedIcon : OpenIcon;
299
+
300
+ // @ts-expect-error Ant Design Icon's v5.0.1 has an issue with @types/react@^18.2.66
301
+ return <IconComponent {...iconProps} />;
302
+ };
285
303
 
286
304
  return (
287
305
  <>
@@ -314,21 +332,7 @@ export const ThemedSiderV2: React.FC<RefineThemedLayoutV2SiderProps> = ({
314
332
  backgroundColor: token.colorBgElevated,
315
333
  }}
316
334
  >
317
- {siderCollapsed ? (
318
- // @ts-expect-error Ant Design Icon's v5.0.1 has an issue with @types/react@^18.2.66
319
- <RightOutlined
320
- style={{
321
- color: token.colorPrimary,
322
- }}
323
- />
324
- ) : (
325
- // @ts-expect-error Ant Design Icon's v5.0.1 has an issue with @types/react@^18.2.66
326
- <LeftOutlined
327
- style={{
328
- color: token.colorPrimary,
329
- }}
330
- />
331
- )}
335
+ {renderClosingIcons()}
332
336
  </Button>
333
337
  }
334
338
  >
@@ -63,6 +63,7 @@ export const useCheckboxGroup = <
63
63
  pagination,
64
64
  liveMode,
65
65
  defaultValue,
66
+ selectedOptionsOrder,
66
67
  onLiveEvent,
67
68
  liveParams,
68
69
  meta,
@@ -90,6 +91,7 @@ export const useCheckboxGroup = <
90
91
  pagination,
91
92
  liveMode,
92
93
  defaultValue,
94
+ selectedOptionsOrder,
93
95
  onLiveEvent,
94
96
  liveParams,
95
97
  meta: pickNotDeprecated(meta, metaData),
@@ -60,6 +60,7 @@ export const useRadioGroup = <
60
60
  pagination,
61
61
  liveMode,
62
62
  defaultValue,
63
+ selectedOptionsOrder,
63
64
  onLiveEvent,
64
65
  liveParams,
65
66
  meta,
@@ -86,6 +87,7 @@ export const useRadioGroup = <
86
87
  pagination,
87
88
  liveMode,
88
89
  defaultValue,
90
+ selectedOptionsOrder,
89
91
  onLiveEvent,
90
92
  liveParams,
91
93
  meta: pickNotDeprecated(meta, metaData),
@@ -1,5 +1,4 @@
1
1
  import React, { useCallback } from "react";
2
- import type { UseFormConfig } from "sunflower-antd";
3
2
  import type { FormInstance, FormProps, DrawerProps, ButtonProps } from "antd";
4
3
  import {
5
4
  useTranslate,
@@ -20,7 +19,7 @@ import {
20
19
  import { useForm, type UseFormProps, type UseFormReturnType } from "../useForm";
21
20
  import type { DeleteButtonProps } from "../../../components";
22
21
 
23
- export interface UseDrawerFormConfig extends UseFormConfig {
22
+ export interface UseDrawerFormConfig {
24
23
  action: "show" | "edit" | "create" | "clone";
25
24
  }
26
25
 
@@ -5,7 +5,7 @@ import {
5
5
  Form,
6
6
  type ButtonProps,
7
7
  } from "antd";
8
- import { useForm as useFormSF } from "sunflower-antd";
8
+ import { useForm as useFormSF, type UseFormConfig } from "sunflower-antd";
9
9
  import {
10
10
  type AutoSaveProps,
11
11
  flattenObjectKeys,
@@ -52,7 +52,8 @@ export type UseFormProps<
52
52
  * @see {@link https://refine.dev/docs/advanced-tutorials/forms/server-side-form-validation/}
53
53
  */
54
54
  disableServerSideValidation?: boolean;
55
- } & AutoSaveProps<TVariables>;
55
+ } & AutoSaveProps<TVariables> &
56
+ Pick<UseFormConfig, "defaultFormValues">;
56
57
 
57
58
  export type UseFormReturnType<
58
59
  TQueryFnData extends BaseRecord = BaseRecord,
@@ -77,7 +78,10 @@ export type UseFormReturnType<
77
78
  onFinish: (
78
79
  values?: TVariables,
79
80
  ) => Promise<CreateResponse<TResponse> | UpdateResponse<TResponse> | void>;
80
- };
81
+ } & Pick<
82
+ ReturnType<typeof useFormSF<TResponse, TVariables>>,
83
+ "defaultFormValuesLoading"
84
+ >;
81
85
 
82
86
  /**
83
87
  * `useForm` is used to manage forms. It uses Ant Design {@link https://ant.design/components/form/ Form} data scope management under the hood and returns the required props for managing the form actions.
@@ -128,6 +132,7 @@ export const useForm = <
128
132
  id: idFromProps,
129
133
  overtimeOptions,
130
134
  optimisticUpdateMap,
135
+ defaultFormValues,
131
136
  disableServerSideValidation: disableServerSideValidationProp = false,
132
137
  }: UseFormProps<
133
138
  TQueryFnData,
@@ -153,6 +158,7 @@ export const useForm = <
153
158
  const [formAnt] = Form.useForm();
154
159
  const formSF = useFormSF<TResponse, TVariables>({
155
160
  form: formAnt,
161
+ defaultFormValues,
156
162
  });
157
163
  const { form } = formSF;
158
164
 
@@ -264,6 +270,8 @@ export const useForm = <
264
270
  const warnWhenUnsavedChanges =
265
271
  warnWhenUnsavedChangesProp ?? warnWhenUnsavedChangesRefine;
266
272
 
273
+ // populate form with data when queryResult is ready or id changes
274
+ // form populated via initialValues prop
267
275
  React.useEffect(() => {
268
276
  form.resetFields();
269
277
  }, [queryResult?.data?.data, id]);
@@ -310,6 +318,7 @@ export const useForm = <
310
318
  initialValues: queryResult?.data?.data,
311
319
  },
312
320
  saveButtonProps,
321
+ defaultFormValuesLoading: formSF.defaultFormValuesLoading,
313
322
  ...useFormCoreResult,
314
323
  onFinish: async (values?: TVariables) => {
315
324
  return await onFinish(values ?? formSF.form.getFieldsValue(true));