tntd 1.3.65 → 1.4.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/.eslintignore +2 -1
- package/babel.config.js +2 -2
- package/dist/0645cf743e4e44ca9da321d689897f07.png +0 -0
- package/dist/09db77de0c24fa0f45f8a5cf299a3d11.png +0 -0
- package/dist/1.tntd.js +12 -0
- package/dist/1d0b52448de217857b270af807e9360d.png +0 -0
- package/dist/25d78d77c9c2f0d403e5d899ceb5b1ef.png +0 -0
- package/dist/27fa44ff0c98e1594d79b73045aabedf.png +0 -0
- package/dist/2c95075adb68d6131b59cae9fa554ec2.png +0 -0
- package/dist/377c871d922a25c773a9e7c2f42ed7c0.png +0 -0
- package/dist/3d901589b40bd56ff1fde2bbb700bfe1.png +0 -0
- package/dist/4abe481e130d7be0574e45573de8beb7.png +0 -0
- package/dist/95ee2260a509cd630d89c5367ed1973b.png +0 -0
- package/dist/b9dd5ff3622296fbee51ed68f4bca1bf.png +0 -0
- package/dist/bd2921989f9296089ba58efb7a76f3ef.png +0 -0
- package/dist/stats.json +45855 -0
- package/dist/tntd.css +1 -0
- package/dist/tntd.js +15 -0
- package/es/ArrayInput/README.md +129 -0
- package/es/ArrayInput/icon.js +24 -0
- package/es/ArrayInput/index.js +274 -0
- package/es/ArrayInput/index.less +20 -0
- package/es/AuthContext.js +4 -0
- package/es/Columns/README.md +149 -0
- package/es/Columns/index.js +82 -0
- package/es/Columns/index.less +75 -0
- package/es/DevelopmentLogin/LoginModal.js +117 -0
- package/es/DevelopmentLogin/README.md +49 -0
- package/es/DevelopmentLogin/index.js +40 -0
- package/es/Ellipsis/README.md +104 -0
- package/es/Ellipsis/Svg/CopySVG.js +63 -0
- package/es/Ellipsis/Svg/TickSVG.js +41 -0
- package/es/Ellipsis/index.js +139 -0
- package/es/Ellipsis/index.less +56 -0
- package/es/Handle/README.md +104 -0
- package/es/Handle/index.js +86 -0
- package/es/Handle/index.less +9 -0
- package/es/Icon/README.md +119 -0
- package/es/Icon/fonts/demo.css +539 -0
- package/es/Icon/fonts/demo_index.html +3345 -0
- package/es/Icon/fonts/iconfont.css +569 -0
- package/es/Icon/fonts/iconfont.eot +0 -0
- package/es/Icon/fonts/iconfont.js +41 -0
- package/es/Icon/fonts/iconfont.json +975 -0
- package/es/Icon/fonts/iconfont.svg +440 -0
- package/es/Icon/fonts/iconfont.ttf +0 -0
- package/es/Icon/fonts/iconfont.woff +0 -0
- package/es/Icon/fonts/iconfont.woff2 +0 -0
- package/es/Icon/iconList.js +1 -0
- package/es/Icon/index.js +26 -0
- package/es/Icon/index.less +9 -0
- package/es/Img/Contain.js +69 -0
- package/es/Img/Cover.js +126 -0
- package/es/Img/README.md +131 -0
- package/es/Img/index.js +76 -0
- package/es/Layout/ActionsContext.js +3 -0
- package/es/Layout/AppList.js +223 -0
- package/es/Layout/Application.js +113 -0
- package/es/Layout/Avatar.js +112 -0
- package/es/Layout/CompatibleLanguage.js +177 -0
- package/es/Layout/EnterpriseLayout/Avatar.js +138 -0
- package/es/Layout/EnterpriseLayout/Language.js +81 -0
- package/es/Layout/EnterpriseLayout/Theme.js +75 -0
- package/es/Layout/EnterpriseLayout/index.js +31 -0
- package/es/Layout/GlobalNavigation/NavigationPopup.js +396 -0
- package/es/Layout/GlobalNavigation/index.js +137 -0
- package/es/Layout/Header.js +95 -0
- package/es/Layout/HeaderActions.js +105 -0
- package/es/Layout/HeaderNavs.js +93 -0
- package/es/Layout/HeaderTabs.js +264 -0
- package/es/Layout/Iconfont.js +4 -0
- package/es/Layout/Language.js +81 -0
- package/es/Layout/Layout.js +232 -0
- package/es/Layout/Logo.js +86 -0
- package/es/Layout/OrgAppList.js +304 -0
- package/es/Layout/README.md +783 -0
- package/es/Layout/SideMenu.js +338 -0
- package/es/Layout/Theme.js +105 -0
- package/es/Layout/checkAuth.js +29 -0
- package/es/Layout/createActions.js +39 -0
- package/es/Layout/images/avatar/empty.png +0 -0
- package/es/Layout/images/avatar/female1.png +0 -0
- package/es/Layout/images/avatar/female2.png +0 -0
- package/es/Layout/images/avatar/female3.png +0 -0
- package/es/Layout/images/avatar/female4.png +0 -0
- package/es/Layout/images/avatar/female5.png +0 -0
- package/es/Layout/images/avatar/female6.png +0 -0
- package/es/Layout/images/avatar/male1.png +0 -0
- package/es/Layout/images/avatar/male2.png +0 -0
- package/es/Layout/images/avatar/male3.png +0 -0
- package/es/Layout/images/avatar/male4.png +0 -0
- package/es/Layout/images/avatar/male5.png +0 -0
- package/es/Layout/images/avatar/male6.png +0 -0
- package/es/Layout/images/index.js +35 -0
- package/es/Layout/images/logo/baldur.svg +14 -0
- package/es/Layout/images/logo/bi.svg +14 -0
- package/es/Layout/images/logo/bridge.svg +15 -0
- package/es/Layout/images/logo/convert.svg +18 -0
- package/es/Layout/images/logo/dataocean.svg +31 -0
- package/es/Layout/images/logo/default.svg +19 -0
- package/es/Layout/images/logo/dispatch.svg +14 -0
- package/es/Layout/images/logo/graph.svg +26 -0
- package/es/Layout/images/logo/handle.svg +10 -0
- package/es/Layout/images/logo/indicator.svg +41 -0
- package/es/Layout/images/logo/kafka.svg +12 -0
- package/es/Layout/images/logo/logo-custom.svg +13 -0
- package/es/Layout/images/logo/model.svg +17 -0
- package/es/Layout/images/logo/mysql.svg +15 -0
- package/es/Layout/images/logo/orion.svg +24 -0
- package/es/Layout/images/logo/salaxy.svg +11 -0
- package/es/Layout/images/logo/storage.svg +16 -0
- package/es/Layout/images/logo/tnt_cli_identify.svg +19 -0
- package/es/Layout/images/logo/turing.svg +35 -0
- package/es/Layout/images/theme/theme1.svg +35 -0
- package/es/Layout/images/theme/theme2.svg +33 -0
- package/es/Layout/index.js +122 -0
- package/es/Layout/paaslayout/CompactSideMenu.js +167 -0
- package/es/Layout/paaslayout/Header.js +77 -0
- package/es/Layout/paaslayout/Logo.js +22 -0
- package/es/Layout/paaslayout/SideMenu.js +168 -0
- package/es/Layout/paaslayout/index.js +233 -0
- package/es/Layout/storage.js +47 -0
- package/es/Layout/utils.js +136 -0
- package/es/LoadingButton/README.md +75 -0
- package/es/LoadingButton/index.js +43 -0
- package/es/Modal/README.md +59 -0
- package/es/Modal/index.js +94 -0
- package/es/Modal/index.less +86 -0
- package/es/Page/Box.js +72 -0
- package/es/Page/README.md +180 -0
- package/es/Page/index.js +165 -0
- package/es/Page/index.less +144 -0
- package/es/Page/utils.js +23 -0
- package/es/QueryForm/Field/Checkbox.js +19 -0
- package/es/QueryForm/Field/Select.js +78 -0
- package/es/QueryForm/Field/SelectInput.js +88 -0
- package/es/QueryForm/Field/fieldsMap.js +27 -0
- package/es/QueryForm/Field/index.js +155 -0
- package/es/QueryForm/README.md +512 -0
- package/es/QueryForm/createActions.js +53 -0
- package/es/QueryForm/index.js +376 -0
- package/es/QueryForm/index.less +133 -0
- package/es/QueryForm/useForm.js +7 -0
- package/es/QueryListScene/List.js +376 -0
- package/es/QueryListScene/QueryForm.js +166 -0
- package/es/QueryListScene/QueryListScene.js +76 -0
- package/es/QueryListScene/README.md +790 -0
- package/es/QueryListScene/Title.js +12 -0
- package/es/QueryListScene/Toolbar.js +20 -0
- package/es/QueryListScene/createActions.js +72 -0
- package/es/QueryListScene/index.js +19 -0
- package/es/QueryListScene/index.less +97 -0
- package/es/QueryListScene/useActions.js +7 -0
- package/es/Select/DropDownWrap.js +116 -0
- package/es/Select/README.md +68 -0
- package/es/Select/index.js +618 -0
- package/es/Table/README.md +109 -0
- package/es/Table/ResizableTable/index.js +108 -0
- package/es/Table/ResizableTable/index.less +36 -0
- package/es/Table/index.js +33 -0
- package/es/Title/README.md +106 -0
- package/es/Title/index.js +40 -0
- package/es/Title/index.less +170 -0
- package/es/index.js +19 -0
- package/es/locale.js +60 -0
- package/package.json +1 -1
- package/doc-scripts.config.js +0 -37
- package/doc-scripts.renderer.js +0 -11
- package/docs/README.md +0 -1643
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
var _this = this;
|
|
2
|
+
|
|
3
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }
|
|
4
|
+
|
|
5
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); }
|
|
6
|
+
|
|
7
|
+
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; }
|
|
8
|
+
|
|
9
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
10
|
+
|
|
11
|
+
function _templateObject4() {
|
|
12
|
+
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"]);
|
|
13
|
+
|
|
14
|
+
_templateObject4 = function _templateObject4() {
|
|
15
|
+
return data;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
return data;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function _templateObject3() {
|
|
22
|
+
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"]);
|
|
23
|
+
|
|
24
|
+
_templateObject3 = function _templateObject3() {
|
|
25
|
+
return data;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
return data;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function _templateObject2() {
|
|
32
|
+
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"]);
|
|
33
|
+
|
|
34
|
+
_templateObject2 = function _templateObject2() {
|
|
35
|
+
return data;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
return data;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function _templateObject() {
|
|
42
|
+
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"]);
|
|
43
|
+
|
|
44
|
+
_templateObject = function _templateObject() {
|
|
45
|
+
return data;
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
return data;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
52
|
+
|
|
53
|
+
import { useState, useEffect } from 'react';
|
|
54
|
+
import styled, { withTheme } from 'styled-components';
|
|
55
|
+
import { Dropdown, Menu, Input, Select, TreeSelect } from 'antd';
|
|
56
|
+
import { get } from 'lodash';
|
|
57
|
+
import Icon from '../Icon';
|
|
58
|
+
import { getCurrentAppStore, setCurrentAppStore } from './storage';
|
|
59
|
+
import { traverseTree } from './utils';
|
|
60
|
+
var Option = Select.Option;
|
|
61
|
+
var MenuList = styled(Menu)(_templateObject()); // 新版UI
|
|
62
|
+
|
|
63
|
+
var AppsSelect = styled(Select)(_templateObject2(), function (props) {
|
|
64
|
+
return "".concat(props.theme.blueBgColor, " !important");
|
|
65
|
+
});
|
|
66
|
+
var AppTreeSelect = styled(TreeSelect)(_templateObject3());
|
|
67
|
+
var SwitchAppMenu = styled.a(_templateObject4(), function (props) {
|
|
68
|
+
return "".concat(props.theme.headerHeight, "px");
|
|
69
|
+
}, function (props) {
|
|
70
|
+
return "".concat(props.theme.size === 'large' ? 16 : 14, "px");
|
|
71
|
+
});
|
|
72
|
+
export default withTheme(function (props) {
|
|
73
|
+
var selectedKey = props.selectedKey,
|
|
74
|
+
_props$items = props.items,
|
|
75
|
+
items = _props$items === void 0 ? [] : _props$items,
|
|
76
|
+
onChange = props.onChange;
|
|
77
|
+
|
|
78
|
+
var getInitialSelectedApp = function getInitialSelectedApp() {
|
|
79
|
+
var currentAppStore = getCurrentAppStore();
|
|
80
|
+
|
|
81
|
+
var findAppByKey = function findAppByKey(selectedKey) {
|
|
82
|
+
var findApp;
|
|
83
|
+
traverseTree(items, function (item) {
|
|
84
|
+
if (item.key === selectedKey) {
|
|
85
|
+
findApp = item;
|
|
86
|
+
return false;
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
return findApp;
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
var currentApp = findAppByKey(selectedKey || get(currentAppStore, 'key'));
|
|
93
|
+
return currentApp || items[0];
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
var changeApp = function changeApp(app) {
|
|
97
|
+
setSelectedApp(app);
|
|
98
|
+
setCurrentAppStore(app);
|
|
99
|
+
onChange && onChange(app);
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
var _useState = useState(),
|
|
103
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
104
|
+
searchValue = _useState2[0],
|
|
105
|
+
setSearchValue = _useState2[1];
|
|
106
|
+
|
|
107
|
+
var _useState3 = useState(getInitialSelectedApp()),
|
|
108
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
109
|
+
selectedApp = _useState4[0],
|
|
110
|
+
setSelectedApp = _useState4[1];
|
|
111
|
+
|
|
112
|
+
var Menus = React.createElement(MenuList, {
|
|
113
|
+
selectedKeys: [get(selectedApp, 'key')]
|
|
114
|
+
}, React.createElement(Menu.Item, {
|
|
115
|
+
className: "app-search-warp",
|
|
116
|
+
key: "search",
|
|
117
|
+
disabled: true
|
|
118
|
+
}, React.createElement(Input, {
|
|
119
|
+
allowClear: true,
|
|
120
|
+
placeholder: "\u8F93\u5165\u5173\u952E\u8BCD\u641C\u7D22",
|
|
121
|
+
value: searchValue,
|
|
122
|
+
onChange: function onChange(evt) {
|
|
123
|
+
setSearchValue(evt.target.value);
|
|
124
|
+
}
|
|
125
|
+
})), items.filter(function () {
|
|
126
|
+
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
127
|
+
key = _ref.key,
|
|
128
|
+
name = _ref.name;
|
|
129
|
+
|
|
130
|
+
var regExp = new RegExp(searchValue, 'i');
|
|
131
|
+
|
|
132
|
+
if (searchValue) {
|
|
133
|
+
return regExp.test(key) || regExp.test(name);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
return true;
|
|
137
|
+
}).map(function (item) {
|
|
138
|
+
return React.createElement(Menu.Item, {
|
|
139
|
+
key: item.key,
|
|
140
|
+
onClick: changeApp.bind(_this, item)
|
|
141
|
+
}, item.name);
|
|
142
|
+
}));
|
|
143
|
+
useEffect(function () {
|
|
144
|
+
var newApp = getInitialSelectedApp();
|
|
145
|
+
|
|
146
|
+
if ((newApp == null ? void 0 : newApp.key) !== (selectedApp == null ? void 0 : selectedApp.key)) {
|
|
147
|
+
changeApp(newApp);
|
|
148
|
+
}
|
|
149
|
+
}, [items, selectedKey]);
|
|
150
|
+
|
|
151
|
+
if (!props.theme.compatible) {
|
|
152
|
+
if (items == null ? void 0 : items.some(function (item) {
|
|
153
|
+
var _item$children;
|
|
154
|
+
|
|
155
|
+
return (_item$children = item.children) == null ? void 0 : _item$children.length;
|
|
156
|
+
})) {
|
|
157
|
+
return React.createElement(AppTreeSelect, {
|
|
158
|
+
placeholder: "\u8BF7\u9009\u62E9",
|
|
159
|
+
showSearch: true,
|
|
160
|
+
treeNodeFilterProp: "title",
|
|
161
|
+
treeDefaultExpandAll: true,
|
|
162
|
+
dropdownClassName: "tnt-layout-header-app-tree-select",
|
|
163
|
+
dropdownStyle: {
|
|
164
|
+
maxHeight: 560
|
|
165
|
+
},
|
|
166
|
+
value: get(selectedApp, 'key'),
|
|
167
|
+
treeData: traverseTree(items, function (item) {
|
|
168
|
+
item.title = item.name;
|
|
169
|
+
item.value = item.key;
|
|
170
|
+
item.selectable = !item.children;
|
|
171
|
+
item.disabled = !!item.children;
|
|
172
|
+
}),
|
|
173
|
+
onChange: function onChange(appKey) {
|
|
174
|
+
var findItem;
|
|
175
|
+
traverseTree(items, function (node) {
|
|
176
|
+
if (node.key === appKey) {
|
|
177
|
+
findItem = node;
|
|
178
|
+
return false;
|
|
179
|
+
}
|
|
180
|
+
});
|
|
181
|
+
changeApp(findItem);
|
|
182
|
+
},
|
|
183
|
+
style: {
|
|
184
|
+
minWidth: 160,
|
|
185
|
+
height: 28,
|
|
186
|
+
lineHeight: 28
|
|
187
|
+
}
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
return React.createElement(AppsSelect, {
|
|
192
|
+
placeholder: "\u8BF7\u9009\u62E9",
|
|
193
|
+
showSearch: true,
|
|
194
|
+
optionFilterProp: "children",
|
|
195
|
+
value: get(selectedApp, 'key'),
|
|
196
|
+
onChange: function onChange(appKey) {
|
|
197
|
+
changeApp(items.find(function (_ref2) {
|
|
198
|
+
var key = _ref2.key;
|
|
199
|
+
return key === appKey;
|
|
200
|
+
}));
|
|
201
|
+
},
|
|
202
|
+
style: {
|
|
203
|
+
minWidth: 160,
|
|
204
|
+
height: 28,
|
|
205
|
+
lineHeight: 28
|
|
206
|
+
}
|
|
207
|
+
}, items.map(function (_ref3) {
|
|
208
|
+
var key = _ref3.key,
|
|
209
|
+
name = _ref3.name;
|
|
210
|
+
return React.createElement(Option, {
|
|
211
|
+
key: key,
|
|
212
|
+
value: key
|
|
213
|
+
}, name);
|
|
214
|
+
}));
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
return React.createElement(Dropdown, {
|
|
218
|
+
overlay: Menus,
|
|
219
|
+
trigger: ['click']
|
|
220
|
+
}, React.createElement(SwitchAppMenu, null, React.createElement("span", null, get(selectedApp, 'name', '请选择')), React.createElement(Icon, {
|
|
221
|
+
type: "caret-down"
|
|
222
|
+
})));
|
|
223
|
+
});
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
var _this = this;
|
|
2
|
+
|
|
3
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }
|
|
4
|
+
|
|
5
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); }
|
|
6
|
+
|
|
7
|
+
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; }
|
|
8
|
+
|
|
9
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
10
|
+
|
|
11
|
+
function _templateObject4() {
|
|
12
|
+
var data = _taggedTemplateLiteral(["\n background-color: #fff;\n border-radius: 4px;\n z-index: 1;\n"]);
|
|
13
|
+
|
|
14
|
+
_templateObject4 = function _templateObject4() {
|
|
15
|
+
return data;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
return data;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function _templateObject3() {
|
|
22
|
+
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"]);
|
|
23
|
+
|
|
24
|
+
_templateObject3 = function _templateObject3() {
|
|
25
|
+
return data;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
return data;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function _templateObject2() {
|
|
32
|
+
var data = _taggedTemplateLiteral(["\n list-style: none;\n width: 264px;\n margin: 0;\n padding: 0;\n"]);
|
|
33
|
+
|
|
34
|
+
_templateObject2 = function _templateObject2() {
|
|
35
|
+
return data;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
return data;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function _templateObject() {
|
|
42
|
+
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"]);
|
|
43
|
+
|
|
44
|
+
_templateObject = function _templateObject() {
|
|
45
|
+
return data;
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
return data;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
52
|
+
|
|
53
|
+
import { useState } from 'react';
|
|
54
|
+
import styled from 'styled-components';
|
|
55
|
+
import cn from 'classnames';
|
|
56
|
+
import { Popover } from 'antd';
|
|
57
|
+
import { get } from 'lodash';
|
|
58
|
+
import { systemMap as applicationsMap } from '@tntx/logo-icon';
|
|
59
|
+
import Iconfont from './Iconfont';
|
|
60
|
+
import { defaultLogo } from './images';
|
|
61
|
+
var App = styled.li(_templateObject());
|
|
62
|
+
var AppList = styled.ul(_templateObject2());
|
|
63
|
+
var AppItem = styled.li(_templateObject3());
|
|
64
|
+
var AppContentWrapper = styled.div(_templateObject4());
|
|
65
|
+
|
|
66
|
+
var AppContent = function AppContent(props) {
|
|
67
|
+
var language = props.language,
|
|
68
|
+
apps = props.apps,
|
|
69
|
+
onChange = props.onChange;
|
|
70
|
+
|
|
71
|
+
var _useState = useState(props.appKey),
|
|
72
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
73
|
+
appKey = _useState2[0],
|
|
74
|
+
setAppKey = _useState2[1];
|
|
75
|
+
|
|
76
|
+
var changeApp = function changeApp(appKey) {
|
|
77
|
+
setAppKey(appKey);
|
|
78
|
+
onChange && onChange(appKey);
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
return React.createElement(AppContentWrapper, null, React.createElement(AppList, null, apps.sort(function (a, b) {
|
|
82
|
+
return get(applicationsMap, "".concat(a.appKey, ".sort"), 1) - get(applicationsMap, "".concat(b.appKey, ".sort"), 1);
|
|
83
|
+
}).map(function (_ref) {
|
|
84
|
+
var key = _ref.appKey;
|
|
85
|
+
return React.createElement(AppItem, {
|
|
86
|
+
key: key,
|
|
87
|
+
className: cn({
|
|
88
|
+
active: appKey === key
|
|
89
|
+
}),
|
|
90
|
+
onClick: changeApp.bind(_this, key)
|
|
91
|
+
}, React.createElement("img", {
|
|
92
|
+
src: get(applicationsMap, "".concat(key, ".logo"), defaultLogo),
|
|
93
|
+
onError: function onError(e) {
|
|
94
|
+
e.target.onerror = null;
|
|
95
|
+
e.target.src = defaultLogo;
|
|
96
|
+
}
|
|
97
|
+
}), React.createElement("div", null, get(applicationsMap, "".concat(key, ".").concat({
|
|
98
|
+
cn: 'name',
|
|
99
|
+
en: 'enName'
|
|
100
|
+
}[language || 'cn']), key)));
|
|
101
|
+
})));
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
export default (function (props) {
|
|
105
|
+
return React.createElement(App, null, React.createElement(Popover, {
|
|
106
|
+
placement: "bottomRight",
|
|
107
|
+
title: null,
|
|
108
|
+
content: React.createElement(AppContent, props),
|
|
109
|
+
trigger: "click"
|
|
110
|
+
}, React.createElement(Iconfont, {
|
|
111
|
+
type: "application"
|
|
112
|
+
})));
|
|
113
|
+
});
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
function _templateObject3() {
|
|
2
|
+
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"]);
|
|
3
|
+
|
|
4
|
+
_templateObject3 = function _templateObject3() {
|
|
5
|
+
return data;
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
return data;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
function _templateObject2() {
|
|
12
|
+
var data = _taggedTemplateLiteral(["\n .tnt-layout-personal-popover {\n .ant-popover-inner-content {\n padding: 0;\n }\n }\n"]);
|
|
13
|
+
|
|
14
|
+
_templateObject2 = function _templateObject2() {
|
|
15
|
+
return data;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
return data;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function _templateObject() {
|
|
22
|
+
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"]);
|
|
23
|
+
|
|
24
|
+
_templateObject = function _templateObject() {
|
|
25
|
+
return data;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
return data;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
32
|
+
|
|
33
|
+
import { useContext } from 'react';
|
|
34
|
+
import styled, { createGlobalStyle } from 'styled-components';
|
|
35
|
+
import { Popover, Button } from 'antd';
|
|
36
|
+
import deleteAllCookiesFactory from 'delete-all-cookies';
|
|
37
|
+
import { get } from 'lodash';
|
|
38
|
+
import images from './images';
|
|
39
|
+
import ActionsContext from './ActionsContext';
|
|
40
|
+
var Avatar = styled.li(_templateObject());
|
|
41
|
+
var GlobalStyle = createGlobalStyle(_templateObject2());
|
|
42
|
+
var UserInfoWrapper = styled.div(_templateObject3());
|
|
43
|
+
|
|
44
|
+
var UserInfoContent = function UserInfoContent(props) {
|
|
45
|
+
var userInfo = props.userInfo,
|
|
46
|
+
onLogout = props.onLogout,
|
|
47
|
+
_props$onChangePasswo = props.onChangePassword,
|
|
48
|
+
onChangePassword = _props$onChangePasswo === void 0 ? function () {
|
|
49
|
+
return true;
|
|
50
|
+
} : _props$onChangePasswo,
|
|
51
|
+
_props$onPersonalSett = props.onPersonalSetting,
|
|
52
|
+
onPersonalSetting = _props$onPersonalSett === void 0 ? function () {
|
|
53
|
+
return true;
|
|
54
|
+
} : _props$onPersonalSett;
|
|
55
|
+
|
|
56
|
+
var _useContext = useContext(ActionsContext),
|
|
57
|
+
getText = _useContext.getText;
|
|
58
|
+
|
|
59
|
+
return React.createElement(UserInfoWrapper, {
|
|
60
|
+
className: "user-info-setting-wrap"
|
|
61
|
+
}, React.createElement("div", {
|
|
62
|
+
className: "user-info-body"
|
|
63
|
+
}, React.createElement("p", {
|
|
64
|
+
className: "user-info-body-username"
|
|
65
|
+
}, userInfo.userName || '暂无昵称'), React.createElement("p", {
|
|
66
|
+
className: "user-info-body-account"
|
|
67
|
+
}, userInfo.account), React.createElement("a", {
|
|
68
|
+
onClick: onPersonalSetting,
|
|
69
|
+
href: "/bridge/userCenter?currentTab=1"
|
|
70
|
+
}, getText('personalSettings')), React.createElement("a", {
|
|
71
|
+
onClick: onChangePassword,
|
|
72
|
+
href: "/bridge/userCenter?currentTab=2"
|
|
73
|
+
}, getText('changePwd'))), React.createElement("div", {
|
|
74
|
+
className: "user-info-footer"
|
|
75
|
+
}, React.createElement(Button, {
|
|
76
|
+
className: "user-info-footer-signout",
|
|
77
|
+
onClick: function onClick() {
|
|
78
|
+
if (onLogout) {
|
|
79
|
+
onLogout();
|
|
80
|
+
deleteAllCookiesFactory(window)();
|
|
81
|
+
} else {
|
|
82
|
+
deleteAllCookiesFactory(window)();
|
|
83
|
+
window.location.href = "/user/login?callbackUrl=".concat(window.encodeURI(location.href));
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}, React.createElement("a", null, getText('signOut')))));
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
export default (function (props) {
|
|
90
|
+
var _images$empty2;
|
|
91
|
+
|
|
92
|
+
var _props$userInfo = props.userInfo,
|
|
93
|
+
userInfo = _props$userInfo === void 0 ? {} : _props$userInfo;
|
|
94
|
+
var avatar = userInfo.avatar;
|
|
95
|
+
return React.createElement(Avatar, null, React.createElement(Popover, {
|
|
96
|
+
popupClassName: "tnt-layout-personal-popover",
|
|
97
|
+
placement: "bottomRight",
|
|
98
|
+
title: null,
|
|
99
|
+
content: React.createElement(UserInfoContent, props),
|
|
100
|
+
trigger: "click"
|
|
101
|
+
}, avatar ? React.createElement("img", {
|
|
102
|
+
src: avatar.indexOf('base64') > 0 ? avatar : get(images[avatar], 'default', images[avatar]),
|
|
103
|
+
onError: function onError(e) {
|
|
104
|
+
var _images$empty;
|
|
105
|
+
|
|
106
|
+
e.target.onerror = null;
|
|
107
|
+
e.target.src = ((_images$empty = images.empty) == null ? void 0 : _images$empty["default"]) || images.empty;
|
|
108
|
+
}
|
|
109
|
+
}) : React.createElement("img", {
|
|
110
|
+
src: ((_images$empty2 = images.empty) == null ? void 0 : _images$empty2["default"]) || images.empty
|
|
111
|
+
})), React.createElement(GlobalStyle, null));
|
|
112
|
+
});
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
var _this = this;
|
|
2
|
+
|
|
3
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }
|
|
4
|
+
|
|
5
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); }
|
|
6
|
+
|
|
7
|
+
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; }
|
|
8
|
+
|
|
9
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
10
|
+
|
|
11
|
+
function _templateObject4() {
|
|
12
|
+
var data = _taggedTemplateLiteral(["\n z-index: 1;\n background-color: #fff;\n border-radius: 4px;\n min-width: 203px;\n padding: 8px 4px 8px 8px;\n .line {\n background: #f0f0f0;\n height: 1px;\n margin: 20px 0;\n width: calc(100% + 44px);\n transform: translateX(-22px);\n }\n"]);
|
|
13
|
+
|
|
14
|
+
_templateObject4 = function _templateObject4() {
|
|
15
|
+
return data;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
return data;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function _templateObject3() {
|
|
22
|
+
var data = _taggedTemplateLiteral(["\n margin-bottom: 20px;\n & > div {\n position: relative;\n display: inline-block;\n cursor: pointer;\n img {\n width: 48px;\n }\n &:first-child {\n margin-right: 10px;\n }\n &:last-child {\n margin-left: 10px;\n }\n & > i, & > .tnt-icon, & > .anticon {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n color: #1890ff;\n }\n }\n"]);
|
|
23
|
+
|
|
24
|
+
_templateObject3 = function _templateObject3() {
|
|
25
|
+
return data;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
return data;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function _templateObject2() {
|
|
32
|
+
var data = _taggedTemplateLiteral(["\n margin-left: 20px;\n font-size: 20px;\n .tnt-themeS1 & {\n color: rgba(255,255,255,.85);\n }\n .isInIframe & {\n display: none;\n }\n .tnt-icon {\n font-size: 30px;\n vertical-align: middle;\n opacity: .75;\n color: #2b5696;\n .tnt-themeS1 & {\n /* color: #fff; */\n }\n }\n"]);
|
|
33
|
+
|
|
34
|
+
_templateObject2 = function _templateObject2() {
|
|
35
|
+
return data;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
return data;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function _templateObject() {
|
|
42
|
+
var data = _taggedTemplateLiteral(["\n margin-bottom: 10px;\n\n & > div {\n padding: 10px 13px 10px 17px;\n border-radius: 20px 0 0 20px;\n border-right: none;\n display: inline-block;\n color: #fff;\n width: 49%;\n text-align: center;\n font-size: 14px;\n letter-spacing: 0!important;\n color: #666;\n border: 1px solid #e5e5e5;\n vertical-align: middle;\n display: inline-block;\n letter-spacing: -4px;\n cursor: pointer;\n &:first-child {\n padding: 10px 13px 10px 17px;\n border-radius: 20px 0 0 20px;\n border-right: none;\n }\n &:last-child {\n padding: 10px 17px 10px 13px;\n border-radius: 0 20px 20px 0;\n border-left: none;\n }\n &.active {\n background-color: #4b93e5;\n border-color: #4b93e5;\n color: #fff;\n }\n }\n"]);
|
|
43
|
+
|
|
44
|
+
_templateObject = function _templateObject() {
|
|
45
|
+
return data;
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
return data;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
52
|
+
|
|
53
|
+
import { useState } from 'react';
|
|
54
|
+
import styled from 'styled-components';
|
|
55
|
+
import cn from 'classnames';
|
|
56
|
+
import { Popover } from 'antd';
|
|
57
|
+
import { get } from 'lodash';
|
|
58
|
+
import Icon from '../Icon';
|
|
59
|
+
import images from './images';
|
|
60
|
+
import { setThemeStore, getThemeStore, setLanguageStore, getLanguageStore } from './storage';
|
|
61
|
+
var languages = [{
|
|
62
|
+
value: 'cn',
|
|
63
|
+
name: '中文'
|
|
64
|
+
}, {
|
|
65
|
+
value: 'en',
|
|
66
|
+
name: ' EN '
|
|
67
|
+
}];
|
|
68
|
+
var languagesMap = languages.reduce(function (acc, cur) {
|
|
69
|
+
acc[cur.value] = cur;
|
|
70
|
+
return acc;
|
|
71
|
+
}, {});
|
|
72
|
+
var LanguageSwitch = styled.div(_templateObject());
|
|
73
|
+
var Theme = styled.li(_templateObject2());
|
|
74
|
+
var ThemeSwitch = styled.div(_templateObject3());
|
|
75
|
+
var ThemeContentWrapper = styled.div(_templateObject4());
|
|
76
|
+
var themes = [{
|
|
77
|
+
value: 'themeS1',
|
|
78
|
+
img: images.themeSymbol1
|
|
79
|
+
}, {
|
|
80
|
+
value: 'themeS2',
|
|
81
|
+
img: images.themeSymbol2
|
|
82
|
+
}];
|
|
83
|
+
|
|
84
|
+
var ThemeContent = function ThemeContent(props) {
|
|
85
|
+
var config = props.config,
|
|
86
|
+
onLanguageChange = props.onLanguageChange,
|
|
87
|
+
onThemeChange = props.onThemeChange;
|
|
88
|
+
|
|
89
|
+
var _ref = config || {},
|
|
90
|
+
_ref$language = _ref.language,
|
|
91
|
+
languageVisible = _ref$language === void 0 ? true : _ref$language,
|
|
92
|
+
_ref$theme = _ref.theme,
|
|
93
|
+
themeVisible = _ref$theme === void 0 ? true : _ref$theme;
|
|
94
|
+
|
|
95
|
+
var getTheme = function getTheme() {
|
|
96
|
+
var theme = getThemeStore() || props.theme || 'themeS2';
|
|
97
|
+
return themes.some(function (_ref2) {
|
|
98
|
+
var value = _ref2.value;
|
|
99
|
+
return value === theme;
|
|
100
|
+
}) ? theme : 'themeS2';
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
var _useState = useState(getTheme()),
|
|
104
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
105
|
+
theme = _useState2[0],
|
|
106
|
+
setTheme = _useState2[1];
|
|
107
|
+
|
|
108
|
+
var changeTheme = function changeTheme(theme) {
|
|
109
|
+
setTheme(theme);
|
|
110
|
+
setThemeStore(theme);
|
|
111
|
+
onThemeChange(theme);
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
var getLanguage = function getLanguage() {
|
|
115
|
+
var lang = getLanguageStore() || props.language;
|
|
116
|
+
|
|
117
|
+
if (!languagesMap[lang]) {
|
|
118
|
+
lang = get(languages, '0.value');
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
return lang;
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
var _useState3 = useState(getLanguage()),
|
|
125
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
126
|
+
_useState4$ = _useState4[0],
|
|
127
|
+
language = _useState4$ === void 0 ? 'cn' : _useState4$,
|
|
128
|
+
setLanguage = _useState4[1];
|
|
129
|
+
|
|
130
|
+
var changeLanguage = function changeLanguage(language) {
|
|
131
|
+
setLanguage(language);
|
|
132
|
+
setLanguageStore(language);
|
|
133
|
+
onLanguageChange(language);
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
return React.createElement(ThemeContentWrapper, null, themeVisible && React.createElement(ThemeSwitch, null, themes.map(function (_ref3) {
|
|
137
|
+
var value = _ref3.value,
|
|
138
|
+
img = _ref3.img;
|
|
139
|
+
return React.createElement("div", {
|
|
140
|
+
key: value,
|
|
141
|
+
onClick: changeTheme.bind(_this, value)
|
|
142
|
+
}, React.createElement("img", {
|
|
143
|
+
src: img
|
|
144
|
+
}), theme === value && React.createElement(Icon, {
|
|
145
|
+
type: "check1"
|
|
146
|
+
}));
|
|
147
|
+
})), themeVisible && languageVisible && React.createElement("div", {
|
|
148
|
+
className: "line"
|
|
149
|
+
}), languageVisible && React.createElement(LanguageSwitch, null, languages.map(function (_ref4) {
|
|
150
|
+
var value = _ref4.value,
|
|
151
|
+
name = _ref4.name;
|
|
152
|
+
return React.createElement("div", {
|
|
153
|
+
className: cn({
|
|
154
|
+
active: value === language
|
|
155
|
+
}),
|
|
156
|
+
key: value,
|
|
157
|
+
onClick: changeLanguage.bind(_this, value)
|
|
158
|
+
}, name);
|
|
159
|
+
})));
|
|
160
|
+
};
|
|
161
|
+
|
|
162
|
+
export default (function (props) {
|
|
163
|
+
var config = props.config;
|
|
164
|
+
|
|
165
|
+
if ((config == null ? void 0 : config.language) === false && (config == null ? void 0 : config.theme) === false) {
|
|
166
|
+
return null;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
return React.createElement(Theme, null, React.createElement(Popover, {
|
|
170
|
+
placement: "bottomRight",
|
|
171
|
+
title: null,
|
|
172
|
+
content: React.createElement(ThemeContent, props),
|
|
173
|
+
trigger: "click"
|
|
174
|
+
}, React.createElement(Icon, {
|
|
175
|
+
type: "daxiaoxie"
|
|
176
|
+
})));
|
|
177
|
+
});
|