@flatbiz/pro-layout 4.4.1 → 4.4.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/index.d.ts CHANGED
@@ -26,6 +26,7 @@ export type TMenuItem = {
26
26
  * iconImg&iconImgActive为自定义png图标
27
27
  */
28
28
  iconImg?: string;
29
+ icon?: string;
29
30
  iconImgActive?: string;
30
31
  defaultPage?: string;
31
32
  parentId: null | number | string;
@@ -102,6 +103,7 @@ export interface TRouteItemProps {
102
103
  breadConfig?: string | RouteBreadConfig;
103
104
  }
104
105
  export type BootstrapOptions = {
106
+ dark?: boolean;
105
107
  /**
106
108
  * ```
107
109
  * 1. 正常用法
@@ -220,8 +222,6 @@ export type BootstrapOptions = {
220
222
  /**
221
223
  * 当sidebar菜单有level限制时,限制数目
222
224
  */
223
- leaveMenuLevel?: number;
224
- LeaveMenu?: ((props: LeaveMenuProps) => JSX.Element) | null;
225
225
  /**
226
226
  * 面包屑起始标题
227
227
  */
@@ -267,6 +267,18 @@ export type BootstrapOptions = {
267
267
  * 是否隐藏侧边栏中收缩按键
268
268
  */
269
269
  hideSidebarShrink?: boolean;
270
+ /** 初始化侧边栏为收起状态 */
271
+ initSidebarShrinkClosed?: boolean;
272
+ /**
273
+ * 开启侧边栏鼠标悬浮打开、收起功能,一般与initSidebarShrinkClosed配合使用最佳
274
+ * ```
275
+ * 1. 鼠标悬浮侧边栏菜单打开
276
+ * 2. 鼠标离开侧边栏菜单收起
277
+ * 3. 手动点击打开侧边栏菜单,悬浮功能失效
278
+ * 4. 手动点击收起侧边栏菜单,悬浮功能生效
279
+ * ```
280
+ */
281
+ sidebarMouseHoverOpen?: boolean;
270
282
  /**
271
283
  * 自定义全局风格
272
284
  * 如果项目通过本地引入源代码的方式,此配置不生效
@@ -359,6 +371,8 @@ export type LayoutCtxProps = {
359
371
  normalModePositionMenu: (link: string) => void;
360
372
  iframeTopRouteMenuChange: (item: TMenuItem) => void;
361
373
  hideSidebarMenu?: boolean;
374
+ /** 关闭当前iframe tab并打开指定iframe tab */
375
+ onDeleteCurrentIframeTabItemOpenTargetIframeTab: (id: string | number, menuId?: string | number) => void;
362
376
  } & Omit<BootstrapOptions, "sidebarWidth" | "componentSize" | "locale" | "hideSidebarMenu">;
363
377
  export interface LeaveMenuProps {
364
378
  leaveMenus?: TMenuItem[];
@@ -465,10 +479,54 @@ export declare const PageWrapper: import("react").ForwardRefExoticComponent<Page
465
479
  export declare const usePageWrapper: () => {
466
480
  onReload: () => void;
467
481
  };
482
+ /**
483
+ * iframe tab 注册刷新方法
484
+ * ```
485
+ * 1. 定义refreshKey唯一值
486
+ * 2. 与 useRefreshRegisterIframeTab 结合实现iframe tab之间的刷新动作
487
+ * ```
488
+ */
489
+ export declare const useRegisterRefreshCurrentIframeTab: (refreshKey: string, onRefresh: (params?: TPlainObject) => Promise<void>) => void;
490
+ /**
491
+ * 根据 refreshKey,刷新指定iframe tab(在iframe tab中调用)
492
+ * ```
493
+ * 1. 使用 useRegisterRefreshCurrentIframeTab 定义的refreshKey
494
+ * 2. 可通过 params 给刷新方法传参
495
+ * ```
496
+ * @returns
497
+ */
498
+ export declare const useRefreshRegisterIframeTab: () => (refreshKey: string, params?: TPlainObject) => void;
468
499
  export type IframeHandler<T = unknown> = (data: T) => void;
500
+ /**
501
+ * iframe通信Demo:https://fex.qa.tcshuke.com/docs/admin/main/exchange
502
+ */
503
+ export type IframeApiProps = {
504
+ /** 广播消息到所有的iframes子页面 */
505
+ broadcastMessages: <T>(data: T) => IframeApiProps;
506
+ /** 发送特定消息到父亲级window对象 */
507
+ postMessage: <T>(data: T) => IframeApiProps;
508
+ /** 打开新的iframe tab窗口 */
509
+ openNewTabItem: (data: {
510
+ link: string;
511
+ name: string;
512
+ metaTitle?: string;
513
+ }) => IframeApiProps;
514
+ /** 打开新的浏览器窗口 */
515
+ openBrowserWindow: (url: string) => IframeApiProps;
516
+ /** 刷新当前iframe tab */
517
+ locationHref: (url: string) => IframeApiProps;
518
+ tabItemHistoryChange: (link: string) => IframeApiProps;
519
+ /** 通过菜单Id打开新的iframe tab窗口 */
520
+ openNewTabItemByMenuId: (data: {
521
+ id: string;
522
+ }) => IframeApiProps;
523
+ /** 关闭当前iframe-tab,跳转上一个链路tab */
524
+ closedIframeTabToPrevlink: () => IframeApiProps;
525
+ };
469
526
  /**
470
527
  * 使用Iframe通讯的API
471
528
  * @param onReceivedMessageCallback 接收iframe通讯消息的回调函数引用
529
+ * @demo https://fex.qa.tcshuke.com/docs/admin/main/exchange
472
530
  * @example
473
531
  * ```tsx
474
532
  * const iframeApi = useIframe<MessageData>((data) => {
@@ -484,21 +542,7 @@ export type IframeHandler<T = unknown> = (data: T) => void;
484
542
  * ```
485
543
  * @returns
486
544
  */
487
- export declare const useIframe: <T>(onReceivedMessageCallback?: IframeHandler<T>) => {
488
- broadcastMessages<T_1>(data: T_1): any;
489
- postMessage<T_2>(data: T_2): any;
490
- openNewTabItem(data: {
491
- link: string;
492
- name: string;
493
- metaTitle?: string | undefined;
494
- }): any;
495
- openBrowserWindow(url: string): any;
496
- locationHref(url: string): any;
497
- tabItemHistoryChange(link: string): any;
498
- openNewTabItemByMenuId(data: {
499
- id: string;
500
- }): any;
501
- };
545
+ export declare const useIframe: <T>(onReceivedMessageCallback?: IframeHandler<T>) => IframeApiProps;
502
546
  export declare const LayoutPage: (props: {
503
547
  style?: CSSProperties;
504
548
  children?: ReactElement;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flatbiz/pro-layout",
3
- "version": "4.4.1",
3
+ "version": "4.4.3",
4
4
  "description": "WEB菜单布局",
5
5
  "main": "index.js",
6
6
  "typings": "index.d.ts",
@@ -37,7 +37,7 @@
37
37
  "@wove/react": ">=1.2.22",
38
38
  "@flatbiz/antd": ">=4.2.107",
39
39
  "@flatbiz/utils": ">=4.0.19",
40
- "antd": ">=5.5.1",
40
+ "antd": ">=5.11.0",
41
41
  "react": ">=18.2.0",
42
42
  "react-dom": ">=18.2.0",
43
43
  "react-router": ">=6.8.1",
@@ -50,7 +50,7 @@
50
50
  "@dimjs/model-react": "^1.1.8",
51
51
  "@dimjs/utils": "^1.2.23",
52
52
  "@wove/react": "^1.2.22",
53
- "antd": "5.5.1",
53
+ "antd": "5.11.0",
54
54
  "react": "18.2.0",
55
55
  "react-dom": "18.2.0",
56
56
  "react-router": "^6.8.1",