@flatbiz/pro-layout 4.4.2 → 4.4.4

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
  * 如果项目通过本地引入源代码的方式,此配置不生效
@@ -329,6 +340,24 @@ export type BootstrapOptions = {
329
340
  * 显示header菜单icon
330
341
  */
331
342
  showHeaderMenuIcon?: boolean;
343
+ /**
344
+ * 基本颜色配置
345
+ * ```
346
+ * 默认值:
347
+ * dark: { bgColor: '#1b1a1a', blockBgColor: '#000' }
348
+ * light: { bgColor: '#f9f9f9', blockBgColor: '#FFF' }
349
+ * ```
350
+ */
351
+ bgColorConfig?: {
352
+ dark?: {
353
+ bgColor?: string;
354
+ blockBgColor?: string;
355
+ };
356
+ light?: {
357
+ bgColor?: string;
358
+ blockBgColor?: string;
359
+ };
360
+ };
332
361
  };
333
362
  export type LayoutCtxProps = {
334
363
  menus: TMenuItem[];
@@ -360,6 +389,8 @@ export type LayoutCtxProps = {
360
389
  normalModePositionMenu: (link: string) => void;
361
390
  iframeTopRouteMenuChange: (item: TMenuItem) => void;
362
391
  hideSidebarMenu?: boolean;
392
+ /** 关闭当前iframe tab并打开指定iframe tab */
393
+ onDeleteCurrentIframeTabItemOpenTargetIframeTab: (id: string | number, menuId?: string | number) => void;
363
394
  } & Omit<BootstrapOptions, "sidebarWidth" | "componentSize" | "locale" | "hideSidebarMenu">;
364
395
  export interface LeaveMenuProps {
365
396
  leaveMenus?: TMenuItem[];
@@ -475,7 +506,7 @@ export declare const usePageWrapper: () => {
475
506
  */
476
507
  export declare const useRegisterRefreshCurrentIframeTab: (refreshKey: string, onRefresh: (params?: TPlainObject) => Promise<void>) => void;
477
508
  /**
478
- * 根据 refreshKey,刷新指定iframe tab
509
+ * 根据 refreshKey,刷新指定iframe tab(在iframe tab中调用)
479
510
  * ```
480
511
  * 1. 使用 useRegisterRefreshCurrentIframeTab 定义的refreshKey
481
512
  * 2. 可通过 params 给刷新方法传参
@@ -484,9 +515,36 @@ export declare const useRegisterRefreshCurrentIframeTab: (refreshKey: string, on
484
515
  */
485
516
  export declare const useRefreshRegisterIframeTab: () => (refreshKey: string, params?: TPlainObject) => void;
486
517
  export type IframeHandler<T = unknown> = (data: T) => void;
518
+ /**
519
+ * iframe通信Demo:https://fex.qa.tcshuke.com/docs/admin/main/exchange
520
+ */
521
+ export type IframeApiProps = {
522
+ /** 广播消息到所有的iframes子页面 */
523
+ broadcastMessages: <T>(data: T) => IframeApiProps;
524
+ /** 发送特定消息到父亲级window对象 */
525
+ postMessage: <T>(data: T) => IframeApiProps;
526
+ /** 打开新的iframe tab窗口 */
527
+ openNewTabItem: (data: {
528
+ link: string;
529
+ name: string;
530
+ metaTitle?: string;
531
+ }) => IframeApiProps;
532
+ /** 打开新的浏览器窗口 */
533
+ openBrowserWindow: (url: string) => IframeApiProps;
534
+ /** 刷新当前iframe tab */
535
+ locationHref: (url: string) => IframeApiProps;
536
+ tabItemHistoryChange: (link: string) => IframeApiProps;
537
+ /** 通过菜单Id打开新的iframe tab窗口 */
538
+ openNewTabItemByMenuId: (data: {
539
+ id: string;
540
+ }) => IframeApiProps;
541
+ /** 关闭当前iframe-tab,跳转上一个链路tab */
542
+ closedIframeTabToPrevlink: () => IframeApiProps;
543
+ };
487
544
  /**
488
545
  * 使用Iframe通讯的API
489
546
  * @param onReceivedMessageCallback 接收iframe通讯消息的回调函数引用
547
+ * @demo https://fex.qa.tcshuke.com/docs/admin/main/exchange
490
548
  * @example
491
549
  * ```tsx
492
550
  * const iframeApi = useIframe<MessageData>((data) => {
@@ -502,21 +560,7 @@ export type IframeHandler<T = unknown> = (data: T) => void;
502
560
  * ```
503
561
  * @returns
504
562
  */
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
- };
563
+ export declare const useIframe: <T>(onReceivedMessageCallback?: IframeHandler<T>) => IframeApiProps;
520
564
  export declare const LayoutPage: (props: {
521
565
  style?: CSSProperties;
522
566
  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.4",
4
4
  "description": "WEB菜单布局",
5
5
  "main": "index.js",
6
6
  "typings": "index.d.ts",