@flatbiz/pro-layout 4.4.2 → 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
@@ -103,6 +103,7 @@ export interface TRouteItemProps {
103
103
  breadConfig?: string | RouteBreadConfig;
104
104
  }
105
105
  export type BootstrapOptions = {
106
+ dark?: boolean;
106
107
  /**
107
108
  * ```
108
109
  * 1. 正常用法
@@ -221,8 +222,6 @@ export type BootstrapOptions = {
221
222
  /**
222
223
  * 当sidebar菜单有level限制时,限制数目
223
224
  */
224
- leaveMenuLevel?: number;
225
- LeaveMenu?: ((props: LeaveMenuProps) => JSX.Element) | null;
226
225
  /**
227
226
  * 面包屑起始标题
228
227
  */
@@ -268,6 +267,18 @@ export type BootstrapOptions = {
268
267
  * 是否隐藏侧边栏中收缩按键
269
268
  */
270
269
  hideSidebarShrink?: boolean;
270
+ /** 初始化侧边栏为收起状态 */
271
+ initSidebarShrinkClosed?: boolean;
272
+ /**
273
+ * 开启侧边栏鼠标悬浮打开、收起功能,一般与initSidebarShrinkClosed配合使用最佳
274
+ * ```
275
+ * 1. 鼠标悬浮侧边栏菜单打开
276
+ * 2. 鼠标离开侧边栏菜单收起
277
+ * 3. 手动点击打开侧边栏菜单,悬浮功能失效
278
+ * 4. 手动点击收起侧边栏菜单,悬浮功能生效
279
+ * ```
280
+ */
281
+ sidebarMouseHoverOpen?: boolean;
271
282
  /**
272
283
  * 自定义全局风格
273
284
  * 如果项目通过本地引入源代码的方式,此配置不生效
@@ -360,6 +371,8 @@ export type LayoutCtxProps = {
360
371
  normalModePositionMenu: (link: string) => void;
361
372
  iframeTopRouteMenuChange: (item: TMenuItem) => void;
362
373
  hideSidebarMenu?: boolean;
374
+ /** 关闭当前iframe tab并打开指定iframe tab */
375
+ onDeleteCurrentIframeTabItemOpenTargetIframeTab: (id: string | number, menuId?: string | number) => void;
363
376
  } & Omit<BootstrapOptions, "sidebarWidth" | "componentSize" | "locale" | "hideSidebarMenu">;
364
377
  export interface LeaveMenuProps {
365
378
  leaveMenus?: TMenuItem[];
@@ -475,7 +488,7 @@ export declare const usePageWrapper: () => {
475
488
  */
476
489
  export declare const useRegisterRefreshCurrentIframeTab: (refreshKey: string, onRefresh: (params?: TPlainObject) => Promise<void>) => void;
477
490
  /**
478
- * 根据 refreshKey,刷新指定iframe tab
491
+ * 根据 refreshKey,刷新指定iframe tab(在iframe tab中调用)
479
492
  * ```
480
493
  * 1. 使用 useRegisterRefreshCurrentIframeTab 定义的refreshKey
481
494
  * 2. 可通过 params 给刷新方法传参
@@ -484,9 +497,36 @@ export declare const useRegisterRefreshCurrentIframeTab: (refreshKey: string, on
484
497
  */
485
498
  export declare const useRefreshRegisterIframeTab: () => (refreshKey: string, params?: TPlainObject) => void;
486
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
+ };
487
526
  /**
488
527
  * 使用Iframe通讯的API
489
528
  * @param onReceivedMessageCallback 接收iframe通讯消息的回调函数引用
529
+ * @demo https://fex.qa.tcshuke.com/docs/admin/main/exchange
490
530
  * @example
491
531
  * ```tsx
492
532
  * const iframeApi = useIframe<MessageData>((data) => {
@@ -502,21 +542,7 @@ export type IframeHandler<T = unknown> = (data: T) => void;
502
542
  * ```
503
543
  * @returns
504
544
  */
505
- export declare const useIframe: <T>(onReceivedMessageCallback?: IframeHandler<T>) => {
506
- broadcastMessages<T_1>(data: T_1): any;
507
- postMessage<T_2>(data: T_2): any;
508
- openNewTabItem(data: {
509
- link: string;
510
- name: string;
511
- metaTitle?: string | undefined;
512
- }): any;
513
- openBrowserWindow(url: string): any;
514
- locationHref(url: string): any;
515
- tabItemHistoryChange(link: string): any;
516
- openNewTabItemByMenuId(data: {
517
- id: string;
518
- }): any;
519
- };
545
+ export declare const useIframe: <T>(onReceivedMessageCallback?: IframeHandler<T>) => IframeApiProps;
520
546
  export declare const LayoutPage: (props: {
521
547
  style?: CSSProperties;
522
548
  children?: ReactElement;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flatbiz/pro-layout",
3
- "version": "4.4.2",
3
+ "version": "4.4.3",
4
4
  "description": "WEB菜单布局",
5
5
  "main": "index.js",
6
6
  "typings": "index.d.ts",