@refinedev/antd 6.0.1 → 6.0.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/CHANGELOG.md +52 -0
- package/dist/components/pages/index.d.cts +0 -2
- package/dist/components/pages/index.d.cts.map +1 -1
- package/dist/components/pages/index.d.mts +0 -2
- package/dist/components/pages/index.d.mts.map +0 -2
- package/dist/components/pages/index.d.ts +0 -2
- package/dist/components/pages/index.d.ts.map +1 -1
- package/dist/definitions/table/index.d.cts +0 -3
- package/dist/definitions/table/index.d.cts.map +1 -1
- package/dist/definitions/table/index.d.mts +0 -3
- package/dist/definitions/table/index.d.mts.map +0 -3
- package/dist/definitions/table/index.d.ts +0 -3
- package/dist/definitions/table/index.d.ts.map +1 -1
- package/dist/hooks/index.d.cts +0 -1
- package/dist/hooks/index.d.cts.map +1 -1
- package/dist/hooks/index.d.mts +0 -1
- package/dist/hooks/index.d.mts.map +0 -1
- package/dist/hooks/index.d.ts +0 -1
- package/dist/hooks/index.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 +8 -8
- package/src/components/pages/index.tsx +0 -2
- package/src/definitions/table/index.ts +0 -3
- package/src/hooks/index.ts +0 -1
- package/tsconfig.json +1 -1
- package/vitest.config.mts +43 -0
- package/dist/components/pages/login/index.d.cts +0 -15
- package/dist/components/pages/login/index.d.cts.map +0 -1
- package/dist/components/pages/login/index.d.mts +0 -15
- package/dist/components/pages/login/index.d.mts.map +0 -15
- package/dist/components/pages/login/index.d.ts +0 -15
- package/dist/components/pages/login/index.d.ts.map +0 -1
- package/dist/components/pages/login/styles.d.cts +0 -6
- package/dist/components/pages/login/styles.d.cts.map +0 -1
- package/dist/components/pages/login/styles.d.mts +0 -6
- package/dist/components/pages/login/styles.d.mts.map +0 -6
- package/dist/components/pages/login/styles.d.ts +0 -6
- package/dist/components/pages/login/styles.d.ts.map +0 -1
- package/dist/components/pages/ready/index.d.cts +0 -9
- package/dist/components/pages/ready/index.d.cts.map +0 -1
- package/dist/components/pages/ready/index.d.mts +0 -9
- package/dist/components/pages/ready/index.d.mts.map +0 -9
- package/dist/components/pages/ready/index.d.ts +0 -9
- package/dist/components/pages/ready/index.d.ts.map +0 -1
- package/dist/hooks/useSiderVisible/index.d.cts +0 -11
- package/dist/hooks/useSiderVisible/index.d.cts.map +0 -1
- package/dist/hooks/useSiderVisible/index.d.mts +0 -11
- package/dist/hooks/useSiderVisible/index.d.mts.map +0 -11
- package/dist/hooks/useSiderVisible/index.d.ts +0 -11
- package/dist/hooks/useSiderVisible/index.d.ts.map +0 -1
- package/src/components/pages/login/index.tsx +0 -147
- package/src/components/pages/login/styles.ts +0 -25
- package/src/components/pages/ready/index.tsx +0 -87
- package/src/hooks/useSiderVisible/index.ts +0 -29
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@refinedev/antd",
|
|
3
|
-
"version": "6.0.
|
|
3
|
+
"version": "6.0.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Ant Design UI support for Refine, offering enterprise-level UI components.",
|
|
6
6
|
"repository": {
|
|
@@ -47,27 +47,25 @@
|
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@esbuild-plugins/node-resolve": "^0.1.4",
|
|
49
49
|
"@refinedev/cli": "^2.16.48",
|
|
50
|
-
"@refinedev/core": "^5.0.
|
|
50
|
+
"@refinedev/core": "^5.0.2",
|
|
51
51
|
"@refinedev/ui-tests": "^2.0.0",
|
|
52
52
|
"@testing-library/jest-dom": "^6.6.3",
|
|
53
53
|
"@testing-library/react": "^16.3.0",
|
|
54
54
|
"@testing-library/react-hooks": "^8.0.1",
|
|
55
55
|
"@testing-library/user-event": "^14.6.1",
|
|
56
|
-
"@types/jest": "^29.2.4",
|
|
57
56
|
"@types/lodash": "^4.14.171",
|
|
58
57
|
"@types/node": "^20",
|
|
59
58
|
"@types/react": "^19.1.0",
|
|
60
59
|
"@types/react-dom": "^19.1.0",
|
|
60
|
+
"@vitest/ui": "^2.1.8",
|
|
61
61
|
"esbuild-copy-static-files": "^0.1.0",
|
|
62
62
|
"esbuild-plugin-inline-image": "^0.0.8",
|
|
63
63
|
"identity-obj-proxy": "^3.0.0",
|
|
64
|
-
"jest": "^30.0.5",
|
|
65
|
-
"jest-environment-jsdom": "^30.0.5",
|
|
66
64
|
"postcss": "^8.1.4",
|
|
67
65
|
"react-router": "^7.0.2",
|
|
68
|
-
"ts-jest": "^29.1.2",
|
|
69
66
|
"tsup": "^6.7.0",
|
|
70
|
-
"typescript": "^5.8.3"
|
|
67
|
+
"typescript": "^5.8.3",
|
|
68
|
+
"vitest": "^2.1.8"
|
|
71
69
|
},
|
|
72
70
|
"peerDependencies": {
|
|
73
71
|
"@refinedev/core": "^5.0.0",
|
|
@@ -89,7 +87,9 @@
|
|
|
89
87
|
"build": "tsup && node ../shared/generate-declarations.js",
|
|
90
88
|
"dev": "tsup --watch",
|
|
91
89
|
"publint": "publint --strict=true --level=suggestion",
|
|
92
|
-
"test": "
|
|
90
|
+
"test": "vitest run",
|
|
91
|
+
"test:ui": "vitest --ui",
|
|
92
|
+
"test:watch": "vitest",
|
|
93
93
|
"types": "node ../shared/generate-declarations.js"
|
|
94
94
|
}
|
|
95
95
|
}
|
package/src/hooks/index.ts
CHANGED
package/tsconfig.json
CHANGED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { defineConfig } from "vitest/config";
|
|
2
|
+
import path from "path";
|
|
3
|
+
|
|
4
|
+
export default defineConfig({
|
|
5
|
+
test: {
|
|
6
|
+
environment: "jsdom",
|
|
7
|
+
setupFiles: ["./test/vitest.setup.ts"],
|
|
8
|
+
coverage: {
|
|
9
|
+
provider: "v8",
|
|
10
|
+
reporter: ["text", "json", "html"],
|
|
11
|
+
reportsDirectory: "./coverage",
|
|
12
|
+
exclude: ["src/index.ts", "src/interfaces/**"],
|
|
13
|
+
},
|
|
14
|
+
globals: true,
|
|
15
|
+
},
|
|
16
|
+
resolve: {
|
|
17
|
+
alias: {
|
|
18
|
+
// Path mappings from tsconfig.json
|
|
19
|
+
"@components": path.resolve(__dirname, "./src/components"),
|
|
20
|
+
"@components/*": path.resolve(__dirname, "./src/components/*"),
|
|
21
|
+
"@containers": path.resolve(__dirname, "./src/containers"),
|
|
22
|
+
"@containers/*": path.resolve(__dirname, "./src/containers/*"),
|
|
23
|
+
"@pages": path.resolve(__dirname, "./src/pages"),
|
|
24
|
+
"@pages/*": path.resolve(__dirname, "./src/pages/*"),
|
|
25
|
+
"@contexts": path.resolve(__dirname, "./src/contexts"),
|
|
26
|
+
"@contexts/*": path.resolve(__dirname, "./src/contexts/*"),
|
|
27
|
+
"@dataProviders": path.resolve(__dirname, "./src/dataProviders"),
|
|
28
|
+
"@dataProviders/*": path.resolve(__dirname, "./src/dataProviders/*"),
|
|
29
|
+
"@hooks": path.resolve(__dirname, "./src/hooks"),
|
|
30
|
+
"@hooks/*": path.resolve(__dirname, "./src/hooks/*"),
|
|
31
|
+
"@test": path.resolve(__dirname, "./test"),
|
|
32
|
+
"@test/*": path.resolve(__dirname, "./test/*"),
|
|
33
|
+
"@definitions": path.resolve(__dirname, "./src/definitions"),
|
|
34
|
+
"@definitions/*": path.resolve(__dirname, "./src/definitions/*"),
|
|
35
|
+
// Handle .js extension mapping
|
|
36
|
+
"^(..?/.+)\\.js?$": "$1",
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
assetsInclude: ["**/*.svg"],
|
|
40
|
+
esbuild: {
|
|
41
|
+
target: "node22",
|
|
42
|
+
},
|
|
43
|
+
});
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import type { LoginPageProps } from "@refinedev/core";
|
|
3
|
-
export interface ILoginForm {
|
|
4
|
-
username: string;
|
|
5
|
-
password: string;
|
|
6
|
-
remember: boolean;
|
|
7
|
-
}
|
|
8
|
-
/**
|
|
9
|
-
* @deprecated LoginPage is deprecated. Use AuthPage instead. @see {@link https://refine.dev/docs/api-reference/antd/components/antd-auth-page} for more details.
|
|
10
|
-
* **refine** has a default login page form which is served on `/login` route when the `authProvider` configuration is provided.
|
|
11
|
-
*
|
|
12
|
-
* @see {@link https://refine.dev/docs/api-reference/core/components/refine-config/#loginpage} for more details.
|
|
13
|
-
*/
|
|
14
|
-
export declare const LoginPage: React.FC<LoginPageProps>;
|
|
15
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/pages/login/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAqBtD,MAAM,WAAW,UAAU;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED;;;;;GAKG;AACH,eAAO,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,cAAc,CAgH9C,CAAC"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import type { LoginPageProps } from "@refinedev/core";
|
|
3
|
-
export interface ILoginForm {
|
|
4
|
-
username: string;
|
|
5
|
-
password: string;
|
|
6
|
-
remember: boolean;
|
|
7
|
-
}
|
|
8
|
-
/**
|
|
9
|
-
* @deprecated LoginPage is deprecated. Use AuthPage instead. @see {@link https://refine.dev/docs/api-reference/antd/components/antd-auth-page} for more details.
|
|
10
|
-
* **refine** has a default login page form which is served on `/login` route when the `authProvider` configuration is provided.
|
|
11
|
-
*
|
|
12
|
-
* @see {@link https://refine.dev/docs/api-reference/core/components/refine-config/#loginpage} for more details.
|
|
13
|
-
*/
|
|
14
|
-
export declare const LoginPage: React.FC<LoginPageProps>;
|
|
15
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import type { LoginPageProps } from "@refinedev/core";
|
|
3
|
-
export interface ILoginForm {
|
|
4
|
-
username: string;
|
|
5
|
-
password: string;
|
|
6
|
-
remember: boolean;
|
|
7
|
-
}
|
|
8
|
-
/**
|
|
9
|
-
* @deprecated LoginPage is deprecated. Use AuthPage instead. @see {@link https://refine.dev/docs/api-reference/antd/components/antd-auth-page} for more details.
|
|
10
|
-
* **refine** has a default login page form which is served on `/login` route when the `authProvider` configuration is provided.
|
|
11
|
-
*
|
|
12
|
-
* @see {@link https://refine.dev/docs/api-reference/core/components/refine-config/#loginpage} for more details.
|
|
13
|
-
*/
|
|
14
|
-
export declare const LoginPage: React.FC<LoginPageProps>;
|
|
15
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import type { LoginPageProps } from "@refinedev/core";
|
|
3
|
-
export interface ILoginForm {
|
|
4
|
-
username: string;
|
|
5
|
-
password: string;
|
|
6
|
-
remember: boolean;
|
|
7
|
-
}
|
|
8
|
-
/**
|
|
9
|
-
* @deprecated LoginPage is deprecated. Use AuthPage instead. @see {@link https://refine.dev/docs/api-reference/antd/components/antd-auth-page} for more details.
|
|
10
|
-
* **refine** has a default login page form which is served on `/login` route when the `authProvider` configuration is provided.
|
|
11
|
-
*
|
|
12
|
-
* @see {@link https://refine.dev/docs/api-reference/core/components/refine-config/#loginpage} for more details.
|
|
13
|
-
*/
|
|
14
|
-
export declare const LoginPage: React.FC<LoginPageProps>;
|
|
15
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/pages/login/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAqBtD,MAAM,WAAW,UAAU;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED;;;;;GAKG;AACH,eAAO,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,cAAc,CAgH9C,CAAC"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { CSSProperties } from "react";
|
|
2
|
-
export declare const layoutStyles: CSSProperties;
|
|
3
|
-
export declare const containerStyles: CSSProperties;
|
|
4
|
-
export declare const titleStyles: CSSProperties;
|
|
5
|
-
export declare const imageContainer: CSSProperties;
|
|
6
|
-
//# sourceMappingURL=styles.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../src/components/pages/login/styles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAE3C,eAAO,MAAM,YAAY,EAAE,aAG1B,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,aAG7B,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,aAKzB,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,aAK5B,CAAC"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { CSSProperties } from "react";
|
|
2
|
-
export declare const layoutStyles: CSSProperties;
|
|
3
|
-
export declare const containerStyles: CSSProperties;
|
|
4
|
-
export declare const titleStyles: CSSProperties;
|
|
5
|
-
export declare const imageContainer: CSSProperties;
|
|
6
|
-
//# sourceMappingURL=styles.d.ts.map
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { CSSProperties } from "react";
|
|
2
|
-
export declare const layoutStyles: CSSProperties;
|
|
3
|
-
export declare const containerStyles: CSSProperties;
|
|
4
|
-
export declare const titleStyles: CSSProperties;
|
|
5
|
-
export declare const imageContainer: CSSProperties;
|
|
6
|
-
//# sourceMappingURL=styles.d.ts.map
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { CSSProperties } from "react";
|
|
2
|
-
export declare const layoutStyles: CSSProperties;
|
|
3
|
-
export declare const containerStyles: CSSProperties;
|
|
4
|
-
export declare const titleStyles: CSSProperties;
|
|
5
|
-
export declare const imageContainer: CSSProperties;
|
|
6
|
-
//# sourceMappingURL=styles.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../src/components/pages/login/styles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAE3C,eAAO,MAAM,YAAY,EAAE,aAG1B,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,aAG7B,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,aAKzB,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,aAK5B,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import type { RefineReadyPageProps } from "@refinedev/ui-types";
|
|
3
|
-
/**
|
|
4
|
-
* **refine** shows a default ready page on root route when no `resources` is passed to the `<Refine>` component as a property.
|
|
5
|
-
*
|
|
6
|
-
* @deprecated `ReadyPage` is deprecated and will be removed in the next major release.
|
|
7
|
-
*/
|
|
8
|
-
export declare const ReadyPage: React.FC<RefineReadyPageProps>;
|
|
9
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/pages/ready/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAkChE;;;;GAIG;AACH,eAAO,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CA8CpD,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import type { RefineReadyPageProps } from "@refinedev/ui-types";
|
|
3
|
-
/**
|
|
4
|
-
* **refine** shows a default ready page on root route when no `resources` is passed to the `<Refine>` component as a property.
|
|
5
|
-
*
|
|
6
|
-
* @deprecated `ReadyPage` is deprecated and will be removed in the next major release.
|
|
7
|
-
*/
|
|
8
|
-
export declare const ReadyPage: React.FC<RefineReadyPageProps>;
|
|
9
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import type { RefineReadyPageProps } from "@refinedev/ui-types";
|
|
3
|
-
/**
|
|
4
|
-
* **refine** shows a default ready page on root route when no `resources` is passed to the `<Refine>` component as a property.
|
|
5
|
-
*
|
|
6
|
-
* @deprecated `ReadyPage` is deprecated and will be removed in the next major release.
|
|
7
|
-
*/
|
|
8
|
-
export declare const ReadyPage: React.FC<RefineReadyPageProps>;
|
|
9
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import type { RefineReadyPageProps } from "@refinedev/ui-types";
|
|
3
|
-
/**
|
|
4
|
-
* **refine** shows a default ready page on root route when no `resources` is passed to the `<Refine>` component as a property.
|
|
5
|
-
*
|
|
6
|
-
* @deprecated `ReadyPage` is deprecated and will be removed in the next major release.
|
|
7
|
-
*/
|
|
8
|
-
export declare const ReadyPage: React.FC<RefineReadyPageProps>;
|
|
9
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/pages/ready/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAkChE;;;;GAIG;AACH,eAAO,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CA8CpD,CAAC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export type UseSiderVisibleType = {
|
|
2
|
-
siderVisible: boolean;
|
|
3
|
-
drawerSiderVisible: boolean;
|
|
4
|
-
setSiderVisible: (visible: boolean) => void;
|
|
5
|
-
setDrawerSiderVisible: (visible: boolean) => void;
|
|
6
|
-
};
|
|
7
|
-
/**
|
|
8
|
-
* @deprecated Please use `useThemedLayoutContext` instead.
|
|
9
|
-
*/
|
|
10
|
-
export declare const useSiderVisible: () => UseSiderVisibleType;
|
|
11
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/useSiderVisible/index.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,mBAAmB,GAAG;IAChC,YAAY,EAAE,OAAO,CAAC;IACtB,kBAAkB,EAAE,OAAO,CAAC;IAC5B,eAAe,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IAC5C,qBAAqB,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;CACnD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,eAAe,QAAO,mBAclC,CAAC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export type UseSiderVisibleType = {
|
|
2
|
-
siderVisible: boolean;
|
|
3
|
-
drawerSiderVisible: boolean;
|
|
4
|
-
setSiderVisible: (visible: boolean) => void;
|
|
5
|
-
setDrawerSiderVisible: (visible: boolean) => void;
|
|
6
|
-
};
|
|
7
|
-
/**
|
|
8
|
-
* @deprecated Please use `useThemedLayoutContext` instead.
|
|
9
|
-
*/
|
|
10
|
-
export declare const useSiderVisible: () => UseSiderVisibleType;
|
|
11
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export type UseSiderVisibleType = {
|
|
2
|
-
siderVisible: boolean;
|
|
3
|
-
drawerSiderVisible: boolean;
|
|
4
|
-
setSiderVisible: (visible: boolean) => void;
|
|
5
|
-
setDrawerSiderVisible: (visible: boolean) => void;
|
|
6
|
-
};
|
|
7
|
-
/**
|
|
8
|
-
* @deprecated Please use `useThemedLayoutContext` instead.
|
|
9
|
-
*/
|
|
10
|
-
export declare const useSiderVisible: () => UseSiderVisibleType;
|
|
11
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export type UseSiderVisibleType = {
|
|
2
|
-
siderVisible: boolean;
|
|
3
|
-
drawerSiderVisible: boolean;
|
|
4
|
-
setSiderVisible: (visible: boolean) => void;
|
|
5
|
-
setDrawerSiderVisible: (visible: boolean) => void;
|
|
6
|
-
};
|
|
7
|
-
/**
|
|
8
|
-
* @deprecated Please use `useThemedLayoutContext` instead.
|
|
9
|
-
*/
|
|
10
|
-
export declare const useSiderVisible: () => UseSiderVisibleType;
|
|
11
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/useSiderVisible/index.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,mBAAmB,GAAG;IAChC,YAAY,EAAE,OAAO,CAAC;IACtB,kBAAkB,EAAE,OAAO,CAAC;IAC5B,eAAe,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IAC5C,qBAAqB,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;CACnD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,eAAe,QAAO,mBAclC,CAAC"}
|
|
@@ -1,147 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import type { LoginPageProps } from "@refinedev/core";
|
|
3
|
-
import {
|
|
4
|
-
Row,
|
|
5
|
-
Col,
|
|
6
|
-
Layout,
|
|
7
|
-
Card,
|
|
8
|
-
Typography,
|
|
9
|
-
Form,
|
|
10
|
-
Input,
|
|
11
|
-
Button,
|
|
12
|
-
Checkbox,
|
|
13
|
-
} from "antd";
|
|
14
|
-
import { useLogin, useTranslate } from "@refinedev/core";
|
|
15
|
-
|
|
16
|
-
import {
|
|
17
|
-
layoutStyles,
|
|
18
|
-
containerStyles,
|
|
19
|
-
titleStyles,
|
|
20
|
-
imageContainer,
|
|
21
|
-
} from "./styles";
|
|
22
|
-
|
|
23
|
-
export interface ILoginForm {
|
|
24
|
-
username: string;
|
|
25
|
-
password: string;
|
|
26
|
-
remember: boolean;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* @deprecated LoginPage is deprecated. Use AuthPage instead. @see {@link https://refine.dev/docs/api-reference/antd/components/antd-auth-page} for more details.
|
|
31
|
-
* **refine** has a default login page form which is served on `/login` route when the `authProvider` configuration is provided.
|
|
32
|
-
*
|
|
33
|
-
* @see {@link https://refine.dev/docs/api-reference/core/components/refine-config/#loginpage} for more details.
|
|
34
|
-
*/
|
|
35
|
-
export const LoginPage: React.FC<LoginPageProps> = () => {
|
|
36
|
-
const [form] = Form.useForm<ILoginForm>();
|
|
37
|
-
const translate = useTranslate();
|
|
38
|
-
|
|
39
|
-
const { mutate: login, isPending } = useLogin<ILoginForm>();
|
|
40
|
-
|
|
41
|
-
const CardTitle = (
|
|
42
|
-
<Typography.Title level={3} style={titleStyles}>
|
|
43
|
-
{translate("pages.login.title", "Sign in your account")}
|
|
44
|
-
</Typography.Title>
|
|
45
|
-
);
|
|
46
|
-
|
|
47
|
-
return (
|
|
48
|
-
<Layout style={layoutStyles}>
|
|
49
|
-
<Row
|
|
50
|
-
justify="center"
|
|
51
|
-
align="middle"
|
|
52
|
-
style={{
|
|
53
|
-
height: "100vh",
|
|
54
|
-
}}
|
|
55
|
-
>
|
|
56
|
-
<Col xs={22}>
|
|
57
|
-
<div style={containerStyles}>
|
|
58
|
-
<div style={imageContainer}>
|
|
59
|
-
<img
|
|
60
|
-
src="https://refine.ams3.cdn.digitaloceanspaces.com/logo/refine.svg"
|
|
61
|
-
alt="Refine Logo"
|
|
62
|
-
/>
|
|
63
|
-
</div>
|
|
64
|
-
<Card
|
|
65
|
-
title={CardTitle}
|
|
66
|
-
styles={{
|
|
67
|
-
header: { borderBottom: 0 },
|
|
68
|
-
}}
|
|
69
|
-
>
|
|
70
|
-
<Form<ILoginForm>
|
|
71
|
-
layout="vertical"
|
|
72
|
-
form={form}
|
|
73
|
-
onFinish={(values) => {
|
|
74
|
-
login(values);
|
|
75
|
-
}}
|
|
76
|
-
requiredMark={false}
|
|
77
|
-
initialValues={{
|
|
78
|
-
remember: false,
|
|
79
|
-
}}
|
|
80
|
-
>
|
|
81
|
-
<Form.Item
|
|
82
|
-
name="username"
|
|
83
|
-
label={translate("pages.login.username", "Username")}
|
|
84
|
-
rules={[{ required: true }]}
|
|
85
|
-
>
|
|
86
|
-
<Input
|
|
87
|
-
size="large"
|
|
88
|
-
placeholder={translate("pages.login.username", "Username")}
|
|
89
|
-
/>
|
|
90
|
-
</Form.Item>
|
|
91
|
-
<Form.Item
|
|
92
|
-
name="password"
|
|
93
|
-
label={translate("pages.login.password", "Password")}
|
|
94
|
-
rules={[{ required: true }]}
|
|
95
|
-
style={{ marginBottom: "12px" }}
|
|
96
|
-
>
|
|
97
|
-
<Input type="password" placeholder="●●●●●●●●" size="large" />
|
|
98
|
-
</Form.Item>
|
|
99
|
-
<div style={{ marginBottom: "12px" }}>
|
|
100
|
-
<Form.Item name="remember" valuePropName="checked" noStyle>
|
|
101
|
-
<Checkbox
|
|
102
|
-
style={{
|
|
103
|
-
fontSize: "12px",
|
|
104
|
-
}}
|
|
105
|
-
>
|
|
106
|
-
{translate("pages.login.remember", "Remember me")}
|
|
107
|
-
</Checkbox>
|
|
108
|
-
</Form.Item>
|
|
109
|
-
|
|
110
|
-
<a
|
|
111
|
-
style={{
|
|
112
|
-
float: "right",
|
|
113
|
-
fontSize: "12px",
|
|
114
|
-
}}
|
|
115
|
-
href="#"
|
|
116
|
-
>
|
|
117
|
-
{translate(
|
|
118
|
-
"pages.login.forgotPassword",
|
|
119
|
-
"Forgot password?",
|
|
120
|
-
)}
|
|
121
|
-
</a>
|
|
122
|
-
</div>
|
|
123
|
-
<Button
|
|
124
|
-
type="primary"
|
|
125
|
-
size="large"
|
|
126
|
-
htmlType="submit"
|
|
127
|
-
loading={isPending}
|
|
128
|
-
block
|
|
129
|
-
>
|
|
130
|
-
{translate("pages.login.signin", "Sign in")}
|
|
131
|
-
</Button>
|
|
132
|
-
</Form>
|
|
133
|
-
<div style={{ marginTop: 8 }}>
|
|
134
|
-
<Typography.Text style={{ fontSize: 12 }}>
|
|
135
|
-
{translate("pages.login.noAccount", "Don’t have an account?")}{" "}
|
|
136
|
-
<a href="#" style={{ fontWeight: "bold" }}>
|
|
137
|
-
{translate("pages.login.signup", "Sign up")}
|
|
138
|
-
</a>
|
|
139
|
-
</Typography.Text>
|
|
140
|
-
</div>
|
|
141
|
-
</Card>
|
|
142
|
-
</div>
|
|
143
|
-
</Col>
|
|
144
|
-
</Row>
|
|
145
|
-
</Layout>
|
|
146
|
-
);
|
|
147
|
-
};
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import type { CSSProperties } from "react";
|
|
2
|
-
|
|
3
|
-
export const layoutStyles: CSSProperties = {
|
|
4
|
-
background: "radial-gradient(50% 50% at 50% 50%, #63386A 0%, #310438 100%)",
|
|
5
|
-
backgroundSize: "cover",
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
export const containerStyles: CSSProperties = {
|
|
9
|
-
maxWidth: "408px",
|
|
10
|
-
margin: "auto",
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
export const titleStyles: CSSProperties = {
|
|
14
|
-
textAlign: "center",
|
|
15
|
-
color: "#626262",
|
|
16
|
-
fontSize: "30px",
|
|
17
|
-
letterSpacing: "-0.04em",
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
export const imageContainer: CSSProperties = {
|
|
21
|
-
display: "flex",
|
|
22
|
-
alignItems: "center",
|
|
23
|
-
justifyContent: "center",
|
|
24
|
-
marginBottom: "28px",
|
|
25
|
-
};
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import type { RefineReadyPageProps } from "@refinedev/ui-types";
|
|
3
|
-
import { Row, Col, Typography, Space, Button } from "antd";
|
|
4
|
-
import { ReadOutlined, FolderOutlined, TeamOutlined } from "@ant-design/icons";
|
|
5
|
-
|
|
6
|
-
const styles: { [key: string]: React.CSSProperties } = {
|
|
7
|
-
root: {
|
|
8
|
-
height: "100vh",
|
|
9
|
-
backgroundImage:
|
|
10
|
-
"url('https://refine.ams3.cdn.digitaloceanspaces.com/login-background/background.png')",
|
|
11
|
-
backgroundSize: "cover",
|
|
12
|
-
backgroundColor: "#331049",
|
|
13
|
-
},
|
|
14
|
-
title: {
|
|
15
|
-
color: "white",
|
|
16
|
-
fontWeight: 800,
|
|
17
|
-
fontSize: "64px",
|
|
18
|
-
marginBottom: "8px",
|
|
19
|
-
},
|
|
20
|
-
p1: {
|
|
21
|
-
color: "white",
|
|
22
|
-
marginBottom: 0,
|
|
23
|
-
fontSize: "20px",
|
|
24
|
-
fontWeight: "bold",
|
|
25
|
-
},
|
|
26
|
-
p2: {
|
|
27
|
-
color: "white",
|
|
28
|
-
fontSize: "20px",
|
|
29
|
-
},
|
|
30
|
-
code: {
|
|
31
|
-
backgroundColor: "white",
|
|
32
|
-
color: "#331049",
|
|
33
|
-
},
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* **refine** shows a default ready page on root route when no `resources` is passed to the `<Refine>` component as a property.
|
|
38
|
-
*
|
|
39
|
-
* @deprecated `ReadyPage` is deprecated and will be removed in the next major release.
|
|
40
|
-
*/
|
|
41
|
-
export const ReadyPage: React.FC<RefineReadyPageProps> = () => {
|
|
42
|
-
return (
|
|
43
|
-
<Row align="middle" justify="center" style={styles.root}>
|
|
44
|
-
<Col style={{ textAlign: "center" }}>
|
|
45
|
-
<img
|
|
46
|
-
style={{ marginBottom: "48px" }}
|
|
47
|
-
src="https://refine.ams3.cdn.digitaloceanspaces.com/logo/refine.svg"
|
|
48
|
-
alt="Refine Logo"
|
|
49
|
-
/>
|
|
50
|
-
<Typography.Title style={styles.title}>
|
|
51
|
-
Welcome on board
|
|
52
|
-
</Typography.Title>
|
|
53
|
-
<p style={styles.p1}>Your configuration is completed.</p>
|
|
54
|
-
<p style={styles.p2}>
|
|
55
|
-
Now you can get started by adding your resources to the{" "}
|
|
56
|
-
<code style={styles.code}>{"resources"}</code> property of{" "}
|
|
57
|
-
<code style={styles.code}>{"<Refine>"}</code>
|
|
58
|
-
</p>
|
|
59
|
-
<Space
|
|
60
|
-
size="large"
|
|
61
|
-
wrap
|
|
62
|
-
style={{ marginTop: "70px", justifyContent: "center" }}
|
|
63
|
-
>
|
|
64
|
-
<a href="https://refine.dev" target="_blank" rel="noreferrer">
|
|
65
|
-
<Button size="large" icon={<ReadOutlined />}>
|
|
66
|
-
Documentation
|
|
67
|
-
</Button>
|
|
68
|
-
</a>
|
|
69
|
-
<a
|
|
70
|
-
href="https://refine.dev/examples"
|
|
71
|
-
target="_blank"
|
|
72
|
-
rel="noreferrer"
|
|
73
|
-
>
|
|
74
|
-
<Button size="large" icon={<FolderOutlined />}>
|
|
75
|
-
Examples
|
|
76
|
-
</Button>
|
|
77
|
-
</a>
|
|
78
|
-
<a href="https://discord.gg/refine" target="_blank" rel="noreferrer">
|
|
79
|
-
<Button size="large" icon={<TeamOutlined />}>
|
|
80
|
-
Community
|
|
81
|
-
</Button>
|
|
82
|
-
</a>
|
|
83
|
-
</Space>
|
|
84
|
-
</Col>
|
|
85
|
-
</Row>
|
|
86
|
-
);
|
|
87
|
-
};
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { useContext } from "react";
|
|
2
|
-
|
|
3
|
-
import { ThemedLayoutContext } from "@contexts";
|
|
4
|
-
|
|
5
|
-
export type UseSiderVisibleType = {
|
|
6
|
-
siderVisible: boolean;
|
|
7
|
-
drawerSiderVisible: boolean;
|
|
8
|
-
setSiderVisible: (visible: boolean) => void;
|
|
9
|
-
setDrawerSiderVisible: (visible: boolean) => void;
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* @deprecated Please use `useThemedLayoutContext` instead.
|
|
14
|
-
*/
|
|
15
|
-
export const useSiderVisible = (): UseSiderVisibleType => {
|
|
16
|
-
const {
|
|
17
|
-
mobileSiderOpen,
|
|
18
|
-
siderCollapsed,
|
|
19
|
-
setMobileSiderOpen,
|
|
20
|
-
setSiderCollapsed,
|
|
21
|
-
} = useContext(ThemedLayoutContext);
|
|
22
|
-
|
|
23
|
-
return {
|
|
24
|
-
siderVisible: mobileSiderOpen,
|
|
25
|
-
setSiderVisible: setMobileSiderOpen,
|
|
26
|
-
drawerSiderVisible: siderCollapsed,
|
|
27
|
-
setDrawerSiderVisible: setSiderCollapsed,
|
|
28
|
-
};
|
|
29
|
-
};
|