react-toolkits 0.0.4 → 0.0.5
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/.turbo/turbo-build.log +6 -6
- package/CHANGELOG.md +6 -0
- package/dist/index.d.mts +39 -26
- package/dist/index.esm.js +155 -145
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/FilterForm/index.tsx +1 -0
- package/src/components/QueryList/index.tsx +8 -21
- package/src/constants/index.ts +0 -2
- package/src/features/permission/hooks/index.ts +13 -28
- package/src/hooks/index.ts +1 -1
- package/src/hooks/{use-fetcher.tsx → use-http-client.tsx} +16 -42
- package/src/hooks/use-permission.tsx +10 -4
- package/src/index.ts +1 -0
- package/src/layouts/Layout.tsx +75 -37
- package/src/layouts/NavBar.tsx +8 -21
- package/src/pages/Login/index.tsx +3 -0
- package/src/pages/NoMatch/index.tsx +27 -0
- package/src/pages/index.ts +2 -1
- package/src/pages/permission/RoleList.tsx +11 -11
- package/src/types/index.ts +0 -17
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> react-toolkits@0.0.
|
|
2
|
+
> react-toolkits@0.0.5 build /home/runner/work/everythingflow/everythingflow/packages/react-toolkits
|
|
3
3
|
> tsup
|
|
4
4
|
|
|
5
5
|
[34mCLI[39m Building entry: src/index.ts
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
[32mESM[39m [1mdist/512_orange_nobackground-L6MFCL6M.png [22m[32m9.49 KB[39m
|
|
14
14
|
[32mESM[39m [1mdist/index.css [22m[32m4.51 KB[39m
|
|
15
15
|
[32mESM[39m [1mdist/index.css.map [22m[32m7.65 KB[39m
|
|
16
|
-
[32mESM[39m [1mdist/index.esm.js [22m[
|
|
17
|
-
[32mESM[39m [1mdist/index.esm.js.map [22m[
|
|
18
|
-
[32mESM[39m ⚡️ Build success in
|
|
19
|
-
[32mDTS[39m ⚡️ Build success in
|
|
20
|
-
[32mDTS[39m [1mdist/index.d.mts [22m[
|
|
16
|
+
[32mESM[39m [1mdist/index.esm.js [22m[32m116.47 KB[39m
|
|
17
|
+
[32mESM[39m [1mdist/index.esm.js.map [22m[32m161.28 KB[39m
|
|
18
|
+
[32mESM[39m ⚡️ Build success in 1983ms
|
|
19
|
+
[32mDTS[39m ⚡️ Build success in 8777ms
|
|
20
|
+
[32mDTS[39m [1mdist/index.d.mts [22m[32m8.28 KB[39m
|
package/CHANGELOG.md
CHANGED
package/dist/index.d.mts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as React from 'react';
|
|
2
2
|
import { FC, PropsWithChildren, ForwardedRef, ReactElement, ReactNode } from 'react';
|
|
3
3
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
4
|
import { FormProps, FormInstance, ModalProps, ButtonProps } from 'antd';
|
|
5
5
|
import { Merge } from 'ts-essentials';
|
|
6
6
|
import { TableProps } from 'antd/es/table';
|
|
7
|
-
import { AxiosRequestConfig } from 'axios';
|
|
7
|
+
import { AxiosRequestConfig, AxiosInstance } from 'axios';
|
|
8
8
|
import * as zustand_middleware from 'zustand/middleware';
|
|
9
9
|
import * as zustand from 'zustand';
|
|
10
10
|
import { RouteObject } from 'react-router-dom';
|
|
@@ -53,7 +53,7 @@ type UseFormModalProps<T> = Merge<Omit<FormModalProps<T>, 'open' | 'onCancel' |
|
|
|
53
53
|
content: FormModalProps<T>['children'];
|
|
54
54
|
}>;
|
|
55
55
|
declare function useFormModal<T extends object>(props: UseFormModalProps<T>): {
|
|
56
|
-
Modal:
|
|
56
|
+
Modal: React.ReactPortal;
|
|
57
57
|
showModal: (options?: {
|
|
58
58
|
initialValues?: RecursivePartial<T> | undefined;
|
|
59
59
|
title?: FormModalProps<T>['title'];
|
|
@@ -72,21 +72,6 @@ interface PermissionButtonProps extends Omit<ButtonProps, 'disabled'> {
|
|
|
72
72
|
}
|
|
73
73
|
declare const PermissionButton: FC<PropsWithChildren<PermissionButtonProps>>;
|
|
74
74
|
|
|
75
|
-
type MenuItemType2 = Merge<MenuItemType, {
|
|
76
|
-
code /** 权限编号 **/?: string;
|
|
77
|
-
route /** 前端路由地址 **/?: string;
|
|
78
|
-
}>;
|
|
79
|
-
type SubMenuType2 = Merge<SubMenuType, {
|
|
80
|
-
children?: ItemType2[];
|
|
81
|
-
}>;
|
|
82
|
-
type MenuItemGroupType2 = Merge<MenuItemGroupType, {
|
|
83
|
-
children?: ItemType2[];
|
|
84
|
-
}>;
|
|
85
|
-
type ItemType2 = MenuItemType2 | SubMenuType2 | MenuItemGroupType2 | MenuDividerType | null;
|
|
86
|
-
interface NavBarProps {
|
|
87
|
-
items: ItemType2[];
|
|
88
|
-
}
|
|
89
|
-
|
|
90
75
|
type PaginationParams = {
|
|
91
76
|
page: number;
|
|
92
77
|
perPage: number;
|
|
@@ -102,21 +87,30 @@ interface QueryListProps<Item, Values> extends Pick<TableProps<Item>, 'columns'
|
|
|
102
87
|
}
|
|
103
88
|
declare const QueryList: <Item extends object, Values = {}>(props: QueryListProps<Item, Values>) => react_jsx_runtime.JSX.Element;
|
|
104
89
|
|
|
105
|
-
|
|
106
|
-
|
|
90
|
+
type ShimmedAxiosInstance = Merge<AxiosInstance, {
|
|
91
|
+
request<T = unknown, D = unknown>(config: AxiosRequestConfig<D>): Promise<T>;
|
|
92
|
+
get<T = unknown, D = unknown>(url: string, config?: AxiosRequestConfig<D>): Promise<T>;
|
|
93
|
+
delete<T = unknown, D = unknown>(url: string, config?: AxiosRequestConfig<D>): Promise<T>;
|
|
94
|
+
head<T = unknown, D = unknown>(url: string, config?: AxiosRequestConfig<D>): Promise<T>;
|
|
95
|
+
post<T = unknown, D = unknown>(url: string, data?: unknown, config?: AxiosRequestConfig<D>): Promise<T>;
|
|
96
|
+
put<T = unknown, D = unknown>(url: string, data?: unknown, config?: AxiosRequestConfig<D>): Promise<T>;
|
|
97
|
+
patch<T = unknown, D = unknown>(url: string, data?: unknown, config?: AxiosRequestConfig<D>): Promise<T>;
|
|
98
|
+
}>;
|
|
99
|
+
declare class HttpClientError extends Error {
|
|
100
|
+
code?: number;
|
|
107
101
|
skip: boolean;
|
|
108
|
-
constructor(message: string, code
|
|
102
|
+
constructor(message: string, code?: number, skip?: boolean);
|
|
109
103
|
}
|
|
110
|
-
declare function
|
|
104
|
+
declare function useHttpClient(): ShimmedAxiosInstance;
|
|
111
105
|
|
|
112
106
|
interface PermissionCheckResult {
|
|
113
107
|
[k: string]: boolean;
|
|
114
108
|
}
|
|
115
109
|
declare function usePermissions(codes: string[]): {
|
|
116
|
-
data: Record<string, boolean
|
|
117
|
-
isLoading:
|
|
110
|
+
data: Record<string, boolean>;
|
|
111
|
+
isLoading: false;
|
|
118
112
|
};
|
|
119
|
-
declare function usePermission(code
|
|
113
|
+
declare function usePermission(code: string): {
|
|
120
114
|
accessible: boolean;
|
|
121
115
|
isValidating: boolean;
|
|
122
116
|
};
|
|
@@ -176,8 +170,25 @@ declare const useQueryTriggerStore: zustand.UseBoundStore<zustand.StoreApi<Query
|
|
|
176
170
|
|
|
177
171
|
declare const Login: FC<PropsWithChildren>;
|
|
178
172
|
|
|
173
|
+
declare const NoMatch: () => react_jsx_runtime.JSX.Element;
|
|
174
|
+
|
|
179
175
|
declare const routes: RouteObject;
|
|
180
176
|
|
|
177
|
+
type MenuItemType2 = Merge<MenuItemType, {
|
|
178
|
+
code /** 权限编号 **/?: string;
|
|
179
|
+
route /** 前端路由地址 **/?: string;
|
|
180
|
+
}>;
|
|
181
|
+
type SubMenuType2 = Merge<SubMenuType, {
|
|
182
|
+
children?: ItemType2[];
|
|
183
|
+
}>;
|
|
184
|
+
type MenuItemGroupType2 = Merge<MenuItemGroupType, {
|
|
185
|
+
children?: ItemType2[];
|
|
186
|
+
}>;
|
|
187
|
+
type ItemType2 = MenuItemType2 | SubMenuType2 | MenuItemGroupType2 | MenuDividerType | null;
|
|
188
|
+
interface NavBarProps {
|
|
189
|
+
items: ItemType2[];
|
|
190
|
+
}
|
|
191
|
+
|
|
181
192
|
interface LayoutProps {
|
|
182
193
|
title?: ReactNode;
|
|
183
194
|
items: ItemType2[];
|
|
@@ -185,4 +196,6 @@ interface LayoutProps {
|
|
|
185
196
|
}
|
|
186
197
|
declare const Layout: FC<PropsWithChildren<LayoutProps>>;
|
|
187
198
|
|
|
188
|
-
|
|
199
|
+
declare const SSO_URL = "https://idaas.ifunplus.cn/enduser/api/application/plugin_FunPlus/sso/v1";
|
|
200
|
+
|
|
201
|
+
export { DynamicTags, DynamicTagsProps, FilterForm, FilterFormProps, FormModal, FormModalProps, FormModalRef, Highlight, HighlightTextsProps, HttpClientError, ItemType2, Layout, LayoutProps, Login, MenuState, NavBarProps, NoMatch, PermissionButton, PermissionButtonProps, PermissionCheckResult, QueryList, QueryListKey, QueryListProps, QueryTriggerState, SSO_URL, TokenState, UseFormModalProps, routes as permission, useFormModal, useHttpClient, useMenuStore, usePermission, usePermissions, useQueryTriggerStore, useTokenStore };
|