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/Header.js
CHANGED
|
@@ -1,27 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
function
|
|
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
|
-
|
|
23
|
-
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
24
|
-
|
|
1
|
+
var _templateObject, _templateObject2;
|
|
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 _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
|
|
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,22 +1,10 @@
|
|
|
1
1
|
import "antd/lib/divider/style";
|
|
2
2
|
import _Divider from "antd/lib/divider";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
function _objectWithoutPropertiesLoose(
|
|
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
|
-
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
19
|
-
|
|
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;
|
|
5
|
+
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; }
|
|
6
|
+
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
|
+
function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
|
|
20
8
|
import styled, { withTheme } from 'styled-components';
|
|
21
9
|
import GlobalNavigation from './GlobalNavigation';
|
|
22
10
|
import Language from './Language';
|
|
@@ -24,68 +12,66 @@ import Theme from './Theme';
|
|
|
24
12
|
import LanguageTheme from './CompatibleLanguage';
|
|
25
13
|
import Application from './Application';
|
|
26
14
|
import Avatar from './Avatar';
|
|
27
|
-
var Actions = styled.ul(_templateObject(), function (props) {
|
|
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
21
|
var type = props.type,
|
|
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
|
-
|
|
66
|
-
|
|
67
|
-
return React.createElement(Actions, rest, extraActions, globalNavigation && React.createElement(GlobalNavigation, {
|
|
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, {
|
|
68
54
|
headerRef: headerRef,
|
|
69
55
|
menus: menus
|
|
70
|
-
}), type !== 'enterprise' && (!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, {
|
|
71
57
|
language: userInfo.lang,
|
|
72
58
|
onChange: onLanguageChange
|
|
73
|
-
}), theme && React.createElement(Theme, {
|
|
59
|
+
}), theme && /*#__PURE__*/React.createElement(Theme, {
|
|
74
60
|
theme: userInfo.theme,
|
|
75
61
|
onChange: onThemeChange
|
|
76
|
-
})) : React.createElement(LanguageTheme, {
|
|
62
|
+
})) : /*#__PURE__*/React.createElement(LanguageTheme, {
|
|
77
63
|
config: props.config,
|
|
78
64
|
language: userInfo.lang,
|
|
79
65
|
theme: userInfo.theme,
|
|
80
66
|
onLanguageChange: onLanguageChange,
|
|
81
67
|
onThemeChange: onThemeChange
|
|
82
|
-
})), application && React.createElement(Application, {
|
|
68
|
+
})), application && /*#__PURE__*/React.createElement(Application, {
|
|
83
69
|
language: userInfo.lang,
|
|
84
70
|
apps: apps,
|
|
85
71
|
onChange: onApplicationChange
|
|
86
|
-
}), avatar && React.createElement(React.Fragment, null, React.createElement(_Divider, {
|
|
72
|
+
}), avatar && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(_Divider, {
|
|
87
73
|
type: "vertical"
|
|
88
|
-
}), AvatarCustom ? React.createElement(AvatarCustom, {
|
|
74
|
+
}), AvatarCustom ? /*#__PURE__*/React.createElement(AvatarCustom, {
|
|
89
75
|
userInfo: userInfo,
|
|
90
76
|
onPersonalSetting: onPersonalSetting,
|
|
91
77
|
onChangePassword: onChangePassword,
|
|
@@ -96,7 +82,7 @@ export default withTheme(function (props) {
|
|
|
96
82
|
language: language
|
|
97
83
|
},
|
|
98
84
|
onLanguageChange: onLanguageChange
|
|
99
|
-
}) : React.createElement(Avatar, {
|
|
85
|
+
}) : /*#__PURE__*/React.createElement(Avatar, {
|
|
100
86
|
userInfo: userInfo,
|
|
101
87
|
onPersonalSetting: onPersonalSetting,
|
|
102
88
|
onChangePassword: onChangePassword,
|
package/es/Layout/HeaderNavs.js
CHANGED
|
@@ -1,43 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
function
|
|
4
|
-
|
|
5
|
-
function
|
|
6
|
-
|
|
7
|
-
function
|
|
8
|
-
|
|
9
|
-
function _objectWithoutProperties(
|
|
10
|
-
|
|
11
|
-
function
|
|
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
|
-
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
34
|
-
|
|
1
|
+
var _excluded = ["theme", "navs", "onChange", "onSelect"];
|
|
2
|
+
var _templateObject, _templateObject2;
|
|
3
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _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(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; } }
|
|
6
|
+
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; }
|
|
7
|
+
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; } }
|
|
8
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
9
|
+
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; }
|
|
10
|
+
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; }
|
|
11
|
+
function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
|
|
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();
|