@refinedev/core 4.5.9 → 4.6.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/CHANGELOG.md +39 -0
- package/dist/esm/index.js +2 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/hooks/router/use-parse/index.d.ts +4 -2
- package/dist/hooks/router/use-parse/index.d.ts.map +1 -1
- package/dist/hooks/router/use-parsed/index.d.ts +1 -1
- package/dist/hooks/router/use-parsed/index.d.ts.map +1 -1
- package/dist/iife/index.js +2 -2
- package/dist/iife/index.js.map +1 -1
- package/dist/index.js +6 -6
- package/dist/index.js.map +1 -1
- package/dist/interfaces/bindings/router.d.ts +5 -8
- package/dist/interfaces/bindings/router.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/gh-banner/index.tsx +3 -3
- package/src/hooks/router/use-parse/index.tsx +7 -3
- package/src/hooks/router/use-parsed/index.tsx +4 -2
- package/src/interfaces/bindings/router.ts +11 -6
|
@@ -39,17 +39,14 @@ export declare type GoConfig = {
|
|
|
39
39
|
};
|
|
40
40
|
type?: "push" | "replace" | "path";
|
|
41
41
|
};
|
|
42
|
-
export declare type ParsedParams = {
|
|
42
|
+
export declare type ParsedParams<TParams extends Record<string, any> = Record<string, any>> = {
|
|
43
43
|
filters?: CrudFilters;
|
|
44
44
|
sorters?: CrudSorting;
|
|
45
45
|
current?: number;
|
|
46
46
|
pageSize?: number;
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
};
|
|
51
|
-
export declare type ParseResponse = {
|
|
52
|
-
params?: ParsedParams;
|
|
47
|
+
} & TParams;
|
|
48
|
+
export declare type ParseResponse<TParams extends Record<string, any> = Record<string, any>> = {
|
|
49
|
+
params?: ParsedParams<TParams>;
|
|
53
50
|
resource?: IResourceItem;
|
|
54
51
|
id?: BaseKey;
|
|
55
52
|
action?: Action;
|
|
@@ -57,7 +54,7 @@ export declare type ParseResponse = {
|
|
|
57
54
|
};
|
|
58
55
|
export declare type GoFunction = (config: GoConfig) => void | string;
|
|
59
56
|
export declare type BackFunction = () => void;
|
|
60
|
-
export declare type ParseFunction = () => ParseResponse
|
|
57
|
+
export declare type ParseFunction<TParams extends Record<string, any> = Record<string, any>> = () => ParseResponse<TParams>;
|
|
61
58
|
export declare type RouterBindings = {
|
|
62
59
|
go?: () => GoFunction;
|
|
63
60
|
back?: () => BackFunction;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../../../src/interfaces/bindings/router.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;;AAEH,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AACvE,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC;AAErC,oBAAY,QAAQ,GAAG;IACnB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE;QACN,SAAS,CAAC,EAAE,OAAO,CAAC;QACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;KACtB,CAAC;IACF,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAAC;CACtC,CAAC;AAEF,oBAAY,YAAY,GAAG;
|
|
1
|
+
{"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../../../src/interfaces/bindings/router.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;;AAEH,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AACvE,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,M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MAAM,aAAa,CAAC,OAAO,CAAC,CAAC;AAEjC,oBAAY,cAAc,GAAG;IACzB,EAAE,CAAC,EAAE,MAAM,UAAU,CAAC;IACtB,IAAI,CAAC,EAAE,MAAM,YAAY,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,aAAa,CAAC;IAC5B,IAAI,CAAC,EAAE,KAAK,CAAC,aAAa,CACtB,KAAK,CAAC,iBAAiB,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,CAAC,IAAI,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,CAAC,CAC/D,CAAC;CACL,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@refinedev/core",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.6.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",
|
|
@@ -26,7 +26,7 @@ export const GitHubBanner = () => {
|
|
|
26
26
|
>
|
|
27
27
|
<a
|
|
28
28
|
className="gh-link"
|
|
29
|
-
href="https://
|
|
29
|
+
href="https://www.producthunt.com/posts/refine-new"
|
|
30
30
|
target="_blank"
|
|
31
31
|
rel="noreferrer"
|
|
32
32
|
>
|
|
@@ -65,8 +65,8 @@ export const GitHubBanner = () => {
|
|
|
65
65
|
textShadow: "0px 0px 4px rgba(255, 255, 255, 0.5)",
|
|
66
66
|
}}
|
|
67
67
|
>
|
|
68
|
-
|
|
69
|
-
|
|
68
|
+
Our new refine tool has just been launched on Product
|
|
69
|
+
Hunt 😻 We would greatly appreciate your support!
|
|
70
70
|
</span>
|
|
71
71
|
</div>
|
|
72
72
|
</a>
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import { RouterBindingsContext } from "@contexts/router";
|
|
2
2
|
import React, { useContext } from "react";
|
|
3
|
-
import { ParseFunction } from "src/interfaces";
|
|
3
|
+
import { ParseFunction, ParseResponse } from "src/interfaces";
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
type UseParseType = () => <
|
|
6
|
+
TParams extends Record<string, any> = Record<string, any>,
|
|
7
|
+
>() => ParseResponse<TParams>;
|
|
8
|
+
|
|
9
|
+
export const useParse: UseParseType = () => {
|
|
6
10
|
const bindings = useContext(RouterBindingsContext);
|
|
7
11
|
|
|
8
12
|
const useParse = React.useMemo(
|
|
@@ -17,5 +21,5 @@ export const useParse = () => {
|
|
|
17
21
|
|
|
18
22
|
const parse = useParse();
|
|
19
23
|
|
|
20
|
-
return parse
|
|
24
|
+
return parse as ReturnType<UseParseType>;
|
|
21
25
|
};
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { useParse } from "../use-parse";
|
|
3
3
|
|
|
4
|
-
export const useParsed =
|
|
4
|
+
export const useParsed = <
|
|
5
|
+
TParams extends Record<string, any> = Record<string, any>,
|
|
6
|
+
>() => {
|
|
5
7
|
const parse = useParse();
|
|
6
8
|
|
|
7
|
-
const parsed = React.useMemo(() => parse(), [parse]);
|
|
9
|
+
const parsed = React.useMemo(() => parse<TParams>(), [parse]);
|
|
8
10
|
|
|
9
11
|
return parsed;
|
|
10
12
|
};
|
|
@@ -41,16 +41,19 @@ export type GoConfig = {
|
|
|
41
41
|
type?: "push" | "replace" | "path";
|
|
42
42
|
};
|
|
43
43
|
|
|
44
|
-
export type ParsedParams
|
|
44
|
+
export type ParsedParams<
|
|
45
|
+
TParams extends Record<string, any> = Record<string, any>,
|
|
46
|
+
> = {
|
|
45
47
|
filters?: CrudFilters;
|
|
46
48
|
sorters?: CrudSorting;
|
|
47
49
|
current?: number;
|
|
48
50
|
pageSize?: number;
|
|
49
|
-
|
|
50
|
-
};
|
|
51
|
+
} & TParams;
|
|
51
52
|
|
|
52
|
-
export type ParseResponse
|
|
53
|
-
|
|
53
|
+
export type ParseResponse<
|
|
54
|
+
TParams extends Record<string, any> = Record<string, any>,
|
|
55
|
+
> = {
|
|
56
|
+
params?: ParsedParams<TParams>;
|
|
54
57
|
resource?: IResourceItem;
|
|
55
58
|
id?: BaseKey;
|
|
56
59
|
action?: Action;
|
|
@@ -61,7 +64,9 @@ export type GoFunction = (config: GoConfig) => void | string;
|
|
|
61
64
|
|
|
62
65
|
export type BackFunction = () => void;
|
|
63
66
|
|
|
64
|
-
export type ParseFunction
|
|
67
|
+
export type ParseFunction<
|
|
68
|
+
TParams extends Record<string, any> = Record<string, any>,
|
|
69
|
+
> = () => ParseResponse<TParams>;
|
|
65
70
|
|
|
66
71
|
export type RouterBindings = {
|
|
67
72
|
go?: () => GoFunction;
|