tntd 1.4.32 → 1.4.33-beta.1
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/Ellipsis/index.js +47 -15
- package/components/QueryListScene/QueryForm.js +4 -4
- package/components/QueryListScene/createActions.js +4 -4
- package/dist/1.tntd.js +1 -1
- package/dist/stats.json +24089 -23289
- package/dist/tntd.css +1 -1
- package/dist/tntd.js +7 -10
- package/es/ArrayInput/icon.js +5 -5
- package/es/ArrayInput/index.js +79 -111
- package/es/AuthContext.js +1 -1
- package/es/Columns/index.js +33 -40
- package/es/DevelopmentLogin/LoginModal.js +33 -46
- package/es/DevelopmentLogin/index.js +14 -18
- package/es/Ellipsis/Svg/CopySVG.js +13 -13
- package/es/Ellipsis/Svg/TickSVG.js +8 -8
- package/es/Ellipsis/index.js +100 -79
- package/es/Handle/index.js +46 -64
- package/es/Icon/fonts/iconfont.js +7 -12
- package/es/Icon/index.js +12 -15
- package/es/Img/Contain.js +26 -31
- package/es/Img/Cover.js +43 -57
- package/es/Img/index.js +39 -48
- package/es/Layout/ActionsContext.js +3 -2
- package/es/Layout/AppList.js +39 -94
- package/es/Layout/Application.js +28 -74
- package/es/Layout/Avatar.js +30 -67
- package/es/Layout/CompatibleLanguage.js +41 -96
- package/es/Layout/EnterpriseLayout/Avatar.js +39 -77
- package/es/Layout/EnterpriseLayout/Language.js +16 -34
- package/es/Layout/EnterpriseLayout/Theme.js +18 -36
- package/es/Layout/EnterpriseLayout/index.js +14 -16
- package/es/Layout/GlobalNavigation/NavigationPopup.js +61 -172
- package/es/Layout/GlobalNavigation/index.js +22 -56
- package/es/Layout/Header.js +26 -47
- package/es/Layout/HeaderActions.js +45 -59
- package/es/Layout/HeaderNavs.js +24 -51
- package/es/Layout/HeaderTabs.js +53 -106
- package/es/Layout/Iconfont.js +1 -1
- package/es/Layout/Language.js +16 -34
- package/es/Layout/Layout.js +88 -110
- package/es/Layout/Logo.js +17 -33
- package/es/Layout/OrgAppList.js +64 -109
- package/es/Layout/SideMenu.js +67 -128
- package/es/Layout/Theme.js +25 -63
- package/es/Layout/index.js +28 -37
- package/es/Layout/paaslayout/CompactSideMenu.js +37 -76
- package/es/Layout/paaslayout/Header.js +23 -46
- package/es/Layout/paaslayout/Logo.js +4 -14
- package/es/Layout/paaslayout/SideMenu.js +41 -80
- package/es/Layout/paaslayout/index.js +77 -104
- package/es/Layout/storage.js +10 -9
- package/es/LoadingButton/index.js +18 -27
- package/es/Modal/index.js +42 -51
- package/es/Page/Box.js +36 -43
- package/es/Page/index.js +56 -71
- package/es/Page/utils.js +0 -5
- package/es/QueryForm/Field/Checkbox.js +7 -11
- package/es/QueryForm/Field/Select.js +34 -44
- package/es/QueryForm/Field/SelectInput.js +31 -46
- package/es/QueryForm/Field/fieldsMap.js +0 -1
- package/es/QueryForm/Field/index.js +46 -78
- package/es/QueryForm/createActions.js +6 -7
- package/es/QueryForm/index.js +79 -140
- package/es/QueryListScene/List.js +83 -139
- package/es/QueryListScene/QueryForm.js +54 -91
- package/es/QueryListScene/QueryListScene.js +29 -47
- package/es/QueryListScene/Title.js +3 -3
- package/es/QueryListScene/Toolbar.js +13 -14
- package/es/QueryListScene/createActions.js +4 -4
- package/es/Select/DropDownWrap.js +32 -55
- package/es/Select/index.js +140 -232
- package/es/Table/ResizableTable/index.js +29 -43
- package/es/Table/index.js +20 -19
- package/es/Title/index.js +23 -25
- package/es/locale.js +1 -5
- package/es/utils/checkAuth.js +6 -8
- package/es/utils/findMenuInfoByPath.js +0 -4
- package/es/utils/index.js +17 -27
- package/lib/ArrayInput/icon.js +7 -9
- package/lib/ArrayInput/index.js +82 -131
- package/lib/AuthContext.js +2 -6
- package/lib/Columns/index.js +36 -54
- package/lib/DevelopmentLogin/LoginModal.js +36 -63
- package/lib/DevelopmentLogin/index.js +21 -31
- package/lib/Ellipsis/Svg/CopySVG.js +15 -18
- package/lib/Ellipsis/Svg/TickSVG.js +10 -13
- package/lib/Ellipsis/index.js +105 -93
- package/lib/Handle/index.js +51 -87
- package/lib/Icon/fonts/iconfont.js +7 -12
- package/lib/Icon/iconList.js +1 -2
- package/lib/Icon/index.js +16 -26
- package/lib/Img/Contain.js +29 -40
- package/lib/Img/Cover.js +48 -72
- package/lib/Img/index.js +42 -58
- package/lib/Layout/ActionsContext.js +1 -5
- package/lib/Layout/AppList.js +45 -124
- package/lib/Layout/Application.js +31 -92
- package/lib/Layout/Avatar.js +36 -91
- package/lib/Layout/CompatibleLanguage.js +44 -116
- package/lib/Layout/EnterpriseLayout/Avatar.js +45 -105
- package/lib/Layout/EnterpriseLayout/Language.js +22 -54
- package/lib/Layout/EnterpriseLayout/Theme.js +21 -50
- package/lib/Layout/EnterpriseLayout/index.js +17 -27
- package/lib/Layout/GlobalNavigation/NavigationPopup.js +64 -192
- package/lib/Layout/GlobalNavigation/index.js +28 -80
- package/lib/Layout/Header.js +36 -68
- package/lib/Layout/HeaderActions.js +51 -81
- package/lib/Layout/HeaderNavs.js +30 -70
- package/lib/Layout/HeaderTabs.js +58 -127
- package/lib/Layout/Iconfont.js +4 -9
- package/lib/Layout/Language.js +22 -54
- package/lib/Layout/Layout.js +93 -134
- package/lib/Layout/Logo.js +26 -47
- package/lib/Layout/OrgAppList.js +69 -133
- package/lib/Layout/SideMenu.js +72 -151
- package/lib/Layout/Theme.js +28 -79
- package/lib/Layout/createActions.js +3 -9
- package/lib/Layout/images/index.js +5 -36
- package/lib/Layout/index.js +35 -63
- package/lib/Layout/paaslayout/CompactSideMenu.js +40 -90
- package/lib/Layout/paaslayout/Header.js +30 -60
- package/lib/Layout/paaslayout/Logo.js +11 -24
- package/lib/Layout/paaslayout/SideMenu.js +44 -93
- package/lib/Layout/paaslayout/index.js +82 -128
- package/lib/Layout/storage.js +26 -68
- package/lib/LoadingButton/index.js +21 -36
- package/lib/Modal/index.js +45 -62
- package/lib/Page/Box.js +38 -50
- package/lib/Page/index.js +58 -84
- package/lib/Page/utils.js +5 -16
- package/lib/QueryForm/Field/Checkbox.js +10 -19
- package/lib/QueryForm/Field/Select.js +39 -60
- package/lib/QueryForm/Field/SelectInput.js +36 -65
- package/lib/QueryForm/Field/fieldsMap.js +6 -23
- package/lib/QueryForm/Field/index.js +50 -91
- package/lib/QueryForm/createActions.js +9 -16
- package/lib/QueryForm/index.js +83 -165
- package/lib/QueryForm/useForm.js +1 -6
- package/lib/QueryListScene/List.js +89 -153
- package/lib/QueryListScene/QueryForm.js +58 -101
- package/lib/QueryListScene/QueryListScene.js +31 -56
- package/lib/QueryListScene/Title.js +6 -11
- package/lib/QueryListScene/Toolbar.js +16 -22
- package/lib/QueryListScene/createActions.js +7 -13
- package/lib/QueryListScene/index.js +5 -19
- package/lib/QueryListScene/useActions.js +1 -6
- package/lib/Select/DropDownWrap.js +35 -63
- package/lib/Select/index.js +142 -245
- package/lib/Table/ResizableTable/index.js +31 -54
- package/lib/Table/index.js +21 -34
- package/lib/Title/index.js +26 -34
- package/lib/index.js +36 -57
- package/lib/locale.js +9 -25
- package/lib/utils/checkAuth.js +9 -16
- package/lib/utils/findMenuInfoByPath.js +3 -12
- package/lib/utils/index.js +26 -60
- package/package.json +3 -2
package/es/Layout/index.js
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
function _objectWithoutProperties(
|
|
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
|
-
|
|
1
|
+
var _excluded = ["type", "config", "showMenuInIframe"];
|
|
2
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
3
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
4
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
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,31 @@ 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
|
+
var isInIframe = showMenuInIframe ? false : self !== top && !window.navigator.userAgent.includes('mo-fang-app');
|
|
47
|
+
// 前期拼写错误,导致需要兼容处理
|
|
53
48
|
var extraHeaderActions = props.extraHeaderActions || props.extralHeaderActions;
|
|
54
49
|
var extendMap = typeof props.extendMap === 'string' ? safeParseJSON(props.extendMap, {}) : props.extendMap;
|
|
55
|
-
|
|
56
50
|
var _ref2 = extendMap || {},
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
51
|
+
_ref2$displayType = _ref2.displayType,
|
|
52
|
+
displayType = _ref2$displayType === void 0 ? 'default' : _ref2$displayType,
|
|
53
|
+
menuAlignMode = _ref2.menuAlignMode,
|
|
54
|
+
_ref2$globalNavigatio = _ref2.globalNavigation,
|
|
55
|
+
globalNavigation = _ref2$globalNavigatio === void 0 ? false : _ref2$globalNavigatio,
|
|
56
|
+
_ref2$language = _ref2.language,
|
|
57
|
+
language = _ref2$language === void 0 ? ['cn'] : _ref2$language,
|
|
58
|
+
_ref2$themeSwitch = _ref2.themeSwitch,
|
|
59
|
+
themeSwitch = _ref2$themeSwitch === void 0 ? true : _ref2$themeSwitch;
|
|
67
60
|
var userInfo = props.userInfo || {};
|
|
68
61
|
var actionsContextValue = createActions({
|
|
69
62
|
language: getLanguageStore() || userInfo.lang || 'cn'
|
|
70
63
|
});
|
|
71
|
-
|
|
72
64
|
var onLanguageChange = function onLanguageChange(language) {
|
|
73
65
|
actionsContextValue.setLanguage(language);
|
|
74
66
|
props.onLanguageChange && props.onLanguageChange(language);
|
|
75
|
-
};
|
|
76
|
-
|
|
67
|
+
};
|
|
77
68
|
|
|
69
|
+
// layout上的指定的属性优先级会高于extendMap中的属性
|
|
78
70
|
type = type || displayType;
|
|
79
71
|
config = Object.assign({
|
|
80
72
|
language: (language == null ? void 0 : language.length) > 1,
|
|
@@ -82,13 +74,13 @@ var TNTLayout = function TNTLayout(_ref) {
|
|
|
82
74
|
avatar: true,
|
|
83
75
|
globalNavigation: globalNavigation
|
|
84
76
|
}, config);
|
|
85
|
-
return React.createElement(ThemeProvider, {
|
|
77
|
+
return /*#__PURE__*/React.createElement(ThemeProvider, {
|
|
86
78
|
theme: theme
|
|
87
|
-
}, React.createElement(AuthContext.Provider, {
|
|
79
|
+
}, /*#__PURE__*/React.createElement(AuthContext.Provider, {
|
|
88
80
|
value: getCheckAuth(props.menus)
|
|
89
|
-
}, React.createElement(ActionsContext.Provider, {
|
|
81
|
+
}, /*#__PURE__*/React.createElement(ActionsContext.Provider, {
|
|
90
82
|
value: actionsContextValue
|
|
91
|
-
}, type === 'paas' && React.createElement(PaasLayout, _extends({
|
|
83
|
+
}, type === 'paas' && /*#__PURE__*/React.createElement(PaasLayout, _extends({
|
|
92
84
|
menuAlignMode: menuAlignMode,
|
|
93
85
|
config: config
|
|
94
86
|
}, props, {
|
|
@@ -96,7 +88,7 @@ var TNTLayout = function TNTLayout(_ref) {
|
|
|
96
88
|
isInIframe: isInIframe,
|
|
97
89
|
userInfo: userInfo,
|
|
98
90
|
onLanguageChange: onLanguageChange
|
|
99
|
-
})), type === 'enterprise' && React.createElement(EnterpriseLayout, _extends({
|
|
91
|
+
})), type === 'enterprise' && /*#__PURE__*/React.createElement(EnterpriseLayout, _extends({
|
|
100
92
|
menuAlignMode: menuAlignMode,
|
|
101
93
|
config: config
|
|
102
94
|
}, props, {
|
|
@@ -105,7 +97,7 @@ var TNTLayout = function TNTLayout(_ref) {
|
|
|
105
97
|
userInfo: userInfo,
|
|
106
98
|
onLanguageChange: onLanguageChange,
|
|
107
99
|
type: type
|
|
108
|
-
})), (!type || !['paas', 'enterprise'].includes(type)) && React.createElement(Layout, _extends({
|
|
100
|
+
})), (!type || !['paas', 'enterprise'].includes(type)) && /*#__PURE__*/React.createElement(Layout, _extends({
|
|
109
101
|
menuAlignMode: menuAlignMode,
|
|
110
102
|
config: config
|
|
111
103
|
}, props, {
|
|
@@ -115,7 +107,6 @@ var TNTLayout = function TNTLayout(_ref) {
|
|
|
115
107
|
onLanguageChange: onLanguageChange
|
|
116
108
|
})))));
|
|
117
109
|
};
|
|
118
|
-
|
|
119
110
|
TNTLayout.HeaderActionItem = HeaderActionItem;
|
|
120
111
|
TNTLayout.HeaderNavs = HeaderNavs;
|
|
121
112
|
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
|
-
|
|
7
|
-
function _arrayWithHoles(
|
|
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
|
-
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
30
|
-
|
|
1
|
+
var _templateObject, _templateObject2;
|
|
2
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _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(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
5
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
6
|
+
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; } }
|
|
7
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
8
|
+
function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
|
|
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(
|
|
6
|
-
|
|
7
|
-
function
|
|
8
|
-
|
|
9
|
-
function
|
|
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
|
-
|
|
29
|
-
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
30
|
-
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
var _templateObject, _templateObject2;
|
|
3
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
4
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
5
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
6
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
7
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
8
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
9
|
+
function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
|
|
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
|
-
|
|
3
|
-
|
|
4
|
-
_templateObject = function _templateObject() {
|
|
5
|
-
return data;
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
return data;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
12
|
-
|
|
1
|
+
var _templateObject;
|
|
2
|
+
function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
|
|
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
|
});
|