@refinedev/core 4.51.0 → 4.52.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 +31 -0
- package/LICENSE +21 -0
- package/dist/components/authenticated/index.d.mts.map +75 -1
- package/dist/components/autoSaveIndicator/index.d.cts.map +1 -1
- package/dist/components/autoSaveIndicator/index.d.mts.map +24 -1
- package/dist/components/autoSaveIndicator/index.d.ts.map +1 -1
- package/dist/components/canAccess/index.d.mts.map +52 -1
- package/dist/components/containers/index.d.mts.map +2 -1
- package/dist/components/containers/refine/index.d.mts.map +11 -1
- package/dist/components/gh-banner/index.d.mts.map +7 -1
- package/dist/components/gh-banner/styles.d.mts.map +2 -1
- package/dist/components/index.d.mts.map +10 -1
- package/dist/components/layoutWrapper/defaultLayout/index.d.mts.map +4 -1
- package/dist/components/layoutWrapper/index.d.mts.map +46 -1
- package/dist/components/pages/auth/components/forgotPassword/index.d.mts.map +7 -1
- package/dist/components/pages/auth/components/index.d.mts.map +5 -1
- package/dist/components/pages/auth/components/login/index.d.mts.map +7 -1
- package/dist/components/pages/auth/components/register/index.d.mts.map +7 -1
- package/dist/components/pages/auth/components/updatePassword/index.d.mts.map +7 -1
- package/dist/components/pages/auth/index.d.mts.map +12 -1
- package/dist/components/pages/auth/types.d.mts.map +179 -1
- package/dist/components/pages/config-error/index.d.mts.map +3 -1
- package/dist/components/pages/config-success/index.d.mts.map +6 -1
- package/dist/components/pages/error/index.d.mts.map +9 -1
- package/dist/components/pages/index.d.mts.map +7 -1
- package/dist/components/pages/login/index.d.mts.map +13 -1
- package/dist/components/pages/ready/index.d.mts.map +8 -1
- package/dist/components/pages/welcome/index.d.mts.map +3 -1
- package/dist/components/routeChangeHandler/index.d.mts.map +3 -1
- package/dist/components/telemetry/index.d.mts.map +3 -1
- package/dist/components/telemetry/types.d.mts.map +16 -1
- package/dist/components/undoableQueue/index.d.mts.map +6 -1
- package/dist/contexts/accessControl/index.d.mts.map +7 -1
- package/dist/contexts/accessControl/types.d.mts.map +84 -1
- package/dist/contexts/auditLog/index.d.mts.map +5 -1
- package/dist/contexts/auditLog/types.d.mts.map +41 -1
- package/dist/contexts/auth/index.d.mts.map +18 -1
- package/dist/contexts/auth/types.d.mts.map +101 -1
- package/dist/contexts/data/index.d.mts.map +10 -1
- package/dist/contexts/data/types.d.mts.map +347 -1
- package/dist/contexts/i18n/index.d.mts.map +7 -1
- package/dist/contexts/i18n/types.d.mts.map +13 -1
- package/dist/contexts/live/index.d.mts.map +5 -1
- package/dist/contexts/live/types.d.mts.map +96 -1
- package/dist/contexts/notification/index.d.mts.map +7 -1
- package/dist/contexts/notification/types.d.mts.map +27 -1
- package/dist/contexts/refine/index.d.mts.map +6 -1
- package/dist/contexts/refine/types.d.mts.map +325 -1
- package/dist/contexts/resource/index.d.mts.map +7 -1
- package/dist/contexts/resource/types.d.mts.map +168 -1
- package/dist/contexts/router/index.d.mts.map +7 -1
- package/dist/contexts/router/legacy/index.d.mts.map +6 -1
- package/dist/contexts/router/legacy/types.d.mts.map +47 -1
- package/dist/contexts/router/picker/index.d.mts.map +15 -1
- package/dist/contexts/router/types.d.mts.map +67 -1
- package/dist/contexts/undoableQueue/index.d.mts.map +6 -1
- package/dist/contexts/undoableQueue/types.d.mts.map +21 -1
- package/dist/contexts/unsavedWarn/index.d.mts.map +5 -1
- package/dist/contexts/unsavedWarn/types.d.mts.map +5 -1
- package/dist/definitions/helpers/async-debounce/index.d.mts.map +18 -1
- package/dist/definitions/helpers/check-router-prop-misuse/index.d.mts.map +4 -1
- package/dist/definitions/helpers/defer-execution/index.d.mts.map +9 -1
- package/dist/definitions/helpers/downloadInBrowser/index.d.mts.map +2 -1
- package/dist/definitions/helpers/flatten-object-keys/index.d.mts.map +4 -1
- package/dist/definitions/helpers/generateDocumentTitle/index.d.mts.map +7 -1
- package/dist/definitions/helpers/handleMultiple/index.d.mts.map +6 -1
- package/dist/definitions/helpers/handlePaginationParams/index.d.mts.map +9 -1
- package/dist/definitions/helpers/handleRefineOptions/index.d.mts.map +26 -1
- package/dist/definitions/helpers/handleUseParams/index.d.mts.map +2 -1
- package/dist/definitions/helpers/hasPermission/index.d.mts.map +2 -1
- package/dist/definitions/helpers/humanizeString/index.d.mts.map +2 -1
- package/dist/definitions/helpers/importCSVMapper/index.d.mts.map +3 -1
- package/dist/definitions/helpers/index.d.mts.map +34 -1
- package/dist/definitions/helpers/keys/index.d.mts.map +64 -1
- package/dist/definitions/helpers/legacy-resource-transform/index.d.mts.map +9 -1
- package/dist/definitions/helpers/menu/create-resource-key.d.mts.map +3 -1
- package/dist/definitions/helpers/menu/create-tree.d.mts.map +13 -1
- package/dist/definitions/helpers/pick-resource/index.d.mts.map +8 -1
- package/dist/definitions/helpers/pickDataProvider/index.d.mts.map +6 -1
- package/dist/definitions/helpers/pickNotDeprecated/index.d.mts.map +2 -1
- package/dist/definitions/helpers/prepare-query-context/index.d.mts.map +3 -1
- package/dist/definitions/helpers/property-path-to-array/index.d.mts.map +2 -1
- package/dist/definitions/helpers/queryKeys/index.d.mts.map +7 -1
- package/dist/definitions/helpers/redirectPage/index.d.mts.map +11 -1
- package/dist/definitions/helpers/routeGenerator/index.d.mts.map +7 -1
- package/dist/definitions/helpers/router/check-by-segments.d.mts.map +9 -1
- package/dist/definitions/helpers/router/compose-route.d.mts.map +11 -1
- package/dist/definitions/helpers/router/get-action-routes-from-resource.d.mts.map +16 -1
- package/dist/definitions/helpers/router/get-default-action-path.d.mts.map +8 -1
- package/dist/definitions/helpers/router/get-parent-prefix-for-resource.d.mts.map +7 -1
- package/dist/definitions/helpers/router/get-parent-resource.d.mts.map +7 -1
- package/dist/definitions/helpers/router/index.d.mts.map +10 -1
- package/dist/definitions/helpers/router/is-parameter.d.mts.map +5 -1
- package/dist/definitions/helpers/router/is-segment-counts-same.d.mts.map +5 -1
- package/dist/definitions/helpers/router/match-resource-from-route.d.mts.map +15 -1
- package/dist/definitions/helpers/router/pick-matched-route.d.mts.map +8 -1
- package/dist/definitions/helpers/router/pick-route-params.d.mts.map +6 -1
- package/dist/definitions/helpers/router/prepare-route-params.d.mts.map +8 -1
- package/dist/definitions/helpers/router/remove-leading-trailing-slashes.d.mts.map +5 -1
- package/dist/definitions/helpers/router/split-to-segments.d.mts.map +5 -1
- package/dist/definitions/helpers/safe-translate/index.d.mts.map +3 -1
- package/dist/definitions/helpers/sanitize-resource/index.d.mts.map +8 -1
- package/dist/definitions/helpers/sequentialPromises/index.d.mts.map +5 -1
- package/dist/definitions/helpers/treeView/createTreeView/index.d.mts.map +6 -1
- package/dist/definitions/helpers/treeView/index.d.mts.map +2 -1
- package/dist/definitions/helpers/useActiveAuthProvider/index.d.cts +7 -7
- package/dist/definitions/helpers/useActiveAuthProvider/index.d.mts +7 -7
- package/dist/definitions/helpers/useActiveAuthProvider/index.d.mts.map +34 -1
- package/dist/definitions/helpers/useActiveAuthProvider/index.d.ts +7 -7
- package/dist/definitions/helpers/useInfinitePagination/index.d.mts.map +4 -1
- package/dist/definitions/helpers/useMediaQuery/index.d.mts.map +2 -1
- package/dist/definitions/helpers/useUserFriendlyName/index.d.mts.map +6 -1
- package/dist/definitions/helpers/userFriendlyResourceName/index.d.mts.map +7 -1
- package/dist/definitions/helpers/userFriendlySeconds/index.d.mts.map +2 -1
- package/dist/definitions/index.d.mts.map +4 -1
- package/dist/definitions/table/index.d.mts.map +34 -1
- package/dist/definitions/upload/file2Base64/index.d.mts.map +2 -1
- package/dist/definitions/upload/index.d.mts.map +2 -1
- package/dist/hooks/accessControl/index.d.mts.map +3 -1
- package/dist/hooks/accessControl/useCan/index.d.mts.map +18 -1
- package/dist/hooks/accessControl/useCanWithoutCache.d.mts.map +3 -1
- package/dist/hooks/auditLog/index.d.mts.map +3 -1
- package/dist/hooks/auditLog/useLog/index.d.mts.map +27 -1
- package/dist/hooks/auditLog/useLogList/index.d.mts.map +22 -1
- package/dist/hooks/auth/index.d.mts.map +11 -1
- package/dist/hooks/auth/useForgotPassword/index.d.mts.map +22 -1
- package/dist/hooks/auth/useGetIdentity/index.d.mts.map +21 -1
- package/dist/hooks/auth/useInvalidateAuthStore/index.d.mts.map +2 -1
- package/dist/hooks/auth/useIsAuthenticated/index.d.mts.map +25 -1
- package/dist/hooks/auth/useIsExistAuthentication/index.d.mts.map +6 -1
- package/dist/hooks/auth/useLogin/index.d.mts.map +22 -1
- package/dist/hooks/auth/useLogout/index.d.mts.map +26 -1
- package/dist/hooks/auth/useOnError/index.d.mts.map +22 -1
- package/dist/hooks/auth/usePermissions/index.d.mts.map +24 -1
- package/dist/hooks/auth/useRegister/index.d.mts.map +22 -1
- package/dist/hooks/auth/useUpdatePassword/index.d.mts.map +23 -1
- package/dist/hooks/breadcrumb/index.d.mts.map +18 -1
- package/dist/hooks/button/actionable-button/index.d.mts.map +8 -1
- package/dist/hooks/button/button-can-access/index.d.mts.map +22 -1
- package/dist/hooks/button/delete-button/index.d.mts.map +28 -1
- package/dist/hooks/button/index.d.mts.map +13 -1
- package/dist/hooks/button/navigation-button/index.d.mts.map +28 -1
- package/dist/hooks/button/refresh-button/index.d.mts.map +14 -1
- package/dist/hooks/data/index.d.cts +12 -12
- package/dist/hooks/data/index.d.cts.map +1 -1
- package/dist/hooks/data/index.d.mts +12 -12
- package/dist/hooks/data/index.d.mts.map +15 -1
- package/dist/hooks/data/index.d.ts +12 -12
- package/dist/hooks/data/index.d.ts.map +1 -1
- package/dist/hooks/data/useApiUrl.d.mts.map +2 -1
- package/dist/hooks/data/useCreate.d.mts.map +49 -1
- package/dist/hooks/data/useCreateMany.d.mts.map +31 -1
- package/dist/hooks/data/useCustom.d.mts.map +63 -1
- package/dist/hooks/data/useCustomMutation.d.mts.map +42 -1
- package/dist/hooks/data/useDataProvider.d.mts.map +7 -1
- package/dist/hooks/data/useDelete.d.mts.map +65 -1
- package/dist/hooks/data/useDeleteMany.d.mts.map +65 -1
- package/dist/hooks/data/useInfiniteList.d.mts.map +74 -1
- package/dist/hooks/data/useList.d.mts.map +73 -1
- package/dist/hooks/data/useMany.d.mts.map +48 -1
- package/dist/hooks/data/useOne.d.mts.map +50 -1
- package/dist/hooks/data/useUpdate.d.mts.map +83 -1
- package/dist/hooks/data/useUpdateMany.d.cts +1 -1
- package/dist/hooks/data/useUpdateMany.d.cts.map +1 -1
- package/dist/hooks/data/useUpdateMany.d.mts +1 -1
- package/dist/hooks/data/useUpdateMany.d.mts.map +84 -1
- package/dist/hooks/data/useUpdateMany.d.ts +1 -1
- package/dist/hooks/data/useUpdateMany.d.ts.map +1 -1
- package/dist/hooks/deepMemo/index.d.mts.map +7 -1
- package/dist/hooks/export/index.d.mts.map +99 -1
- package/dist/hooks/export/types.d.mts.map +21 -1
- package/dist/hooks/form/index.d.mts.map +18 -1
- package/dist/hooks/form/types.d.mts.map +146 -1
- package/dist/hooks/i18n/index.d.mts.map +5 -1
- package/dist/hooks/i18n/useGetLocale.d.mts.map +9 -1
- package/dist/hooks/i18n/useSetLocale.d.mts.map +8 -1
- package/dist/hooks/i18n/useTranslate.d.mts.map +11 -1
- package/dist/hooks/i18n/useTranslation.d.mts.map +18 -1
- package/dist/hooks/import/index.d.mts.map +101 -1
- package/dist/hooks/index.d.mts.map +31 -1
- package/dist/hooks/invalidate/index.d.mts.map +12 -1
- package/dist/hooks/legacy-router/index.d.mts.map +2 -1
- package/dist/hooks/legacy-router/useRouterContext.d.mts.map +10 -1
- package/dist/hooks/live/index.d.mts.map +5 -1
- package/dist/hooks/live/useLiveMode/index.d.mts.map +3 -1
- package/dist/hooks/live/usePublish/index.d.mts.map +3 -1
- package/dist/hooks/live/useResourceSubscription/index.d.mts.map +43 -1
- package/dist/hooks/live/useSubscription/index.d.mts.map +57 -1
- package/dist/hooks/memoized/index.d.mts.map +6 -1
- package/dist/hooks/menu/index.d.mts.map +2 -1
- package/dist/hooks/menu/useMenu.d.mts.map +28 -1
- package/dist/hooks/modal/index.d.mts.map +2 -1
- package/dist/hooks/modal/useModal/index.d.mts.map +13 -1
- package/dist/hooks/navigation/index.d.mts.map +28 -1
- package/dist/hooks/notification/index.d.mts.map +4 -1
- package/dist/hooks/notification/useCancelNotification/index.d.mts.map +8 -1
- package/dist/hooks/notification/useHandleNotification/index.d.mts.map +3 -1
- package/dist/hooks/notification/useNotification/index.d.mts.map +3 -1
- package/dist/hooks/redirection/index.d.mts.map +11 -1
- package/dist/hooks/refine/index.d.mts.map +6 -1
- package/dist/hooks/refine/useMutationMode.d.mts.map +16 -1
- package/dist/hooks/refine/useRefineContext.d.cts +1 -1
- package/dist/hooks/refine/useRefineContext.d.mts +1 -1
- package/dist/hooks/refine/useRefineContext.d.mts.map +20 -1
- package/dist/hooks/refine/useRefineContext.d.ts +1 -1
- package/dist/hooks/refine/useSyncWithLocation.d.mts.map +13 -1
- package/dist/hooks/refine/useTitle.d.mts.map +10 -1
- package/dist/hooks/refine/useWarnAboutChange/index.d.mts.map +16 -1
- package/dist/hooks/resource/index.d.mts.map +3 -1
- package/dist/hooks/resource/useResource/index.d.mts.map +63 -1
- package/dist/hooks/resource/useResourceWithRoute/index.d.mts.map +8 -1
- package/dist/hooks/router/index.d.mts.map +8 -1
- package/dist/hooks/router/use-back/index.d.mts.map +2 -1
- package/dist/hooks/router/use-get-to-path/index.d.mts.map +19 -1
- package/dist/hooks/router/use-go/index.d.mts.map +33 -1
- package/dist/hooks/router/use-link/index.d.mts.map +6 -1
- package/dist/hooks/router/use-parse/index.d.mts.map +5 -1
- package/dist/hooks/router/use-parsed/index.d.mts.map +2 -1
- package/dist/hooks/router/use-router-misuse-warning/index.d.mts.map +3 -1
- package/dist/hooks/router/use-to-path/index.d.mts.map +18 -1
- package/dist/hooks/show/index.d.mts.map +17 -1
- package/dist/hooks/show/types.d.mts.map +52 -1
- package/dist/hooks/show/useShow.d.mts.map +57 -1
- package/dist/hooks/use-refine-options/index.d.mts.map +2 -1
- package/dist/hooks/use-resource-params/index.d.mts.map +43 -1
- package/dist/hooks/use-resource-params/use-action/index.d.mts.map +12 -1
- package/dist/hooks/use-resource-params/use-id/index.d.mts.map +12 -1
- package/dist/hooks/useKeys/index.d.mts.map +5 -1
- package/dist/hooks/useLoadingOvertime/index.d.mts.map +49 -1
- package/dist/hooks/useMeta/index.d.mts.map +19 -1
- package/dist/hooks/useSelect/index.d.cts +6 -0
- package/dist/hooks/useSelect/index.d.cts.map +1 -1
- package/dist/hooks/useSelect/index.d.mts +6 -0
- package/dist/hooks/useSelect/index.d.mts.map +137 -1
- package/dist/hooks/useSelect/index.d.ts +6 -0
- package/dist/hooks/useSelect/index.d.ts.map +1 -1
- package/dist/hooks/useTable/index.d.mts.map +167 -1
- package/dist/hooks/useTelemetryData/index.d.mts.map +3 -1
- package/dist/index.cjs +18 -18
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +8 -7
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +8 -7
- package/dist/index.d.mts.map +25 -1
- package/dist/index.d.ts +8 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +18 -18
- package/dist/index.mjs.map +1 -1
- package/package.json +12 -13
- package/src/components/autoSaveIndicator/index.tsx +21 -7
- package/src/hooks/data/index.ts +28 -12
- package/src/hooks/data/useUpdateMany.ts +1 -1
- package/src/hooks/useSelect/index.ts +15 -1
- package/src/index.tsx +39 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@refinedev/core",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.52.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": {
|
|
@@ -26,18 +26,8 @@
|
|
|
26
26
|
"main": "dist/index.cjs",
|
|
27
27
|
"module": "dist/index.mjs",
|
|
28
28
|
"typings": "dist/index.d.ts",
|
|
29
|
-
"scripts": {
|
|
30
|
-
"attw": "attw --pack .",
|
|
31
|
-
"build": "tsup && node ../shared/generate-declarations.js",
|
|
32
|
-
"dev": "tsup --watch",
|
|
33
|
-
"prepare": "pnpm -w build --scope @refinedev/core",
|
|
34
|
-
"publint": "publint --strict=true --level=suggestion",
|
|
35
|
-
"test": "jest --passWithNoTests --runInBand",
|
|
36
|
-
"test:dev": "jest --silent --noStackTrace",
|
|
37
|
-
"types": "node ../shared/generate-declarations.js"
|
|
38
|
-
},
|
|
39
29
|
"dependencies": {
|
|
40
|
-
"@refinedev/devtools-internal": "1.1.
|
|
30
|
+
"@refinedev/devtools-internal": "1.1.12",
|
|
41
31
|
"@tanstack/react-query": "^4.10.1",
|
|
42
32
|
"lodash": "^4.17.21",
|
|
43
33
|
"lodash-es": "^4.17.21",
|
|
@@ -80,5 +70,14 @@
|
|
|
80
70
|
},
|
|
81
71
|
"publishConfig": {
|
|
82
72
|
"access": "public"
|
|
73
|
+
},
|
|
74
|
+
"scripts": {
|
|
75
|
+
"attw": "attw --pack .",
|
|
76
|
+
"build": "tsup && node ../shared/generate-declarations.js",
|
|
77
|
+
"dev": "tsup --watch",
|
|
78
|
+
"publint": "publint --strict=true --level=suggestion",
|
|
79
|
+
"test": "jest --passWithNoTests --runInBand",
|
|
80
|
+
"test:dev": "jest --silent --noStackTrace",
|
|
81
|
+
"types": "node ../shared/generate-declarations.js"
|
|
83
82
|
}
|
|
84
|
-
}
|
|
83
|
+
}
|
|
@@ -32,10 +32,24 @@ export type AutoSaveIndicatorProps<
|
|
|
32
32
|
export const AutoSaveIndicator: React.FC<AutoSaveIndicatorProps> = ({
|
|
33
33
|
status,
|
|
34
34
|
elements: {
|
|
35
|
-
success =
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
35
|
+
success = (
|
|
36
|
+
<Message translationKey="autoSave.success" defaultMessage="saved" />
|
|
37
|
+
),
|
|
38
|
+
error = (
|
|
39
|
+
<Message
|
|
40
|
+
translationKey="autoSave.error"
|
|
41
|
+
defaultMessage="auto save failure"
|
|
42
|
+
/>
|
|
43
|
+
),
|
|
44
|
+
loading = (
|
|
45
|
+
<Message translationKey="autoSave.loading" defaultMessage="saving..." />
|
|
46
|
+
),
|
|
47
|
+
idle = (
|
|
48
|
+
<Message
|
|
49
|
+
translationKey="autoSave.idle"
|
|
50
|
+
defaultMessage="waiting for changes"
|
|
51
|
+
/>
|
|
52
|
+
),
|
|
39
53
|
} = {},
|
|
40
54
|
}) => {
|
|
41
55
|
switch (status) {
|
|
@@ -51,13 +65,13 @@ export const AutoSaveIndicator: React.FC<AutoSaveIndicatorProps> = ({
|
|
|
51
65
|
};
|
|
52
66
|
|
|
53
67
|
const Message = ({
|
|
54
|
-
|
|
68
|
+
translationKey,
|
|
55
69
|
defaultMessage,
|
|
56
70
|
}: {
|
|
57
|
-
|
|
71
|
+
translationKey: string;
|
|
58
72
|
defaultMessage: string;
|
|
59
73
|
}) => {
|
|
60
74
|
const translate = useTranslate();
|
|
61
75
|
|
|
62
|
-
return <span>{translate(
|
|
76
|
+
return <span>{translate(translationKey, defaultMessage)}</span>;
|
|
63
77
|
};
|
package/src/hooks/data/index.ts
CHANGED
|
@@ -1,18 +1,34 @@
|
|
|
1
|
-
export { useList } from "./useList";
|
|
2
|
-
export { useOne } from "./useOne";
|
|
3
|
-
export { useMany } from "./useMany";
|
|
1
|
+
export { useList, UseListProps } from "./useList";
|
|
2
|
+
export { useOne, UseOneProps } from "./useOne";
|
|
3
|
+
export { useMany, UseManyProps } from "./useMany";
|
|
4
4
|
|
|
5
|
-
export { useUpdate } from "./useUpdate";
|
|
6
|
-
export { useCreate, UseCreateReturnType } from "./useCreate";
|
|
7
|
-
export { useDelete } from "./useDelete";
|
|
5
|
+
export { useUpdate, UseUpdateProps, UseUpdateReturnType } from "./useUpdate";
|
|
6
|
+
export { useCreate, UseCreateProps, UseCreateReturnType } from "./useCreate";
|
|
7
|
+
export { useDelete, UseDeleteProps, UseDeleteReturnType } from "./useDelete";
|
|
8
8
|
|
|
9
|
-
export {
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
export {
|
|
10
|
+
useCreateMany,
|
|
11
|
+
UseCreateManyProps,
|
|
12
|
+
UseCreateManyReturnType,
|
|
13
|
+
} from "./useCreateMany";
|
|
14
|
+
export {
|
|
15
|
+
useUpdateMany,
|
|
16
|
+
UseUpdateManyProps,
|
|
17
|
+
UseUpdateManyReturnType,
|
|
18
|
+
} from "./useUpdateMany";
|
|
19
|
+
export {
|
|
20
|
+
useDeleteMany,
|
|
21
|
+
UseDeleteManyProps,
|
|
22
|
+
UseDeleteManyReturnType,
|
|
23
|
+
} from "./useDeleteMany";
|
|
12
24
|
|
|
13
25
|
export { useApiUrl } from "./useApiUrl";
|
|
14
|
-
export { useCustom } from "./useCustom";
|
|
15
|
-
export {
|
|
26
|
+
export { useCustom, UseCustomProps } from "./useCustom";
|
|
27
|
+
export {
|
|
28
|
+
useCustomMutation,
|
|
29
|
+
UseCustomMutationProps,
|
|
30
|
+
UseCustomMutationReturnType,
|
|
31
|
+
} from "./useCustomMutation";
|
|
16
32
|
|
|
17
33
|
export { useDataProvider } from "./useDataProvider";
|
|
18
|
-
export { useInfiniteList } from "./useInfiniteList";
|
|
34
|
+
export { useInfiniteList, UseInfiniteListProps } from "./useInfiniteList";
|
|
@@ -134,7 +134,7 @@ type UpdateManyParams<TData, TError, TVariables> = {
|
|
|
134
134
|
{ ids: BaseKey[]; values: TVariables }
|
|
135
135
|
>;
|
|
136
136
|
|
|
137
|
-
type UseUpdateManyReturnType<
|
|
137
|
+
export type UseUpdateManyReturnType<
|
|
138
138
|
TData extends BaseRecord = BaseRecord,
|
|
139
139
|
TError extends HttpError = HttpError,
|
|
140
140
|
TVariables = {},
|
|
@@ -34,6 +34,8 @@ import {
|
|
|
34
34
|
useLoadingOvertime,
|
|
35
35
|
} from "../useLoadingOvertime";
|
|
36
36
|
|
|
37
|
+
export type SelectedOptionsOrder = "in-place" | "selected-first";
|
|
38
|
+
|
|
37
39
|
export type UseSelectProps<TQueryFnData, TError, TData> = {
|
|
38
40
|
/**
|
|
39
41
|
* Resource name for API data interactions
|
|
@@ -84,6 +86,11 @@ export type UseSelectProps<TQueryFnData, TError, TData> = {
|
|
|
84
86
|
* Adds extra `options`
|
|
85
87
|
*/
|
|
86
88
|
defaultValue?: BaseKey | BaseKey[];
|
|
89
|
+
/**
|
|
90
|
+
* Allow us to sort the selection options
|
|
91
|
+
* @default `in-place`
|
|
92
|
+
*/
|
|
93
|
+
selectedOptionsOrder?: SelectedOptionsOrder;
|
|
87
94
|
/**
|
|
88
95
|
* The number of milliseconds to delay
|
|
89
96
|
* @default `300`
|
|
@@ -213,6 +220,7 @@ export const useSelect = <
|
|
|
213
220
|
hasPagination = false,
|
|
214
221
|
liveMode,
|
|
215
222
|
defaultValue = [],
|
|
223
|
+
selectedOptionsOrder = "in-place",
|
|
216
224
|
onLiveEvent,
|
|
217
225
|
onSearch: onSearchFromProp,
|
|
218
226
|
liveParams,
|
|
@@ -362,7 +370,13 @@ export const useSelect = <
|
|
|
362
370
|
});
|
|
363
371
|
|
|
364
372
|
const combinedOptions = useMemo(
|
|
365
|
-
() =>
|
|
373
|
+
() =>
|
|
374
|
+
uniqBy(
|
|
375
|
+
selectedOptionsOrder === "in-place"
|
|
376
|
+
? [...options, ...selectedOptions]
|
|
377
|
+
: [...selectedOptions, ...options],
|
|
378
|
+
"value",
|
|
379
|
+
),
|
|
366
380
|
[options, selectedOptions],
|
|
367
381
|
);
|
|
368
382
|
|
package/src/index.tsx
CHANGED
|
@@ -47,22 +47,32 @@ export {
|
|
|
47
47
|
AccessControlProvider,
|
|
48
48
|
AccessControlProvider as AccessControlBindings,
|
|
49
49
|
CanParams,
|
|
50
|
+
CanResponse,
|
|
50
51
|
CanReturnType,
|
|
51
52
|
IAccessControlContext,
|
|
53
|
+
IAccessControlContextReturnType,
|
|
52
54
|
} from "./contexts/accessControl/types.js";
|
|
53
55
|
|
|
54
56
|
export {
|
|
55
57
|
AuditLogProvider,
|
|
58
|
+
IAuditLogContext,
|
|
56
59
|
ILog,
|
|
57
60
|
ILogData,
|
|
58
61
|
LogParams,
|
|
59
62
|
} from "./contexts/auditLog/types.js";
|
|
60
63
|
|
|
61
64
|
export {
|
|
65
|
+
AuthActionResponse,
|
|
62
66
|
AuthBindings,
|
|
63
67
|
AuthProvider,
|
|
68
|
+
CheckResponse,
|
|
69
|
+
IAuthContext,
|
|
70
|
+
IdentityResponse,
|
|
64
71
|
ILegacyAuthContext,
|
|
65
72
|
LegacyAuthProvider,
|
|
73
|
+
OnErrorResponse,
|
|
74
|
+
PermissionResponse,
|
|
75
|
+
SuccessNotificationResponse,
|
|
66
76
|
} from "./contexts/auth/types.js";
|
|
67
77
|
|
|
68
78
|
export {
|
|
@@ -107,6 +117,20 @@ export {
|
|
|
107
117
|
BaseOption,
|
|
108
118
|
IQueryKeys,
|
|
109
119
|
Prettify,
|
|
120
|
+
Context,
|
|
121
|
+
ContextQuery,
|
|
122
|
+
DataProviders,
|
|
123
|
+
IDataContext,
|
|
124
|
+
GraphQLQueryOptions,
|
|
125
|
+
Fields,
|
|
126
|
+
NestedField,
|
|
127
|
+
PrevContext,
|
|
128
|
+
PreviousQuery,
|
|
129
|
+
QueryBuilderOptions,
|
|
130
|
+
QueryResponse,
|
|
131
|
+
RefineError,
|
|
132
|
+
ValidationErrors,
|
|
133
|
+
VariableOptions,
|
|
110
134
|
} from "./contexts/data/types.js";
|
|
111
135
|
|
|
112
136
|
export {
|
|
@@ -123,6 +147,7 @@ export {
|
|
|
123
147
|
|
|
124
148
|
export {
|
|
125
149
|
ILiveContext,
|
|
150
|
+
ILiveModeContextProvider,
|
|
126
151
|
LiveEvent,
|
|
127
152
|
LiveCommonParams,
|
|
128
153
|
LiveManyParams,
|
|
@@ -141,6 +166,7 @@ export {
|
|
|
141
166
|
} from "./contexts/notification/types.js";
|
|
142
167
|
|
|
143
168
|
export {
|
|
169
|
+
DashboardPageProps,
|
|
144
170
|
IRefineContext,
|
|
145
171
|
IRefineContextOptions,
|
|
146
172
|
IRefineContextProvider,
|
|
@@ -158,7 +184,14 @@ export {
|
|
|
158
184
|
IResourceContext,
|
|
159
185
|
IResourceItem,
|
|
160
186
|
ITreeMenu,
|
|
187
|
+
IMenuItem,
|
|
188
|
+
ResourceAuditLogPermissions,
|
|
161
189
|
ResourceBindings,
|
|
190
|
+
RouteableProperties,
|
|
191
|
+
ResourceRouteComponent,
|
|
192
|
+
ResourceRouteComposition,
|
|
193
|
+
ResourceRouteDefinition,
|
|
194
|
+
ResourceRoutePath,
|
|
162
195
|
} from "./contexts/resource/types.js";
|
|
163
196
|
|
|
164
197
|
export {
|
|
@@ -184,4 +217,10 @@ export {
|
|
|
184
217
|
RouterProvider as RouterBindings,
|
|
185
218
|
} from "./contexts/router/types.js";
|
|
186
219
|
|
|
220
|
+
export {
|
|
221
|
+
ActionTypes,
|
|
222
|
+
IUndoableQueue,
|
|
223
|
+
IUndoableQueueContext,
|
|
224
|
+
} from "./contexts/undoableQueue/types.js";
|
|
225
|
+
|
|
187
226
|
export { IUnsavedWarnContext } from "./contexts/unsavedWarn/types.js";
|