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/Header.js
CHANGED
|
@@ -1,6 +1,27 @@
|
|
|
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
|
+
function _templateObject2() {
|
|
4
|
+
var data = _taggedTemplateLiteral(["\n flex: 1;\n .isInIframe & {\n display: none;\n }\n"]);
|
|
5
|
+
|
|
6
|
+
_templateObject2 = function _templateObject2() {
|
|
7
|
+
return data;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
return data;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
function _templateObject() {
|
|
14
|
+
var data = _taggedTemplateLiteral(["\n position: relative;\n z-index: 201;\n height: ", ";\n display: flex;\n color: rgba(255,255,255,.85);\n background: #fff;\n .hasHeaderTabs & {\n // background: #191D29;\n background: #fff !important;\n box-shadow: 0px 1px 6px 0px rgba(0,0,0,0.18);\n .tnt-layout-header-content {\n display: none;\n }\n }\n\n // .tnt-themeS3.hasHeaderTabs &{\n // background: ", "; //#1D4295 !important;\n // }\n\n .isInIframe.noAppList &,\n .isEmptyLayout & {\n display: none;\n }\n .tnt-themeS1 & {\n background: #FFFFFF;\n box-shadow: 0 1px 10px 0 rgba(0,0,0,0.15);\n }\n .tnt-themeS1.compatible & {\n /* background: #323b4a; */\n }\n padding-right: 20px;\n background: #FFFFFF;\n box-shadow: 0 1px 10px 0 rgba(0,0,0,0.10);\n .compatible & {\n box-shadow: 0 1px 10px 0 rgba(0,0,0,0.10);\n }\n transition: box-shadow .2s cubic-bezier(.4,0,.2,1), -webkit-box-shadow .2s cubic-bezier(.4,0,.2,1);\n\n .sidebar-collapsed-controller {\n text-align: center;\n width: ", ";\n line-height: ", ";\n height: ", ";\n cursor: pointer;\n color: ", ";\n margin-right: 10px;\n\n & > .tnt-icon {\n font-size: 16px;\n .large-size & {\n font-size: 20px;\n }\n }\n\n i {\n position: relative;\n top: -1px;\n vertical-align: sub;\n }\n\n &:hover {\n background-color: rgba(0,0,0,.06);\n }\n\n .tnt-themeS1 & {\n /* color: rgba(255,255,255,.85); */\n color: ", ";\n }\n .large-size & {\n font-size: 18px;\n }\n .isInIframe & {\n display: none;\n }\n }\n"]);
|
|
15
|
+
|
|
16
|
+
_templateObject = function _templateObject() {
|
|
17
|
+
return data;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
return data;
|
|
21
|
+
}
|
|
22
|
+
|
|
3
23
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
24
|
+
|
|
4
25
|
/**
|
|
5
26
|
* @file Layout header
|
|
6
27
|
* @author zhangyou
|
|
@@ -11,7 +32,7 @@ import Icon from '../Icon';
|
|
|
11
32
|
import Actions from './HeaderActions';
|
|
12
33
|
import AppList from './AppList';
|
|
13
34
|
import OrgAppList from './OrgAppList';
|
|
14
|
-
var Header = styled.div(_templateObject
|
|
35
|
+
var Header = styled.div(_templateObject(), function (props) {
|
|
15
36
|
return "".concat(props.theme.headerHeight, "px");
|
|
16
37
|
}, function (props) {
|
|
17
38
|
return "".concat(props.theme.blueBgColor, " !important");
|
|
@@ -26,33 +47,33 @@ var Header = styled.div(_templateObject || (_templateObject = _taggedTemplateLit
|
|
|
26
47
|
}, function (props) {
|
|
27
48
|
return "".concat(props.theme.primaryTextColor);
|
|
28
49
|
});
|
|
29
|
-
var Content = styled.div(_templateObject2
|
|
50
|
+
var Content = styled.div(_templateObject2());
|
|
30
51
|
export default withTheme(function (props) {
|
|
31
52
|
var collapsed = props.collapsed,
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
53
|
+
_props$collapseIconPl = props.collapseIconPlacement,
|
|
54
|
+
collapseIconPlacement = _props$collapseIconPl === void 0 ? 'right' : _props$collapseIconPl,
|
|
55
|
+
selectedAppKey = props.selectedAppKey,
|
|
56
|
+
appList = props.appList,
|
|
57
|
+
orgAppShow = props.orgAppShow,
|
|
58
|
+
orgAppList = props.orgAppList,
|
|
59
|
+
orgTreeConfig = props.orgTreeConfig,
|
|
60
|
+
selectedOrgKey = props.selectedOrgKey,
|
|
61
|
+
orgList = props.orgList,
|
|
62
|
+
headerTabs = props.headerTabs,
|
|
63
|
+
onAppChange = props.onAppChange,
|
|
64
|
+
onOrgChange = props.onOrgChange,
|
|
65
|
+
onCollapseChange = props.onCollapseChange,
|
|
66
|
+
extraActions = props.extraActions;
|
|
46
67
|
var headerRef = useRef();
|
|
47
|
-
return
|
|
68
|
+
return React.createElement(Header, {
|
|
48
69
|
className: "tnt-layout-header",
|
|
49
70
|
ref: headerRef
|
|
50
|
-
}, collapseIconPlacement === 'right' &&
|
|
71
|
+
}, collapseIconPlacement === 'right' && React.createElement("div", {
|
|
51
72
|
className: "sidebar-collapsed-controller",
|
|
52
73
|
onClick: onCollapseChange
|
|
53
|
-
},
|
|
74
|
+
}, React.createElement(Icon, {
|
|
54
75
|
type: "menu-".concat(collapsed ? 'unfold' : 'fold')
|
|
55
|
-
})), headerTabs, orgList &&
|
|
76
|
+
})), headerTabs, orgList && React.createElement(OrgAppList, {
|
|
56
77
|
orgAppShow: orgAppShow,
|
|
57
78
|
selectedOrgKey: selectedOrgKey,
|
|
58
79
|
orgList: orgList,
|
|
@@ -62,13 +83,13 @@ export default withTheme(function (props) {
|
|
|
62
83
|
orgAppList: orgAppList,
|
|
63
84
|
onAppChange: onAppChange,
|
|
64
85
|
headerTabs: headerTabs
|
|
65
|
-
}), appList && !orgList &&
|
|
86
|
+
}), appList && !orgList && React.createElement(AppList, {
|
|
66
87
|
items: appList,
|
|
67
88
|
selectedKey: selectedAppKey,
|
|
68
89
|
onChange: onAppChange
|
|
69
|
-
}),
|
|
90
|
+
}), React.createElement(Content, {
|
|
70
91
|
className: "tnt-layout-header-content"
|
|
71
|
-
}, props.children),
|
|
92
|
+
}, props.children), React.createElement(Actions, _extends({}, props, {
|
|
72
93
|
headerRef: headerRef
|
|
73
94
|
}), extraActions));
|
|
74
95
|
});
|
|
@@ -1,10 +1,22 @@
|
|
|
1
1
|
import "antd/lib/divider/style";
|
|
2
2
|
import _Divider from "antd/lib/divider";
|
|
3
|
-
|
|
4
|
-
var _templateObject;
|
|
3
|
+
|
|
5
4
|
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; }
|
|
5
|
+
|
|
6
6
|
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; }
|
|
7
|
+
|
|
8
|
+
function _templateObject() {
|
|
9
|
+
var data = _taggedTemplateLiteral(["\n list-style: none;\n display: inline-block;\n line-height: ", ";\n margin: 0 0 0 20px;\n .hasHeaderTabs & {\n margin: 0;\n }\n padding: 0;\n white-space: nowrap;\n\n .isInIframe & {\n display: none;\n }\n\n & > li {\n height: 100%;\n display: inline-block;\n vertical-align: top;\n cursor: pointer;\n font-size: 20px;\n margin: 0 7.5px;\n color: ", ";\n .large-size & {\n margin: 0 10px;\n }\n .tnt-themeS1 & {\n /* color: rgba(255,255,255,.85); */\n }\n &:last-of-type {\n margin-right: 0;\n }\n .hasHeaderTabs & {\n color: #455064;\n }\n // \u5220\u9664\u8272\u7CFB\u533A\u5206 \u7EDF\u4E00\u8272\u8C03\n // .hasHeaderTabs:not(.tnt-themeS1) & {\n // color: rgba(255,255,255,.8);\n // }\n .hasHeaderTabs:not(.tnt-themeS1) & {\n color: #455064 !important;\n }\n }\n"]);
|
|
10
|
+
|
|
11
|
+
_templateObject = function _templateObject() {
|
|
12
|
+
return data;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
return data;
|
|
16
|
+
}
|
|
17
|
+
|
|
7
18
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
19
|
+
|
|
8
20
|
import styled, { withTheme } from 'styled-components';
|
|
9
21
|
import GlobalNavigation from './GlobalNavigation';
|
|
10
22
|
import Language from './Language';
|
|
@@ -12,66 +24,68 @@ import Theme from './Theme';
|
|
|
12
24
|
import LanguageTheme from './CompatibleLanguage';
|
|
13
25
|
import Application from './Application';
|
|
14
26
|
import Avatar from './Avatar';
|
|
15
|
-
var Actions = styled.ul(_templateObject
|
|
27
|
+
var Actions = styled.ul(_templateObject(), function (props) {
|
|
16
28
|
return "".concat(props.theme.headerHeight, "px");
|
|
17
29
|
}, function (props) {
|
|
18
30
|
return "".concat(props.theme.headerActionsColor);
|
|
19
31
|
});
|
|
20
32
|
export default withTheme(function (props) {
|
|
21
33
|
var type = props.type,
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
34
|
+
_props$config = props.config;
|
|
35
|
+
_props$config = _props$config === void 0 ? {} : _props$config;
|
|
36
|
+
|
|
37
|
+
var _props$config$theme = _props$config.theme,
|
|
38
|
+
theme = _props$config$theme === void 0 ? true : _props$config$theme,
|
|
39
|
+
_props$config$avatar = _props$config.avatar,
|
|
40
|
+
avatar = _props$config$avatar === void 0 ? true : _props$config$avatar,
|
|
41
|
+
_props$config$languag = _props$config.language,
|
|
42
|
+
language = _props$config$languag === void 0 ? true : _props$config$languag,
|
|
43
|
+
_props$config$applica = _props$config.application,
|
|
44
|
+
application = _props$config$applica === void 0 ? false : _props$config$applica,
|
|
45
|
+
_props$config$globalN = _props$config.globalNavigation,
|
|
46
|
+
globalNavigation = _props$config$globalN === void 0 ? false : _props$config$globalN,
|
|
47
|
+
compatible = props.theme.compatible,
|
|
48
|
+
_props$userInfo = props.userInfo,
|
|
49
|
+
userInfo = _props$userInfo === void 0 ? {} : _props$userInfo,
|
|
50
|
+
menus = props.menus,
|
|
51
|
+
apps = props.apps,
|
|
52
|
+
extraActions = props.extraActions,
|
|
53
|
+
headerRef = props.headerRef,
|
|
54
|
+
onLanguageChange = props.onLanguageChange,
|
|
55
|
+
onThemeChange = props.onThemeChange,
|
|
56
|
+
onApplicationChange = props.onApplicationChange,
|
|
57
|
+
onAppChange = props.onAppChange,
|
|
58
|
+
onOrgChange = props.onOrgChange,
|
|
59
|
+
onCollapseChange = props.onCollapseChange,
|
|
60
|
+
onPersonalSetting = props.onPersonalSetting,
|
|
61
|
+
onChangePassword = props.onChangePassword,
|
|
62
|
+
onLogout = props.onLogout,
|
|
63
|
+
onLogoClick = props.onLogoClick,
|
|
64
|
+
AvatarCustom = props.AvatarCustom,
|
|
65
|
+
rest = _objectWithoutProperties(props, ["type", "config", "theme", "userInfo", "menus", "apps", "extraActions", "headerRef", "onLanguageChange", "onThemeChange", "onApplicationChange", "onAppChange", "onOrgChange", "onCollapseChange", "onPersonalSetting", "onChangePassword", "onLogout", "onLogoClick", "AvatarCustom"]);
|
|
66
|
+
|
|
67
|
+
return React.createElement(Actions, rest, extraActions, globalNavigation && React.createElement(GlobalNavigation, {
|
|
54
68
|
headerRef: headerRef,
|
|
55
69
|
menus: menus
|
|
56
|
-
}), type !== 'enterprise' && (!compatible ?
|
|
70
|
+
}), type !== 'enterprise' && (!compatible ? React.createElement(React.Fragment, null, language && React.createElement(Language, {
|
|
57
71
|
language: userInfo.lang,
|
|
58
72
|
onChange: onLanguageChange
|
|
59
|
-
}), theme &&
|
|
73
|
+
}), theme && React.createElement(Theme, {
|
|
60
74
|
theme: userInfo.theme,
|
|
61
75
|
onChange: onThemeChange
|
|
62
|
-
})) :
|
|
76
|
+
})) : React.createElement(LanguageTheme, {
|
|
63
77
|
config: props.config,
|
|
64
78
|
language: userInfo.lang,
|
|
65
79
|
theme: userInfo.theme,
|
|
66
80
|
onLanguageChange: onLanguageChange,
|
|
67
81
|
onThemeChange: onThemeChange
|
|
68
|
-
})), application &&
|
|
82
|
+
})), application && React.createElement(Application, {
|
|
69
83
|
language: userInfo.lang,
|
|
70
84
|
apps: apps,
|
|
71
85
|
onChange: onApplicationChange
|
|
72
|
-
}), avatar &&
|
|
86
|
+
}), avatar && React.createElement(React.Fragment, null, React.createElement(_Divider, {
|
|
73
87
|
type: "vertical"
|
|
74
|
-
}), AvatarCustom ?
|
|
88
|
+
}), AvatarCustom ? React.createElement(AvatarCustom, {
|
|
75
89
|
userInfo: userInfo,
|
|
76
90
|
onPersonalSetting: onPersonalSetting,
|
|
77
91
|
onChangePassword: onChangePassword,
|
|
@@ -82,7 +96,7 @@ export default withTheme(function (props) {
|
|
|
82
96
|
language: language
|
|
83
97
|
},
|
|
84
98
|
onLanguageChange: onLanguageChange
|
|
85
|
-
}) :
|
|
99
|
+
}) : React.createElement(Avatar, {
|
|
86
100
|
userInfo: userInfo,
|
|
87
101
|
onPersonalSetting: onPersonalSetting,
|
|
88
102
|
onChangePassword: onChangePassword,
|
package/es/Layout/HeaderNavs.js
CHANGED
|
@@ -1,20 +1,43 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
function
|
|
4
|
-
|
|
5
|
-
function
|
|
6
|
-
|
|
7
|
-
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; } }
|
|
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
|
+
|
|
8
7
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
8
|
+
|
|
9
9
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
10
|
+
|
|
10
11
|
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; }
|
|
12
|
+
|
|
13
|
+
function _templateObject2() {
|
|
14
|
+
var data = _taggedTemplateLiteral(["\n position: relative;\n margin: 0;\n padding: 0 20px;\n cursor: pointer;\n display: inline-block;\n line-height: ", ";\n transition: background-color .5;\n\n a {\n font-size: 14px;\n color: ", ";\n text-rendering: optimizeLegibility;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n .tnt-themeS1 & {\n color: rgba(255,255,255,.8);\n }\n }\n\n &:hover, &.active {\n a {\n color: ", ";\n .tnt-themeS1 & {\n color: #418AFF;\n }\n }\n }\n &.active {\n &:after {\n position: absolute;\n left: 0;\n bottom: 0;\n width: 100%;\n height: 3px;\n background: ", ";\n display: inline-block;\n content: \"\";\n .tnt-themeS1 & {\n background: #418AFF;\n }\n }\n }\n"]);
|
|
15
|
+
|
|
16
|
+
_templateObject2 = function _templateObject2() {
|
|
17
|
+
return data;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
return data;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function _templateObject() {
|
|
24
|
+
var data = _taggedTemplateLiteral(["\n margin: 0;\n padding: 0;\n list-style: none;\n text-align: right;\n"]);
|
|
25
|
+
|
|
26
|
+
_templateObject = function _templateObject() {
|
|
27
|
+
return data;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
return data;
|
|
31
|
+
}
|
|
32
|
+
|
|
11
33
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
34
|
+
|
|
12
35
|
import { useState, useEffect } from 'react';
|
|
13
36
|
import styled, { withTheme } from 'styled-components';
|
|
14
37
|
import cn from 'classnames';
|
|
15
38
|
import { get } from 'lodash';
|
|
16
|
-
var Navs = styled.ul(_templateObject
|
|
17
|
-
var NavItem = styled.li(_templateObject2
|
|
39
|
+
var Navs = styled.ul(_templateObject());
|
|
40
|
+
var NavItem = styled.li(_templateObject2(), function (props) {
|
|
18
41
|
return props.theme.size === 'large' ? '60px' : '50px';
|
|
19
42
|
}, function (props) {
|
|
20
43
|
return props.theme.secondaryTextColor;
|
|
@@ -25,28 +48,32 @@ var NavItem = styled.li(_templateObject2 || (_templateObject2 = _taggedTemplateL
|
|
|
25
48
|
});
|
|
26
49
|
export var HeaderNavs = withTheme(function (_ref) {
|
|
27
50
|
var theme = _ref.theme,
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
51
|
+
_ref$navs = _ref.navs,
|
|
52
|
+
navs = _ref$navs === void 0 ? [] : _ref$navs,
|
|
53
|
+
onChange = _ref.onChange,
|
|
54
|
+
onSelect = _ref.onSelect,
|
|
55
|
+
props = _objectWithoutProperties(_ref, ["theme", "navs", "onChange", "onSelect"]);
|
|
56
|
+
|
|
33
57
|
var _useState = useState(props.selectedKey || get(navs, '0.key')),
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
58
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
59
|
+
selectedKey = _useState2[0],
|
|
60
|
+
setSelectedKey = _useState2[1];
|
|
61
|
+
|
|
37
62
|
var onClickNav = function onClickNav(nav) {
|
|
38
63
|
setSelectedKey(nav.key);
|
|
39
64
|
onSelect && onSelect(nav);
|
|
65
|
+
|
|
40
66
|
if (selectedKey !== nav.key) {
|
|
41
67
|
onChange && onChange(nav);
|
|
42
68
|
setSelectedKey(nav.key);
|
|
43
69
|
}
|
|
44
70
|
};
|
|
71
|
+
|
|
45
72
|
useEffect(function () {
|
|
46
73
|
setSelectedKey(props.selectedKey || get(navs, '0.key'));
|
|
47
74
|
}, [navs, props.selectedKey]);
|
|
48
|
-
return
|
|
49
|
-
return
|
|
75
|
+
return React.createElement(Navs, props, navs.map(function (nav) {
|
|
76
|
+
return React.createElement(NavItem, {
|
|
50
77
|
key: nav.key,
|
|
51
78
|
theme: theme,
|
|
52
79
|
className: cn({
|
|
@@ -55,7 +82,7 @@ export var HeaderNavs = withTheme(function (_ref) {
|
|
|
55
82
|
onClick: function onClick() {
|
|
56
83
|
return onClickNav(nav);
|
|
57
84
|
}
|
|
58
|
-
},
|
|
85
|
+
}, React.createElement("a", {
|
|
59
86
|
href: nav.key,
|
|
60
87
|
onClick: function onClick(evt) {
|
|
61
88
|
return evt.preventDefault();
|