tntd 1.4.20 → 1.4.21

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.
Files changed (163) hide show
  1. package/components/Handle/README.md +0 -20
  2. package/components/Handle/index.js +27 -6
  3. package/components/locale.js +8 -2
  4. package/dist/1.tntd.js +1 -1
  5. package/dist/stats.json +23819 -24067
  6. package/dist/tntd.css +1 -1
  7. package/dist/tntd.js +13 -8
  8. package/es/ArrayInput/icon.js +5 -5
  9. package/es/ArrayInput/index.js +108 -76
  10. package/es/AuthContext.js +1 -1
  11. package/es/Columns/index.js +38 -31
  12. package/es/DevelopmentLogin/LoginModal.js +45 -32
  13. package/es/DevelopmentLogin/index.js +17 -13
  14. package/es/Ellipsis/Svg/CopySVG.js +13 -13
  15. package/es/Ellipsis/Svg/TickSVG.js +8 -8
  16. package/es/Ellipsis/index.js +69 -58
  17. package/es/Handle/README.md +0 -20
  18. package/es/Handle/index.js +67 -32
  19. package/es/Icon/fonts/iconfont.js +12 -7
  20. package/es/Icon/index.js +13 -10
  21. package/es/Img/Contain.js +29 -24
  22. package/es/Img/Cover.js +54 -40
  23. package/es/Img/index.js +45 -36
  24. package/es/Layout/ActionsContext.js +2 -3
  25. package/es/Layout/AppList.js +92 -37
  26. package/es/Layout/Application.js +72 -26
  27. package/es/Layout/Avatar.js +66 -29
  28. package/es/Layout/CompatibleLanguage.js +94 -39
  29. package/es/Layout/EnterpriseLayout/Avatar.js +76 -38
  30. package/es/Layout/EnterpriseLayout/Language.js +32 -14
  31. package/es/Layout/EnterpriseLayout/Theme.js +34 -16
  32. package/es/Layout/EnterpriseLayout/index.js +16 -14
  33. package/es/Layout/GlobalNavigation/NavigationPopup.js +170 -59
  34. package/es/Layout/GlobalNavigation/index.js +54 -20
  35. package/es/Layout/Header.js +46 -25
  36. package/es/Layout/HeaderActions.js +56 -42
  37. package/es/Layout/HeaderNavs.js +47 -20
  38. package/es/Layout/HeaderTabs.js +102 -49
  39. package/es/Layout/Iconfont.js +1 -1
  40. package/es/Layout/Language.js +32 -14
  41. package/es/Layout/Layout.js +108 -86
  42. package/es/Layout/Logo.js +32 -16
  43. package/es/Layout/OrgAppList.js +107 -62
  44. package/es/Layout/SideMenu.js +124 -63
  45. package/es/Layout/Theme.js +61 -23
  46. package/es/Layout/checkAuth.js +29 -0
  47. package/es/Layout/index.js +34 -26
  48. package/es/Layout/paaslayout/CompactSideMenu.js +74 -35
  49. package/es/Layout/paaslayout/Header.js +45 -22
  50. package/es/Layout/paaslayout/Logo.js +13 -3
  51. package/es/Layout/paaslayout/SideMenu.js +78 -39
  52. package/es/Layout/paaslayout/index.js +102 -75
  53. package/es/Layout/storage.js +9 -10
  54. package/es/Layout/utils.js +136 -0
  55. package/es/LoadingButton/index.js +24 -15
  56. package/es/Modal/index.js +46 -38
  57. package/es/Page/Box.js +41 -34
  58. package/es/Page/index.js +67 -52
  59. package/es/Page/utils.js +5 -0
  60. package/es/QueryForm/Field/Checkbox.js +9 -5
  61. package/es/QueryForm/Field/Select.js +41 -31
  62. package/es/QueryForm/Field/SelectInput.js +41 -26
  63. package/es/QueryForm/Field/fieldsMap.js +1 -0
  64. package/es/QueryForm/Field/index.js +71 -41
  65. package/es/QueryForm/createActions.js +7 -6
  66. package/es/QueryForm/index.js +135 -76
  67. package/es/QueryListScene/List.js +128 -74
  68. package/es/QueryListScene/QueryForm.js +81 -46
  69. package/es/QueryListScene/QueryListScene.js +40 -25
  70. package/es/QueryListScene/Title.js +3 -3
  71. package/es/QueryListScene/Toolbar.js +12 -11
  72. package/es/Select/DropDownWrap.js +50 -29
  73. package/es/Select/index.js +231 -135
  74. package/es/Table/ResizableTable/index.js +40 -26
  75. package/es/Table/index.js +16 -18
  76. package/es/Title/index.js +23 -21
  77. package/es/locale.js +11 -3
  78. package/es/utils/checkAuth.js +5 -3
  79. package/es/utils/findMenuInfoByPath.js +4 -0
  80. package/es/utils/index.js +23 -12
  81. package/lib/ArrayInput/icon.js +6 -6
  82. package/lib/ArrayInput/index.js +127 -78
  83. package/lib/AuthContext.js +4 -1
  84. package/lib/Columns/index.js +47 -31
  85. package/lib/DevelopmentLogin/LoginModal.js +58 -32
  86. package/lib/DevelopmentLogin/index.js +27 -16
  87. package/lib/Ellipsis/Svg/CopySVG.js +15 -13
  88. package/lib/Ellipsis/Svg/TickSVG.js +10 -8
  89. package/lib/Ellipsis/index.js +80 -57
  90. package/lib/Handle/README.md +0 -20
  91. package/lib/Handle/index.js +80 -32
  92. package/lib/Icon/fonts/iconfont.js +12 -7
  93. package/lib/Icon/index.js +20 -11
  94. package/lib/Img/Contain.js +34 -24
  95. package/lib/Img/Cover.js +65 -42
  96. package/lib/Img/index.js +51 -36
  97. package/lib/Layout/ActionsContext.js +4 -1
  98. package/lib/Layout/AppList.js +118 -40
  99. package/lib/Layout/Application.js +86 -26
  100. package/lib/Layout/Avatar.js +86 -32
  101. package/lib/Layout/CompatibleLanguage.js +110 -39
  102. package/lib/Layout/EnterpriseLayout/Avatar.js +100 -41
  103. package/lib/Layout/EnterpriseLayout/Header.js +113 -0
  104. package/lib/Layout/EnterpriseLayout/HeaderActions.js +104 -0
  105. package/lib/Layout/EnterpriseLayout/Language.js +48 -17
  106. package/lib/Layout/EnterpriseLayout/Theme.js +44 -16
  107. package/lib/Layout/EnterpriseLayout/index.js +23 -14
  108. package/lib/Layout/GlobalNavigation/NavigationPopup.js +186 -59
  109. package/lib/Layout/GlobalNavigation/index.js +74 -23
  110. package/lib/Layout/Header.js +63 -28
  111. package/lib/Layout/HeaderActions.js +74 -45
  112. package/lib/Layout/HeaderNavs.js +61 -23
  113. package/lib/Layout/HeaderTabs.js +118 -51
  114. package/lib/Layout/Iconfont.js +5 -1
  115. package/lib/Layout/Language.js +48 -17
  116. package/lib/Layout/Layout.js +128 -88
  117. package/lib/Layout/Logo.js +43 -19
  118. package/lib/Layout/OrgAppList.js +127 -64
  119. package/lib/Layout/SideMenu.js +143 -65
  120. package/lib/Layout/Theme.js +73 -23
  121. package/lib/Layout/checkAuth.js +39 -0
  122. package/lib/Layout/createActions.js +5 -0
  123. package/lib/Layout/images/index.js +28 -0
  124. package/lib/Layout/index.js +55 -30
  125. package/lib/Layout/paaslayout/CompactSideMenu.js +84 -35
  126. package/lib/Layout/paaslayout/Header.js +55 -22
  127. package/lib/Layout/paaslayout/Logo.js +19 -3
  128. package/lib/Layout/paaslayout/SideMenu.js +87 -39
  129. package/lib/Layout/paaslayout/index.js +122 -77
  130. package/lib/Layout/storage.js +40 -11
  131. package/lib/Layout/utils.js +166 -0
  132. package/lib/LoadingButton/index.js +29 -15
  133. package/lib/Modal/index.js +53 -38
  134. package/lib/Page/Box.js +45 -34
  135. package/lib/Page/index.js +77 -52
  136. package/lib/Page/utils.js +9 -1
  137. package/lib/QueryForm/Field/Checkbox.js +13 -5
  138. package/lib/QueryForm/Field/Select.js +53 -33
  139. package/lib/QueryForm/Field/SelectInput.js +56 -28
  140. package/lib/QueryForm/Field/fieldsMap.js +15 -1
  141. package/lib/QueryForm/Field/index.js +81 -43
  142. package/lib/QueryForm/createActions.js +12 -6
  143. package/lib/QueryForm/index.js +157 -78
  144. package/lib/QueryForm/useForm.js +5 -0
  145. package/lib/QueryListScene/List.js +140 -76
  146. package/lib/QueryListScene/QueryForm.js +86 -46
  147. package/lib/QueryListScene/QueryListScene.js +46 -25
  148. package/lib/QueryListScene/Title.js +7 -3
  149. package/lib/QueryListScene/Toolbar.js +16 -11
  150. package/lib/QueryListScene/createActions.js +5 -0
  151. package/lib/QueryListScene/index.js +10 -0
  152. package/lib/QueryListScene/useActions.js +5 -0
  153. package/lib/Select/DropDownWrap.js +56 -31
  154. package/lib/Select/index.js +241 -135
  155. package/lib/Table/ResizableTable/index.js +48 -26
  156. package/lib/Table/index.js +28 -17
  157. package/lib/Title/index.js +28 -21
  158. package/lib/index.js +56 -35
  159. package/lib/locale.js +19 -4
  160. package/lib/utils/checkAuth.js +9 -4
  161. package/lib/utils/findMenuInfoByPath.js +8 -1
  162. package/lib/utils/index.js +42 -15
  163. package/package.json +2 -2
