tntd 1.4.20 → 1.4.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/Handle/README.md +0 -20
- package/components/Handle/index.js +44 -7
- package/components/locale.js +8 -2
- package/dist/1.tntd.js +1 -1
- package/dist/stats.json +24430 -24390
- package/dist/tntd.css +1 -1
- package/dist/tntd.js +13 -8
- package/es/ArrayInput/icon.js +5 -5
- package/es/ArrayInput/index.js +108 -76
- package/es/AuthContext.js +1 -1
- package/es/Columns/index.js +38 -31
- package/es/DevelopmentLogin/LoginModal.js +45 -32
- package/es/DevelopmentLogin/index.js +17 -13
- package/es/Ellipsis/Svg/CopySVG.js +13 -13
- package/es/Ellipsis/Svg/TickSVG.js +8 -8
- package/es/Ellipsis/index.js +69 -58
- package/es/Handle/README.md +0 -20
- package/es/Handle/index.js +100 -33
- package/es/Icon/fonts/iconfont.js +12 -7
- package/es/Icon/index.js +13 -10
- package/es/Img/Contain.js +29 -24
- package/es/Img/Cover.js +54 -40
- package/es/Img/index.js +45 -36
- package/es/Layout/ActionsContext.js +2 -3
- package/es/Layout/AppList.js +92 -37
- package/es/Layout/Application.js +72 -26
- package/es/Layout/Avatar.js +66 -29
- package/es/Layout/CompatibleLanguage.js +94 -39
- package/es/Layout/EnterpriseLayout/Avatar.js +76 -38
- package/es/Layout/EnterpriseLayout/Language.js +32 -14
- package/es/Layout/EnterpriseLayout/Theme.js +34 -16
- package/es/Layout/EnterpriseLayout/index.js +16 -14
- package/es/Layout/GlobalNavigation/NavigationPopup.js +170 -59
- package/es/Layout/GlobalNavigation/index.js +54 -20
- package/es/Layout/Header.js +46 -25
- package/es/Layout/HeaderActions.js +56 -42
- package/es/Layout/HeaderNavs.js +47 -20
- package/es/Layout/HeaderTabs.js +102 -49
- package/es/Layout/Iconfont.js +1 -1
- package/es/Layout/Language.js +32 -14
- package/es/Layout/Layout.js +108 -86
- package/es/Layout/Logo.js +32 -16
- package/es/Layout/OrgAppList.js +107 -62
- package/es/Layout/SideMenu.js +124 -63
- package/es/Layout/Theme.js +61 -23
- package/es/Layout/checkAuth.js +29 -0
- package/es/Layout/index.js +34 -26
- package/es/Layout/paaslayout/CompactSideMenu.js +74 -35
- package/es/Layout/paaslayout/Header.js +45 -22
- package/es/Layout/paaslayout/Logo.js +13 -3
- package/es/Layout/paaslayout/SideMenu.js +78 -39
- package/es/Layout/paaslayout/index.js +102 -75
- package/es/Layout/storage.js +9 -10
- package/es/Layout/utils.js +136 -0
- package/es/LoadingButton/index.js +24 -15
- package/es/Modal/index.js +46 -38
- package/es/Page/Box.js +41 -34
- package/es/Page/index.js +67 -52
- package/es/Page/utils.js +5 -0
- package/es/QueryForm/Field/Checkbox.js +9 -5
- package/es/QueryForm/Field/Select.js +41 -31
- package/es/QueryForm/Field/SelectInput.js +41 -26
- package/es/QueryForm/Field/fieldsMap.js +1 -0
- package/es/QueryForm/Field/index.js +71 -41
- package/es/QueryForm/createActions.js +7 -6
- package/es/QueryForm/index.js +135 -76
- package/es/QueryListScene/List.js +128 -74
- package/es/QueryListScene/QueryForm.js +81 -46
- package/es/QueryListScene/QueryListScene.js +40 -25
- package/es/QueryListScene/Title.js +3 -3
- package/es/QueryListScene/Toolbar.js +12 -11
- package/es/Select/DropDownWrap.js +50 -29
- package/es/Select/index.js +231 -135
- package/es/Table/ResizableTable/index.js +40 -26
- package/es/Table/index.js +16 -18
- package/es/Title/index.js +23 -21
- package/es/locale.js +11 -3
- package/es/utils/checkAuth.js +5 -3
- package/es/utils/findMenuInfoByPath.js +4 -0
- package/es/utils/index.js +23 -12
- package/lib/ArrayInput/icon.js +6 -6
- package/lib/ArrayInput/index.js +127 -78
- package/lib/AuthContext.js +4 -1
- package/lib/Columns/index.js +47 -31
- package/lib/DevelopmentLogin/LoginModal.js +58 -32
- package/lib/DevelopmentLogin/index.js +27 -16
- package/lib/Ellipsis/Svg/CopySVG.js +15 -13
- package/lib/Ellipsis/Svg/TickSVG.js +10 -8
- package/lib/Ellipsis/index.js +80 -57
- package/lib/Handle/README.md +0 -20
- package/lib/Handle/index.js +119 -33
- package/lib/Icon/fonts/iconfont.js +12 -7
- package/lib/Icon/index.js +20 -11
- package/lib/Img/Contain.js +34 -24
- package/lib/Img/Cover.js +65 -42
- package/lib/Img/index.js +51 -36
- package/lib/Layout/ActionsContext.js +4 -1
- package/lib/Layout/AppList.js +118 -40
- package/lib/Layout/Application.js +86 -26
- package/lib/Layout/Avatar.js +86 -32
- package/lib/Layout/CompatibleLanguage.js +110 -39
- package/lib/Layout/EnterpriseLayout/Avatar.js +100 -41
- package/lib/Layout/EnterpriseLayout/Header.js +113 -0
- package/lib/Layout/EnterpriseLayout/HeaderActions.js +104 -0
- package/lib/Layout/EnterpriseLayout/Language.js +48 -17
- package/lib/Layout/EnterpriseLayout/Theme.js +44 -16
- package/lib/Layout/EnterpriseLayout/index.js +23 -14
- package/lib/Layout/GlobalNavigation/NavigationPopup.js +186 -59
- package/lib/Layout/GlobalNavigation/index.js +74 -23
- package/lib/Layout/Header.js +63 -28
- package/lib/Layout/HeaderActions.js +74 -45
- package/lib/Layout/HeaderNavs.js +61 -23
- package/lib/Layout/HeaderTabs.js +118 -51
- package/lib/Layout/Iconfont.js +5 -1
- package/lib/Layout/Language.js +48 -17
- package/lib/Layout/Layout.js +128 -88
- package/lib/Layout/Logo.js +43 -19
- package/lib/Layout/OrgAppList.js +127 -64
- package/lib/Layout/SideMenu.js +143 -65
- package/lib/Layout/Theme.js +73 -23
- package/lib/Layout/checkAuth.js +39 -0
- package/lib/Layout/createActions.js +5 -0
- package/lib/Layout/images/index.js +28 -0
- package/lib/Layout/index.js +55 -30
- package/lib/Layout/paaslayout/CompactSideMenu.js +84 -35
- package/lib/Layout/paaslayout/Header.js +55 -22
- package/lib/Layout/paaslayout/Logo.js +19 -3
- package/lib/Layout/paaslayout/SideMenu.js +87 -39
- package/lib/Layout/paaslayout/index.js +122 -77
- package/lib/Layout/storage.js +40 -11
- package/lib/Layout/utils.js +166 -0
- package/lib/LoadingButton/index.js +29 -15
- package/lib/Modal/index.js +53 -38
- package/lib/Page/Box.js +45 -34
- package/lib/Page/index.js +77 -52
- package/lib/Page/utils.js +9 -1
- package/lib/QueryForm/Field/Checkbox.js +13 -5
- package/lib/QueryForm/Field/Select.js +53 -33
- package/lib/QueryForm/Field/SelectInput.js +56 -28
- package/lib/QueryForm/Field/fieldsMap.js +15 -1
- package/lib/QueryForm/Field/index.js +81 -43
- package/lib/QueryForm/createActions.js +12 -6
- package/lib/QueryForm/index.js +157 -78
- package/lib/QueryForm/useForm.js +5 -0
- package/lib/QueryListScene/List.js +140 -76
- package/lib/QueryListScene/QueryForm.js +86 -46
- package/lib/QueryListScene/QueryListScene.js +46 -25
- package/lib/QueryListScene/Title.js +7 -3
- package/lib/QueryListScene/Toolbar.js +16 -11
- package/lib/QueryListScene/createActions.js +5 -0
- package/lib/QueryListScene/index.js +10 -0
- package/lib/QueryListScene/useActions.js +5 -0
- package/lib/Select/DropDownWrap.js +56 -31
- package/lib/Select/index.js +241 -135
- package/lib/Table/ResizableTable/index.js +48 -26
- package/lib/Table/index.js +28 -17
- package/lib/Title/index.js +28 -21
- package/lib/index.js +56 -35
- package/lib/locale.js +19 -4
- package/lib/utils/checkAuth.js +9 -4
- package/lib/utils/findMenuInfoByPath.js +8 -1
- package/lib/utils/index.js +42 -15
- package/package.json +2 -2
package/lib/Layout/AppList.js
CHANGED
|
@@ -1,61 +1,125 @@
|
|
|
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/dropdown/style");
|
|
11
|
+
|
|
9
12
|
var _dropdown = _interopRequireDefault(require("antd/lib/dropdown"));
|
|
13
|
+
|
|
10
14
|
require("antd/lib/input/style");
|
|
15
|
+
|
|
11
16
|
var _input = _interopRequireDefault(require("antd/lib/input"));
|
|
17
|
+
|
|
12
18
|
require("antd/lib/tree-select/style");
|
|
19
|
+
|
|
13
20
|
var _treeSelect = _interopRequireDefault(require("antd/lib/tree-select"));
|
|
21
|
+
|
|
14
22
|
require("antd/lib/menu/style");
|
|
23
|
+
|
|
15
24
|
var _menu = _interopRequireDefault(require("antd/lib/menu"));
|
|
25
|
+
|
|
16
26
|
require("antd/lib/select/style");
|
|
27
|
+
|
|
17
28
|
var _select = _interopRequireDefault(require("antd/lib/select"));
|
|
29
|
+
|
|
18
30
|
var _react = require("react");
|
|
31
|
+
|
|
19
32
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
33
|
+
|
|
20
34
|
var _lodash = require("lodash");
|
|
35
|
+
|
|
21
36
|
var _Icon = _interopRequireDefault(require("../Icon"));
|
|
37
|
+
|
|
22
38
|
var _storage = require("./storage");
|
|
39
|
+
|
|
23
40
|
var _utils = require("../utils");
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
function
|
|
30
|
-
|
|
41
|
+
|
|
42
|
+
var _this = void 0;
|
|
43
|
+
|
|
44
|
+
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
|
45
|
+
|
|
46
|
+
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; }
|
|
47
|
+
|
|
31
48
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
32
|
-
|
|
33
|
-
function
|
|
34
|
-
|
|
35
|
-
function
|
|
36
|
-
|
|
49
|
+
|
|
50
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }
|
|
51
|
+
|
|
52
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); }
|
|
53
|
+
|
|
54
|
+
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; }
|
|
55
|
+
|
|
37
56
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
57
|
+
|
|
58
|
+
function _templateObject4() {
|
|
59
|
+
var data = _taggedTemplateLiteral(["\n display: block;\n color: #666;\n line-height: ", ";\n font-size: ", ";\n\n .tnt-themeS1 & {\n color: rgba(255,255,255,.85);\n }\n &:hover {\n color: #666;\n }\n i {\n margin-left: 12px;\n }\n"]);
|
|
60
|
+
|
|
61
|
+
_templateObject4 = function _templateObject4() {
|
|
62
|
+
return data;
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
return data;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function _templateObject3() {
|
|
69
|
+
var data = _taggedTemplateLiteral(["\n min-width: 160px;\n height: 28px;\n line-height: 28;\n position: relative;\n top: 50%;\n transform: translateY(-50%);\n"]);
|
|
70
|
+
|
|
71
|
+
_templateObject3 = function _templateObject3() {
|
|
72
|
+
return data;
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
return data;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
function _templateObject2() {
|
|
79
|
+
var data = _taggedTemplateLiteral(["\n min-width: 160px;\n height: 28px;\n line-height: 28;\n position: relative;\n top: 50%;\n transform: translateY(-50%);\n .ant-select-selection, .ant-select-selection__rendered {\n line-height: 28px;\n height: 28px;\n }\n\n .ant-select-selection {\n .hasHeaderTabs & {\n border-radius: 14px;\n font-size: 12px;\n // \u53BB\u6389\u9ED8\u8BA4\u9ED1\u8272\n // background: #191D29;\n // border: 1px solid rgba(186,189,197,0.60);\n // color: rgba(255,255,255,.8);\n // \u7EDF\u4E00\u4E3A\u6D45\u8272\u8C03\n background: #fff !important;\n border-color: #c9d2dd !important;\n color: #8b919e !important;\n }\n // \u7EDF\u4E00\u8272\u8C03\n // .tnt-themeS1.hasHeaderTabs & {\n // /* background: #141825; */\n // /* color: rgba(255,255,255,.85); */\n // background: #fff;\n // border-color: #c9d2dd;\n // color: #8b919e;\n // }\n\n // .tnt-themeS3.hasHeaderTabs &{\n // background: ", "; //#1D4295\n // color: rgba(255,255,255,0.8);\n // border-color: rgba(255,255,255,0.5);\n // }\n }\n\n .ant-select-arrow {\n .hasHeaderTabs & {\n color: #B2BECD;\n }\n .tnt-themeS1 & {\n /* color: rgba(255,255,255,.85); */\n }\n }\n\n .tnt-themeS1 & {\n border-radius: 2px;\n }\n\n .isInIframe & {\n margin-left: 20px;\n }\n"]);
|
|
80
|
+
|
|
81
|
+
_templateObject2 = function _templateObject2() {
|
|
82
|
+
return data;
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
return data;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
function _templateObject() {
|
|
89
|
+
var data = _taggedTemplateLiteral(["\n border-radius: 0;\n min-width: 250px;\n max-height: 350px;\n overflow-y: auto;\n border: 1px solid #ccc;\n box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2) !important;\n .ant-dropdown-menu-item {\n padding: 0 20px;\n height: 44px;\n line-height: 44px;\n &:hover {\n background: rgba(0, 0, 0, 0.1);\n }\n &.app-search-warp {\n padding: 0;\n &:hover {\n background: none;\n }\n .ant-input-affix-wrapper {\n height: 100%;\n }\n .ant-input {\n border: none;\n border-bottom: 1px dashed #dcdcdc;\n box-shadow: none;\n padding: 0 20px;\n }\n }\n i {\n margin-right: 0 !important;\n margin-left: 6px !important;\n }\n }\n .isInIframe & {\n margin-left: 20px;\n }\n"]);
|
|
90
|
+
|
|
91
|
+
_templateObject = function _templateObject() {
|
|
92
|
+
return data;
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
return data;
|
|
96
|
+
}
|
|
97
|
+
|
|
38
98
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
99
|
+
|
|
39
100
|
var Option = _select["default"].Option;
|
|
40
|
-
var MenuList = (0, _styledComponents["default"])(_menu["default"])(_templateObject
|
|
101
|
+
var MenuList = (0, _styledComponents["default"])(_menu["default"])(_templateObject()); // 新版UI
|
|
41
102
|
|
|
42
|
-
|
|
43
|
-
var AppsSelect = (0, _styledComponents["default"])(_select["default"])(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n min-width: 160px;\n height: 28px;\n line-height: 28;\n position: relative;\n top: 50%;\n transform: translateY(-50%);\n .ant-select-selection, .ant-select-selection__rendered {\n line-height: 28px;\n height: 28px;\n }\n\n .ant-select-selection {\n .hasHeaderTabs & {\n border-radius: 14px;\n font-size: 12px;\n // \u53BB\u6389\u9ED8\u8BA4\u9ED1\u8272\n // background: #191D29;\n // border: 1px solid rgba(186,189,197,0.60);\n // color: rgba(255,255,255,.8);\n // \u7EDF\u4E00\u4E3A\u6D45\u8272\u8C03\n background: #fff !important;\n border-color: #c9d2dd !important;\n color: #8b919e !important;\n }\n // \u7EDF\u4E00\u8272\u8C03\n // .tnt-themeS1.hasHeaderTabs & {\n // /* background: #141825; */\n // /* color: rgba(255,255,255,.85); */\n // background: #fff;\n // border-color: #c9d2dd;\n // color: #8b919e;\n // }\n\n // .tnt-themeS3.hasHeaderTabs &{\n // background: ", "; //#1D4295\n // color: rgba(255,255,255,0.8);\n // border-color: rgba(255,255,255,0.5);\n // }\n }\n\n .ant-select-arrow {\n .hasHeaderTabs & {\n color: #B2BECD;\n }\n .tnt-themeS1 & {\n /* color: rgba(255,255,255,.85); */\n }\n }\n\n .tnt-themeS1 & {\n border-radius: 2px;\n }\n\n .isInIframe & {\n margin-left: 20px;\n }\n"])), function (props) {
|
|
103
|
+
var AppsSelect = (0, _styledComponents["default"])(_select["default"])(_templateObject2(), function (props) {
|
|
44
104
|
return "".concat(props.theme.blueBgColor, " !important");
|
|
45
105
|
});
|
|
46
|
-
var AppTreeSelect = (0, _styledComponents["default"])(_treeSelect["default"])(_templateObject3
|
|
47
|
-
|
|
106
|
+
var AppTreeSelect = (0, _styledComponents["default"])(_treeSelect["default"])(_templateObject3());
|
|
107
|
+
|
|
108
|
+
var SwitchAppMenu = _styledComponents["default"].a(_templateObject4(), function (props) {
|
|
48
109
|
return "".concat(props.theme.headerHeight, "px");
|
|
49
110
|
}, function (props) {
|
|
50
111
|
return "".concat(props.theme.size === 'large' ? 16 : 14, "px");
|
|
51
112
|
});
|
|
113
|
+
|
|
52
114
|
var _default = (0, _styledComponents.withTheme)(function (props) {
|
|
53
115
|
var selectedKey = props.selectedKey,
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
116
|
+
_props$items = props.items,
|
|
117
|
+
items = _props$items === void 0 ? [] : _props$items,
|
|
118
|
+
onChange = props.onChange;
|
|
119
|
+
|
|
57
120
|
var getInitialSelectedApp = function getInitialSelectedApp() {
|
|
58
121
|
var currentAppStore = (0, _storage.getCurrentAppStore)();
|
|
122
|
+
|
|
59
123
|
var findAppByKey = function findAppByKey(selectedKey) {
|
|
60
124
|
var findApp;
|
|
61
125
|
(0, _utils.traverseTree)(items, function (item) {
|
|
@@ -66,29 +130,34 @@ var _default = (0, _styledComponents.withTheme)(function (props) {
|
|
|
66
130
|
});
|
|
67
131
|
return findApp;
|
|
68
132
|
};
|
|
133
|
+
|
|
69
134
|
var currentApp = findAppByKey(selectedKey || (0, _lodash.get)(currentAppStore, 'key'));
|
|
70
135
|
return currentApp || items[0];
|
|
71
136
|
};
|
|
137
|
+
|
|
72
138
|
var changeApp = function changeApp(app) {
|
|
73
139
|
setSelectedApp(app);
|
|
74
140
|
(0, _storage.setCurrentAppStore)(app);
|
|
75
141
|
onChange && onChange(app);
|
|
76
142
|
};
|
|
143
|
+
|
|
77
144
|
var _useState = (0, _react.useState)(),
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
145
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
146
|
+
searchValue = _useState2[0],
|
|
147
|
+
setSearchValue = _useState2[1];
|
|
148
|
+
|
|
81
149
|
var _useState3 = (0, _react.useState)(getInitialSelectedApp()),
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
150
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
151
|
+
selectedApp = _useState4[0],
|
|
152
|
+
setSelectedApp = _useState4[1];
|
|
153
|
+
|
|
154
|
+
var Menus = React.createElement(MenuList, {
|
|
86
155
|
selectedKeys: [(0, _lodash.get)(selectedApp, 'key')]
|
|
87
|
-
},
|
|
156
|
+
}, React.createElement(_menu["default"].Item, {
|
|
88
157
|
className: "app-search-warp",
|
|
89
158
|
key: "search",
|
|
90
159
|
disabled: true
|
|
91
|
-
},
|
|
160
|
+
}, React.createElement(_input["default"], {
|
|
92
161
|
allowClear: true,
|
|
93
162
|
placeholder: "\u8F93\u5165\u5173\u952E\u8BCD\u641C\u7D22",
|
|
94
163
|
value: searchValue,
|
|
@@ -97,31 +166,37 @@ var _default = (0, _styledComponents.withTheme)(function (props) {
|
|
|
97
166
|
}
|
|
98
167
|
})), items.filter(function () {
|
|
99
168
|
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
100
|
-
|
|
101
|
-
|
|
169
|
+
key = _ref.key,
|
|
170
|
+
name = _ref.name;
|
|
171
|
+
|
|
102
172
|
var regExp = new RegExp(searchValue, 'i');
|
|
173
|
+
|
|
103
174
|
if (searchValue) {
|
|
104
175
|
return regExp.test(key) || regExp.test(name);
|
|
105
176
|
}
|
|
177
|
+
|
|
106
178
|
return true;
|
|
107
179
|
}).map(function (item) {
|
|
108
|
-
return
|
|
180
|
+
return React.createElement(_menu["default"].Item, {
|
|
109
181
|
key: item.key,
|
|
110
182
|
onClick: changeApp.bind(_this, item)
|
|
111
183
|
}, item.name);
|
|
112
184
|
}));
|
|
113
185
|
(0, _react.useEffect)(function () {
|
|
114
186
|
var newApp = getInitialSelectedApp();
|
|
187
|
+
|
|
115
188
|
if ((newApp == null ? void 0 : newApp.key) !== (selectedApp == null ? void 0 : selectedApp.key)) {
|
|
116
189
|
changeApp(newApp);
|
|
117
190
|
}
|
|
118
191
|
}, [items, selectedKey]);
|
|
192
|
+
|
|
119
193
|
if (!props.theme.compatible) {
|
|
120
|
-
if (items
|
|
194
|
+
if (items == null ? void 0 : items.some(function (item) {
|
|
121
195
|
var _item$children;
|
|
196
|
+
|
|
122
197
|
return (_item$children = item.children) == null ? void 0 : _item$children.length;
|
|
123
198
|
})) {
|
|
124
|
-
return
|
|
199
|
+
return React.createElement(AppTreeSelect, {
|
|
125
200
|
placeholder: "\u8BF7\u9009\u62E9",
|
|
126
201
|
showSearch: true,
|
|
127
202
|
treeNodeFilterProp: "title",
|
|
@@ -154,7 +229,8 @@ var _default = (0, _styledComponents.withTheme)(function (props) {
|
|
|
154
229
|
}
|
|
155
230
|
});
|
|
156
231
|
}
|
|
157
|
-
|
|
232
|
+
|
|
233
|
+
return React.createElement(AppsSelect, {
|
|
158
234
|
placeholder: "\u8BF7\u9009\u62E9",
|
|
159
235
|
showSearch: true,
|
|
160
236
|
optionFilterProp: "children",
|
|
@@ -172,18 +248,20 @@ var _default = (0, _styledComponents.withTheme)(function (props) {
|
|
|
172
248
|
}
|
|
173
249
|
}, items.map(function (_ref3) {
|
|
174
250
|
var key = _ref3.key,
|
|
175
|
-
|
|
176
|
-
return
|
|
251
|
+
name = _ref3.name;
|
|
252
|
+
return React.createElement(Option, {
|
|
177
253
|
key: key,
|
|
178
254
|
value: key
|
|
179
255
|
}, name);
|
|
180
256
|
}));
|
|
181
257
|
}
|
|
182
|
-
|
|
258
|
+
|
|
259
|
+
return React.createElement(_dropdown["default"], {
|
|
183
260
|
overlay: Menus,
|
|
184
261
|
trigger: ['click']
|
|
185
|
-
},
|
|
262
|
+
}, React.createElement(SwitchAppMenu, null, React.createElement("span", null, (0, _lodash.get)(selectedApp, 'name', '请选择')), React.createElement(_Icon["default"], {
|
|
186
263
|
type: "caret-down"
|
|
187
264
|
})));
|
|
188
265
|
});
|
|
266
|
+
|
|
189
267
|
exports["default"] = _default;
|
|
@@ -4,74 +4,134 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = void 0;
|
|
7
|
+
|
|
7
8
|
require("antd/lib/popover/style");
|
|
9
|
+
|
|
8
10
|
var _popover = _interopRequireDefault(require("antd/lib/popover"));
|
|
11
|
+
|
|
9
12
|
var _react = require("react");
|
|
13
|
+
|
|
10
14
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
15
|
+
|
|
11
16
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
17
|
+
|
|
12
18
|
var _lodash = require("lodash");
|
|
19
|
+
|
|
13
20
|
var _logoIcon = require("@tntx/logo-icon");
|
|
21
|
+
|
|
14
22
|
var _Iconfont = _interopRequireDefault(require("./Iconfont"));
|
|
23
|
+
|
|
15
24
|
var _images = require("./images");
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
_templateObject4,
|
|
20
|
-
_this = void 0;
|
|
25
|
+
|
|
26
|
+
var _this = void 0;
|
|
27
|
+
|
|
21
28
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
22
|
-
|
|
23
|
-
function
|
|
24
|
-
|
|
25
|
-
function
|
|
26
|
-
|
|
29
|
+
|
|
30
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }
|
|
31
|
+
|
|
32
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); }
|
|
33
|
+
|
|
34
|
+
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; }
|
|
35
|
+
|
|
27
36
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
37
|
+
|
|
38
|
+
function _templateObject4() {
|
|
39
|
+
var data = _taggedTemplateLiteral(["\n background-color: #fff;\n border-radius: 4px;\n z-index: 1;\n"]);
|
|
40
|
+
|
|
41
|
+
_templateObject4 = function _templateObject4() {
|
|
42
|
+
return data;
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
return data;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function _templateObject3() {
|
|
49
|
+
var data = _taggedTemplateLiteral(["\n position: relative;\n width: 88px;\n padding: 8px 0;\n cursor: pointer;\n display: inline-block;\n text-align: center;\n &:hover, &.active {\n background: #eee;\n }\n &.active:after {\n position: absolute;\n width: 0;\n height: 0;\n border-width: 5px 10px 0 0;\n border-color: #333;\n border-style: solid;\n z-index: 9;\n }\n img {\n width: 44px;\n height: 44px;\n margin-bottom: 6px;\n }\n div {\n line-height: 20px;\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n }\n"]);
|
|
50
|
+
|
|
51
|
+
_templateObject3 = function _templateObject3() {
|
|
52
|
+
return data;
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
return data;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function _templateObject2() {
|
|
59
|
+
var data = _taggedTemplateLiteral(["\n list-style: none;\n width: 264px;\n margin: 0;\n padding: 0;\n"]);
|
|
60
|
+
|
|
61
|
+
_templateObject2 = function _templateObject2() {
|
|
62
|
+
return data;
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
return data;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function _templateObject() {
|
|
69
|
+
var data = _taggedTemplateLiteral(["\n margin-left: 20px;\n font-size: 20px;\n cursor: pointer;\n .tnt-icon {\n color: #17233d99;\n .tnt-themeS1 & {\n color: rgba(255,255,255,.85);\n }\n }\n"]);
|
|
70
|
+
|
|
71
|
+
_templateObject = function _templateObject() {
|
|
72
|
+
return data;
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
return data;
|
|
76
|
+
}
|
|
77
|
+
|
|
28
78
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
29
|
-
|
|
30
|
-
var
|
|
31
|
-
|
|
32
|
-
var
|
|
79
|
+
|
|
80
|
+
var App = _styledComponents["default"].li(_templateObject());
|
|
81
|
+
|
|
82
|
+
var AppList = _styledComponents["default"].ul(_templateObject2());
|
|
83
|
+
|
|
84
|
+
var AppItem = _styledComponents["default"].li(_templateObject3());
|
|
85
|
+
|
|
86
|
+
var AppContentWrapper = _styledComponents["default"].div(_templateObject4());
|
|
87
|
+
|
|
33
88
|
var AppContent = function AppContent(props) {
|
|
34
89
|
var language = props.language,
|
|
35
|
-
|
|
36
|
-
|
|
90
|
+
apps = props.apps,
|
|
91
|
+
onChange = props.onChange;
|
|
92
|
+
|
|
37
93
|
var _useState = (0, _react.useState)(props.appKey),
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
94
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
95
|
+
appKey = _useState2[0],
|
|
96
|
+
setAppKey = _useState2[1];
|
|
97
|
+
|
|
41
98
|
var changeApp = function changeApp(appKey) {
|
|
42
99
|
setAppKey(appKey);
|
|
43
100
|
onChange && onChange(appKey);
|
|
44
101
|
};
|
|
45
|
-
|
|
102
|
+
|
|
103
|
+
return React.createElement(AppContentWrapper, null, React.createElement(AppList, null, apps.sort(function (a, b) {
|
|
46
104
|
return (0, _lodash.get)(_logoIcon.systemMap, "".concat(a.appKey, ".sort"), 1) - (0, _lodash.get)(_logoIcon.systemMap, "".concat(b.appKey, ".sort"), 1);
|
|
47
105
|
}).map(function (_ref) {
|
|
48
106
|
var key = _ref.appKey;
|
|
49
|
-
return
|
|
107
|
+
return React.createElement(AppItem, {
|
|
50
108
|
key: key,
|
|
51
109
|
className: (0, _classnames["default"])({
|
|
52
110
|
active: appKey === key
|
|
53
111
|
}),
|
|
54
112
|
onClick: changeApp.bind(_this, key)
|
|
55
|
-
},
|
|
113
|
+
}, React.createElement("img", {
|
|
56
114
|
src: (0, _lodash.get)(_logoIcon.systemMap, "".concat(key, ".logo"), _images.defaultLogo),
|
|
57
115
|
onError: function onError(e) {
|
|
58
116
|
e.target.onerror = null;
|
|
59
117
|
e.target.src = _images.defaultLogo;
|
|
60
118
|
}
|
|
61
|
-
}),
|
|
119
|
+
}), React.createElement("div", null, (0, _lodash.get)(_logoIcon.systemMap, "".concat(key, ".").concat({
|
|
62
120
|
cn: 'name',
|
|
63
121
|
en: 'enName'
|
|
64
122
|
}[language || 'cn']), key)));
|
|
65
123
|
})));
|
|
66
124
|
};
|
|
125
|
+
|
|
67
126
|
var _default = function _default(props) {
|
|
68
|
-
return
|
|
127
|
+
return React.createElement(App, null, React.createElement(_popover["default"], {
|
|
69
128
|
placement: "bottomRight",
|
|
70
129
|
title: null,
|
|
71
|
-
content:
|
|
130
|
+
content: React.createElement(AppContent, props),
|
|
72
131
|
trigger: "click"
|
|
73
|
-
},
|
|
132
|
+
}, React.createElement(_Iconfont["default"], {
|
|
74
133
|
type: "application"
|
|
75
134
|
})));
|
|
76
135
|
};
|
|
136
|
+
|
|
77
137
|
exports["default"] = _default;
|
package/lib/Layout/Avatar.js
CHANGED
|
@@ -1,58 +1,108 @@
|
|
|
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/popover/style");
|
|
11
|
+
|
|
9
12
|
var _popover = _interopRequireDefault(require("antd/lib/popover"));
|
|
13
|
+
|
|
10
14
|
require("antd/lib/button/style");
|
|
15
|
+
|
|
11
16
|
var _button = _interopRequireDefault(require("antd/lib/button"));
|
|
17
|
+
|
|
12
18
|
var _react = require("react");
|
|
19
|
+
|
|
13
20
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
21
|
+
|
|
14
22
|
var _lodash = require("lodash");
|
|
23
|
+
|
|
15
24
|
var _images = _interopRequireDefault(require("./images"));
|
|
25
|
+
|
|
16
26
|
var _ActionsContext = _interopRequireDefault(require("./ActionsContext"));
|
|
27
|
+
|
|
17
28
|
var _storage = require("./storage");
|
|
18
|
-
|
|
19
|
-
function _getRequireWildcardCache(
|
|
20
|
-
|
|
29
|
+
|
|
30
|
+
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
|
31
|
+
|
|
32
|
+
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; }
|
|
33
|
+
|
|
21
34
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
35
|
+
|
|
36
|
+
function _templateObject3() {
|
|
37
|
+
var data = _taggedTemplateLiteral(["\n min-width: 235px;\n z-index: 1;\n background-color: #fff;\n border-radius: 4px;\n\n .isInIframe & {\n display: none;\n }\n \n .user-info-body {\n padding: 30px 20px 20px 24px;\n line-height: 16px;\n .user-info-body-username {\n margin-top: 0px;\n font-size: 16px;\n color: #333;\n font-weight: normal;\n margin-bottom: 10px;\n line-height: 16px;\n }\n .user-info-body-account {\n margin-top: 0px;\n color: #666;\n margin-bottom: 14px;\n line-height: 16px;\n }\n a {\n margin-right: 16px;\n }\n }\n .user-info-footer {\n border-top: 1px solid #ccc;\n background-color: #f5f5f5;\n padding: 8px 20px;\n text-align: right;\n .user-info-footer-signout:hover {\n box-shadow: 0 2px 8px rgba(0, 0, 0, .1);\n border-color: #d9d9d9;\n color: rgba(0, 0, 0, 0.65);\n }\n }\n"]);
|
|
38
|
+
|
|
39
|
+
_templateObject3 = function _templateObject3() {
|
|
40
|
+
return data;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
return data;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function _templateObject2() {
|
|
47
|
+
var data = _taggedTemplateLiteral(["\n .tnt-layout-personal-popover {\n .ant-popover-inner-content {\n padding: 0;\n }\n }\n"]);
|
|
48
|
+
|
|
49
|
+
_templateObject2 = function _templateObject2() {
|
|
50
|
+
return data;
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
return data;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function _templateObject() {
|
|
57
|
+
var data = _taggedTemplateLiteral(["\n margin-right: 0;\n font-size: 0;\n img {\n width: 26px;\n height: 26px;\n border-radius: 50%;\n cursor: pointer;\n .large-size & {\n width: 32px;\n height: 32px;\n }\n }\n"]);
|
|
58
|
+
|
|
59
|
+
_templateObject = function _templateObject() {
|
|
60
|
+
return data;
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
return data;
|
|
64
|
+
}
|
|
65
|
+
|
|
22
66
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
23
|
-
|
|
24
|
-
var
|
|
25
|
-
|
|
67
|
+
|
|
68
|
+
var Avatar = _styledComponents["default"].li(_templateObject());
|
|
69
|
+
|
|
70
|
+
var GlobalStyle = (0, _styledComponents.createGlobalStyle)(_templateObject2());
|
|
71
|
+
|
|
72
|
+
var UserInfoWrapper = _styledComponents["default"].div(_templateObject3());
|
|
73
|
+
|
|
26
74
|
var UserInfoContent = function UserInfoContent(props) {
|
|
27
75
|
var userInfo = props.userInfo,
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
76
|
+
onLogout = props.onLogout,
|
|
77
|
+
_props$onChangePasswo = props.onChangePassword,
|
|
78
|
+
onChangePassword = _props$onChangePasswo === void 0 ? function () {
|
|
79
|
+
return true;
|
|
80
|
+
} : _props$onChangePasswo,
|
|
81
|
+
_props$onPersonalSett = props.onPersonalSetting,
|
|
82
|
+
onPersonalSetting = _props$onPersonalSett === void 0 ? function () {
|
|
83
|
+
return true;
|
|
84
|
+
} : _props$onPersonalSett;
|
|
85
|
+
|
|
37
86
|
var _useContext = (0, _react.useContext)(_ActionsContext["default"]),
|
|
38
|
-
|
|
39
|
-
|
|
87
|
+
getText = _useContext.getText;
|
|
88
|
+
|
|
89
|
+
return React.createElement(UserInfoWrapper, {
|
|
40
90
|
className: "user-info-setting-wrap"
|
|
41
|
-
},
|
|
91
|
+
}, React.createElement("div", {
|
|
42
92
|
className: "user-info-body"
|
|
43
|
-
},
|
|
93
|
+
}, React.createElement("p", {
|
|
44
94
|
className: "user-info-body-username"
|
|
45
|
-
}, userInfo.userName || getText('nameNull')),
|
|
95
|
+
}, userInfo.userName || getText('nameNull')), React.createElement("p", {
|
|
46
96
|
className: "user-info-body-account"
|
|
47
|
-
}, userInfo.account),
|
|
97
|
+
}, userInfo.account), React.createElement("a", {
|
|
48
98
|
onClick: onPersonalSetting,
|
|
49
99
|
href: "/bridge/userCenter?currentTab=1"
|
|
50
|
-
}, getText('personalSettings')),
|
|
100
|
+
}, getText('personalSettings')), React.createElement("a", {
|
|
51
101
|
onClick: onChangePassword,
|
|
52
102
|
href: "/bridge/userCenter?currentTab=2"
|
|
53
|
-
}, getText('changePwd'))),
|
|
103
|
+
}, getText('changePwd'))), React.createElement("div", {
|
|
54
104
|
className: "user-info-footer"
|
|
55
|
-
},
|
|
105
|
+
}, React.createElement(_button["default"], {
|
|
56
106
|
className: "user-info-footer-signout",
|
|
57
107
|
onClick: function onClick() {
|
|
58
108
|
if (onLogout) {
|
|
@@ -63,28 +113,32 @@ var UserInfoContent = function UserInfoContent(props) {
|
|
|
63
113
|
window.location.href = "/user/login?callbackUrl=".concat(window.encodeURI(location.href));
|
|
64
114
|
}
|
|
65
115
|
}
|
|
66
|
-
},
|
|
116
|
+
}, React.createElement("a", null, getText('signOut')))));
|
|
67
117
|
};
|
|
118
|
+
|
|
68
119
|
var _default = function _default(props) {
|
|
69
120
|
var _images$empty2;
|
|
121
|
+
|
|
70
122
|
var _props$userInfo = props.userInfo,
|
|
71
|
-
|
|
123
|
+
userInfo = _props$userInfo === void 0 ? {} : _props$userInfo;
|
|
72
124
|
var avatar = userInfo.avatar;
|
|
73
|
-
return
|
|
125
|
+
return React.createElement(Avatar, null, React.createElement(_popover["default"], {
|
|
74
126
|
popupClassName: "tnt-layout-personal-popover",
|
|
75
127
|
placement: "bottomRight",
|
|
76
128
|
title: null,
|
|
77
|
-
content:
|
|
129
|
+
content: React.createElement(UserInfoContent, props),
|
|
78
130
|
trigger: "click"
|
|
79
|
-
}, avatar ?
|
|
131
|
+
}, avatar ? React.createElement("img", {
|
|
80
132
|
src: avatar.indexOf('base64') > 0 ? avatar : (0, _lodash.get)(_images["default"][avatar], 'default', _images["default"][avatar]),
|
|
81
133
|
onError: function onError(e) {
|
|
82
134
|
var _images$empty;
|
|
135
|
+
|
|
83
136
|
e.target.onerror = null;
|
|
84
137
|
e.target.src = ((_images$empty = _images["default"].empty) == null ? void 0 : _images$empty["default"]) || _images["default"].empty;
|
|
85
138
|
}
|
|
86
|
-
}) :
|
|
139
|
+
}) : React.createElement("img", {
|
|
87
140
|
src: ((_images$empty2 = _images["default"].empty) == null ? void 0 : _images$empty2["default"]) || _images["default"].empty
|
|
88
|
-
})),
|
|
141
|
+
})), React.createElement(GlobalStyle, null));
|
|
89
142
|
};
|
|
143
|
+
|
|
90
144
|
exports["default"] = _default;
|