tntd 1.4.20 → 1.4.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/Handle/README.md +0 -20
- package/components/Handle/index.js +44 -7
- package/components/locale.js +8 -2
- package/dist/1.tntd.js +1 -1
- package/dist/stats.json +24430 -24390
- package/dist/tntd.css +1 -1
- package/dist/tntd.js +13 -8
- package/es/ArrayInput/icon.js +5 -5
- package/es/ArrayInput/index.js +108 -76
- package/es/AuthContext.js +1 -1
- package/es/Columns/index.js +38 -31
- package/es/DevelopmentLogin/LoginModal.js +45 -32
- package/es/DevelopmentLogin/index.js +17 -13
- package/es/Ellipsis/Svg/CopySVG.js +13 -13
- package/es/Ellipsis/Svg/TickSVG.js +8 -8
- package/es/Ellipsis/index.js +69 -58
- package/es/Handle/README.md +0 -20
- package/es/Handle/index.js +100 -33
- package/es/Icon/fonts/iconfont.js +12 -7
- package/es/Icon/index.js +13 -10
- package/es/Img/Contain.js +29 -24
- package/es/Img/Cover.js +54 -40
- package/es/Img/index.js +45 -36
- package/es/Layout/ActionsContext.js +2 -3
- package/es/Layout/AppList.js +92 -37
- package/es/Layout/Application.js +72 -26
- package/es/Layout/Avatar.js +66 -29
- package/es/Layout/CompatibleLanguage.js +94 -39
- package/es/Layout/EnterpriseLayout/Avatar.js +76 -38
- package/es/Layout/EnterpriseLayout/Language.js +32 -14
- package/es/Layout/EnterpriseLayout/Theme.js +34 -16
- package/es/Layout/EnterpriseLayout/index.js +16 -14
- package/es/Layout/GlobalNavigation/NavigationPopup.js +170 -59
- package/es/Layout/GlobalNavigation/index.js +54 -20
- package/es/Layout/Header.js +46 -25
- package/es/Layout/HeaderActions.js +56 -42
- package/es/Layout/HeaderNavs.js +47 -20
- package/es/Layout/HeaderTabs.js +102 -49
- package/es/Layout/Iconfont.js +1 -1
- package/es/Layout/Language.js +32 -14
- package/es/Layout/Layout.js +108 -86
- package/es/Layout/Logo.js +32 -16
- package/es/Layout/OrgAppList.js +107 -62
- package/es/Layout/SideMenu.js +124 -63
- package/es/Layout/Theme.js +61 -23
- package/es/Layout/checkAuth.js +29 -0
- package/es/Layout/index.js +34 -26
- package/es/Layout/paaslayout/CompactSideMenu.js +74 -35
- package/es/Layout/paaslayout/Header.js +45 -22
- package/es/Layout/paaslayout/Logo.js +13 -3
- package/es/Layout/paaslayout/SideMenu.js +78 -39
- package/es/Layout/paaslayout/index.js +102 -75
- package/es/Layout/storage.js +9 -10
- package/es/Layout/utils.js +136 -0
- package/es/LoadingButton/index.js +24 -15
- package/es/Modal/index.js +46 -38
- package/es/Page/Box.js +41 -34
- package/es/Page/index.js +67 -52
- package/es/Page/utils.js +5 -0
- package/es/QueryForm/Field/Checkbox.js +9 -5
- package/es/QueryForm/Field/Select.js +41 -31
- package/es/QueryForm/Field/SelectInput.js +41 -26
- package/es/QueryForm/Field/fieldsMap.js +1 -0
- package/es/QueryForm/Field/index.js +71 -41
- package/es/QueryForm/createActions.js +7 -6
- package/es/QueryForm/index.js +135 -76
- package/es/QueryListScene/List.js +128 -74
- package/es/QueryListScene/QueryForm.js +81 -46
- package/es/QueryListScene/QueryListScene.js +40 -25
- package/es/QueryListScene/Title.js +3 -3
- package/es/QueryListScene/Toolbar.js +12 -11
- package/es/Select/DropDownWrap.js +50 -29
- package/es/Select/index.js +231 -135
- package/es/Table/ResizableTable/index.js +40 -26
- package/es/Table/index.js +16 -18
- package/es/Title/index.js +23 -21
- package/es/locale.js +11 -3
- package/es/utils/checkAuth.js +5 -3
- package/es/utils/findMenuInfoByPath.js +4 -0
- package/es/utils/index.js +23 -12
- package/lib/ArrayInput/icon.js +6 -6
- package/lib/ArrayInput/index.js +127 -78
- package/lib/AuthContext.js +4 -1
- package/lib/Columns/index.js +47 -31
- package/lib/DevelopmentLogin/LoginModal.js +58 -32
- package/lib/DevelopmentLogin/index.js +27 -16
- package/lib/Ellipsis/Svg/CopySVG.js +15 -13
- package/lib/Ellipsis/Svg/TickSVG.js +10 -8
- package/lib/Ellipsis/index.js +80 -57
- package/lib/Handle/README.md +0 -20
- package/lib/Handle/index.js +119 -33
- package/lib/Icon/fonts/iconfont.js +12 -7
- package/lib/Icon/index.js +20 -11
- package/lib/Img/Contain.js +34 -24
- package/lib/Img/Cover.js +65 -42
- package/lib/Img/index.js +51 -36
- package/lib/Layout/ActionsContext.js +4 -1
- package/lib/Layout/AppList.js +118 -40
- package/lib/Layout/Application.js +86 -26
- package/lib/Layout/Avatar.js +86 -32
- package/lib/Layout/CompatibleLanguage.js +110 -39
- package/lib/Layout/EnterpriseLayout/Avatar.js +100 -41
- package/lib/Layout/EnterpriseLayout/Header.js +113 -0
- package/lib/Layout/EnterpriseLayout/HeaderActions.js +104 -0
- package/lib/Layout/EnterpriseLayout/Language.js +48 -17
- package/lib/Layout/EnterpriseLayout/Theme.js +44 -16
- package/lib/Layout/EnterpriseLayout/index.js +23 -14
- package/lib/Layout/GlobalNavigation/NavigationPopup.js +186 -59
- package/lib/Layout/GlobalNavigation/index.js +74 -23
- package/lib/Layout/Header.js +63 -28
- package/lib/Layout/HeaderActions.js +74 -45
- package/lib/Layout/HeaderNavs.js +61 -23
- package/lib/Layout/HeaderTabs.js +118 -51
- package/lib/Layout/Iconfont.js +5 -1
- package/lib/Layout/Language.js +48 -17
- package/lib/Layout/Layout.js +128 -88
- package/lib/Layout/Logo.js +43 -19
- package/lib/Layout/OrgAppList.js +127 -64
- package/lib/Layout/SideMenu.js +143 -65
- package/lib/Layout/Theme.js +73 -23
- package/lib/Layout/checkAuth.js +39 -0
- package/lib/Layout/createActions.js +5 -0
- package/lib/Layout/images/index.js +28 -0
- package/lib/Layout/index.js +55 -30
- package/lib/Layout/paaslayout/CompactSideMenu.js +84 -35
- package/lib/Layout/paaslayout/Header.js +55 -22
- package/lib/Layout/paaslayout/Logo.js +19 -3
- package/lib/Layout/paaslayout/SideMenu.js +87 -39
- package/lib/Layout/paaslayout/index.js +122 -77
- package/lib/Layout/storage.js +40 -11
- package/lib/Layout/utils.js +166 -0
- package/lib/LoadingButton/index.js +29 -15
- package/lib/Modal/index.js +53 -38
- package/lib/Page/Box.js +45 -34
- package/lib/Page/index.js +77 -52
- package/lib/Page/utils.js +9 -1
- package/lib/QueryForm/Field/Checkbox.js +13 -5
- package/lib/QueryForm/Field/Select.js +53 -33
- package/lib/QueryForm/Field/SelectInput.js +56 -28
- package/lib/QueryForm/Field/fieldsMap.js +15 -1
- package/lib/QueryForm/Field/index.js +81 -43
- package/lib/QueryForm/createActions.js +12 -6
- package/lib/QueryForm/index.js +157 -78
- package/lib/QueryForm/useForm.js +5 -0
- package/lib/QueryListScene/List.js +140 -76
- package/lib/QueryListScene/QueryForm.js +86 -46
- package/lib/QueryListScene/QueryListScene.js +46 -25
- package/lib/QueryListScene/Title.js +7 -3
- package/lib/QueryListScene/Toolbar.js +16 -11
- package/lib/QueryListScene/createActions.js +5 -0
- package/lib/QueryListScene/index.js +10 -0
- package/lib/QueryListScene/useActions.js +5 -0
- package/lib/Select/DropDownWrap.js +56 -31
- package/lib/Select/index.js +241 -135
- package/lib/Table/ResizableTable/index.js +48 -26
- package/lib/Table/index.js +28 -17
- package/lib/Title/index.js +28 -21
- package/lib/index.js +56 -35
- package/lib/locale.js +19 -4
- package/lib/utils/checkAuth.js +9 -4
- package/lib/utils/findMenuInfoByPath.js +8 -1
- package/lib/utils/index.js +42 -15
- package/package.json +2 -2
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports["default"] = void 0;
|
|
9
|
+
|
|
10
|
+
require("antd/lib/divider/style");
|
|
11
|
+
|
|
12
|
+
var _divider = _interopRequireDefault(require("antd/lib/divider"));
|
|
13
|
+
|
|
14
|
+
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
15
|
+
|
|
16
|
+
var _GlobalNavigation = _interopRequireDefault(require("../GlobalNavigation"));
|
|
17
|
+
|
|
18
|
+
var _Application = _interopRequireDefault(require("../Application"));
|
|
19
|
+
|
|
20
|
+
var _Avatar = _interopRequireDefault(require("./Avatar"));
|
|
21
|
+
|
|
22
|
+
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
|
23
|
+
|
|
24
|
+
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
25
|
+
|
|
26
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
27
|
+
|
|
28
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
29
|
+
|
|
30
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
31
|
+
|
|
32
|
+
function _templateObject() {
|
|
33
|
+
var data = _taggedTemplateLiteral(["\n list-style: none;\n display: inline-block;\n line-height: ", ";\n margin: 0 0 0 20px;\n .hasHeaderTabs & {\n margin: 0;\n }\n padding: 0;\n white-space: nowrap;\n\n .isInIframe & {\n display: none;\n }\n\n & > li {\n height: 100%;\n display: inline-block;\n vertical-align: top;\n cursor: pointer;\n font-size: 20px;\n margin: 0 7.5px;\n color: ", ";\n .large-size & {\n margin: 0 10px;\n }\n .tnt-themeS1 & {\n /* color: rgba(255,255,255,.85); */\n }\n &:last-of-type {\n margin-right: 0;\n }\n .hasHeaderTabs:not(.tnt-themeS1) & {\n color: rgba(255,255,255,.8);\n }\n }\n"]);
|
|
34
|
+
|
|
35
|
+
_templateObject = function _templateObject() {
|
|
36
|
+
return data;
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
return data;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
43
|
+
|
|
44
|
+
var Actions = _styledComponents["default"].ul(_templateObject(), function (props) {
|
|
45
|
+
return "".concat(props.theme.headerHeight, "px");
|
|
46
|
+
}, function (props) {
|
|
47
|
+
return "".concat(props.theme.headerActionsColor);
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
var _default = (0, _styledComponents.withTheme)(function (props) {
|
|
51
|
+
var _props$config = props.config;
|
|
52
|
+
_props$config = _props$config === void 0 ? {} : _props$config;
|
|
53
|
+
|
|
54
|
+
var _props$config$theme = _props$config.theme,
|
|
55
|
+
theme = _props$config$theme === void 0 ? true : _props$config$theme,
|
|
56
|
+
_props$config$avatar = _props$config.avatar,
|
|
57
|
+
avatar = _props$config$avatar === void 0 ? true : _props$config$avatar,
|
|
58
|
+
_props$config$languag = _props$config.language,
|
|
59
|
+
language = _props$config$languag === void 0 ? true : _props$config$languag,
|
|
60
|
+
_props$config$applica = _props$config.application,
|
|
61
|
+
application = _props$config$applica === void 0 ? false : _props$config$applica,
|
|
62
|
+
_props$config$globalN = _props$config.globalNavigation,
|
|
63
|
+
globalNavigation = _props$config$globalN === void 0 ? false : _props$config$globalN,
|
|
64
|
+
compatible = props.theme.compatible,
|
|
65
|
+
_props$userInfo = props.userInfo,
|
|
66
|
+
userInfo = _props$userInfo === void 0 ? {} : _props$userInfo,
|
|
67
|
+
menus = props.menus,
|
|
68
|
+
apps = props.apps,
|
|
69
|
+
extraActions = props.extraActions,
|
|
70
|
+
headerRef = props.headerRef,
|
|
71
|
+
onLanguageChange = props.onLanguageChange,
|
|
72
|
+
onThemeChange = props.onThemeChange,
|
|
73
|
+
onApplicationChange = props.onApplicationChange,
|
|
74
|
+
onAppChange = props.onAppChange,
|
|
75
|
+
onCollapseChange = props.onCollapseChange,
|
|
76
|
+
onPersonalSetting = props.onPersonalSetting,
|
|
77
|
+
onChangePassword = props.onChangePassword,
|
|
78
|
+
onLogout = props.onLogout,
|
|
79
|
+
onLogoClick = props.onLogoClick,
|
|
80
|
+
rest = _objectWithoutProperties(props, ["config", "theme", "userInfo", "menus", "apps", "extraActions", "headerRef", "onLanguageChange", "onThemeChange", "onApplicationChange", "onAppChange", "onCollapseChange", "onPersonalSetting", "onChangePassword", "onLogout", "onLogoClick"]);
|
|
81
|
+
|
|
82
|
+
return React.createElement(Actions, rest, extraActions, globalNavigation && React.createElement(_GlobalNavigation["default"], {
|
|
83
|
+
headerRef: headerRef,
|
|
84
|
+
menus: menus
|
|
85
|
+
}), application && React.createElement(_Application["default"], {
|
|
86
|
+
language: userInfo.lang,
|
|
87
|
+
apps: apps,
|
|
88
|
+
onChange: onApplicationChange
|
|
89
|
+
}), avatar && React.createElement(React.Fragment, null, React.createElement(_divider["default"], {
|
|
90
|
+
type: "vertical"
|
|
91
|
+
}), React.createElement(_Avatar["default"], {
|
|
92
|
+
userInfo: userInfo,
|
|
93
|
+
onThemeChange: onThemeChange,
|
|
94
|
+
onPersonalSetting: onPersonalSetting,
|
|
95
|
+
onChangePassword: onChangePassword,
|
|
96
|
+
onLogout: onLogout,
|
|
97
|
+
config: {
|
|
98
|
+
theme: theme,
|
|
99
|
+
language: language
|
|
100
|
+
}
|
|
101
|
+
})));
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
exports["default"] = _default;
|
|
@@ -1,26 +1,48 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(obj) {
|
|
3
|
+
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
4
|
+
|
|
4
5
|
Object.defineProperty(exports, "__esModule", {
|
|
5
6
|
value: true
|
|
6
7
|
});
|
|
7
8
|
exports["default"] = void 0;
|
|
9
|
+
|
|
8
10
|
var _react = require("react");
|
|
11
|
+
|
|
9
12
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
13
|
+
|
|
10
14
|
var _lodash = require("lodash");
|
|
15
|
+
|
|
11
16
|
var _Iconfont = _interopRequireDefault(require("../Iconfont"));
|
|
17
|
+
|
|
12
18
|
var _storage = require("../storage");
|
|
13
|
-
|
|
19
|
+
|
|
14
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
15
|
-
|
|
16
|
-
function
|
|
17
|
-
|
|
18
|
-
function
|
|
19
|
-
|
|
20
|
-
function
|
|
21
|
-
|
|
21
|
+
|
|
22
|
+
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
|
23
|
+
|
|
24
|
+
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
25
|
+
|
|
26
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }
|
|
27
|
+
|
|
28
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); }
|
|
29
|
+
|
|
30
|
+
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; }
|
|
31
|
+
|
|
22
32
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
33
|
+
|
|
34
|
+
function _templateObject() {
|
|
35
|
+
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"]);
|
|
36
|
+
|
|
37
|
+
_templateObject = function _templateObject() {
|
|
38
|
+
return data;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
return data;
|
|
42
|
+
}
|
|
43
|
+
|
|
23
44
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
45
|
+
|
|
24
46
|
var languages = [{
|
|
25
47
|
value: 'cn',
|
|
26
48
|
name: '中文'
|
|
@@ -32,7 +54,8 @@ var languagesMap = languages.reduce(function (acc, cur) {
|
|
|
32
54
|
acc[cur.value] = cur;
|
|
33
55
|
return acc;
|
|
34
56
|
}, {});
|
|
35
|
-
|
|
57
|
+
|
|
58
|
+
var Language = _styledComponents["default"].li(_templateObject(), function (_ref) {
|
|
36
59
|
var size = _ref.theme.size;
|
|
37
60
|
return size === 'large' ? '14px' : '12px';
|
|
38
61
|
}, function (_ref2) {
|
|
@@ -45,33 +68,41 @@ var Language = _styledComponents["default"].li(_templateObject || (_templateObje
|
|
|
45
68
|
var size = _ref4.theme.size;
|
|
46
69
|
return size === 'large' ? '-3px' : '-2px';
|
|
47
70
|
});
|
|
71
|
+
|
|
48
72
|
var _default = (0, _styledComponents.withTheme)(function (props) {
|
|
49
73
|
var onChange = props.onChange;
|
|
74
|
+
|
|
50
75
|
var getLanguage = function getLanguage() {
|
|
51
76
|
var lang = (0, _storage.getLanguageStore)() || props.language;
|
|
77
|
+
|
|
52
78
|
if (!languagesMap[lang]) {
|
|
53
79
|
lang = (0, _lodash.get)(languages, '0.value');
|
|
54
80
|
}
|
|
81
|
+
|
|
55
82
|
return lang;
|
|
56
83
|
};
|
|
84
|
+
|
|
57
85
|
var _useState = (0, _react.useState)(getLanguage()),
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
86
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
87
|
+
_useState2$ = _useState2[0],
|
|
88
|
+
language = _useState2$ === void 0 ? 'cn' : _useState2$,
|
|
89
|
+
setLanguage = _useState2[1];
|
|
90
|
+
|
|
62
91
|
var switchLanguage = function switchLanguage() {
|
|
63
92
|
var lang = language === 'cn' ? 'en' : 'cn';
|
|
64
93
|
setLanguage(lang);
|
|
65
94
|
(0, _storage.setLanguageStore)(lang);
|
|
66
95
|
onChange && onChange(lang);
|
|
67
96
|
};
|
|
97
|
+
|
|
68
98
|
var otherLanguage = (0, _react.useMemo)(function () {
|
|
69
99
|
return language === 'cn' ? 'en' : 'cn';
|
|
70
100
|
}, [language]);
|
|
71
|
-
return
|
|
101
|
+
return React.createElement(Language, {
|
|
72
102
|
onClick: switchLanguage
|
|
73
|
-
},
|
|
103
|
+
}, React.createElement(_Iconfont["default"], {
|
|
74
104
|
type: "flag-".concat(otherLanguage)
|
|
75
|
-
}),
|
|
105
|
+
}), React.createElement("span", null, (0, _lodash.get)(languagesMap[otherLanguage], 'name')));
|
|
76
106
|
});
|
|
107
|
+
|
|
77
108
|
exports["default"] = _default;
|
|
@@ -4,23 +4,45 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = void 0;
|
|
7
|
+
|
|
7
8
|
require("antd/lib/row/style");
|
|
9
|
+
|
|
8
10
|
var _row = _interopRequireDefault(require("antd/lib/row"));
|
|
11
|
+
|
|
9
12
|
var _react = require("react");
|
|
13
|
+
|
|
10
14
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
15
|
+
|
|
11
16
|
var _Iconfont = _interopRequireDefault(require("../Iconfont"));
|
|
17
|
+
|
|
12
18
|
var _storage = require("../storage");
|
|
13
|
-
|
|
14
|
-
|
|
19
|
+
|
|
20
|
+
var _this = void 0;
|
|
21
|
+
|
|
15
22
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
16
|
-
|
|
17
|
-
function
|
|
18
|
-
|
|
19
|
-
function
|
|
20
|
-
|
|
23
|
+
|
|
24
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }
|
|
25
|
+
|
|
26
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); }
|
|
27
|
+
|
|
28
|
+
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; }
|
|
29
|
+
|
|
21
30
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
31
|
+
|
|
32
|
+
function _templateObject() {
|
|
33
|
+
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"]);
|
|
34
|
+
|
|
35
|
+
_templateObject = function _templateObject() {
|
|
36
|
+
return data;
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
return data;
|
|
40
|
+
}
|
|
41
|
+
|
|
22
42
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
23
|
-
|
|
43
|
+
|
|
44
|
+
var Theme = _styledComponents["default"].li(_templateObject());
|
|
45
|
+
|
|
24
46
|
var themes = [{
|
|
25
47
|
value: 'themeS3',
|
|
26
48
|
label: '科技蓝',
|
|
@@ -34,8 +56,10 @@ var themes = [{
|
|
|
34
56
|
label: '极致白',
|
|
35
57
|
enLabel: 'White'
|
|
36
58
|
}];
|
|
59
|
+
|
|
37
60
|
var _default = function _default(props) {
|
|
38
61
|
var onChange = props.onChange;
|
|
62
|
+
|
|
39
63
|
var getTheme = function getTheme() {
|
|
40
64
|
var theme = (0, _storage.getThemeStore)() || props.theme || 'themeS3';
|
|
41
65
|
return themes.some(function (_ref) {
|
|
@@ -43,29 +67,33 @@ var _default = function _default(props) {
|
|
|
43
67
|
return value === theme;
|
|
44
68
|
}) ? theme : 'themeS3';
|
|
45
69
|
};
|
|
70
|
+
|
|
46
71
|
var _useState = (0, _react.useState)(getTheme()),
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
72
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
73
|
+
theme = _useState2[0],
|
|
74
|
+
setTheme = _useState2[1];
|
|
75
|
+
|
|
50
76
|
var changeTheme = function changeTheme(theme) {
|
|
51
77
|
setTheme(theme);
|
|
52
78
|
(0, _storage.setThemeStore)(theme);
|
|
53
79
|
onChange(theme);
|
|
54
80
|
};
|
|
55
|
-
|
|
81
|
+
|
|
82
|
+
return React.createElement(Theme, null, React.createElement(_row["default"], {
|
|
56
83
|
type: "flex",
|
|
57
84
|
justify: "space-between",
|
|
58
85
|
className: "user-info-body-theme-row"
|
|
59
86
|
}, themes.map(function (_ref2) {
|
|
60
87
|
var value = _ref2.value,
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
return
|
|
88
|
+
label = _ref2.label,
|
|
89
|
+
enLabel = _ref2.enLabel;
|
|
90
|
+
return React.createElement("div", {
|
|
64
91
|
className: value,
|
|
65
92
|
onClick: changeTheme.bind(_this, value)
|
|
66
|
-
}, (0, _storage.getLanguageStore)() === 'en' ? enLabel : label, theme === value &&
|
|
93
|
+
}, (0, _storage.getLanguageStore)() === 'en' ? enLabel : label, theme === value && React.createElement("span", {
|
|
67
94
|
className: "icon-checked-wrap"
|
|
68
95
|
}));
|
|
69
96
|
})));
|
|
70
97
|
};
|
|
98
|
+
|
|
71
99
|
exports["default"] = _default;
|
|
@@ -4,34 +4,43 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = void 0;
|
|
7
|
+
|
|
7
8
|
var _styledComponents = require("styled-components");
|
|
9
|
+
|
|
8
10
|
var _Layout = _interopRequireDefault(require("../Layout"));
|
|
11
|
+
|
|
9
12
|
var _Avatar = _interopRequireDefault(require("./Avatar"));
|
|
13
|
+
|
|
10
14
|
var _storage = require("../storage");
|
|
15
|
+
|
|
11
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
12
|
-
|
|
13
|
-
function _extends() { _extends = Object.assign
|
|
14
|
-
|
|
15
|
-
function
|
|
16
|
-
|
|
17
|
-
function
|
|
18
|
-
|
|
17
|
+
|
|
18
|
+
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); }
|
|
19
|
+
|
|
20
|
+
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; }
|
|
21
|
+
|
|
22
|
+
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; }
|
|
23
|
+
|
|
24
|
+
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; }
|
|
25
|
+
|
|
19
26
|
var _default = (0, _styledComponents.withTheme)(function (props) {
|
|
20
27
|
var _props$userInfo = props.userInfo,
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
28
|
+
userInfo = _props$userInfo === void 0 ? {} : _props$userInfo,
|
|
29
|
+
_props$extendMap = props.extendMap,
|
|
30
|
+
extendMap = _props$extendMap === void 0 ? {} : _props$extendMap; // 企业级的默认蓝色主题
|
|
24
31
|
|
|
25
|
-
// 企业级的默认蓝色主题
|
|
26
32
|
var theme = (0, _storage.getThemeStore)() || (extendMap == null ? void 0 : extendMap.defaultTheme) || userInfo.theme || 'themeS3';
|
|
27
33
|
theme = theme === 'default' ? 'themeS3' : theme;
|
|
28
|
-
|
|
29
|
-
|
|
34
|
+
|
|
35
|
+
var newProps = _objectSpread({}, props, {
|
|
36
|
+
userInfo: _objectSpread({}, userInfo, {
|
|
30
37
|
theme: theme
|
|
31
38
|
})
|
|
32
39
|
});
|
|
33
|
-
|
|
40
|
+
|
|
41
|
+
return React.createElement(_Layout["default"], _extends({}, newProps, {
|
|
34
42
|
AvatarCustom: _Avatar["default"]
|
|
35
43
|
}));
|
|
36
44
|
});
|
|
45
|
+
|
|
37
46
|
exports["default"] = _default;
|