react-toolkits 2.22.11 → 2.22.13

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.
Files changed (70) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/lib/chunk-7W2ZX3CB.js +2 -0
  3. package/lib/chunk-7W2ZX3CB.js.map +1 -0
  4. package/lib/chunk-AGGPFMZE.js +3 -0
  5. package/lib/chunk-AGGPFMZE.js.map +1 -0
  6. package/lib/chunk-ES6EDPL4.js +2 -0
  7. package/lib/chunk-ES6EDPL4.js.map +1 -0
  8. package/lib/chunk-JAGE2XCG.js +2 -0
  9. package/lib/chunk-JAGE2XCG.js.map +1 -0
  10. package/lib/chunk-JUD7AMBZ.js +2 -0
  11. package/lib/chunk-JUD7AMBZ.js.map +1 -0
  12. package/lib/chunk-LKQSOMD5.js +2 -0
  13. package/lib/chunk-LKQSOMD5.js.map +1 -0
  14. package/lib/chunk-MS25PZ5J.js +2 -0
  15. package/lib/chunk-MS25PZ5J.js.map +1 -0
  16. package/lib/chunk-Q4PXPBQR.js +2 -0
  17. package/lib/chunk-Q4PXPBQR.js.map +1 -0
  18. package/lib/chunk-XBISTSFI.js +2 -0
  19. package/lib/chunk-XBISTSFI.js.map +1 -0
  20. package/lib/createMenuItem-PS7ABPSF.js +2 -0
  21. package/lib/createMenuItem-PS7ABPSF.js.map +1 -0
  22. package/lib/index.css +0 -3
  23. package/lib/index.d.ts +793 -21
  24. package/lib/index.js +3 -2
  25. package/lib/index.js.map +1 -0
  26. package/lib/menuItemList-LXN2NUCP.js +2 -0
  27. package/lib/menuItemList-LXN2NUCP.js.map +1 -0
  28. package/lib/roleDetail-VH4X743G.js +2 -0
  29. package/lib/roleDetail-VH4X743G.js.map +1 -0
  30. package/lib/roleList-RHX3D2HP.js +2 -0
  31. package/lib/roleList-RHX3D2HP.js.map +1 -0
  32. package/lib/updateMenuItem-M5U4T3L7.js +2 -0
  33. package/lib/updateMenuItem-M5U4T3L7.js.map +1 -0
  34. package/lib/userDetail-ODAEQUYS.js +2 -0
  35. package/lib/userDetail-ODAEQUYS.js.map +1 -0
  36. package/lib/userList-TSYEABRN.js +2 -0
  37. package/lib/userList-TSYEABRN.js.map +1 -0
  38. package/locale/context.js +2 -1
  39. package/locale/context.js.map +1 -0
  40. package/locale/en_GB.js +2 -1
  41. package/locale/en_GB.js.map +1 -0
  42. package/locale/hooks.js +2 -1
  43. package/locale/hooks.js.map +1 -0
  44. package/locale/index.js +2 -1
  45. package/locale/index.js.map +1 -0
  46. package/locale/ja_JP.js +2 -1
  47. package/locale/ja_JP.js.map +1 -0
  48. package/locale/ko_KR.js +2 -1
  49. package/locale/ko_KR.js.map +1 -0
  50. package/locale/zh_CN.js +2 -1
  51. package/locale/zh_CN.js.map +1 -0
  52. package/package.json +6 -36
  53. package/lib/components.d.ts +0 -429
  54. package/lib/components.js +0 -1
  55. package/lib/constants.d.ts +0 -11
  56. package/lib/constants.js +0 -2
  57. package/lib/hooks.d.ts +0 -108
  58. package/lib/hooks.js +0 -1
  59. package/lib/logo-L6MFCL6M.png +0 -0
  60. package/lib/modules.d.ts +0 -7
  61. package/lib/modules.js +0 -1
  62. package/lib/pages.d.ts +0 -20
  63. package/lib/pages.js +0 -2
  64. package/lib/services.d.ts +0 -196
  65. package/lib/services.js +0 -1
  66. package/lib/types-DVKf5poe.d.ts +0 -19
  67. package/lib/types.d.ts +0 -23
  68. package/lib/types.js +0 -0
  69. package/lib/utils.d.ts +0 -6
  70. package/lib/utils.js +0 -1
