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