@yueglobal/ui 1.0.0 → 1.0.2
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/README.md +147 -148
- package/{dist/components → components}/svg-icon/declaration.svg +23 -23
- package/{dist/components → components}/svg-icon/expo.svg +23 -23
- package/{dist/components → components}/svg-icon/home.svg +13 -13
- package/{dist/components → components}/svg-icon/hwc.svg +20 -20
- package/{dist/components → components}/svg-icon/insurance.svg +14 -14
- package/{dist/components → components}/svg-icon/law.svg +23 -23
- package/{dist/components → components}/svg-icon/location.svg +9 -9
- package/{dist/components → components}/svg-icon/selection.svg +16 -16
- package/{dist/components → components}/svg-icon/single-window.svg +8 -8
- package/{dist/components → components}/svg-icon/taxation.svg +13 -13
- package/{dist/components → components}/svg-icon/trade-data.svg +18 -18
- package/{dist/components → components}/svg-icon/training.svg +17 -17
- package/package.json +7 -55
- package/{dist/yue-page-footer → yue-page-footer}/index.less +168 -168
- package/yue-page-header/breadcrumb/index.d.ts +12 -0
- package/yue-page-header/breadcrumb/index.js +130 -0
- package/yue-page-header/breadcrumb/index.less +30 -0
- package/yue-page-header/first-menus/index.d.ts +11 -0
- package/{dist/yue-page-header → yue-page-header}/first-menus/index.js +51 -15
- package/{dist/yue-page-header → yue-page-header}/first-menus/index.less +119 -86
- package/{dist/yue-page-header → yue-page-header}/helper.d.ts +9 -0
- package/{dist/yue-page-header → yue-page-header}/helper.js +106 -36
- package/{dist/yue-page-header → yue-page-header}/index.d.ts +1 -0
- package/{dist/yue-page-header → yue-page-header}/index.js +50 -17
- package/{dist/yue-page-header → yue-page-header}/index.less +44 -43
- package/{dist/yue-page-header → yue-page-header}/right-content/index.less +35 -35
- package/yue-page-header/second-menus/index.d.ts +12 -0
- package/{dist/yue-page-header → yue-page-header}/second-menus/index.js +27 -44
- package/{dist/yue-page-header → yue-page-header}/second-menus/index.less +160 -161
- package/dist/yue-page-header/breadcrumb/index.d.ts +0 -5
- package/dist/yue-page-header/breadcrumb/index.js +0 -82
- package/dist/yue-page-header/first-menus/index.d.ts +0 -7
- package/dist/yue-page-header/second-menus/index.d.ts +0 -8
- /package/{dist/assets → assets}/gw-logo.png +0 -0
- /package/{dist/assets → assets}/hs-logo.png +0 -0
- /package/{dist/assets → assets}/hs-wx.png +0 -0
- /package/{dist/assets → assets}/platform-logo.png +0 -0
- /package/{dist/assets → assets}/yldm-applet.png +0 -0
- /package/{dist/assets → assets}/ylqq-title.png +0 -0
- /package/{dist/assets → assets}/yxh-applet.png +0 -0
- /package/{dist/components → components}/svg-icon/index.d.ts +0 -0
- /package/{dist/components → components}/svg-icon/index.js +0 -0
- /package/{dist/index.d.ts → index.d.ts} +0 -0
- /package/{dist/index.js → index.js} +0 -0
- /package/{dist/yue-page-footer → yue-page-footer}/data/privacy-policy.d.ts +0 -0
- /package/{dist/yue-page-footer → yue-page-footer}/data/privacy-policy.js +0 -0
- /package/{dist/yue-page-footer → yue-page-footer}/data/terms-of-service.d.ts +0 -0
- /package/{dist/yue-page-footer → yue-page-footer}/data/terms-of-service.js +0 -0
- /package/{dist/yue-page-footer → yue-page-footer}/index.d.ts +0 -0
- /package/{dist/yue-page-footer → yue-page-footer}/index.js +0 -0
- /package/{dist/yue-page-footer → yue-page-footer}/info-modal/index.d.ts +0 -0
- /package/{dist/yue-page-footer → yue-page-footer}/info-modal/index.js +0 -0
- /package/{dist/yue-page-header → yue-page-header}/right-content/index.d.ts +0 -0
- /package/{dist/yue-page-header → yue-page-header}/right-content/index.js +0 -0
|
@@ -1,18 +1,12 @@
|
|
|
1
|
-
var _excluded = ["width", "backgroundColor", "rightContent", "onLocaleChange"];
|
|
1
|
+
var _excluded = ["width", "backgroundColor", "rightContent", "onLocaleChange", "pageTitle", "pageIcon", "activeLabel"];
|
|
2
2
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
3
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
4
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
5
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
6
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
7
|
-
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
8
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
9
3
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
10
4
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
11
|
-
import React, { memo, useMemo
|
|
5
|
+
import React, { memo, useMemo } from 'react';
|
|
12
6
|
import logoImg from "../assets/gw-logo.png";
|
|
13
7
|
import titleImg from "../assets/ylqq-title.png";
|
|
14
8
|
import FirstMenus from "./first-menus";
|
|
15
|
-
import { mainHost } from "./helper";
|
|
9
|
+
import { flattenMenuList, mainHost } from "./helper";
|
|
16
10
|
import "./index.less";
|
|
17
11
|
import RightContent from "./right-content";
|
|
18
12
|
import SecondMenus from "./second-menus";
|
|
@@ -23,15 +17,54 @@ var Index = function Index(_ref) {
|
|
|
23
17
|
backgroundColor = _ref$backgroundColor === void 0 ? '#fff' : _ref$backgroundColor,
|
|
24
18
|
rightContent = _ref.rightContent,
|
|
25
19
|
onLocaleChange = _ref.onLocaleChange,
|
|
20
|
+
pageTitle = _ref.pageTitle,
|
|
21
|
+
pageIcon = _ref.pageIcon,
|
|
22
|
+
activeLabel = _ref.activeLabel,
|
|
26
23
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
27
|
-
var _useState = useState(false),
|
|
28
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
29
|
-
visible = _useState2[0],
|
|
30
|
-
setVisible = _useState2[1];
|
|
31
24
|
var hasSecondMenu = useMemo(function () {
|
|
32
25
|
var _props$breadcrumbs, _props$menuItems;
|
|
33
|
-
return !!
|
|
34
|
-
}, [
|
|
26
|
+
return !!pageTitle || !!((_props$breadcrumbs = props.breadcrumbs) !== null && _props$breadcrumbs !== void 0 && _props$breadcrumbs.length) || !!((_props$menuItems = props.menuItems) !== null && _props$menuItems !== void 0 && _props$menuItems.length);
|
|
27
|
+
}, [pageTitle, props.breadcrumbs, props.menuItems]);
|
|
28
|
+
|
|
29
|
+
// 应用数据
|
|
30
|
+
var moduleData = useMemo(function () {
|
|
31
|
+
var title = pageTitle;
|
|
32
|
+
var icon = pageIcon;
|
|
33
|
+
var key;
|
|
34
|
+
var firstMenuList = flattenMenuList(true);
|
|
35
|
+
var _window$location = window.location,
|
|
36
|
+
origin = _window$location.origin,
|
|
37
|
+
pathname = _window$location.pathname;
|
|
38
|
+
var url = origin + pathname;
|
|
39
|
+
var current = firstMenuList.find(function (m) {
|
|
40
|
+
return !!(m !== null && m !== void 0 && m.key) && url.startsWith("".concat(m.key));
|
|
41
|
+
});
|
|
42
|
+
if (!current) {
|
|
43
|
+
if (activeLabel) {
|
|
44
|
+
current = firstMenuList.find(function (m) {
|
|
45
|
+
return (m === null || m === void 0 ? void 0 : m.label) === activeLabel;
|
|
46
|
+
});
|
|
47
|
+
} else if (pageTitle) {
|
|
48
|
+
current = firstMenuList.find(function (m) {
|
|
49
|
+
return (m === null || m === void 0 ? void 0 : m.label) === pageTitle;
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
if (current) {
|
|
54
|
+
if (!title) {
|
|
55
|
+
title = current.label;
|
|
56
|
+
}
|
|
57
|
+
if (!icon) {
|
|
58
|
+
icon = current.icon;
|
|
59
|
+
}
|
|
60
|
+
key = current.key;
|
|
61
|
+
}
|
|
62
|
+
return {
|
|
63
|
+
title: title,
|
|
64
|
+
icon: icon,
|
|
65
|
+
key: key
|
|
66
|
+
};
|
|
67
|
+
}, [pageTitle, pageIcon, activeLabel]);
|
|
35
68
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
36
69
|
style: {
|
|
37
70
|
backgroundColor: backgroundColor,
|
|
@@ -63,13 +96,13 @@ var Index = function Index(_ref) {
|
|
|
63
96
|
})), /*#__PURE__*/React.createElement("div", {
|
|
64
97
|
className: "menus-bar"
|
|
65
98
|
}, /*#__PURE__*/React.createElement(FirstMenus, {
|
|
66
|
-
|
|
99
|
+
moduleData: moduleData
|
|
67
100
|
})), /*#__PURE__*/React.createElement(RightContent, {
|
|
68
101
|
content: rightContent,
|
|
69
102
|
onLocaleChange: onLocaleChange
|
|
70
103
|
})), hasSecondMenu && /*#__PURE__*/React.createElement(SecondMenus, _extends({
|
|
71
104
|
width: width,
|
|
72
|
-
|
|
105
|
+
moduleData: moduleData
|
|
73
106
|
}, props))));
|
|
74
107
|
};
|
|
75
108
|
export default /*#__PURE__*/memo(Index);
|
|
@@ -1,43 +1,44 @@
|
|
|
1
|
-
.yue-page-header {
|
|
2
|
-
position: fixed;
|
|
3
|
-
top: 0;
|
|
4
|
-
left: 0;
|
|
5
|
-
width: 100%;
|
|
6
|
-
z-index: 100;
|
|
7
|
-
line-height: 1.415;
|
|
8
|
-
|
|
9
|
-
* {
|
|
10
|
-
box-sizing: border-box;
|
|
11
|
-
outline: none;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
.yue-flex {
|
|
15
|
-
display: flex;
|
|
16
|
-
align-items: center;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
.yue-page-header-topbar {
|
|
21
|
-
margin: 0 auto;
|
|
22
|
-
height: 80px;
|
|
23
|
-
max-width:
|
|
24
|
-
|
|
25
|
-
.title-bar {
|
|
26
|
-
flex-shrink: 0;
|
|
27
|
-
cursor: pointer;
|
|
28
|
-
gap: 16px;
|
|
29
|
-
|
|
30
|
-
.logo {
|
|
31
|
-
height: 34px;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
.title {
|
|
35
|
-
height: 29px;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
.menus-bar {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}
|
|
1
|
+
.yue-page-header {
|
|
2
|
+
position: fixed;
|
|
3
|
+
top: 0;
|
|
4
|
+
left: 0;
|
|
5
|
+
width: 100%;
|
|
6
|
+
z-index: 100;
|
|
7
|
+
line-height: 1.415;
|
|
8
|
+
|
|
9
|
+
* {
|
|
10
|
+
box-sizing: border-box;
|
|
11
|
+
outline: none;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.yue-flex {
|
|
15
|
+
display: flex;
|
|
16
|
+
align-items: center;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.yue-page-header-topbar {
|
|
21
|
+
margin: 0 auto;
|
|
22
|
+
height: 80px;
|
|
23
|
+
max-width: 98%;
|
|
24
|
+
|
|
25
|
+
.title-bar {
|
|
26
|
+
flex-shrink: 0;
|
|
27
|
+
cursor: pointer;
|
|
28
|
+
gap: 16px;
|
|
29
|
+
|
|
30
|
+
.logo {
|
|
31
|
+
height: 34px;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.title {
|
|
35
|
+
height: 29px;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.menus-bar {
|
|
40
|
+
height: 100%;
|
|
41
|
+
flex: 1 1 0%;
|
|
42
|
+
min-width: 0;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
.yue-page-header-right-content {
|
|
2
|
-
flex-shrink: 0;
|
|
3
|
-
gap: 14px;
|
|
4
|
-
font-size: 15px;
|
|
5
|
-
margin-left: 12px;
|
|
6
|
-
|
|
7
|
-
.vr {
|
|
8
|
-
width: 1px;
|
|
9
|
-
height: 22px;
|
|
10
|
-
background-color: rgba(0, 0, 0, 40%);
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
.link {
|
|
14
|
-
text-decoration: none;
|
|
15
|
-
color: #000;
|
|
16
|
-
gap: 8px;
|
|
17
|
-
height: 34px;
|
|
18
|
-
border-radius: 4px;
|
|
19
|
-
padding-inline: 4px;
|
|
20
|
-
|
|
21
|
-
&:hover {
|
|
22
|
-
color: rgba(0, 0, 0, 90%);
|
|
23
|
-
background-color: rgba(0, 0, 0, 4%);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
.anticon {
|
|
27
|
-
color: #2860f3;
|
|
28
|
-
font-size: 16px;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
.sz-translate-bar.mode3 {
|
|
33
|
-
font-size: 16px;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
1
|
+
.yue-page-header-right-content {
|
|
2
|
+
flex-shrink: 0;
|
|
3
|
+
gap: 14px;
|
|
4
|
+
font-size: 15px;
|
|
5
|
+
margin-left: 12px;
|
|
6
|
+
|
|
7
|
+
.vr {
|
|
8
|
+
width: 1px;
|
|
9
|
+
height: 22px;
|
|
10
|
+
background-color: rgba(0, 0, 0, 40%);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.link {
|
|
14
|
+
text-decoration: none;
|
|
15
|
+
color: #000;
|
|
16
|
+
gap: 8px;
|
|
17
|
+
height: 34px;
|
|
18
|
+
border-radius: 4px;
|
|
19
|
+
padding-inline: 4px;
|
|
20
|
+
|
|
21
|
+
&:hover {
|
|
22
|
+
color: rgba(0, 0, 0, 90%);
|
|
23
|
+
background-color: rgba(0, 0, 0, 4%);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.anticon {
|
|
27
|
+
color: #2860f3;
|
|
28
|
+
font-size: 16px;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.sz-translate-bar.mode3 {
|
|
33
|
+
font-size: 16px;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
import { YuePageHeaderProps } from '../index';
|
|
3
|
+
import './index.less';
|
|
4
|
+
interface Props extends Omit<YuePageHeaderProps, 'rightContent' | 'pageTitle' | 'pageIcon'> {
|
|
5
|
+
moduleData: {
|
|
6
|
+
title?: string;
|
|
7
|
+
icon?: ReactNode;
|
|
8
|
+
key?: string;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
declare const _default: React.NamedExoticComponent<Props>;
|
|
12
|
+
export default _default;
|
|
@@ -5,60 +5,26 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
5
5
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
6
6
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
7
|
import { ConfigProvider, Menu } from 'antd';
|
|
8
|
-
import React, { memo, useEffect,
|
|
8
|
+
import React, { memo, useEffect, useRef, useState } from 'react';
|
|
9
9
|
import Breadcrumb from "../breadcrumb";
|
|
10
|
-
import {
|
|
10
|
+
import { flattenTreeList, setSubMenuPopupStyle } from "../helper";
|
|
11
11
|
import "./index.less";
|
|
12
12
|
var Index = function Index(_ref) {
|
|
13
13
|
var width = _ref.width,
|
|
14
|
-
pageTitle = _ref.pageTitle,
|
|
15
|
-
pageIcon = _ref.pageIcon,
|
|
16
14
|
breadcrumbs = _ref.breadcrumbs,
|
|
17
15
|
routes = _ref.routes,
|
|
18
16
|
menuItems = _ref.menuItems,
|
|
19
17
|
pathname = _ref.pathname,
|
|
20
|
-
|
|
18
|
+
moduleData = _ref.moduleData,
|
|
21
19
|
onRouteChange = _ref.onRouteChange;
|
|
22
20
|
var _useState = useState(),
|
|
23
21
|
_useState2 = _slicedToArray(_useState, 2),
|
|
24
22
|
selectedKeys = _useState2[0],
|
|
25
23
|
setSelectedKeys = _useState2[1];
|
|
24
|
+
var menuRef = useRef(null);
|
|
26
25
|
useEffect(function () {
|
|
27
26
|
if (pathname) setSelectedKeys([pathname]);
|
|
28
27
|
}, [pathname]);
|
|
29
|
-
|
|
30
|
-
// 应用数据
|
|
31
|
-
var moduleData = useMemo(function () {
|
|
32
|
-
var title = pageTitle;
|
|
33
|
-
var icon = pageIcon;
|
|
34
|
-
if (!title || !icon) {
|
|
35
|
-
var menuList = flattenMenuList(true);
|
|
36
|
-
var _window$location = window.location,
|
|
37
|
-
origin = _window$location.origin,
|
|
38
|
-
_pathname = _window$location.pathname;
|
|
39
|
-
var url = origin + _pathname;
|
|
40
|
-
var current = menuList.find(function (m) {
|
|
41
|
-
return !!(m !== null && m !== void 0 && m.key) && url.startsWith("".concat(m.key));
|
|
42
|
-
});
|
|
43
|
-
if (!current && pageTitle) {
|
|
44
|
-
current = menuList.find(function (m) {
|
|
45
|
-
return (m === null || m === void 0 ? void 0 : m.label) === pageTitle;
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
if (current) {
|
|
49
|
-
if (!title) {
|
|
50
|
-
title = current.label;
|
|
51
|
-
}
|
|
52
|
-
if (!icon) {
|
|
53
|
-
icon = current.icon;
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
return {
|
|
58
|
-
title: title,
|
|
59
|
-
icon: icon
|
|
60
|
-
};
|
|
61
|
-
}, [pageTitle, pageIcon]);
|
|
62
28
|
var onMenuClick = function onMenuClick(_ref2) {
|
|
63
29
|
var key = _ref2.key,
|
|
64
30
|
selectedKeys = _ref2.selectedKeys;
|
|
@@ -77,8 +43,20 @@ var Index = function Index(_ref) {
|
|
|
77
43
|
onRouteChange === null || onRouteChange === void 0 || onRouteChange(value);
|
|
78
44
|
}
|
|
79
45
|
};
|
|
46
|
+
var onSubMenuOpen = function onSubMenuOpen(key) {
|
|
47
|
+
if (!menuRef.current || !(menuItems !== null && menuItems !== void 0 && menuItems.length)) {
|
|
48
|
+
return false;
|
|
49
|
+
}
|
|
50
|
+
var index = menuItems.findIndex(function (m) {
|
|
51
|
+
return m.key === key;
|
|
52
|
+
});
|
|
53
|
+
if (index === -1) {
|
|
54
|
+
return false;
|
|
55
|
+
}
|
|
56
|
+
setSubMenuPopupStyle(menuRef.current, index);
|
|
57
|
+
};
|
|
80
58
|
return /*#__PURE__*/React.createElement("div", {
|
|
81
|
-
className: 'yue-page-header-second-menu'
|
|
59
|
+
className: 'yue-page-header-second-menu'
|
|
82
60
|
}, /*#__PURE__*/React.createElement("div", {
|
|
83
61
|
className: "yue-flex wrapper",
|
|
84
62
|
style: {
|
|
@@ -110,23 +88,28 @@ var Index = function Index(_ref) {
|
|
|
110
88
|
className: "yue-flex module-info"
|
|
111
89
|
}, !!moduleData.icon && /*#__PURE__*/React.createElement("span", {
|
|
112
90
|
className: "module-icon"
|
|
113
|
-
}, moduleData.icon), !!moduleData.title && /*#__PURE__*/React.createElement("
|
|
91
|
+
}, moduleData.icon), !!moduleData.title && /*#__PURE__*/React.createElement("div", {
|
|
114
92
|
className: "module-title"
|
|
115
93
|
}, moduleData.title)), /*#__PURE__*/React.createElement("div", {
|
|
116
|
-
className: "vr"
|
|
117
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
118
94
|
className: "menus"
|
|
119
95
|
}, /*#__PURE__*/React.createElement(Menu, {
|
|
96
|
+
ref: menuRef,
|
|
120
97
|
items: menuItems,
|
|
121
98
|
mode: "horizontal",
|
|
122
99
|
rootClassName: "yue-second-menu-bar",
|
|
123
100
|
onSelect: onMenuClick,
|
|
124
|
-
selectedKeys: selectedKeys
|
|
101
|
+
selectedKeys: selectedKeys,
|
|
102
|
+
onOpenChange: function onOpenChange(val) {
|
|
103
|
+
if (!!(val !== null && val !== void 0 && val.length)) {
|
|
104
|
+
onSubMenuOpen(val[0]);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
125
107
|
}))), /*#__PURE__*/React.createElement(Breadcrumb, {
|
|
126
108
|
breadcrumbs: breadcrumbs,
|
|
127
109
|
routes: routes,
|
|
128
110
|
pathname: pathname,
|
|
129
|
-
onRouteChange: onRouteChange
|
|
111
|
+
onRouteChange: onRouteChange,
|
|
112
|
+
moduleData: moduleData
|
|
130
113
|
}))));
|
|
131
114
|
};
|
|
132
115
|
export default /*#__PURE__*/memo(Index);
|