@flatbiz/pro-layout 4.4.20 → 5.0.0
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 +1 -0
- package/LICENSE +21 -0
- package/README.md +1 -0
- package/dist/index.css +1 -0
- package/{index.d.ts → dist/index.d.ts} +16 -15
- package/dist/index.js +4127 -0
- package/dist/index.js.map +1 -0
- package/index.js +1 -1
- package/package.json +78 -43
- package/esm/index.css +0 -1
- package/esm/index.js +0 -5
- package/esm/index.js.map +0 -1
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# @mono/react
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2020-2021 Yingchun Tian
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# @mono/react
|
package/dist/index.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.bread-wrapper{align-items:center;border-radius:6px;display:flex;justify-content:space-between;margin-bottom:5px;padding:3px 15px 6px 8px}.bread-wrapper .bread{display:inline-block}.bread-wrapper .ant-breadcrumb ol{margin:0;padding:0}.bread-extend{flex:1}.header-account{color:unset;cursor:pointer;flex-shrink:0;height:100%;line-height:normal;margin-right:20px}.header-account:hover{background:var(--header-menuSelectedBgColor);color:var(--header-menuSelectedTextColor)}.header-account .header-account-wraper{align-items:center;display:flex;height:100%;padding:0 15px}.header-account .header-account-wraper img.user-avatar{border-radius:100%;height:24px;object-fit:cover;width:24px}.account-dropdown-overlay{box-shadow:0 4px 8px 0 rgba(0,0,0,.08);z-index:900}.layout-brand{align-items:center;background:var(--header-bgColor);color:var(--header-textColor);display:flex;justify-content:center;overflow:hidden;position:relative;transition:all .2s;white-space:nowrap}.brand-logo{background-position:50%;background-repeat:no-repeat;background-size:40px 100%;height:100%;width:40px}.brand-name{font-size:18px;margin-left:15px;white-space:nowrap}.ant-layout-sider-collapsed .layout-brand{display:block;overflow:hidden}.ant-layout-sider-collapsed .brand-logo{width:60px}.hyperse-layout-main-header{background:var(--header-bgColor);color:var(--header-textColor);display:flex;flex-shrink:0;z-index:1}.hyperse-layout-system-name{align-items:center;color:unset;display:flex;flex-shrink:0;font-size:18px;margin-left:15px}.hyperse-layout-header-fill{display:flex;flex:1;justify-content:flex-end;overflow:hidden}.hyperse-layout-header-fill>.ant-menu{background:unset;border-bottom:none;height:unset}.hyperse-layout-header-fill>.ant-menu.ant-menu-horizontal{border-bottom:none;line-height:inherit}.hyperse-layout-header-fill>.ant-menu .ant-menu-item{align-items:center;border-radius:0!important;display:flex}.hyperse-layout-header-fill>.ant-menu .ant-menu-item:hover:after{border:none}.hyperse-layout-header-fill>.ant-menu .ant-menu-item:after{border-bottom:0;bottom:12px}.hyperse-layout-header-fill>.ant-menu .ant-menu-item.ant-menu-item-selected:after{background:var(--header-menuSelectedTextColor);border:none}.hyperse-layout-header-fill>.ant-menu .ant-menu-item.ant-menu-item-active:not(.ant-menu-item-selected){background:var(--header-menuActiveBgColor)}.hyperse-layout-header-fill>.ant-menu .ant-menu-item.ant-menu-item-active:not(.ant-menu-item-selected):after{background:var(--header-menuActiveTextColor);border:none}.hyperse-layout-header-fill>.ant-menu .ant-menu-item-active:after,.hyperse-layout-header-fill>.ant-menu .ant-menu-item-selected:after{border-radius:3px;bottom:12px;content:"";height:3px;left:50%!important;min-width:22px;position:absolute;transform:translateX(-50%);width:30%}.hyperse-layout-header-fill>.ant-menu .ant-menu-overflow-item-rest{align-items:center;background-color:transparent!important;display:flex}.hyperse-layout-header-fill>.ant-menu .ant-menu-overflow-item-rest .ant-menu-submenu-title{color:var(--header-textColor)!important}.hyperse-layout-header-fill>.ant-menu .ant-menu-overflow-item-rest .ant-menu-submenu-title:hover{color:unset!important}.hyperse-layout-header-fill>.ant-menu .ant-menu-overflow-item-rest:after{width:0}.hyperse-layout-topmenu{flex:1;overflow:hidden}.hyperse-layout-main-header-has-menu .hyperse-layout-header-fill{justify-content:space-between}.hyperse-layout-topmenu-overflowed-modal .ant-menu-submenu{background-color:transparent!important}.light-theme .hyperse-layout-topmenu-overflowed-modal .ant-menu-item{color:#000!important}.dark-theme .hyperse-layout-topmenu-overflowed-modal .ant-menu-item{color:#fff}.loader{align-items:center;background-color:var(--block-bg-color);bottom:0;display:flex;justify-content:center;left:0;opacity:1;position:absolute;right:0;text-align:center;top:0;z-index:100000}.loader.fullScreen{position:fixed}.loader .loader-wrapper{display:inline-flex;flex-direction:column;height:100px;justify-content:space-around;width:100px}.loader .loader-inner{animation:spinner .6s linear infinite;border:2px solid rgba(0,128,227,.08);border-left-color:rgba(0,84,153,.7);border-radius:50%;height:30px;margin:0 auto;text-indent:-12345px;width:30px;z-index:100001}.loader .loader-text{color:#0080e3;font-size:12px;height:20px;letter-spacing:4px;text-align:center;width:100px}.loader.hidden{display:none}@keyframes spinner{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}.page{flex:1;overflow-x:hidden;overflow-y:auto;position:relative}.page-flex{display:flex;flex-direction:column}.page-full{flex:1;overflow-y:auto}.layout-shrink{align-items:center;cursor:pointer;display:flex;font-size:18px;justify-content:center;padding:10px 0;transition:all .3s ease-out}.sider-bar-shrink{background-color:var(--sidebar-bgColor);box-shadow:0 0 17px rgba(0,0,0,.1);color:var(--sidebar-menuSelectedTextColor)}.sider-bar-shrink:hover{color:var(--sidebar-menuSelectedBgColor)}.header-shrink{color:var(--header-textColor);width:50px}.header-shrink:hover{color:var(--header-menuSelectedBgColor)}.icon-change-show-active .menu-icon-img-active{display:block}.icon-change-show-active .menu-icon-img{display:none}.menu-icon-img,.menu-icon-img-active{background-position:0;background-repeat:no-repeat;background-size:100% 100%;display:none;flex-shrink:0;height:16px;width:16px}.menu-icon-img{display:block}.hyperse-layout-sider{display:flex;flex:1!important;flex-direction:column;height:100%;overflow:hidden;z-index:10}.hyperse-layout-sider .ant-layout-sider-children{display:flex;flex-direction:column}.hyperse-layout-sider .ant-layout-sider-children>.ant-menu-root{padding-bottom:30px}.hyperse-layout-sider .ant-menu-root{flex:1;overflow-x:hidden;overflow-y:auto}.hyperse-layout-sider .ant-menu-title-content{margin-left:5px}.hyperse-layout-sider .ant-menu-item-selected .menu-icon-img-active{display:block}.hyperse-layout-sider .ant-menu-item-selected .menu-icon-img{display:none}.hyperse-layout-sider .ant-menu-item-active .menu-icon-img-active{display:block}.hyperse-layout-sider .ant-menu-item-active .menu-icon-img{display:none}.hyperse-layout-sider .ant-menu-submenu-active .ant-menu-submenu-title .menu-icon-img-active,.hyperse-layout-sider .ant-menu-submenu-selected .ant-menu-submenu-title .menu-icon-img-active{display:block}.hyperse-layout-sider .ant-menu-submenu-active .ant-menu-submenu-title .menu-icon-img,.hyperse-layout-sider .ant-menu-submenu-selected .ant-menu-submenu-title .menu-icon-img{display:none}.hyperse-layout-sider .ant-menu-light.ant-menu-root.ant-menu-inline,.hyperse-layout-sider .ant-menu-light.ant-menu-root.ant-menu-vertical{border-inline-end:none}.ant-menu-root.ant-menu-inline-collapsed>.ant-menu-item,.ant-menu-root.ant-menu-inline-collapsed>.ant-menu-submenu .ant-menu-submenu-title{align-items:center;display:flex}.ant-menu-root.ant-menu-inline-collapsed .menu-icon-img-active+span{display:none}.menu-icon-wrapper{align-items:center;display:flex}.hyperse-layout-sider-submenu-popup .ant-menu-item-selected .menu-icon-img-active{display:block}.hyperse-layout-sider-submenu-popup .ant-menu-item-selected .menu-icon-img{display:none}.hyperse-layout-sider-submenu-popup .ant-menu-item-selected .ant-menu-title-content{color:var(--sidebar-menuSelectedTextColor)}.hyperse-layout-sider-submenu-popup .ant-menu-item-active .menu-icon-img-active{display:block}.hyperse-layout-sider-submenu-popup .ant-menu-item-active .menu-icon-img{display:none}.hyperse-layout-sider-submenu-popup .ant-menu-item-active .ant-menu-title-content{color:var(--sidebar-menuSelectedTextColor)}.hyperse-layout-sider-submenu-popup .ant-menu-item{align-items:center!important;display:flex!important}.hyperse-layout-sider-submenu-popup .ant-menu-title-content{color:rgba(0,0,0,.88);margin-left:5px}.sider-bar-search{align-items:center;background-color:var(--sidebar-bgColor);display:flex;padding:10px}.sider-bar-search input{background-color:transparent}.sider-bar-search:not(.sider-bar-search-bgfff) input{color:#fff}.sider-bar-search:not(.sider-bar-search-bgfff) input::placeholder{color:#fff}.iframe-tabs{overflow:hidden}.iframe-tabs .ant-tabs-tab{background:transparent!important;border:none!important;border-radius:0!important;height:38px;margin:0!important;padding:0 16px!important}.iframe-tabs .ant-tabs-tab.ant-tabs-tab-active{background-color:var(--bg-color)!important;border-bottom:none!important}.iframe-tabs .ant-tabs-tab-btn{margin:0 auto}.iframe-tabs .ant-tabs-tab-remove{display:flex;height:16px;margin-left:4px;padding:0;width:16px}.iframe-tabs .tab-icon{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAV5JREFUWEftVTtSwzAQfZuchJqL2KGJDAMFyKkIDZ+GUJGZDNDwafg0QGUbCpjBdkPsg3AALoKXUUhsF8YfKNRYnaTdt2/falcEzYs0x0dLoFWgVaBSAeftfdLtdtaY6UQK47VO23pBvE7g868kcQarK5Myn0oCT2H0wYxlBdIB2ZvC8MoAvTC2wewoGwI+t4S59C8CKhuAXxYgzDy0rd5jEagXREMA99kdbVSpVqmAAnsOYpmA3RzwnhTGXZ6E60f7RLhOz4gGsm/kfIp1qEVAubr+dJuIHrIAPJL93pXae340AuEiF2JHCjOzLalBbQKzQEG8C/BtWg5gPK/1aVYiHNiWeVPnsc5965r+2Hnh9BBMl4VejCNpmcV3v4RppMACww2iYwLSrNU5A2NbmGfN0pl1SvOllYDWEmh9hFrbUOsg0j6KtX9G2r/j5lOimcefBlGzEOXWLYFWgVaBb9EEtCFLbAZ7AAAAAElFTkSuQmCC);background-size:100% 100%;border-radius:100%;display:inline-block;height:100%;width:100%}.iframe-tabs .tab-icon:hover{background-color:#f96868;background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAASdJREFUWEftljtOBDEQRF8dhZjrIIhYIpaET8ISsRICEj4JCwkQARGchwNwk0KWvFJrNcN4dpCcjKORu11dXW13j6i8VDk+I4FRgVGBTgVsXwBbwKWkr5Jna3sbuAHeJKXzrauEwDewmREmkj7+ArQ9SYGzz4+kjaEEUjafAWQq6bUJ1PYUeA62nS7VOhVIYLZ3gfcAfCTpKZKwfQw8hL09SfFMoxBFBDKJfeAloMwk3WfbDLgNtgNJ0Xf9O7CS5SHwGPbm+fsq7J1IWpRc1uRTrMAS0PYpcNcS4ExSm21YCVaUOAdi1sk8l3RdmvnSr7cCueb1CFQtge16l9B2vWdYtRHlwVKvFduuPozqjuO+jaWv/1qNqG+QQf8D/xmsCWtUYFSgugK/gSWEIdTkUcAAAAAASUVORK5CYII=");background-size:100% 100%}.iframe-tabs .ant-tabs-nav{background-color:var(--block-bg-color);margin:0!important}.iframe-tabs .ant-tabs-nav:before{border:none!important}.iframe-tabs .ant-tabs-content{height:100%}.iframe-tabs .ant-tabs-extra-content{margin-right:20px}.iframe-tabs .menu-tabs-operate{text-align:center;width:24px}.content-top-menus{margin:0}.content-top-menus .ant-tabs-tab{background:transparent!important;border:none!important;border-radius:0!important;height:38px;margin:0!important;padding:0 16px!important}.content-top-menus .ant-tabs-tab.ant-tabs-tab-active{background-color:var(--bg-color)!important;border-bottom:none!important}.content-top-menus .ant-tabs-nav{background-color:var(--block-bg-color);margin:0!important}.content-top-menus .ant-tabs-nav:before{border:none!important}.layout-page-wrapper{background:var(--bg-color);flex:1;padding:8px 8px 0}.layout-page,.layout-page-wrapper{height:100%;overflow:hidden;position:relative}.layout-page{display:flex;flex-direction:column}.layout-page-noheader{padding:0}.layout-page-noheader .bread-wrapper{padding:5px 15px 5px 8px}.layout-page-noheader .page{padding:0 8px 8px}#app,#app>.ant-app,body,html{height:100%;margin:0;width:100%}*,:after,:before{box-sizing:border-box}#app{background-color:var(--bg-color)}.hyperse-layout{bottom:0;display:flex;flex-direction:row;height:100vh;left:0;overflow:auto;position:fixed;right:0;top:0}.hyperse-layout-main{display:flex;flex:1;overflow:hidden}.hyperse-layout-main-content{flex:1;overflow-y:auto}.hyperse-layout-windows ::-webkit-scrollbar,.layout-page-windows ::-webkit-scrollbar,.page-windows ::-webkit-scrollbar{background-color:#eee;height:8px;width:8px}.hyperse-layout-windows ::-webkit-scrollbar-thumb,.layout-page-windows ::-webkit-scrollbar-thumb,.page-windows ::-webkit-scrollbar-thumb{background-color:#cfcfcf;border-radius:10px}.hyperse-layout-windows ::-webkit-scrollbar-thumb:hover,.layout-page-windows ::-webkit-scrollbar-thumb:hover,.page-windows ::-webkit-scrollbar-thumb:hover{background-color:#a8a8a8}.hyperse-layout-windows ::-webkit-scrollbar-thumb:active,.layout-page-windows ::-webkit-scrollbar-thumb:active,.page-windows ::-webkit-scrollbar-thumb:active{background-color:#787878}
|
|
@@ -1,15 +1,11 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
/// <reference types="prop-types" />
|
|
3
|
-
/// <reference types="scheduler" />
|
|
4
|
-
|
|
5
1
|
import { ModelType } from '@dimjs/model';
|
|
6
2
|
import { ButtonWrapperProps, ConfigProviderWrapperProps } from '@flatbiz/antd';
|
|
7
3
|
import { TAny, TPlainObject } from '@flatbiz/utils';
|
|
8
4
|
import { BreadcrumbProps, MenuProps } from 'antd';
|
|
9
|
-
import { MessageInstance } from 'antd/es/message/interface';
|
|
10
|
-
import { ModalStaticFunctions } from 'antd/es/modal/confirm';
|
|
11
|
-
import { NotificationInstance } from 'antd/es/notification/interface';
|
|
12
|
-
import { SizeType } from 'antd/lib/config-provider/SizeContext';
|
|
5
|
+
import { MessageInstance } from 'antd/es/message/interface.js';
|
|
6
|
+
import { ModalStaticFunctions } from 'antd/es/modal/confirm.js';
|
|
7
|
+
import { NotificationInstance } from 'antd/es/notification/interface.js';
|
|
8
|
+
import { SizeType } from 'antd/lib/config-provider/SizeContext.js';
|
|
13
9
|
import { CSSProperties, ComponentType, ReactElement } from 'react';
|
|
14
10
|
|
|
15
11
|
export declare let message: MessageInstance;
|
|
@@ -18,7 +14,7 @@ export declare let modal: Omit<ModalStaticFunctions, "warn">;
|
|
|
18
14
|
export type BreadProps = {
|
|
19
15
|
children?: ReactElement;
|
|
20
16
|
};
|
|
21
|
-
export declare const Bread: (props: BreadProps) => import("react
|
|
17
|
+
export declare const Bread: (props: BreadProps) => import("react").JSX.Element | null;
|
|
22
18
|
export type HistoryBackProps = ButtonWrapperProps & {
|
|
23
19
|
level?: number;
|
|
24
20
|
};
|
|
@@ -37,7 +33,7 @@ export type HistoryBackProps = ButtonWrapperProps & {
|
|
|
37
33
|
* 5. onClick返回 promise reject,则不会进行回退处理(V4.2.4)
|
|
38
34
|
* ```
|
|
39
35
|
*/
|
|
40
|
-
export declare const HistoryBackButton: (props: HistoryBackProps) => import("react
|
|
36
|
+
export declare const HistoryBackButton: (props: HistoryBackProps) => import("react").JSX.Element;
|
|
41
37
|
export declare const useHistoryBack: (props?: {
|
|
42
38
|
level?: number;
|
|
43
39
|
}) => {
|
|
@@ -63,7 +59,7 @@ export interface PageProps {
|
|
|
63
59
|
* @param props
|
|
64
60
|
* @returns
|
|
65
61
|
*/
|
|
66
|
-
export declare const Page: (props: PageProps) => import("react
|
|
62
|
+
export declare const Page: (props: PageProps) => import("react").JSX.Element;
|
|
67
63
|
export type PageWrapperServiceConfig = {
|
|
68
64
|
onRequest: (params?: TAny) => Promise<TAny>;
|
|
69
65
|
params?: TPlainObject | (() => TPlainObject);
|
|
@@ -252,6 +248,9 @@ export type THeaderThemeConfig = {
|
|
|
252
248
|
menuColor?: string;
|
|
253
249
|
menuTextFontSize?: number;
|
|
254
250
|
};
|
|
251
|
+
/**
|
|
252
|
+
* url地址上配置 hideBreads = 1,可隐藏面包屑显示
|
|
253
|
+
*/
|
|
255
254
|
export type BootstrapOptions = {
|
|
256
255
|
className?: string;
|
|
257
256
|
/** 是否紧凑模式 */
|
|
@@ -545,6 +544,8 @@ export type BootstrapOptions = {
|
|
|
545
544
|
layoutPageClassName?: string;
|
|
546
545
|
/** 取消iframe中路由地址同步至外部父窗口,在 iframe-main 中配置有效 */
|
|
547
546
|
cancelIframeRouteSyncParent?: boolean;
|
|
547
|
+
/** 侧边栏菜单onChange事件 */
|
|
548
|
+
siderBarMenuOnChange?: (data: any) => void;
|
|
548
549
|
};
|
|
549
550
|
export type LayoutCtxProps = {
|
|
550
551
|
menus: TMenuItem[];
|
|
@@ -625,7 +626,7 @@ export declare const useRegisterRefreshCurrentIframeTab: (refreshKey: string, on
|
|
|
625
626
|
export declare const useRefreshRegisterIframeTab: () => (refreshKey: string, params?: TPlainObject) => void;
|
|
626
627
|
export type IframeHandler<T = unknown> = (data: T) => void;
|
|
627
628
|
/**
|
|
628
|
-
* iframe通信Demo:https://
|
|
629
|
+
* iframe通信Demo:https://xx.xx.com/docs/admin/main/exchange
|
|
629
630
|
*/
|
|
630
631
|
export type IframeApiProps = {
|
|
631
632
|
/** 广播消息到所有的iframes子页面 */
|
|
@@ -649,7 +650,7 @@ export type IframeApiProps = {
|
|
|
649
650
|
if (menuItem?.id) {
|
|
650
651
|
window.parent.postMessage(
|
|
651
652
|
JSON.stringify({
|
|
652
|
-
type: '
|
|
653
|
+
type: 'HYPERSE-LAYOUT',
|
|
653
654
|
data: {
|
|
654
655
|
type: 'redirect_to_frame_layout_menu_third_item',
|
|
655
656
|
data: {
|
|
@@ -687,7 +688,7 @@ export type IframeApiProps = {
|
|
|
687
688
|
/**
|
|
688
689
|
* 使用Iframe通讯的API
|
|
689
690
|
* @param onReceivedMessageCallback 接收iframe通讯消息的回调函数引用
|
|
690
|
-
* @demo https://
|
|
691
|
+
* @demo https://xx.xx.com/docs/admin/main/exchange
|
|
691
692
|
* @example
|
|
692
693
|
* ```tsx
|
|
693
694
|
* const iframeApi = useIframe<MessageData>((data) => {
|
|
@@ -709,7 +710,7 @@ export declare const LayoutPage: (props: {
|
|
|
709
710
|
hideHeader?: boolean;
|
|
710
711
|
elementId?: string;
|
|
711
712
|
className?: string;
|
|
712
|
-
}) => import("react
|
|
713
|
+
}) => import("react").JSX.Element;
|
|
713
714
|
export type IState = {
|
|
714
715
|
isDark?: boolean;
|
|
715
716
|
};
|