tntd 1.4.32 → 1.4.33-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/Ellipsis/index.js +47 -15
- package/components/QueryListScene/QueryForm.js +4 -4
- package/components/QueryListScene/createActions.js +4 -4
- package/dist/1.tntd.js +1 -1
- package/dist/stats.json +24089 -23289
- package/dist/tntd.css +1 -1
- package/dist/tntd.js +7 -10
- package/es/ArrayInput/icon.js +5 -5
- package/es/ArrayInput/index.js +79 -111
- package/es/AuthContext.js +1 -1
- package/es/Columns/index.js +33 -40
- package/es/DevelopmentLogin/LoginModal.js +33 -46
- package/es/DevelopmentLogin/index.js +14 -18
- package/es/Ellipsis/Svg/CopySVG.js +13 -13
- package/es/Ellipsis/Svg/TickSVG.js +8 -8
- package/es/Ellipsis/index.js +100 -79
- package/es/Handle/index.js +46 -64
- package/es/Icon/fonts/iconfont.js +7 -12
- package/es/Icon/index.js +12 -15
- package/es/Img/Contain.js +26 -31
- package/es/Img/Cover.js +43 -57
- package/es/Img/index.js +39 -48
- package/es/Layout/ActionsContext.js +3 -2
- package/es/Layout/AppList.js +39 -94
- package/es/Layout/Application.js +28 -74
- package/es/Layout/Avatar.js +30 -67
- package/es/Layout/CompatibleLanguage.js +41 -96
- package/es/Layout/EnterpriseLayout/Avatar.js +39 -77
- package/es/Layout/EnterpriseLayout/Language.js +16 -34
- package/es/Layout/EnterpriseLayout/Theme.js +18 -36
- package/es/Layout/EnterpriseLayout/index.js +14 -16
- package/es/Layout/GlobalNavigation/NavigationPopup.js +61 -172
- package/es/Layout/GlobalNavigation/index.js +22 -56
- package/es/Layout/Header.js +26 -47
- package/es/Layout/HeaderActions.js +45 -59
- package/es/Layout/HeaderNavs.js +24 -51
- package/es/Layout/HeaderTabs.js +53 -106
- package/es/Layout/Iconfont.js +1 -1
- package/es/Layout/Language.js +16 -34
- package/es/Layout/Layout.js +88 -110
- package/es/Layout/Logo.js +17 -33
- package/es/Layout/OrgAppList.js +64 -109
- package/es/Layout/SideMenu.js +67 -128
- package/es/Layout/Theme.js +25 -63
- package/es/Layout/index.js +28 -37
- package/es/Layout/paaslayout/CompactSideMenu.js +37 -76
- package/es/Layout/paaslayout/Header.js +23 -46
- package/es/Layout/paaslayout/Logo.js +4 -14
- package/es/Layout/paaslayout/SideMenu.js +41 -80
- package/es/Layout/paaslayout/index.js +77 -104
- package/es/Layout/storage.js +10 -9
- package/es/LoadingButton/index.js +18 -27
- package/es/Modal/index.js +42 -51
- package/es/Page/Box.js +36 -43
- package/es/Page/index.js +56 -71
- package/es/Page/utils.js +0 -5
- package/es/QueryForm/Field/Checkbox.js +7 -11
- package/es/QueryForm/Field/Select.js +34 -44
- package/es/QueryForm/Field/SelectInput.js +31 -46
- package/es/QueryForm/Field/fieldsMap.js +0 -1
- package/es/QueryForm/Field/index.js +46 -78
- package/es/QueryForm/createActions.js +6 -7
- package/es/QueryForm/index.js +79 -140
- package/es/QueryListScene/List.js +83 -139
- package/es/QueryListScene/QueryForm.js +54 -91
- package/es/QueryListScene/QueryListScene.js +29 -47
- package/es/QueryListScene/Title.js +3 -3
- package/es/QueryListScene/Toolbar.js +13 -14
- package/es/QueryListScene/createActions.js +4 -4
- package/es/Select/DropDownWrap.js +32 -55
- package/es/Select/index.js +140 -232
- package/es/Table/ResizableTable/index.js +29 -43
- package/es/Table/index.js +20 -19
- package/es/Title/index.js +23 -25
- package/es/locale.js +1 -5
- package/es/utils/checkAuth.js +6 -8
- package/es/utils/findMenuInfoByPath.js +0 -4
- package/es/utils/index.js +17 -27
- package/lib/ArrayInput/icon.js +7 -9
- package/lib/ArrayInput/index.js +82 -131
- package/lib/AuthContext.js +2 -6
- package/lib/Columns/index.js +36 -54
- package/lib/DevelopmentLogin/LoginModal.js +36 -63
- package/lib/DevelopmentLogin/index.js +21 -31
- package/lib/Ellipsis/Svg/CopySVG.js +15 -18
- package/lib/Ellipsis/Svg/TickSVG.js +10 -13
- package/lib/Ellipsis/index.js +105 -93
- package/lib/Handle/index.js +51 -87
- package/lib/Icon/fonts/iconfont.js +7 -12
- package/lib/Icon/iconList.js +1 -2
- package/lib/Icon/index.js +16 -26
- package/lib/Img/Contain.js +29 -40
- package/lib/Img/Cover.js +48 -72
- package/lib/Img/index.js +42 -58
- package/lib/Layout/ActionsContext.js +1 -5
- package/lib/Layout/AppList.js +45 -124
- package/lib/Layout/Application.js +31 -92
- package/lib/Layout/Avatar.js +36 -91
- package/lib/Layout/CompatibleLanguage.js +44 -116
- package/lib/Layout/EnterpriseLayout/Avatar.js +45 -105
- package/lib/Layout/EnterpriseLayout/Language.js +22 -54
- package/lib/Layout/EnterpriseLayout/Theme.js +21 -50
- package/lib/Layout/EnterpriseLayout/index.js +17 -27
- package/lib/Layout/GlobalNavigation/NavigationPopup.js +64 -192
- package/lib/Layout/GlobalNavigation/index.js +28 -80
- package/lib/Layout/Header.js +36 -68
- package/lib/Layout/HeaderActions.js +51 -81
- package/lib/Layout/HeaderNavs.js +30 -70
- package/lib/Layout/HeaderTabs.js +58 -127
- package/lib/Layout/Iconfont.js +4 -9
- package/lib/Layout/Language.js +22 -54
- package/lib/Layout/Layout.js +93 -134
- package/lib/Layout/Logo.js +26 -47
- package/lib/Layout/OrgAppList.js +69 -133
- package/lib/Layout/SideMenu.js +72 -151
- package/lib/Layout/Theme.js +28 -79
- package/lib/Layout/createActions.js +3 -9
- package/lib/Layout/images/index.js +5 -36
- package/lib/Layout/index.js +35 -63
- package/lib/Layout/paaslayout/CompactSideMenu.js +40 -90
- package/lib/Layout/paaslayout/Header.js +30 -60
- package/lib/Layout/paaslayout/Logo.js +11 -24
- package/lib/Layout/paaslayout/SideMenu.js +44 -93
- package/lib/Layout/paaslayout/index.js +82 -128
- package/lib/Layout/storage.js +26 -68
- package/lib/LoadingButton/index.js +21 -36
- package/lib/Modal/index.js +45 -62
- package/lib/Page/Box.js +38 -50
- package/lib/Page/index.js +58 -84
- package/lib/Page/utils.js +5 -16
- package/lib/QueryForm/Field/Checkbox.js +10 -19
- package/lib/QueryForm/Field/Select.js +39 -60
- package/lib/QueryForm/Field/SelectInput.js +36 -65
- package/lib/QueryForm/Field/fieldsMap.js +6 -23
- package/lib/QueryForm/Field/index.js +50 -91
- package/lib/QueryForm/createActions.js +9 -16
- package/lib/QueryForm/index.js +83 -165
- package/lib/QueryForm/useForm.js +1 -6
- package/lib/QueryListScene/List.js +89 -153
- package/lib/QueryListScene/QueryForm.js +58 -101
- package/lib/QueryListScene/QueryListScene.js +31 -56
- package/lib/QueryListScene/Title.js +6 -11
- package/lib/QueryListScene/Toolbar.js +16 -22
- package/lib/QueryListScene/createActions.js +7 -13
- package/lib/QueryListScene/index.js +5 -19
- package/lib/QueryListScene/useActions.js +1 -6
- package/lib/Select/DropDownWrap.js +35 -63
- package/lib/Select/index.js +142 -245
- package/lib/Table/ResizableTable/index.js +31 -54
- package/lib/Table/index.js +21 -34
- package/lib/Title/index.js +26 -34
- package/lib/index.js +36 -57
- package/lib/locale.js +9 -25
- package/lib/utils/checkAuth.js +9 -16
- package/lib/utils/findMenuInfoByPath.js +3 -12
- package/lib/utils/index.js +26 -60
- package/package.json +3 -2
package/lib/Layout/AppList.js
CHANGED
|
@@ -1,125 +1,61 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(
|
|
4
|
-
|
|
3
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
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
|
-
|
|
48
|
-
function _interopRequireDefault(
|
|
49
|
-
|
|
50
|
-
function
|
|
51
|
-
|
|
52
|
-
function
|
|
53
|
-
|
|
54
|
-
function
|
|
55
|
-
|
|
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
|
-
|
|
98
|
-
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
99
|
-
|
|
24
|
+
var _templateObject,
|
|
25
|
+
_templateObject2,
|
|
26
|
+
_templateObject3,
|
|
27
|
+
_templateObject4,
|
|
28
|
+
_this = void 0;
|
|
29
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
30
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
|
31
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
32
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _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(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
35
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
36
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
37
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
38
|
+
function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
|
|
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
|
-
var _default = (0, _styledComponents.withTheme)(function (props) {
|
|
52
|
+
var _default = exports["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,17 @@ 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
|
-
});
|
|
266
|
-
|
|
267
|
-
exports["default"] = _default;
|
|
188
|
+
});
|
|
@@ -4,134 +4,73 @@ 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
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
function
|
|
31
|
-
|
|
32
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); }
|
|
33
|
-
|
|
34
|
-
function
|
|
35
|
-
|
|
36
|
-
function _arrayWithHoles(
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
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
|
-
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
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
|
-
|
|
16
|
+
var _templateObject,
|
|
17
|
+
_templateObject2,
|
|
18
|
+
_templateObject3,
|
|
19
|
+
_templateObject4,
|
|
20
|
+
_this = void 0;
|
|
21
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
22
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _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(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
25
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
26
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
27
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
28
|
+
function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
|
|
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
|
-
|
|
127
|
-
return React.createElement(App, null, React.createElement(_popover["default"], {
|
|
67
|
+
var _default = exports["default"] = function _default(props) {
|
|
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
|
-
};
|
|
136
|
-
|
|
137
|
-
exports["default"] = _default;
|
|
76
|
+
};
|
package/lib/Layout/Avatar.js
CHANGED
|
@@ -1,108 +1,58 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(
|
|
4
|
-
|
|
3
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
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
14
|
var _lodash = require("lodash");
|
|
23
|
-
|
|
24
15
|
var _images = _interopRequireDefault(require("./images"));
|
|
25
|
-
|
|
26
16
|
var _ActionsContext = _interopRequireDefault(require("./ActionsContext"));
|
|
27
|
-
|
|
28
17
|
var _storage = require("./storage");
|
|
29
|
-
|
|
30
|
-
function _getRequireWildcardCache() { if (typeof WeakMap
|
|
31
|
-
|
|
32
|
-
function
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
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
|
-
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
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
|
-
|
|
18
|
+
var _templateObject, _templateObject2, _templateObject3;
|
|
19
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
20
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
|
21
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
22
|
+
function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
|
|
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 || getText('nameNull')), React.createElement("p", {
|
|
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) {
|
|
@@ -113,32 +63,27 @@ var UserInfoContent = function UserInfoContent(props) {
|
|
|
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
|
-
var _default = function _default(props) {
|
|
68
|
+
var _default = exports["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));
|
|
142
|
-
};
|
|
143
|
-
|
|
144
|
-
exports["default"] = _default;
|
|
88
|
+
})), /*#__PURE__*/React.createElement(GlobalStyle, null));
|
|
89
|
+
};
|