@refinedev/antd 5.43.1 → 5.45.1
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/CHANGELOG.md +174 -0
- package/README.md +2 -2
- package/dist/components/autoSaveIndicator/index.d.cts.map +1 -1
- package/dist/components/autoSaveIndicator/index.d.ts.map +1 -1
- package/dist/components/breadcrumb/index.d.cts.map +1 -1
- package/dist/components/breadcrumb/index.d.ts.map +1 -1
- package/dist/components/buttons/clone/index.d.cts.map +1 -1
- package/dist/components/buttons/clone/index.d.ts.map +1 -1
- package/dist/components/buttons/create/index.d.cts.map +1 -1
- package/dist/components/buttons/create/index.d.ts.map +1 -1
- package/dist/components/buttons/edit/index.d.cts.map +1 -1
- package/dist/components/buttons/edit/index.d.ts.map +1 -1
- package/dist/components/buttons/export/index.d.cts.map +1 -1
- package/dist/components/buttons/export/index.d.ts.map +1 -1
- package/dist/components/buttons/import/index.d.cts.map +1 -1
- package/dist/components/buttons/import/index.d.ts.map +1 -1
- package/dist/components/buttons/list/index.d.cts.map +1 -1
- package/dist/components/buttons/list/index.d.ts.map +1 -1
- package/dist/components/buttons/refresh/index.d.cts.map +1 -1
- package/dist/components/buttons/refresh/index.d.ts.map +1 -1
- package/dist/components/buttons/save/index.d.cts.map +1 -1
- package/dist/components/buttons/save/index.d.ts.map +1 -1
- package/dist/components/buttons/show/index.d.cts.map +1 -1
- package/dist/components/buttons/show/index.d.ts.map +1 -1
- package/dist/components/crud/create/index.d.cts.map +1 -1
- package/dist/components/crud/create/index.d.ts.map +1 -1
- package/dist/components/crud/edit/index.d.cts.map +1 -1
- package/dist/components/crud/edit/index.d.ts.map +1 -1
- package/dist/components/crud/list/index.d.cts.map +1 -1
- package/dist/components/crud/list/index.d.ts.map +1 -1
- package/dist/components/crud/show/index.d.cts.map +1 -1
- package/dist/components/crud/show/index.d.ts.map +1 -1
- package/dist/components/fields/boolean/index.d.cts.map +1 -1
- package/dist/components/fields/boolean/index.d.ts.map +1 -1
- package/dist/components/layout/sider/index.d.cts.map +1 -1
- package/dist/components/layout/sider/index.d.ts.map +1 -1
- package/dist/components/pageHeader/index.d.cts.map +1 -1
- package/dist/components/pageHeader/index.d.ts.map +1 -1
- package/dist/components/pages/auth/components/forgotPassword/index.d.cts.map +1 -1
- package/dist/components/pages/auth/components/forgotPassword/index.d.ts.map +1 -1
- package/dist/components/pages/auth/components/login/index.d.cts.map +1 -1
- package/dist/components/pages/auth/components/login/index.d.ts.map +1 -1
- package/dist/components/pages/auth/components/register/index.d.cts.map +1 -1
- package/dist/components/pages/auth/components/register/index.d.ts.map +1 -1
- package/dist/components/pages/auth/components/updatePassword/index.d.cts.map +1 -1
- package/dist/components/pages/auth/components/updatePassword/index.d.ts.map +1 -1
- package/dist/components/pages/error/index.d.cts.map +1 -1
- package/dist/components/pages/error/index.d.ts.map +1 -1
- package/dist/components/pages/ready/index.d.cts.map +1 -1
- package/dist/components/pages/ready/index.d.ts.map +1 -1
- package/dist/components/table/components/filterDropdown/index.d.cts.map +1 -1
- package/dist/components/table/components/filterDropdown/index.d.ts.map +1 -1
- package/dist/components/themedLayout/sider/index.d.cts.map +1 -1
- package/dist/components/themedLayout/sider/index.d.ts.map +1 -1
- package/dist/components/themedLayoutV2/index.d.cts.map +1 -1
- package/dist/components/themedLayoutV2/index.d.ts.map +1 -1
- package/dist/components/themedLayoutV2/sider/index.d.cts.map +1 -1
- package/dist/components/themedLayoutV2/sider/index.d.ts.map +1 -1
- package/dist/components/undoableNotification/index.d.cts.map +1 -1
- package/dist/components/undoableNotification/index.d.ts.map +1 -1
- package/dist/contexts/themedLayoutContext/IThemedLayoutContext.d.cts +1 -0
- package/dist/contexts/themedLayoutContext/IThemedLayoutContext.d.cts.map +1 -1
- package/dist/contexts/themedLayoutContext/IThemedLayoutContext.d.mts +1 -0
- package/dist/contexts/themedLayoutContext/IThemedLayoutContext.d.mts.map +1 -0
- package/dist/contexts/themedLayoutContext/IThemedLayoutContext.d.ts +1 -0
- package/dist/contexts/themedLayoutContext/IThemedLayoutContext.d.ts.map +1 -1
- package/dist/contexts/themedLayoutContext/index.d.cts +1 -0
- package/dist/contexts/themedLayoutContext/index.d.cts.map +1 -1
- package/dist/contexts/themedLayoutContext/index.d.mts +1 -0
- package/dist/contexts/themedLayoutContext/index.d.mts.map +1 -0
- package/dist/contexts/themedLayoutContext/index.d.ts +1 -0
- package/dist/contexts/themedLayoutContext/index.d.ts.map +1 -1
- package/dist/hooks/form/useForm.d.cts.map +1 -1
- package/dist/hooks/form/useForm.d.ts.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +9 -9
- package/src/components/autoSaveIndicator/index.tsx +0 -4
- package/src/components/breadcrumb/index.tsx +2 -4
- package/src/components/buttons/clone/index.tsx +6 -4
- package/src/components/buttons/create/index.tsx +7 -5
- package/src/components/buttons/delete/index.tsx +6 -6
- package/src/components/buttons/edit/index.tsx +6 -4
- package/src/components/buttons/export/index.tsx +0 -1
- package/src/components/buttons/import/index.tsx +0 -1
- package/src/components/buttons/list/index.tsx +7 -5
- package/src/components/buttons/refresh/index.tsx +0 -1
- package/src/components/buttons/save/index.tsx +0 -1
- package/src/components/buttons/show/index.tsx +6 -4
- package/src/components/crud/create/index.tsx +0 -1
- package/src/components/crud/edit/index.tsx +0 -1
- package/src/components/crud/list/index.tsx +0 -1
- package/src/components/crud/show/index.tsx +0 -1
- package/src/components/fields/boolean/index.tsx +0 -2
- package/src/components/layout/sider/index.tsx +0 -5
- package/src/components/pageHeader/index.tsx +0 -1
- package/src/components/pages/auth/components/forgotPassword/index.tsx +4 -1
- package/src/components/pages/auth/components/login/index.tsx +3 -1
- package/src/components/pages/auth/components/register/index.tsx +3 -1
- package/src/components/pages/auth/components/updatePassword/index.tsx +4 -1
- package/src/components/pages/error/index.tsx +0 -1
- package/src/components/pages/ready/index.tsx +0 -3
- package/src/components/table/components/filterDropdown/index.tsx +0 -1
- package/src/components/themedLayout/sider/index.tsx +0 -7
- package/src/components/themedLayoutV2/index.tsx +5 -1
- package/src/components/themedLayoutV2/sider/index.tsx +0 -6
- package/src/components/undoableNotification/index.tsx +0 -1
- package/src/contexts/themedLayoutContext/IThemedLayoutContext.ts +1 -0
- package/src/contexts/themedLayoutContext/index.tsx +10 -2
- package/src/hooks/form/useForm.ts +5 -6
package/package.json
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
{
|
2
2
|
"name": "@refinedev/antd",
|
3
|
-
"version": "5.
|
3
|
+
"version": "5.45.1",
|
4
4
|
"private": false,
|
5
|
-
"description": "
|
5
|
+
"description": "Ant Design UI support for Refine, offering enterprise-level UI components.",
|
6
6
|
"repository": {
|
7
7
|
"type": "git",
|
8
8
|
"url": "https://github.com/refinedev/refine.git",
|
@@ -33,9 +33,9 @@
|
|
33
33
|
"module": "dist/index.mjs",
|
34
34
|
"typings": "dist/index.d.ts",
|
35
35
|
"dependencies": {
|
36
|
-
"@ant-design/icons": "5.
|
37
|
-
"@ant-design/pro-layout": "7.
|
38
|
-
"@refinedev/ui-types": "^1.
|
36
|
+
"@ant-design/icons": "^5.5.1",
|
37
|
+
"@ant-design/pro-layout": "^7.21.1",
|
38
|
+
"@refinedev/ui-types": "^1.23.1",
|
39
39
|
"@tanstack/react-query": "^4.10.1",
|
40
40
|
"antd": "^5.17.0",
|
41
41
|
"dayjs": "^1.10.7",
|
@@ -46,9 +46,9 @@
|
|
46
46
|
},
|
47
47
|
"devDependencies": {
|
48
48
|
"@esbuild-plugins/node-resolve": "^0.1.4",
|
49
|
-
"@refinedev/cli": "^2.16.
|
50
|
-
"@refinedev/core": "^4.
|
51
|
-
"@refinedev/ui-tests": "^1.
|
49
|
+
"@refinedev/cli": "^2.16.42",
|
50
|
+
"@refinedev/core": "^4.57.1",
|
51
|
+
"@refinedev/ui-tests": "^1.15.1",
|
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",
|
@@ -64,7 +64,7 @@
|
|
64
64
|
"jest": "^29.3.1",
|
65
65
|
"jest-environment-jsdom": "^29.3.1",
|
66
66
|
"postcss": "^8.1.4",
|
67
|
-
"react-router
|
67
|
+
"react-router": "^7.0.2",
|
68
68
|
"ts-jest": "^29.1.2",
|
69
69
|
"tsup": "^6.7.0",
|
70
70
|
"typescript": "^5.4.2"
|
@@ -19,7 +19,6 @@ export const AutoSaveIndicator: React.FC<AutoSaveIndicatorProps> = ({
|
|
19
19
|
<Message
|
20
20
|
translationKey="autoSave.success"
|
21
21
|
defaultMessage="saved"
|
22
|
-
// @ts-expect-error Ant Design Icon's v5.0.1 has an issue with @types/react@^18.2.66
|
23
22
|
icon={<CheckCircleOutlined />}
|
24
23
|
/>
|
25
24
|
),
|
@@ -27,7 +26,6 @@ export const AutoSaveIndicator: React.FC<AutoSaveIndicatorProps> = ({
|
|
27
26
|
<Message
|
28
27
|
translationKey="autoSave.error"
|
29
28
|
defaultMessage="auto save failure"
|
30
|
-
// @ts-expect-error Ant Design Icon's v5.0.1 has an issue with @types/react@^18.2.66
|
31
29
|
icon={<ExclamationCircleOutlined />}
|
32
30
|
/>
|
33
31
|
),
|
@@ -35,7 +33,6 @@ export const AutoSaveIndicator: React.FC<AutoSaveIndicatorProps> = ({
|
|
35
33
|
<Message
|
36
34
|
translationKey="autoSave.loading"
|
37
35
|
defaultMessage="saving..."
|
38
|
-
// @ts-expect-error Ant Design Icon's v5.0.1 has an issue with @types/react@^18.2.66
|
39
36
|
icon={<SyncOutlined />}
|
40
37
|
/>
|
41
38
|
),
|
@@ -43,7 +40,6 @@ export const AutoSaveIndicator: React.FC<AutoSaveIndicatorProps> = ({
|
|
43
40
|
<Message
|
44
41
|
translationKey="autoSave.idle"
|
45
42
|
defaultMessage="waiting for changes"
|
46
|
-
// @ts-expect-error Ant Design Icon's v5.0.1 has an issue with @types/react@^18.2.66
|
47
43
|
icon={<EllipsisOutlined />}
|
48
44
|
/>
|
49
45
|
),
|
@@ -23,6 +23,7 @@ export const Breadcrumb: React.FC<BreadcrumbProps> = ({
|
|
23
23
|
showHome = true,
|
24
24
|
hideIcons = false,
|
25
25
|
meta,
|
26
|
+
minItems = 2,
|
26
27
|
}) => {
|
27
28
|
const routerType = useRouterType();
|
28
29
|
const { breadcrumbs } = useBreadcrumb({
|
@@ -38,9 +39,7 @@ export const Breadcrumb: React.FC<BreadcrumbProps> = ({
|
|
38
39
|
|
39
40
|
const ActiveLink = routerType === "legacy" ? LegacyLink : Link;
|
40
41
|
|
41
|
-
if (breadcrumbs.length
|
42
|
-
return null;
|
43
|
-
}
|
42
|
+
if (breadcrumbs.length < minItems) return null;
|
44
43
|
|
45
44
|
const breadCrumbItems = breadcrumbs.map(({ label, icon, href }) => ({
|
46
45
|
key: `breadcrumb-item-${label}`,
|
@@ -70,7 +69,6 @@ export const Breadcrumb: React.FC<BreadcrumbProps> = ({
|
|
70
69
|
key: "breadcrumb-item-home",
|
71
70
|
title: (
|
72
71
|
<ActiveLink to="/">
|
73
|
-
{/* @ts-expect-error Ant Design Icon's v5.0.1 has an issue with @types/react@^18.2.66 */}
|
74
72
|
{rootRouteResource?.resource?.meta?.icon ?? <HomeOutlined />}
|
75
73
|
</ActiveLink>
|
76
74
|
),
|
@@ -34,14 +34,17 @@ export const CloneButton: React.FC<CloneButtonProps> = ({
|
|
34
34
|
meta,
|
35
35
|
});
|
36
36
|
|
37
|
-
|
37
|
+
const isDisabled = disabled || rest.disabled;
|
38
|
+
const isHidden = hidden || rest.hidden;
|
39
|
+
|
40
|
+
if (isHidden) return null;
|
38
41
|
|
39
42
|
return (
|
40
43
|
<LinkComponent
|
41
44
|
to={to}
|
42
45
|
replace={false}
|
43
46
|
onClick={(e: React.PointerEvent<HTMLButtonElement>) => {
|
44
|
-
if (
|
47
|
+
if (isDisabled) {
|
45
48
|
e.preventDefault();
|
46
49
|
return;
|
47
50
|
}
|
@@ -52,9 +55,8 @@ export const CloneButton: React.FC<CloneButtonProps> = ({
|
|
52
55
|
}}
|
53
56
|
>
|
54
57
|
<Button
|
55
|
-
// @ts-expect-error Ant Design Icon's v5.0.1 has an issue with @types/react@^18.2.66
|
56
58
|
icon={<PlusSquareOutlined />}
|
57
|
-
disabled={
|
59
|
+
disabled={isDisabled}
|
58
60
|
title={title}
|
59
61
|
data-testid={RefineButtonTestIds.CloneButton}
|
60
62
|
className={RefineButtonClassNames.CloneButton}
|
@@ -29,19 +29,22 @@ export const CreateButton: React.FC<CreateButtonProps> = ({
|
|
29
29
|
const { hidden, disabled, label, title, LinkComponent, to } = useCreateButton(
|
30
30
|
{
|
31
31
|
resource: resourceNameFromProps ?? propResourceNameOrRouteName,
|
32
|
-
accessControl,
|
33
32
|
meta,
|
33
|
+
accessControl,
|
34
34
|
},
|
35
35
|
);
|
36
36
|
|
37
|
-
|
37
|
+
const isDisabled = disabled || rest.disabled;
|
38
|
+
const isHidden = hidden || rest.hidden;
|
39
|
+
|
40
|
+
if (isHidden) return null;
|
38
41
|
|
39
42
|
return (
|
40
43
|
<LinkComponent
|
41
44
|
to={to}
|
42
45
|
replace={false}
|
43
46
|
onClick={(e: React.PointerEvent<HTMLButtonElement>) => {
|
44
|
-
if (
|
47
|
+
if (isDisabled) {
|
45
48
|
e.preventDefault();
|
46
49
|
return;
|
47
50
|
}
|
@@ -52,9 +55,8 @@ export const CreateButton: React.FC<CreateButtonProps> = ({
|
|
52
55
|
}}
|
53
56
|
>
|
54
57
|
<Button
|
55
|
-
// @ts-expect-error Ant Design Icon's v5.0.1 has an issue with @types/react@^18.2.66
|
56
58
|
icon={<PlusSquareOutlined />}
|
57
|
-
disabled={
|
59
|
+
disabled={isDisabled}
|
58
60
|
title={title}
|
59
61
|
data-testid={RefineButtonTestIds.CreateButton}
|
60
62
|
className={RefineButtonClassNames.CreateButton}
|
@@ -58,7 +58,10 @@ export const DeleteButton: React.FC<DeleteButtonProps> = ({
|
|
58
58
|
accessControl,
|
59
59
|
});
|
60
60
|
|
61
|
-
|
61
|
+
const isDisabled = disabled || rest.disabled;
|
62
|
+
const isHidden = hidden || rest.hidden;
|
63
|
+
|
64
|
+
if (isHidden) return null;
|
62
65
|
|
63
66
|
return (
|
64
67
|
<Popconfirm
|
@@ -69,17 +72,14 @@ export const DeleteButton: React.FC<DeleteButtonProps> = ({
|
|
69
72
|
title={confirmTitle ?? defaultConfirmTitle}
|
70
73
|
okButtonProps={{ disabled: loading }}
|
71
74
|
onConfirm={onConfirm}
|
72
|
-
disabled={
|
73
|
-
typeof rest?.disabled !== "undefined" ? rest.disabled : disabled
|
74
|
-
}
|
75
|
+
disabled={isDisabled}
|
75
76
|
>
|
76
77
|
<Button
|
77
78
|
danger
|
78
79
|
loading={loading}
|
79
|
-
// @ts-expect-error Ant Design Icon's v5.0.1 has an issue with @types/react@^18.2.66
|
80
80
|
icon={<DeleteOutlined />}
|
81
81
|
title={title}
|
82
|
-
disabled={
|
82
|
+
disabled={isDisabled}
|
83
83
|
data-testid={RefineButtonTestIds.DeleteButton}
|
84
84
|
className={RefineButtonClassNames.DeleteButton}
|
85
85
|
{...rest}
|
@@ -34,14 +34,17 @@ export const EditButton: React.FC<EditButtonProps> = ({
|
|
34
34
|
accessControl,
|
35
35
|
});
|
36
36
|
|
37
|
-
|
37
|
+
const isDisabled = disabled || rest.disabled;
|
38
|
+
const isHidden = hidden || rest.hidden;
|
39
|
+
|
40
|
+
if (isHidden) return null;
|
38
41
|
|
39
42
|
return (
|
40
43
|
<LinkComponent
|
41
44
|
to={to}
|
42
45
|
replace={false}
|
43
46
|
onClick={(e: React.PointerEvent<HTMLButtonElement>) => {
|
44
|
-
if (
|
47
|
+
if (isDisabled) {
|
45
48
|
e.preventDefault();
|
46
49
|
return;
|
47
50
|
}
|
@@ -52,9 +55,8 @@ export const EditButton: React.FC<EditButtonProps> = ({
|
|
52
55
|
}}
|
53
56
|
>
|
54
57
|
<Button
|
55
|
-
// @ts-expect-error Ant Design Icon's v5.0.1 has an issue with @types/react@^18.2.66
|
56
58
|
icon={<EditOutlined />}
|
57
|
-
disabled={
|
59
|
+
disabled={isDisabled}
|
58
60
|
title={title}
|
59
61
|
data-testid={RefineButtonTestIds.EditButton}
|
60
62
|
className={RefineButtonClassNames.EditButton}
|
@@ -25,7 +25,6 @@ export const ExportButton: React.FC<ExportButtonProps> = ({
|
|
25
25
|
return (
|
26
26
|
<Button
|
27
27
|
type="default"
|
28
|
-
// @ts-expect-error Ant Design Icon's v5.0.1 has an issue with @types/react@^18.2.66
|
29
28
|
icon={<ExportOutlined />}
|
30
29
|
data-testid={RefineButtonTestIds.ExportButton}
|
31
30
|
className={RefineButtonClassNames.ExportButton}
|
@@ -28,7 +28,6 @@ export const ImportButton: React.FC<ImportButtonProps> = ({
|
|
28
28
|
return (
|
29
29
|
<Upload {...uploadProps}>
|
30
30
|
<Button
|
31
|
-
// @ts-expect-error Ant Design Icon's v5.0.1 has an issue with @types/react@^18.2.66
|
32
31
|
icon={<ImportOutlined />}
|
33
32
|
data-testid={RefineButtonTestIds.ImportButton}
|
34
33
|
className={RefineButtonClassNames.ImportButton}
|
@@ -28,18 +28,21 @@ export const ListButton: React.FC<ListButtonProps> = ({
|
|
28
28
|
}) => {
|
29
29
|
const { to, label, title, hidden, disabled, LinkComponent } = useListButton({
|
30
30
|
resource: resourceNameFromProps ?? propResourceNameOrRouteName,
|
31
|
-
accessControl,
|
32
31
|
meta,
|
32
|
+
accessControl,
|
33
33
|
});
|
34
34
|
|
35
|
-
|
35
|
+
const isDisabled = disabled || rest.disabled;
|
36
|
+
const isHidden = hidden || rest.hidden;
|
37
|
+
|
38
|
+
if (isHidden) return null;
|
36
39
|
|
37
40
|
return (
|
38
41
|
<LinkComponent
|
39
42
|
to={to}
|
40
43
|
replace={false}
|
41
44
|
onClick={(e: React.PointerEvent<HTMLButtonElement>) => {
|
42
|
-
if (
|
45
|
+
if (isDisabled) {
|
43
46
|
e.preventDefault();
|
44
47
|
return;
|
45
48
|
}
|
@@ -50,9 +53,8 @@ export const ListButton: React.FC<ListButtonProps> = ({
|
|
50
53
|
}}
|
51
54
|
>
|
52
55
|
<Button
|
53
|
-
// @ts-expect-error Ant Design Icon's v5.0.1 has an issue with @types/react@^18.2.66
|
54
56
|
icon={<BarsOutlined />}
|
55
|
-
disabled={
|
57
|
+
disabled={isDisabled}
|
56
58
|
title={title}
|
57
59
|
data-testid={RefineButtonTestIds.ListButton}
|
58
60
|
className={RefineButtonClassNames.ListButton}
|
@@ -35,7 +35,6 @@ export const RefreshButton: React.FC<RefreshButtonProps> = ({
|
|
35
35
|
return (
|
36
36
|
<Button
|
37
37
|
onClick={onClick}
|
38
|
-
// @ts-expect-error Ant Design Icon's v5.0.1 has an issue with @types/react@^18.2.66
|
39
38
|
icon={<RedoOutlined spin={loading} />}
|
40
39
|
data-testid={RefineButtonTestIds.RefreshButton}
|
41
40
|
className={RefineButtonClassNames.RefreshButton}
|
@@ -25,7 +25,6 @@ export const SaveButton: React.FC<SaveButtonProps> = ({
|
|
25
25
|
return (
|
26
26
|
<Button
|
27
27
|
type="primary"
|
28
|
-
// @ts-expect-error Ant Design Icon's v5.0.1 has an issue with @types/react@^18.2.66
|
29
28
|
icon={<SaveOutlined />}
|
30
29
|
data-testid={RefineButtonTestIds.SaveButton}
|
31
30
|
className={RefineButtonClassNames.SaveButton}
|
@@ -34,14 +34,17 @@ export const ShowButton: React.FC<ShowButtonProps> = ({
|
|
34
34
|
meta,
|
35
35
|
});
|
36
36
|
|
37
|
-
|
37
|
+
const isDisabled = disabled || rest.disabled;
|
38
|
+
const isHidden = hidden || rest.hidden;
|
39
|
+
|
40
|
+
if (isHidden) return null;
|
38
41
|
|
39
42
|
return (
|
40
43
|
<LinkComponent
|
41
44
|
to={to}
|
42
45
|
replace={false}
|
43
46
|
onClick={(e: React.PointerEvent<HTMLButtonElement>) => {
|
44
|
-
if (
|
47
|
+
if (isDisabled) {
|
45
48
|
e.preventDefault();
|
46
49
|
return;
|
47
50
|
}
|
@@ -52,9 +55,8 @@ export const ShowButton: React.FC<ShowButtonProps> = ({
|
|
52
55
|
}}
|
53
56
|
>
|
54
57
|
<Button
|
55
|
-
|
58
|
+
disabled={isDisabled}
|
56
59
|
icon={<EyeOutlined />}
|
57
|
-
disabled={disabled}
|
58
60
|
title={title}
|
59
61
|
data-testid={RefineButtonTestIds.ShowButton}
|
60
62
|
className={RefineButtonClassNames.ShowButton}
|
@@ -14,9 +14,7 @@ export const BooleanField: React.FC<BooleanFieldProps> = ({
|
|
14
14
|
value,
|
15
15
|
valueLabelTrue = "true",
|
16
16
|
valueLabelFalse = "false",
|
17
|
-
// @ts-expect-error Ant Design Icon's v5.0.1 has an issue with @types/react@^18.2.66
|
18
17
|
trueIcon = <CheckOutlined />,
|
19
|
-
// @ts-expect-error Ant Design Icon's v5.0.1 has an issue with @types/react@^18.2.66
|
20
18
|
falseIcon = <CloseOutlined />,
|
21
19
|
...rest
|
22
20
|
}) => {
|
@@ -82,7 +82,6 @@ export const Sider: React.FC<RefineLayoutSiderProps> = ({
|
|
82
82
|
>
|
83
83
|
<Menu.SubMenu
|
84
84
|
key={item.key}
|
85
|
-
// @ts-expect-error Ant Design Icon's v5.0.1 has an issue with @types/react@^18.2.66
|
86
85
|
icon={icon ?? <UnorderedListOutlined />}
|
87
86
|
title={label}
|
88
87
|
>
|
@@ -110,7 +109,6 @@ export const Sider: React.FC<RefineLayoutSiderProps> = ({
|
|
110
109
|
style={{
|
111
110
|
fontWeight: isSelected ? "bold" : "normal",
|
112
111
|
}}
|
113
|
-
// @ts-expect-error Ant Design Icon's v5.0.1 has an issue with @types/react@^18.2.66
|
114
112
|
icon={icon ?? (isRoute && <UnorderedListOutlined />)}
|
115
113
|
>
|
116
114
|
<Link to={route ?? ""}>{label}</Link>
|
@@ -142,7 +140,6 @@ export const Sider: React.FC<RefineLayoutSiderProps> = ({
|
|
142
140
|
};
|
143
141
|
|
144
142
|
const logout = isExistAuthentication && (
|
145
|
-
// @ts-expect-error Ant Design Icon's v5.0.1 has an issue with @types/react@^18.2.66
|
146
143
|
<Menu.Item key="logout" onClick={handleLogout} icon={<LogoutOutlined />}>
|
147
144
|
{translate("buttons.logout", "Logout")}
|
148
145
|
</Menu.Item>
|
@@ -154,7 +151,6 @@ export const Sider: React.FC<RefineLayoutSiderProps> = ({
|
|
154
151
|
style={{
|
155
152
|
fontWeight: selectedKey === "/" ? "bold" : "normal",
|
156
153
|
}}
|
157
|
-
// @ts-expect-error Ant Design Icon's v5.0.1 has an issue with @types/react@^18.2.66
|
158
154
|
icon={<DashboardOutlined />}
|
159
155
|
>
|
160
156
|
<Link to="/">{translate("dashboard.title", "Dashboard")}</Link>
|
@@ -230,7 +226,6 @@ export const Sider: React.FC<RefineLayoutSiderProps> = ({
|
|
230
226
|
style={drawerButtonStyles}
|
231
227
|
size="large"
|
232
228
|
onClick={() => setDrawerOpen(true)}
|
233
|
-
// @ts-expect-error Ant Design Icon's v5.0.1 has an issue with @types/react@^18.2.66
|
234
229
|
icon={<BarsOutlined />}
|
235
230
|
/>
|
236
231
|
</>
|
@@ -15,7 +15,6 @@ export const PageHeader: FC<AntdPageHeaderProps> = ({ children, ...props }) => {
|
|
15
15
|
const BackIcon =
|
16
16
|
direction === "rtl" ? ArrowRightOutlined : ArrowLeftOutlined;
|
17
17
|
|
18
|
-
// @ts-expect-error Ant Design Icon's v5.0.1 has an issue with @types/react@^18.2.66
|
19
18
|
return <Button type="text" icon={<BackIcon />} />;
|
20
19
|
};
|
21
20
|
const backIcon =
|
@@ -52,6 +52,7 @@ export const ForgotPasswordPage: React.FC<ResetPassworProps> = ({
|
|
52
52
|
renderContent,
|
53
53
|
formProps,
|
54
54
|
title,
|
55
|
+
mutationVariables,
|
55
56
|
}) => {
|
56
57
|
const { token } = theme.useToken();
|
57
58
|
const [form] = Form.useForm<ForgotPasswordFormTypes>();
|
@@ -104,7 +105,9 @@ export const ForgotPasswordPage: React.FC<ResetPassworProps> = ({
|
|
104
105
|
<Form<ForgotPasswordFormTypes>
|
105
106
|
layout="vertical"
|
106
107
|
form={form}
|
107
|
-
onFinish={(values) =>
|
108
|
+
onFinish={(values) =>
|
109
|
+
forgotPassword({ ...values, ...mutationVariables })
|
110
|
+
}
|
108
111
|
requiredMark={false}
|
109
112
|
{...formProps}
|
110
113
|
>
|
@@ -50,6 +50,7 @@ export const LoginPage: React.FC<LoginProps> = ({
|
|
50
50
|
formProps,
|
51
51
|
title,
|
52
52
|
hideForm,
|
53
|
+
mutationVariables,
|
53
54
|
}) => {
|
54
55
|
const { token } = theme.useToken();
|
55
56
|
const [form] = Form.useForm<LoginFormTypes>();
|
@@ -111,6 +112,7 @@ export const LoginPage: React.FC<LoginProps> = ({
|
|
111
112
|
}}
|
112
113
|
onClick={() =>
|
113
114
|
login({
|
115
|
+
...mutationVariables,
|
114
116
|
providerName: provider.name,
|
115
117
|
})
|
116
118
|
}
|
@@ -152,7 +154,7 @@ export const LoginPage: React.FC<LoginProps> = ({
|
|
152
154
|
<Form<LoginFormTypes>
|
153
155
|
layout="vertical"
|
154
156
|
form={form}
|
155
|
-
onFinish={(values) => login(values)}
|
157
|
+
onFinish={(values) => login({ ...values, ...mutationVariables })}
|
156
158
|
requiredMark={false}
|
157
159
|
initialValues={{
|
158
160
|
remember: false,
|
@@ -47,6 +47,7 @@ export const RegisterPage: React.FC<RegisterProps> = ({
|
|
47
47
|
formProps,
|
48
48
|
title,
|
49
49
|
hideForm,
|
50
|
+
mutationVariables,
|
50
51
|
}) => {
|
51
52
|
const { token } = theme.useToken();
|
52
53
|
const [form] = Form.useForm<RegisterFormTypes>();
|
@@ -108,6 +109,7 @@ export const RegisterPage: React.FC<RegisterProps> = ({
|
|
108
109
|
}}
|
109
110
|
onClick={() =>
|
110
111
|
register({
|
112
|
+
...mutationVariables,
|
111
113
|
providerName: provider.name,
|
112
114
|
})
|
113
115
|
}
|
@@ -152,7 +154,7 @@ export const RegisterPage: React.FC<RegisterProps> = ({
|
|
152
154
|
<Form<RegisterFormTypes>
|
153
155
|
layout="vertical"
|
154
156
|
form={form}
|
155
|
-
onFinish={(values) => register(values)}
|
157
|
+
onFinish={(values) => register({ ...mutationVariables, ...values })}
|
156
158
|
requiredMark={false}
|
157
159
|
{...formProps}
|
158
160
|
>
|
@@ -46,6 +46,7 @@ export const UpdatePasswordPage: React.FC<UpdatePasswordProps> = ({
|
|
46
46
|
renderContent,
|
47
47
|
formProps,
|
48
48
|
title,
|
49
|
+
mutationVariables,
|
49
50
|
}) => {
|
50
51
|
const { token } = theme.useToken();
|
51
52
|
const [form] = Form.useForm<UpdatePasswordFormTypes>();
|
@@ -96,7 +97,9 @@ export const UpdatePasswordPage: React.FC<UpdatePasswordProps> = ({
|
|
96
97
|
<Form<UpdatePasswordFormTypes>
|
97
98
|
layout="vertical"
|
98
99
|
form={form}
|
99
|
-
onFinish={(values) =>
|
100
|
+
onFinish={(values) =>
|
101
|
+
updatePassword({ ...values, ...mutationVariables })
|
102
|
+
}
|
100
103
|
requiredMark={false}
|
101
104
|
{...formProps}
|
102
105
|
>
|
@@ -52,7 +52,6 @@ export const ErrorComponent: React.FC<RefineErrorPageProps> = () => {
|
|
52
52
|
</Typography.Text>
|
53
53
|
{errorMessage && (
|
54
54
|
<Tooltip title={errorMessage}>
|
55
|
-
{/* @ts-expect-error Ant Design Icon's v5.0.1 has an issue with @types/react@^18.2.66 */}
|
56
55
|
<InfoCircleOutlined data-testid="error-component-tooltip" />
|
57
56
|
</Tooltip>
|
58
57
|
)}
|
@@ -62,7 +62,6 @@ export const ReadyPage: React.FC<RefineReadyPageProps> = () => {
|
|
62
62
|
style={{ marginTop: "70px", justifyContent: "center" }}
|
63
63
|
>
|
64
64
|
<a href="https://refine.dev" target="_blank" rel="noreferrer">
|
65
|
-
{/* @ts-expect-error Ant Design Icon's v5.0.1 has an issue with @types/react@^18.2.66 */}
|
66
65
|
<Button size="large" icon={<ReadOutlined />}>
|
67
66
|
Documentation
|
68
67
|
</Button>
|
@@ -72,13 +71,11 @@ export const ReadyPage: React.FC<RefineReadyPageProps> = () => {
|
|
72
71
|
target="_blank"
|
73
72
|
rel="noreferrer"
|
74
73
|
>
|
75
|
-
{/* @ts-expect-error Ant Design Icon's v5.0.1 has an issue with @types/react@^18.2.66 */}
|
76
74
|
<Button size="large" icon={<FolderOutlined />}>
|
77
75
|
Examples
|
78
76
|
</Button>
|
79
77
|
</a>
|
80
78
|
<a href="https://discord.gg/refine" target="_blank" rel="noreferrer">
|
81
|
-
{/* @ts-expect-error Ant Design Icon's v5.0.1 has an issue with @types/react@^18.2.66 */}
|
82
79
|
<Button size="large" icon={<TeamOutlined />}>
|
83
80
|
Community
|
84
81
|
</Button>
|
@@ -94,7 +94,6 @@ export const FilterDropdown: React.FC<FilterDropdownProps> = (props) => {
|
|
94
94
|
<div style={{ marginBottom: 15 }}>{childrenWithProps}</div>
|
95
95
|
<Space>
|
96
96
|
<Button type="primary" size="small" onClick={() => onFilter()}>
|
97
|
-
{/* @ts-expect-error Ant Design Icon's v5.0.1 has an issue with @types/react@^18.2.66 */}
|
98
97
|
<FilterOutlined /> {translate("buttons.filter", "Filter")}
|
99
98
|
</Button>
|
100
99
|
<Button danger size="small" onClick={() => clearFilter()}>
|
@@ -88,7 +88,6 @@ export const ThemedSider: React.FC<RefineThemedLayoutSiderProps> = ({
|
|
88
88
|
>
|
89
89
|
<Menu.SubMenu
|
90
90
|
key={item.key}
|
91
|
-
// @ts-expect-error Ant Design Icon's v5.0.1 has an issue with @types/react@^18.2.66
|
92
91
|
icon={icon ?? <UnorderedListOutlined />}
|
93
92
|
title={label}
|
94
93
|
>
|
@@ -114,7 +113,6 @@ export const ThemedSider: React.FC<RefineThemedLayoutSiderProps> = ({
|
|
114
113
|
>
|
115
114
|
<Menu.Item
|
116
115
|
key={item.key}
|
117
|
-
// @ts-expect-error Ant Design Icon's v5.0.1 has an issue with @types/react@^18.2.66
|
118
116
|
icon={icon ?? (isRoute && <UnorderedListOutlined />)}
|
119
117
|
>
|
120
118
|
<Link to={route ?? ""}>{label}</Link>
|
@@ -149,7 +147,6 @@ export const ThemedSider: React.FC<RefineThemedLayoutSiderProps> = ({
|
|
149
147
|
<Menu.Item
|
150
148
|
key="logout"
|
151
149
|
onClick={() => handleLogout()}
|
152
|
-
// @ts-expect-error Ant Design Icon's v5.0.1 has an issue with @types/react@^18.2.66
|
153
150
|
icon={<LogoutOutlined />}
|
154
151
|
>
|
155
152
|
{translate("buttons.logout", "Logout")}
|
@@ -157,7 +154,6 @@ export const ThemedSider: React.FC<RefineThemedLayoutSiderProps> = ({
|
|
157
154
|
);
|
158
155
|
|
159
156
|
const dashboard = hasDashboard ? (
|
160
|
-
// @ts-expect-error Ant Design Icon's v5.0.1 has an issue with @types/react@^18.2.66
|
161
157
|
<Menu.Item key="dashboard" icon={<DashboardOutlined />}>
|
162
158
|
<Link to="/">{translate("dashboard.title", "Dashboard")}</Link>
|
163
159
|
{!collapsed && selectedKey === "/" && (
|
@@ -254,7 +250,6 @@ export const ThemedSider: React.FC<RefineThemedLayoutSiderProps> = ({
|
|
254
250
|
style={drawerButtonStyles}
|
255
251
|
size="large"
|
256
252
|
onClick={() => setDrawerOpen(true)}
|
257
|
-
// @ts-expect-error Ant Design Icon's v5.0.1 has an issue with @types/react@^18.2.66
|
258
253
|
icon={<BarsOutlined />}
|
259
254
|
/>
|
260
255
|
</>
|
@@ -287,14 +282,12 @@ export const ThemedSider: React.FC<RefineThemedLayoutSiderProps> = ({
|
|
287
282
|
}}
|
288
283
|
>
|
289
284
|
{collapsed ? (
|
290
|
-
// @ts-expect-error Ant Design Icon's v5.0.1 has an issue with @types/react@^18.2.66
|
291
285
|
<RightOutlined
|
292
286
|
style={{
|
293
287
|
color: token.colorPrimary,
|
294
288
|
}}
|
295
289
|
/>
|
296
290
|
) : (
|
297
|
-
// @ts-expect-error Ant Design Icon's v5.0.1 has an issue with @types/react@^18.2.66
|
298
291
|
<LeftOutlined
|
299
292
|
style={{
|
300
293
|
color: token.colorPrimary,
|
@@ -14,6 +14,7 @@ export const ThemedLayoutV2: React.FC<RefineThemedLayoutV2Props> = ({
|
|
14
14
|
Footer,
|
15
15
|
OffLayoutArea,
|
16
16
|
initialSiderCollapsed,
|
17
|
+
onSiderCollapsed,
|
17
18
|
}) => {
|
18
19
|
const breakpoint = Grid.useBreakpoint();
|
19
20
|
const SiderToRender = Sider ?? DefaultSider;
|
@@ -22,7 +23,10 @@ export const ThemedLayoutV2: React.FC<RefineThemedLayoutV2Props> = ({
|
|
22
23
|
const hasSider = !!SiderToRender({ Title });
|
23
24
|
|
24
25
|
return (
|
25
|
-
<ThemedLayoutContextProvider
|
26
|
+
<ThemedLayoutContextProvider
|
27
|
+
initialSiderCollapsed={initialSiderCollapsed}
|
28
|
+
onSiderCollapsed={onSiderCollapsed}
|
29
|
+
>
|
26
30
|
<AntdLayout style={{ minHeight: "100vh" }} hasSider={hasSider}>
|
27
31
|
<SiderToRender Title={Title} />
|
28
32
|
<AntdLayout>
|