@flatbiz/pro-layout 4.0.1 → 4.0.3
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/cjs/index.css +31 -18
- package/cjs/index.js +1 -1
- package/cjs/index.js.map +1 -1
- package/index.d.ts +39 -12
- package/package.json +5 -5
package/index.d.ts
CHANGED
|
@@ -10,11 +10,11 @@ export interface FallbackProps {
|
|
|
10
10
|
error: Error;
|
|
11
11
|
resetErrorBoundary: (...args: Array<unknown>) => void;
|
|
12
12
|
}
|
|
13
|
-
export
|
|
13
|
+
export type BreadRouteMatchPath = {
|
|
14
14
|
params: Readonly<Record<string, string | undefined>>;
|
|
15
15
|
search: URLSearchParams;
|
|
16
16
|
};
|
|
17
|
-
export
|
|
17
|
+
export type BreadRoutePathFn = (data: BreadRouteMatchPath) => string;
|
|
18
18
|
export interface BreadRoute {
|
|
19
19
|
/**
|
|
20
20
|
* 当前面包屑UI显示名
|
|
@@ -34,11 +34,11 @@ export interface BreadRoute {
|
|
|
34
34
|
*/
|
|
35
35
|
query?: string[];
|
|
36
36
|
}
|
|
37
|
-
export
|
|
37
|
+
export type BreadsData = AppBreads | ((data: BreadRouteMatchPath) => AppBreads);
|
|
38
38
|
export interface AppBreads {
|
|
39
39
|
[index: string]: BreadRoute[];
|
|
40
40
|
}
|
|
41
|
-
export
|
|
41
|
+
export type TMenuItem = {
|
|
42
42
|
id: string | number;
|
|
43
43
|
name: string;
|
|
44
44
|
path: string;
|
|
@@ -54,7 +54,7 @@ export declare type TMenuItem = {
|
|
|
54
54
|
parentId: null | number | string;
|
|
55
55
|
children: TMenuItem[];
|
|
56
56
|
};
|
|
57
|
-
export
|
|
57
|
+
export type TGlobalData = {
|
|
58
58
|
appName: string;
|
|
59
59
|
user: TAdminUser;
|
|
60
60
|
menus: TMenuItem[];
|
|
@@ -64,17 +64,40 @@ export declare type TGlobalData = {
|
|
|
64
64
|
routeBaseName: string;
|
|
65
65
|
elemAclLimits: string[];
|
|
66
66
|
};
|
|
67
|
-
export
|
|
67
|
+
export type TAdminUser = null | {
|
|
68
68
|
id: string;
|
|
69
69
|
userName: string;
|
|
70
70
|
};
|
|
71
71
|
export interface TRouteItemProps {
|
|
72
72
|
path: string;
|
|
73
73
|
element: ReactElement | ComponentType | null;
|
|
74
|
-
redirect?: string
|
|
74
|
+
redirect?: string;
|
|
75
75
|
caseSensitive?: boolean;
|
|
76
76
|
}
|
|
77
|
-
export
|
|
77
|
+
export type BootstrapOptions = {
|
|
78
|
+
/**
|
|
79
|
+
* ```
|
|
80
|
+
* 1. 正常用法
|
|
81
|
+
* [{
|
|
82
|
+
* path: '/module/page',
|
|
83
|
+
* element: <Text />
|
|
84
|
+
* },{
|
|
85
|
+
* path: '*',
|
|
86
|
+
* redirect: '/module/page'
|
|
87
|
+
* }]
|
|
88
|
+
*
|
|
89
|
+
* 2. 懒加载用法
|
|
90
|
+
* [{
|
|
91
|
+
* path: '/module/page',
|
|
92
|
+
* element: lazy(() => import(\/* webpackChunkName: "xxx/xxx/module/chunks/page" *\/ './page')),
|
|
93
|
+
* },{
|
|
94
|
+
* path: '*',
|
|
95
|
+
* redirect: '/module/page'
|
|
96
|
+
* }]
|
|
97
|
+
*
|
|
98
|
+
* 3. 如果配置中 没有path = '*',程序会在路由中添加 <Route path="*" element={<NotFound />} />
|
|
99
|
+
* ```
|
|
100
|
+
*/
|
|
78
101
|
routeList: TRouteItemProps[];
|
|
79
102
|
breads?: BreadsData;
|
|
80
103
|
/**
|
|
@@ -193,6 +216,7 @@ export declare type BootstrapOptions = {
|
|
|
193
216
|
menuSelectedBgColor?: string;
|
|
194
217
|
menuSelectedTextColor?: string;
|
|
195
218
|
menuColor?: string;
|
|
219
|
+
menuSubMenuBgColor?: string;
|
|
196
220
|
menuTextFontSize?: number;
|
|
197
221
|
menuItemHeight?: number;
|
|
198
222
|
/**
|
|
@@ -208,6 +232,10 @@ export declare type BootstrapOptions = {
|
|
|
208
232
|
* 是否隐藏侧边栏中收缩按键
|
|
209
233
|
*/
|
|
210
234
|
hideSidebarShrink?: boolean;
|
|
235
|
+
/**
|
|
236
|
+
* 自定义全局风格
|
|
237
|
+
* 如果项目通过本地引入源代码的方式,此配置不生效
|
|
238
|
+
*/
|
|
211
239
|
configProviderProps?: ConfigProviderProps;
|
|
212
240
|
/**
|
|
213
241
|
* 配置theme后 sidebarThemeConfig 配置失效
|
|
@@ -218,7 +246,7 @@ export declare type BootstrapOptions = {
|
|
|
218
246
|
*/
|
|
219
247
|
topMenuConfigProviderProps?: Omit<ConfigProviderProps, "locale">;
|
|
220
248
|
};
|
|
221
|
-
export
|
|
249
|
+
export type LayoutCtxProps = {
|
|
222
250
|
sidebarWidth: number;
|
|
223
251
|
componentSize: SizeType;
|
|
224
252
|
routeList: TRouteItemProps[];
|
|
@@ -230,7 +258,7 @@ export interface LeaveMenuProps {
|
|
|
230
258
|
}
|
|
231
259
|
export declare const bootstrap: (options: BootstrapOptions) => void;
|
|
232
260
|
export declare const Bread: (props: any) => JSX.Element | null;
|
|
233
|
-
export
|
|
261
|
+
export type HistoryBackProps = {
|
|
234
262
|
breads: BreadsData;
|
|
235
263
|
level?: number;
|
|
236
264
|
};
|
|
@@ -261,14 +289,13 @@ export interface PageProps {
|
|
|
261
289
|
children?: ReactElement | ReactElement[];
|
|
262
290
|
}
|
|
263
291
|
export declare const Page: (props: PageProps) => JSX.Element;
|
|
264
|
-
export
|
|
292
|
+
export type IframeHandler<T = unknown> = (data: T) => void;
|
|
265
293
|
/**
|
|
266
294
|
* 使用Iframe通讯的API
|
|
267
295
|
* @param onReceivedMessageCallback 接收iframe通讯消息的回调函数引用
|
|
268
296
|
* @example
|
|
269
297
|
* ```tsx
|
|
270
298
|
* const iframeApi = useIframe<MessageData>((data) => {
|
|
271
|
-
* console.log('onMainMessageReceived', data.name);
|
|
272
299
|
* updateMessage(data);
|
|
273
300
|
* });
|
|
274
301
|
*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flatbiz/pro-layout",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.3",
|
|
4
4
|
"description": "WEB菜单布局",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"typings": "index.d.ts",
|
|
@@ -38,14 +38,14 @@
|
|
|
38
38
|
"@dimjs/model-react": ">=1.1.8",
|
|
39
39
|
"@dimjs/utils": ">=1.2.23",
|
|
40
40
|
"@wove/react": ">=1.2.22",
|
|
41
|
-
"antd": ">=5.0.
|
|
41
|
+
"antd": ">=5.0.6",
|
|
42
42
|
"react": ">=18.2.0",
|
|
43
43
|
"react-dom": ">=18.2.0",
|
|
44
|
-
"react-router": ">=6.4.
|
|
45
|
-
"react-router-dom": ">=6.4.
|
|
44
|
+
"react-router": ">=6.4.5",
|
|
45
|
+
"react-router-dom": ">=6.4.5"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
|
-
"@ant-design/icons": "^4.
|
|
48
|
+
"@ant-design/icons": "^4.8.0",
|
|
49
49
|
"@dimjs/lang": "^1.2.23",
|
|
50
50
|
"@dimjs/model": "^1.1.8",
|
|
51
51
|
"@dimjs/model-react": "^1.1.8",
|