react-toolkits 2.27.10 → 2.27.12
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.css +1063 -1
- package/lib/index.d.ts +50 -20
- package/lib/index.js +14008 -3
- package/lib/index.js.map +1 -0
- package/locale/context.js +1473 -2
- package/locale/hooks.js +53902 -14
- package/locale/index.js +53902 -14
- package/package.json +1 -1
package/lib/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ButtonProps, FormInstance, SelectProps,
|
|
1
|
+
import { ButtonProps, FormInstance, SelectProps, DrawerProps, Button, FormProps, ModalProps } from 'antd';
|
|
2
2
|
import { Options } from 'ky';
|
|
3
3
|
import { FC, PropsWithChildren, Key, ReactNode, ReactElement, Ref, DetailedHTMLProps, ImgHTMLAttributes, ComponentProps } from 'react';
|
|
4
4
|
import { ParagraphProps } from 'antd/es/typography/Paragraph';
|
|
@@ -272,6 +272,12 @@ declare const useInfiniteListStore: zustand.UseBoundStore<Omit<Omit<zustand.Stor
|
|
|
272
272
|
};
|
|
273
273
|
}>;
|
|
274
274
|
|
|
275
|
+
type Prettify<Type> = Type extends Function ? Type : Extract<{
|
|
276
|
+
[Key in keyof Type]: Type[Key];
|
|
277
|
+
}, Type>;
|
|
278
|
+
|
|
279
|
+
type Merge<Object1, Object2> = Prettify<Omit<Object1, keyof Object2> & Object2>;
|
|
280
|
+
|
|
275
281
|
type Area = 'all' | 'cn' | 'global';
|
|
276
282
|
type ScreenOrientation = 0 | 1;
|
|
277
283
|
interface Game {
|
|
@@ -289,36 +295,45 @@ interface Game {
|
|
|
289
295
|
is_new_game: 0 | 1;
|
|
290
296
|
server_type: string;
|
|
291
297
|
}
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
}
|
|
297
|
-
declare const GameSelect: <T extends Game = Game>(props: GameSelectProps<T>) => react_jsx_runtime.JSX.Element;
|
|
298
|
-
|
|
299
|
-
type Prettify<Type> = Type extends Function ? Type : Extract<{
|
|
300
|
-
[Key in keyof Type]: Type[Key];
|
|
301
|
-
}, Type>;
|
|
302
|
-
|
|
303
|
-
type Merge<Object1, Object2> = Prettify<Omit<Object1, keyof Object2> & Object2>;
|
|
304
|
-
|
|
298
|
+
/**
|
|
299
|
+
* 导航菜单项类型
|
|
300
|
+
* 扩展 antd MenuItemType,添加路由支持
|
|
301
|
+
*/
|
|
305
302
|
type NavMenuItemType = Merge<MenuItemType, {
|
|
303
|
+
/** react-router-dom 路由地址,用于菜单项点击时跳转 */
|
|
306
304
|
route?: string;
|
|
307
305
|
}>;
|
|
306
|
+
/**
|
|
307
|
+
* 导航子菜单类型
|
|
308
|
+
* 使用接口来支持递归类型定义,允许嵌套子菜单
|
|
309
|
+
*/
|
|
308
310
|
interface NavSubMenuType extends Omit<SubMenuType, 'children'> {
|
|
311
|
+
/** 子菜单项数组,支持嵌套结构 */
|
|
309
312
|
children?: NavItem[];
|
|
310
313
|
}
|
|
314
|
+
/**
|
|
315
|
+
* 导航菜单组类型
|
|
316
|
+
* 用于将多个菜单项分组显示,菜单组本身不计入路径
|
|
317
|
+
*/
|
|
311
318
|
interface NavMenuItemGroupType extends Omit<MenuItemGroupType, 'children'> {
|
|
319
|
+
/** 菜单组内的菜单项数组 */
|
|
312
320
|
children?: NavItem[];
|
|
313
321
|
}
|
|
322
|
+
/**
|
|
323
|
+
* 导航项联合类型
|
|
324
|
+
* 包含所有支持的导航项类型:
|
|
325
|
+
* - 特殊项(如分割线)
|
|
326
|
+
* - 普通菜单项(NavMenuItemType)
|
|
327
|
+
* - 子菜单(NavSubMenuType)
|
|
328
|
+
* - 菜单组(NavMenuItemGroupType)
|
|
329
|
+
*/
|
|
314
330
|
type NavItem = Exclude<ItemType, SubMenuType | MenuItemGroupType | MenuItemType> | NavMenuItemType | NavSubMenuType | NavMenuItemGroupType;
|
|
315
331
|
|
|
316
|
-
interface
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
loading?: boolean;
|
|
332
|
+
interface GameSelectProps<T extends Game = Game> {
|
|
333
|
+
filter?: (game: T) => boolean;
|
|
334
|
+
options?: (data?: T[]) => SelectProps['options'];
|
|
320
335
|
}
|
|
321
|
-
declare const
|
|
336
|
+
declare const GameSelect: <T extends Game = Game>(props: GameSelectProps<T>) => react_jsx_runtime.JSX.Element;
|
|
322
337
|
|
|
323
338
|
/** Header 扩展项配置 */
|
|
324
339
|
type HeaderExtra = {
|
|
@@ -626,6 +641,20 @@ interface LayoutSlice {
|
|
|
626
641
|
toggleCollapsed: () => void;
|
|
627
642
|
}
|
|
628
643
|
|
|
644
|
+
/**
|
|
645
|
+
* 导航菜单状态接口
|
|
646
|
+
*/
|
|
647
|
+
interface NavSlice {
|
|
648
|
+
/** 当前展开的菜单项 key 数组 */
|
|
649
|
+
openKeys: string[];
|
|
650
|
+
/** 当前选中的菜单项 key 数组 */
|
|
651
|
+
selectedKeys: string[];
|
|
652
|
+
/** 设置展开的菜单项 */
|
|
653
|
+
setOpenKeys: (keys: string[]) => void;
|
|
654
|
+
/** 设置选中的菜单项 */
|
|
655
|
+
setSelectedKeys: (keys: string[]) => void;
|
|
656
|
+
}
|
|
657
|
+
|
|
629
658
|
/**
|
|
630
659
|
* JWT Token 解码后的用户信息
|
|
631
660
|
*/
|
|
@@ -646,6 +675,7 @@ type ToolkitsState = {
|
|
|
646
675
|
token: TokenSlice;
|
|
647
676
|
game: GameSlice;
|
|
648
677
|
layout: LayoutSlice;
|
|
678
|
+
nav: NavSlice;
|
|
649
679
|
clear: () => void;
|
|
650
680
|
};
|
|
651
681
|
|
|
@@ -1008,4 +1038,4 @@ declare function useAuth(code?: string | string[], config?: Options): {
|
|
|
1008
1038
|
declare function useMenuList(): _tanstack_react_query.UseQueryResult<MenuListItem[], Error>;
|
|
1009
1039
|
declare const useGames: () => _tanstack_react_query.UseQueryResult<Game[], Error>;
|
|
1010
1040
|
|
|
1011
|
-
export { APP_ID_HEADER, AuthButton, type AuthButtonProps, type CacheConfig$1 as CacheConfig, DynamicTags, type DynamicTagsProps, ExpandableParagraph, type ExpandableParagraphProps, FRONTEND_ROUTE_PREFIX, FilterFormWrapper, type FilterFormWrapperProps, type Game, GameSelect, type GameSelectConfig, type GameSelectProps, type HeaderExtra, type HeaderExtraConfig, Highlight, type HighlightProps, type HttpMethod$1 as HttpMethod, InfiniteList, type InfiniteListDataAdapter, type InfiniteListPayload, type InfiniteListProps, type InfiniteListRef, type InfiniteListRequestConfig, type InfiniteListRequestConfigType, type JsonResponse, Layout, type LayoutProps, Logo, type LogoProps, type MenuListItem,
|
|
1041
|
+
export { APP_ID_HEADER, AuthButton, type AuthButtonProps, type CacheConfig$1 as CacheConfig, DynamicTags, type DynamicTagsProps, ExpandableParagraph, type ExpandableParagraphProps, FRONTEND_ROUTE_PREFIX, FilterFormWrapper, type FilterFormWrapperProps, type Game, GameSelect, type GameSelectConfig, type GameSelectProps, type HeaderExtra, type HeaderExtraConfig, Highlight, type HighlightProps, type HttpMethod$1 as HttpMethod, InfiniteList, type InfiniteListDataAdapter, type InfiniteListPayload, type InfiniteListProps, type InfiniteListRef, type InfiniteListRequestConfig, type InfiniteListRequestConfigType, type JsonResponse, Layout, type LayoutProps, Logo, type LogoProps, type MenuListItem, type NavItem, type NavMenuItemGroupType, type NavMenuItemType, type NavSubMenuType, type NavigationConfig, NotFound, OperationLogList, type Permission, PermissionMode, QueryList, QueryListAction, type QueryListPayload, type QueryListProps, type QueryListRef, type RecursivePartial, RequireAuth, type RequireAuthProps, RequireGame, type RouteMatchRule, SSO_URL, SignIn, ToolkitsProvider, type ToolkitsProviderProps, type UseFormDrawerProps, type UseFormModalProps, UserDropdown, type VisibilityState, WILDCARD, createVisibilityStoreConfig, generateId, _default$1 as menu, mixedStorage, _default as permission, useAuth, useDrawer, useDrawerStore, useFormDrawer, useFormModal, useGames, useInfiniteListStore, useMenuList, useModal, useModalStore, useQueryListStore, useToolkitsStore };
|