tntd 1.4.9 → 1.4.11
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/Layout/AppList.js +1 -1
- package/components/Layout/GlobalNavigation/NavigationPopup.js +8 -8
- package/components/Layout/GlobalNavigation/index.js +2 -2
- package/components/Layout/HeaderTabs.js +98 -73
- package/components/Layout/OrgAppList.js +14 -15
- package/components/Layout/SideMenu.js +2 -2
- package/components/Layout/index.js +4 -5
- package/components/Layout/paaslayout/CompactSideMenu.js +1 -1
- package/components/Layout/paaslayout/index.js +2 -2
- package/components/Layout/storage.js +1 -1
- package/components/index.js +1 -0
- package/components/{Layout → utils}/checkAuth.js +3 -1
- package/components/utils/findMenuInfoByPath.js +39 -0
- package/components/{Layout/utils.js → utils/index.js} +3 -35
- package/dist/stats.json +9824 -9578
- package/dist/tntd.js +1 -1
- package/es/Layout/AppList.js +1 -1
- package/es/Layout/GlobalNavigation/NavigationPopup.js +1 -1
- package/es/Layout/GlobalNavigation/index.js +1 -1
- package/es/Layout/HeaderTabs.js +19 -15
- package/es/Layout/OrgAppList.js +3 -4
- package/es/Layout/SideMenu.js +1 -1
- package/es/Layout/index.js +5 -4
- package/es/Layout/paaslayout/CompactSideMenu.js +1 -1
- package/es/Layout/paaslayout/index.js +1 -1
- package/es/Layout/storage.js +1 -1
- package/es/index.js +2 -1
- package/es/utils/checkAuth.js +30 -0
- package/es/utils/findMenuInfoByPath.js +41 -0
- package/es/utils/index.js +99 -0
- package/lib/Layout/AppList.js +1 -1
- package/lib/Layout/GlobalNavigation/NavigationPopup.js +1 -1
- package/lib/Layout/GlobalNavigation/index.js +1 -1
- package/lib/Layout/HeaderTabs.js +14 -10
- package/lib/Layout/OrgAppList.js +5 -6
- package/lib/Layout/SideMenu.js +1 -1
- package/lib/Layout/index.js +6 -6
- package/lib/Layout/paaslayout/CompactSideMenu.js +1 -1
- package/lib/Layout/paaslayout/index.js +1 -1
- package/lib/Layout/storage.js +1 -1
- package/lib/index.js +34 -0
- package/lib/utils/checkAuth.js +41 -0
- package/lib/utils/findMenuInfoByPath.js +52 -0
- package/lib/utils/index.js +159 -0
- package/package.json +1 -1
- package/lib/Layout/EnterpriseLayout/Header.js +0 -113
- package/lib/Layout/EnterpriseLayout/HeaderActions.js +0 -104
|
@@ -11,7 +11,7 @@ var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
|
11
11
|
|
|
12
12
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
13
|
|
|
14
|
-
var _utils = require("
|
|
14
|
+
var _utils = require("../../utils");
|
|
15
15
|
|
|
16
16
|
var _Iconfont = _interopRequireDefault(require("../Iconfont"));
|
|
17
17
|
|
|
@@ -19,7 +19,7 @@ var _classnames = _interopRequireDefault(require("classnames"));
|
|
|
19
19
|
|
|
20
20
|
var _lodash = require("lodash");
|
|
21
21
|
|
|
22
|
-
var _utils = require("
|
|
22
|
+
var _utils = require("../../utils");
|
|
23
23
|
|
|
24
24
|
var _HeaderNavs = _interopRequireDefault(require("../HeaderNavs"));
|
|
25
25
|
|
package/lib/Layout/storage.js
CHANGED
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.getThemeStore = exports.setThemeStore = exports.getLanguageStore = exports.setLanguageStore = exports.getCurrentOrgTreeStore = exports.setCurrentOrgTreeStore = exports.getCurrentOrgStore = exports.setCurrentOrgStore = exports.getCurrentAppStore = exports.setCurrentAppStore = exports.setSideMenuStore = exports.getSideMenuStore = void 0;
|
|
7
7
|
|
|
8
|
-
var _utils = require("
|
|
8
|
+
var _utils = require("../utils");
|
|
9
9
|
|
|
10
10
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
11
11
|
|
package/lib/index.js
CHANGED
|
@@ -3,6 +3,27 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
+
var _exportNames = {
|
|
7
|
+
Layout: true,
|
|
8
|
+
AuthContext: true,
|
|
9
|
+
QueryForm: true,
|
|
10
|
+
Table: true,
|
|
11
|
+
ResizableTable: true,
|
|
12
|
+
QueryListScene: true,
|
|
13
|
+
Icon: true,
|
|
14
|
+
iconList: true,
|
|
15
|
+
Modal: true,
|
|
16
|
+
Columns: true,
|
|
17
|
+
DevelopmentLogin: true,
|
|
18
|
+
LoadingButton: true,
|
|
19
|
+
Handle: true,
|
|
20
|
+
Page: true,
|
|
21
|
+
Select: true,
|
|
22
|
+
Img: true,
|
|
23
|
+
Title: true,
|
|
24
|
+
Ellipsis: true,
|
|
25
|
+
ArrayInput: true
|
|
26
|
+
};
|
|
6
27
|
Object.defineProperty(exports, "Layout", {
|
|
7
28
|
enumerable: true,
|
|
8
29
|
get: function get() {
|
|
@@ -156,4 +177,17 @@ var _Ellipsis = _interopRequireDefault(require("./Ellipsis"));
|
|
|
156
177
|
|
|
157
178
|
var _ArrayInput = _interopRequireDefault(require("./ArrayInput"));
|
|
158
179
|
|
|
180
|
+
var _utils = require("./utils");
|
|
181
|
+
|
|
182
|
+
Object.keys(_utils).forEach(function (key) {
|
|
183
|
+
if (key === "default" || key === "__esModule") return;
|
|
184
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
185
|
+
Object.defineProperty(exports, key, {
|
|
186
|
+
enumerable: true,
|
|
187
|
+
get: function get() {
|
|
188
|
+
return _utils[key];
|
|
189
|
+
}
|
|
190
|
+
});
|
|
191
|
+
});
|
|
192
|
+
|
|
159
193
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = exports.getCheckAuth = void 0;
|
|
7
|
+
|
|
8
|
+
var _lodash = require("lodash");
|
|
9
|
+
|
|
10
|
+
var getCheckAuth = function getCheckAuth(menus) {
|
|
11
|
+
var getAuthMap = function getAuthMap() {
|
|
12
|
+
var menus = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
13
|
+
var authMap = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
14
|
+
return menus.reduce(function (acc, _ref) {
|
|
15
|
+
var code = _ref.code,
|
|
16
|
+
groupName = _ref.groupName,
|
|
17
|
+
functionList = _ref.functionList,
|
|
18
|
+
children = _ref.children;
|
|
19
|
+
|
|
20
|
+
if (groupName) {
|
|
21
|
+
return getAuthMap(children, acc);
|
|
22
|
+
} else {
|
|
23
|
+
acc[code] = acc[code] || {};
|
|
24
|
+
acc[code] = (functionList || []).reduce(function (acc, curFunc) {
|
|
25
|
+
acc[curFunc.code] = curFunc.hasPermission;
|
|
26
|
+
return acc;
|
|
27
|
+
}, acc[code]);
|
|
28
|
+
return acc;
|
|
29
|
+
}
|
|
30
|
+
}, authMap);
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
var authMap = getAuthMap(menus);
|
|
34
|
+
return function (menuCode, funCode) {
|
|
35
|
+
return !!(0, _lodash.get)(authMap, "".concat(menuCode).concat(funCode ? ".".concat(funCode) : ''));
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
exports.getCheckAuth = getCheckAuth;
|
|
40
|
+
var _default = getCheckAuth;
|
|
41
|
+
exports["default"] = _default;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = exports.findMenuInfoByPath = void 0;
|
|
7
|
+
|
|
8
|
+
var _ = require(".");
|
|
9
|
+
|
|
10
|
+
var findMenuInfoByPath = function findMenuInfoByPath(menuTree, path, matchFunc) {
|
|
11
|
+
var menu;
|
|
12
|
+
var subMenu;
|
|
13
|
+
var matchedSubMenu;
|
|
14
|
+
var parentMenus;
|
|
15
|
+
|
|
16
|
+
if (path) {
|
|
17
|
+
(0, _.traverseTree)(menuTree, function (menu, pnode, pnodes) {
|
|
18
|
+
if (!(0, _.isGroupMenu)(menu)) {
|
|
19
|
+
var _menu;
|
|
20
|
+
|
|
21
|
+
if (((_menu = menu) == null ? void 0 : _menu.path) === path) {
|
|
22
|
+
subMenu = menu;
|
|
23
|
+
menu = pnode;
|
|
24
|
+
parentMenus = pnodes;
|
|
25
|
+
return false;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
if (!matchedSubMenu && matchFunc && matchFunc(menu)) {
|
|
29
|
+
matchedSubMenu = menu;
|
|
30
|
+
menu = pnode;
|
|
31
|
+
parentMenus = pnodes;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
return {
|
|
36
|
+
subMenu: subMenu,
|
|
37
|
+
matchedSubMenu: matchedSubMenu,
|
|
38
|
+
menu: menu,
|
|
39
|
+
parentMenus: parentMenus
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
return {
|
|
44
|
+
subMenu: subMenu,
|
|
45
|
+
menu: menu,
|
|
46
|
+
parentMenus: parentMenus
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
exports.findMenuInfoByPath = findMenuInfoByPath;
|
|
51
|
+
var _default = findMenuInfoByPath;
|
|
52
|
+
exports["default"] = _default;
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _exportNames = {
|
|
7
|
+
isGroupMenu: true,
|
|
8
|
+
getSelectedMenuInfo: true,
|
|
9
|
+
hasLevel3: true,
|
|
10
|
+
isNewTabMenu: true,
|
|
11
|
+
openInNewTab: true,
|
|
12
|
+
traverseTree: true,
|
|
13
|
+
safeParseJSON: true
|
|
14
|
+
};
|
|
15
|
+
exports.safeParseJSON = exports.traverseTree = exports.openInNewTab = exports.isNewTabMenu = exports.hasLevel3 = exports.getSelectedMenuInfo = exports.isGroupMenu = void 0;
|
|
16
|
+
|
|
17
|
+
var _checkAuth = require("./checkAuth");
|
|
18
|
+
|
|
19
|
+
Object.keys(_checkAuth).forEach(function (key) {
|
|
20
|
+
if (key === "default" || key === "__esModule") return;
|
|
21
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
22
|
+
Object.defineProperty(exports, key, {
|
|
23
|
+
enumerable: true,
|
|
24
|
+
get: function get() {
|
|
25
|
+
return _checkAuth[key];
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
var _findMenuInfoByPath = require("./findMenuInfoByPath");
|
|
31
|
+
|
|
32
|
+
Object.keys(_findMenuInfoByPath).forEach(function (key) {
|
|
33
|
+
if (key === "default" || key === "__esModule") return;
|
|
34
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
35
|
+
Object.defineProperty(exports, key, {
|
|
36
|
+
enumerable: true,
|
|
37
|
+
get: function get() {
|
|
38
|
+
return _findMenuInfoByPath[key];
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); }
|
|
44
|
+
|
|
45
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); }
|
|
46
|
+
|
|
47
|
+
function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); }
|
|
48
|
+
|
|
49
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } }
|
|
50
|
+
|
|
51
|
+
var isGroupMenu = function isGroupMenu(menu) {
|
|
52
|
+
return (menu == null ? void 0 : menu.children) && !(menu == null ? void 0 : menu.path);
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
exports.isGroupMenu = isGroupMenu;
|
|
56
|
+
|
|
57
|
+
var getSelectedMenuInfo = function getSelectedMenuInfo(selectedKey) {
|
|
58
|
+
var menus = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
59
|
+
var subMenu;
|
|
60
|
+
var menu;
|
|
61
|
+
var parentMenus = [];
|
|
62
|
+
|
|
63
|
+
if (selectedKey) {
|
|
64
|
+
traverseTree(menus, function (node, pnode, pnodes) {
|
|
65
|
+
if (!isGroupMenu(node) && node.code === selectedKey) {
|
|
66
|
+
subMenu = node;
|
|
67
|
+
menu = pnode;
|
|
68
|
+
parentMenus = pnodes;
|
|
69
|
+
return false;
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
} else {
|
|
73
|
+
// 默认找到第一个菜单项
|
|
74
|
+
traverseTree(menus, function (node, pnode, pnodes) {
|
|
75
|
+
if (!isGroupMenu(node)) {
|
|
76
|
+
subMenu = node;
|
|
77
|
+
menu = pnode;
|
|
78
|
+
parentMenus = pnodes;
|
|
79
|
+
return false;
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
return {
|
|
85
|
+
subMenu: subMenu,
|
|
86
|
+
menu: menu,
|
|
87
|
+
parentMenus: parentMenus
|
|
88
|
+
};
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
exports.getSelectedMenuInfo = getSelectedMenuInfo;
|
|
92
|
+
|
|
93
|
+
var hasLevel3 = function hasLevel3(menus) {
|
|
94
|
+
return menus == null ? void 0 : menus.some(function (menu) {
|
|
95
|
+
var _menu$children;
|
|
96
|
+
|
|
97
|
+
return menu == null ? void 0 : (_menu$children = menu.children) == null ? void 0 : _menu$children.some(function (item) {
|
|
98
|
+
var _item$children;
|
|
99
|
+
|
|
100
|
+
return item == null ? void 0 : (_item$children = item.children) == null ? void 0 : _item$children.length;
|
|
101
|
+
});
|
|
102
|
+
});
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
exports.hasLevel3 = hasLevel3;
|
|
106
|
+
|
|
107
|
+
var isNewTabMenu = function isNewTabMenu(menu) {
|
|
108
|
+
var _ref = menu || {},
|
|
109
|
+
target = _ref.target,
|
|
110
|
+
path = _ref.path;
|
|
111
|
+
|
|
112
|
+
return target === '_blank' || /^http/i.test(path) && /blankType=newTarget/.test(path);
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
exports.isNewTabMenu = isNewTabMenu;
|
|
116
|
+
|
|
117
|
+
var openInNewTab = function openInNewTab(path) {
|
|
118
|
+
window.open(path, '_blank');
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
exports.openInNewTab = openInNewTab;
|
|
122
|
+
|
|
123
|
+
var traverseTree = function traverseTree(treeData, callback, pnode) {
|
|
124
|
+
var pnodes = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];
|
|
125
|
+
(treeData || []).every(function (node, index) {
|
|
126
|
+
var result;
|
|
127
|
+
|
|
128
|
+
if (callback) {
|
|
129
|
+
result = callback(node, pnode, (pnodes == null ? void 0 : pnodes.length) ? pnodes : [pnode].filter(function (item) {
|
|
130
|
+
return !!item;
|
|
131
|
+
}), index);
|
|
132
|
+
} // 回调函数返回false则终止遍历
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
if (result !== false) {
|
|
136
|
+
node && traverseTree(node.children || [], callback, node, [node].concat(_toConsumableArray(pnodes)));
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
return result !== false;
|
|
140
|
+
});
|
|
141
|
+
return treeData;
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
exports.traverseTree = traverseTree;
|
|
145
|
+
|
|
146
|
+
var safeParseJSON = function safeParseJSON(str, defaultObj) {
|
|
147
|
+
var result;
|
|
148
|
+
|
|
149
|
+
try {
|
|
150
|
+
result = JSON.parse(str);
|
|
151
|
+
} catch (err) {
|
|
152
|
+
console.warn('json parse error:', err);
|
|
153
|
+
result = typeof defaultObj === 'undefined' ? str : defaultObj;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
return result || defaultObj;
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
exports.safeParseJSON = safeParseJSON;
|
package/package.json
CHANGED
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
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
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports["default"] = void 0;
|
|
9
|
-
|
|
10
|
-
var _react = require("react");
|
|
11
|
-
|
|
12
|
-
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
13
|
-
|
|
14
|
-
var _Icon = _interopRequireDefault(require("../../Icon"));
|
|
15
|
-
|
|
16
|
-
var _AppList = _interopRequireDefault(require("../AppList"));
|
|
17
|
-
|
|
18
|
-
var _OrgAppList = _interopRequireDefault(require("../OrgAppList"));
|
|
19
|
-
|
|
20
|
-
var _HeaderActions = _interopRequireDefault(require("./HeaderActions"));
|
|
21
|
-
|
|
22
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
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\n .hasHeaderTabs & {\n background: #191D29;\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
|
-
|
|
50
|
-
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
51
|
-
|
|
52
|
-
var Header = _styledComponents["default"].div(_templateObject(), function (props) {
|
|
53
|
-
return "".concat(props.theme.headerHeight, "px");
|
|
54
|
-
}, function (props) {
|
|
55
|
-
return "".concat(props.theme.blueBgColor, " !important");
|
|
56
|
-
}, function (props) {
|
|
57
|
-
return "".concat(props.theme.headerHeight, "px");
|
|
58
|
-
}, function (props) {
|
|
59
|
-
return "".concat(props.theme.headerHeight, "px");
|
|
60
|
-
}, function (props) {
|
|
61
|
-
return "".concat(props.theme.headerHeight, "px");
|
|
62
|
-
}, function (props) {
|
|
63
|
-
return "".concat(props.theme.primaryTextColor);
|
|
64
|
-
}, function (props) {
|
|
65
|
-
return "".concat(props.theme.primaryTextColor);
|
|
66
|
-
});
|
|
67
|
-
|
|
68
|
-
var Content = _styledComponents["default"].div(_templateObject2());
|
|
69
|
-
|
|
70
|
-
var _default = (0, _styledComponents.withTheme)(function (props) {
|
|
71
|
-
var collapsed = props.collapsed,
|
|
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
|
-
selectedOrgKey = props.selectedOrgKey,
|
|
79
|
-
orgList = props.orgList,
|
|
80
|
-
headerTabs = props.headerTabs,
|
|
81
|
-
onAppChange = props.onAppChange,
|
|
82
|
-
onOrgChange = props.onOrgChange,
|
|
83
|
-
onCollapseChange = props.onCollapseChange,
|
|
84
|
-
extraActions = props.extraActions;
|
|
85
|
-
var headerRef = (0, _react.useRef)();
|
|
86
|
-
return React.createElement(Header, {
|
|
87
|
-
className: "tnt-layout-header",
|
|
88
|
-
ref: headerRef
|
|
89
|
-
}, collapseIconPlacement === 'right' && React.createElement("div", {
|
|
90
|
-
className: "sidebar-collapsed-controller",
|
|
91
|
-
onClick: onCollapseChange
|
|
92
|
-
}, React.createElement(_Icon["default"], {
|
|
93
|
-
type: "menu-".concat(collapsed ? 'unfold' : 'fold')
|
|
94
|
-
})), headerTabs, orgList && React.createElement(_OrgAppList["default"], {
|
|
95
|
-
orgAppShow: orgAppShow,
|
|
96
|
-
selectedOrgKey: selectedOrgKey,
|
|
97
|
-
orgList: orgList,
|
|
98
|
-
onOrgChange: onOrgChange,
|
|
99
|
-
selectedAppKey: selectedAppKey,
|
|
100
|
-
orgAppList: orgAppList,
|
|
101
|
-
onAppChange: onAppChange
|
|
102
|
-
}), appList && !orgList && React.createElement(_AppList["default"], {
|
|
103
|
-
items: appList,
|
|
104
|
-
selectedKey: selectedAppKey,
|
|
105
|
-
onChange: onAppChange
|
|
106
|
-
}), React.createElement(Content, {
|
|
107
|
-
className: "tnt-layout-header-content"
|
|
108
|
-
}, props.children), React.createElement(_HeaderActions["default"], _extends({}, props, {
|
|
109
|
-
headerRef: headerRef
|
|
110
|
-
}), extraActions));
|
|
111
|
-
});
|
|
112
|
-
|
|
113
|
-
exports["default"] = _default;
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
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
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports["default"] = void 0;
|
|
9
|
-
|
|
10
|
-
require("antd/lib/divider/style");
|
|
11
|
-
|
|
12
|
-
var _divider = _interopRequireDefault(require("antd/lib/divider"));
|
|
13
|
-
|
|
14
|
-
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
15
|
-
|
|
16
|
-
var _GlobalNavigation = _interopRequireDefault(require("../GlobalNavigation"));
|
|
17
|
-
|
|
18
|
-
var _Application = _interopRequireDefault(require("../Application"));
|
|
19
|
-
|
|
20
|
-
var _Avatar = _interopRequireDefault(require("./Avatar"));
|
|
21
|
-
|
|
22
|
-
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
|
23
|
-
|
|
24
|
-
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; }
|
|
25
|
-
|
|
26
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
27
|
-
|
|
28
|
-
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; }
|
|
29
|
-
|
|
30
|
-
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; }
|
|
31
|
-
|
|
32
|
-
function _templateObject() {
|
|
33
|
-
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:not(.tnt-themeS1) & {\n color: rgba(255,255,255,.8);\n }\n }\n"]);
|
|
34
|
-
|
|
35
|
-
_templateObject = function _templateObject() {
|
|
36
|
-
return data;
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
return data;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
43
|
-
|
|
44
|
-
var Actions = _styledComponents["default"].ul(_templateObject(), function (props) {
|
|
45
|
-
return "".concat(props.theme.headerHeight, "px");
|
|
46
|
-
}, function (props) {
|
|
47
|
-
return "".concat(props.theme.headerActionsColor);
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
var _default = (0, _styledComponents.withTheme)(function (props) {
|
|
51
|
-
var _props$config = props.config;
|
|
52
|
-
_props$config = _props$config === void 0 ? {} : _props$config;
|
|
53
|
-
|
|
54
|
-
var _props$config$theme = _props$config.theme,
|
|
55
|
-
theme = _props$config$theme === void 0 ? true : _props$config$theme,
|
|
56
|
-
_props$config$avatar = _props$config.avatar,
|
|
57
|
-
avatar = _props$config$avatar === void 0 ? true : _props$config$avatar,
|
|
58
|
-
_props$config$languag = _props$config.language,
|
|
59
|
-
language = _props$config$languag === void 0 ? true : _props$config$languag,
|
|
60
|
-
_props$config$applica = _props$config.application,
|
|
61
|
-
application = _props$config$applica === void 0 ? false : _props$config$applica,
|
|
62
|
-
_props$config$globalN = _props$config.globalNavigation,
|
|
63
|
-
globalNavigation = _props$config$globalN === void 0 ? false : _props$config$globalN,
|
|
64
|
-
compatible = props.theme.compatible,
|
|
65
|
-
_props$userInfo = props.userInfo,
|
|
66
|
-
userInfo = _props$userInfo === void 0 ? {} : _props$userInfo,
|
|
67
|
-
menus = props.menus,
|
|
68
|
-
apps = props.apps,
|
|
69
|
-
extraActions = props.extraActions,
|
|
70
|
-
headerRef = props.headerRef,
|
|
71
|
-
onLanguageChange = props.onLanguageChange,
|
|
72
|
-
onThemeChange = props.onThemeChange,
|
|
73
|
-
onApplicationChange = props.onApplicationChange,
|
|
74
|
-
onAppChange = props.onAppChange,
|
|
75
|
-
onCollapseChange = props.onCollapseChange,
|
|
76
|
-
onPersonalSetting = props.onPersonalSetting,
|
|
77
|
-
onChangePassword = props.onChangePassword,
|
|
78
|
-
onLogout = props.onLogout,
|
|
79
|
-
onLogoClick = props.onLogoClick,
|
|
80
|
-
rest = _objectWithoutProperties(props, ["config", "theme", "userInfo", "menus", "apps", "extraActions", "headerRef", "onLanguageChange", "onThemeChange", "onApplicationChange", "onAppChange", "onCollapseChange", "onPersonalSetting", "onChangePassword", "onLogout", "onLogoClick"]);
|
|
81
|
-
|
|
82
|
-
return React.createElement(Actions, rest, extraActions, globalNavigation && React.createElement(_GlobalNavigation["default"], {
|
|
83
|
-
headerRef: headerRef,
|
|
84
|
-
menus: menus
|
|
85
|
-
}), application && React.createElement(_Application["default"], {
|
|
86
|
-
language: userInfo.lang,
|
|
87
|
-
apps: apps,
|
|
88
|
-
onChange: onApplicationChange
|
|
89
|
-
}), avatar && React.createElement(React.Fragment, null, React.createElement(_divider["default"], {
|
|
90
|
-
type: "vertical"
|
|
91
|
-
}), React.createElement(_Avatar["default"], {
|
|
92
|
-
userInfo: userInfo,
|
|
93
|
-
onThemeChange: onThemeChange,
|
|
94
|
-
onPersonalSetting: onPersonalSetting,
|
|
95
|
-
onChangePassword: onChangePassword,
|
|
96
|
-
onLogout: onLogout,
|
|
97
|
-
config: {
|
|
98
|
-
theme: theme,
|
|
99
|
-
language: language
|
|
100
|
-
}
|
|
101
|
-
})));
|
|
102
|
-
});
|
|
103
|
-
|
|
104
|
-
exports["default"] = _default;
|