package/lib/index.d.ts CHANGED
@@ -1,21 +1,793 @@
1
- export { DynamicTags, DynamicTagsProps, ExpandableParagraph, ExpandableParagraphProps, FilterFormWrapper, FilterFormWrapperProps, Highlight, HighlightProps, InfiniteList, InfiniteListAction, InfiniteListPayload, InfiniteListProps, InfiniteListRef, InfiniteListRequestConfig, Layout, LayoutProps, Logo, LogoProps, NavMenu, NavMenuItem, PermissionButton, PermissionButtonProps, QueryList, QueryListAction, QueryListPayload, QueryListProps, QueryListRef, RequireGame, RequirePermission, RequirePermissionProps, ToolkitsProvider, ToolkitsProviderProps, UserWidget, useInfiniteListStore, useQueryListStore, useToolkitsStore, withContext } from './components.js';
2
- export { G as Game } from './types-DVKf5poe.js';
3
- export { APP_ID_HEADER, FRONTEND_ROUTE_PREFIX, PermissionVersion, SSO_URL, WILDCARD } from './constants.js';
4
- export { UseFormDrawerProps, UseFormModalProps, useDrawer, useDrawerStore, useFormDrawer, useFormModal, useModal, useModalStore } from './hooks.js';
5
- export { menu, permission } from './modules.js';
6
- export { NotFound, OperationLogList, SignIn } from './pages.js';
7
- export { useGames, useMenuList, usePermission } from './services.js';
8
- export { MenuListItem, Permission, RecursivePartial } from './types.js';
9
- export { generateId, mixedStorage } from './utils.js';
10
- import 'react';
11
- import 'antd/es/typography/Paragraph';
12
- import 'react/jsx-runtime';
13
- import 'antd';
14
- import 'antd/es/_util/type';
15
- import 'antd/es/table';
16
- import 'zustand';
17
- import 'antd/es/menu/interface';
18
- import 'ts-essentials';
19
- import 'ky';
20
- import '@tanstack/react-query';
21
- import 'zustand/middleware';
1
+ import * as react from 'react';
2
+ import { FC, PropsWithChildren, Key, ReactNode, ReactElement, Ref, DetailedHTMLProps, ImgHTMLAttributes, ComponentType, ComponentProps } from 'react';
3
+ import { ParagraphProps } from 'antd/es/typography/Paragraph';
4
+ import * as react_jsx_runtime from 'react/jsx-runtime';
5
+ import { FormInstance, MenuProps, SelectProps, ButtonProps, DrawerProps, Button, FormProps, ModalProps } from 'antd';
6
+ import { AnyObject } from 'antd/es/_util/type';
7
+ import { TableProps } from 'antd/es/table';
8
+ import * as zustand from 'zustand';
9
+ import { ItemType, SubMenuType, MenuItemGroupType, MenuItemType } from 'antd/es/menu/interface';
10
+ import { Merge } from 'ts-essentials';
11
+ import { Options } from 'ky';
12
+ import * as _tanstack_react_query from '@tanstack/react-query';
13
+ import { StateStorage } from 'zustand/middleware';
14
+
15
+ interface DynamicTagsProps {
16
+ initialTags?: string[];
17
+ addable?: boolean;
18
+ removable?: boolean;
19
+ addCallback?: (addedTag: string) => Promise<boolean>;
20
+ removeCallback?: (removedTag: string) => Promise<boolean>;
21
+ }
22
+ declare const DynamicTags: FC<DynamicTagsProps>;
23
+
24
+ type ExpandableParagraphProps = Omit<ParagraphProps, 'ellipsis' | 'className'>;
25
+ declare const ExpandableParagraph: FC<ExpandableParagraphProps>;
26
+
27
+ interface FilterFormWrapperProps extends PropsWithChildren {
28
+ onConfirm?: () => void | Promise<void>;
29
+ onReset?: () => void;
30
+ extras?: {
31
+ key: Key;
32
+ children: ReactNode;
33
+ }[];
34
+ isConfirming?: boolean;
35
+ buttonsAlign?: 'left' | 'right' | 'bottom';
36
+ showReset?: boolean;
37
+ }
38
+ declare const FilterFormWrapper: (props: FilterFormWrapperProps) => react_jsx_runtime.JSX.Element;
39
+
40
+ interface HighlightProps extends PropsWithChildren {
41
+ texts: Array<string | number>;
42
+ }
43
+ declare const Highlight: (props: HighlightProps) => react_jsx_runtime.JSX.Element;
44
+
45
+ interface InfiniteListPayload<Values = any> {
46
+ page?: number;
47
+ filters?: Values;
48
+ }
49
+ interface InfiniteListRequestConfig<Values = any> {
50
+ url: string;
51
+ method?: 'GET' | 'POST';
52
+ body?: FormData | Record<string | number, any> | ((payload: InfiniteListPayload<Values>, pageParam: any) => FormData | Record<string | number, any>);
53
+ params?: Record<string | number, any> | ((payload: InfiniteListPayload<Values>, pageParam: any) => Record<string | number, any>);
54
+ headers?: Record<string, string> | ((form: FormInstance<Values>) => Record<string, string>);
55
+ cacheTime?: number;
56
+ staleTime?: number;
57
+ }
58
+ declare enum InfiniteListAction {
59
+ Confirm = 0,
60
+ Reset = 1,
61
+ LoadMore = 2,
62
+ Init = 3
63
+ }
64
+ interface InfiniteListDataAdapter<Item = any, Values = any, Data = any> {
65
+ items?: (data: Data[] | undefined, form: FormInstance<Values>) => Item[] | undefined;
66
+ hasMore?: (lastPage: Data | undefined, allPages: Data[]) => boolean;
67
+ nextPageParam?: (lastPage: Data | undefined, allPages: Data[], pageParam: any) => any;
68
+ }
69
+ interface InfiniteListRef<Item = any, Values = any, Data = any> {
70
+ data: Data[] | undefined;
71
+ dataSource: Item[] | undefined;
72
+ form: FormInstance<Values>;
73
+ refetch: () => void;
74
+ fetchNextPage: () => void;
75
+ hasNextPage: boolean;
76
+ isFetchingNextPage: boolean;
77
+ }
78
+ interface InfiniteListProps<Item, Values, Data> extends Omit<TableProps<Item>, 'pagination' | 'dataSource' | 'loading' | 'footer'>, Pick<FilterFormWrapperProps, 'buttonsAlign' | 'showReset'> {
79
+ identifier?: string;
80
+ code?: string;
81
+ form?: FormInstance<Values>;
82
+ refreshInterval?: number;
83
+ request: InfiniteListRequestConfig<Values>;
84
+ tableExtra?: ReactNode | ((form: FormInstance<Values>, data?: Data[]) => ReactNode);
85
+ renderForm?: (form: FormInstance<Values>) => ReactElement;
86
+ afterSuccess?: (action: InfiniteListAction, form: FormInstance<Values>, data?: Data[]) => void;
87
+ afterError?: (error: Error, action: InfiniteListAction, form: FormInstance<Values>) => void;
88
+ dataAdapter?: InfiniteListDataAdapter<Item, Values, Data>;
89
+ initialPageParam?: any;
90
+ footer?: (data: Data[] | undefined) => ReactNode;
91
+ }
92
+ declare const InfiniteList: <Item extends AnyObject = AnyObject, Values extends object | undefined = undefined, Data = any>(props: InfiniteListProps<Item, Values, Data> & {
93
+ ref?: Ref<InfiniteListRef<Item, Values, Data>>;
94
+ }) => ReactElement;
95
+
96
+ type InfiniteQueryRefetchFunction = () => void | Promise<unknown>;
97
+ type InfiniteQueryFetchNextPageFunction = () => void | Promise<unknown>;
98
+ interface InfiniteListInstance {
99
+ id: string;
100
+ url: string;
101
+ queryKey: readonly unknown[];
102
+ payload: InfiniteListPayload;
103
+ refetch: InfiniteQueryRefetchFunction;
104
+ fetchNextPage: InfiniteQueryFetchNextPageFunction;
105
+ }
106
+ interface InfiniteListState {
107
+ instances: Map<string, InfiniteListInstance>;
108
+ registerInstance(id: string, url: string, queryKey: readonly unknown[], refetch: InfiniteQueryRefetchFunction, fetchNextPage: InfiniteQueryFetchNextPageFunction): void;
109
+ unregisterInstance(id: string): void;
110
+ updatePayload(id: string, payload: InfiniteListPayload): void;
111
+ getPayload(id: string): InfiniteListPayload;
112
+ refetch(id: string, payload?: InfiniteListPayload): Promise<void>;
113
+ fetchNextPage(id: string): Promise<void>;
114
+ getInstance(id: string): InfiniteListInstance | undefined;
115
+ getAllInstances(): InfiniteListInstance[];
116
+ }
117
+ declare const useInfiniteListStore: zustand.UseBoundStore<Omit<Omit<zustand.StoreApi<InfiniteListState>, "setState"> & {
118
+ setState(partial: InfiniteListState | Partial<InfiniteListState> | ((state: InfiniteListState) => InfiniteListState | Partial<InfiniteListState>), replace?: false | undefined, action?: (string | {
119
+ [x: string]: unknown;
120
+ [x: number]: unknown;
121
+ [x: symbol]: unknown;
122
+ type: string;
123
+ }) | undefined): void;
124
+ setState(state: InfiniteListState | ((state: InfiniteListState) => InfiniteListState), replace: true, action?: (string | {
125
+ [x: string]: unknown;
126
+ [x: number]: unknown;
127
+ [x: symbol]: unknown;
128
+ type: string;
129
+ }) | undefined): void;
130
+ }, "subscribe"> & {
131
+ subscribe: {
132
+ (listener: (selectedState: InfiniteListState, previousSelectedState: InfiniteListState) => void): () => void;
133
+ <U>(selector: (state: InfiniteListState) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
134
+ equalityFn?: ((a: U, b: U) => boolean) | undefined;
135
+ fireImmediately?: boolean;
136
+ } | undefined): () => void;
137
+ };
138
+ }>;
139
+
140
+ type MenuItemType2 = Merge<MenuItemType, {
141
+ route?: string;
142
+ }>;
143
+ type SubMenuType2 = Merge<SubMenuType, {
144
+ children?: NavMenuItem[];
145
+ }>;
146
+ type MenuItemGroupType2 = Merge<MenuItemGroupType, {
147
+ children?: NavMenuItem[];
148
+ }>;
149
+ type NavMenuItem = Exclude<ItemType, SubMenuType | MenuItemGroupType | MenuItemType> | MenuItemType2 | SubMenuType2 | MenuItemGroupType2;
150
+
151
+ interface NavMenuProps {
152
+ items?: NavMenuItem[];
153
+ theme?: MenuProps['theme'];
154
+ loading?: boolean;
155
+ }
156
+ declare const NavMenu: react.NamedExoticComponent<NavMenuProps>;
157
+
158
+ type Area = 'all' | 'cn' | 'global';
159
+ type ScreenOrientation = 0 | 1;
160
+ interface Game {
161
+ id: number;
162
+ game_id: string | number;
163
+ game_group: string;
164
+ name: string;
165
+ screen_type: ScreenOrientation;
166
+ area: Area;
167
+ icon: string;
168
+ auth: string;
169
+ ctime: string;
170
+ mtime: string;
171
+ is_delete: 0 | 1;
172
+ is_new_game: 0 | 1;
173
+ server_type: string;
174
+ }
175
+
176
+ interface GameSelectProps {
177
+ filter?: (game: Game) => boolean;
178
+ options?: (data?: Game[]) => SelectProps['options'];
179
+ }
180
+
181
+ type HeaderExtra = {
182
+ key: Key;
183
+ children: ReactNode;
184
+ };
185
+ interface LayoutProps extends Pick<GameSelectProps, 'filter'> {
186
+ collapsible?: boolean;
187
+ isMenuLoading?: boolean;
188
+ items?: NavMenuItem[];
189
+ navWidth?: string | number;
190
+ gameSelectOptions?: GameSelectProps['options'];
191
+ headerExtra?: {
192
+ left?: HeaderExtra[];
193
+ right?: HeaderExtra[];
194
+ };
195
+ title?: string;
196
+ subtitle?: string;
197
+ }
198
+ declare const Layout: FC<PropsWithChildren<LayoutProps>>;
199
+
200
+ type LogoProps = Omit<DetailedHTMLProps<ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, 'src' | 'alt'>;
201
+ declare const Logo: FC<LogoProps>;
202
+
203
+ interface PermissionButtonProps extends ButtonProps {
204
+ code?: string | string[];
205
+ showLoading?: boolean;
206
+ config?: Options;
207
+ }
208
+ declare const PermissionButton: FC<PropsWithChildren<PermissionButtonProps>>;
209
+
210
+ interface QueryListPayload<Values = any> {
211
+ page?: number;
212
+ size?: number;
213
+ filters?: Values;
214
+ }
215
+ interface CacheConfig {
216
+ cacheTime?: number;
217
+ staleTime?: number;
218
+ }
219
+ type HttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'HEAD';
220
+ interface QueryListRequestConfig extends CacheConfig {
221
+ url: string;
222
+ method?: HttpMethod;
223
+ body?: FormData | Record<string | number, any>;
224
+ searchParams?: Record<string | number, any>;
225
+ headers?: Record<string, string>;
226
+ }
227
+ type QueryListRequestConfigType<Values = any> = QueryListRequestConfig | ((payload: QueryListPayload<Values>) => QueryListRequestConfig);
228
+ declare enum QueryListAction {
229
+ Confirm = 0,
230
+ Reset = 1,
231
+ Jump = 2,
232
+ Init = 3
233
+ }
234
+ interface QueryListRef<Item extends AnyObject = AnyObject, Values = AnyObject, Data = any> {
235
+ data: Data | undefined;
236
+ dataSource: Item[] | undefined;
237
+ form: FormInstance<Values>;
238
+ }
239
+ interface QueryListDataAdapter<Item extends AnyObject = AnyObject> {
240
+ total?: number;
241
+ items?: Item[];
242
+ }
243
+ type QueryListDataAdapterConfig<Item extends AnyObject = AnyObject, Data = any> = QueryListDataAdapter<Item> | ((data: Data) => QueryListDataAdapter<Item>);
244
+ interface QueryListProps<Item extends AnyObject = AnyObject, Values = AnyObject, Data = any> extends Omit<TableProps<Item>, 'pagination' | 'dataSource' | 'loading' | 'footer'>, Pick<FilterFormWrapperProps, 'buttonsAlign' | 'showReset'> {
245
+ identifier?: string;
246
+ code?: string;
247
+ form?: FormInstance<Values>;
248
+ refreshInterval?: number;
249
+ onePage?: boolean;
250
+ defaultSize?: number;
251
+ pageSizeOptions?: number[];
252
+ request: QueryListRequestConfigType<Values>;
253
+ tableExtra?: ReactNode | ((form: FormInstance<Values>, data?: Data) => ReactNode);
254
+ renderForm?: (form: FormInstance<Values>) => ReactElement;
255
+ afterSuccess?: (action: QueryListAction, form: FormInstance<Values>, data?: Data) => void;
256
+ afterError?: (error: Error, action: QueryListAction, form: FormInstance<Values>) => void;
257
+ dataAdapter?: QueryListDataAdapterConfig<Item, Data>;
258
+ footer?: (data: Data | undefined) => ReactNode;
259
+ }
260
+ declare const QueryList: <Item extends AnyObject = AnyObject, Values extends object | undefined = undefined, Data = any>(props: QueryListProps<Item, Values, Data> & {
261
+ ref?: Ref<QueryListRef<Item, Values, Data>>;
262
+ }) => ReactElement;
263
+
264
+ type QueryRefetchFunction = () => void | Promise<unknown>;
265
+ interface QueryListInstance {
266
+ id: string;
267
+ url: string;
268
+ queryKey: readonly unknown[];
269
+ payload: QueryListPayload;
270
+ refetch: QueryRefetchFunction;
271
+ }
272
+ interface QueryListState {
273
+ instances: Map<string, QueryListInstance>;
274
+ registerInstance(id: string, url: string, queryKey: readonly unknown[], refetch: QueryRefetchFunction): void;
275
+ unregisterInstance(id: string): void;
276
+ updatePayload(id: string, payload: QueryListPayload): void;
277
+ getPayload(id: string): QueryListPayload;
278
+ refetch(id: string, payload?: QueryListPayload): Promise<void>;
279
+ getInstance(id: string): QueryListInstance | undefined;
280
+ getAllInstances(): QueryListInstance[];
281
+ }
282
+ declare const useQueryListStore: zustand.UseBoundStore<Omit<Omit<zustand.StoreApi<QueryListState>, "setState"> & {
283
+ setState(partial: QueryListState | Partial<QueryListState> | ((state: QueryListState) => QueryListState | Partial<QueryListState>), replace?: false | undefined, action?: (string | {
284
+ [x: string]: unknown;
285
+ [x: number]: unknown;
286
+ [x: symbol]: unknown;
287
+ type: string;
288
+ }) | undefined): void;
289
+ setState(state: QueryListState | ((state: QueryListState) => QueryListState), replace: true, action?: (string | {
290
+ [x: string]: unknown;
291
+ [x: number]: unknown;
292
+ [x: symbol]: unknown;
293
+ type: string;
294
+ }) | undefined): void;
295
+ }, "subscribe"> & {
296
+ subscribe: {
297
+ (listener: (selectedState: QueryListState, previousSelectedState: QueryListState) => void): () => void;
298
+ <U>(selector: (state: QueryListState) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
299
+ equalityFn?: ((a: U, b: U) => boolean) | undefined;
300
+ fireImmediately?: boolean;
301
+ } | undefined): () => void;
302
+ };
303
+ }>;
304
+
305
+ declare const RequireGame: FC<PropsWithChildren>;
306
+
307
+ interface RequirePermissionProps {
308
+ code: string;
309
+ config?: Options;
310
+ }
311
+ declare const RequirePermission: FC<PropsWithChildren<RequirePermissionProps>>;
312
+
313
+ declare const SSO_URL = "https://idaas.ifunplus.cn/enduser/api/application/plugin_FunPlus/sso/v1";
314
+ declare const APP_ID_HEADER = "App-ID";
315
+ declare const FRONTEND_ROUTE_PREFIX = "/console/";
316
+ declare enum PermissionVersion {
317
+ V1 = "v1",
318
+ V2 = "v2",
319
+ V3 = "v3"
320
+ }
321
+ declare const WILDCARD = "*";
322
+
323
+ type Locale = {
324
+ global: {
325
+ noEntitlement: string;
326
+ name: string;
327
+ creationTime: string;
328
+ operation: string;
329
+ update: string;
330
+ edit: string;
331
+ delete: string;
332
+ selectAll: string;
333
+ game: string;
334
+ user: string;
335
+ role: string;
336
+ username: string;
337
+ password: string;
338
+ label: string;
339
+ method: string;
340
+ route: string;
341
+ request: string;
342
+ response: string;
343
+ add: string;
344
+ signIn: string;
345
+ projectGroup: string;
346
+ view: string;
347
+ };
348
+ SignIn: {
349
+ title: string;
350
+ thirdParty: string;
351
+ signInWithIDass: string;
352
+ unregistered: string;
353
+ welcome: string;
354
+ };
355
+ NotFound: {
356
+ subTitle: string;
357
+ buttonText: string;
358
+ };
359
+ FilterFormWrapper: {
360
+ confirmText: string;
361
+ resetText: string;
362
+ };
363
+ FormModal: {
364
+ confirmText: string;
365
+ cancelText: string;
366
+ };
367
+ GameSelect: {
368
+ label: string;
369
+ placeholder: string;
370
+ };
371
+ RequireGame: {
372
+ description: string;
373
+ };
374
+ UserWidget: {
375
+ signOutText: string;
376
+ };
377
+ User: {
378
+ createTitle: string;
379
+ createSuccessfully: string;
380
+ updateTitle: string;
381
+ updateSuccessfully: string;
382
+ deleteTitle: string;
383
+ deleteContent: string;
384
+ deleteSuccessfully: string;
385
+ };
386
+ Role: {
387
+ createTitle: string;
388
+ createSuccessfully: string;
389
+ updateTitle: string;
390
+ updateSuccessfully: string;
391
+ deleteTitle: string;
392
+ deleteContent: string;
393
+ deleteSuccessfully: string;
394
+ };
395
+ PermissionList: {
396
+ failedDescription: string;
397
+ baseSectionTitle: string;
398
+ gameSectionTitle: string;
399
+ gameSectionDescription: string;
400
+ gameSelectPlaceholder: string;
401
+ removeText: string;
402
+ addText: string;
403
+ };
404
+ RoleDetail: {
405
+ title: string;
406
+ };
407
+ InfiniteList: {
408
+ loadingText: string;
409
+ reachEndText: string;
410
+ loadMoreText: string;
411
+ };
412
+ };
413
+
414
+ interface ContextSlice {
415
+ locale: Locale;
416
+ permissionVersion: PermissionVersion;
417
+ gameApiV2: boolean;
418
+ signInPath: string;
419
+ isGlobal: boolean;
420
+ navWidth?: number;
421
+ collapsed?: boolean;
422
+ collapsible?: boolean;
423
+ mainPagePath: string;
424
+ setContext(state: Partial<Omit<ContextSlice, 'setContext'>>): void;
425
+ }
426
+
427
+ interface GameSlice {
428
+ gameId?: string | number;
429
+ setGameId: (id?: string | number) => void;
430
+ }
431
+
432
+ interface UserInfo {
433
+ authorityId: string;
434
+ exp: number;
435
+ }
436
+ interface TokenSlice {
437
+ token?: string;
438
+ getUser: () => UserInfo | null;
439
+ setToken: (token: string) => void;
440
+ }
441
+
442
+ type ToolkitsState = TokenSlice & GameSlice & ContextSlice & {
443
+ clearToken: () => void;
444
+ };
445
+
446
+ declare function useToolkitsStore(): ToolkitsState;
447
+ declare function useToolkitsStore<T>(selector: (state: ToolkitsState) => T): T;
448
+ type ToolkitsProviderProps = PropsWithChildren<Partial<Omit<ContextSlice, 'setContext'>>>;
449
+ declare const ToolkitsProvider: FC<ToolkitsProviderProps>;
450
+ declare const withContext: (Component: ComponentType, providerProps: Omit<ToolkitsProviderProps, "children">) => {
451
+ (props: any): react_jsx_runtime.JSX.Element;
452
+ displayName: string;
453
+ };
454
+
455
+ declare const UserWidget: FC;
456
+
457
+ interface UseDrawerOperation {
458
+ hide: () => void;
459
+ }
460
+ interface UseDrawerProps extends Omit<DrawerProps, 'open' | 'confirmLoading' | 'onClose' | 'footer'> {
461
+ content?: ReactNode | ((operation: UseDrawerOperation) => ReactNode);
462
+ onConfirm?: () => void | Promise<void>;
463
+ afterOpen?: () => void | Promise<void>;
464
+ afterClose?: () => void | Promise<void>;
465
+ footer?: ReactNode | null;
466
+ confirmText?: string;
467
+ cancelText?: string;
468
+ confirmButtonProps?: ComponentProps<typeof Button>;
469
+ cancelButtonProps?: ComponentProps<typeof Button>;
470
+ }
471
+ declare function useDrawer(props: UseDrawerProps): {
472
+ id: number;
473
+ show: () => Promise<void>;
474
+ hide: () => void;
475
+ confirmLoading: boolean;
476
+ drawer: react_jsx_runtime.JSX.Element;
477
+ };
478
+
479
+ interface Permission {
480
+ label: string;
481
+ value: string;
482
+ route: string;
483
+ method?: string;
484
+ }
485
+ interface MenuListItem {
486
+ id: number;
487
+ category: string;
488
+ is_common: boolean;
489
+ is_model: boolean;
490
+ model_name: string;
491
+ permissions: Permission[];
492
+ front_route: string;
493
+ order: number;
494
+ scheme: string;
495
+ ext: string;
496
+ }
497
+ type RecursivePartial<T> = NonNullable<T> extends object ? {
498
+ [P in keyof T]?: NonNullable<T[P]> extends (infer U)[] ? RecursivePartial<U>[] : NonNullable<T[P]> extends object ? RecursivePartial<T[P]> : T[P];
499
+ } : T;
500
+
501
+ interface ShowFormOptions$1<Values extends AnyObject, ExtraValues> {
502
+ initialValues?: RecursivePartial<Values>;
503
+ extraValues?: ExtraValues;
504
+ }
505
+ interface UseFormDrawerProps<Values extends AnyObject = AnyObject, ExtraValues = Record<string, unknown>> extends Omit<UseDrawerProps, 'onConfirm' | 'content' | 'onShow' | 'afterClose'> {
506
+ formProps?: Omit<FormProps, 'form'>;
507
+ form?: FormInstance<Values>;
508
+ content?: ReactNode | ((extraValues: ExtraValues, operation: UseDrawerOperation) => ReactNode);
509
+ onConfirm?: (values: Values, extraValues: ExtraValues) => void | Promise<void>;
510
+ onSuccess?: () => void;
511
+ afterClose?: (form: FormInstance<Values>) => void;
512
+ }
513
+ interface UseFormDrawerReturn<Values extends AnyObject, ExtraValues> {
514
+ id: number;
515
+ show: (options?: ShowFormOptions$1<Values, ExtraValues>) => void;
516
+ hide: () => void;
517
+ drawer: ReactNode;
518
+ }
519
+ declare function useFormDrawer<Values extends AnyObject = AnyObject, ExtraValues = Record<string, unknown>>(props: UseFormDrawerProps<Values, ExtraValues>): UseFormDrawerReturn<Values, ExtraValues>;
520
+
521
+ interface VisibilityState {
522
+ open: Map<number, boolean>;
523
+ usedIds: Set<number>;
524
+ isOpen: (uuid: number) => boolean;
525
+ show: (uuid: number) => void;
526
+ hide: (uuid: number) => void;
527
+ hideAll: () => void;
528
+ checkUniqueness: (uuid: number) => boolean;
529
+ registerIds: (uuid: number) => boolean;
530
+ cleanup: (uuid: number) => void;
531
+ }
532
+ /**
533
+ * 创建一个可见性管理的 Zustand store
534
+ * 用于管理 Modal、Drawer 等组件的显示/隐藏状态
535
+ * 每次调用都会创建一个独立的 store 实例,确保不同组件间的状态隔离
536
+ */
537
+ declare function createVisibilityStore(): zustand.UseBoundStore<zustand.StoreApi<VisibilityState>>;
538
+
539
+ declare const generateId: () => number;
540
+
541
+ declare const mixedStorage: StateStorage;
542
+
543
+ declare const useDrawerStore: zustand.UseBoundStore<zustand.StoreApi<VisibilityState>>;
544
+
545
+ interface UseModalOperation {
546
+ hide: () => void;
547
+ }
548
+ interface UseModalProps extends Omit<ModalProps, 'open' | 'confirmLoading' | 'onOk' | 'onCancel'> {
549
+ content?: ReactNode | ((operation: UseModalOperation) => ReactNode);
550
+ onConfirm?: () => void | Promise<void>;
551
+ afterOpen?: () => void | Promise<void>;
552
+ afterClose?: () => void | Promise<void>;
553
+ }
554
+ declare function useModal(props: UseModalProps): {
555
+ id: number;
556
+ show: () => Promise<void>;
557
+ hide: () => void;
558
+ modal: react_jsx_runtime.JSX.Element;
559
+ };
560
+
561
+ interface ShowFormOptions<Values extends AnyObject, ExtraValues> {
562
+ initialValues?: RecursivePartial<Values>;
563
+ extraValues?: ExtraValues;
564
+ }
565
+ interface UseFormModalProps<Values extends AnyObject = AnyObject, ExtraValues = Record<string, unknown>> extends Omit<UseModalProps, 'onConfirm' | 'content' | 'onShow' | 'afterClose'> {
566
+ formProps?: Omit<FormProps, 'form'>;
567
+ form?: FormInstance<Values>;
568
+ content?: ReactNode | ((extraValues: ExtraValues, operation: UseModalOperation) => ReactNode);
569
+ onConfirm?: (values: Values, extraValues: ExtraValues) => void | Promise<void>;
570
+ onSuccess?: () => void;
571
+ afterClose?: (form: FormInstance<Values>) => void;
572
+ }
573
+ interface UseFormModalReturn<Values extends AnyObject, ExtraValues> {
574
+ id: number;
575
+ show: (options?: ShowFormOptions<Values, ExtraValues>) => void;
576
+ hide: () => void;
577
+ modal: ReactNode;
578
+ }
579
+ declare function useFormModal<Values extends AnyObject = AnyObject, ExtraValues = Record<string, unknown>>(props: UseFormModalProps<Values, ExtraValues>): UseFormModalReturn<Values, ExtraValues>;
580
+
581
+ declare const useModalStore: zustand.UseBoundStore<zustand.StoreApi<VisibilityState>>;
582
+
583
+ declare const _default$2: react_jsx_runtime.JSX.Element;
584
+
585
+ declare const _default$1: react_jsx_runtime.JSX.Element;
586
+
587
+ interface NotFoundProps {
588
+ redirectUrl?: string;
589
+ }
590
+ declare const NotFound: FC<NotFoundProps>;
591
+
592
+ declare const _default: {
593
+ (props: any): react_jsx_runtime.JSX.Element;
594
+ displayName: string;
595
+ };
596
+
597
+ interface SignInProps {
598
+ extra?: ReactNode;
599
+ title?: string;
600
+ }
601
+ declare const SignIn: FC<SignInProps>;
602
+
603
+ declare function usePermission(code?: string | string[], config?: Options): {
604
+ data: boolean | Record<string, boolean>;
605
+ error: Error;
606
+ isError: true;
607
+ isPending: false;
608
+ isLoading: false;
609
+ isLoadingError: false;
610
+ isRefetchError: true;
611
+ isSuccess: false;
612
+ isPlaceholderData: false;
613
+ status: "error";
614
+ dataUpdatedAt: number;
615
+ errorUpdatedAt: number;
616
+ failureCount: number;
617
+ failureReason: Error | null;
618
+ errorUpdateCount: number;
619
+ isFetched: boolean;
620
+ isFetchedAfterMount: boolean;
621
+ isFetching: boolean;
622
+ isInitialLoading: boolean;
623
+ isPaused: boolean;
624
+ isRefetching: boolean;
625
+ isStale: boolean;
626
+ isEnabled: boolean;
627
+ refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<Record<string, boolean> & {
628
+ has_all?: boolean;
629
+ }, Error>>;
630
+ fetchStatus: _tanstack_react_query.FetchStatus;
631
+ promise: Promise<Record<string, boolean> & {
632
+ has_all?: boolean;
633
+ }>;
634
+ } | {
635
+ data: boolean | Record<string, boolean>;
636
+ error: null;
637
+ isError: false;
638
+ isPending: false;
639
+ isLoading: false;
640
+ isLoadingError: false;
641
+ isRefetchError: false;
642
+ isSuccess: true;
643
+ isPlaceholderData: false;
644
+ status: "success";
645
+ dataUpdatedAt: number;
646
+ errorUpdatedAt: number;
647
+ failureCount: number;
648
+ failureReason: Error | null;
649
+ errorUpdateCount: number;
650
+ isFetched: boolean;
651
+ isFetchedAfterMount: boolean;
652
+ isFetching: boolean;
653
+ isInitialLoading: boolean;
654
+ isPaused: boolean;
655
+ isRefetching: boolean;
656
+ isStale: boolean;
657
+ isEnabled: boolean;
658
+ refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<Record<string, boolean> & {
659
+ has_all?: boolean;
660
+ }, Error>>;
661
+ fetchStatus: _tanstack_react_query.FetchStatus;
662
+ promise: Promise<Record<string, boolean> & {
663
+ has_all?: boolean;
664
+ }>;
665
+ } | {
666
+ data: boolean | Record<string, boolean>;
667
+ error: Error;
668
+ isError: true;
669
+ isPending: false;
670
+ isLoading: false;
671
+ isLoadingError: true;
672
+ isRefetchError: false;
673
+ isSuccess: false;
674
+ isPlaceholderData: false;
675
+ status: "error";
676
+ dataUpdatedAt: number;
677
+ errorUpdatedAt: number;
678
+ failureCount: number;
679
+ failureReason: Error | null;
680
+ errorUpdateCount: number;
681
+ isFetched: boolean;
682
+ isFetchedAfterMount: boolean;
683
+ isFetching: boolean;
684
+ isInitialLoading: boolean;
685
+ isPaused: boolean;
686
+ isRefetching: boolean;
687
+ isStale: boolean;
688
+ isEnabled: boolean;
689
+ refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<Record<string, boolean> & {
690
+ has_all?: boolean;
691
+ }, Error>>;
692
+ fetchStatus: _tanstack_react_query.FetchStatus;
693
+ promise: Promise<Record<string, boolean> & {
694
+ has_all?: boolean;
695
+ }>;
696
+ } | {
697
+ data: boolean | Record<string, boolean>;
698
+ error: null;
699
+ isError: false;
700
+ isPending: true;
701
+ isLoading: true;
702
+ isLoadingError: false;
703
+ isRefetchError: false;
704
+ isSuccess: false;
705
+ isPlaceholderData: false;
706
+ status: "pending";
707
+ dataUpdatedAt: number;
708
+ errorUpdatedAt: number;
709
+ failureCount: number;
710
+ failureReason: Error | null;
711
+ errorUpdateCount: number;
712
+ isFetched: boolean;
713
+ isFetchedAfterMount: boolean;
714
+ isFetching: boolean;
715
+ isInitialLoading: boolean;
716
+ isPaused: boolean;
717
+ isRefetching: boolean;
718
+ isStale: boolean;
719
+ isEnabled: boolean;
720
+ refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<Record<string, boolean> & {
721
+ has_all?: boolean;
722
+ }, Error>>;
723
+ fetchStatus: _tanstack_react_query.FetchStatus;
724
+ promise: Promise<Record<string, boolean> & {
725
+ has_all?: boolean;
726
+ }>;
727
+ } | {
728
+ data: boolean | Record<string, boolean>;
729
+ error: null;
730
+ isError: false;
731
+ isPending: true;
732
+ isLoadingError: false;
733
+ isRefetchError: false;
734
+ isSuccess: false;
735
+ isPlaceholderData: false;
736
+ status: "pending";
737
+ dataUpdatedAt: number;
738
+ errorUpdatedAt: number;
739
+ failureCount: number;
740
+ failureReason: Error | null;
741
+ errorUpdateCount: number;
742
+ isFetched: boolean;
743
+ isFetchedAfterMount: boolean;
744
+ isFetching: boolean;
745
+ isLoading: boolean;
746
+ isInitialLoading: boolean;
747
+ isPaused: boolean;
748
+ isRefetching: boolean;
749
+ isStale: boolean;
750
+ isEnabled: boolean;
751
+ refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<Record<string, boolean> & {
752
+ has_all?: boolean;
753
+ }, Error>>;
754
+ fetchStatus: _tanstack_react_query.FetchStatus;
755
+ promise: Promise<Record<string, boolean> & {
756
+ has_all?: boolean;
757
+ }>;
758
+ } | {
759
+ data: boolean | Record<string, boolean>;
760
+ isError: false;
761
+ error: null;
762
+ isPending: false;
763
+ isLoading: false;
764
+ isLoadingError: false;
765
+ isRefetchError: false;
766
+ isSuccess: true;
767
+ isPlaceholderData: true;
768
+ status: "success";
769
+ dataUpdatedAt: number;
770
+ errorUpdatedAt: number;
771
+ failureCount: number;
772
+ failureReason: Error | null;
773
+ errorUpdateCount: number;
774
+ isFetched: boolean;
775
+ isFetchedAfterMount: boolean;
776
+ isFetching: boolean;
777
+ isInitialLoading: boolean;
778
+ isPaused: boolean;
779
+ isRefetching: boolean;
780
+ isStale: boolean;
781
+ isEnabled: boolean;
782
+ refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<Record<string, boolean> & {
783
+ has_all?: boolean;
784
+ }, Error>>;
785
+ fetchStatus: _tanstack_react_query.FetchStatus;
786
+ promise: Promise<Record<string, boolean> & {
787
+ has_all?: boolean;
788
+ }>;
789
+ };
790
+ declare function useMenuList(): _tanstack_react_query.UseQueryResult<MenuListItem[], Error>;
791
+ declare const useGames: () => _tanstack_react_query.UseQueryResult<Game[], Error>;
792
+
793
+ export { APP_ID_HEADER, DynamicTags, type DynamicTagsProps, ExpandableParagraph, type ExpandableParagraphProps, FRONTEND_ROUTE_PREFIX, FilterFormWrapper, type FilterFormWrapperProps, type Game, Highlight, type HighlightProps, InfiniteList, InfiniteListAction, type InfiniteListPayload, type InfiniteListProps, type InfiniteListRef, type InfiniteListRequestConfig, Layout, type LayoutProps, Logo, type LogoProps, type MenuListItem, NavMenu, type NavMenuItem, NotFound, _default as OperationLogList, type Permission, PermissionButton, type PermissionButtonProps, PermissionVersion, QueryList, QueryListAction, type QueryListPayload, type QueryListProps, type QueryListRef, type RecursivePartial, RequireGame, RequirePermission, type RequirePermissionProps, SSO_URL, SignIn, ToolkitsProvider, type ToolkitsProviderProps, type UseFormDrawerProps, type UseFormModalProps, UserWidget, type VisibilityState, WILDCARD, createVisibilityStore, generateId, _default$2 as menu, mixedStorage, _default$1 as permission, useDrawer, useDrawerStore, useFormDrawer, useFormModal, useGames, useInfiniteListStore, useMenuList, useModal, useModalStore, usePermission, useQueryListStore, useToolkitsStore, withContext };