tntd 1.4.18 → 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/Ellipsis/index.js +1 -1
- 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 +28426 -28000
- 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 +59 -70
- 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 +58 -81
- 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/Header.js
CHANGED
|
@@ -1,27 +1,6 @@
|
|
|
1
|
-
|
|
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
|
-
|
|
1
|
+
var _templateObject, _templateObject2;
|
|
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); }
|
|
23
3
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
24
|
-
|
|
25
4
|
/**
|
|
26
5
|
* @file Layout header
|
|
27
6
|
* @author zhangyou
|
|
@@ -32,7 +11,7 @@ import Icon from '../Icon';
|
|
|
32
11
|
import Actions from './HeaderActions';
|
|
33
12
|
import AppList from './AppList';
|
|
34
13
|
import OrgAppList from './OrgAppList';
|
|
35
|
-
var Header = styled.div(_templateObject(), function (props) {
|
|
14
|
+
var Header = styled.div(_templateObject || (_templateObject = _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"])), function (props) {
|
|
36
15
|
return "".concat(props.theme.headerHeight, "px");
|
|
37
16
|
}, function (props) {
|
|
38
17
|
return "".concat(props.theme.blueBgColor, " !important");
|
|
@@ -47,33 +26,33 @@ var Header = styled.div(_templateObject(), function (props) {
|
|
|
47
26
|
}, function (props) {
|
|
48
27
|
return "".concat(props.theme.primaryTextColor);
|
|
49
28
|
});
|
|
50
|
-
var Content = styled.div(_templateObject2());
|
|
29
|
+
var Content = styled.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n flex: 1;\n .isInIframe & {\n display: none;\n }\n"])));
|
|
51
30
|
export default withTheme(function (props) {
|
|
52
31
|
var collapsed = props.collapsed,
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
32
|
+
_props$collapseIconPl = props.collapseIconPlacement,
|
|
33
|
+
collapseIconPlacement = _props$collapseIconPl === void 0 ? 'right' : _props$collapseIconPl,
|
|
34
|
+
selectedAppKey = props.selectedAppKey,
|
|
35
|
+
appList = props.appList,
|
|
36
|
+
orgAppShow = props.orgAppShow,
|
|
37
|
+
orgAppList = props.orgAppList,
|
|
38
|
+
orgTreeConfig = props.orgTreeConfig,
|
|
39
|
+
selectedOrgKey = props.selectedOrgKey,
|
|
40
|
+
orgList = props.orgList,
|
|
41
|
+
headerTabs = props.headerTabs,
|
|
42
|
+
onAppChange = props.onAppChange,
|
|
43
|
+
onOrgChange = props.onOrgChange,
|
|
44
|
+
onCollapseChange = props.onCollapseChange,
|
|
45
|
+
extraActions = props.extraActions;
|
|
67
46
|
var headerRef = useRef();
|
|
68
|
-
return React.createElement(Header, {
|
|
47
|
+
return /*#__PURE__*/React.createElement(Header, {
|
|
69
48
|
className: "tnt-layout-header",
|
|
70
49
|
ref: headerRef
|
|
71
|
-
}, collapseIconPlacement === 'right' && React.createElement("div", {
|
|
50
|
+
}, collapseIconPlacement === 'right' && /*#__PURE__*/React.createElement("div", {
|
|
72
51
|
className: "sidebar-collapsed-controller",
|
|
73
52
|
onClick: onCollapseChange
|
|
74
|
-
}, React.createElement(Icon, {
|
|
53
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
75
54
|
type: "menu-".concat(collapsed ? 'unfold' : 'fold')
|
|
76
|
-
})), headerTabs, orgList && React.createElement(OrgAppList, {
|
|
55
|
+
})), headerTabs, orgList && /*#__PURE__*/React.createElement(OrgAppList, {
|
|
77
56
|
orgAppShow: orgAppShow,
|
|
78
57
|
selectedOrgKey: selectedOrgKey,
|
|
79
58
|
orgList: orgList,
|
|
@@ -83,13 +62,13 @@ export default withTheme(function (props) {
|
|
|
83
62
|
orgAppList: orgAppList,
|
|
84
63
|
onAppChange: onAppChange,
|
|
85
64
|
headerTabs: headerTabs
|
|
86
|
-
}), appList && !orgList && React.createElement(AppList, {
|
|
65
|
+
}), appList && !orgList && /*#__PURE__*/React.createElement(AppList, {
|
|
87
66
|
items: appList,
|
|
88
67
|
selectedKey: selectedAppKey,
|
|
89
68
|
onChange: onAppChange
|
|
90
|
-
}), React.createElement(Content, {
|
|
69
|
+
}), /*#__PURE__*/React.createElement(Content, {
|
|
91
70
|
className: "tnt-layout-header-content"
|
|
92
|
-
}, props.children), React.createElement(Actions, _extends({}, props, {
|
|
71
|
+
}, props.children), /*#__PURE__*/React.createElement(Actions, _extends({}, props, {
|
|
93
72
|
headerRef: headerRef
|
|
94
73
|
}), extraActions));
|
|
95
74
|
});
|
|
@@ -1,89 +1,77 @@
|
|
|
1
1
|
import "antd/lib/divider/style";
|
|
2
2
|
import _Divider from "antd/lib/divider";
|
|
3
|
-
|
|
3
|
+
var _excluded = ["type", "config", "theme", "userInfo", "menus", "apps", "extraActions", "headerRef", "onLanguageChange", "onThemeChange", "onApplicationChange", "onAppChange", "onOrgChange", "onCollapseChange", "onPersonalSetting", "onChangePassword", "onLogout", "onLogoClick", "AvatarCustom"];
|
|
4
|
+
var _templateObject;
|
|
4
5
|
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
|
-
|
|
18
7
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
19
|
-
|
|
20
|
-
import
|
|
21
|
-
import
|
|
22
|
-
import
|
|
23
|
-
import
|
|
24
|
-
import
|
|
25
|
-
import
|
|
26
|
-
|
|
27
|
-
var Actions = styled.ul(_templateObject(), function (props) {
|
|
8
|
+
import styled, { withTheme } from 'styled-components';
|
|
9
|
+
import GlobalNavigation from './GlobalNavigation';
|
|
10
|
+
import Language from './Language';
|
|
11
|
+
import Theme from './Theme';
|
|
12
|
+
import LanguageTheme from './CompatibleLanguage';
|
|
13
|
+
import Application from './Application';
|
|
14
|
+
import Avatar from './Avatar';
|
|
15
|
+
var Actions = styled.ul(_templateObject || (_templateObject = _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"])), function (props) {
|
|
28
16
|
return "".concat(props.theme.headerHeight, "px");
|
|
29
17
|
}, function (props) {
|
|
30
18
|
return "".concat(props.theme.headerActionsColor);
|
|
31
19
|
});
|
|
32
20
|
export default withTheme(function (props) {
|
|
33
|
-
var
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
return React.createElement(Actions, rest, extraActions, globalNavigation && React.createElement(GlobalNavigation, {
|
|
21
|
+
var type = props.type,
|
|
22
|
+
_props$config = props.config,
|
|
23
|
+
_props$config2 = _props$config === void 0 ? {} : _props$config,
|
|
24
|
+
_props$config2$theme = _props$config2.theme,
|
|
25
|
+
theme = _props$config2$theme === void 0 ? true : _props$config2$theme,
|
|
26
|
+
_props$config2$avatar = _props$config2.avatar,
|
|
27
|
+
avatar = _props$config2$avatar === void 0 ? true : _props$config2$avatar,
|
|
28
|
+
_props$config2$langua = _props$config2.language,
|
|
29
|
+
language = _props$config2$langua === void 0 ? true : _props$config2$langua,
|
|
30
|
+
_props$config2$applic = _props$config2.application,
|
|
31
|
+
application = _props$config2$applic === void 0 ? false : _props$config2$applic,
|
|
32
|
+
_props$config2$global = _props$config2.globalNavigation,
|
|
33
|
+
globalNavigation = _props$config2$global === void 0 ? false : _props$config2$global,
|
|
34
|
+
compatible = props.theme.compatible,
|
|
35
|
+
_props$userInfo = props.userInfo,
|
|
36
|
+
userInfo = _props$userInfo === void 0 ? {} : _props$userInfo,
|
|
37
|
+
menus = props.menus,
|
|
38
|
+
apps = props.apps,
|
|
39
|
+
extraActions = props.extraActions,
|
|
40
|
+
headerRef = props.headerRef,
|
|
41
|
+
onLanguageChange = props.onLanguageChange,
|
|
42
|
+
onThemeChange = props.onThemeChange,
|
|
43
|
+
onApplicationChange = props.onApplicationChange,
|
|
44
|
+
onAppChange = props.onAppChange,
|
|
45
|
+
onOrgChange = props.onOrgChange,
|
|
46
|
+
onCollapseChange = props.onCollapseChange,
|
|
47
|
+
onPersonalSetting = props.onPersonalSetting,
|
|
48
|
+
onChangePassword = props.onChangePassword,
|
|
49
|
+
onLogout = props.onLogout,
|
|
50
|
+
onLogoClick = props.onLogoClick,
|
|
51
|
+
AvatarCustom = props.AvatarCustom,
|
|
52
|
+
rest = _objectWithoutProperties(props, _excluded);
|
|
53
|
+
return /*#__PURE__*/React.createElement(Actions, rest, extraActions, globalNavigation && /*#__PURE__*/React.createElement(GlobalNavigation, {
|
|
66
54
|
headerRef: headerRef,
|
|
67
55
|
menus: menus
|
|
68
|
-
}), !compatible ? React.createElement(React.Fragment, null, language && React.createElement(Language, {
|
|
56
|
+
}), type !== 'enterprise' && (!compatible ? /*#__PURE__*/React.createElement(React.Fragment, null, language && /*#__PURE__*/React.createElement(Language, {
|
|
69
57
|
language: userInfo.lang,
|
|
70
58
|
onChange: onLanguageChange
|
|
71
|
-
}), theme && React.createElement(Theme, {
|
|
59
|
+
}), theme && /*#__PURE__*/React.createElement(Theme, {
|
|
72
60
|
theme: userInfo.theme,
|
|
73
61
|
onChange: onThemeChange
|
|
74
|
-
})) : React.createElement(LanguageTheme, {
|
|
62
|
+
})) : /*#__PURE__*/React.createElement(LanguageTheme, {
|
|
75
63
|
config: props.config,
|
|
76
64
|
language: userInfo.lang,
|
|
77
65
|
theme: userInfo.theme,
|
|
78
66
|
onLanguageChange: onLanguageChange,
|
|
79
67
|
onThemeChange: onThemeChange
|
|
80
|
-
}), application && React.createElement(Application, {
|
|
68
|
+
})), application && /*#__PURE__*/React.createElement(Application, {
|
|
81
69
|
language: userInfo.lang,
|
|
82
70
|
apps: apps,
|
|
83
71
|
onChange: onApplicationChange
|
|
84
|
-
}), avatar && React.createElement(React.Fragment, null, React.createElement(_Divider, {
|
|
72
|
+
}), avatar && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(_Divider, {
|
|
85
73
|
type: "vertical"
|
|
86
|
-
}), AvatarCustom ? React.createElement(AvatarCustom, {
|
|
74
|
+
}), AvatarCustom ? /*#__PURE__*/React.createElement(AvatarCustom, {
|
|
87
75
|
userInfo: userInfo,
|
|
88
76
|
onPersonalSetting: onPersonalSetting,
|
|
89
77
|
onChangePassword: onChangePassword,
|
|
@@ -92,8 +80,9 @@ export default withTheme(function (props) {
|
|
|
92
80
|
config: {
|
|
93
81
|
theme: theme,
|
|
94
82
|
language: language
|
|
95
|
-
}
|
|
96
|
-
|
|
83
|
+
},
|
|
84
|
+
onLanguageChange: onLanguageChange
|
|
85
|
+
}) : /*#__PURE__*/React.createElement(Avatar, {
|
|
97
86
|
userInfo: userInfo,
|
|
98
87
|
onPersonalSetting: onPersonalSetting,
|
|
99
88
|
onChangePassword: onChangePassword,
|
package/es/Layout/HeaderNavs.js
CHANGED
|
@@ -1,43 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
function
|
|
4
|
-
|
|
5
|
-
function
|
|
6
|
-
|
|
1
|
+
var _excluded = ["theme", "navs", "onChange", "onSelect"];
|
|
2
|
+
var _templateObject, _templateObject2;
|
|
3
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
4
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
5
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
6
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
7
|
+
function _iterableToArrayLimit(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
8
|
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
|
-
|
|
11
10
|
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
|
-
|
|
33
11
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
34
|
-
|
|
35
12
|
import { useState, useEffect } from 'react';
|
|
36
13
|
import styled, { withTheme } from 'styled-components';
|
|
37
14
|
import cn from 'classnames';
|
|
38
15
|
import { get } from 'lodash';
|
|
39
|
-
var Navs = styled.ul(_templateObject());
|
|
40
|
-
var NavItem = styled.li(_templateObject2(), function (props) {
|
|
16
|
+
var Navs = styled.ul(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n margin: 0;\n padding: 0;\n list-style: none;\n text-align: right;\n"])));
|
|
17
|
+
var NavItem = styled.li(_templateObject2 || (_templateObject2 = _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"])), function (props) {
|
|
41
18
|
return props.theme.size === 'large' ? '60px' : '50px';
|
|
42
19
|
}, function (props) {
|
|
43
20
|
return props.theme.secondaryTextColor;
|
|
@@ -48,32 +25,28 @@ var NavItem = styled.li(_templateObject2(), function (props) {
|
|
|
48
25
|
});
|
|
49
26
|
export var HeaderNavs = withTheme(function (_ref) {
|
|
50
27
|
var theme = _ref.theme,
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
28
|
+
_ref$navs = _ref.navs,
|
|
29
|
+
navs = _ref$navs === void 0 ? [] : _ref$navs,
|
|
30
|
+
onChange = _ref.onChange,
|
|
31
|
+
onSelect = _ref.onSelect,
|
|
32
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
57
33
|
var _useState = useState(props.selectedKey || get(navs, '0.key')),
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
34
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
35
|
+
selectedKey = _useState2[0],
|
|
36
|
+
setSelectedKey = _useState2[1];
|
|
62
37
|
var onClickNav = function onClickNav(nav) {
|
|
63
38
|
setSelectedKey(nav.key);
|
|
64
39
|
onSelect && onSelect(nav);
|
|
65
|
-
|
|
66
40
|
if (selectedKey !== nav.key) {
|
|
67
41
|
onChange && onChange(nav);
|
|
68
42
|
setSelectedKey(nav.key);
|
|
69
43
|
}
|
|
70
44
|
};
|
|
71
|
-
|
|
72
45
|
useEffect(function () {
|
|
73
46
|
setSelectedKey(props.selectedKey || get(navs, '0.key'));
|
|
74
47
|
}, [navs, props.selectedKey]);
|
|
75
|
-
return React.createElement(Navs, props, navs.map(function (nav) {
|
|
76
|
-
return React.createElement(NavItem, {
|
|
48
|
+
return /*#__PURE__*/React.createElement(Navs, props, navs.map(function (nav) {
|
|
49
|
+
return /*#__PURE__*/React.createElement(NavItem, {
|
|
77
50
|
key: nav.key,
|
|
78
51
|
theme: theme,
|
|
79
52
|
className: cn({
|
|
@@ -82,7 +55,7 @@ export var HeaderNavs = withTheme(function (_ref) {
|
|
|
82
55
|
onClick: function onClick() {
|
|
83
56
|
return onClickNav(nav);
|
|
84
57
|
}
|
|
85
|
-
}, React.createElement("a", {
|
|
58
|
+
}, /*#__PURE__*/React.createElement("a", {
|
|
86
59
|
href: nav.key,
|
|
87
60
|
onClick: function onClick(evt) {
|
|
88
61
|
return evt.preventDefault();
|