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