tntd 1.4.20 → 1.4.21
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 +27 -6
- package/components/locale.js +8 -2
- package/dist/1.tntd.js +1 -1
- package/dist/stats.json +23819 -24067
- 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 +67 -32
- 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 +80 -32
- 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/lib/Layout/Header.js
CHANGED
|
@@ -1,23 +1,55 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(obj) {
|
|
3
|
+
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
4
|
+
|
|
4
5
|
Object.defineProperty(exports, "__esModule", {
|
|
5
6
|
value: true
|
|
6
7
|
});
|
|
7
8
|
exports["default"] = void 0;
|
|
9
|
+
|
|
8
10
|
var _react = require("react");
|
|
11
|
+
|
|
9
12
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
13
|
+
|
|
10
14
|
var _Icon = _interopRequireDefault(require("../Icon"));
|
|
15
|
+
|
|
11
16
|
var _HeaderActions = _interopRequireDefault(require("./HeaderActions"));
|
|
17
|
+
|
|
12
18
|
var _AppList = _interopRequireDefault(require("./AppList"));
|
|
19
|
+
|
|
13
20
|
var _OrgAppList = _interopRequireDefault(require("./OrgAppList"));
|
|
14
|
-
|
|
21
|
+
|
|
15
22
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
16
|
-
|
|
17
|
-
function
|
|
18
|
-
|
|
23
|
+
|
|
24
|
+
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
|
25
|
+
|
|
26
|
+
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
27
|
+
|
|
28
|
+
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); }
|
|
29
|
+
|
|
30
|
+
function _templateObject2() {
|
|
31
|
+
var data = _taggedTemplateLiteral(["\n flex: 1;\n .isInIframe & {\n display: none;\n }\n"]);
|
|
32
|
+
|
|
33
|
+
_templateObject2 = function _templateObject2() {
|
|
34
|
+
return data;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
return data;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function _templateObject() {
|
|
41
|
+
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"]);
|
|
42
|
+
|
|
43
|
+
_templateObject = function _templateObject() {
|
|
44
|
+
return data;
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
return data;
|
|
48
|
+
}
|
|
49
|
+
|
|
19
50
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
20
|
-
|
|
51
|
+
|
|
52
|
+
var Header = _styledComponents["default"].div(_templateObject(), function (props) {
|
|
21
53
|
return "".concat(props.theme.headerHeight, "px");
|
|
22
54
|
}, function (props) {
|
|
23
55
|
return "".concat(props.theme.blueBgColor, " !important");
|
|
@@ -32,33 +64,35 @@ var Header = _styledComponents["default"].div(_templateObject || (_templateObjec
|
|
|
32
64
|
}, function (props) {
|
|
33
65
|
return "".concat(props.theme.primaryTextColor);
|
|
34
66
|
});
|
|
35
|
-
|
|
67
|
+
|
|
68
|
+
var Content = _styledComponents["default"].div(_templateObject2());
|
|
69
|
+
|
|
36
70
|
var _default = (0, _styledComponents.withTheme)(function (props) {
|
|
37
71
|
var collapsed = props.collapsed,
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
72
|
+
_props$collapseIconPl = props.collapseIconPlacement,
|
|
73
|
+
collapseIconPlacement = _props$collapseIconPl === void 0 ? 'right' : _props$collapseIconPl,
|
|
74
|
+
selectedAppKey = props.selectedAppKey,
|
|
75
|
+
appList = props.appList,
|
|
76
|
+
orgAppShow = props.orgAppShow,
|
|
77
|
+
orgAppList = props.orgAppList,
|
|
78
|
+
orgTreeConfig = props.orgTreeConfig,
|
|
79
|
+
selectedOrgKey = props.selectedOrgKey,
|
|
80
|
+
orgList = props.orgList,
|
|
81
|
+
headerTabs = props.headerTabs,
|
|
82
|
+
onAppChange = props.onAppChange,
|
|
83
|
+
onOrgChange = props.onOrgChange,
|
|
84
|
+
onCollapseChange = props.onCollapseChange,
|
|
85
|
+
extraActions = props.extraActions;
|
|
52
86
|
var headerRef = (0, _react.useRef)();
|
|
53
|
-
return
|
|
87
|
+
return React.createElement(Header, {
|
|
54
88
|
className: "tnt-layout-header",
|
|
55
89
|
ref: headerRef
|
|
56
|
-
}, collapseIconPlacement === 'right' &&
|
|
90
|
+
}, collapseIconPlacement === 'right' && React.createElement("div", {
|
|
57
91
|
className: "sidebar-collapsed-controller",
|
|
58
92
|
onClick: onCollapseChange
|
|
59
|
-
},
|
|
93
|
+
}, React.createElement(_Icon["default"], {
|
|
60
94
|
type: "menu-".concat(collapsed ? 'unfold' : 'fold')
|
|
61
|
-
})), headerTabs, orgList &&
|
|
95
|
+
})), headerTabs, orgList && React.createElement(_OrgAppList["default"], {
|
|
62
96
|
orgAppShow: orgAppShow,
|
|
63
97
|
selectedOrgKey: selectedOrgKey,
|
|
64
98
|
orgList: orgList,
|
|
@@ -68,14 +102,15 @@ var _default = (0, _styledComponents.withTheme)(function (props) {
|
|
|
68
102
|
orgAppList: orgAppList,
|
|
69
103
|
onAppChange: onAppChange,
|
|
70
104
|
headerTabs: headerTabs
|
|
71
|
-
}), appList && !orgList &&
|
|
105
|
+
}), appList && !orgList && React.createElement(_AppList["default"], {
|
|
72
106
|
items: appList,
|
|
73
107
|
selectedKey: selectedAppKey,
|
|
74
108
|
onChange: onAppChange
|
|
75
|
-
}),
|
|
109
|
+
}), React.createElement(Content, {
|
|
76
110
|
className: "tnt-layout-header-content"
|
|
77
|
-
}, props.children),
|
|
111
|
+
}, props.children), React.createElement(_HeaderActions["default"], _extends({}, props, {
|
|
78
112
|
headerRef: headerRef
|
|
79
113
|
}), extraActions));
|
|
80
114
|
});
|
|
115
|
+
|
|
81
116
|
exports["default"] = _default;
|
|
@@ -1,87 +1,115 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(obj) {
|
|
3
|
+
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
4
|
+
|
|
4
5
|
Object.defineProperty(exports, "__esModule", {
|
|
5
6
|
value: true
|
|
6
7
|
});
|
|
7
8
|
exports["default"] = void 0;
|
|
9
|
+
|
|
8
10
|
require("antd/lib/divider/style");
|
|
11
|
+
|
|
9
12
|
var _divider = _interopRequireDefault(require("antd/lib/divider"));
|
|
13
|
+
|
|
10
14
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
15
|
+
|
|
11
16
|
var _GlobalNavigation = _interopRequireDefault(require("./GlobalNavigation"));
|
|
17
|
+
|
|
12
18
|
var _Language = _interopRequireDefault(require("./Language"));
|
|
19
|
+
|
|
13
20
|
var _Theme = _interopRequireDefault(require("./Theme"));
|
|
21
|
+
|
|
14
22
|
var _CompatibleLanguage = _interopRequireDefault(require("./CompatibleLanguage"));
|
|
23
|
+
|
|
15
24
|
var _Application = _interopRequireDefault(require("./Application"));
|
|
25
|
+
|
|
16
26
|
var _Avatar = _interopRequireDefault(require("./Avatar"));
|
|
17
|
-
|
|
18
|
-
var
|
|
19
|
-
|
|
20
|
-
function _interopRequireWildcard(obj
|
|
27
|
+
|
|
28
|
+
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
|
29
|
+
|
|
30
|
+
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
31
|
+
|
|
21
32
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
33
|
+
|
|
22
34
|
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; }
|
|
35
|
+
|
|
23
36
|
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; }
|
|
37
|
+
|
|
38
|
+
function _templateObject() {
|
|
39
|
+
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"]);
|
|
40
|
+
|
|
41
|
+
_templateObject = function _templateObject() {
|
|
42
|
+
return data;
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
return data;
|
|
46
|
+
}
|
|
47
|
+
|
|
24
48
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
25
|
-
|
|
49
|
+
|
|
50
|
+
var Actions = _styledComponents["default"].ul(_templateObject(), function (props) {
|
|
26
51
|
return "".concat(props.theme.headerHeight, "px");
|
|
27
52
|
}, function (props) {
|
|
28
53
|
return "".concat(props.theme.headerActionsColor);
|
|
29
54
|
});
|
|
55
|
+
|
|
30
56
|
var _default = (0, _styledComponents.withTheme)(function (props) {
|
|
31
57
|
var type = props.type,
|
|
32
|
-
|
|
33
|
-
|
|
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
|
-
|
|
58
|
+
_props$config = props.config;
|
|
59
|
+
_props$config = _props$config === void 0 ? {} : _props$config;
|
|
60
|
+
|
|
61
|
+
var _props$config$theme = _props$config.theme,
|
|
62
|
+
theme = _props$config$theme === void 0 ? true : _props$config$theme,
|
|
63
|
+
_props$config$avatar = _props$config.avatar,
|
|
64
|
+
avatar = _props$config$avatar === void 0 ? true : _props$config$avatar,
|
|
65
|
+
_props$config$languag = _props$config.language,
|
|
66
|
+
language = _props$config$languag === void 0 ? true : _props$config$languag,
|
|
67
|
+
_props$config$applica = _props$config.application,
|
|
68
|
+
application = _props$config$applica === void 0 ? false : _props$config$applica,
|
|
69
|
+
_props$config$globalN = _props$config.globalNavigation,
|
|
70
|
+
globalNavigation = _props$config$globalN === void 0 ? false : _props$config$globalN,
|
|
71
|
+
compatible = props.theme.compatible,
|
|
72
|
+
_props$userInfo = props.userInfo,
|
|
73
|
+
userInfo = _props$userInfo === void 0 ? {} : _props$userInfo,
|
|
74
|
+
menus = props.menus,
|
|
75
|
+
apps = props.apps,
|
|
76
|
+
extraActions = props.extraActions,
|
|
77
|
+
headerRef = props.headerRef,
|
|
78
|
+
onLanguageChange = props.onLanguageChange,
|
|
79
|
+
onThemeChange = props.onThemeChange,
|
|
80
|
+
onApplicationChange = props.onApplicationChange,
|
|
81
|
+
onAppChange = props.onAppChange,
|
|
82
|
+
onOrgChange = props.onOrgChange,
|
|
83
|
+
onCollapseChange = props.onCollapseChange,
|
|
84
|
+
onPersonalSetting = props.onPersonalSetting,
|
|
85
|
+
onChangePassword = props.onChangePassword,
|
|
86
|
+
onLogout = props.onLogout,
|
|
87
|
+
onLogoClick = props.onLogoClick,
|
|
88
|
+
AvatarCustom = props.AvatarCustom,
|
|
89
|
+
rest = _objectWithoutProperties(props, ["type", "config", "theme", "userInfo", "menus", "apps", "extraActions", "headerRef", "onLanguageChange", "onThemeChange", "onApplicationChange", "onAppChange", "onOrgChange", "onCollapseChange", "onPersonalSetting", "onChangePassword", "onLogout", "onLogoClick", "AvatarCustom"]);
|
|
90
|
+
|
|
91
|
+
return React.createElement(Actions, rest, extraActions, globalNavigation && React.createElement(_GlobalNavigation["default"], {
|
|
64
92
|
headerRef: headerRef,
|
|
65
93
|
menus: menus
|
|
66
|
-
}), type !== 'enterprise' && (!compatible ?
|
|
94
|
+
}), type !== 'enterprise' && (!compatible ? React.createElement(React.Fragment, null, language && React.createElement(_Language["default"], {
|
|
67
95
|
language: userInfo.lang,
|
|
68
96
|
onChange: onLanguageChange
|
|
69
|
-
}), theme &&
|
|
97
|
+
}), theme && React.createElement(_Theme["default"], {
|
|
70
98
|
theme: userInfo.theme,
|
|
71
99
|
onChange: onThemeChange
|
|
72
|
-
})) :
|
|
100
|
+
})) : React.createElement(_CompatibleLanguage["default"], {
|
|
73
101
|
config: props.config,
|
|
74
102
|
language: userInfo.lang,
|
|
75
103
|
theme: userInfo.theme,
|
|
76
104
|
onLanguageChange: onLanguageChange,
|
|
77
105
|
onThemeChange: onThemeChange
|
|
78
|
-
})), application &&
|
|
106
|
+
})), application && React.createElement(_Application["default"], {
|
|
79
107
|
language: userInfo.lang,
|
|
80
108
|
apps: apps,
|
|
81
109
|
onChange: onApplicationChange
|
|
82
|
-
}), avatar &&
|
|
110
|
+
}), avatar && React.createElement(React.Fragment, null, React.createElement(_divider["default"], {
|
|
83
111
|
type: "vertical"
|
|
84
|
-
}), AvatarCustom ?
|
|
112
|
+
}), AvatarCustom ? React.createElement(AvatarCustom, {
|
|
85
113
|
userInfo: userInfo,
|
|
86
114
|
onPersonalSetting: onPersonalSetting,
|
|
87
115
|
onChangePassword: onChangePassword,
|
|
@@ -92,7 +120,7 @@ var _default = (0, _styledComponents.withTheme)(function (props) {
|
|
|
92
120
|
language: language
|
|
93
121
|
},
|
|
94
122
|
onLanguageChange: onLanguageChange
|
|
95
|
-
}) :
|
|
123
|
+
}) : React.createElement(_Avatar["default"], {
|
|
96
124
|
userInfo: userInfo,
|
|
97
125
|
onPersonalSetting: onPersonalSetting,
|
|
98
126
|
onChangePassword: onChangePassword,
|
|
@@ -104,4 +132,5 @@ var _default = (0, _styledComponents.withTheme)(function (props) {
|
|
|
104
132
|
}
|
|
105
133
|
})));
|
|
106
134
|
});
|
|
135
|
+
|
|
107
136
|
exports["default"] = _default;
|
package/lib/Layout/HeaderNavs.js
CHANGED
|
@@ -1,30 +1,63 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(obj) {
|
|
3
|
+
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
4
|
+
|
|
4
5
|
Object.defineProperty(exports, "__esModule", {
|
|
5
6
|
value: true
|
|
6
7
|
});
|
|
7
8
|
exports["default"] = exports.HeaderNavs = void 0;
|
|
9
|
+
|
|
8
10
|
var _react = require("react");
|
|
11
|
+
|
|
9
12
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
13
|
+
|
|
10
14
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
15
|
+
|
|
11
16
|
var _lodash = require("lodash");
|
|
12
|
-
|
|
13
|
-
var _templateObject, _templateObject2;
|
|
17
|
+
|
|
14
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
15
|
-
|
|
16
|
-
function
|
|
17
|
-
|
|
18
|
-
function
|
|
19
|
-
|
|
20
|
-
function
|
|
21
|
-
|
|
19
|
+
|
|
20
|
+
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
|
21
|
+
|
|
22
|
+
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
23
|
+
|
|
24
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }
|
|
25
|
+
|
|
26
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); }
|
|
27
|
+
|
|
28
|
+
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; }
|
|
29
|
+
|
|
22
30
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
31
|
+
|
|
23
32
|
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; }
|
|
33
|
+
|
|
24
34
|
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; }
|
|
35
|
+
|
|
36
|
+
function _templateObject2() {
|
|
37
|
+
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"]);
|
|
38
|
+
|
|
39
|
+
_templateObject2 = function _templateObject2() {
|
|
40
|
+
return data;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
return data;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function _templateObject() {
|
|
47
|
+
var data = _taggedTemplateLiteral(["\n margin: 0;\n padding: 0;\n list-style: none;\n text-align: right;\n"]);
|
|
48
|
+
|
|
49
|
+
_templateObject = function _templateObject() {
|
|
50
|
+
return data;
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
return data;
|
|
54
|
+
}
|
|
55
|
+
|
|
25
56
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
26
|
-
|
|
27
|
-
var
|
|
57
|
+
|
|
58
|
+
var Navs = _styledComponents["default"].ul(_templateObject());
|
|
59
|
+
|
|
60
|
+
var NavItem = _styledComponents["default"].li(_templateObject2(), function (props) {
|
|
28
61
|
return props.theme.size === 'large' ? '60px' : '50px';
|
|
29
62
|
}, function (props) {
|
|
30
63
|
return props.theme.secondaryTextColor;
|
|
@@ -33,30 +66,35 @@ var NavItem = _styledComponents["default"].li(_templateObject2 || (_templateObje
|
|
|
33
66
|
}, function (props) {
|
|
34
67
|
return props.theme.primaryColor;
|
|
35
68
|
});
|
|
69
|
+
|
|
36
70
|
var HeaderNavs = (0, _styledComponents.withTheme)(function (_ref) {
|
|
37
71
|
var theme = _ref.theme,
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
72
|
+
_ref$navs = _ref.navs,
|
|
73
|
+
navs = _ref$navs === void 0 ? [] : _ref$navs,
|
|
74
|
+
onChange = _ref.onChange,
|
|
75
|
+
onSelect = _ref.onSelect,
|
|
76
|
+
props = _objectWithoutProperties(_ref, ["theme", "navs", "onChange", "onSelect"]);
|
|
77
|
+
|
|
43
78
|
var _useState = (0, _react.useState)(props.selectedKey || (0, _lodash.get)(navs, '0.key')),
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
79
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
80
|
+
selectedKey = _useState2[0],
|
|
81
|
+
setSelectedKey = _useState2[1];
|
|
82
|
+
|
|
47
83
|
var onClickNav = function onClickNav(nav) {
|
|
48
84
|
setSelectedKey(nav.key);
|
|
49
85
|
onSelect && onSelect(nav);
|
|
86
|
+
|
|
50
87
|
if (selectedKey !== nav.key) {
|
|
51
88
|
onChange && onChange(nav);
|
|
52
89
|
setSelectedKey(nav.key);
|
|
53
90
|
}
|
|
54
91
|
};
|
|
92
|
+
|
|
55
93
|
(0, _react.useEffect)(function () {
|
|
56
94
|
setSelectedKey(props.selectedKey || (0, _lodash.get)(navs, '0.key'));
|
|
57
95
|
}, [navs, props.selectedKey]);
|
|
58
|
-
return
|
|
59
|
-
return
|
|
96
|
+
return React.createElement(Navs, props, navs.map(function (nav) {
|
|
97
|
+
return React.createElement(NavItem, {
|
|
60
98
|
key: nav.key,
|
|
61
99
|
theme: theme,
|
|
62
100
|
className: (0, _classnames["default"])({
|
|
@@ -65,7 +103,7 @@ var HeaderNavs = (0, _styledComponents.withTheme)(function (_ref) {
|
|
|
65
103
|
onClick: function onClick() {
|
|
66
104
|
return onClickNav(nav);
|
|
67
105
|
}
|
|
68
|
-
},
|
|
106
|
+
}, React.createElement("a", {
|
|
69
107
|
href: nav.key,
|
|
70
108
|
onClick: function onClick(evt) {
|
|
71
109
|
return evt.preventDefault();
|