tntd 1.4.20 → 1.4.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/Handle/README.md +0 -20
- package/components/Handle/index.js +44 -7
- package/components/locale.js +8 -2
- package/dist/1.tntd.js +1 -1
- package/dist/stats.json +24430 -24390
- package/dist/tntd.css +1 -1
- package/dist/tntd.js +13 -8
- package/es/ArrayInput/icon.js +5 -5
- package/es/ArrayInput/index.js +108 -76
- package/es/AuthContext.js +1 -1
- package/es/Columns/index.js +38 -31
- package/es/DevelopmentLogin/LoginModal.js +45 -32
- package/es/DevelopmentLogin/index.js +17 -13
- package/es/Ellipsis/Svg/CopySVG.js +13 -13
- package/es/Ellipsis/Svg/TickSVG.js +8 -8
- package/es/Ellipsis/index.js +69 -58
- package/es/Handle/README.md +0 -20
- package/es/Handle/index.js +100 -33
- package/es/Icon/fonts/iconfont.js +12 -7
- package/es/Icon/index.js +13 -10
- package/es/Img/Contain.js +29 -24
- package/es/Img/Cover.js +54 -40
- package/es/Img/index.js +45 -36
- package/es/Layout/ActionsContext.js +2 -3
- package/es/Layout/AppList.js +92 -37
- package/es/Layout/Application.js +72 -26
- package/es/Layout/Avatar.js +66 -29
- package/es/Layout/CompatibleLanguage.js +94 -39
- package/es/Layout/EnterpriseLayout/Avatar.js +76 -38
- package/es/Layout/EnterpriseLayout/Language.js +32 -14
- package/es/Layout/EnterpriseLayout/Theme.js +34 -16
- package/es/Layout/EnterpriseLayout/index.js +16 -14
- package/es/Layout/GlobalNavigation/NavigationPopup.js +170 -59
- package/es/Layout/GlobalNavigation/index.js +54 -20
- package/es/Layout/Header.js +46 -25
- package/es/Layout/HeaderActions.js +56 -42
- package/es/Layout/HeaderNavs.js +47 -20
- package/es/Layout/HeaderTabs.js +102 -49
- package/es/Layout/Iconfont.js +1 -1
- package/es/Layout/Language.js +32 -14
- package/es/Layout/Layout.js +108 -86
- package/es/Layout/Logo.js +32 -16
- package/es/Layout/OrgAppList.js +107 -62
- package/es/Layout/SideMenu.js +124 -63
- package/es/Layout/Theme.js +61 -23
- package/es/Layout/checkAuth.js +29 -0
- package/es/Layout/index.js +34 -26
- package/es/Layout/paaslayout/CompactSideMenu.js +74 -35
- package/es/Layout/paaslayout/Header.js +45 -22
- package/es/Layout/paaslayout/Logo.js +13 -3
- package/es/Layout/paaslayout/SideMenu.js +78 -39
- package/es/Layout/paaslayout/index.js +102 -75
- package/es/Layout/storage.js +9 -10
- package/es/Layout/utils.js +136 -0
- package/es/LoadingButton/index.js +24 -15
- package/es/Modal/index.js +46 -38
- package/es/Page/Box.js +41 -34
- package/es/Page/index.js +67 -52
- package/es/Page/utils.js +5 -0
- package/es/QueryForm/Field/Checkbox.js +9 -5
- package/es/QueryForm/Field/Select.js +41 -31
- package/es/QueryForm/Field/SelectInput.js +41 -26
- package/es/QueryForm/Field/fieldsMap.js +1 -0
- package/es/QueryForm/Field/index.js +71 -41
- package/es/QueryForm/createActions.js +7 -6
- package/es/QueryForm/index.js +135 -76
- package/es/QueryListScene/List.js +128 -74
- package/es/QueryListScene/QueryForm.js +81 -46
- package/es/QueryListScene/QueryListScene.js +40 -25
- package/es/QueryListScene/Title.js +3 -3
- package/es/QueryListScene/Toolbar.js +12 -11
- package/es/Select/DropDownWrap.js +50 -29
- package/es/Select/index.js +231 -135
- package/es/Table/ResizableTable/index.js +40 -26
- package/es/Table/index.js +16 -18
- package/es/Title/index.js +23 -21
- package/es/locale.js +11 -3
- package/es/utils/checkAuth.js +5 -3
- package/es/utils/findMenuInfoByPath.js +4 -0
- package/es/utils/index.js +23 -12
- package/lib/ArrayInput/icon.js +6 -6
- package/lib/ArrayInput/index.js +127 -78
- package/lib/AuthContext.js +4 -1
- package/lib/Columns/index.js +47 -31
- package/lib/DevelopmentLogin/LoginModal.js +58 -32
- package/lib/DevelopmentLogin/index.js +27 -16
- package/lib/Ellipsis/Svg/CopySVG.js +15 -13
- package/lib/Ellipsis/Svg/TickSVG.js +10 -8
- package/lib/Ellipsis/index.js +80 -57
- package/lib/Handle/README.md +0 -20
- package/lib/Handle/index.js +119 -33
- package/lib/Icon/fonts/iconfont.js +12 -7
- package/lib/Icon/index.js +20 -11
- package/lib/Img/Contain.js +34 -24
- package/lib/Img/Cover.js +65 -42
- package/lib/Img/index.js +51 -36
- package/lib/Layout/ActionsContext.js +4 -1
- package/lib/Layout/AppList.js +118 -40
- package/lib/Layout/Application.js +86 -26
- package/lib/Layout/Avatar.js +86 -32
- package/lib/Layout/CompatibleLanguage.js +110 -39
- package/lib/Layout/EnterpriseLayout/Avatar.js +100 -41
- package/lib/Layout/EnterpriseLayout/Header.js +113 -0
- package/lib/Layout/EnterpriseLayout/HeaderActions.js +104 -0
- package/lib/Layout/EnterpriseLayout/Language.js +48 -17
- package/lib/Layout/EnterpriseLayout/Theme.js +44 -16
- package/lib/Layout/EnterpriseLayout/index.js +23 -14
- package/lib/Layout/GlobalNavigation/NavigationPopup.js +186 -59
- package/lib/Layout/GlobalNavigation/index.js +74 -23
- package/lib/Layout/Header.js +63 -28
- package/lib/Layout/HeaderActions.js +74 -45
- package/lib/Layout/HeaderNavs.js +61 -23
- package/lib/Layout/HeaderTabs.js +118 -51
- package/lib/Layout/Iconfont.js +5 -1
- package/lib/Layout/Language.js +48 -17
- package/lib/Layout/Layout.js +128 -88
- package/lib/Layout/Logo.js +43 -19
- package/lib/Layout/OrgAppList.js +127 -64
- package/lib/Layout/SideMenu.js +143 -65
- package/lib/Layout/Theme.js +73 -23
- package/lib/Layout/checkAuth.js +39 -0
- package/lib/Layout/createActions.js +5 -0
- package/lib/Layout/images/index.js +28 -0
- package/lib/Layout/index.js +55 -30
- package/lib/Layout/paaslayout/CompactSideMenu.js +84 -35
- package/lib/Layout/paaslayout/Header.js +55 -22
- package/lib/Layout/paaslayout/Logo.js +19 -3
- package/lib/Layout/paaslayout/SideMenu.js +87 -39
- package/lib/Layout/paaslayout/index.js +122 -77
- package/lib/Layout/storage.js +40 -11
- package/lib/Layout/utils.js +166 -0
- package/lib/LoadingButton/index.js +29 -15
- package/lib/Modal/index.js +53 -38
- package/lib/Page/Box.js +45 -34
- package/lib/Page/index.js +77 -52
- package/lib/Page/utils.js +9 -1
- package/lib/QueryForm/Field/Checkbox.js +13 -5
- package/lib/QueryForm/Field/Select.js +53 -33
- package/lib/QueryForm/Field/SelectInput.js +56 -28
- package/lib/QueryForm/Field/fieldsMap.js +15 -1
- package/lib/QueryForm/Field/index.js +81 -43
- package/lib/QueryForm/createActions.js +12 -6
- package/lib/QueryForm/index.js +157 -78
- package/lib/QueryForm/useForm.js +5 -0
- package/lib/QueryListScene/List.js +140 -76
- package/lib/QueryListScene/QueryForm.js +86 -46
- package/lib/QueryListScene/QueryListScene.js +46 -25
- package/lib/QueryListScene/Title.js +7 -3
- package/lib/QueryListScene/Toolbar.js +16 -11
- package/lib/QueryListScene/createActions.js +5 -0
- package/lib/QueryListScene/index.js +10 -0
- package/lib/QueryListScene/useActions.js +5 -0
- package/lib/Select/DropDownWrap.js +56 -31
- package/lib/Select/index.js +241 -135
- package/lib/Table/ResizableTable/index.js +48 -26
- package/lib/Table/index.js +28 -17
- package/lib/Title/index.js +28 -21
- package/lib/index.js +56 -35
- package/lib/locale.js +19 -4
- package/lib/utils/checkAuth.js +9 -4
- package/lib/utils/findMenuInfoByPath.js +8 -1
- package/lib/utils/index.js +42 -15
- package/package.json +2 -2
package/es/Layout/AppList.js
CHANGED
|
@@ -8,18 +8,59 @@ import "antd/lib/menu/style";
|
|
|
8
8
|
import _Menu from "antd/lib/menu";
|
|
9
9
|
import "antd/lib/select/style";
|
|
10
10
|
import _Select from "antd/lib/select";
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
function
|
|
17
|
-
|
|
18
|
-
function
|
|
19
|
-
|
|
20
|
-
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; } }
|
|
11
|
+
|
|
12
|
+
var _this = this;
|
|
13
|
+
|
|
14
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }
|
|
15
|
+
|
|
16
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); }
|
|
17
|
+
|
|
18
|
+
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; }
|
|
19
|
+
|
|
21
20
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
21
|
+
|
|
22
|
+
function _templateObject4() {
|
|
23
|
+
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"]);
|
|
24
|
+
|
|
25
|
+
_templateObject4 = function _templateObject4() {
|
|
26
|
+
return data;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
return data;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function _templateObject3() {
|
|
33
|
+
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"]);
|
|
34
|
+
|
|
35
|
+
_templateObject3 = function _templateObject3() {
|
|
36
|
+
return data;
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
return data;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function _templateObject2() {
|
|
43
|
+
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"]);
|
|
44
|
+
|
|
45
|
+
_templateObject2 = function _templateObject2() {
|
|
46
|
+
return data;
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
return data;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
function _templateObject() {
|
|
53
|
+
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"]);
|
|
54
|
+
|
|
55
|
+
_templateObject = function _templateObject() {
|
|
56
|
+
return data;
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
return data;
|
|
60
|
+
}
|
|
61
|
+
|
|
22
62
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
63
|
+
|
|
23
64
|
import { useState, useEffect } from 'react';
|
|
24
65
|
import styled, { withTheme } from 'styled-components';
|
|
25
66
|
import { get } from 'lodash';
|
|
@@ -27,25 +68,26 @@ import Icon from '../Icon';
|
|
|
27
68
|
import { getCurrentAppStore, setCurrentAppStore } from './storage';
|
|
28
69
|
import { traverseTree } from '../utils';
|
|
29
70
|
var Option = _Select.Option;
|
|
30
|
-
var MenuList = styled(_Menu)(_templateObject
|
|
71
|
+
var MenuList = styled(_Menu)(_templateObject()); // 新版UI
|
|
31
72
|
|
|
32
|
-
|
|
33
|
-
var AppsSelect = styled(_Select)(_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) {
|
|
73
|
+
var AppsSelect = styled(_Select)(_templateObject2(), function (props) {
|
|
34
74
|
return "".concat(props.theme.blueBgColor, " !important");
|
|
35
75
|
});
|
|
36
|
-
var AppTreeSelect = styled(_TreeSelect)(_templateObject3
|
|
37
|
-
var SwitchAppMenu = styled.a(_templateObject4
|
|
76
|
+
var AppTreeSelect = styled(_TreeSelect)(_templateObject3());
|
|
77
|
+
var SwitchAppMenu = styled.a(_templateObject4(), function (props) {
|
|
38
78
|
return "".concat(props.theme.headerHeight, "px");
|
|
39
79
|
}, function (props) {
|
|
40
80
|
return "".concat(props.theme.size === 'large' ? 16 : 14, "px");
|
|
41
81
|
});
|
|
42
82
|
export default withTheme(function (props) {
|
|
43
83
|
var selectedKey = props.selectedKey,
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
84
|
+
_props$items = props.items,
|
|
85
|
+
items = _props$items === void 0 ? [] : _props$items,
|
|
86
|
+
onChange = props.onChange;
|
|
87
|
+
|
|
47
88
|
var getInitialSelectedApp = function getInitialSelectedApp() {
|
|
48
89
|
var currentAppStore = getCurrentAppStore();
|
|
90
|
+
|
|
49
91
|
var findAppByKey = function findAppByKey(selectedKey) {
|
|
50
92
|
var findApp;
|
|
51
93
|
traverseTree(items, function (item) {
|
|
@@ -56,29 +98,34 @@ export default withTheme(function (props) {
|
|
|
56
98
|
});
|
|
57
99
|
return findApp;
|
|
58
100
|
};
|
|
101
|
+
|
|
59
102
|
var currentApp = findAppByKey(selectedKey || get(currentAppStore, 'key'));
|
|
60
103
|
return currentApp || items[0];
|
|
61
104
|
};
|
|
105
|
+
|
|
62
106
|
var changeApp = function changeApp(app) {
|
|
63
107
|
setSelectedApp(app);
|
|
64
108
|
setCurrentAppStore(app);
|
|
65
109
|
onChange && onChange(app);
|
|
66
110
|
};
|
|
111
|
+
|
|
67
112
|
var _useState = useState(),
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
113
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
114
|
+
searchValue = _useState2[0],
|
|
115
|
+
setSearchValue = _useState2[1];
|
|
116
|
+
|
|
71
117
|
var _useState3 = useState(getInitialSelectedApp()),
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
118
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
119
|
+
selectedApp = _useState4[0],
|
|
120
|
+
setSelectedApp = _useState4[1];
|
|
121
|
+
|
|
122
|
+
var Menus = React.createElement(MenuList, {
|
|
76
123
|
selectedKeys: [get(selectedApp, 'key')]
|
|
77
|
-
},
|
|
124
|
+
}, React.createElement(_Menu.Item, {
|
|
78
125
|
className: "app-search-warp",
|
|
79
126
|
key: "search",
|
|
80
127
|
disabled: true
|
|
81
|
-
},
|
|
128
|
+
}, React.createElement(_Input, {
|
|
82
129
|
allowClear: true,
|
|
83
130
|
placeholder: "\u8F93\u5165\u5173\u952E\u8BCD\u641C\u7D22",
|
|
84
131
|
value: searchValue,
|
|
@@ -87,31 +134,37 @@ export default withTheme(function (props) {
|
|
|
87
134
|
}
|
|
88
135
|
})), items.filter(function () {
|
|
89
136
|
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
90
|
-
|
|
91
|
-
|
|
137
|
+
key = _ref.key,
|
|
138
|
+
name = _ref.name;
|
|
139
|
+
|
|
92
140
|
var regExp = new RegExp(searchValue, 'i');
|
|
141
|
+
|
|
93
142
|
if (searchValue) {
|
|
94
143
|
return regExp.test(key) || regExp.test(name);
|
|
95
144
|
}
|
|
145
|
+
|
|
96
146
|
return true;
|
|
97
147
|
}).map(function (item) {
|
|
98
|
-
return
|
|
148
|
+
return React.createElement(_Menu.Item, {
|
|
99
149
|
key: item.key,
|
|
100
150
|
onClick: changeApp.bind(_this, item)
|
|
101
151
|
}, item.name);
|
|
102
152
|
}));
|
|
103
153
|
useEffect(function () {
|
|
104
154
|
var newApp = getInitialSelectedApp();
|
|
155
|
+
|
|
105
156
|
if ((newApp == null ? void 0 : newApp.key) !== (selectedApp == null ? void 0 : selectedApp.key)) {
|
|
106
157
|
changeApp(newApp);
|
|
107
158
|
}
|
|
108
159
|
}, [items, selectedKey]);
|
|
160
|
+
|
|
109
161
|
if (!props.theme.compatible) {
|
|
110
|
-
if (items
|
|
162
|
+
if (items == null ? void 0 : items.some(function (item) {
|
|
111
163
|
var _item$children;
|
|
164
|
+
|
|
112
165
|
return (_item$children = item.children) == null ? void 0 : _item$children.length;
|
|
113
166
|
})) {
|
|
114
|
-
return
|
|
167
|
+
return React.createElement(AppTreeSelect, {
|
|
115
168
|
placeholder: "\u8BF7\u9009\u62E9",
|
|
116
169
|
showSearch: true,
|
|
117
170
|
treeNodeFilterProp: "title",
|
|
@@ -144,7 +197,8 @@ export default withTheme(function (props) {
|
|
|
144
197
|
}
|
|
145
198
|
});
|
|
146
199
|
}
|
|
147
|
-
|
|
200
|
+
|
|
201
|
+
return React.createElement(AppsSelect, {
|
|
148
202
|
placeholder: "\u8BF7\u9009\u62E9",
|
|
149
203
|
showSearch: true,
|
|
150
204
|
optionFilterProp: "children",
|
|
@@ -162,17 +216,18 @@ export default withTheme(function (props) {
|
|
|
162
216
|
}
|
|
163
217
|
}, items.map(function (_ref3) {
|
|
164
218
|
var key = _ref3.key,
|
|
165
|
-
|
|
166
|
-
return
|
|
219
|
+
name = _ref3.name;
|
|
220
|
+
return React.createElement(Option, {
|
|
167
221
|
key: key,
|
|
168
222
|
value: key
|
|
169
223
|
}, name);
|
|
170
224
|
}));
|
|
171
225
|
}
|
|
172
|
-
|
|
226
|
+
|
|
227
|
+
return React.createElement(_Dropdown, {
|
|
173
228
|
overlay: Menus,
|
|
174
229
|
trigger: ['click']
|
|
175
|
-
},
|
|
230
|
+
}, React.createElement(SwitchAppMenu, null, React.createElement("span", null, get(selectedApp, 'name', '请选择')), React.createElement(Icon, {
|
|
176
231
|
type: "caret-down"
|
|
177
232
|
})));
|
|
178
233
|
});
|
package/es/Layout/Application.js
CHANGED
|
@@ -1,17 +1,58 @@
|
|
|
1
1
|
import "antd/lib/popover/style";
|
|
2
2
|
import _Popover from "antd/lib/popover";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
function
|
|
9
|
-
|
|
10
|
-
function
|
|
11
|
-
|
|
12
|
-
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; } }
|
|
3
|
+
|
|
4
|
+
var _this = this;
|
|
5
|
+
|
|
6
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }
|
|
7
|
+
|
|
8
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); }
|
|
9
|
+
|
|
10
|
+
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; }
|
|
11
|
+
|
|
13
12
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
13
|
+
|
|
14
|
+
function _templateObject4() {
|
|
15
|
+
var data = _taggedTemplateLiteral(["\n background-color: #fff;\n border-radius: 4px;\n z-index: 1;\n"]);
|
|
16
|
+
|
|
17
|
+
_templateObject4 = function _templateObject4() {
|
|
18
|
+
return data;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
return data;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function _templateObject3() {
|
|
25
|
+
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"]);
|
|
26
|
+
|
|
27
|
+
_templateObject3 = function _templateObject3() {
|
|
28
|
+
return data;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
return data;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function _templateObject2() {
|
|
35
|
+
var data = _taggedTemplateLiteral(["\n list-style: none;\n width: 264px;\n margin: 0;\n padding: 0;\n"]);
|
|
36
|
+
|
|
37
|
+
_templateObject2 = function _templateObject2() {
|
|
38
|
+
return data;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
return data;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function _templateObject() {
|
|
45
|
+
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"]);
|
|
46
|
+
|
|
47
|
+
_templateObject = function _templateObject() {
|
|
48
|
+
return data;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
return data;
|
|
52
|
+
}
|
|
53
|
+
|
|
14
54
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
55
|
+
|
|
15
56
|
import { useState } from 'react';
|
|
16
57
|
import styled from 'styled-components';
|
|
17
58
|
import cn from 'classnames';
|
|
@@ -19,51 +60,56 @@ import { get } from 'lodash';
|
|
|
19
60
|
import { systemMap as applicationsMap } from '@tntx/logo-icon';
|
|
20
61
|
import Iconfont from './Iconfont';
|
|
21
62
|
import { defaultLogo } from './images';
|
|
22
|
-
var App = styled.li(_templateObject
|
|
23
|
-
var AppList = styled.ul(_templateObject2
|
|
24
|
-
var AppItem = styled.li(_templateObject3
|
|
25
|
-
var AppContentWrapper = styled.div(_templateObject4
|
|
63
|
+
var App = styled.li(_templateObject());
|
|
64
|
+
var AppList = styled.ul(_templateObject2());
|
|
65
|
+
var AppItem = styled.li(_templateObject3());
|
|
66
|
+
var AppContentWrapper = styled.div(_templateObject4());
|
|
67
|
+
|
|
26
68
|
var AppContent = function AppContent(props) {
|
|
27
69
|
var language = props.language,
|
|
28
|
-
|
|
29
|
-
|
|
70
|
+
apps = props.apps,
|
|
71
|
+
onChange = props.onChange;
|
|
72
|
+
|
|
30
73
|
var _useState = useState(props.appKey),
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
74
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
75
|
+
appKey = _useState2[0],
|
|
76
|
+
setAppKey = _useState2[1];
|
|
77
|
+
|
|
34
78
|
var changeApp = function changeApp(appKey) {
|
|
35
79
|
setAppKey(appKey);
|
|
36
80
|
onChange && onChange(appKey);
|
|
37
81
|
};
|
|
38
|
-
|
|
82
|
+
|
|
83
|
+
return React.createElement(AppContentWrapper, null, React.createElement(AppList, null, apps.sort(function (a, b) {
|
|
39
84
|
return get(applicationsMap, "".concat(a.appKey, ".sort"), 1) - get(applicationsMap, "".concat(b.appKey, ".sort"), 1);
|
|
40
85
|
}).map(function (_ref) {
|
|
41
86
|
var key = _ref.appKey;
|
|
42
|
-
return
|
|
87
|
+
return React.createElement(AppItem, {
|
|
43
88
|
key: key,
|
|
44
89
|
className: cn({
|
|
45
90
|
active: appKey === key
|
|
46
91
|
}),
|
|
47
92
|
onClick: changeApp.bind(_this, key)
|
|
48
|
-
},
|
|
93
|
+
}, React.createElement("img", {
|
|
49
94
|
src: get(applicationsMap, "".concat(key, ".logo"), defaultLogo),
|
|
50
95
|
onError: function onError(e) {
|
|
51
96
|
e.target.onerror = null;
|
|
52
97
|
e.target.src = defaultLogo;
|
|
53
98
|
}
|
|
54
|
-
}),
|
|
99
|
+
}), React.createElement("div", null, get(applicationsMap, "".concat(key, ".").concat({
|
|
55
100
|
cn: 'name',
|
|
56
101
|
en: 'enName'
|
|
57
102
|
}[language || 'cn']), key)));
|
|
58
103
|
})));
|
|
59
104
|
};
|
|
105
|
+
|
|
60
106
|
export default (function (props) {
|
|
61
|
-
return
|
|
107
|
+
return React.createElement(App, null, React.createElement(_Popover, {
|
|
62
108
|
placement: "bottomRight",
|
|
63
109
|
title: null,
|
|
64
|
-
content:
|
|
110
|
+
content: React.createElement(AppContent, props),
|
|
65
111
|
trigger: "click"
|
|
66
|
-
},
|
|
112
|
+
}, React.createElement(Iconfont, {
|
|
67
113
|
type: "application"
|
|
68
114
|
})));
|
|
69
115
|
});
|
package/es/Layout/Avatar.js
CHANGED
|
@@ -2,47 +2,81 @@ import "antd/lib/popover/style";
|
|
|
2
2
|
import _Popover from "antd/lib/popover";
|
|
3
3
|
import "antd/lib/button/style";
|
|
4
4
|
import _Button from "antd/lib/button";
|
|
5
|
-
|
|
5
|
+
|
|
6
|
+
function _templateObject3() {
|
|
7
|
+
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"]);
|
|
8
|
+
|
|
9
|
+
_templateObject3 = function _templateObject3() {
|
|
10
|
+
return data;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
return data;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
function _templateObject2() {
|
|
17
|
+
var data = _taggedTemplateLiteral(["\n .tnt-layout-personal-popover {\n .ant-popover-inner-content {\n padding: 0;\n }\n }\n"]);
|
|
18
|
+
|
|
19
|
+
_templateObject2 = function _templateObject2() {
|
|
20
|
+
return data;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
return data;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function _templateObject() {
|
|
27
|
+
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"]);
|
|
28
|
+
|
|
29
|
+
_templateObject = function _templateObject() {
|
|
30
|
+
return data;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
return data;
|
|
34
|
+
}
|
|
35
|
+
|
|
6
36
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
37
|
+
|
|
7
38
|
import { useContext } from 'react';
|
|
8
39
|
import styled, { createGlobalStyle } from 'styled-components';
|
|
9
40
|
import { get } from 'lodash';
|
|
10
41
|
import images from './images';
|
|
11
42
|
import ActionsContext from './ActionsContext';
|
|
12
43
|
import { clearLoginCookie } from './storage';
|
|
13
|
-
var Avatar = styled.li(_templateObject
|
|
14
|
-
var GlobalStyle = createGlobalStyle(_templateObject2
|
|
15
|
-
var UserInfoWrapper = styled.div(_templateObject3
|
|
44
|
+
var Avatar = styled.li(_templateObject());
|
|
45
|
+
var GlobalStyle = createGlobalStyle(_templateObject2());
|
|
46
|
+
var UserInfoWrapper = styled.div(_templateObject3());
|
|
47
|
+
|
|
16
48
|
var UserInfoContent = function UserInfoContent(props) {
|
|
17
49
|
var userInfo = props.userInfo,
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
50
|
+
onLogout = props.onLogout,
|
|
51
|
+
_props$onChangePasswo = props.onChangePassword,
|
|
52
|
+
onChangePassword = _props$onChangePasswo === void 0 ? function () {
|
|
53
|
+
return true;
|
|
54
|
+
} : _props$onChangePasswo,
|
|
55
|
+
_props$onPersonalSett = props.onPersonalSetting,
|
|
56
|
+
onPersonalSetting = _props$onPersonalSett === void 0 ? function () {
|
|
57
|
+
return true;
|
|
58
|
+
} : _props$onPersonalSett;
|
|
59
|
+
|
|
27
60
|
var _useContext = useContext(ActionsContext),
|
|
28
|
-
|
|
29
|
-
|
|
61
|
+
getText = _useContext.getText;
|
|
62
|
+
|
|
63
|
+
return React.createElement(UserInfoWrapper, {
|
|
30
64
|
className: "user-info-setting-wrap"
|
|
31
|
-
},
|
|
65
|
+
}, React.createElement("div", {
|
|
32
66
|
className: "user-info-body"
|
|
33
|
-
},
|
|
67
|
+
}, React.createElement("p", {
|
|
34
68
|
className: "user-info-body-username"
|
|
35
|
-
}, userInfo.userName || getText('nameNull')),
|
|
69
|
+
}, userInfo.userName || getText('nameNull')), React.createElement("p", {
|
|
36
70
|
className: "user-info-body-account"
|
|
37
|
-
}, userInfo.account),
|
|
71
|
+
}, userInfo.account), React.createElement("a", {
|
|
38
72
|
onClick: onPersonalSetting,
|
|
39
73
|
href: "/bridge/userCenter?currentTab=1"
|
|
40
|
-
}, getText('personalSettings')),
|
|
74
|
+
}, getText('personalSettings')), React.createElement("a", {
|
|
41
75
|
onClick: onChangePassword,
|
|
42
76
|
href: "/bridge/userCenter?currentTab=2"
|
|
43
|
-
}, getText('changePwd'))),
|
|
77
|
+
}, getText('changePwd'))), React.createElement("div", {
|
|
44
78
|
className: "user-info-footer"
|
|
45
|
-
},
|
|
79
|
+
}, React.createElement(_Button, {
|
|
46
80
|
className: "user-info-footer-signout",
|
|
47
81
|
onClick: function onClick() {
|
|
48
82
|
if (onLogout) {
|
|
@@ -53,27 +87,30 @@ var UserInfoContent = function UserInfoContent(props) {
|
|
|
53
87
|
window.location.href = "/user/login?callbackUrl=".concat(window.encodeURI(location.href));
|
|
54
88
|
}
|
|
55
89
|
}
|
|
56
|
-
},
|
|
90
|
+
}, React.createElement("a", null, getText('signOut')))));
|
|
57
91
|
};
|
|
92
|
+
|
|
58
93
|
export default (function (props) {
|
|
59
94
|
var _images$empty2;
|
|
95
|
+
|
|
60
96
|
var _props$userInfo = props.userInfo,
|
|
61
|
-
|
|
97
|
+
userInfo = _props$userInfo === void 0 ? {} : _props$userInfo;
|
|
62
98
|
var avatar = userInfo.avatar;
|
|
63
|
-
return
|
|
99
|
+
return React.createElement(Avatar, null, React.createElement(_Popover, {
|
|
64
100
|
popupClassName: "tnt-layout-personal-popover",
|
|
65
101
|
placement: "bottomRight",
|
|
66
102
|
title: null,
|
|
67
|
-
content:
|
|
103
|
+
content: React.createElement(UserInfoContent, props),
|
|
68
104
|
trigger: "click"
|
|
69
|
-
}, avatar ?
|
|
105
|
+
}, avatar ? React.createElement("img", {
|
|
70
106
|
src: avatar.indexOf('base64') > 0 ? avatar : get(images[avatar], 'default', images[avatar]),
|
|
71
107
|
onError: function onError(e) {
|
|
72
108
|
var _images$empty;
|
|
109
|
+
|
|
73
110
|
e.target.onerror = null;
|
|
74
111
|
e.target.src = ((_images$empty = images.empty) == null ? void 0 : _images$empty["default"]) || images.empty;
|
|
75
112
|
}
|
|
76
|
-
}) :
|
|
113
|
+
}) : React.createElement("img", {
|
|
77
114
|
src: ((_images$empty2 = images.empty) == null ? void 0 : _images$empty2["default"]) || images.empty
|
|
78
|
-
})),
|
|
115
|
+
})), React.createElement(GlobalStyle, null));
|
|
79
116
|
});
|