tntd 1.4.20 → 1.4.22
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/components/Handle/README.md +0 -20
- package/components/Handle/index.js +44 -7
- package/components/locale.js +8 -2
- package/dist/1.tntd.js +1 -1
- package/dist/stats.json +24430 -24390
- package/dist/tntd.css +1 -1
- package/dist/tntd.js +13 -8
- package/es/ArrayInput/icon.js +5 -5
- package/es/ArrayInput/index.js +108 -76
- package/es/AuthContext.js +1 -1
- package/es/Columns/index.js +38 -31
- package/es/DevelopmentLogin/LoginModal.js +45 -32
- package/es/DevelopmentLogin/index.js +17 -13
- package/es/Ellipsis/Svg/CopySVG.js +13 -13
- package/es/Ellipsis/Svg/TickSVG.js +8 -8
- package/es/Ellipsis/index.js +69 -58
- package/es/Handle/README.md +0 -20
- package/es/Handle/index.js +100 -33
- package/es/Icon/fonts/iconfont.js +12 -7
- package/es/Icon/index.js +13 -10
- package/es/Img/Contain.js +29 -24
- package/es/Img/Cover.js +54 -40
- package/es/Img/index.js +45 -36
- package/es/Layout/ActionsContext.js +2 -3
- package/es/Layout/AppList.js +92 -37
- package/es/Layout/Application.js +72 -26
- package/es/Layout/Avatar.js +66 -29
- package/es/Layout/CompatibleLanguage.js +94 -39
- package/es/Layout/EnterpriseLayout/Avatar.js +76 -38
- package/es/Layout/EnterpriseLayout/Language.js +32 -14
- package/es/Layout/EnterpriseLayout/Theme.js +34 -16
- package/es/Layout/EnterpriseLayout/index.js +16 -14
- package/es/Layout/GlobalNavigation/NavigationPopup.js +170 -59
- package/es/Layout/GlobalNavigation/index.js +54 -20
- package/es/Layout/Header.js +46 -25
- package/es/Layout/HeaderActions.js +56 -42
- package/es/Layout/HeaderNavs.js +47 -20
- package/es/Layout/HeaderTabs.js +102 -49
- package/es/Layout/Iconfont.js +1 -1
- package/es/Layout/Language.js +32 -14
- package/es/Layout/Layout.js +108 -86
- package/es/Layout/Logo.js +32 -16
- package/es/Layout/OrgAppList.js +107 -62
- package/es/Layout/SideMenu.js +124 -63
- package/es/Layout/Theme.js +61 -23
- package/es/Layout/checkAuth.js +29 -0
- package/es/Layout/index.js +34 -26
- package/es/Layout/paaslayout/CompactSideMenu.js +74 -35
- package/es/Layout/paaslayout/Header.js +45 -22
- package/es/Layout/paaslayout/Logo.js +13 -3
- package/es/Layout/paaslayout/SideMenu.js +78 -39
- package/es/Layout/paaslayout/index.js +102 -75
- package/es/Layout/storage.js +9 -10
- package/es/Layout/utils.js +136 -0
- package/es/LoadingButton/index.js +24 -15
- package/es/Modal/index.js +46 -38
- package/es/Page/Box.js +41 -34
- package/es/Page/index.js +67 -52
- package/es/Page/utils.js +5 -0
- package/es/QueryForm/Field/Checkbox.js +9 -5
- package/es/QueryForm/Field/Select.js +41 -31
- package/es/QueryForm/Field/SelectInput.js +41 -26
- package/es/QueryForm/Field/fieldsMap.js +1 -0
- package/es/QueryForm/Field/index.js +71 -41
- package/es/QueryForm/createActions.js +7 -6
- package/es/QueryForm/index.js +135 -76
- package/es/QueryListScene/List.js +128 -74
- package/es/QueryListScene/QueryForm.js +81 -46
- package/es/QueryListScene/QueryListScene.js +40 -25
- package/es/QueryListScene/Title.js +3 -3
- package/es/QueryListScene/Toolbar.js +12 -11
- package/es/Select/DropDownWrap.js +50 -29
- package/es/Select/index.js +231 -135
- package/es/Table/ResizableTable/index.js +40 -26
- package/es/Table/index.js +16 -18
- package/es/Title/index.js +23 -21
- package/es/locale.js +11 -3
- package/es/utils/checkAuth.js +5 -3
- package/es/utils/findMenuInfoByPath.js +4 -0
- package/es/utils/index.js +23 -12
- package/lib/ArrayInput/icon.js +6 -6
- package/lib/ArrayInput/index.js +127 -78
- package/lib/AuthContext.js +4 -1
- package/lib/Columns/index.js +47 -31
- package/lib/DevelopmentLogin/LoginModal.js +58 -32
- package/lib/DevelopmentLogin/index.js +27 -16
- package/lib/Ellipsis/Svg/CopySVG.js +15 -13
- package/lib/Ellipsis/Svg/TickSVG.js +10 -8
- package/lib/Ellipsis/index.js +80 -57
- package/lib/Handle/README.md +0 -20
- package/lib/Handle/index.js +119 -33
- package/lib/Icon/fonts/iconfont.js +12 -7
- package/lib/Icon/index.js +20 -11
- package/lib/Img/Contain.js +34 -24
- package/lib/Img/Cover.js +65 -42
- package/lib/Img/index.js +51 -36
- package/lib/Layout/ActionsContext.js +4 -1
- package/lib/Layout/AppList.js +118 -40
- package/lib/Layout/Application.js +86 -26
- package/lib/Layout/Avatar.js +86 -32
- package/lib/Layout/CompatibleLanguage.js +110 -39
- package/lib/Layout/EnterpriseLayout/Avatar.js +100 -41
- package/lib/Layout/EnterpriseLayout/Header.js +113 -0
- package/lib/Layout/EnterpriseLayout/HeaderActions.js +104 -0
- package/lib/Layout/EnterpriseLayout/Language.js +48 -17
- package/lib/Layout/EnterpriseLayout/Theme.js +44 -16
- package/lib/Layout/EnterpriseLayout/index.js +23 -14
- package/lib/Layout/GlobalNavigation/NavigationPopup.js +186 -59
- package/lib/Layout/GlobalNavigation/index.js +74 -23
- package/lib/Layout/Header.js +63 -28
- package/lib/Layout/HeaderActions.js +74 -45
- package/lib/Layout/HeaderNavs.js +61 -23
- package/lib/Layout/HeaderTabs.js +118 -51
- package/lib/Layout/Iconfont.js +5 -1
- package/lib/Layout/Language.js +48 -17
- package/lib/Layout/Layout.js +128 -88
- package/lib/Layout/Logo.js +43 -19
- package/lib/Layout/OrgAppList.js +127 -64
- package/lib/Layout/SideMenu.js +143 -65
- package/lib/Layout/Theme.js +73 -23
- package/lib/Layout/checkAuth.js +39 -0
- package/lib/Layout/createActions.js +5 -0
- package/lib/Layout/images/index.js +28 -0
- package/lib/Layout/index.js +55 -30
- package/lib/Layout/paaslayout/CompactSideMenu.js +84 -35
- package/lib/Layout/paaslayout/Header.js +55 -22
- package/lib/Layout/paaslayout/Logo.js +19 -3
- package/lib/Layout/paaslayout/SideMenu.js +87 -39
- package/lib/Layout/paaslayout/index.js +122 -77
- package/lib/Layout/storage.js +40 -11
- package/lib/Layout/utils.js +166 -0
- package/lib/LoadingButton/index.js +29 -15
- package/lib/Modal/index.js +53 -38
- package/lib/Page/Box.js +45 -34
- package/lib/Page/index.js +77 -52
- package/lib/Page/utils.js +9 -1
- package/lib/QueryForm/Field/Checkbox.js +13 -5
- package/lib/QueryForm/Field/Select.js +53 -33
- package/lib/QueryForm/Field/SelectInput.js +56 -28
- package/lib/QueryForm/Field/fieldsMap.js +15 -1
- package/lib/QueryForm/Field/index.js +81 -43
- package/lib/QueryForm/createActions.js +12 -6
- package/lib/QueryForm/index.js +157 -78
- package/lib/QueryForm/useForm.js +5 -0
- package/lib/QueryListScene/List.js +140 -76
- package/lib/QueryListScene/QueryForm.js +86 -46
- package/lib/QueryListScene/QueryListScene.js +46 -25
- package/lib/QueryListScene/Title.js +7 -3
- package/lib/QueryListScene/Toolbar.js +16 -11
- package/lib/QueryListScene/createActions.js +5 -0
- package/lib/QueryListScene/index.js +10 -0
- package/lib/QueryListScene/useActions.js +5 -0
- package/lib/Select/DropDownWrap.js +56 -31
- package/lib/Select/index.js +241 -135
- package/lib/Table/ResizableTable/index.js +48 -26
- package/lib/Table/index.js +28 -17
- package/lib/Title/index.js +28 -21
- package/lib/index.js +56 -35
- package/lib/locale.js +19 -4
- package/lib/utils/checkAuth.js +9 -4
- package/lib/utils/findMenuInfoByPath.js +8 -1
- package/lib/utils/index.js +42 -15
- package/package.json +2 -2
package/es/Layout/index.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
var
|
|
2
|
-
|
|
1
|
+
function _extends() { _extends = Object.assign || 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); }
|
|
2
|
+
|
|
3
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; }
|
|
4
|
+
|
|
4
5
|
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; }
|
|
6
|
+
|
|
5
7
|
import { ThemeProvider } from 'styled-components';
|
|
6
8
|
import Layout from './Layout';
|
|
7
9
|
import EnterpriseLayout from './EnterpriseLayout';
|
|
@@ -14,15 +16,17 @@ import ActionsContext from './ActionsContext';
|
|
|
14
16
|
import createActions from './createActions';
|
|
15
17
|
import { getLanguageStore } from './storage';
|
|
16
18
|
export var HeaderActionItem = function HeaderActionItem(props) {
|
|
17
|
-
return
|
|
19
|
+
return React.createElement("li", props, props.children);
|
|
18
20
|
};
|
|
19
21
|
export * from './HeaderNavs';
|
|
22
|
+
|
|
20
23
|
var TNTLayout = function TNTLayout(_ref) {
|
|
21
24
|
var type = _ref.type,
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
25
|
+
config = _ref.config,
|
|
26
|
+
_ref$showMenuInIframe = _ref.showMenuInIframe,
|
|
27
|
+
showMenuInIframe = _ref$showMenuInIframe === void 0 ? false : _ref$showMenuInIframe,
|
|
28
|
+
props = _objectWithoutProperties(_ref, ["type", "config", "showMenuInIframe"]);
|
|
29
|
+
|
|
26
30
|
var headerHeight = props.size === 'large' ? 60 : 50;
|
|
27
31
|
var theme = {
|
|
28
32
|
size: props.size,
|
|
@@ -42,32 +46,35 @@ var TNTLayout = function TNTLayout(_ref) {
|
|
|
42
46
|
dividerColor: '#E1E6EE',
|
|
43
47
|
lightBgColor: '#F1F2F5',
|
|
44
48
|
blueBgColor: '#1D4295' // 默认的蓝色主题
|
|
49
|
+
|
|
45
50
|
};
|
|
51
|
+
var isInIframe = showMenuInIframe ? false : self !== top && !window.navigator.userAgent.includes('mo-fang-app'); // 前期拼写错误,导致需要兼容处理
|
|
46
52
|
|
|
47
|
-
var isInIframe = showMenuInIframe ? false : self !== top && !window.navigator.userAgent.includes('mo-fang-app');
|
|
48
|
-
// 前期拼写错误,导致需要兼容处理
|
|
49
53
|
var extraHeaderActions = props.extraHeaderActions || props.extralHeaderActions;
|
|
50
54
|
var extendMap = typeof props.extendMap === 'string' ? safeParseJSON(props.extendMap, {}) : props.extendMap;
|
|
55
|
+
|
|
51
56
|
var _ref2 = extendMap || {},
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
57
|
+
_ref2$displayType = _ref2.displayType,
|
|
58
|
+
displayType = _ref2$displayType === void 0 ? 'default' : _ref2$displayType,
|
|
59
|
+
menuAlignMode = _ref2.menuAlignMode,
|
|
60
|
+
_ref2$globalNavigatio = _ref2.globalNavigation,
|
|
61
|
+
globalNavigation = _ref2$globalNavigatio === void 0 ? false : _ref2$globalNavigatio,
|
|
62
|
+
_ref2$language = _ref2.language,
|
|
63
|
+
language = _ref2$language === void 0 ? ['cn'] : _ref2$language,
|
|
64
|
+
_ref2$themeSwitch = _ref2.themeSwitch,
|
|
65
|
+
themeSwitch = _ref2$themeSwitch === void 0 ? true : _ref2$themeSwitch;
|
|
66
|
+
|
|
61
67
|
var userInfo = props.userInfo || {};
|
|
62
68
|
var actionsContextValue = createActions({
|
|
63
69
|
language: getLanguageStore() || userInfo.lang || 'cn'
|
|
64
70
|
});
|
|
71
|
+
|
|
65
72
|
var onLanguageChange = function onLanguageChange(language) {
|
|
66
73
|
actionsContextValue.setLanguage(language);
|
|
67
74
|
props.onLanguageChange && props.onLanguageChange(language);
|
|
68
|
-
};
|
|
75
|
+
}; // layout上的指定的属性优先级会高于extendMap中的属性
|
|
76
|
+
|
|
69
77
|
|
|
70
|
-
// layout上的指定的属性优先级会高于extendMap中的属性
|
|
71
78
|
type = type || displayType;
|
|
72
79
|
config = Object.assign({
|
|
73
80
|
language: (language == null ? void 0 : language.length) > 1,
|
|
@@ -75,13 +82,13 @@ var TNTLayout = function TNTLayout(_ref) {
|
|
|
75
82
|
avatar: true,
|
|
76
83
|
globalNavigation: globalNavigation
|
|
77
84
|
}, config);
|
|
78
|
-
return
|
|
85
|
+
return React.createElement(ThemeProvider, {
|
|
79
86
|
theme: theme
|
|
80
|
-
},
|
|
87
|
+
}, React.createElement(AuthContext.Provider, {
|
|
81
88
|
value: getCheckAuth(props.menus)
|
|
82
|
-
},
|
|
89
|
+
}, React.createElement(ActionsContext.Provider, {
|
|
83
90
|
value: actionsContextValue
|
|
84
|
-
}, type === 'paas' &&
|
|
91
|
+
}, type === 'paas' && React.createElement(PaasLayout, _extends({
|
|
85
92
|
menuAlignMode: menuAlignMode,
|
|
86
93
|
config: config
|
|
87
94
|
}, props, {
|
|
@@ -89,7 +96,7 @@ var TNTLayout = function TNTLayout(_ref) {
|
|
|
89
96
|
isInIframe: isInIframe,
|
|
90
97
|
userInfo: userInfo,
|
|
91
98
|
onLanguageChange: onLanguageChange
|
|
92
|
-
})), type === 'enterprise' &&
|
|
99
|
+
})), type === 'enterprise' && React.createElement(EnterpriseLayout, _extends({
|
|
93
100
|
menuAlignMode: menuAlignMode,
|
|
94
101
|
config: config
|
|
95
102
|
}, props, {
|
|
@@ -98,7 +105,7 @@ var TNTLayout = function TNTLayout(_ref) {
|
|
|
98
105
|
userInfo: userInfo,
|
|
99
106
|
onLanguageChange: onLanguageChange,
|
|
100
107
|
type: type
|
|
101
|
-
})), (!type || !['paas', 'enterprise'].includes(type)) &&
|
|
108
|
+
})), (!type || !['paas', 'enterprise'].includes(type)) && React.createElement(Layout, _extends({
|
|
102
109
|
menuAlignMode: menuAlignMode,
|
|
103
110
|
config: config
|
|
104
111
|
}, props, {
|
|
@@ -108,6 +115,7 @@ var TNTLayout = function TNTLayout(_ref) {
|
|
|
108
115
|
onLanguageChange: onLanguageChange
|
|
109
116
|
})))));
|
|
110
117
|
};
|
|
118
|
+
|
|
111
119
|
TNTLayout.HeaderActionItem = HeaderActionItem;
|
|
112
120
|
TNTLayout.HeaderNavs = HeaderNavs;
|
|
113
121
|
TNTLayout.HeaderTabs = HeaderTabs;
|
|
@@ -1,48 +1,79 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance
|
|
4
|
-
|
|
5
|
-
function
|
|
6
|
-
|
|
1
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }
|
|
2
|
+
|
|
3
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); }
|
|
4
|
+
|
|
5
|
+
function _iterableToArrayLimit(arr, i) { if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) { return; } var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
6
|
+
|
|
7
7
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
8
|
+
|
|
9
|
+
function _templateObject2() {
|
|
10
|
+
var data = _taggedTemplateLiteral(["\n background: #fff;\n list-style: none;\n font-size: 14px;\n color: #17233D;\n margin: 10px 0 0;\n padding: 0;\n li {\n position: relative;\n line-height: 38px;\n cursor: pointer;\n padding-left: 20px;\n & > a {\n color: #17233D;\n & > span {\n padding-left: 10px;\n }\n }\n &.active {\n background: #EAEDF8;\n &:before {\n position: absolute;\n left: 0;\n top: 0;\n content: '';\n width: 4px;\n height: 100%;\n background-color: #4C79FF;\n }\n }\n }\n"]);
|
|
11
|
+
|
|
12
|
+
_templateObject2 = function _templateObject2() {
|
|
13
|
+
return data;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
return data;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function _templateObject() {
|
|
20
|
+
var data = _taggedTemplateLiteral(["\n background: #fff;\n list-style: none;\n margin: 0;\n padding: 30px 0 20px;\n text-rendering: optimizeLegibility;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n .isInIframe & {\n display: none;\n }\n \n & > li {\n position: relative;\n cursor: pointer;\n line-height: 38px;\n font-size: 14px;\n color: #17233D;\n letter-spacing: 0;\n\n &.group-menu-item {\n & > span {\n opacity: 0.4;\n }\n }\n\n &.active {\n &:before {\n position: absolute;\n content: \"\";\n left: 0;\n top: 0;\n width: 3px;\n height: 100%;\n background: #126bfb;\n }\n\n span {\n background: rgba(18,107,251,0.10);\n color: #126bfb;\n opacity: 1;\n }\n }\n\n & > span {\n display: inline-block;\n width: 100%;\n color: #17233D;\n padding-left: 20px;\n\n &:hover {\n color: #323232;\n background: #f5f5f5;\n }\n\n & > .tnt-icon {\n margin-right: 7px;\n }\n }\n }\n"]);
|
|
21
|
+
|
|
22
|
+
_templateObject = function _templateObject() {
|
|
23
|
+
return data;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
return data;
|
|
27
|
+
}
|
|
28
|
+
|
|
8
29
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
30
|
+
|
|
9
31
|
import { useState, useEffect, Component } from 'react';
|
|
10
32
|
import styled from 'styled-components';
|
|
11
33
|
import cn from 'classnames';
|
|
12
34
|
import { isNewTabMenu, openInNewTab } from '../../utils';
|
|
13
35
|
import Iconfont from '../Iconfont';
|
|
14
|
-
var SideMenu = styled.ul(_templateObject
|
|
15
|
-
var SubMenu = styled.ul(_templateObject2
|
|
36
|
+
var SideMenu = styled.ul(_templateObject());
|
|
37
|
+
var SubMenu = styled.ul(_templateObject2());
|
|
16
38
|
export default (function (props) {
|
|
17
39
|
var language = props.language,
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
40
|
+
_props$menus = props.menus,
|
|
41
|
+
menus = _props$menus === void 0 ? [] : _props$menus,
|
|
42
|
+
formatMenuPath = props.formatMenuPath,
|
|
43
|
+
selectedKey = props.selectedKey,
|
|
44
|
+
onBeforeChange = props.onBeforeChange,
|
|
45
|
+
onChange = props.onChange,
|
|
46
|
+
onSelect = props.onSelect;
|
|
47
|
+
|
|
25
48
|
var _useState = useState(selectedKey),
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
49
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
50
|
+
activeMenu = _useState2[0],
|
|
51
|
+
setActiveMenu = _useState2[1];
|
|
52
|
+
|
|
29
53
|
var defaultBeforeChange = function defaultBeforeChange(_ref) {
|
|
30
54
|
var data = _ref.data;
|
|
31
55
|
return !isNewTabMenu(data);
|
|
32
56
|
};
|
|
57
|
+
|
|
33
58
|
var defaultSelect = function defaultSelect(_ref2) {
|
|
34
59
|
var _window$location$path;
|
|
60
|
+
|
|
35
61
|
var data = _ref2.data;
|
|
62
|
+
|
|
36
63
|
var _ref3 = data || {},
|
|
37
|
-
|
|
64
|
+
path = _ref3.path;
|
|
65
|
+
|
|
38
66
|
var formatPath = formatMenuPath || function (path) {
|
|
39
67
|
return path;
|
|
40
68
|
};
|
|
69
|
+
|
|
41
70
|
if (isNewTabMenu(data)) {
|
|
42
71
|
openInNewTab(formatPath(data == null ? void 0 : data.path, data));
|
|
43
72
|
return;
|
|
44
73
|
}
|
|
74
|
+
|
|
45
75
|
var routerPrefix = (_window$location$path = window.location.pathname.match(/(^\/[^\/]+)/i)) == null ? void 0 : _window$location$path[1];
|
|
76
|
+
|
|
46
77
|
if (window.location.pathname.startsWith(routerPrefix)) {
|
|
47
78
|
var forwardPath = formatPath(path, data);
|
|
48
79
|
changeRouter ? changeRouter(forwardPath, data) : window.history.pushState(data, data == null ? void 0 : data.name, forwardPath);
|
|
@@ -50,32 +81,37 @@ export default (function (props) {
|
|
|
50
81
|
window.location.href = formatPath(path, data);
|
|
51
82
|
}
|
|
52
83
|
};
|
|
84
|
+
|
|
53
85
|
var selectMenu = function selectMenu() {
|
|
54
86
|
var param = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
55
87
|
var finalBeforeChange = onBeforeChange || defaultBeforeChange;
|
|
56
88
|
var finalSelect = onSelect || defaultSelect;
|
|
89
|
+
|
|
57
90
|
if (param.key !== activeMenu) {
|
|
58
91
|
if (finalBeforeChange(param, activeMenu)) {
|
|
59
92
|
setActiveMenu(param.key);
|
|
60
93
|
onChange && onChange(param);
|
|
61
94
|
}
|
|
62
95
|
}
|
|
96
|
+
|
|
63
97
|
finalSelect(param);
|
|
64
98
|
};
|
|
99
|
+
|
|
65
100
|
var MenuItem = function MenuItem(_ref4) {
|
|
66
101
|
var item = _ref4.item;
|
|
67
102
|
var code = item.code,
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
103
|
+
groupName = item.groupName,
|
|
104
|
+
enName = item.enName,
|
|
105
|
+
_item$children = item.children,
|
|
106
|
+
children = _item$children === void 0 ? [] : _item$children;
|
|
107
|
+
|
|
72
108
|
var SubMenuItem = function SubMenuItem(_ref5) {
|
|
73
109
|
var menu = _ref5.menu;
|
|
74
110
|
var code = menu.code,
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
return
|
|
111
|
+
menuName = menu.menuName,
|
|
112
|
+
enName = menu.enName,
|
|
113
|
+
icon = menu.icon;
|
|
114
|
+
return React.createElement("li", {
|
|
79
115
|
key: code,
|
|
80
116
|
onClick: function onClick(evt) {
|
|
81
117
|
return selectMenu({
|
|
@@ -87,40 +123,43 @@ export default (function (props) {
|
|
|
87
123
|
className: cn({
|
|
88
124
|
active: code === activeMenu
|
|
89
125
|
})
|
|
90
|
-
},
|
|
126
|
+
}, React.createElement("span", null, typeof (icon || '') === 'string' ? React.createElement(Iconfont, {
|
|
91
127
|
type: icon
|
|
92
128
|
}) : icon, {
|
|
93
129
|
cn: menuName,
|
|
94
130
|
en: enName
|
|
95
131
|
}[language]));
|
|
96
132
|
};
|
|
133
|
+
|
|
97
134
|
if (groupName && children.length) {
|
|
98
|
-
return
|
|
135
|
+
return React.createElement("li", {
|
|
99
136
|
key: code,
|
|
100
137
|
className: "group-menu-item"
|
|
101
|
-
},
|
|
138
|
+
}, React.createElement("span", null, icon instanceof Component ? icon : React.createElement(Iconfont, {
|
|
102
139
|
type: icon
|
|
103
140
|
}), {
|
|
104
141
|
cn: groupName,
|
|
105
142
|
en: enName
|
|
106
|
-
}[language]),
|
|
107
|
-
return
|
|
143
|
+
}[language]), React.createElement(SubMenu, null, children.map(function (subItem) {
|
|
144
|
+
return React.createElement(SubMenuItem, {
|
|
108
145
|
menu: subItem,
|
|
109
146
|
key: subItem == null ? void 0 : subItem.code
|
|
110
147
|
});
|
|
111
148
|
})));
|
|
112
149
|
}
|
|
113
|
-
|
|
150
|
+
|
|
151
|
+
return React.createElement(SubMenuItem, {
|
|
114
152
|
menu: item
|
|
115
153
|
});
|
|
116
154
|
};
|
|
155
|
+
|
|
117
156
|
useEffect(function () {
|
|
118
157
|
setActiveMenu(selectedKey);
|
|
119
158
|
}, [selectedKey]);
|
|
120
|
-
return
|
|
159
|
+
return React.createElement(SideMenu, {
|
|
121
160
|
className: "tnt-compact-sidemenu"
|
|
122
161
|
}, menus.map(function (menu) {
|
|
123
|
-
return
|
|
162
|
+
return React.createElement(MenuItem, {
|
|
124
163
|
item: menu,
|
|
125
164
|
key: menu.code
|
|
126
165
|
});
|
|
@@ -1,12 +1,33 @@
|
|
|
1
|
-
function
|
|
2
|
-
|
|
3
|
-
function
|
|
4
|
-
|
|
5
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source =
|
|
6
|
-
|
|
7
|
-
function
|
|
8
|
-
|
|
1
|
+
function _extends() { _extends = Object.assign || 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); }
|
|
2
|
+
|
|
3
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
4
|
+
|
|
5
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
6
|
+
|
|
7
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
8
|
+
|
|
9
|
+
function _templateObject2() {
|
|
10
|
+
var data = _taggedTemplateLiteral(["\n flex: 1;\n .isInIframe & {\n display: none;\n }\n"]);
|
|
11
|
+
|
|
12
|
+
_templateObject2 = function _templateObject2() {
|
|
13
|
+
return data;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
return data;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function _templateObject() {
|
|
20
|
+
var data = _taggedTemplateLiteral(["\n position: sticky;\n top: 0;\n height: ", ";\n display: flex;\n color: #fff;\n background: #fff;\n z-index: 201;\n .isInIframe.noAppList &,\n .isEmptyLayout & {\n display: none;\n }\n .tnt-themeS1 & {\n background: #323b4a;\n }\n padding-right: 20px;\n box-shadow: 0 1px 10px 0 rgba(0,0,0,0.1);\n transition: box-shadow .2s cubic-bezier(.4,0,.2,1), -webkit-box-shadow .2s cubic-bezier(.4,0,.2,1);\n\n .paas-header-actions {\n li {\n .tnt-themeS1 & {\n color: rgba(255,255,255,.85);\n }\n }\n }\n"]);
|
|
21
|
+
|
|
22
|
+
_templateObject = function _templateObject() {
|
|
23
|
+
return data;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
return data;
|
|
27
|
+
}
|
|
28
|
+
|
|
9
29
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
30
|
+
|
|
10
31
|
/**
|
|
11
32
|
* @file Layout header
|
|
12
33
|
* @author zhangyou
|
|
@@ -16,37 +37,39 @@ import styled from 'styled-components';
|
|
|
16
37
|
import Actions from '../HeaderActions';
|
|
17
38
|
import AppList from '../AppList';
|
|
18
39
|
import Logo from './Logo';
|
|
19
|
-
var Header = styled.div(_templateObject
|
|
40
|
+
var Header = styled.div(_templateObject(), function (props) {
|
|
20
41
|
return "".concat(props.theme.headerHeight, "px");
|
|
21
42
|
});
|
|
22
|
-
var Content = styled.div(_templateObject2
|
|
43
|
+
var Content = styled.div(_templateObject2());
|
|
23
44
|
export default (function (props) {
|
|
24
45
|
var logo = props.logo,
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
46
|
+
name = props.name,
|
|
47
|
+
enName = props.enName,
|
|
48
|
+
language = props.language,
|
|
49
|
+
selectedAppKey = props.selectedAppKey,
|
|
50
|
+
appList = props.appList,
|
|
51
|
+
onLogoClick = props.onLogoClick,
|
|
52
|
+
onAppChange = props.onAppChange,
|
|
53
|
+
extraActions = props.extraActions;
|
|
54
|
+
|
|
33
55
|
var config = _objectSpread({
|
|
34
56
|
application: true
|
|
35
57
|
}, props.config);
|
|
58
|
+
|
|
36
59
|
var headerRef = useRef();
|
|
37
|
-
return
|
|
60
|
+
return React.createElement(Header, {
|
|
38
61
|
ref: headerRef
|
|
39
|
-
},
|
|
62
|
+
}, React.createElement(Logo, {
|
|
40
63
|
language: language,
|
|
41
64
|
logo: logo,
|
|
42
65
|
name: name,
|
|
43
66
|
enName: enName,
|
|
44
67
|
onClick: onLogoClick
|
|
45
|
-
}), appList &&
|
|
68
|
+
}), appList && React.createElement(AppList, {
|
|
46
69
|
items: appList,
|
|
47
70
|
selectedKey: selectedAppKey,
|
|
48
71
|
onChange: onAppChange
|
|
49
|
-
}),
|
|
72
|
+
}), React.createElement(Content, null, props.children), React.createElement(Actions, _extends({}, props, {
|
|
50
73
|
config: config,
|
|
51
74
|
headerRef: headerRef,
|
|
52
75
|
className: "paas-header-actions"
|
|
@@ -1,12 +1,22 @@
|
|
|
1
|
-
|
|
1
|
+
function _templateObject() {
|
|
2
|
+
var data = _taggedTemplateLiteral(["\n color: #17233d !important;\n letter-spacing: 0;\n background: #fff !important;\n box-shadow: none !important;\n .isInIframe & {\n display: none;\n }\n\n &:after {\n display: none;\n }\n\n .tnt-themeS1 & {\n color: rgba(255,255,255,.85) !important;\n background: #323b4a !important;\n }\n"]);
|
|
3
|
+
|
|
4
|
+
_templateObject = function _templateObject() {
|
|
5
|
+
return data;
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
return data;
|
|
9
|
+
}
|
|
10
|
+
|
|
2
11
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
12
|
+
|
|
3
13
|
/**
|
|
4
14
|
* @file Logo
|
|
5
15
|
* @author zhangyou
|
|
6
16
|
*/
|
|
7
17
|
import styled from 'styled-components';
|
|
8
18
|
import Logo from '../Logo';
|
|
9
|
-
var LogoWrapper = styled(Logo)(_templateObject
|
|
19
|
+
var LogoWrapper = styled(Logo)(_templateObject());
|
|
10
20
|
export default (function (props) {
|
|
11
|
-
return
|
|
21
|
+
return React.createElement(LogoWrapper, props);
|
|
12
22
|
});
|