tntd 1.3.66 → 1.4.2
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/babel.config.js +1 -1
- 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 +282 -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 +86 -0
- package/es/Columns/index.less +75 -0
- package/es/DevelopmentLogin/LoginModal.js +126 -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 +143 -0
- package/es/Ellipsis/index.less +56 -0
- package/es/Handle/README.md +104 -0
- package/es/Handle/index.js +92 -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 +233 -0
- package/es/Layout/Application.js +115 -0
- package/es/Layout/Avatar.js +116 -0
- package/es/Layout/CompatibleLanguage.js +179 -0
- package/es/Layout/EnterpriseLayout/Avatar.js +144 -0
- package/es/Layout/EnterpriseLayout/Language.js +81 -0
- package/es/Layout/EnterpriseLayout/Theme.js +77 -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 +107 -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 +234 -0
- package/es/Layout/Logo.js +86 -0
- package/es/Layout/OrgAppList.js +310 -0
- package/es/Layout/README.md +783 -0
- package/es/Layout/SideMenu.js +340 -0
- package/es/Layout/Theme.js +107 -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 +235 -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 +45 -0
- package/es/Modal/README.md +59 -0
- package/es/Modal/index.js +96 -0
- package/es/Modal/index.less +86 -0
- package/es/Page/Box.js +74 -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 +21 -0
- package/es/QueryForm/Field/Select.js +80 -0
- package/es/QueryForm/Field/SelectInput.js +92 -0
- package/es/QueryForm/Field/fieldsMap.js +32 -0
- package/es/QueryForm/Field/index.js +157 -0
- package/es/QueryForm/README.md +512 -0
- package/es/QueryForm/createActions.js +53 -0
- package/es/QueryForm/index.js +384 -0
- package/es/QueryForm/index.less +133 -0
- package/es/QueryForm/useForm.js +7 -0
- package/es/QueryListScene/List.js +378 -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 +622 -0
- package/es/Table/README.md +109 -0
- package/es/Table/ResizableTable/index.js +110 -0
- package/es/Table/ResizableTable/index.less +36 -0
- package/es/Table/index.js +35 -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,144 @@
|
|
|
1
|
+
import "antd/lib/popover/style";
|
|
2
|
+
import _Popover from "antd/lib/popover";
|
|
3
|
+
import "antd/lib/row/style";
|
|
4
|
+
import _Row from "antd/lib/row";
|
|
5
|
+
import "antd/lib/divider/style";
|
|
6
|
+
import _Divider from "antd/lib/divider";
|
|
7
|
+
|
|
8
|
+
function _templateObject3() {
|
|
9
|
+
var data = _taggedTemplateLiteral(["\n width: 330px;\n z-index: 1;\n background-color: #fff;\n border-radius: 4px;\n box-shadow: 0px 0px 6px 0px rgba(0,0,0,0.1);\n .isInIframe & {\n display: none;\n }\n\n .user-info-body {\n padding: 20px 15px;\n line-height: 16px;\n list-style: none;\n margin: 0;\n .user-info-body-username {\n margin-top: 0px;\n font-family: PingFangSC-Regular;\n font-weight: normal;\n font-size: 14px;\n color: ", ";\n line-height: 14px;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n .user-info-body-account {\n margin-top: 0px;\n font-family: PingFangSC-Regular;\n font-size: 12px;\n color: #8B919E;\n margin-bottom: 14px;\n line-height: 14px;\n margin-left: 10px;\n }\n }\n .user-info-footer {\n border-top: ", ";\n background-color: #fff;\n height: 36px;\n line-height: 36px;\n padding: 0 15px;\n font-size: 12px;\n color: ", ";\n a{\n flex: 1;\n text-align:center;\n color: ", ";\n }\n }\n"]);
|
|
10
|
+
|
|
11
|
+
_templateObject3 = function _templateObject3() {
|
|
12
|
+
return data;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
return data;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function _templateObject2() {
|
|
19
|
+
var data = _taggedTemplateLiteral(["\n .tnt-layout-personal-popover {\n .ant-popover-inner-content {\n padding: 0;\n }\n }\n"]);
|
|
20
|
+
|
|
21
|
+
_templateObject2 = function _templateObject2() {
|
|
22
|
+
return data;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
return data;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function _templateObject() {
|
|
29
|
+
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"]);
|
|
30
|
+
|
|
31
|
+
_templateObject = function _templateObject() {
|
|
32
|
+
return data;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
return data;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
39
|
+
|
|
40
|
+
import styled, { createGlobalStyle } from 'styled-components';
|
|
41
|
+
import deleteAllCookiesFactory from 'delete-all-cookies';
|
|
42
|
+
import { get } from 'lodash';
|
|
43
|
+
import images from '../images';
|
|
44
|
+
import Language from './Language';
|
|
45
|
+
import Theme from './Theme';
|
|
46
|
+
var Avatar = styled.li(_templateObject());
|
|
47
|
+
var GlobalStyle = createGlobalStyle(_templateObject2());
|
|
48
|
+
var UserInfoWrapper = styled.div(_templateObject3(), function (props) {
|
|
49
|
+
return "".concat(props.theme.primaryTextColor);
|
|
50
|
+
}, function (props) {
|
|
51
|
+
return "1px solid ".concat(props.theme.dividerColor);
|
|
52
|
+
}, function (props) {
|
|
53
|
+
return "".concat(props.theme.primaryColor);
|
|
54
|
+
}, function (props) {
|
|
55
|
+
return "".concat(props.theme.primaryColor);
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
var UserInfoContent = function UserInfoContent(props) {
|
|
59
|
+
var userInfo = props.userInfo,
|
|
60
|
+
_props$config = props.config,
|
|
61
|
+
config = _props$config === void 0 ? {} : _props$config,
|
|
62
|
+
onLogout = props.onLogout,
|
|
63
|
+
_props$onChangePasswo = props.onChangePassword,
|
|
64
|
+
onChangePassword = _props$onChangePasswo === void 0 ? function () {
|
|
65
|
+
return true;
|
|
66
|
+
} : _props$onChangePasswo,
|
|
67
|
+
_props$onPersonalSett = props.onPersonalSetting,
|
|
68
|
+
onPersonalSetting = _props$onPersonalSett === void 0 ? function () {
|
|
69
|
+
return true;
|
|
70
|
+
} : _props$onPersonalSett,
|
|
71
|
+
onLanguageChange = props.onLanguageChange,
|
|
72
|
+
onThemeChange = props.onThemeChange;
|
|
73
|
+
|
|
74
|
+
var _ref = config || {},
|
|
75
|
+
_ref$language = _ref.language,
|
|
76
|
+
language = _ref$language === void 0 ? true : _ref$language;
|
|
77
|
+
|
|
78
|
+
return React.createElement(UserInfoWrapper, {
|
|
79
|
+
className: "user-info-setting-wrap"
|
|
80
|
+
}, React.createElement("ul", {
|
|
81
|
+
className: "user-info-body"
|
|
82
|
+
}, React.createElement("li", {
|
|
83
|
+
className: "user-info-body-username"
|
|
84
|
+
}, userInfo.userName || '暂无昵称', React.createElement("span", {
|
|
85
|
+
className: "user-info-body-account"
|
|
86
|
+
}, userInfo.account)), language && React.createElement(Language, {
|
|
87
|
+
language: userInfo.lang,
|
|
88
|
+
onChange: onLanguageChange
|
|
89
|
+
}), React.createElement(Theme, {
|
|
90
|
+
theme: userInfo.theme,
|
|
91
|
+
onChange: onThemeChange
|
|
92
|
+
})), React.createElement(_Row, {
|
|
93
|
+
className: "user-info-footer",
|
|
94
|
+
type: "flex",
|
|
95
|
+
justify: "space-between",
|
|
96
|
+
align: "middle"
|
|
97
|
+
}, React.createElement("a", {
|
|
98
|
+
onClick: onPersonalSetting,
|
|
99
|
+
href: "/bridge/userCenter?currentTab=1"
|
|
100
|
+
}, "\u4E2A\u4EBA\u8BBE\u7F6E"), React.createElement(_Divider, {
|
|
101
|
+
type: "vertical"
|
|
102
|
+
}), React.createElement("a", {
|
|
103
|
+
onClick: onChangePassword,
|
|
104
|
+
href: "/bridge/userCenter?currentTab=2"
|
|
105
|
+
}, "\u4FEE\u6539\u5BC6\u7801"), React.createElement(_Divider, {
|
|
106
|
+
type: "vertical"
|
|
107
|
+
}), React.createElement("a", {
|
|
108
|
+
className: "user-info-footer-signout",
|
|
109
|
+
onClick: function onClick() {
|
|
110
|
+
if (onLogout) {
|
|
111
|
+
onLogout();
|
|
112
|
+
deleteAllCookiesFactory(window)();
|
|
113
|
+
} else {
|
|
114
|
+
deleteAllCookiesFactory(window)();
|
|
115
|
+
window.location.href = "/user/login?callbackUrl=".concat(window.encodeURI(location.href));
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}, "\u9000\u51FA\u767B\u5F55")));
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
export default (function (props) {
|
|
122
|
+
var _images$empty2;
|
|
123
|
+
|
|
124
|
+
var _props$userInfo = props.userInfo,
|
|
125
|
+
userInfo = _props$userInfo === void 0 ? {} : _props$userInfo;
|
|
126
|
+
var avatar = userInfo.avatar;
|
|
127
|
+
return React.createElement(Avatar, null, React.createElement(_Popover, {
|
|
128
|
+
popupClassName: "tnt-layout-personal-popover",
|
|
129
|
+
placement: "bottomRight",
|
|
130
|
+
title: null,
|
|
131
|
+
content: React.createElement(UserInfoContent, props),
|
|
132
|
+
trigger: "click"
|
|
133
|
+
}, avatar ? React.createElement("img", {
|
|
134
|
+
src: avatar.indexOf('base64') > 0 ? avatar : get(images[avatar], 'default', images[avatar]),
|
|
135
|
+
onError: function onError(e) {
|
|
136
|
+
var _images$empty;
|
|
137
|
+
|
|
138
|
+
e.target.onerror = null;
|
|
139
|
+
e.target.src = ((_images$empty = images.empty) == null ? void 0 : _images$empty["default"]) || images.empty;
|
|
140
|
+
}
|
|
141
|
+
}) : React.createElement("img", {
|
|
142
|
+
src: ((_images$empty2 = images.empty) == null ? void 0 : _images$empty2["default"]) || images.empty
|
|
143
|
+
})), React.createElement(GlobalStyle, null));
|
|
144
|
+
});
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }
|
|
2
|
+
|
|
3
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); }
|
|
4
|
+
|
|
5
|
+
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; }
|
|
6
|
+
|
|
7
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
8
|
+
|
|
9
|
+
function _templateObject() {
|
|
10
|
+
var data = _taggedTemplateLiteral(["\n display:inline-block;\n padding: 0 10px;\n height: 32px;\n line-height: 32px;\n text-align: center;\n background: #FFFFFF;\n border: 1px solid #E1E6EE;\n border-radius: 2px;\n font-family: PingFangSC-Regular;\n color: #17233D;\n font-size: ", ";\n cursor: pointer;\n margin-top: 8px;\n\n .tnt-icon {\n font-size: ", ";\n margin-right: 4px;\n }\n\n span {\n position: relative;\n font-size: ", ";\n top: ", ";\n font-family: auto;\n }\n\n .isInIframe & {\n display: none;\n }\n"]);
|
|
11
|
+
|
|
12
|
+
_templateObject = function _templateObject() {
|
|
13
|
+
return data;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
return data;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
20
|
+
|
|
21
|
+
import { useState } from 'react';
|
|
22
|
+
import styled, { withTheme } from 'styled-components';
|
|
23
|
+
import { get } from 'lodash';
|
|
24
|
+
import Iconfont from '../Iconfont';
|
|
25
|
+
import { setLanguageStore, getLanguageStore } from '../storage';
|
|
26
|
+
var languages = [{
|
|
27
|
+
value: 'cn',
|
|
28
|
+
name: '中文'
|
|
29
|
+
}, {
|
|
30
|
+
value: 'en',
|
|
31
|
+
name: 'EN '
|
|
32
|
+
}];
|
|
33
|
+
var languagesMap = languages.reduce(function (acc, cur) {
|
|
34
|
+
acc[cur.value] = cur;
|
|
35
|
+
return acc;
|
|
36
|
+
}, {});
|
|
37
|
+
var Language = styled.li(_templateObject(), function (_ref) {
|
|
38
|
+
var size = _ref.theme.size;
|
|
39
|
+
return size === 'large' ? '14px' : '12px';
|
|
40
|
+
}, function (_ref2) {
|
|
41
|
+
var size = _ref2.theme.size;
|
|
42
|
+
return size === 'large' ? '24px' : '20px';
|
|
43
|
+
}, function (_ref3) {
|
|
44
|
+
var size = _ref3.theme.size;
|
|
45
|
+
return size === 'large' ? '14px' : '12px';
|
|
46
|
+
}, function (_ref4) {
|
|
47
|
+
var size = _ref4.theme.size;
|
|
48
|
+
return size === 'large' ? '-3px' : '-2px';
|
|
49
|
+
});
|
|
50
|
+
export default withTheme(function (props) {
|
|
51
|
+
var onChange = props.onChange;
|
|
52
|
+
|
|
53
|
+
var getLanguage = function getLanguage() {
|
|
54
|
+
var lang = getLanguageStore() || props.language;
|
|
55
|
+
|
|
56
|
+
if (!languagesMap[lang]) {
|
|
57
|
+
lang = get(languages, '0.value');
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
return lang;
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
var _useState = useState(getLanguage()),
|
|
64
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
65
|
+
_useState2$ = _useState2[0],
|
|
66
|
+
language = _useState2$ === void 0 ? 'cn' : _useState2$,
|
|
67
|
+
setLanguage = _useState2[1];
|
|
68
|
+
|
|
69
|
+
var switchLanguage = function switchLanguage() {
|
|
70
|
+
var lang = language === 'cn' ? 'en' : 'cn';
|
|
71
|
+
setLanguage(lang);
|
|
72
|
+
setLanguageStore(lang);
|
|
73
|
+
onChange && onChange(lang);
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
return React.createElement(Language, {
|
|
77
|
+
onClick: switchLanguage
|
|
78
|
+
}, React.createElement(Iconfont, {
|
|
79
|
+
type: "flag-".concat(language)
|
|
80
|
+
}), React.createElement("span", null, get(languagesMap[language], 'name')));
|
|
81
|
+
});
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import "antd/lib/row/style";
|
|
2
|
+
import _Row from "antd/lib/row";
|
|
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
|
+
|
|
12
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
13
|
+
|
|
14
|
+
function _templateObject() {
|
|
15
|
+
var data = _taggedTemplateLiteral(["\n margin-top: 20px;\n .user-info-body-theme-row{\n >div{\n width: 90px;\n height: 36px;\n line-height: 36px;\n font-family: PingFangSC-Regular;\n font-size: 12px;\n border-radius: 2px;\n text-align: center;\n cursor:pointer;\n position: relative;\n &.themeS3{\n background-image: linear-gradient(180deg, #213F83 0%, #0F75D6 100%);\n color: #FFFFFF;\n }\n &.themeS2{\n background: #17233D;\n color: #FFFFFF;\n }\n &.themeS1{\n background: #FFFFFF;\n box-shadow: 0px 0px 4px 0px rgba(0,0,0,0.1);\n color: #17233D;\n }\n .icon-checked-wrap{\n width: 14px;\n height: 14px;\n border-radius: 100%;\n background: #126BFB;\n position: absolute;\n top: -5px;\n right: -5px;\n &:after{\n content:'';\n width: 4px;\n height: 6px;\n border-color: #FFFFFF;\n border-width: 0 1px 1px 0;\n border-style: solid;\n transform: rotate(45deg);\n position: absolute;\n top: 3px;\n left: 5px;\n }\n }\n }\n }\n"]);
|
|
16
|
+
|
|
17
|
+
_templateObject = function _templateObject() {
|
|
18
|
+
return data;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
return data;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
25
|
+
|
|
26
|
+
import { useState } from 'react';
|
|
27
|
+
import styled from 'styled-components';
|
|
28
|
+
import Iconfont from '../Iconfont';
|
|
29
|
+
import { setThemeStore, getThemeStore } from '../storage';
|
|
30
|
+
var Theme = styled.li(_templateObject());
|
|
31
|
+
var themes = [{
|
|
32
|
+
value: 'themeS3',
|
|
33
|
+
label: '科技蓝'
|
|
34
|
+
}, {
|
|
35
|
+
value: 'themeS2',
|
|
36
|
+
label: '暗夜黑'
|
|
37
|
+
}, {
|
|
38
|
+
value: 'themeS1',
|
|
39
|
+
label: '极致白'
|
|
40
|
+
}];
|
|
41
|
+
export default (function (props) {
|
|
42
|
+
var onChange = props.onChange;
|
|
43
|
+
|
|
44
|
+
var getTheme = function getTheme() {
|
|
45
|
+
var theme = getThemeStore() || props.theme || 'themeS3';
|
|
46
|
+
return themes.some(function (_ref) {
|
|
47
|
+
var value = _ref.value;
|
|
48
|
+
return value === theme;
|
|
49
|
+
}) ? theme : 'themeS3';
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
var _useState = useState(getTheme()),
|
|
53
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
54
|
+
theme = _useState2[0],
|
|
55
|
+
setTheme = _useState2[1];
|
|
56
|
+
|
|
57
|
+
var changeTheme = function changeTheme(theme) {
|
|
58
|
+
setTheme(theme);
|
|
59
|
+
setThemeStore(theme);
|
|
60
|
+
onChange(theme);
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
return React.createElement(Theme, null, React.createElement(_Row, {
|
|
64
|
+
type: "flex",
|
|
65
|
+
justify: "space-between",
|
|
66
|
+
className: "user-info-body-theme-row"
|
|
67
|
+
}, themes.map(function (_ref2) {
|
|
68
|
+
var value = _ref2.value,
|
|
69
|
+
label = _ref2.label;
|
|
70
|
+
return React.createElement("div", {
|
|
71
|
+
className: value,
|
|
72
|
+
onClick: changeTheme.bind(_this, value)
|
|
73
|
+
}, label, theme === value && React.createElement("span", {
|
|
74
|
+
className: "icon-checked-wrap"
|
|
75
|
+
}));
|
|
76
|
+
})));
|
|
77
|
+
});
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
+
|
|
3
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
4
|
+
|
|
5
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
6
|
+
|
|
7
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
8
|
+
|
|
9
|
+
import { withTheme } from 'styled-components';
|
|
10
|
+
import Layout from '../Layout';
|
|
11
|
+
import Avatar from './Avatar';
|
|
12
|
+
import { getThemeStore } from '../storage';
|
|
13
|
+
export default withTheme(function (props) {
|
|
14
|
+
var _props$userInfo = props.userInfo,
|
|
15
|
+
userInfo = _props$userInfo === void 0 ? {} : _props$userInfo,
|
|
16
|
+
_props$extendMap = props.extendMap,
|
|
17
|
+
extendMap = _props$extendMap === void 0 ? {} : _props$extendMap; // 企业级的默认蓝色主题
|
|
18
|
+
|
|
19
|
+
var theme = getThemeStore() || (extendMap == null ? void 0 : extendMap.defaultTheme) || userInfo.theme || 'themeS3';
|
|
20
|
+
theme = theme === 'default' ? 'themeS3' : theme;
|
|
21
|
+
|
|
22
|
+
var newProps = _objectSpread({}, props, {
|
|
23
|
+
userInfo: _objectSpread({}, userInfo, {
|
|
24
|
+
theme: theme
|
|
25
|
+
})
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
return React.createElement(Layout, _extends({}, newProps, {
|
|
29
|
+
AvatarCustom: Avatar
|
|
30
|
+
}));
|
|
31
|
+
});
|