tntd 1.4.32 → 1.4.33-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/Ellipsis/index.js +47 -15
- package/components/QueryListScene/QueryForm.js +4 -4
- package/components/QueryListScene/createActions.js +4 -4
- package/dist/1.tntd.js +1 -1
- package/dist/stats.json +24089 -23289
- package/dist/tntd.css +1 -1
- package/dist/tntd.js +7 -10
- package/es/ArrayInput/icon.js +5 -5
- package/es/ArrayInput/index.js +79 -111
- package/es/AuthContext.js +1 -1
- package/es/Columns/index.js +33 -40
- package/es/DevelopmentLogin/LoginModal.js +33 -46
- package/es/DevelopmentLogin/index.js +14 -18
- package/es/Ellipsis/Svg/CopySVG.js +13 -13
- package/es/Ellipsis/Svg/TickSVG.js +8 -8
- package/es/Ellipsis/index.js +100 -79
- package/es/Handle/index.js +46 -64
- package/es/Icon/fonts/iconfont.js +7 -12
- package/es/Icon/index.js +12 -15
- package/es/Img/Contain.js +26 -31
- package/es/Img/Cover.js +43 -57
- package/es/Img/index.js +39 -48
- package/es/Layout/ActionsContext.js +3 -2
- package/es/Layout/AppList.js +39 -94
- package/es/Layout/Application.js +28 -74
- package/es/Layout/Avatar.js +30 -67
- package/es/Layout/CompatibleLanguage.js +41 -96
- package/es/Layout/EnterpriseLayout/Avatar.js +39 -77
- package/es/Layout/EnterpriseLayout/Language.js +16 -34
- package/es/Layout/EnterpriseLayout/Theme.js +18 -36
- package/es/Layout/EnterpriseLayout/index.js +14 -16
- package/es/Layout/GlobalNavigation/NavigationPopup.js +61 -172
- package/es/Layout/GlobalNavigation/index.js +22 -56
- package/es/Layout/Header.js +26 -47
- package/es/Layout/HeaderActions.js +45 -59
- package/es/Layout/HeaderNavs.js +24 -51
- package/es/Layout/HeaderTabs.js +53 -106
- package/es/Layout/Iconfont.js +1 -1
- package/es/Layout/Language.js +16 -34
- package/es/Layout/Layout.js +88 -110
- package/es/Layout/Logo.js +17 -33
- package/es/Layout/OrgAppList.js +64 -109
- package/es/Layout/SideMenu.js +67 -128
- package/es/Layout/Theme.js +25 -63
- package/es/Layout/index.js +28 -37
- package/es/Layout/paaslayout/CompactSideMenu.js +37 -76
- package/es/Layout/paaslayout/Header.js +23 -46
- package/es/Layout/paaslayout/Logo.js +4 -14
- package/es/Layout/paaslayout/SideMenu.js +41 -80
- package/es/Layout/paaslayout/index.js +77 -104
- package/es/Layout/storage.js +10 -9
- package/es/LoadingButton/index.js +18 -27
- package/es/Modal/index.js +42 -51
- package/es/Page/Box.js +36 -43
- package/es/Page/index.js +56 -71
- package/es/Page/utils.js +0 -5
- package/es/QueryForm/Field/Checkbox.js +7 -11
- package/es/QueryForm/Field/Select.js +34 -44
- package/es/QueryForm/Field/SelectInput.js +31 -46
- package/es/QueryForm/Field/fieldsMap.js +0 -1
- package/es/QueryForm/Field/index.js +46 -78
- package/es/QueryForm/createActions.js +6 -7
- package/es/QueryForm/index.js +79 -140
- package/es/QueryListScene/List.js +83 -139
- package/es/QueryListScene/QueryForm.js +54 -91
- package/es/QueryListScene/QueryListScene.js +29 -47
- package/es/QueryListScene/Title.js +3 -3
- package/es/QueryListScene/Toolbar.js +13 -14
- package/es/QueryListScene/createActions.js +4 -4
- package/es/Select/DropDownWrap.js +32 -55
- package/es/Select/index.js +140 -232
- package/es/Table/ResizableTable/index.js +29 -43
- package/es/Table/index.js +20 -19
- package/es/Title/index.js +23 -25
- package/es/locale.js +1 -5
- package/es/utils/checkAuth.js +6 -8
- package/es/utils/findMenuInfoByPath.js +0 -4
- package/es/utils/index.js +17 -27
- package/lib/ArrayInput/icon.js +7 -9
- package/lib/ArrayInput/index.js +82 -131
- package/lib/AuthContext.js +2 -6
- package/lib/Columns/index.js +36 -54
- package/lib/DevelopmentLogin/LoginModal.js +36 -63
- package/lib/DevelopmentLogin/index.js +21 -31
- package/lib/Ellipsis/Svg/CopySVG.js +15 -18
- package/lib/Ellipsis/Svg/TickSVG.js +10 -13
- package/lib/Ellipsis/index.js +105 -93
- package/lib/Handle/index.js +51 -87
- package/lib/Icon/fonts/iconfont.js +7 -12
- package/lib/Icon/iconList.js +1 -2
- package/lib/Icon/index.js +16 -26
- package/lib/Img/Contain.js +29 -40
- package/lib/Img/Cover.js +48 -72
- package/lib/Img/index.js +42 -58
- package/lib/Layout/ActionsContext.js +1 -5
- package/lib/Layout/AppList.js +45 -124
- package/lib/Layout/Application.js +31 -92
- package/lib/Layout/Avatar.js +36 -91
- package/lib/Layout/CompatibleLanguage.js +44 -116
- package/lib/Layout/EnterpriseLayout/Avatar.js +45 -105
- package/lib/Layout/EnterpriseLayout/Language.js +22 -54
- package/lib/Layout/EnterpriseLayout/Theme.js +21 -50
- package/lib/Layout/EnterpriseLayout/index.js +17 -27
- package/lib/Layout/GlobalNavigation/NavigationPopup.js +64 -192
- package/lib/Layout/GlobalNavigation/index.js +28 -80
- package/lib/Layout/Header.js +36 -68
- package/lib/Layout/HeaderActions.js +51 -81
- package/lib/Layout/HeaderNavs.js +30 -70
- package/lib/Layout/HeaderTabs.js +58 -127
- package/lib/Layout/Iconfont.js +4 -9
- package/lib/Layout/Language.js +22 -54
- package/lib/Layout/Layout.js +93 -134
- package/lib/Layout/Logo.js +26 -47
- package/lib/Layout/OrgAppList.js +69 -133
- package/lib/Layout/SideMenu.js +72 -151
- package/lib/Layout/Theme.js +28 -79
- package/lib/Layout/createActions.js +3 -9
- package/lib/Layout/images/index.js +5 -36
- package/lib/Layout/index.js +35 -63
- package/lib/Layout/paaslayout/CompactSideMenu.js +40 -90
- package/lib/Layout/paaslayout/Header.js +30 -60
- package/lib/Layout/paaslayout/Logo.js +11 -24
- package/lib/Layout/paaslayout/SideMenu.js +44 -93
- package/lib/Layout/paaslayout/index.js +82 -128
- package/lib/Layout/storage.js +26 -68
- package/lib/LoadingButton/index.js +21 -36
- package/lib/Modal/index.js +45 -62
- package/lib/Page/Box.js +38 -50
- package/lib/Page/index.js +58 -84
- package/lib/Page/utils.js +5 -16
- package/lib/QueryForm/Field/Checkbox.js +10 -19
- package/lib/QueryForm/Field/Select.js +39 -60
- package/lib/QueryForm/Field/SelectInput.js +36 -65
- package/lib/QueryForm/Field/fieldsMap.js +6 -23
- package/lib/QueryForm/Field/index.js +50 -91
- package/lib/QueryForm/createActions.js +9 -16
- package/lib/QueryForm/index.js +83 -165
- package/lib/QueryForm/useForm.js +1 -6
- package/lib/QueryListScene/List.js +89 -153
- package/lib/QueryListScene/QueryForm.js +58 -101
- package/lib/QueryListScene/QueryListScene.js +31 -56
- package/lib/QueryListScene/Title.js +6 -11
- package/lib/QueryListScene/Toolbar.js +16 -22
- package/lib/QueryListScene/createActions.js +7 -13
- package/lib/QueryListScene/index.js +5 -19
- package/lib/QueryListScene/useActions.js +1 -6
- package/lib/Select/DropDownWrap.js +35 -63
- package/lib/Select/index.js +142 -245
- package/lib/Table/ResizableTable/index.js +31 -54
- package/lib/Table/index.js +21 -34
- package/lib/Title/index.js +26 -34
- package/lib/index.js +36 -57
- package/lib/locale.js +9 -25
- package/lib/utils/checkAuth.js +9 -16
- package/lib/utils/findMenuInfoByPath.js +3 -12
- package/lib/utils/index.js +26 -60
- package/package.json +3 -2
|
@@ -1,58 +1,17 @@
|
|
|
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
|
|
13
|
-
|
|
14
|
-
function
|
|
15
|
-
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"]);
|
|
16
|
-
|
|
17
|
-
_templateObject4 = function _templateObject4() {
|
|
18
|
-
return data;
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
return data;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
function _templateObject3() {
|
|
25
|
-
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"]);
|
|
26
|
-
|
|
27
|
-
_templateObject3 = function _templateObject3() {
|
|
28
|
-
return data;
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
return data;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
function _templateObject2() {
|
|
35
|
-
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"]);
|
|
36
|
-
|
|
37
|
-
_templateObject2 = function _templateObject2() {
|
|
38
|
-
return data;
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
return data;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
function _templateObject() {
|
|
45
|
-
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"]);
|
|
46
|
-
|
|
47
|
-
_templateObject = function _templateObject() {
|
|
48
|
-
return data;
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
return data;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
55
|
-
|
|
3
|
+
var _templateObject,
|
|
4
|
+
_templateObject2,
|
|
5
|
+
_templateObject3,
|
|
6
|
+
_templateObject4,
|
|
7
|
+
_this = this;
|
|
8
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
9
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
10
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
11
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
12
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
13
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
14
|
+
function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
|
|
56
15
|
import { useState } from 'react';
|
|
57
16
|
import styled from 'styled-components';
|
|
58
17
|
import cn from 'classnames';
|
|
@@ -71,10 +30,10 @@ var languagesMap = languages.reduce(function (acc, cur) {
|
|
|
71
30
|
acc[cur.value] = cur;
|
|
72
31
|
return acc;
|
|
73
32
|
}, {});
|
|
74
|
-
var LanguageSwitch = styled.div(_templateObject());
|
|
75
|
-
var Theme = styled.li(_templateObject2());
|
|
76
|
-
var ThemeSwitch = styled.div(_templateObject3());
|
|
77
|
-
var ThemeContentWrapper = styled.div(_templateObject4());
|
|
33
|
+
var LanguageSwitch = styled.div(_templateObject || (_templateObject = _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"])));
|
|
34
|
+
var Theme = styled.li(_templateObject2 || (_templateObject2 = _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"])));
|
|
35
|
+
var ThemeSwitch = styled.div(_templateObject3 || (_templateObject3 = _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"])));
|
|
36
|
+
var ThemeContentWrapper = styled.div(_templateObject4 || (_templateObject4 = _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"])));
|
|
78
37
|
var themes = [{
|
|
79
38
|
value: 'themeS1',
|
|
80
39
|
img: images.themeSymbol1
|
|
@@ -82,18 +41,15 @@ var themes = [{
|
|
|
82
41
|
value: 'themeS2',
|
|
83
42
|
img: images.themeSymbol2
|
|
84
43
|
}];
|
|
85
|
-
|
|
86
44
|
var ThemeContent = function ThemeContent(props) {
|
|
87
45
|
var config = props.config,
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
46
|
+
onLanguageChange = props.onLanguageChange,
|
|
47
|
+
onThemeChange = props.onThemeChange;
|
|
91
48
|
var _ref = config || {},
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
49
|
+
_ref$language = _ref.language,
|
|
50
|
+
languageVisible = _ref$language === void 0 ? true : _ref$language,
|
|
51
|
+
_ref$theme = _ref.theme,
|
|
52
|
+
themeVisible = _ref$theme === void 0 ? true : _ref$theme;
|
|
97
53
|
var getTheme = function getTheme() {
|
|
98
54
|
var theme = getThemeStore() || props.theme || 'themeS2';
|
|
99
55
|
return themes.some(function (_ref2) {
|
|
@@ -101,57 +57,49 @@ var ThemeContent = function ThemeContent(props) {
|
|
|
101
57
|
return value === theme;
|
|
102
58
|
}) ? theme : 'themeS2';
|
|
103
59
|
};
|
|
104
|
-
|
|
105
60
|
var _useState = useState(getTheme()),
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
61
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
62
|
+
theme = _useState2[0],
|
|
63
|
+
setTheme = _useState2[1];
|
|
110
64
|
var changeTheme = function changeTheme(theme) {
|
|
111
65
|
setTheme(theme);
|
|
112
66
|
setThemeStore(theme);
|
|
113
67
|
onThemeChange(theme);
|
|
114
68
|
};
|
|
115
|
-
|
|
116
69
|
var getLanguage = function getLanguage() {
|
|
117
70
|
var lang = getLanguageStore() || props.language;
|
|
118
|
-
|
|
119
71
|
if (!languagesMap[lang]) {
|
|
120
72
|
lang = get(languages, '0.value');
|
|
121
73
|
}
|
|
122
|
-
|
|
123
74
|
return lang;
|
|
124
75
|
};
|
|
125
|
-
|
|
126
76
|
var _useState3 = useState(getLanguage()),
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
77
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
78
|
+
_useState4$ = _useState4[0],
|
|
79
|
+
language = _useState4$ === void 0 ? 'cn' : _useState4$,
|
|
80
|
+
setLanguage = _useState4[1];
|
|
132
81
|
var changeLanguage = function changeLanguage(language) {
|
|
133
82
|
setLanguage(language);
|
|
134
83
|
setLanguageStore(language);
|
|
135
84
|
onLanguageChange(language);
|
|
136
85
|
};
|
|
137
|
-
|
|
138
|
-
return React.createElement(ThemeContentWrapper, null, themeVisible && React.createElement(ThemeSwitch, null, themes.map(function (_ref3) {
|
|
86
|
+
return /*#__PURE__*/React.createElement(ThemeContentWrapper, null, themeVisible && /*#__PURE__*/React.createElement(ThemeSwitch, null, themes.map(function (_ref3) {
|
|
139
87
|
var value = _ref3.value,
|
|
140
|
-
|
|
141
|
-
return React.createElement("div", {
|
|
88
|
+
img = _ref3.img;
|
|
89
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
142
90
|
key: value,
|
|
143
91
|
onClick: changeTheme.bind(_this, value)
|
|
144
|
-
}, React.createElement("img", {
|
|
92
|
+
}, /*#__PURE__*/React.createElement("img", {
|
|
145
93
|
src: img
|
|
146
|
-
}), theme === value && React.createElement(Icon, {
|
|
94
|
+
}), theme === value && /*#__PURE__*/React.createElement(Icon, {
|
|
147
95
|
type: "check1"
|
|
148
96
|
}));
|
|
149
|
-
})), themeVisible && languageVisible && React.createElement("div", {
|
|
97
|
+
})), themeVisible && languageVisible && /*#__PURE__*/React.createElement("div", {
|
|
150
98
|
className: "line"
|
|
151
|
-
}), languageVisible && React.createElement(LanguageSwitch, null, languages.map(function (_ref4) {
|
|
99
|
+
}), languageVisible && /*#__PURE__*/React.createElement(LanguageSwitch, null, languages.map(function (_ref4) {
|
|
152
100
|
var value = _ref4.value,
|
|
153
|
-
|
|
154
|
-
return React.createElement("div", {
|
|
101
|
+
name = _ref4.name;
|
|
102
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
155
103
|
className: cn({
|
|
156
104
|
active: value === language
|
|
157
105
|
}),
|
|
@@ -160,20 +108,17 @@ var ThemeContent = function ThemeContent(props) {
|
|
|
160
108
|
}, name);
|
|
161
109
|
})));
|
|
162
110
|
};
|
|
163
|
-
|
|
164
111
|
export default (function (props) {
|
|
165
112
|
var config = props.config;
|
|
166
|
-
|
|
167
113
|
if ((config == null ? void 0 : config.language) === false && (config == null ? void 0 : config.theme) === false) {
|
|
168
114
|
return null;
|
|
169
115
|
}
|
|
170
|
-
|
|
171
|
-
return React.createElement(Theme, null, React.createElement(_Popover, {
|
|
116
|
+
return /*#__PURE__*/React.createElement(Theme, null, /*#__PURE__*/React.createElement(_Popover, {
|
|
172
117
|
placement: "bottomRight",
|
|
173
118
|
title: null,
|
|
174
|
-
content: React.createElement(ThemeContent, props),
|
|
119
|
+
content: /*#__PURE__*/React.createElement(ThemeContent, props),
|
|
175
120
|
trigger: "click"
|
|
176
|
-
}, React.createElement(Icon, {
|
|
121
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
177
122
|
type: "daxiaoxie"
|
|
178
123
|
})));
|
|
179
124
|
});
|
|
@@ -4,39 +4,8 @@ import "antd/lib/row/style";
|
|
|
4
4
|
import _Row from "antd/lib/row";
|
|
5
5
|
import "antd/lib/divider/style";
|
|
6
6
|
import _Divider from "antd/lib/divider";
|
|
7
|
-
|
|
8
|
-
function
|
|
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
|
-
|
|
7
|
+
var _templateObject, _templateObject2, _templateObject3;
|
|
8
|
+
function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
|
|
40
9
|
import { useContext } from 'react';
|
|
41
10
|
import styled, { createGlobalStyle } from 'styled-components';
|
|
42
11
|
import { get } from 'lodash';
|
|
@@ -45,9 +14,9 @@ import ActionsContext from '../ActionsContext';
|
|
|
45
14
|
import Language from './Language';
|
|
46
15
|
import Theme from './Theme';
|
|
47
16
|
import { getLanguageStore, clearLoginCookie } from '../storage';
|
|
48
|
-
var Avatar = styled.li(_templateObject());
|
|
49
|
-
var GlobalStyle = createGlobalStyle(_templateObject2());
|
|
50
|
-
var UserInfoWrapper = styled.div(_templateObject3(), function (props) {
|
|
17
|
+
var Avatar = styled.li(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n margin-right: 0;\n font-size: 0;\n img {\n width: 26px;\n height: 26px;\n border-radius: 50%;\n cursor: pointer;\n .large-size & {\n width: 32px;\n height: 32px;\n }\n }\n"])));
|
|
18
|
+
var GlobalStyle = createGlobalStyle(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n .tnt-layout-personal-popover {\n .ant-popover-inner-content {\n padding: 0;\n }\n }\n"])));
|
|
19
|
+
var UserInfoWrapper = styled.div(_templateObject3 || (_templateObject3 = _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"])), function (props) {
|
|
51
20
|
return "".concat(props.theme.primaryTextColor);
|
|
52
21
|
}, function (props) {
|
|
53
22
|
return "1px solid ".concat(props.theme.dividerColor);
|
|
@@ -56,63 +25,59 @@ var UserInfoWrapper = styled.div(_templateObject3(), function (props) {
|
|
|
56
25
|
}, function (props) {
|
|
57
26
|
return "".concat(props.theme.primaryColor);
|
|
58
27
|
});
|
|
59
|
-
|
|
60
28
|
var UserInfoContent = function UserInfoContent(props) {
|
|
61
29
|
var userInfo = props.userInfo,
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
30
|
+
_props$config = props.config,
|
|
31
|
+
config = _props$config === void 0 ? {} : _props$config,
|
|
32
|
+
onLogout = props.onLogout,
|
|
33
|
+
_props$onChangePasswo = props.onChangePassword,
|
|
34
|
+
onChangePassword = _props$onChangePasswo === void 0 ? function () {
|
|
35
|
+
return true;
|
|
36
|
+
} : _props$onChangePasswo,
|
|
37
|
+
_props$onPersonalSett = props.onPersonalSetting,
|
|
38
|
+
onPersonalSetting = _props$onPersonalSett === void 0 ? function () {
|
|
39
|
+
return true;
|
|
40
|
+
} : _props$onPersonalSett,
|
|
41
|
+
onLanguageChange = props.onLanguageChange,
|
|
42
|
+
onThemeChange = props.onThemeChange;
|
|
76
43
|
var _useContext = useContext(ActionsContext),
|
|
77
|
-
|
|
78
|
-
|
|
44
|
+
getText = _useContext.getText;
|
|
79
45
|
var _ref = config || {},
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
return React.createElement(UserInfoWrapper, {
|
|
46
|
+
_ref$language = _ref.language,
|
|
47
|
+
language = _ref$language === void 0 ? true : _ref$language;
|
|
48
|
+
return /*#__PURE__*/React.createElement(UserInfoWrapper, {
|
|
84
49
|
className: "user-info-setting-wrap"
|
|
85
|
-
}, React.createElement("ul", {
|
|
50
|
+
}, /*#__PURE__*/React.createElement("ul", {
|
|
86
51
|
className: "user-info-body"
|
|
87
|
-
}, React.createElement("li", {
|
|
52
|
+
}, /*#__PURE__*/React.createElement("li", {
|
|
88
53
|
className: "user-info-body-username"
|
|
89
|
-
}, userInfo.userName || getText('nameNull'), React.createElement("span", {
|
|
54
|
+
}, userInfo.userName || getText('nameNull'), /*#__PURE__*/React.createElement("span", {
|
|
90
55
|
className: "user-info-body-account"
|
|
91
|
-
}, userInfo.account)), language && React.createElement(Language, {
|
|
56
|
+
}, userInfo.account)), language && /*#__PURE__*/React.createElement(Language, {
|
|
92
57
|
language: userInfo.lang,
|
|
93
58
|
onChange: onLanguageChange
|
|
94
|
-
}), React.createElement(Theme, {
|
|
59
|
+
}), /*#__PURE__*/React.createElement(Theme, {
|
|
95
60
|
theme: userInfo.theme,
|
|
96
61
|
onChange: onThemeChange
|
|
97
|
-
})), React.createElement(_Row, {
|
|
62
|
+
})), /*#__PURE__*/React.createElement(_Row, {
|
|
98
63
|
className: "user-info-footer",
|
|
99
64
|
type: "flex",
|
|
100
65
|
justify: "space-between",
|
|
101
66
|
align: "middle"
|
|
102
|
-
}, React.createElement("a", {
|
|
67
|
+
}, /*#__PURE__*/React.createElement("a", {
|
|
103
68
|
onClick: onPersonalSetting,
|
|
104
69
|
href: "/bridge/userCenter?currentTab=1"
|
|
105
|
-
}, getText('personalSettings')), React.createElement(_Divider, {
|
|
70
|
+
}, getText('personalSettings')), /*#__PURE__*/React.createElement(_Divider, {
|
|
106
71
|
type: "vertical"
|
|
107
|
-
}), React.createElement("a", {
|
|
72
|
+
}), /*#__PURE__*/React.createElement("a", {
|
|
108
73
|
onClick: onChangePassword,
|
|
109
74
|
href: "/bridge/userCenter?currentTab=2",
|
|
110
75
|
style: getLanguageStore() === 'en' ? {
|
|
111
76
|
flex: 2
|
|
112
77
|
} : {}
|
|
113
|
-
}, getText('changePwd')), React.createElement(_Divider, {
|
|
78
|
+
}, getText('changePwd')), /*#__PURE__*/React.createElement(_Divider, {
|
|
114
79
|
type: "vertical"
|
|
115
|
-
}), React.createElement("a", {
|
|
80
|
+
}), /*#__PURE__*/React.createElement("a", {
|
|
116
81
|
className: "user-info-footer-signout",
|
|
117
82
|
onClick: function onClick() {
|
|
118
83
|
if (onLogout) {
|
|
@@ -125,28 +90,25 @@ var UserInfoContent = function UserInfoContent(props) {
|
|
|
125
90
|
}
|
|
126
91
|
}, getText('signOut'))));
|
|
127
92
|
};
|
|
128
|
-
|
|
129
93
|
export default (function (props) {
|
|
130
94
|
var _images$empty2;
|
|
131
|
-
|
|
132
95
|
var _props$userInfo = props.userInfo,
|
|
133
|
-
|
|
96
|
+
userInfo = _props$userInfo === void 0 ? {} : _props$userInfo;
|
|
134
97
|
var avatar = userInfo.avatar;
|
|
135
|
-
return React.createElement(Avatar, null, React.createElement(_Popover, {
|
|
98
|
+
return /*#__PURE__*/React.createElement(Avatar, null, /*#__PURE__*/React.createElement(_Popover, {
|
|
136
99
|
popupClassName: "tnt-layout-personal-popover",
|
|
137
100
|
placement: "bottomRight",
|
|
138
101
|
title: null,
|
|
139
|
-
content: React.createElement(UserInfoContent, props),
|
|
102
|
+
content: /*#__PURE__*/React.createElement(UserInfoContent, props),
|
|
140
103
|
trigger: "click"
|
|
141
|
-
}, avatar ? React.createElement("img", {
|
|
104
|
+
}, avatar ? /*#__PURE__*/React.createElement("img", {
|
|
142
105
|
src: avatar.indexOf('base64') > 0 ? avatar : get(images[avatar], 'default', images[avatar]),
|
|
143
106
|
onError: function onError(e) {
|
|
144
107
|
var _images$empty;
|
|
145
|
-
|
|
146
108
|
e.target.onerror = null;
|
|
147
109
|
e.target.src = ((_images$empty = images.empty) == null ? void 0 : _images$empty["default"]) || images.empty;
|
|
148
110
|
}
|
|
149
|
-
}) : React.createElement("img", {
|
|
111
|
+
}) : /*#__PURE__*/React.createElement("img", {
|
|
150
112
|
src: ((_images$empty2 = images.empty) == null ? void 0 : _images$empty2["default"]) || images.empty
|
|
151
|
-
})), React.createElement(GlobalStyle, null));
|
|
113
|
+
})), /*#__PURE__*/React.createElement(GlobalStyle, null));
|
|
152
114
|
});
|
|
@@ -1,23 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); }
|
|
4
|
-
|
|
5
|
-
function
|
|
6
|
-
|
|
7
|
-
function _arrayWithHoles(
|
|
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
|
-
|
|
1
|
+
var _templateObject;
|
|
2
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
3
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
4
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
5
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
6
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
7
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
8
|
+
function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
|
|
21
9
|
import { useState, useMemo } from 'react';
|
|
22
10
|
import styled, { withTheme } from 'styled-components';
|
|
23
11
|
import { get } from 'lodash';
|
|
@@ -34,7 +22,7 @@ var languagesMap = languages.reduce(function (acc, cur) {
|
|
|
34
22
|
acc[cur.value] = cur;
|
|
35
23
|
return acc;
|
|
36
24
|
}, {});
|
|
37
|
-
var Language = styled.li(_templateObject(), function (_ref) {
|
|
25
|
+
var Language = styled.li(_templateObject || (_templateObject = _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"])), function (_ref) {
|
|
38
26
|
var size = _ref.theme.size;
|
|
39
27
|
return size === 'large' ? '14px' : '12px';
|
|
40
28
|
}, function (_ref2) {
|
|
@@ -49,36 +37,30 @@ var Language = styled.li(_templateObject(), function (_ref) {
|
|
|
49
37
|
});
|
|
50
38
|
export default withTheme(function (props) {
|
|
51
39
|
var onChange = props.onChange;
|
|
52
|
-
|
|
53
40
|
var getLanguage = function getLanguage() {
|
|
54
41
|
var lang = getLanguageStore() || props.language;
|
|
55
|
-
|
|
56
42
|
if (!languagesMap[lang]) {
|
|
57
43
|
lang = get(languages, '0.value');
|
|
58
44
|
}
|
|
59
|
-
|
|
60
45
|
return lang;
|
|
61
46
|
};
|
|
62
|
-
|
|
63
47
|
var _useState = useState(getLanguage()),
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
48
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
49
|
+
_useState2$ = _useState2[0],
|
|
50
|
+
language = _useState2$ === void 0 ? 'cn' : _useState2$,
|
|
51
|
+
setLanguage = _useState2[1];
|
|
69
52
|
var switchLanguage = function switchLanguage() {
|
|
70
53
|
var lang = language === 'cn' ? 'en' : 'cn';
|
|
71
54
|
setLanguage(lang);
|
|
72
55
|
setLanguageStore(lang);
|
|
73
56
|
onChange && onChange(lang);
|
|
74
57
|
};
|
|
75
|
-
|
|
76
58
|
var otherLanguage = useMemo(function () {
|
|
77
59
|
return language === 'cn' ? 'en' : 'cn';
|
|
78
60
|
}, [language]);
|
|
79
|
-
return React.createElement(Language, {
|
|
61
|
+
return /*#__PURE__*/React.createElement(Language, {
|
|
80
62
|
onClick: switchLanguage
|
|
81
|
-
}, React.createElement(Iconfont, {
|
|
63
|
+
}, /*#__PURE__*/React.createElement(Iconfont, {
|
|
82
64
|
type: "flag-".concat(otherLanguage)
|
|
83
|
-
}), React.createElement("span", null, get(languagesMap[otherLanguage], 'name')));
|
|
65
|
+
}), /*#__PURE__*/React.createElement("span", null, get(languagesMap[otherLanguage], 'name')));
|
|
84
66
|
});
|
|
@@ -1,33 +1,19 @@
|
|
|
1
1
|
import "antd/lib/row/style";
|
|
2
2
|
import _Row from "antd/lib/row";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
function
|
|
7
|
-
|
|
8
|
-
function
|
|
9
|
-
|
|
10
|
-
function
|
|
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
|
-
|
|
3
|
+
var _templateObject,
|
|
4
|
+
_this = this;
|
|
5
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
6
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
7
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
8
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
9
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
10
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
11
|
+
function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
|
|
26
12
|
import { useState } from 'react';
|
|
27
13
|
import styled from 'styled-components';
|
|
28
14
|
import Iconfont from '../Iconfont';
|
|
29
15
|
import { setThemeStore, getThemeStore, getLanguageStore } from '../storage';
|
|
30
|
-
var Theme = styled.li(_templateObject());
|
|
16
|
+
var Theme = styled.li(_templateObject || (_templateObject = _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"])));
|
|
31
17
|
var themes = [{
|
|
32
18
|
value: 'themeS3',
|
|
33
19
|
label: '科技蓝',
|
|
@@ -43,7 +29,6 @@ var themes = [{
|
|
|
43
29
|
}];
|
|
44
30
|
export default (function (props) {
|
|
45
31
|
var onChange = props.onChange;
|
|
46
|
-
|
|
47
32
|
var getTheme = function getTheme() {
|
|
48
33
|
var theme = getThemeStore() || props.theme || 'themeS3';
|
|
49
34
|
return themes.some(function (_ref) {
|
|
@@ -51,30 +36,27 @@ export default (function (props) {
|
|
|
51
36
|
return value === theme;
|
|
52
37
|
}) ? theme : 'themeS3';
|
|
53
38
|
};
|
|
54
|
-
|
|
55
39
|
var _useState = useState(getTheme()),
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
40
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
41
|
+
theme = _useState2[0],
|
|
42
|
+
setTheme = _useState2[1];
|
|
60
43
|
var changeTheme = function changeTheme(theme) {
|
|
61
44
|
setTheme(theme);
|
|
62
45
|
setThemeStore(theme);
|
|
63
46
|
onChange(theme);
|
|
64
47
|
};
|
|
65
|
-
|
|
66
|
-
return React.createElement(Theme, null, React.createElement(_Row, {
|
|
48
|
+
return /*#__PURE__*/React.createElement(Theme, null, /*#__PURE__*/React.createElement(_Row, {
|
|
67
49
|
type: "flex",
|
|
68
50
|
justify: "space-between",
|
|
69
51
|
className: "user-info-body-theme-row"
|
|
70
52
|
}, themes.map(function (_ref2) {
|
|
71
53
|
var value = _ref2.value,
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
return React.createElement("div", {
|
|
54
|
+
label = _ref2.label,
|
|
55
|
+
enLabel = _ref2.enLabel;
|
|
56
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
75
57
|
className: value,
|
|
76
58
|
onClick: changeTheme.bind(_this, value)
|
|
77
|
-
}, getLanguageStore() === 'en' ? enLabel : label, theme === value && React.createElement("span", {
|
|
59
|
+
}, getLanguageStore() === 'en' ? enLabel : label, theme === value && /*#__PURE__*/React.createElement("span", {
|
|
78
60
|
className: "icon-checked-wrap"
|
|
79
61
|
}));
|
|
80
62
|
})));
|