@@ -1,17 +1,58 @@
1
1
  import "antd/lib/popover/style";
2
2
  import _Popover from "antd/lib/popover";
3
- var _templateObject,
4
- _templateObject2,
5
- _templateObject3,
6
- _templateObject4,
7
- _this = this;
8
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _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(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
11
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
12
- function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
3
+
4
+ var _this = this;
5
+
6
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }
7
+
8
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); }
9
+
10
+ function _iterableToArrayLimit(arr, i) { if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) { return; } var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
11
+
13
12
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
13
+
14
+ function _templateObject4() {
15
+ var data = _taggedTemplateLiteral(["\n 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
+
14
54
  function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
55
+
15
56
  import { useState } from 'react';
16
57
  import styled from 'styled-components';
17
58
  import cn from 'classnames';
@@ -30,10 +71,10 @@ var languagesMap = languages.reduce(function (acc, cur) {
30
71
  acc[cur.value] = cur;
31
72
  return acc;
32
73
  }, {});
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"])));
74
+ var LanguageSwitch = styled.div(_templateObject());
75
+ var Theme = styled.li(_templateObject2());
76
+ var ThemeSwitch = styled.div(_templateObject3());
77
+ var ThemeContentWrapper = styled.div(_templateObject4());
37
78
  var themes = [{
38
79
  value: 'themeS1',
39
80
  img: images.themeSymbol1
@@ -41,15 +82,18 @@ var themes = [{
41
82
  value: 'themeS2',
42
83
  img: images.themeSymbol2
43
84
  }];
85
+
44
86
  var ThemeContent = function ThemeContent(props) {
45
87
  var config = props.config,
46
- onLanguageChange = props.onLanguageChange,
47
- onThemeChange = props.onThemeChange;
88
+ onLanguageChange = props.onLanguageChange,
89
+ onThemeChange = props.onThemeChange;
90
+
48
91
  var _ref = config || {},
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;
92
+ _ref$language = _ref.language,
93
+ languageVisible = _ref$language === void 0 ? true : _ref$language,
94
+ _ref$theme = _ref.theme,
95
+ themeVisible = _ref$theme === void 0 ? true : _ref$theme;
96
+
53
97
  var getTheme = function getTheme() {
54
98
  var theme = getThemeStore() || props.theme || 'themeS2';
55
99
  return themes.some(function (_ref2) {
@@ -57,49 +101,57 @@ var ThemeContent = function ThemeContent(props) {
57
101
  return value === theme;
58
102
  }) ? theme : 'themeS2';
59
103
  };
104
+
60
105
  var _useState = useState(getTheme()),
61
- _useState2 = _slicedToArray(_useState, 2),
62
- theme = _useState2[0],
63
- setTheme = _useState2[1];
106
+ _useState2 = _slicedToArray(_useState, 2),
107
+ theme = _useState2[0],
108
+ setTheme = _useState2[1];
109
+
64
110
  var changeTheme = function changeTheme(theme) {
65
111
  setTheme(theme);
66
112
  setThemeStore(theme);
67
113
  onThemeChange(theme);
68
114
  };
115
+
69
116
  var getLanguage = function getLanguage() {
70
117
  var lang = getLanguageStore() || props.language;
118
+
71
119
  if (!languagesMap[lang]) {
72
120
  lang = get(languages, '0.value');
73
121
  }
122
+
74
123
  return lang;
75
124
  };
125
+
76
126
  var _useState3 = useState(getLanguage()),
77
- _useState4 = _slicedToArray(_useState3, 2),
78
- _useState4$ = _useState4[0],
79
- language = _useState4$ === void 0 ? 'cn' : _useState4$,
80
- setLanguage = _useState4[1];
127
+ _useState4 = _slicedToArray(_useState3, 2),
128
+ _useState4$ = _useState4[0],
129
+ language = _useState4$ === void 0 ? 'cn' : _useState4$,
130
+ setLanguage = _useState4[1];
131
+
81
132
  var changeLanguage = function changeLanguage(language) {
82
133
  setLanguage(language);
83
134
  setLanguageStore(language);
84
135
  onLanguageChange(language);
85
136
  };
86
- return /*#__PURE__*/React.createElement(ThemeContentWrapper, null, themeVisible && /*#__PURE__*/React.createElement(ThemeSwitch, null, themes.map(function (_ref3) {
137
+
138
+ return React.createElement(ThemeContentWrapper, null, themeVisible && React.createElement(ThemeSwitch, null, themes.map(function (_ref3) {
87
139
  var value = _ref3.value,
88
- img = _ref3.img;
89
- return /*#__PURE__*/React.createElement("div", {
140
+ img = _ref3.img;
141
+ return React.createElement("div", {
90
142
  key: value,
91
143
  onClick: changeTheme.bind(_this, value)
92
- }, /*#__PURE__*/React.createElement("img", {
144
+ }, React.createElement("img", {
93
145
  src: img
94
- }), theme === value && /*#__PURE__*/React.createElement(Icon, {
146
+ }), theme === value && React.createElement(Icon, {
95
147
  type: "check1"
96
148
  }));
97
- })), themeVisible && languageVisible && /*#__PURE__*/React.createElement("div", {
149
+ })), themeVisible && languageVisible && React.createElement("div", {
98
150
  className: "line"
99
- }), languageVisible && /*#__PURE__*/React.createElement(LanguageSwitch, null, languages.map(function (_ref4) {
151
+ }), languageVisible && React.createElement(LanguageSwitch, null, languages.map(function (_ref4) {
100
152
  var value = _ref4.value,
101
- name = _ref4.name;
102
- return /*#__PURE__*/React.createElement("div", {
153
+ name = _ref4.name;
154
+ return React.createElement("div", {
103
155
  className: cn({
104
156
  active: value === language
105
157
  }),
@@ -108,17 +160,20 @@ var ThemeContent = function ThemeContent(props) {
108
160
  }, name);
109
161
  })));
110
162
  };
163
+
111
164
  export default (function (props) {
112
165
  var config = props.config;
166
+
113
167
  if ((config == null ? void 0 : config.language) === false && (config == null ? void 0 : config.theme) === false) {
114
168
  return null;
115
169
  }
116
- return /*#__PURE__*/React.createElement(Theme, null, /*#__PURE__*/React.createElement(_Popover, {
170
+
171
+ return React.createElement(Theme, null, React.createElement(_Popover, {
117
172
  placement: "bottomRight",
118
173
  title: null,
119
- content: /*#__PURE__*/React.createElement(ThemeContent, props),
174
+ content: React.createElement(ThemeContent, props),
120
175
  trigger: "click"
121
- }, /*#__PURE__*/React.createElement(Icon, {
176
+ }, React.createElement(Icon, {
122
177
  type: "daxiaoxie"
123
178
  })));
124
179
  });
@@ -4,8 +4,39 @@ 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
- var _templateObject, _templateObject2, _templateObject3;
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
+
8
38
  function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
39
+
9
40
  import { useContext } from 'react';
10
41
  import styled, { createGlobalStyle } from 'styled-components';
11
42
  import { get } from 'lodash';
@@ -14,9 +45,9 @@ import ActionsContext from '../ActionsContext';
14
45
  import Language from './Language';
15
46
  import Theme from './Theme';
16
47
  import { getLanguageStore, clearLoginCookie } from '../storage';
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) {
48
+ var Avatar = styled.li(_templateObject());
49
+ var GlobalStyle = createGlobalStyle(_templateObject2());
50
+ var UserInfoWrapper = styled.div(_templateObject3(), function (props) {
20
51
  return "".concat(props.theme.primaryTextColor);
21
52
  }, function (props) {
22
53
  return "1px solid ".concat(props.theme.dividerColor);
@@ -25,59 +56,63 @@ var UserInfoWrapper = styled.div(_templateObject3 || (_templateObject3 = _tagged
25
56
  }, function (props) {
26
57
  return "".concat(props.theme.primaryColor);
27
58
  });
59
+
28
60
  var UserInfoContent = function UserInfoContent(props) {
29
61
  var userInfo = props.userInfo,
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;
62
+ _props$config = props.config,
63
+ config = _props$config === void 0 ? {} : _props$config,
64
+ onLogout = props.onLogout,
65
+ _props$onChangePasswo = props.onChangePassword,
66
+ onChangePassword = _props$onChangePasswo === void 0 ? function () {
67
+ return true;
68
+ } : _props$onChangePasswo,
69
+ _props$onPersonalSett = props.onPersonalSetting,
70
+ onPersonalSetting = _props$onPersonalSett === void 0 ? function () {
71
+ return true;
72
+ } : _props$onPersonalSett,
73
+ onLanguageChange = props.onLanguageChange,
74
+ onThemeChange = props.onThemeChange;
75
+
43
76
  var _useContext = useContext(ActionsContext),
44
- getText = _useContext.getText;
77
+ getText = _useContext.getText;
78
+
45
79
  var _ref = config || {},
46
- _ref$language = _ref.language,
47
- language = _ref$language === void 0 ? true : _ref$language;
48
- return /*#__PURE__*/React.createElement(UserInfoWrapper, {
80
+ _ref$language = _ref.language,
81
+ language = _ref$language === void 0 ? true : _ref$language;
82
+
83
+ return React.createElement(UserInfoWrapper, {
49
84
  className: "user-info-setting-wrap"
50
- }, /*#__PURE__*/React.createElement("ul", {
85
+ }, React.createElement("ul", {
51
86
  className: "user-info-body"
52
- }, /*#__PURE__*/React.createElement("li", {
87
+ }, React.createElement("li", {
53
88
  className: "user-info-body-username"
54
- }, userInfo.userName || getText('nameNull'), /*#__PURE__*/React.createElement("span", {
89
+ }, userInfo.userName || getText('nameNull'), React.createElement("span", {
55
90
  className: "user-info-body-account"
56
- }, userInfo.account)), language && /*#__PURE__*/React.createElement(Language, {
91
+ }, userInfo.account)), language && React.createElement(Language, {
57
92
  language: userInfo.lang,
58
93
  onChange: onLanguageChange
59
- }), /*#__PURE__*/React.createElement(Theme, {
94
+ }), React.createElement(Theme, {
60
95
  theme: userInfo.theme,
61
96
  onChange: onThemeChange
62
- })), /*#__PURE__*/React.createElement(_Row, {
97
+ })), React.createElement(_Row, {
63
98
  className: "user-info-footer",
64
99
  type: "flex",
65
100
  justify: "space-between",
66
101
  align: "middle"
67
- }, /*#__PURE__*/React.createElement("a", {
102
+ }, React.createElement("a", {
68
103
  onClick: onPersonalSetting,
69
104
  href: "/bridge/userCenter?currentTab=1"
70
- }, getText('personalSettings')), /*#__PURE__*/React.createElement(_Divider, {
105
+ }, getText('personalSettings')), React.createElement(_Divider, {
71
106
  type: "vertical"
72
- }), /*#__PURE__*/React.createElement("a", {
107
+ }), React.createElement("a", {
73
108
  onClick: onChangePassword,
74
109
  href: "/bridge/userCenter?currentTab=2",
75
110
  style: getLanguageStore() === 'en' ? {
76
111
  flex: 2
77
112
  } : {}
78
- }, getText('changePwd')), /*#__PURE__*/React.createElement(_Divider, {
113
+ }, getText('changePwd')), React.createElement(_Divider, {
79
114
  type: "vertical"
80
- }), /*#__PURE__*/React.createElement("a", {
115
+ }), React.createElement("a", {
81
116
  className: "user-info-footer-signout",
82
117
  onClick: function onClick() {
83
118
  if (onLogout) {
@@ -90,25 +125,28 @@ var UserInfoContent = function UserInfoContent(props) {
90
125
  }
91
126
  }, getText('signOut'))));
92
127
  };
128
+
93
129
  export default (function (props) {
94
130
  var _images$empty2;
131
+
95
132
  var _props$userInfo = props.userInfo,
96
- userInfo = _props$userInfo === void 0 ? {} : _props$userInfo;
133
+ userInfo = _props$userInfo === void 0 ? {} : _props$userInfo;
97
134
  var avatar = userInfo.avatar;
98
- return /*#__PURE__*/React.createElement(Avatar, null, /*#__PURE__*/React.createElement(_Popover, {
135
+ return React.createElement(Avatar, null, React.createElement(_Popover, {
99
136
  popupClassName: "tnt-layout-personal-popover",
100
137
  placement: "bottomRight",
101
138
  title: null,
102
- content: /*#__PURE__*/React.createElement(UserInfoContent, props),
139
+ content: React.createElement(UserInfoContent, props),
103
140
  trigger: "click"
104
- }, avatar ? /*#__PURE__*/React.createElement("img", {
141
+ }, avatar ? React.createElement("img", {
105
142
  src: avatar.indexOf('base64') > 0 ? avatar : get(images[avatar], 'default', images[avatar]),
106
143
  onError: function onError(e) {
107
144
  var _images$empty;
145
+
108
146
  e.target.onerror = null;
109
147
  e.target.src = ((_images$empty = images.empty) == null ? void 0 : _images$empty["default"]) || images.empty;
110
148
  }
111
- }) : /*#__PURE__*/React.createElement("img", {
149
+ }) : React.createElement("img", {
112
150
  src: ((_images$empty2 = images.empty) == null ? void 0 : _images$empty2["default"]) || images.empty
113
- })), /*#__PURE__*/React.createElement(GlobalStyle, null));
151
+ })), React.createElement(GlobalStyle, null));
114
152
  });
@@ -1,11 +1,23 @@
1
- var _templateObject;
2
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _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(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
5
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
6
- function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
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
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
+
8
19
  function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
20
+
9
21
  import { useState, useMemo } from 'react';
10
22
  import styled, { withTheme } from 'styled-components';
11
23
  import { get } from 'lodash';
@@ -22,7 +34,7 @@ var languagesMap = languages.reduce(function (acc, cur) {
22
34
  acc[cur.value] = cur;
23
35
  return acc;
24
36
  }, {});
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) {
37
+ var Language = styled.li(_templateObject(), function (_ref) {
26
38
  var size = _ref.theme.size;
27
39
  return size === 'large' ? '14px' : '12px';
28
40
  }, function (_ref2) {
@@ -37,30 +49,36 @@ var Language = styled.li(_templateObject || (_templateObject = _taggedTemplateLi
37
49
  });
38
50
  export default withTheme(function (props) {
39
51
  var onChange = props.onChange;
52
+
40
53
  var getLanguage = function getLanguage() {
41
54
  var lang = getLanguageStore() || props.language;
55
+
42
56
  if (!languagesMap[lang]) {
43
57
  lang = get(languages, '0.value');
44
58
  }
59
+
45
60
  return lang;
46
61
  };
62
+
47
63
  var _useState = useState(getLanguage()),
48
- _useState2 = _slicedToArray(_useState, 2),
49
- _useState2$ = _useState2[0],
50
- language = _useState2$ === void 0 ? 'cn' : _useState2$,
51
- setLanguage = _useState2[1];
64
+ _useState2 = _slicedToArray(_useState, 2),
65
+ _useState2$ = _useState2[0],
66
+ language = _useState2$ === void 0 ? 'cn' : _useState2$,
67
+ setLanguage = _useState2[1];
68
+
52
69
  var switchLanguage = function switchLanguage() {
53
70
  var lang = language === 'cn' ? 'en' : 'cn';
54
71
  setLanguage(lang);
55
72
  setLanguageStore(lang);
56
73
  onChange && onChange(lang);
57
74
  };
75
+
58
76
  var otherLanguage = useMemo(function () {
59
77
  return language === 'cn' ? 'en' : 'cn';
60
78
  }, [language]);
61
- return /*#__PURE__*/React.createElement(Language, {
79
+ return React.createElement(Language, {
62
80
  onClick: switchLanguage
63
- }, /*#__PURE__*/React.createElement(Iconfont, {
81
+ }, React.createElement(Iconfont, {
64
82
  type: "flag-".concat(otherLanguage)
65
- }), /*#__PURE__*/React.createElement("span", null, get(languagesMap[otherLanguage], 'name')));
83
+ }), React.createElement("span", null, get(languagesMap[otherLanguage], 'name')));
66
84
  });
@@ -1,19 +1,33 @@
1
1
  import "antd/lib/row/style";
2
2
  import _Row from "antd/lib/row";
3
- var _templateObject,
4
- _this = this;
5
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _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(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
8
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
9
- function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
3
+
4
+ var _this = this;
5
+
6
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }
7
+
8
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); }
9
+
10
+ function _iterableToArrayLimit(arr, i) { if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) { return; } var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
11
+
10
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
+
11
24
  function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
25
+
12
26
  import { useState } from 'react';
13
27
  import styled from 'styled-components';
14
28
  import Iconfont from '../Iconfont';
15
29
  import { setThemeStore, getThemeStore, getLanguageStore } from '../storage';
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"])));
30
+ var Theme = styled.li(_templateObject());
17
31
  var themes = [{
18
32
  value: 'themeS3',
19
33
  label: '科技蓝',
@@ -29,6 +43,7 @@ var themes = [{
29
43
  }];
30
44
  export default (function (props) {
31
45
  var onChange = props.onChange;
46
+
32
47
  var getTheme = function getTheme() {
33
48
  var theme = getThemeStore() || props.theme || 'themeS3';
34
49
  return themes.some(function (_ref) {
@@ -36,27 +51,30 @@ export default (function (props) {
36
51
  return value === theme;
37
52
  }) ? theme : 'themeS3';
38
53
  };
54
+
39
55
  var _useState = useState(getTheme()),
40
- _useState2 = _slicedToArray(_useState, 2),
41
- theme = _useState2[0],
42
- setTheme = _useState2[1];
56
+ _useState2 = _slicedToArray(_useState, 2),
57
+ theme = _useState2[0],
58
+ setTheme = _useState2[1];
59
+
43
60
  var changeTheme = function changeTheme(theme) {
44
61
  setTheme(theme);
45
62
  setThemeStore(theme);
46
63
  onChange(theme);
47
64
  };
48
- return /*#__PURE__*/React.createElement(Theme, null, /*#__PURE__*/React.createElement(_Row, {
65
+
66
+ return React.createElement(Theme, null, React.createElement(_Row, {
49
67
  type: "flex",
50
68
  justify: "space-between",
51
69
  className: "user-info-body-theme-row"
52
70
  }, themes.map(function (_ref2) {
53
71
  var value = _ref2.value,
54
- label = _ref2.label,
55
- enLabel = _ref2.enLabel;
56
- return /*#__PURE__*/React.createElement("div", {
72
+ label = _ref2.label,
73
+ enLabel = _ref2.enLabel;
74
+ return React.createElement("div", {
57
75
  className: value,
58
76
  onClick: changeTheme.bind(_this, value)
59
- }, getLanguageStore() === 'en' ? enLabel : label, theme === value && /*#__PURE__*/React.createElement("span", {
77
+ }, getLanguageStore() === 'en' ? enLabel : label, theme === value && React.createElement("span", {
60
78
  className: "icon-checked-wrap"
61
79
  }));
62
80
  })));
@@ -1,29 +1,31 @@
1
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
- function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }
3
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
4
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
5
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
6
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
7
- function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
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
+
8
9
  import { withTheme } from 'styled-components';
9
10
  import Layout from '../Layout';
10
11
  import Avatar from './Avatar';
11
12
  import { getThemeStore } from '../storage';
12
13
  export default withTheme(function (props) {
13
14
  var _props$userInfo = props.userInfo,
14
- userInfo = _props$userInfo === void 0 ? {} : _props$userInfo,
15
- _props$extendMap = props.extendMap,
16
- extendMap = _props$extendMap === void 0 ? {} : _props$extendMap;
15
+ userInfo = _props$userInfo === void 0 ? {} : _props$userInfo,
16
+ _props$extendMap = props.extendMap,
17
+ extendMap = _props$extendMap === void 0 ? {} : _props$extendMap; // 企业级的默认蓝色主题
17
18
 
18
- // 企业级的默认蓝色主题
19
19
  var theme = getThemeStore() || (extendMap == null ? void 0 : extendMap.defaultTheme) || userInfo.theme || 'themeS3';
20
20
  theme = theme === 'default' ? 'themeS3' : theme;
21
- var newProps = _objectSpread(_objectSpread({}, props), {}, {
22
- userInfo: _objectSpread(_objectSpread({}, userInfo), {}, {
21
+
22
+ var newProps = _objectSpread({}, props, {
23
+ userInfo: _objectSpread({}, userInfo, {
23
24
  theme: theme
24
25
  })
25
26
  });
26
- return /*#__PURE__*/React.createElement(Layout, _extends({}, newProps, {
27
+
28
+ return React.createElement(Layout, _extends({}, newProps, {
27
29
  AvatarCustom: Avatar
28
30
  }));
29
31
  });