@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
|
@@ -1 +1,67 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* @author aliemir
|
|
3
|
+
*
|
|
4
|
+
* Router bindings interface, used to define the router bindings of refine.
|
|
5
|
+
*
|
|
6
|
+
* We're marking of the functions as optional, some features may not work properly but this is intentional.
|
|
7
|
+
* Users can choose to use the router bindings or not, or use their own router bindings.
|
|
8
|
+
* Leaving the control to the user is the best way to go.
|
|
9
|
+
*
|
|
10
|
+
* We're defining the functions as function generators, this is to allow the user to use hooks inside the functions.
|
|
11
|
+
*
|
|
12
|
+
* `go` function is used to navigate to a specific route. We're expecting a `GoConfig` object as the only parameter.
|
|
13
|
+
* Passing `query` as an object, will also let users to stringify the object as they like or ignore it completely or even use a custom logic to handle query strings.
|
|
14
|
+
*
|
|
15
|
+
* `back` function is used to navigate back to the previous route. It doesn't take any parameters.
|
|
16
|
+
* This one is a basic function for the back buttons, absence of this function can also hide the back button,
|
|
17
|
+
* but this depends on the UI package implementations.
|
|
18
|
+
*
|
|
19
|
+
* `parse` function is used to parse the current route, query parameters and other information.
|
|
20
|
+
* We're expecting this function to lead refine to the correct resource, action and id (again, not required but recommended).
|
|
21
|
+
* Also there's `params` property, which is used in data hooks and other places.
|
|
22
|
+
* This property has an interface to match but not restricted to it.
|
|
23
|
+
*
|
|
24
|
+
* Instead of a single `useNavigation` hook,
|
|
25
|
+
* we can separate those functions into three different hooks,
|
|
26
|
+
* `useGo`, `useBack` and `useParsed`
|
|
27
|
+
*/
|
|
28
|
+
/// <reference types="react" />
|
|
29
|
+
import type { BaseKey, CrudFilter, CrudSort } from "../data/types";
|
|
30
|
+
import type { IResourceItem } from "../resource/types";
|
|
31
|
+
export type Action = "create" | "edit" | "list" | "show" | "clone";
|
|
32
|
+
export type GoConfig = {
|
|
33
|
+
to?: string;
|
|
34
|
+
query?: Record<string, unknown>;
|
|
35
|
+
hash?: string;
|
|
36
|
+
options?: {
|
|
37
|
+
keepQuery?: boolean;
|
|
38
|
+
keepHash?: boolean;
|
|
39
|
+
};
|
|
40
|
+
type?: "push" | "replace" | "path";
|
|
41
|
+
};
|
|
42
|
+
export type ParsedParams<TParams extends Record<string, any> = Record<string, any>> = {
|
|
43
|
+
filters?: CrudFilter[];
|
|
44
|
+
sorters?: CrudSort[];
|
|
45
|
+
current?: number;
|
|
46
|
+
pageSize?: number;
|
|
47
|
+
} & TParams;
|
|
48
|
+
export type ParseResponse<TParams extends Record<string, any> = Record<string, any>> = {
|
|
49
|
+
params?: ParsedParams<TParams>;
|
|
50
|
+
resource?: IResourceItem;
|
|
51
|
+
id?: BaseKey;
|
|
52
|
+
action?: Action;
|
|
53
|
+
pathname?: string;
|
|
54
|
+
};
|
|
55
|
+
export type GoFunction = (config: GoConfig) => void | string;
|
|
56
|
+
export type BackFunction = () => void;
|
|
57
|
+
export type ParseFunction<TParams extends Record<string, any> = Record<string, any>> = () => ParseResponse<TParams>;
|
|
58
|
+
export type RouterProvider = {
|
|
59
|
+
go?: () => GoFunction;
|
|
60
|
+
back?: () => BackFunction;
|
|
61
|
+
parse?: () => ParseFunction;
|
|
62
|
+
Link?: React.ComponentType<React.PropsWithChildren<{
|
|
63
|
+
to: string;
|
|
64
|
+
[prop: string]: any;
|
|
65
|
+
}>>;
|
|
66
|
+
};
|
|
67
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
{"
|
|
1
|
+
import React, { type PropsWithChildren } from "react";
|
|
2
|
+
import { type IUndoableQueue, type IUndoableQueueContext } from "./types";
|
|
3
|
+
export declare const UndoableQueueContext: React.Context<IUndoableQueueContext>;
|
|
4
|
+
export declare const undoableQueueReducer: (state: IUndoableQueue[], action: any) => any[];
|
|
5
|
+
export declare const UndoableQueueContextProvider: React.FC<PropsWithChildren>;
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1,21 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { BaseKey } from "../data/types";
|
|
3
|
+
export declare enum ActionTypes {
|
|
4
|
+
ADD = "ADD",
|
|
5
|
+
REMOVE = "REMOVE",
|
|
6
|
+
DECREASE_NOTIFICATION_SECOND = "DECREASE_NOTIFICATION_SECOND"
|
|
7
|
+
}
|
|
8
|
+
export interface IUndoableQueue {
|
|
9
|
+
id: BaseKey;
|
|
10
|
+
resource: string;
|
|
11
|
+
cancelMutation: () => void;
|
|
12
|
+
doMutation: () => void;
|
|
13
|
+
seconds: number;
|
|
14
|
+
isRunning: boolean;
|
|
15
|
+
isSilent: boolean;
|
|
16
|
+
}
|
|
17
|
+
export interface IUndoableQueueContext {
|
|
18
|
+
notifications: IUndoableQueue[];
|
|
19
|
+
notificationDispatch: React.Dispatch<any>;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1,5 @@
|
|
|
1
|
-
{"
|
|
1
|
+
import React, { type PropsWithChildren } from "react";
|
|
2
|
+
import type { IUnsavedWarnContext } from "./types";
|
|
3
|
+
export declare const UnsavedWarnContext: React.Context<IUnsavedWarnContext>;
|
|
4
|
+
export declare const UnsavedWarnContextProvider: React.FC<PropsWithChildren>;
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1,5 @@
|
|
|
1
|
-
{
|
|
1
|
+
export interface IUnsavedWarnContext {
|
|
2
|
+
warnWhen?: boolean;
|
|
3
|
+
setWarnWhen?: (value: boolean) => void;
|
|
4
|
+
}
|
|
5
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1,18 @@
|
|
|
1
|
-
{
|
|
1
|
+
type DebouncedFunction<T extends (...args: any) => any> = {
|
|
2
|
+
(...args: Parameters<T>): Promise<Awaited<ReturnType<T>>>;
|
|
3
|
+
flush: () => void;
|
|
4
|
+
cancel: () => void;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Debounces sync and async functions with given wait time. The debounced function returns a promise which can be awaited or catched.
|
|
8
|
+
* Only the last call of the debounced function will resolve or reject.
|
|
9
|
+
* Previous calls will be rejected with the given cancelReason.
|
|
10
|
+
*
|
|
11
|
+
* The original debounce function doesn't work well with async functions,
|
|
12
|
+
* It won't return a promise to resolve/reject and therefore it's not possible to await the result.
|
|
13
|
+
* This will always return a promise to handle and await the result.
|
|
14
|
+
* Previous calls will be rejected immediately after a new call made.
|
|
15
|
+
*/
|
|
16
|
+
export declare const asyncDebounce: <T extends (...args: any[]) => any>(func: T, wait?: number, cancelReason?: string) => DebouncedFunction<T>;
|
|
17
|
+
export {};
|
|
18
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1,4 @@
|
|
|
1
|
-
{"
|
|
1
|
+
import type { LegacyRouterProvider } from "../../../contexts/router/legacy/types";
|
|
2
|
+
import type { RouterProvider } from "../../../contexts/router/types";
|
|
3
|
+
export declare const checkRouterPropMisuse: (value: LegacyRouterProvider | RouterProvider) => boolean;
|
|
4
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Delays the execution of a callback function asynchronously.
|
|
3
|
+
* This utility function is used to defer the execution of the provided
|
|
4
|
+
* callback, allowing the current call stack to clear before the callback
|
|
5
|
+
* is invoked. It is particularly useful for ensuring non-blocking behavior
|
|
6
|
+
* and providing a clear intent when a 0 ms timeout is used.
|
|
7
|
+
*/
|
|
8
|
+
export declare const deferExecution: (fn: Function) => void;
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
export declare const downloadInBrowser: (filename: string, content: string, type?: string) => void;
|
|
2
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
export declare const flattenObjectKeys: (obj: any, prefix?: string) => {
|
|
2
|
+
[x: string]: any;
|
|
3
|
+
};
|
|
4
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{"
|
|
1
|
+
import type { useTranslate } from "@hooks/i18n";
|
|
2
|
+
import type { IResourceItem } from "../../../contexts/resource/types";
|
|
3
|
+
/**
|
|
4
|
+
* Generates document title for the given resource and action.
|
|
5
|
+
*/
|
|
6
|
+
export declare function generateDefaultDocumentTitle(translate: ReturnType<typeof useTranslate>, resource?: IResourceItem, action?: string, id?: string, resourceName?: string): string;
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
export declare const handleMultiple: <TData = unknown>(promises: Promise<{
|
|
2
|
+
data: TData;
|
|
3
|
+
}>[]) => Promise<{
|
|
4
|
+
data: TData[];
|
|
5
|
+
}>;
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1,9 @@
|
|
|
1
|
-
{"
|
|
1
|
+
import type { Pagination } from "../../../contexts/data/types";
|
|
2
|
+
type HandlePaginationParamsProps = {
|
|
3
|
+
hasPagination?: boolean;
|
|
4
|
+
pagination?: Pagination;
|
|
5
|
+
configPagination?: Pagination;
|
|
6
|
+
};
|
|
7
|
+
export declare const handlePaginationParams: ({ hasPagination, pagination, configPagination, }?: HandlePaginationParamsProps) => Required<Pagination>;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1,26 @@
|
|
|
1
|
-
{
|
|
1
|
+
import type { QueryClient, QueryClientConfig } from "@tanstack/react-query";
|
|
2
|
+
import type { MutationMode } from "../../../contexts/data/types";
|
|
3
|
+
import type { LiveModeProps } from "../../../contexts/live/types";
|
|
4
|
+
import type { IRefineContextOptions, IRefineOptions } from "../../../contexts/refine/types";
|
|
5
|
+
type HandleRefineOptionsProps = {
|
|
6
|
+
options?: IRefineOptions;
|
|
7
|
+
mutationMode?: MutationMode;
|
|
8
|
+
syncWithLocation?: boolean;
|
|
9
|
+
warnWhenUnsavedChanges?: boolean;
|
|
10
|
+
undoableTimeout?: number;
|
|
11
|
+
liveMode?: LiveModeProps["liveMode"];
|
|
12
|
+
disableTelemetry?: boolean;
|
|
13
|
+
reactQueryClientConfig?: QueryClientConfig;
|
|
14
|
+
reactQueryDevtoolConfig?: any | false;
|
|
15
|
+
};
|
|
16
|
+
type HandleRefineOptionsReturnValues = {
|
|
17
|
+
optionsWithDefaults: IRefineContextOptions;
|
|
18
|
+
disableTelemetryWithDefault: boolean;
|
|
19
|
+
reactQueryWithDefaults: {
|
|
20
|
+
clientConfig: QueryClientConfig | InstanceType<typeof QueryClient>;
|
|
21
|
+
devtoolConfig: false | any;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
export declare const handleRefineOptions: ({ options, disableTelemetry, liveMode, mutationMode, reactQueryClientConfig, reactQueryDevtoolConfig, syncWithLocation, undoableTimeout, warnWhenUnsavedChanges, }?: HandleRefineOptionsProps) => HandleRefineOptionsReturnValues;
|
|
25
|
+
export {};
|
|
26
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
export declare const handleUseParams: (params?: any) => any;
|
|
2
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
export declare const hasPermission: (permissions: string[] | undefined, action: string | undefined) => boolean;
|
|
2
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
export declare const humanizeString: (text: string) => string;
|
|
2
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1,3 @@
|
|
|
1
|
-
{"
|
|
1
|
+
import type { MapDataFn } from "../../../hooks/export/types";
|
|
2
|
+
export declare const importCSVMapper: <TItem = any, TVariables = any>(data: any[][], mapData?: MapDataFn<TItem, TVariables>) => TVariables[];
|
|
3
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1,34 @@
|
|
|
1
|
-
{"
|
|
1
|
+
export { userFriendlySecond } from "./userFriendlySeconds";
|
|
2
|
+
export { importCSVMapper } from "./importCSVMapper";
|
|
3
|
+
export { userFriendlyResourceName } from "./userFriendlyResourceName";
|
|
4
|
+
export { handleUseParams } from "./handleUseParams";
|
|
5
|
+
export { queryKeys, queryKeysReplacement } from "./queryKeys";
|
|
6
|
+
export { hasPermission } from "./hasPermission";
|
|
7
|
+
export { routeGenerator } from "./routeGenerator";
|
|
8
|
+
export { createTreeView } from "./treeView/createTreeView";
|
|
9
|
+
export { humanizeString } from "./humanizeString";
|
|
10
|
+
export { handleRefineOptions } from "./handleRefineOptions";
|
|
11
|
+
export { redirectPage } from "./redirectPage";
|
|
12
|
+
export { sequentialPromises } from "./sequentialPromises";
|
|
13
|
+
export { pickDataProvider } from "./pickDataProvider";
|
|
14
|
+
export { handleMultiple } from "./handleMultiple";
|
|
15
|
+
export { getNextPageParam, getPreviousPageParam, } from "./useInfinitePagination";
|
|
16
|
+
export { pickNotDeprecated } from "./pickNotDeprecated";
|
|
17
|
+
export { legacyResourceTransform } from "./legacy-resource-transform";
|
|
18
|
+
export { matchResourceFromRoute } from "./router/match-resource-from-route";
|
|
19
|
+
export { getActionRoutesFromResource } from "./router";
|
|
20
|
+
export { composeRoute } from "./router/compose-route";
|
|
21
|
+
export { useActiveAuthProvider } from "./useActiveAuthProvider";
|
|
22
|
+
export { handlePaginationParams } from "./handlePaginationParams";
|
|
23
|
+
export { useMediaQuery } from "./useMediaQuery";
|
|
24
|
+
export { generateDefaultDocumentTitle } from "./generateDocumentTitle";
|
|
25
|
+
export { useUserFriendlyName } from "./useUserFriendlyName";
|
|
26
|
+
export { keys, stripUndefined } from "./keys";
|
|
27
|
+
export { KeyBuilder } from "./keys";
|
|
28
|
+
export { flattenObjectKeys } from "./flatten-object-keys";
|
|
29
|
+
export { propertyPathToArray } from "./property-path-to-array";
|
|
30
|
+
export { downloadInBrowser } from "./downloadInBrowser";
|
|
31
|
+
export { deferExecution } from "./defer-execution";
|
|
32
|
+
export { asyncDebounce } from "./async-debounce";
|
|
33
|
+
export { prepareQueryContext } from "./prepare-query-context";
|
|
34
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1,64 @@
|
|
|
1
|
-
{"
|
|
1
|
+
import type { BaseKey } from "../../../contexts/data/types";
|
|
2
|
+
type ParametrizedDataActions = "list" | "infinite";
|
|
3
|
+
type IdRequiredDataActions = "one";
|
|
4
|
+
type IdsRequiredDataActions = "many";
|
|
5
|
+
type DataMutationActions = "custom" | "customMutation" | "create" | "createMany" | "update" | "updateMany" | "delete" | "deleteMany";
|
|
6
|
+
type AuthActionType = "login" | "logout" | "identity" | "register" | "forgotPassword" | "check" | "onError" | "permissions" | "updatePassword";
|
|
7
|
+
type AuditActionType = "list" | "log" | "rename";
|
|
8
|
+
type IdType = BaseKey;
|
|
9
|
+
type IdsType = IdType[];
|
|
10
|
+
type ParamsType = any;
|
|
11
|
+
type KeySegment = string | IdType | IdsType | ParamsType;
|
|
12
|
+
export declare function arrayFindIndex<T>(array: T[], slice: T[]): number;
|
|
13
|
+
export declare function arrayReplace<T>(array: T[], partToBeReplaced: T[], newPart: T[]): T[];
|
|
14
|
+
export declare function stripUndefined(segments: KeySegment[]): any[];
|
|
15
|
+
declare class BaseKeyBuilder {
|
|
16
|
+
segments: KeySegment[];
|
|
17
|
+
constructor(segments?: KeySegment[]);
|
|
18
|
+
key(): any[];
|
|
19
|
+
legacy(): any[];
|
|
20
|
+
get(legacy?: boolean): any[];
|
|
21
|
+
}
|
|
22
|
+
declare class ParamsKeyBuilder extends BaseKeyBuilder {
|
|
23
|
+
params(paramsValue?: ParamsType): BaseKeyBuilder;
|
|
24
|
+
}
|
|
25
|
+
declare class DataIdRequiringKeyBuilder extends BaseKeyBuilder {
|
|
26
|
+
id(idValue?: IdType): ParamsKeyBuilder;
|
|
27
|
+
}
|
|
28
|
+
declare class DataIdsRequiringKeyBuilder extends BaseKeyBuilder {
|
|
29
|
+
ids(...idsValue: IdsType): ParamsKeyBuilder;
|
|
30
|
+
}
|
|
31
|
+
declare class DataResourceKeyBuilder extends BaseKeyBuilder {
|
|
32
|
+
action(actionType: ParametrizedDataActions): ParamsKeyBuilder;
|
|
33
|
+
action(actionType: IdRequiredDataActions): DataIdRequiringKeyBuilder;
|
|
34
|
+
action(actionType: IdsRequiredDataActions): DataIdsRequiringKeyBuilder;
|
|
35
|
+
}
|
|
36
|
+
declare class DataKeyBuilder extends BaseKeyBuilder {
|
|
37
|
+
resource(resourceName?: string): DataResourceKeyBuilder;
|
|
38
|
+
mutation(mutationName: DataMutationActions): ParamsKeyBuilder;
|
|
39
|
+
}
|
|
40
|
+
declare class AuthKeyBuilder extends BaseKeyBuilder {
|
|
41
|
+
action(actionType: AuthActionType): ParamsKeyBuilder;
|
|
42
|
+
}
|
|
43
|
+
declare class AccessResourceKeyBuilder extends BaseKeyBuilder {
|
|
44
|
+
action(resourceName: string): ParamsKeyBuilder;
|
|
45
|
+
}
|
|
46
|
+
declare class AccessKeyBuilder extends BaseKeyBuilder {
|
|
47
|
+
resource(resourceName?: string): AccessResourceKeyBuilder;
|
|
48
|
+
}
|
|
49
|
+
declare class AuditActionKeyBuilder extends BaseKeyBuilder {
|
|
50
|
+
action(actionType: Extract<AuditActionType, "list">): ParamsKeyBuilder;
|
|
51
|
+
}
|
|
52
|
+
declare class AuditKeyBuilder extends BaseKeyBuilder {
|
|
53
|
+
resource(resourceName?: string): AuditActionKeyBuilder;
|
|
54
|
+
action(actionType: Extract<AuditActionType, "rename" | "log">): ParamsKeyBuilder;
|
|
55
|
+
}
|
|
56
|
+
export declare class KeyBuilder extends BaseKeyBuilder {
|
|
57
|
+
data(name?: string): DataKeyBuilder;
|
|
58
|
+
auth(): AuthKeyBuilder;
|
|
59
|
+
access(): AccessKeyBuilder;
|
|
60
|
+
audit(): AuditKeyBuilder;
|
|
61
|
+
}
|
|
62
|
+
export declare const keys: () => KeyBuilder;
|
|
63
|
+
export {};
|
|
64
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1,9 @@
|
|
|
1
|
-
{
|
|
1
|
+
import type { IResourceItem, ResourceProps } from "../../../contexts/resource/types";
|
|
2
|
+
/**
|
|
3
|
+
* For the legacy definition of resources, we did a basic transformation for provided resources
|
|
4
|
+
* - This is meant to provide an easier way to access properties.
|
|
5
|
+
* - In the new definition, we don't need to do transformations and properties can be accessed via helpers or manually.
|
|
6
|
+
* This is kept for backward compability
|
|
7
|
+
*/
|
|
8
|
+
export declare const legacyResourceTransform: (resources: ResourceProps[]) => IResourceItem[];
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1,3 @@
|
|
|
1
|
-
{"
|
|
1
|
+
import type { IResourceItem } from "../../../contexts/resource/types";
|
|
2
|
+
export declare const createResourceKey: (resource: IResourceItem, resources: IResourceItem[], legacy?: boolean) => string;
|
|
3
|
+
//# sourceMappingURL=create-resource-key.d.ts.map
|
|
@@ -1 +1,13 @@
|
|
|
1
|
-
{"
|
|
1
|
+
import type { IResourceItem } from "../../../contexts/resource/types";
|
|
2
|
+
export type Tree = {
|
|
3
|
+
item: IResourceItem;
|
|
4
|
+
children: {
|
|
5
|
+
[key: string]: Tree;
|
|
6
|
+
};
|
|
7
|
+
};
|
|
8
|
+
export type FlatTreeItem = IResourceItem & {
|
|
9
|
+
key: string;
|
|
10
|
+
children: FlatTreeItem[];
|
|
11
|
+
};
|
|
12
|
+
export declare const createTree: (resources: IResourceItem[], legacy?: boolean) => FlatTreeItem[];
|
|
13
|
+
//# sourceMappingURL=create-tree.d.ts.map
|
|
@@ -1 +1,8 @@
|
|
|
1
|
-
{"
|
|
1
|
+
import type { IResourceItem } from "../../../contexts/resource/types";
|
|
2
|
+
/**
|
|
3
|
+
* Picks the resource based on the provided identifier.
|
|
4
|
+
* Identifier fallbacks to `name` if `identifier` is not explicitly provided to the resource.
|
|
5
|
+
* If legacy is true, then resource is matched by `route` first and then by `name`.
|
|
6
|
+
*/
|
|
7
|
+
export declare const pickResource: (identifier?: string, resources?: IResourceItem[], legacy?: boolean) => IResourceItem | undefined;
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
{"
|
|
1
|
+
import type { IResourceItem } from "../../../contexts/resource/types";
|
|
2
|
+
/**
|
|
3
|
+
* Picks the data provider name based on the provided name or fallbacks to resource definition, or `default`.
|
|
4
|
+
*/
|
|
5
|
+
export declare const pickDataProvider: (resourceName?: string, dataProviderName?: string, resources?: IResourceItem[]) => string;
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
export declare const pickNotDeprecated: <T extends unknown[]>(...args: T) => T[never];
|
|
2
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1,3 @@
|
|
|
1
|
-
{
|
|
1
|
+
import type { QueryFunctionContext, QueryKey } from "@tanstack/react-query";
|
|
2
|
+
export declare const prepareQueryContext: (context: QueryFunctionContext<QueryKey, any>) => Omit<QueryFunctionContext<QueryKey, any>, "meta">;
|
|
3
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
export declare const propertyPathToArray: (propertyPath: string) => (string | number)[];
|
|
2
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
import type { IQueryKeys, MetaQuery } from "../../../contexts/data/types";
|
|
2
|
+
/**
|
|
3
|
+
* @deprecated `queryKeys` is deprecated. Please use `keys` instead.
|
|
4
|
+
*/
|
|
5
|
+
export declare const queryKeys: (resource?: string, dataProviderName?: string, meta?: MetaQuery, metaData?: MetaQuery | undefined) => IQueryKeys;
|
|
6
|
+
export declare const queryKeysReplacement: (preferLegacyKeys?: boolean) => (resource?: string, dataProviderName?: string, meta?: MetaQuery, metaData?: MetaQuery | undefined) => IQueryKeys;
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1,11 @@
|
|
|
1
|
-
{"
|
|
1
|
+
import type { IRefineContextOptions } from "../../../contexts/refine/types";
|
|
2
|
+
import type { Action } from "../../../contexts/router/types";
|
|
3
|
+
import type { RedirectAction } from "../../../hooks/form/types";
|
|
4
|
+
type RedirectPageProps = {
|
|
5
|
+
redirectFromProps?: RedirectAction;
|
|
6
|
+
action: Action;
|
|
7
|
+
redirectOptions: IRefineContextOptions["redirect"];
|
|
8
|
+
};
|
|
9
|
+
export declare const redirectPage: ({ redirectFromProps, action, redirectOptions, }: RedirectPageProps) => RedirectAction;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{"
|
|
1
|
+
import type { ResourceProps } from "../../../contexts/resource/types";
|
|
2
|
+
/**
|
|
3
|
+
* generates route for the resource based on parents and custom routes
|
|
4
|
+
* @deprecated this is a **legacy** function and works only with the old resource definition
|
|
5
|
+
*/
|
|
6
|
+
export declare const routeGenerator: (item: ResourceProps, resourcesFromProps: ResourceProps[]) => string | undefined;
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* This function if the route and resourceRoute match by segments.
|
|
3
|
+
* - First, trailing and leading slashes are removed
|
|
4
|
+
* - Then, the route and resourceRoute are split to segments and checked if they have the same number of segments
|
|
5
|
+
* - Then, each segment is checked if it is a parameter or if it matches the resourceRoute segment
|
|
6
|
+
* - If all segments match, the function returns true, otherwise false
|
|
7
|
+
*/
|
|
8
|
+
export declare const checkBySegments: (route: string, resourceRoute: string) => boolean;
|
|
9
|
+
//# sourceMappingURL=check-by-segments.d.ts.map
|
|
@@ -1 +1,11 @@
|
|
|
1
|
-
{"
|
|
1
|
+
import type { MetaQuery } from "../../../contexts/data/types";
|
|
2
|
+
import type { ParseResponse } from "../../../contexts/router/types";
|
|
3
|
+
/**
|
|
4
|
+
* This function will compose a route with the given params and meta.
|
|
5
|
+
* - A route can have parameters like (eg: /users/:id)
|
|
6
|
+
* - First we pick the route params from the route (eg: [id])
|
|
7
|
+
* - Then we prepare the route params with the given params and meta (eg: { id: 1 })
|
|
8
|
+
* - Then we replace the route params with the prepared route params (eg: /users/1)
|
|
9
|
+
*/
|
|
10
|
+
export declare const composeRoute: (designatedRoute: string, resourceMeta?: MetaQuery, parsed?: ParseResponse, meta?: Record<string, unknown>) => string;
|
|
11
|
+
//# sourceMappingURL=compose-route.d.ts.map
|
|
@@ -1 +1,16 @@
|
|
|
1
|
-
{
|
|
1
|
+
import type { IResourceItem } from "../../../contexts/resource/types";
|
|
2
|
+
import type { Action } from "../../../contexts/router/types";
|
|
3
|
+
export type ResourceActionRoute = {
|
|
4
|
+
action: Action;
|
|
5
|
+
resource: IResourceItem;
|
|
6
|
+
route: string;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* This function returns all the routes for available actions for a resource.
|
|
10
|
+
* - If the action is a function, it means we're fallbacking to default path for the action
|
|
11
|
+
* - If the action is a string, it means we don't have the component, but we have the route
|
|
12
|
+
* - If the action is an object, it means we have the component and the route
|
|
13
|
+
* - It will return an array of objects with the action, the resource and the route
|
|
14
|
+
*/
|
|
15
|
+
export declare const getActionRoutesFromResource: (resource: IResourceItem, resources: IResourceItem[], legacy?: boolean) => ResourceActionRoute[];
|
|
16
|
+
//# sourceMappingURL=get-action-routes-from-resource.d.ts.map
|
|
@@ -1 +1,8 @@
|
|
|
1
|
-
{"
|
|
1
|
+
import type { Action } from "../../../contexts/router/types";
|
|
2
|
+
/**
|
|
3
|
+
* This helper function returns the default path for a given action and resource.
|
|
4
|
+
* It also applies the parentPrefix if provided.
|
|
5
|
+
* This is used by the legacy router and the new router if the resource doesn't provide a custom path.
|
|
6
|
+
*/
|
|
7
|
+
export declare const getDefaultActionPath: (resourceName: string, action: Action, parentPrefix?: string) => string;
|
|
8
|
+
//# sourceMappingURL=get-default-action-path.d.ts.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{"
|
|
1
|
+
import type { ResourceProps } from "../../../contexts/resource/types";
|
|
2
|
+
/**
|
|
3
|
+
* Returns the parent prefix for a resource
|
|
4
|
+
* - If `legacy` is provided, the computation is based on the `route` option of the resource
|
|
5
|
+
*/
|
|
6
|
+
export declare const getParentPrefixForResource: (resource: ResourceProps, resources: ResourceProps[], legacy?: boolean) => string | undefined;
|
|
7
|
+
//# sourceMappingURL=get-parent-prefix-for-resource.d.ts.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{"
|
|
1
|
+
import type { IResourceItem } from "../../../contexts/resource/types";
|
|
2
|
+
/**
|
|
3
|
+
* Returns the parent resource of the given resource.
|
|
4
|
+
* Works both with the deprecated `parentName` and the new `parent` property.
|
|
5
|
+
*/
|
|
6
|
+
export declare const getParentResource: (resource: IResourceItem, resources: IResourceItem[]) => IResourceItem | undefined;
|
|
7
|
+
//# sourceMappingURL=get-parent-resource.d.ts.map
|
|
@@ -1 +1,10 @@
|
|
|
1
|
-
{"
|
|
1
|
+
export { checkBySegments } from "./check-by-segments";
|
|
2
|
+
export { getActionRoutesFromResource } from "./get-action-routes-from-resource";
|
|
3
|
+
export { getDefaultActionPath } from "./get-default-action-path";
|
|
4
|
+
export { getParentPrefixForResource } from "./get-parent-prefix-for-resource";
|
|
5
|
+
export { getParentResource } from "./get-parent-resource";
|
|
6
|
+
export { isParameter } from "./is-parameter";
|
|
7
|
+
export { isSegmentCountsSame } from "./is-segment-counts-same";
|
|
8
|
+
export { removeLeadingTrailingSlashes } from "./remove-leading-trailing-slashes";
|
|
9
|
+
export { matchResourceFromRoute } from "./match-resource-from-route";
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Check if a segment is a parameter. (e.g. :id)
|
|
3
|
+
*/
|
|
4
|
+
export declare const isParameter: (segment: string) => boolean;
|
|
5
|
+
//# sourceMappingURL=is-parameter.d.ts.map
|
|
@@ -1 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Checks if the both routes have the same number of segments.
|
|
3
|
+
*/
|
|
4
|
+
export declare const isSegmentCountsSame: (route: string, resourceRoute: string) => boolean;
|
|
5
|
+
//# sourceMappingURL=is-segment-counts-same.d.ts.map
|