react-toolkits 0.8.67 → 0.8.69
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 +12 -0
- package/lib/{index.d.ts → index.d.mts} +405 -461
- package/lib/index.js +24 -43
- package/lib/logo-L6MFCL6M.png +0 -0
- package/locales/en_GB.d.mts +5 -0
- package/locales/en_GB.js +3 -91
- package/locales/{zh_CN.d.ts → index-Yb6kmiRt.d.mts} +90 -93
- package/locales/ja_JP.d.mts +5 -0
- package/locales/ja_JP.js +3 -91
- package/locales/ko_KR.d.mts +5 -0
- package/locales/ko_KR.js +3 -91
- package/locales/zh_CN.d.mts +5 -0
- package/locales/zh_CN.js +3 -91
- package/package.json +5 -13
- package/lib/immer-BLf7GM7E.chunk.js +0 -460
- package/lib/immer-BLf7GM7E.chunk.js.map +0 -1
- package/lib/index--jWvmyyO.chunk.js +0 -5379
- package/lib/index--jWvmyyO.chunk.js.map +0 -1
- package/lib/index-CiNYhEey.chunk.js +0 -40
- package/lib/index-CiNYhEey.chunk.js.map +0 -1
- package/lib/index-K5w_JTua.chunk.js +0 -180
- package/lib/index-K5w_JTua.chunk.js.map +0 -1
- package/lib/index-bewDG1xb.chunk.js +0 -219
- package/lib/index-bewDG1xb.chunk.js.map +0 -1
- package/lib/index-brCtC_4Y.chunk.js +0 -171
- package/lib/index-brCtC_4Y.chunk.js.map +0 -1
- package/lib/index-gD2dnDu7.chunk.js +0 -193
- package/lib/index-gD2dnDu7.chunk.js.map +0 -1
- package/lib/index.js.map +0 -1
- package/locales/en_GB.d.ts +0 -93
- package/locales/ja_JP.d.ts +0 -93
- package/locales/ko_KR.d.ts +0 -93
- /package/lib/{style.css → index.css} +0 -0
|
@@ -1,461 +1,405 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
}
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
}
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
};
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
declare
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
}
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
declare
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
content?: ReactNode | ((operation: UseModalOperation) => ReactNode);
|
|
407
|
-
onConfirm?: () => void | Promise<void>;
|
|
408
|
-
}
|
|
409
|
-
|
|
410
|
-
export declare const useModalStore: UseBoundStore<StoreApi<ModalState>>;
|
|
411
|
-
|
|
412
|
-
export declare function usePermission(code: string | undefined, isGlobal?: boolean, config?: SWRConfiguration): {
|
|
413
|
-
accessible: boolean;
|
|
414
|
-
isValidating: boolean;
|
|
415
|
-
isLoading: boolean;
|
|
416
|
-
};
|
|
417
|
-
|
|
418
|
-
export declare function usePermissions(codes: string[], isGlobal?: boolean, config?: SWRConfiguration): {
|
|
419
|
-
data: Record<string, boolean> | undefined;
|
|
420
|
-
isValidating: boolean;
|
|
421
|
-
isLoading: boolean;
|
|
422
|
-
};
|
|
423
|
-
|
|
424
|
-
export declare const useQueryListStore: UseBoundStore<StoreApi<QueryListState>>;
|
|
425
|
-
|
|
426
|
-
export declare function useRequest(): <T = any>(url: string, opts?: RequestOptions) => Promise<RequestResponse<T>>;
|
|
427
|
-
|
|
428
|
-
declare interface UserInfo {
|
|
429
|
-
authorityId: string;
|
|
430
|
-
exp: number;
|
|
431
|
-
}
|
|
432
|
-
|
|
433
|
-
export declare const UserWidget: FC;
|
|
434
|
-
|
|
435
|
-
export declare const useTokenStore: UseBoundStore<Omit<StoreApi<TokenState>, "persist"> & {
|
|
436
|
-
persist: {
|
|
437
|
-
setOptions: (options: Partial<PersistOptions<TokenState, {
|
|
438
|
-
token: string;
|
|
439
|
-
}>>) => void;
|
|
440
|
-
clearStorage: () => void;
|
|
441
|
-
rehydrate: () => void | Promise<void>;
|
|
442
|
-
hasHydrated: () => boolean;
|
|
443
|
-
onHydrate: (fn: (state: TokenState) => void) => () => void;
|
|
444
|
-
onFinishHydration: (fn: (state: TokenState) => void) => () => void;
|
|
445
|
-
getOptions: () => Partial<PersistOptions<TokenState, {
|
|
446
|
-
token: string;
|
|
447
|
-
}>>;
|
|
448
|
-
};
|
|
449
|
-
}>;
|
|
450
|
-
|
|
451
|
-
export declare function useTokenValidation(skip?: boolean): void;
|
|
452
|
-
|
|
453
|
-
export declare function useToolkitsContext(): ContextState;
|
|
454
|
-
|
|
455
|
-
export declare function useTranslation(): (key: Paths<Locale>, data?: Record<string, unknown>) => string;
|
|
456
|
-
|
|
457
|
-
export declare function withBaseRoutes(routes: ReactNode, props?: Partial<Omit<ContextState, 'hideGameSelect'>>): () => JSX_2.Element;
|
|
458
|
-
|
|
459
|
-
export declare const withLayout: (WrappedComponent: ComponentType, props?: Partial<ContextState>) => () => JSX_2.Element;
|
|
460
|
-
|
|
461
|
-
export { }
|
|
1
|
+
import * as zustand from 'zustand';
|
|
2
|
+
import * as react from 'react';
|
|
3
|
+
import { ReactNode, Key, FC, PropsWithChildren, Ref, ReactElement, ComponentType } from 'react';
|
|
4
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
5
|
+
import * as zustand_middleware from 'zustand/middleware';
|
|
6
|
+
import { StateStorage } from 'zustand/middleware';
|
|
7
|
+
import { MenuDividerType, MenuItemType, SubMenuType, MenuItemGroupType } from 'antd/es/menu/hooks/useItems';
|
|
8
|
+
import { Merge } from 'ts-essentials';
|
|
9
|
+
import { FormInstance, ButtonProps, ModalProps, FormProps } from 'antd';
|
|
10
|
+
import { TableProps } from 'antd/es/table';
|
|
11
|
+
import { MutatorCallback, MutatorOptions } from 'swr/_internal';
|
|
12
|
+
import { SWRConfiguration } from 'swr';
|
|
13
|
+
|
|
14
|
+
declare class RequestError extends Error {
|
|
15
|
+
status: number;
|
|
16
|
+
code?: number;
|
|
17
|
+
constructor(opts: {
|
|
18
|
+
message?: string;
|
|
19
|
+
status: number;
|
|
20
|
+
code?: number;
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
interface RequestOptions extends Omit<RequestInit, 'body'> {
|
|
24
|
+
body?: Record<string | number, any> | FormData | null;
|
|
25
|
+
params?: Record<string | number, any> | URLSearchParams | null;
|
|
26
|
+
responseType?: 'json' | 'blob' | 'text';
|
|
27
|
+
isGlobal?: boolean;
|
|
28
|
+
}
|
|
29
|
+
type RequestResponse<T> = Pick<Response, 'headers' | 'status' | 'statusText' | 'url'> & {
|
|
30
|
+
data: T;
|
|
31
|
+
};
|
|
32
|
+
declare function useRequest(): <T = any>(url: string, opts?: RequestOptions) => Promise<RequestResponse<T>>;
|
|
33
|
+
|
|
34
|
+
interface ListResponse<T = any> {
|
|
35
|
+
list: T[];
|
|
36
|
+
total: number;
|
|
37
|
+
}
|
|
38
|
+
type Locale = {
|
|
39
|
+
global: {
|
|
40
|
+
noEntitlement: string;
|
|
41
|
+
name: string;
|
|
42
|
+
creationTime: string;
|
|
43
|
+
operation: string;
|
|
44
|
+
update: string;
|
|
45
|
+
edit: string;
|
|
46
|
+
delete: string;
|
|
47
|
+
selectAll: string;
|
|
48
|
+
game: string;
|
|
49
|
+
user: string;
|
|
50
|
+
role: string;
|
|
51
|
+
username: string;
|
|
52
|
+
password: string;
|
|
53
|
+
label: string;
|
|
54
|
+
method: string;
|
|
55
|
+
route: string;
|
|
56
|
+
request: string;
|
|
57
|
+
response: string;
|
|
58
|
+
add: string;
|
|
59
|
+
signIn: string;
|
|
60
|
+
};
|
|
61
|
+
SignIn: {
|
|
62
|
+
title: string;
|
|
63
|
+
thirdParty: string;
|
|
64
|
+
signInWithIDass: string;
|
|
65
|
+
notRegistered: string;
|
|
66
|
+
welcome: string;
|
|
67
|
+
};
|
|
68
|
+
NotFound: {
|
|
69
|
+
subTitle: string;
|
|
70
|
+
buttonText: string;
|
|
71
|
+
};
|
|
72
|
+
FilterFormWrapper: {
|
|
73
|
+
confirmText: string;
|
|
74
|
+
resetText: string;
|
|
75
|
+
};
|
|
76
|
+
FormModal: {
|
|
77
|
+
confirmText: string;
|
|
78
|
+
cancelText: string;
|
|
79
|
+
};
|
|
80
|
+
GameSelect: {
|
|
81
|
+
label: string;
|
|
82
|
+
placeholder: string;
|
|
83
|
+
};
|
|
84
|
+
RequireGame: {
|
|
85
|
+
description: string;
|
|
86
|
+
};
|
|
87
|
+
UserWidget: {
|
|
88
|
+
signOutText: string;
|
|
89
|
+
};
|
|
90
|
+
UserList: {
|
|
91
|
+
createTitle: string;
|
|
92
|
+
createSuccessfully: string;
|
|
93
|
+
updateTitle: string;
|
|
94
|
+
updateSuccessfully: string;
|
|
95
|
+
deleteTitle: string;
|
|
96
|
+
deleteContent: string;
|
|
97
|
+
deleteSuccessfully: string;
|
|
98
|
+
};
|
|
99
|
+
RoleList: {
|
|
100
|
+
createTitle: string;
|
|
101
|
+
createSuccessfully: string;
|
|
102
|
+
updateTitle: string;
|
|
103
|
+
updateSuccessfully: string;
|
|
104
|
+
deleteTitle: string;
|
|
105
|
+
deleteContent: string;
|
|
106
|
+
deleteSuccessfully: string;
|
|
107
|
+
};
|
|
108
|
+
PermissionList: {
|
|
109
|
+
failedDescription: string;
|
|
110
|
+
baseSectionTitle: string;
|
|
111
|
+
gameSectionTitle: string;
|
|
112
|
+
gameSectionDescription: string;
|
|
113
|
+
gameSelectPlaceholder: string;
|
|
114
|
+
removeText: string;
|
|
115
|
+
addText: string;
|
|
116
|
+
};
|
|
117
|
+
RoleDetail: {
|
|
118
|
+
title: string;
|
|
119
|
+
};
|
|
120
|
+
InfiniteList: {
|
|
121
|
+
loadingText: string;
|
|
122
|
+
reachEndText: string;
|
|
123
|
+
loadMoreText: string;
|
|
124
|
+
};
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
interface Game {
|
|
128
|
+
id: string;
|
|
129
|
+
name: string;
|
|
130
|
+
area: 'cn' | 'global';
|
|
131
|
+
Ctime: string;
|
|
132
|
+
}
|
|
133
|
+
interface GameState {
|
|
134
|
+
game: Game | null;
|
|
135
|
+
games: Game[];
|
|
136
|
+
isLoading: boolean;
|
|
137
|
+
setGame: (id: string) => void;
|
|
138
|
+
fetchGames: () => void;
|
|
139
|
+
}
|
|
140
|
+
declare const useGameStore: zustand.UseBoundStore<Omit<zustand.StoreApi<GameState>, "persist"> & {
|
|
141
|
+
persist: {
|
|
142
|
+
setOptions: (options: Partial<zustand_middleware.PersistOptions<GameState, unknown>>) => void;
|
|
143
|
+
clearStorage: () => void;
|
|
144
|
+
rehydrate: () => void | Promise<void>;
|
|
145
|
+
hasHydrated: () => boolean;
|
|
146
|
+
onHydrate: (fn: (state: GameState) => void) => () => void;
|
|
147
|
+
onFinishHydration: (fn: (state: GameState) => void) => () => void;
|
|
148
|
+
getOptions: () => Partial<zustand_middleware.PersistOptions<GameState, unknown>>;
|
|
149
|
+
};
|
|
150
|
+
}>;
|
|
151
|
+
declare const GameSelect: () => react_jsx_runtime.JSX.Element;
|
|
152
|
+
|
|
153
|
+
type MenuItemType2 = Merge<MenuItemType, {
|
|
154
|
+
code?: string;
|
|
155
|
+
route?: string;
|
|
156
|
+
}>;
|
|
157
|
+
type SubMenuType2 = Merge<SubMenuType, {
|
|
158
|
+
children?: NavMenuItem[];
|
|
159
|
+
}>;
|
|
160
|
+
type MenuItemGroupType2 = Merge<MenuItemGroupType, {
|
|
161
|
+
children?: NavMenuItem[];
|
|
162
|
+
}>;
|
|
163
|
+
type NavMenuItem = MenuItemType2 | SubMenuType2 | MenuItemGroupType2 | MenuDividerType | null;
|
|
164
|
+
declare const NavMenu: react.NamedExoticComponent<object>;
|
|
165
|
+
|
|
166
|
+
interface ContextState {
|
|
167
|
+
appTitle: ReactNode;
|
|
168
|
+
signInPageTitle?: ReactNode;
|
|
169
|
+
menuItems: NavMenuItem[];
|
|
170
|
+
hideGameSelect: boolean;
|
|
171
|
+
usePermissionApiV2: boolean;
|
|
172
|
+
gameFilter?: (game: Game) => boolean;
|
|
173
|
+
locale?: Locale;
|
|
174
|
+
localeDropdownMenu?: ReactNode;
|
|
175
|
+
signInSuccessRedirectUrl?: string;
|
|
176
|
+
notFoundRedirectUrl?: string;
|
|
177
|
+
logoutRedirectUrl?: string;
|
|
178
|
+
idaasRedirectUrl: string;
|
|
179
|
+
layoutHeaderExtras?: {
|
|
180
|
+
key: Key;
|
|
181
|
+
children: ReactNode;
|
|
182
|
+
}[];
|
|
183
|
+
isGlobal?: boolean;
|
|
184
|
+
responseInterceptor?: (response: Response, opts: RequestOptions) => Promise<any>;
|
|
185
|
+
}
|
|
186
|
+
declare const contextStore: zustand.StoreApi<ContextState>;
|
|
187
|
+
declare function useToolkitsContext(): ContextState;
|
|
188
|
+
declare const ContextProvider: FC<PropsWithChildren<Partial<ContextState>>>;
|
|
189
|
+
|
|
190
|
+
interface DynamicTagsProps {
|
|
191
|
+
initialTags?: string[];
|
|
192
|
+
addable?: boolean;
|
|
193
|
+
removable?: boolean;
|
|
194
|
+
addCallback?: (addedTag: string) => Promise<boolean>;
|
|
195
|
+
removeCallback?: (removedTag: string) => Promise<boolean>;
|
|
196
|
+
}
|
|
197
|
+
declare const DynamicTags: FC<DynamicTagsProps>;
|
|
198
|
+
|
|
199
|
+
interface FilterFormWrapperProps extends PropsWithChildren {
|
|
200
|
+
onConfirm?: () => void | Promise<void>;
|
|
201
|
+
onReset?: () => void;
|
|
202
|
+
extras?: {
|
|
203
|
+
key: Key;
|
|
204
|
+
children: ReactNode;
|
|
205
|
+
}[];
|
|
206
|
+
isConfirming?: boolean;
|
|
207
|
+
}
|
|
208
|
+
declare const FilterFormWrapper: (props: FilterFormWrapperProps) => react_jsx_runtime.JSX.Element;
|
|
209
|
+
|
|
210
|
+
interface HighlightTextsProps extends PropsWithChildren {
|
|
211
|
+
texts: Array<string | number>;
|
|
212
|
+
}
|
|
213
|
+
declare const Highlight: (props: HighlightTextsProps) => react_jsx_runtime.JSX.Element;
|
|
214
|
+
|
|
215
|
+
interface InfiniteListExtra<Values> {
|
|
216
|
+
key: Key;
|
|
217
|
+
children: ReactNode | ((form: FormInstance<Values>) => ReactNode);
|
|
218
|
+
}
|
|
219
|
+
interface InfiniteListProps<Item, Values, Response> extends Pick<TableProps<Item>, 'columns' | 'rowKey' | 'tableLayout' | 'expandable' | 'rowSelection' | 'bordered'> {
|
|
220
|
+
action: string;
|
|
221
|
+
getRowKey: (response: Response) => any;
|
|
222
|
+
getDataSource: (data: Response[] | undefined) => Item[];
|
|
223
|
+
code?: string;
|
|
224
|
+
headers?: Record<string, string> | ((form: FormInstance<Values>) => Record<string, string>);
|
|
225
|
+
renderForm?: (form: FormInstance<Values>) => ReactNode;
|
|
226
|
+
transformArg: (values: Values, rowKey?: string) => Record<any, any>;
|
|
227
|
+
hasMore?: (data: Response[] | undefined) => boolean;
|
|
228
|
+
isGlobal?: boolean;
|
|
229
|
+
extras?: InfiniteListExtra<Values>[];
|
|
230
|
+
}
|
|
231
|
+
declare const InfiniteList: <Item extends object, Values extends object | undefined = undefined, Response_1 = any>(props: InfiniteListProps<Item, Values, Response_1>) => react_jsx_runtime.JSX.Element;
|
|
232
|
+
|
|
233
|
+
declare const Layout: FC<PropsWithChildren>;
|
|
234
|
+
|
|
235
|
+
interface PermissionButtonProps extends Omit<ButtonProps, 'disabled'> {
|
|
236
|
+
code: string | string[];
|
|
237
|
+
showLoading?: boolean;
|
|
238
|
+
isGlobal?: boolean;
|
|
239
|
+
}
|
|
240
|
+
declare const PermissionButton: FC<PropsWithChildren<PermissionButtonProps>>;
|
|
241
|
+
|
|
242
|
+
interface PermissionGuardProps {
|
|
243
|
+
code: string;
|
|
244
|
+
}
|
|
245
|
+
declare const PermissionGuard: FC<PropsWithChildren<PermissionGuardProps>>;
|
|
246
|
+
|
|
247
|
+
type QueryListMutator = <Item = any>(action: string, data?: QueryListDataType<Item> | Promise<QueryListDataType<Item>> | MutatorCallback<QueryListDataType<Item>>, opts?: MutatorOptions<QueryListDataType<Item>>) => void;
|
|
248
|
+
interface QueryListPayload<FormValues = any> {
|
|
249
|
+
page?: number;
|
|
250
|
+
size?: number;
|
|
251
|
+
formValues?: FormValues;
|
|
252
|
+
}
|
|
253
|
+
interface QueryListState {
|
|
254
|
+
swrKeyMap: Map<string, string | null>;
|
|
255
|
+
payloadMap: Map<string, QueryListPayload>;
|
|
256
|
+
propsMap: Map<string, QueryListProps>;
|
|
257
|
+
getSwrkKey(action: string): string | null;
|
|
258
|
+
updateSwrKey(action: string, key?: string | null): void;
|
|
259
|
+
getPayload: (action: string) => QueryListPayload | undefined;
|
|
260
|
+
setPayload(action: string, payload: Partial<QueryListPayload>): void;
|
|
261
|
+
mutate: QueryListMutator;
|
|
262
|
+
refresh(action: string, page?: number): void;
|
|
263
|
+
}
|
|
264
|
+
declare const useQueryListStore: zustand.UseBoundStore<zustand.StoreApi<QueryListState>>;
|
|
265
|
+
|
|
266
|
+
declare enum QueryListAction {
|
|
267
|
+
Confirm = "confirm",
|
|
268
|
+
Reset = "reset",
|
|
269
|
+
Jump = "jump",
|
|
270
|
+
Init = "init"
|
|
271
|
+
}
|
|
272
|
+
interface QueryListDataType<Item> {
|
|
273
|
+
dataSource: Item[];
|
|
274
|
+
total: number;
|
|
275
|
+
}
|
|
276
|
+
interface QueryListRef<Item = any, Values = any, Response = any> {
|
|
277
|
+
data: QueryListDataType<Item>;
|
|
278
|
+
form: FormInstance<Values>;
|
|
279
|
+
originalData: Response | undefined;
|
|
280
|
+
}
|
|
281
|
+
interface QueryListProps<Item = any, Values = any, Response = any> extends Pick<TableProps<Item>, 'columns' | 'rowKey' | 'tableLayout' | 'expandable' | 'rowSelection' | 'bordered' | 'components'> {
|
|
282
|
+
code?: string;
|
|
283
|
+
isGlobal?: boolean;
|
|
284
|
+
action: string;
|
|
285
|
+
method?: string;
|
|
286
|
+
refreshInterval?: number;
|
|
287
|
+
onePage?: boolean;
|
|
288
|
+
defaultSize?: number;
|
|
289
|
+
headers?: RequestOptions['headers'] | ((payload: QueryListPayload<Values> | undefined) => RequestOptions['headers']);
|
|
290
|
+
getBody?: (payload: QueryListPayload<Values>) => RequestOptions['body'];
|
|
291
|
+
getParams?: (payload: QueryListPayload<Values>) => RequestOptions['params'];
|
|
292
|
+
renderForm?: (form: FormInstance<Values>) => ReactNode;
|
|
293
|
+
extra?: (form: FormInstance<Values>) => ReactNode;
|
|
294
|
+
onTableChange?: TableProps<Item>['onChange'];
|
|
295
|
+
afterSuccess?: (action: QueryListAction, data: QueryListDataType<Item>) => void;
|
|
296
|
+
getTotal?: (response: Response) => number;
|
|
297
|
+
getDataSource?: (response: Response) => Item[];
|
|
298
|
+
}
|
|
299
|
+
declare const QueryList: <Item extends object, Values extends object | undefined, Response_1 = ListResponse<Item>>(props: QueryListProps<Item, Values, Response_1> & {
|
|
300
|
+
ref?: Ref<QueryListRef<Item, Values, Response_1>> | undefined;
|
|
301
|
+
}) => ReactElement;
|
|
302
|
+
|
|
303
|
+
declare const RequireGame: FC<PropsWithChildren>;
|
|
304
|
+
|
|
305
|
+
declare const UserWidget: FC;
|
|
306
|
+
|
|
307
|
+
interface ModalState {
|
|
308
|
+
open: Map<number, boolean>;
|
|
309
|
+
getOpen: (uuid: number) => boolean;
|
|
310
|
+
show: (uuid: number) => void;
|
|
311
|
+
hide: (uuid: number) => void;
|
|
312
|
+
hideAll: () => void;
|
|
313
|
+
}
|
|
314
|
+
declare const useModalStore: zustand.UseBoundStore<zustand.StoreApi<ModalState>>;
|
|
315
|
+
interface UseModalOperation {
|
|
316
|
+
hide: () => void;
|
|
317
|
+
}
|
|
318
|
+
interface UseModalProps extends Omit<ModalProps, 'open' | 'confirmLoading' | 'onOk' | 'onCancel'> {
|
|
319
|
+
content?: ReactNode | ((operation: UseModalOperation) => ReactNode);
|
|
320
|
+
onConfirm?: () => void | Promise<void>;
|
|
321
|
+
}
|
|
322
|
+
declare function useModal(props: UseModalProps): {
|
|
323
|
+
uuid: number;
|
|
324
|
+
show: () => void;
|
|
325
|
+
hide: () => void;
|
|
326
|
+
modal: react_jsx_runtime.JSX.Element;
|
|
327
|
+
};
|
|
328
|
+
|
|
329
|
+
type RecursivePartial<T> = NonNullable<T> extends object ? {
|
|
330
|
+
[P in keyof T]?: NonNullable<T[P]> extends (infer U)[] ? RecursivePartial<U>[] : NonNullable<T[P]> extends object ? RecursivePartial<T[P]> : T[P];
|
|
331
|
+
} : T;
|
|
332
|
+
interface UseFormModalProps<Values, ExtraValues> extends Omit<UseModalProps, 'afterClose' | 'onConfirm' | 'content'> {
|
|
333
|
+
formProps?: Omit<FormProps, 'form'>;
|
|
334
|
+
form?: FormInstance<Values>;
|
|
335
|
+
content?: ReactNode | ((extraValues: ExtraValues, operation: UseModalOperation) => ReactNode);
|
|
336
|
+
onConfirm?: (values: Values, extraValues: ExtraValues) => void | Promise<void>;
|
|
337
|
+
}
|
|
338
|
+
declare function useFormModal<Values, ExtraValues extends NonNullable<unknown> = NonNullable<unknown>>(props: UseFormModalProps<Values, ExtraValues>): {
|
|
339
|
+
uuid: number;
|
|
340
|
+
show: ({ initialValues, extraValues, }?: {
|
|
341
|
+
initialValues?: RecursivePartial<Values> | undefined;
|
|
342
|
+
extraValues?: ExtraValues | undefined;
|
|
343
|
+
}) => void;
|
|
344
|
+
hide: () => void;
|
|
345
|
+
modal: react_jsx_runtime.JSX.Element;
|
|
346
|
+
};
|
|
347
|
+
|
|
348
|
+
type Join<K, P> = K extends string | number ? P extends string | number ? `${K}${'' extends P ? '' : '.'}${P}` : never : never;
|
|
349
|
+
type Paths<T, D extends number = 10> = [D] extends [never] ? never : T extends object ? {
|
|
350
|
+
[K in keyof T]-?: K extends string | number ? `${K}` | Join<K, Paths<T[K]>> : never;
|
|
351
|
+
}[keyof T] : '';
|
|
352
|
+
declare function useTranslation(): (key: Paths<Locale>, data?: Record<string, unknown>) => string;
|
|
353
|
+
|
|
354
|
+
declare function usePermissions(codes: string[], isGlobal?: boolean, config?: SWRConfiguration): {
|
|
355
|
+
data: Record<string, boolean> | undefined;
|
|
356
|
+
isValidating: boolean;
|
|
357
|
+
isLoading: boolean;
|
|
358
|
+
};
|
|
359
|
+
declare function usePermission(code: string | undefined, isGlobal?: boolean, config?: SWRConfiguration): {
|
|
360
|
+
accessible: boolean;
|
|
361
|
+
isValidating: boolean;
|
|
362
|
+
isLoading: boolean;
|
|
363
|
+
};
|
|
364
|
+
|
|
365
|
+
declare const NotFound: () => react_jsx_runtime.JSX.Element;
|
|
366
|
+
|
|
367
|
+
declare const OperationLogList: FC;
|
|
368
|
+
|
|
369
|
+
declare const SignIn: FC;
|
|
370
|
+
|
|
371
|
+
declare const Permission: () => react_jsx_runtime.JSX.Element;
|
|
372
|
+
|
|
373
|
+
interface UserInfo {
|
|
374
|
+
authorityId: string;
|
|
375
|
+
exp: number;
|
|
376
|
+
}
|
|
377
|
+
interface TokenState {
|
|
378
|
+
token: string;
|
|
379
|
+
getUser: () => UserInfo | null;
|
|
380
|
+
setToken: (token: string) => void;
|
|
381
|
+
clearToken: () => void;
|
|
382
|
+
}
|
|
383
|
+
declare const useTokenStore: zustand.UseBoundStore<Omit<zustand.StoreApi<TokenState>, "persist"> & {
|
|
384
|
+
persist: {
|
|
385
|
+
setOptions: (options: Partial<zustand_middleware.PersistOptions<TokenState, {
|
|
386
|
+
token: string;
|
|
387
|
+
}>>) => void;
|
|
388
|
+
clearStorage: () => void;
|
|
389
|
+
rehydrate: () => void | Promise<void>;
|
|
390
|
+
hasHydrated: () => boolean;
|
|
391
|
+
onHydrate: (fn: (state: TokenState) => void) => () => void;
|
|
392
|
+
onFinishHydration: (fn: (state: TokenState) => void) => () => void;
|
|
393
|
+
getOptions: () => Partial<zustand_middleware.PersistOptions<TokenState, {
|
|
394
|
+
token: string;
|
|
395
|
+
}>>;
|
|
396
|
+
};
|
|
397
|
+
}>;
|
|
398
|
+
declare function useTokenValidation(skip?: boolean): void;
|
|
399
|
+
|
|
400
|
+
declare const withLayout: (WrappedComponent: ComponentType, props?: Partial<ContextState>) => () => react_jsx_runtime.JSX.Element;
|
|
401
|
+
declare function withBaseRoutes(routes: ReactNode, props?: Partial<Omit<ContextState, 'hideGameSelect'>>): () => react_jsx_runtime.JSX.Element;
|
|
402
|
+
|
|
403
|
+
declare const mixedStorage: StateStorage;
|
|
404
|
+
|
|
405
|
+
export { ContextProvider, type ContextState, DynamicTags, type DynamicTagsProps, FilterFormWrapper, type FilterFormWrapperProps, type Game, GameSelect, type GameState, Highlight, type HighlightTextsProps, InfiniteList, type InfiniteListProps, Layout, type Locale, NavMenu, type NavMenuItem, NotFound, OperationLogList, Permission, PermissionButton, type PermissionButtonProps, PermissionGuard, type PermissionGuardProps, QueryList, QueryListAction, type QueryListProps, type QueryListRef, RequestError, type RequestOptions, type RequestResponse, RequireGame, SignIn, type TokenState, type UseFormModalProps, UserWidget, contextStore, mixedStorage, useFormModal, useGameStore, useModal, useModalStore, usePermission, usePermissions, useQueryListStore, useRequest, useTokenStore, useTokenValidation, useToolkitsContext, useTranslation, withBaseRoutes, withLayout };
|