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
package/lib/Layout/SideMenu.js
CHANGED
|
@@ -1,83 +1,44 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(
|
|
4
|
-
|
|
3
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports["default"] = void 0;
|
|
9
|
-
|
|
10
8
|
require("antd/lib/menu/style");
|
|
11
|
-
|
|
12
9
|
var _menu = _interopRequireDefault(require("antd/lib/menu"));
|
|
13
|
-
|
|
14
10
|
var _react = require("react");
|
|
15
|
-
|
|
16
11
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
17
|
-
|
|
18
12
|
var _lodash = require("lodash");
|
|
19
|
-
|
|
20
13
|
var _ActionsContext = _interopRequireDefault(require("./ActionsContext"));
|
|
21
|
-
|
|
22
14
|
var _utils = require("../utils");
|
|
23
|
-
|
|
24
15
|
var _storage = require("./storage");
|
|
25
|
-
|
|
26
16
|
var _Iconfont = _interopRequireDefault(require("./Iconfont"));
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
function _interopRequireWildcard(
|
|
31
|
-
|
|
32
|
-
function
|
|
33
|
-
|
|
34
|
-
function
|
|
35
|
-
|
|
36
|
-
function
|
|
37
|
-
|
|
38
|
-
function
|
|
39
|
-
|
|
40
|
-
function
|
|
41
|
-
|
|
42
|
-
function
|
|
43
|
-
|
|
44
|
-
function
|
|
45
|
-
|
|
46
|
-
function
|
|
47
|
-
|
|
48
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); }
|
|
49
|
-
|
|
50
|
-
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; }
|
|
51
|
-
|
|
52
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
53
|
-
|
|
54
|
-
function _templateObject2() {
|
|
55
|
-
var data = _taggedTemplateLiteral(["\n font-size: 14px;\n .large-size & {\n font-size: 15px;\n }\n color: rgba(255,255,255,.85);\n .compatible & {\n color: #A1D7FF;\n }\n .tnt-themeS1 & {\n color: ", ";\n }\n .tnt-icon {\n margin-right: 12px;\n font-size: 16px;\n position: relative;\n top: 1px;\n\n .large-size & {\n font-size: 18px;\n top: auto;\n }\n .tnt-themeS1 & {\n /* color: #7e8081; */\n color: ", ";\n }\n }\n"]);
|
|
56
|
-
|
|
57
|
-
_templateObject2 = function _templateObject2() {
|
|
58
|
-
return data;
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
return data;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
function _templateObject() {
|
|
65
|
-
var data = _taggedTemplateLiteral(["\n background: none !important;\n &.ant-menu.ant-menu-root {\n position: relative;\n transition: none !important;\n padding-top: 10px;\n border-right: none;\n text-rendering: optimizeLegibility;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n height: calc(100vh - ", ");\n overflow-y: auto;\n overflow-x: hidden;\n .collapseIconPlacementBottom & {\n padding-bottom: 36px;\n }\n .tnt-themeS1 & {\n overflow-x: unset;\n box-shadow: 10px 0 10px -5px rgba(0,0,0,0.10);\n z-index: 2;\n }\n scrollbar-width: none;\n -ms-overflow-style: none;\n\n &::-webkit-scrollbar {\n display: none;\n }\n &::-moz-scrollbar {\n display: none;\n }\n\n /** \u4E00\u7EA7\u7ED3\u70B9\u662F\u83DC\u5355\u6837\u5F0F\u5F00\u59CB */\n & > .ant-menu-item {\n & > .tnt-icon:first-child {\n font-size: 16px\n }\n }\n\n .ant-layout-sider-collapsed & {\n & > .ant-menu-item {\n & > .tnt-icon:first-child {\n padding-left: 8px;\n }\n a {\n visibility: hidden;\n }\n }\n }\n /** \u4E00\u7EA7\u7ED3\u70B9\u662F\u83DC\u5355\u6837\u5F0F\u7ED3\u675F */\n\n .ant-menu-item:active,\n .ant-menu-submenu-title:active {\n background: none;\n }\n\n .ant-menu-submenu .ant-menu-sub {\n background: #212635;\n border-radius: 0 0 2px 2px;\n .compatible & {\n background: #07408d !important;\n }\n .tnt-themeS1 & {\n background: #fff !important;\n }\n\n // \u84DD\u8272\u7CFB\u5217 \u83DC\u5355\u5C55\u5F00\u533A\u57DF\u989C\u8272\n .tnt-themeS3 & {\n background: #07408D !important;\n }\n }\n .ant-menu-submenu.ant-menu-submenu-active,\n .ant-menu-submenu.ant-menu-submenu-selected {\n background: rgba(47,129,247,.25) !important;\n .tnt-themeS1 & {\n background: ", " !important;\n }\n\n // \u84DD\u8272\u7CFB \u4E00\u7EA7\u83DC\u5355\u7684\u9009\u4E2D\u6548\u679C\n .tnt-themeS3 & {\n background: #204085 !important;\n }\n }\n & > .ant-menu-submenu .ant-menu-submenu.ant-menu-submenu-active,\n & > .ant-menu-submenu .ant-menu-submenu.ant-menu-submenu-selected {\n background: none !important;\n .tnt-themeS1 & {\n background: ", " !important;\n }\n // \u84DD\u8272\u7CFB \u5B50\u7EA7\u83DC\u5355\u7EA7\u7684\u9009\u4E2D\u6548\u679C\n .tnt-themeS3 & {\n background: #204085 !important;\n }\n }\n .ant-menu-item {\n margin: 0;\n font-size: 14px;\n padding-left: 54px !important;\n height: ", ";\n line-height: ", ";\n }\n\n & > .ant-menu-item {\n padding-left: 24px !important;\n width: 100%;\n\n & > .tnt-icon {\n margin-right: 12px;\n }\n & > a {\n display: inline-block;\n }\n }\n\n .ant-menu-submenu-title {\n position: relative;\n color: ", ";\n .tnt-themeS1 & {\n color: ", ";\n }\n height: ", ";\n line-height: ", ";\n .tnt-icon {\n .tnt-themeS1 & {\n color: ", ";\n }\n }\n & > .tnt-icon {\n position: absolute;\n right: 20px;\n top: 1px;\n font-size: 10px;\n }\n\n // \u84DD\u8272\u7CFB\u4E3B\u9898\n .tnt-themeS3 & {\n color: #FFF;\n }\n .tnt-icon {\n .tnt-themeS3 & {\n color: #FFF;\n }\n }\n }\n\n & > .ant-menu-submenu .ant-menu-submenu .ant-menu-submenu-title {\n margin-top: 0;\n margin-bottom: 0;\n padding-left: 54px !important;\n }\n }\n\n &.ant-menu .menu-arrow-right {\n color: ", ";\n }\n\n .ant-menu-item, .ant-menu-item > a {\n color: ", ";\n .tnt-themeS1 & {\n color: ", ";\n }\n &:hover {\n color: #fff;\n .tnt-themeS1 & {\n color: ", ";\n }\n }\n\n // \u84DD\u8272\u7CFB\u5217\n .tnt-themeS3 & {\n color: #fff;\n }\n &:hover {\n .tnt-themeS3 & {\n color: #fff;\n }\n }\n }\n & > .ant-menu-item.ant-menu-item-selected,\n &.ant-menu:not(.ant-menu-horizontal) .ant-menu-item-selected {\n color: rgba(255,255,255,.85);\n background-color: ", ";\n .compatible & {\n background-color: #013479;\n }\n & > a {\n .tnt-themeS1 & {\n color: #fff;\n }\n }\n .tnt-themeS1 & {\n color: #fff;\n background-color: ", ";\n }\n\n // \u84DD\u8272\u7CFB \u5B50\u9879\u9009\u4E2D\u989C\u8272\n .tnt-themeS3 & {\n color: #fff;\n background: #013479;\n &::after{\n content:\"\";\n display:none;\n }\n }\n }\n .ant-menu-submenu.ant-menu-submenu-selected {\n .tnt-themeS2 & {\n background: #141825;\n }\n .tnt-themeS2.compatible & {\n background: rgba(47,129,247,.25) !important;\n }\n }\n"]);
|
|
66
|
-
|
|
67
|
-
_templateObject = function _templateObject() {
|
|
68
|
-
return data;
|
|
69
|
-
};
|
|
70
|
-
|
|
71
|
-
return data;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
75
|
-
|
|
17
|
+
var _excluded = ["code"];
|
|
18
|
+
var _templateObject, _templateObject2;
|
|
19
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
20
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
|
21
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
22
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
23
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
24
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
25
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
26
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
27
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
28
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
29
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
30
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
31
|
+
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."); }
|
|
32
|
+
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; } }
|
|
33
|
+
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; }
|
|
34
|
+
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; } }
|
|
35
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
36
|
+
function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
|
|
76
37
|
var color = 'rgba(255,255,255,.85)';
|
|
77
38
|
var compatibleColor = '#a1d7ff';
|
|
78
39
|
var SubMenu = _menu["default"].SubMenu,
|
|
79
|
-
|
|
80
|
-
var TNTMenu = (0, _styledComponents["default"])(_menu["default"])(_templateObject(), function (props) {
|
|
40
|
+
MenuItem = _menu["default"].Item;
|
|
41
|
+
var TNTMenu = (0, _styledComponents["default"])(_menu["default"])(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n background: none !important;\n &.ant-menu.ant-menu-root {\n position: relative;\n transition: none !important;\n padding-top: 10px;\n border-right: none;\n text-rendering: optimizeLegibility;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n height: calc(100vh - ", ");\n overflow-y: auto;\n overflow-x: hidden;\n .collapseIconPlacementBottom & {\n padding-bottom: 36px;\n }\n .tnt-themeS1 & {\n overflow-x: unset;\n box-shadow: 10px 0 10px -5px rgba(0,0,0,0.10);\n z-index: 2;\n }\n scrollbar-width: none;\n -ms-overflow-style: none;\n\n &::-webkit-scrollbar {\n display: none;\n }\n &::-moz-scrollbar {\n display: none;\n }\n\n /** \u4E00\u7EA7\u7ED3\u70B9\u662F\u83DC\u5355\u6837\u5F0F\u5F00\u59CB */\n & > .ant-menu-item {\n & > .tnt-icon:first-child {\n font-size: 16px\n }\n }\n\n .ant-layout-sider-collapsed & {\n & > .ant-menu-item {\n & > .tnt-icon:first-child {\n padding-left: 8px;\n }\n a {\n visibility: hidden;\n }\n }\n }\n /** \u4E00\u7EA7\u7ED3\u70B9\u662F\u83DC\u5355\u6837\u5F0F\u7ED3\u675F */\n\n .ant-menu-item:active,\n .ant-menu-submenu-title:active {\n background: none;\n }\n\n .ant-menu-submenu .ant-menu-sub {\n background: #212635;\n border-radius: 0 0 2px 2px;\n .compatible & {\n background: #07408d !important;\n }\n .tnt-themeS1 & {\n background: #fff !important;\n }\n\n // \u84DD\u8272\u7CFB\u5217 \u83DC\u5355\u5C55\u5F00\u533A\u57DF\u989C\u8272\n .tnt-themeS3 & {\n background: #07408D !important;\n }\n }\n .ant-menu-submenu.ant-menu-submenu-active,\n .ant-menu-submenu.ant-menu-submenu-selected {\n background: rgba(47,129,247,.25) !important;\n .tnt-themeS1 & {\n background: ", " !important;\n }\n\n // \u84DD\u8272\u7CFB \u4E00\u7EA7\u83DC\u5355\u7684\u9009\u4E2D\u6548\u679C\n .tnt-themeS3 & {\n background: #204085 !important;\n }\n }\n & > .ant-menu-submenu .ant-menu-submenu.ant-menu-submenu-active,\n & > .ant-menu-submenu .ant-menu-submenu.ant-menu-submenu-selected {\n background: none !important;\n .tnt-themeS1 & {\n background: ", " !important;\n }\n // \u84DD\u8272\u7CFB \u5B50\u7EA7\u83DC\u5355\u7EA7\u7684\u9009\u4E2D\u6548\u679C\n .tnt-themeS3 & {\n background: #204085 !important;\n }\n }\n .ant-menu-item {\n margin: 0;\n font-size: 14px;\n padding-left: 54px !important;\n height: ", ";\n line-height: ", ";\n }\n\n & > .ant-menu-item {\n padding-left: 24px !important;\n width: 100%;\n\n & > .tnt-icon {\n margin-right: 12px;\n }\n & > a {\n display: inline-block;\n }\n }\n\n .ant-menu-submenu-title {\n position: relative;\n color: ", ";\n .tnt-themeS1 & {\n color: ", ";\n }\n height: ", ";\n line-height: ", ";\n .tnt-icon {\n .tnt-themeS1 & {\n color: ", ";\n }\n }\n & > .tnt-icon {\n position: absolute;\n right: 20px;\n top: 1px;\n font-size: 10px;\n }\n\n // \u84DD\u8272\u7CFB\u4E3B\u9898\n .tnt-themeS3 & {\n color: #FFF;\n }\n .tnt-icon {\n .tnt-themeS3 & {\n color: #FFF;\n }\n }\n }\n\n & > .ant-menu-submenu .ant-menu-submenu .ant-menu-submenu-title {\n margin-top: 0;\n margin-bottom: 0;\n padding-left: 54px !important;\n }\n }\n\n &.ant-menu .menu-arrow-right {\n color: ", ";\n }\n\n .ant-menu-item, .ant-menu-item > a {\n color: ", ";\n .tnt-themeS1 & {\n color: ", ";\n }\n &:hover {\n color: #fff;\n .tnt-themeS1 & {\n color: ", ";\n }\n }\n\n // \u84DD\u8272\u7CFB\u5217\n .tnt-themeS3 & {\n color: #fff;\n }\n &:hover {\n .tnt-themeS3 & {\n color: #fff;\n }\n }\n }\n & > .ant-menu-item.ant-menu-item-selected,\n &.ant-menu:not(.ant-menu-horizontal) .ant-menu-item-selected {\n color: rgba(255,255,255,.85);\n background-color: ", ";\n .compatible & {\n background-color: #013479;\n }\n & > a {\n .tnt-themeS1 & {\n color: #fff;\n }\n }\n .tnt-themeS1 & {\n color: #fff;\n background-color: ", ";\n }\n\n // \u84DD\u8272\u7CFB \u5B50\u9879\u9009\u4E2D\u989C\u8272\n .tnt-themeS3 & {\n color: #fff;\n background: #013479;\n &::after{\n content:\"\";\n display:none;\n }\n }\n }\n .ant-menu-submenu.ant-menu-submenu-selected {\n .tnt-themeS2 & {\n background: #141825;\n }\n .tnt-themeS2.compatible & {\n background: rgba(47,129,247,.25) !important;\n }\n }\n"])), function (props) {
|
|
81
42
|
return "".concat(props.theme.headerHeight, "px");
|
|
82
43
|
}, function (props) {
|
|
83
44
|
return props.theme.dividerColor;
|
|
@@ -114,83 +75,66 @@ var TNTMenu = (0, _styledComponents["default"])(_menu["default"])(_templateObjec
|
|
|
114
75
|
}, function (props) {
|
|
115
76
|
return props.theme.primaryColor;
|
|
116
77
|
});
|
|
117
|
-
|
|
118
|
-
var MenuTitle = _styledComponents["default"].span(_templateObject2(), function (props) {
|
|
78
|
+
var MenuTitle = _styledComponents["default"].span(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n font-size: 14px;\n .large-size & {\n font-size: 15px;\n }\n color: rgba(255,255,255,.85);\n .compatible & {\n color: #A1D7FF;\n }\n .tnt-themeS1 & {\n color: ", ";\n }\n .tnt-icon {\n margin-right: 12px;\n font-size: 16px;\n position: relative;\n top: 1px;\n\n .large-size & {\n font-size: 18px;\n top: auto;\n }\n .tnt-themeS1 & {\n /* color: #7e8081; */\n color: ", ";\n }\n }\n"])), function (props) {
|
|
119
79
|
return props.theme.primaryTextColor;
|
|
120
80
|
}, function (props) {
|
|
121
81
|
return "".concat(props.theme.iconColor);
|
|
122
82
|
});
|
|
123
|
-
|
|
124
|
-
var _default = (0, _styledComponents.withTheme)(function (props) {
|
|
83
|
+
var _default = exports["default"] = (0, _styledComponents.withTheme)(function (props) {
|
|
125
84
|
var actions = (0, _react.useContext)(_ActionsContext["default"]);
|
|
126
85
|
var language = props.language,
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
86
|
+
_props$menus = props.menus,
|
|
87
|
+
menus = _props$menus === void 0 ? [] : _props$menus,
|
|
88
|
+
formatMenuPath = props.formatMenuPath,
|
|
89
|
+
changeRouter = props.changeRouter,
|
|
90
|
+
selectedKey = props.selectedKey,
|
|
91
|
+
openKeys = props.openKeys,
|
|
92
|
+
onSelect = props.onSelect,
|
|
93
|
+
onBeforeChange = props.onBeforeChange,
|
|
94
|
+
onChange = props.onChange,
|
|
95
|
+
onOpenChange = props.onOpenChange,
|
|
96
|
+
collapsed = props.collapsed;
|
|
139
97
|
var _getSelectedMenuInfo = (0, _utils.getSelectedMenuInfo)(selectedKey, menus),
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
98
|
+
subMenu = _getSelectedMenuInfo.subMenu,
|
|
99
|
+
parentMenus = _getSelectedMenuInfo.parentMenus;
|
|
143
100
|
var _useState = (0, _react.useState)([(0, _lodash.get)(subMenu, 'code')]),
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
101
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
102
|
+
selectedKeys = _useState2[0],
|
|
103
|
+
setSelectedKeys = _useState2[1];
|
|
148
104
|
var onSelectMenu = function onSelectMenu(param) {
|
|
149
105
|
var _ref5 = (0, _utils.getSelectedMenuInfo)(param.key, menus) || {},
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
var params = _objectSpread({}, param, {
|
|
106
|
+
subMenu = _ref5.subMenu,
|
|
107
|
+
parentMenus = _ref5.parentMenus;
|
|
108
|
+
var params = _objectSpread(_objectSpread({}, param), {}, {
|
|
154
109
|
data: subMenu
|
|
155
110
|
});
|
|
156
|
-
|
|
157
111
|
var defaultBeforeChange = function defaultBeforeChange(_ref6) {
|
|
158
112
|
var data = _ref6.data;
|
|
159
113
|
return !(0, _utils.isNewTabMenu)(data);
|
|
160
114
|
};
|
|
161
|
-
|
|
162
115
|
var defaultSelect = function defaultSelect(_ref7) {
|
|
163
116
|
var _window$location$path;
|
|
164
|
-
|
|
165
117
|
var data = _ref7.data;
|
|
166
|
-
|
|
167
118
|
var _ref8 = data || {},
|
|
168
|
-
|
|
169
|
-
|
|
119
|
+
path = _ref8.path;
|
|
170
120
|
var formatPath = formatMenuPath || function (path) {
|
|
171
121
|
return path;
|
|
172
122
|
};
|
|
173
|
-
|
|
174
123
|
if ((0, _utils.isNewTabMenu)(data)) {
|
|
175
124
|
(0, _utils.openInNewTab)(formatPath(data == null ? void 0 : data.path, data));
|
|
176
125
|
return;
|
|
177
126
|
}
|
|
178
|
-
|
|
179
127
|
var routerPrefix = (_window$location$path = window.location.pathname.match(/(^\/[^\/]+)/i)) == null ? void 0 : _window$location$path[1];
|
|
180
|
-
|
|
181
|
-
if (path == null ? void 0 : path.startsWith(routerPrefix)) {
|
|
128
|
+
if (path != null && path.startsWith(routerPrefix)) {
|
|
182
129
|
var forwardPath = formatPath(path, data);
|
|
183
130
|
changeRouter ? changeRouter(forwardPath, data) : window.history.pushState(data, data == null ? void 0 : data.name, forwardPath);
|
|
184
131
|
} else {
|
|
185
132
|
window.location.href = formatPath(path, data);
|
|
186
133
|
}
|
|
187
134
|
};
|
|
188
|
-
|
|
189
135
|
var finalSelect = onSelect || defaultSelect;
|
|
190
|
-
|
|
191
136
|
if (param.key !== (0, _lodash.get)(selectedKeys, '0')) {
|
|
192
137
|
var finalBeforeChange = onBeforeChange || defaultBeforeChange;
|
|
193
|
-
|
|
194
138
|
if (finalBeforeChange(params, (0, _lodash.get)(selectedKeys, '0'))) {
|
|
195
139
|
// SideMenu菜单收起状态
|
|
196
140
|
if (collapsed) {
|
|
@@ -204,32 +148,26 @@ var _default = (0, _styledComponents.withTheme)(function (props) {
|
|
|
204
148
|
beforeOpenKeys: newOpenKeys
|
|
205
149
|
});
|
|
206
150
|
}
|
|
207
|
-
|
|
208
151
|
setSelectedKeys([param.key]);
|
|
209
152
|
onChange && onChange(params);
|
|
210
153
|
}
|
|
211
154
|
}
|
|
212
|
-
|
|
213
155
|
actions.setSelectedMenuKey(param.key);
|
|
214
156
|
setSelectedKeys([param.key]);
|
|
215
157
|
finalSelect(params);
|
|
216
158
|
};
|
|
217
|
-
|
|
218
159
|
var getExpandIcon = function getExpandIcon(code) {
|
|
219
160
|
if (props.theme.compatible) {
|
|
220
161
|
return openKeys.includes(code) ? 'minus' : 'plus';
|
|
221
162
|
}
|
|
222
|
-
|
|
223
163
|
return openKeys.includes(code) ? 'up' : 'down';
|
|
224
164
|
};
|
|
225
|
-
|
|
226
165
|
var onOpenKeysChange = function onOpenKeysChange(keys) {
|
|
227
166
|
var openKey = keys.find(function (key) {
|
|
228
167
|
return !openKeys.includes(key);
|
|
229
|
-
});
|
|
230
|
-
|
|
168
|
+
});
|
|
169
|
+
// const closeKey = openKeys.find(key => !keys.includes(key));
|
|
231
170
|
var newOpenKeys = keys;
|
|
232
|
-
|
|
233
171
|
var findParentGroupKey = function findParentGroupKey(key, openKeys) {
|
|
234
172
|
var parentGroupKey;
|
|
235
173
|
(0, _utils.traverseTree)(menus, function (node, pnode) {
|
|
@@ -237,18 +175,16 @@ var _default = (0, _styledComponents.withTheme)(function (props) {
|
|
|
237
175
|
if (pnode && openKeys.includes(pnode == null ? void 0 : pnode.code)) {
|
|
238
176
|
parentGroupKey = pnode == null ? void 0 : pnode.code;
|
|
239
177
|
}
|
|
240
|
-
|
|
241
178
|
return false;
|
|
242
179
|
}
|
|
243
180
|
});
|
|
244
181
|
return parentGroupKey;
|
|
245
|
-
};
|
|
246
|
-
|
|
182
|
+
};
|
|
247
183
|
|
|
184
|
+
// 展开openKey
|
|
248
185
|
if (openKey) {
|
|
249
186
|
// 父子关系展开
|
|
250
187
|
var parentGroupKey = findParentGroupKey(openKey, openKeys);
|
|
251
|
-
|
|
252
188
|
if (parentGroupKey) {
|
|
253
189
|
newOpenKeys = keys.length > 2 ? [parentGroupKey, openKey] : keys;
|
|
254
190
|
} else {
|
|
@@ -258,25 +194,21 @@ var _default = (0, _styledComponents.withTheme)(function (props) {
|
|
|
258
194
|
// 收起closeKey
|
|
259
195
|
newOpenKeys = keys;
|
|
260
196
|
}
|
|
261
|
-
|
|
262
197
|
onOpenChange(newOpenKeys);
|
|
263
198
|
};
|
|
264
|
-
|
|
265
199
|
(0, _react.useEffect)(function () {
|
|
266
200
|
setSelectedKeys([selectedKey]);
|
|
267
|
-
|
|
268
|
-
if (selectedKey && !collapsed && (parentMenus == null ? void 0 : parentMenus.length)) {
|
|
201
|
+
if (selectedKey && !collapsed && parentMenus != null && parentMenus.length) {
|
|
269
202
|
onOpenChange(parentMenus == null ? void 0 : parentMenus.map(function (_ref10) {
|
|
270
203
|
var code = _ref10.code;
|
|
271
204
|
return code;
|
|
272
205
|
}).reverse());
|
|
273
206
|
}
|
|
274
|
-
|
|
275
207
|
actions.setSelectedMenuKey(selectedKey);
|
|
276
208
|
}, [selectedKey]);
|
|
277
209
|
actions.off('menuSelect', onSelectMenu);
|
|
278
210
|
actions.on('menuSelect', onSelectMenu);
|
|
279
|
-
return React.createElement(TNTMenu, {
|
|
211
|
+
return /*#__PURE__*/React.createElement(TNTMenu, {
|
|
280
212
|
mode: "inline",
|
|
281
213
|
defaultSelectedKeys: [],
|
|
282
214
|
openKeys: openKeys,
|
|
@@ -285,9 +217,9 @@ var _default = (0, _styledComponents.withTheme)(function (props) {
|
|
|
285
217
|
}, menus == null ? void 0 : menus.map(function (menu) {
|
|
286
218
|
var MenuLink = function MenuLink(_ref11) {
|
|
287
219
|
var menuName = _ref11.menuName,
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
return React.createElement("a", {
|
|
220
|
+
enName = _ref11.enName,
|
|
221
|
+
path = _ref11.path;
|
|
222
|
+
return /*#__PURE__*/React.createElement("a", {
|
|
291
223
|
href: path,
|
|
292
224
|
onClick: function onClick(evt) {
|
|
293
225
|
return evt.preventDefault();
|
|
@@ -297,71 +229,60 @@ var _default = (0, _styledComponents.withTheme)(function (props) {
|
|
|
297
229
|
en: enName
|
|
298
230
|
}[language]);
|
|
299
231
|
};
|
|
300
|
-
|
|
301
232
|
if ((0, _utils.isGroupMenu)(menu)) {
|
|
302
233
|
var _menu$children;
|
|
303
|
-
|
|
304
234
|
var getSubMenuProps = function getSubMenuProps(_ref12) {
|
|
305
235
|
var code = _ref12.code,
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
236
|
+
groupIcon = _ref12.groupIcon,
|
|
237
|
+
groupName = _ref12.groupName,
|
|
238
|
+
enName = _ref12.enName;
|
|
309
239
|
var isSubGroup = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
310
240
|
return {
|
|
311
241
|
key: code,
|
|
312
|
-
title: React.createElement(MenuTitle, {
|
|
242
|
+
title: /*#__PURE__*/React.createElement(MenuTitle, {
|
|
313
243
|
style: collapsed && isSubGroup ? {
|
|
314
244
|
color: props.theme.primaryTextColor
|
|
315
245
|
} : {}
|
|
316
|
-
}, !isSubGroup && React.createElement(_Iconfont["default"], {
|
|
246
|
+
}, !isSubGroup && /*#__PURE__*/React.createElement(_Iconfont["default"], {
|
|
317
247
|
type: groupIcon
|
|
318
248
|
}), collapsed && !isSubGroup ? '' : {
|
|
319
249
|
cn: groupName,
|
|
320
250
|
en: enName
|
|
321
251
|
}[language]),
|
|
322
|
-
expandIcon: collapsed ? null : React.createElement(_Iconfont["default"]
|
|
323
|
-
/* */
|
|
324
|
-
, {
|
|
252
|
+
expandIcon: collapsed ? null : /*#__PURE__*/React.createElement(_Iconfont["default"] /* */, {
|
|
325
253
|
type: getExpandIcon(code)
|
|
326
254
|
})
|
|
327
255
|
};
|
|
328
256
|
};
|
|
329
|
-
|
|
330
|
-
return React.createElement(SubMenu, _extends({}, getSubMenuProps(menu), {
|
|
257
|
+
return /*#__PURE__*/React.createElement(SubMenu, _extends({}, getSubMenuProps(menu), {
|
|
331
258
|
onClick: onSelectMenu
|
|
332
259
|
}), menu == null ? void 0 : (_menu$children = menu.children) == null ? void 0 : _menu$children.map(function (menu) {
|
|
333
260
|
if ((0, _utils.isGroupMenu)(menu)) {
|
|
334
261
|
var _menu$children2;
|
|
335
|
-
|
|
336
|
-
return React.createElement(SubMenu, _extends({}, getSubMenuProps(menu, true), {
|
|
262
|
+
return /*#__PURE__*/React.createElement(SubMenu, _extends({}, getSubMenuProps(menu, true), {
|
|
337
263
|
onClick: onSelectMenu
|
|
338
264
|
}), menu == null ? void 0 : (_menu$children2 = menu.children) == null ? void 0 : _menu$children2.map(function (_ref13) {
|
|
339
265
|
var code = _ref13.code,
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
return React.createElement(MenuItem, {
|
|
266
|
+
menu = _objectWithoutProperties(_ref13, _excluded);
|
|
267
|
+
return /*#__PURE__*/React.createElement(MenuItem, {
|
|
343
268
|
key: code
|
|
344
|
-
}, React.createElement(MenuLink, _extends({}, menu, {
|
|
269
|
+
}, /*#__PURE__*/React.createElement(MenuLink, _extends({}, menu, {
|
|
345
270
|
style: {
|
|
346
271
|
paddingLeft: '24px'
|
|
347
272
|
}
|
|
348
273
|
})));
|
|
349
274
|
}));
|
|
350
275
|
}
|
|
351
|
-
|
|
352
|
-
return React.createElement(MenuItem, {
|
|
276
|
+
return /*#__PURE__*/React.createElement(MenuItem, {
|
|
353
277
|
key: menu == null ? void 0 : menu.code
|
|
354
|
-
}, React.createElement(MenuLink, menu));
|
|
278
|
+
}, /*#__PURE__*/React.createElement(MenuLink, menu));
|
|
355
279
|
}));
|
|
356
280
|
}
|
|
357
|
-
|
|
358
|
-
return React.createElement(MenuItem, {
|
|
281
|
+
return /*#__PURE__*/React.createElement(MenuItem, {
|
|
359
282
|
key: menu.code,
|
|
360
283
|
onClick: onSelectMenu
|
|
361
|
-
}, React.createElement(_Iconfont["default"], {
|
|
284
|
+
}, /*#__PURE__*/React.createElement(_Iconfont["default"], {
|
|
362
285
|
type: menu.icon
|
|
363
|
-
}), React.createElement(MenuLink, menu));
|
|
286
|
+
}), /*#__PURE__*/React.createElement(MenuLink, menu));
|
|
364
287
|
}));
|
|
365
|
-
});
|
|
366
|
-
|
|
367
|
-
exports["default"] = _default;
|
|
288
|
+
});
|
package/lib/Layout/Theme.js
CHANGED
|
@@ -4,71 +4,28 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = void 0;
|
|
7
|
-
|
|
8
7
|
require("antd/lib/popover/style");
|
|
9
|
-
|
|
10
8
|
var _popover = _interopRequireDefault(require("antd/lib/popover"));
|
|
11
|
-
|
|
12
9
|
var _react = require("react");
|
|
13
|
-
|
|
14
10
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
15
|
-
|
|
16
11
|
var _Iconfont = _interopRequireDefault(require("./Iconfont"));
|
|
17
|
-
|
|
18
12
|
var _images = _interopRequireDefault(require("./images"));
|
|
19
|
-
|
|
20
13
|
var _storage = require("./storage");
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
function _slicedToArray(
|
|
27
|
-
|
|
28
|
-
function
|
|
29
|
-
|
|
30
|
-
function _iterableToArrayLimit(
|
|
31
|
-
|
|
32
|
-
function
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
_templateObject3 = function _templateObject3() {
|
|
38
|
-
return data;
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
return data;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
function _templateObject2() {
|
|
45
|
-
var data = _taggedTemplateLiteral(["\n & > div {\n position: relative;\n display: inline-block;\n cursor: pointer;\n &:first-child {\n margin-right: 10px;\n }\n &:last-child {\n margin-left: 10px;\n }\n & > i, & > .tnt-icon {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n }\n }\n"]);
|
|
46
|
-
|
|
47
|
-
_templateObject2 = function _templateObject2() {
|
|
48
|
-
return data;
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
return data;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
function _templateObject() {
|
|
55
|
-
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"]);
|
|
56
|
-
|
|
57
|
-
_templateObject = function _templateObject() {
|
|
58
|
-
return data;
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
return data;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
65
|
-
|
|
66
|
-
var Theme = _styledComponents["default"].li(_templateObject());
|
|
67
|
-
|
|
68
|
-
var ThemeSwitch = _styledComponents["default"].div(_templateObject2());
|
|
69
|
-
|
|
70
|
-
var ThemeContentWrapper = _styledComponents["default"].div(_templateObject3());
|
|
71
|
-
|
|
14
|
+
var _templateObject,
|
|
15
|
+
_templateObject2,
|
|
16
|
+
_templateObject3,
|
|
17
|
+
_this = void 0;
|
|
18
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
19
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
20
|
+
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."); }
|
|
21
|
+
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; } }
|
|
22
|
+
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; }
|
|
23
|
+
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; } }
|
|
24
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
25
|
+
function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
|
|
26
|
+
var Theme = _styledComponents["default"].li(_templateObject || (_templateObject = _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"])));
|
|
27
|
+
var ThemeSwitch = _styledComponents["default"].div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n & > div {\n position: relative;\n display: inline-block;\n cursor: pointer;\n &:first-child {\n margin-right: 10px;\n }\n &:last-child {\n margin-left: 10px;\n }\n & > i, & > .tnt-icon {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n }\n }\n"])));
|
|
28
|
+
var ThemeContentWrapper = _styledComponents["default"].div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n z-index: 1;\n background-color: #fff;\n border-radius: 4px;\n width: 156px;\n"])));
|
|
72
29
|
var themes = [{
|
|
73
30
|
value: 'themeS1',
|
|
74
31
|
img: _images["default"].themeSymbol1
|
|
@@ -76,10 +33,8 @@ var themes = [{
|
|
|
76
33
|
value: 'themeS2',
|
|
77
34
|
img: _images["default"].themeSymbol2
|
|
78
35
|
}];
|
|
79
|
-
|
|
80
36
|
var ThemeContent = function ThemeContent(props) {
|
|
81
37
|
var onChange = props.onChange;
|
|
82
|
-
|
|
83
38
|
var getTheme = function getTheme() {
|
|
84
39
|
var theme = (0, _storage.getThemeStore)() || props.theme || 'themeS2';
|
|
85
40
|
return themes.some(function (_ref) {
|
|
@@ -87,41 +42,35 @@ var ThemeContent = function ThemeContent(props) {
|
|
|
87
42
|
return value === theme;
|
|
88
43
|
}) ? theme : 'themeS2';
|
|
89
44
|
};
|
|
90
|
-
|
|
91
45
|
var _useState = (0, _react.useState)(getTheme()),
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
46
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
47
|
+
theme = _useState2[0],
|
|
48
|
+
setTheme = _useState2[1];
|
|
96
49
|
var changeTheme = function changeTheme(theme) {
|
|
97
50
|
setTheme(theme);
|
|
98
51
|
(0, _storage.setThemeStore)(theme);
|
|
99
52
|
onChange(theme);
|
|
100
53
|
};
|
|
101
|
-
|
|
102
|
-
return React.createElement(ThemeContentWrapper, null, React.createElement(ThemeSwitch, null, themes.map(function (_ref2) {
|
|
54
|
+
return /*#__PURE__*/React.createElement(ThemeContentWrapper, null, /*#__PURE__*/React.createElement(ThemeSwitch, null, themes.map(function (_ref2) {
|
|
103
55
|
var value = _ref2.value,
|
|
104
|
-
|
|
105
|
-
return React.createElement("div", {
|
|
56
|
+
img = _ref2.img;
|
|
57
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
106
58
|
key: value,
|
|
107
59
|
onClick: changeTheme.bind(_this, value)
|
|
108
|
-
}, React.createElement("img", {
|
|
60
|
+
}, /*#__PURE__*/React.createElement("img", {
|
|
109
61
|
src: img
|
|
110
|
-
}), theme === value && React.createElement(_Iconfont["default"], {
|
|
62
|
+
}), theme === value && /*#__PURE__*/React.createElement(_Iconfont["default"], {
|
|
111
63
|
type: "check1"
|
|
112
64
|
}));
|
|
113
65
|
})));
|
|
114
66
|
};
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
return React.createElement(Theme, null, React.createElement(_popover["default"], {
|
|
67
|
+
var _default = exports["default"] = function _default(props) {
|
|
68
|
+
return /*#__PURE__*/React.createElement(Theme, null, /*#__PURE__*/React.createElement(_popover["default"], {
|
|
118
69
|
placement: "bottomRight",
|
|
119
70
|
title: null,
|
|
120
|
-
content: React.createElement(ThemeContent, props),
|
|
71
|
+
content: /*#__PURE__*/React.createElement(ThemeContent, props),
|
|
121
72
|
trigger: "click"
|
|
122
|
-
}, React.createElement(_Iconfont["default"], {
|
|
73
|
+
}, /*#__PURE__*/React.createElement(_Iconfont["default"], {
|
|
123
74
|
type: "change-theme"
|
|
124
75
|
})));
|
|
125
|
-
};
|
|
126
|
-
|
|
127
|
-
exports["default"] = _default;
|
|
76
|
+
};
|
|
@@ -4,14 +4,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = void 0;
|
|
7
|
-
|
|
8
7
|
var _eventemitter = _interopRequireDefault(require("eventemitter3"));
|
|
9
|
-
|
|
10
8
|
var _locale = require("../locale");
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
var _default = function _default(params) {
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
10
|
+
var _default = exports["default"] = function _default(params) {
|
|
15
11
|
var eventEmitter = new _eventemitter["default"]();
|
|
16
12
|
var data = {
|
|
17
13
|
language: (params == null ? void 0 : params.language) || 'cn',
|
|
@@ -47,6 +43,4 @@ var _default = function _default(params) {
|
|
|
47
43
|
eventEmitter.removeListener.apply(eventEmitter, arguments);
|
|
48
44
|
}
|
|
49
45
|
};
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
exports["default"] = _default;
|
|
46
|
+
};
|