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
@@ -8,18 +8,59 @@ import "antd/lib/menu/style";
8
8
  import _Menu from "antd/lib/menu";
9
9
  import "antd/lib/select/style";
10
10
  import _Select from "antd/lib/select";
11
- var _templateObject,
12
- _templateObject2,
13
- _templateObject3,
14
- _templateObject4,
15
- _this = this;
16
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
17
- 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."); }
18
- 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); }
19
- 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; }
20
- 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; } }
11
+
12
+ var _this = this;
13
+
14
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }
15
+
16
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); }
17
+
18
+ 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; }
19
+
21
20
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
21
+
22
+ function _templateObject4() {
23
+ var data = _taggedTemplateLiteral(["\n display: block;\n color: #666;\n line-height: ", ";\n font-size: ", ";\n\n .tnt-themeS1 & {\n color: rgba(255,255,255,.85);\n }\n &:hover {\n color: #666;\n }\n i {\n margin-left: 12px;\n }\n"]);
24
+
25
+ _templateObject4 = function _templateObject4() {
26
+ return data;
27
+ };
28
+
29
+ return data;
30
+ }
31
+
32
+ function _templateObject3() {
33
+ var data = _taggedTemplateLiteral(["\n min-width: 160px;\n height: 28px;\n line-height: 28;\n position: relative;\n top: 50%;\n transform: translateY(-50%);\n"]);
34
+
35
+ _templateObject3 = function _templateObject3() {
36
+ return data;
37
+ };
38
+
39
+ return data;
40
+ }
41
+
42
+ function _templateObject2() {
43
+ var data = _taggedTemplateLiteral(["\n min-width: 160px;\n height: 28px;\n line-height: 28;\n position: relative;\n top: 50%;\n transform: translateY(-50%);\n .ant-select-selection, .ant-select-selection__rendered {\n line-height: 28px;\n height: 28px;\n }\n\n .ant-select-selection {\n .hasHeaderTabs & {\n border-radius: 14px;\n font-size: 12px;\n // \u53BB\u6389\u9ED8\u8BA4\u9ED1\u8272\n // background: #191D29;\n // border: 1px solid rgba(186,189,197,0.60);\n // color: rgba(255,255,255,.8);\n // \u7EDF\u4E00\u4E3A\u6D45\u8272\u8C03\n background: #fff !important;\n border-color: #c9d2dd !important;\n color: #8b919e !important;\n }\n // \u7EDF\u4E00\u8272\u8C03\n // .tnt-themeS1.hasHeaderTabs & {\n // /* background: #141825; */\n // /* color: rgba(255,255,255,.85); */\n // background: #fff;\n // border-color: #c9d2dd;\n // color: #8b919e;\n // }\n\n // .tnt-themeS3.hasHeaderTabs &{\n // background: ", "; //#1D4295\n // color: rgba(255,255,255,0.8);\n // border-color: rgba(255,255,255,0.5);\n // }\n }\n\n .ant-select-arrow {\n .hasHeaderTabs & {\n color: #B2BECD;\n }\n .tnt-themeS1 & {\n /* color: rgba(255,255,255,.85); */\n }\n }\n\n .tnt-themeS1 & {\n border-radius: 2px;\n }\n\n .isInIframe & {\n margin-left: 20px;\n }\n"]);
44
+
45
+ _templateObject2 = function _templateObject2() {
46
+ return data;
47
+ };
48
+
49
+ return data;
50
+ }
51
+
52
+ function _templateObject() {
53
+ var data = _taggedTemplateLiteral(["\n border-radius: 0;\n min-width: 250px;\n max-height: 350px;\n overflow-y: auto;\n border: 1px solid #ccc;\n box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2) !important;\n .ant-dropdown-menu-item {\n padding: 0 20px;\n height: 44px;\n line-height: 44px;\n &:hover {\n background: rgba(0, 0, 0, 0.1);\n }\n &.app-search-warp {\n padding: 0;\n &:hover {\n background: none;\n }\n .ant-input-affix-wrapper {\n height: 100%;\n }\n .ant-input {\n border: none;\n border-bottom: 1px dashed #dcdcdc;\n box-shadow: none;\n padding: 0 20px;\n }\n }\n i {\n margin-right: 0 !important;\n margin-left: 6px !important;\n }\n }\n .isInIframe & {\n margin-left: 20px;\n }\n"]);
54
+
55
+ _templateObject = function _templateObject() {
56
+ return data;
57
+ };
58
+
59
+ return data;
60
+ }
61
+
22
62
  function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
63
+
23
64
  import { useState, useEffect } from 'react';
24
65
  import styled, { withTheme } from 'styled-components';
25
66
  import { get } from 'lodash';
@@ -27,25 +68,26 @@ import Icon from '../Icon';
27
68
  import { getCurrentAppStore, setCurrentAppStore } from './storage';
28
69
  import { traverseTree } from '../utils';
29
70
  var Option = _Select.Option;
30
- var MenuList = styled(_Menu)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n border-radius: 0;\n min-width: 250px;\n max-height: 350px;\n overflow-y: auto;\n border: 1px solid #ccc;\n box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2) !important;\n .ant-dropdown-menu-item {\n padding: 0 20px;\n height: 44px;\n line-height: 44px;\n &:hover {\n background: rgba(0, 0, 0, 0.1);\n }\n &.app-search-warp {\n padding: 0;\n &:hover {\n background: none;\n }\n .ant-input-affix-wrapper {\n height: 100%;\n }\n .ant-input {\n border: none;\n border-bottom: 1px dashed #dcdcdc;\n box-shadow: none;\n padding: 0 20px;\n }\n }\n i {\n margin-right: 0 !important;\n margin-left: 6px !important;\n }\n }\n .isInIframe & {\n margin-left: 20px;\n }\n"])));
71
+ var MenuList = styled(_Menu)(_templateObject()); // 新版UI
31
72
 
32
- // 新版UI
33
- var AppsSelect = styled(_Select)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n min-width: 160px;\n height: 28px;\n line-height: 28;\n position: relative;\n top: 50%;\n transform: translateY(-50%);\n .ant-select-selection, .ant-select-selection__rendered {\n line-height: 28px;\n height: 28px;\n }\n\n .ant-select-selection {\n .hasHeaderTabs & {\n border-radius: 14px;\n font-size: 12px;\n // \u53BB\u6389\u9ED8\u8BA4\u9ED1\u8272\n // background: #191D29;\n // border: 1px solid rgba(186,189,197,0.60);\n // color: rgba(255,255,255,.8);\n // \u7EDF\u4E00\u4E3A\u6D45\u8272\u8C03\n background: #fff !important;\n border-color: #c9d2dd !important;\n color: #8b919e !important;\n }\n // \u7EDF\u4E00\u8272\u8C03\n // .tnt-themeS1.hasHeaderTabs & {\n // /* background: #141825; */\n // /* color: rgba(255,255,255,.85); */\n // background: #fff;\n // border-color: #c9d2dd;\n // color: #8b919e;\n // }\n\n // .tnt-themeS3.hasHeaderTabs &{\n // background: ", "; //#1D4295\n // color: rgba(255,255,255,0.8);\n // border-color: rgba(255,255,255,0.5);\n // }\n }\n\n .ant-select-arrow {\n .hasHeaderTabs & {\n color: #B2BECD;\n }\n .tnt-themeS1 & {\n /* color: rgba(255,255,255,.85); */\n }\n }\n\n .tnt-themeS1 & {\n border-radius: 2px;\n }\n\n .isInIframe & {\n margin-left: 20px;\n }\n"])), function (props) {
73
+ var AppsSelect = styled(_Select)(_templateObject2(), function (props) {
34
74
  return "".concat(props.theme.blueBgColor, " !important");
35
75
  });
36
- var AppTreeSelect = styled(_TreeSelect)(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n min-width: 160px;\n height: 28px;\n line-height: 28;\n position: relative;\n top: 50%;\n transform: translateY(-50%);\n"])));
37
- var SwitchAppMenu = styled.a(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n display: block;\n color: #666;\n line-height: ", ";\n font-size: ", ";\n\n .tnt-themeS1 & {\n color: rgba(255,255,255,.85);\n }\n &:hover {\n color: #666;\n }\n i {\n margin-left: 12px;\n }\n"])), function (props) {
76
+ var AppTreeSelect = styled(_TreeSelect)(_templateObject3());
77
+ var SwitchAppMenu = styled.a(_templateObject4(), function (props) {
38
78
  return "".concat(props.theme.headerHeight, "px");
39
79
  }, function (props) {
40
80
  return "".concat(props.theme.size === 'large' ? 16 : 14, "px");
41
81
  });
42
82
  export default withTheme(function (props) {
43
83
  var selectedKey = props.selectedKey,
44
- _props$items = props.items,
45
- items = _props$items === void 0 ? [] : _props$items,
46
- onChange = props.onChange;
84
+ _props$items = props.items,
85
+ items = _props$items === void 0 ? [] : _props$items,
86
+ onChange = props.onChange;
87
+
47
88
  var getInitialSelectedApp = function getInitialSelectedApp() {
48
89
  var currentAppStore = getCurrentAppStore();
90
+
49
91
  var findAppByKey = function findAppByKey(selectedKey) {
50
92
  var findApp;
51
93
  traverseTree(items, function (item) {
@@ -56,29 +98,34 @@ export default withTheme(function (props) {
56
98
  });
57
99
  return findApp;
58
100
  };
101
+
59
102
  var currentApp = findAppByKey(selectedKey || get(currentAppStore, 'key'));
60
103
  return currentApp || items[0];
61
104
  };
105
+
62
106
  var changeApp = function changeApp(app) {
63
107
  setSelectedApp(app);
64
108
  setCurrentAppStore(app);
65
109
  onChange && onChange(app);
66
110
  };
111
+
67
112
  var _useState = useState(),
68
- _useState2 = _slicedToArray(_useState, 2),
69
- searchValue = _useState2[0],
70
- setSearchValue = _useState2[1];
113
+ _useState2 = _slicedToArray(_useState, 2),
114
+ searchValue = _useState2[0],
115
+ setSearchValue = _useState2[1];
116
+
71
117
  var _useState3 = useState(getInitialSelectedApp()),
72
- _useState4 = _slicedToArray(_useState3, 2),
73
- selectedApp = _useState4[0],
74
- setSelectedApp = _useState4[1];
75
- var Menus = /*#__PURE__*/React.createElement(MenuList, {
118
+ _useState4 = _slicedToArray(_useState3, 2),
119
+ selectedApp = _useState4[0],
120
+ setSelectedApp = _useState4[1];
121
+
122
+ var Menus = React.createElement(MenuList, {
76
123
  selectedKeys: [get(selectedApp, 'key')]
77
- }, /*#__PURE__*/React.createElement(_Menu.Item, {
124
+ }, React.createElement(_Menu.Item, {
78
125
  className: "app-search-warp",
79
126
  key: "search",
80
127
  disabled: true
81
- }, /*#__PURE__*/React.createElement(_Input, {
128
+ }, React.createElement(_Input, {
82
129
  allowClear: true,
83
130
  placeholder: "\u8F93\u5165\u5173\u952E\u8BCD\u641C\u7D22",
84
131
  value: searchValue,
@@ -87,31 +134,37 @@ export default withTheme(function (props) {
87
134
  }
88
135
  })), items.filter(function () {
89
136
  var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
90
- key = _ref.key,
91
- name = _ref.name;
137
+ key = _ref.key,
138
+ name = _ref.name;
139
+
92
140
  var regExp = new RegExp(searchValue, 'i');
141
+
93
142
  if (searchValue) {
94
143
  return regExp.test(key) || regExp.test(name);
95
144
  }
145
+
96
146
  return true;
97
147
  }).map(function (item) {
98
- return /*#__PURE__*/React.createElement(_Menu.Item, {
148
+ return React.createElement(_Menu.Item, {
99
149
  key: item.key,
100
150
  onClick: changeApp.bind(_this, item)
101
151
  }, item.name);
102
152
  }));
103
153
  useEffect(function () {
104
154
  var newApp = getInitialSelectedApp();
155
+
105
156
  if ((newApp == null ? void 0 : newApp.key) !== (selectedApp == null ? void 0 : selectedApp.key)) {
106
157
  changeApp(newApp);
107
158
  }
108
159
  }, [items, selectedKey]);
160
+
109
161
  if (!props.theme.compatible) {
110
- if (items != null && items.some(function (item) {
162
+ if (items == null ? void 0 : items.some(function (item) {
111
163
  var _item$children;
164
+
112
165
  return (_item$children = item.children) == null ? void 0 : _item$children.length;
113
166
  })) {
114
- return /*#__PURE__*/React.createElement(AppTreeSelect, {
167
+ return React.createElement(AppTreeSelect, {
115
168
  placeholder: "\u8BF7\u9009\u62E9",
116
169
  showSearch: true,
117
170
  treeNodeFilterProp: "title",
@@ -144,7 +197,8 @@ export default withTheme(function (props) {
144
197
  }
145
198
  });
146
199
  }
147
- return /*#__PURE__*/React.createElement(AppsSelect, {
200
+
201
+ return React.createElement(AppsSelect, {
148
202
  placeholder: "\u8BF7\u9009\u62E9",
149
203
  showSearch: true,
150
204
  optionFilterProp: "children",
@@ -162,17 +216,18 @@ export default withTheme(function (props) {
162
216
  }
163
217
  }, items.map(function (_ref3) {
164
218
  var key = _ref3.key,
165
- name = _ref3.name;
166
- return /*#__PURE__*/React.createElement(Option, {
219
+ name = _ref3.name;
220
+ return React.createElement(Option, {
167
221
  key: key,
168
222
  value: key
169
223
  }, name);
170
224
  }));
171
225
  }
172
- return /*#__PURE__*/React.createElement(_Dropdown, {
226
+
227
+ return React.createElement(_Dropdown, {
173
228
  overlay: Menus,
174
229
  trigger: ['click']
175
- }, /*#__PURE__*/React.createElement(SwitchAppMenu, null, /*#__PURE__*/React.createElement("span", null, get(selectedApp, 'name', '请选择')), /*#__PURE__*/React.createElement(Icon, {
230
+ }, React.createElement(SwitchAppMenu, null, React.createElement("span", null, get(selectedApp, 'name', '请选择')), React.createElement(Icon, {
176
231
  type: "caret-down"
177
232
  })));
178
233
  });
@@ -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 background-color: #fff;\n border-radius: 4px;\n z-index: 1;\n"]);
16
+
17
+ _templateObject4 = function _templateObject4() {
18
+ return data;
19
+ };
20
+
21
+ return data;
22
+ }
23
+
24
+ function _templateObject3() {
25
+ var data = _taggedTemplateLiteral(["\n position: relative;\n width: 88px;\n padding: 8px 0;\n cursor: pointer;\n display: inline-block;\n text-align: center;\n &:hover, &.active {\n background: #eee;\n }\n &.active:after {\n position: absolute;\n width: 0;\n height: 0;\n border-width: 5px 10px 0 0;\n border-color: #333;\n border-style: solid;\n z-index: 9;\n }\n img {\n width: 44px;\n height: 44px;\n margin-bottom: 6px;\n }\n div {\n line-height: 20px;\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\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 list-style: none;\n width: 264px;\n margin: 0;\n padding: 0;\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-left: 20px;\n font-size: 20px;\n cursor: pointer;\n .tnt-icon {\n color: #17233d99;\n .tnt-themeS1 & {\n color: rgba(255,255,255,.85);\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';
@@ -19,51 +60,56 @@ import { get } from 'lodash';
19
60
  import { systemMap as applicationsMap } from '@tntx/logo-icon';
20
61
  import Iconfont from './Iconfont';
21
62
  import { defaultLogo } from './images';
22
- var App = styled.li(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n margin-left: 20px;\n font-size: 20px;\n cursor: pointer;\n .tnt-icon {\n color: #17233d99;\n .tnt-themeS1 & {\n color: rgba(255,255,255,.85);\n }\n }\n"])));
23
- var AppList = styled.ul(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n list-style: none;\n width: 264px;\n margin: 0;\n padding: 0;\n"])));
24
- var AppItem = styled.li(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n position: relative;\n width: 88px;\n padding: 8px 0;\n cursor: pointer;\n display: inline-block;\n text-align: center;\n &:hover, &.active {\n background: #eee;\n }\n &.active:after {\n position: absolute;\n width: 0;\n height: 0;\n border-width: 5px 10px 0 0;\n border-color: #333;\n border-style: solid;\n z-index: 9;\n }\n img {\n width: 44px;\n height: 44px;\n margin-bottom: 6px;\n }\n div {\n line-height: 20px;\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n }\n"])));
25
- var AppContentWrapper = styled.div(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n background-color: #fff;\n border-radius: 4px;\n z-index: 1;\n"])));
63
+ var App = styled.li(_templateObject());
64
+ var AppList = styled.ul(_templateObject2());
65
+ var AppItem = styled.li(_templateObject3());
66
+ var AppContentWrapper = styled.div(_templateObject4());
67
+
26
68
  var AppContent = function AppContent(props) {
27
69
  var language = props.language,
28
- apps = props.apps,
29
- onChange = props.onChange;
70
+ apps = props.apps,
71
+ onChange = props.onChange;
72
+
30
73
  var _useState = useState(props.appKey),
31
- _useState2 = _slicedToArray(_useState, 2),
32
- appKey = _useState2[0],
33
- setAppKey = _useState2[1];
74
+ _useState2 = _slicedToArray(_useState, 2),
75
+ appKey = _useState2[0],
76
+ setAppKey = _useState2[1];
77
+
34
78
  var changeApp = function changeApp(appKey) {
35
79
  setAppKey(appKey);
36
80
  onChange && onChange(appKey);
37
81
  };
38
- return /*#__PURE__*/React.createElement(AppContentWrapper, null, /*#__PURE__*/React.createElement(AppList, null, apps.sort(function (a, b) {
82
+
83
+ return React.createElement(AppContentWrapper, null, React.createElement(AppList, null, apps.sort(function (a, b) {
39
84
  return get(applicationsMap, "".concat(a.appKey, ".sort"), 1) - get(applicationsMap, "".concat(b.appKey, ".sort"), 1);
40
85
  }).map(function (_ref) {
41
86
  var key = _ref.appKey;
42
- return /*#__PURE__*/React.createElement(AppItem, {
87
+ return React.createElement(AppItem, {
43
88
  key: key,
44
89
  className: cn({
45
90
  active: appKey === key
46
91
  }),
47
92
  onClick: changeApp.bind(_this, key)
48
- }, /*#__PURE__*/React.createElement("img", {
93
+ }, React.createElement("img", {
49
94
  src: get(applicationsMap, "".concat(key, ".logo"), defaultLogo),
50
95
  onError: function onError(e) {
51
96
  e.target.onerror = null;
52
97
  e.target.src = defaultLogo;
53
98
  }
54
- }), /*#__PURE__*/React.createElement("div", null, get(applicationsMap, "".concat(key, ".").concat({
99
+ }), React.createElement("div", null, get(applicationsMap, "".concat(key, ".").concat({
55
100
  cn: 'name',
56
101
  en: 'enName'
57
102
  }[language || 'cn']), key)));
58
103
  })));
59
104
  };
105
+
60
106
  export default (function (props) {
61
- return /*#__PURE__*/React.createElement(App, null, /*#__PURE__*/React.createElement(_Popover, {
107
+ return React.createElement(App, null, React.createElement(_Popover, {
62
108
  placement: "bottomRight",
63
109
  title: null,
64
- content: /*#__PURE__*/React.createElement(AppContent, props),
110
+ content: React.createElement(AppContent, props),
65
111
  trigger: "click"
66
- }, /*#__PURE__*/React.createElement(Iconfont, {
112
+ }, React.createElement(Iconfont, {
67
113
  type: "application"
68
114
  })));
69
115
  });
@@ -2,47 +2,81 @@ import "antd/lib/popover/style";
2
2
  import _Popover from "antd/lib/popover";
3
3
  import "antd/lib/button/style";
4
4
  import _Button from "antd/lib/button";
5
- var _templateObject, _templateObject2, _templateObject3;
5
+
6
+ function _templateObject3() {
7
+ var data = _taggedTemplateLiteral(["\n min-width: 235px;\n z-index: 1;\n background-color: #fff;\n border-radius: 4px;\n\n .isInIframe & {\n display: none;\n }\n \n .user-info-body {\n padding: 30px 20px 20px 24px;\n line-height: 16px;\n .user-info-body-username {\n margin-top: 0px;\n font-size: 16px;\n color: #333;\n font-weight: normal;\n margin-bottom: 10px;\n line-height: 16px;\n }\n .user-info-body-account {\n margin-top: 0px;\n color: #666;\n margin-bottom: 14px;\n line-height: 16px;\n }\n a {\n margin-right: 16px;\n }\n }\n .user-info-footer {\n border-top: 1px solid #ccc;\n background-color: #f5f5f5;\n padding: 8px 20px;\n text-align: right;\n .user-info-footer-signout:hover {\n box-shadow: 0 2px 8px rgba(0, 0, 0, .1);\n border-color: #d9d9d9;\n color: rgba(0, 0, 0, 0.65);\n }\n }\n"]);
8
+
9
+ _templateObject3 = function _templateObject3() {
10
+ return data;
11
+ };
12
+
13
+ return data;
14
+ }
15
+
16
+ function _templateObject2() {
17
+ var data = _taggedTemplateLiteral(["\n .tnt-layout-personal-popover {\n .ant-popover-inner-content {\n padding: 0;\n }\n }\n"]);
18
+
19
+ _templateObject2 = function _templateObject2() {
20
+ return data;
21
+ };
22
+
23
+ return data;
24
+ }
25
+
26
+ function _templateObject() {
27
+ 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"]);
28
+
29
+ _templateObject = function _templateObject() {
30
+ return data;
31
+ };
32
+
33
+ return data;
34
+ }
35
+
6
36
  function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
37
+
7
38
  import { useContext } from 'react';
8
39
  import styled, { createGlobalStyle } from 'styled-components';
9
40
  import { get } from 'lodash';
10
41
  import images from './images';
11
42
  import ActionsContext from './ActionsContext';
12
43
  import { clearLoginCookie } from './storage';
13
- 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"])));
14
- var GlobalStyle = createGlobalStyle(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n .tnt-layout-personal-popover {\n .ant-popover-inner-content {\n padding: 0;\n }\n }\n"])));
15
- var UserInfoWrapper = styled.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n min-width: 235px;\n z-index: 1;\n background-color: #fff;\n border-radius: 4px;\n\n .isInIframe & {\n display: none;\n }\n \n .user-info-body {\n padding: 30px 20px 20px 24px;\n line-height: 16px;\n .user-info-body-username {\n margin-top: 0px;\n font-size: 16px;\n color: #333;\n font-weight: normal;\n margin-bottom: 10px;\n line-height: 16px;\n }\n .user-info-body-account {\n margin-top: 0px;\n color: #666;\n margin-bottom: 14px;\n line-height: 16px;\n }\n a {\n margin-right: 16px;\n }\n }\n .user-info-footer {\n border-top: 1px solid #ccc;\n background-color: #f5f5f5;\n padding: 8px 20px;\n text-align: right;\n .user-info-footer-signout:hover {\n box-shadow: 0 2px 8px rgba(0, 0, 0, .1);\n border-color: #d9d9d9;\n color: rgba(0, 0, 0, 0.65);\n }\n }\n"])));
44
+ var Avatar = styled.li(_templateObject());
45
+ var GlobalStyle = createGlobalStyle(_templateObject2());
46
+ var UserInfoWrapper = styled.div(_templateObject3());
47
+
16
48
  var UserInfoContent = function UserInfoContent(props) {
17
49
  var userInfo = props.userInfo,
18
- onLogout = props.onLogout,
19
- _props$onChangePasswo = props.onChangePassword,
20
- onChangePassword = _props$onChangePasswo === void 0 ? function () {
21
- return true;
22
- } : _props$onChangePasswo,
23
- _props$onPersonalSett = props.onPersonalSetting,
24
- onPersonalSetting = _props$onPersonalSett === void 0 ? function () {
25
- return true;
26
- } : _props$onPersonalSett;
50
+ onLogout = props.onLogout,
51
+ _props$onChangePasswo = props.onChangePassword,
52
+ onChangePassword = _props$onChangePasswo === void 0 ? function () {
53
+ return true;
54
+ } : _props$onChangePasswo,
55
+ _props$onPersonalSett = props.onPersonalSetting,
56
+ onPersonalSetting = _props$onPersonalSett === void 0 ? function () {
57
+ return true;
58
+ } : _props$onPersonalSett;
59
+
27
60
  var _useContext = useContext(ActionsContext),
28
- getText = _useContext.getText;
29
- return /*#__PURE__*/React.createElement(UserInfoWrapper, {
61
+ getText = _useContext.getText;
62
+
63
+ return React.createElement(UserInfoWrapper, {
30
64
  className: "user-info-setting-wrap"
31
- }, /*#__PURE__*/React.createElement("div", {
65
+ }, React.createElement("div", {
32
66
  className: "user-info-body"
33
- }, /*#__PURE__*/React.createElement("p", {
67
+ }, React.createElement("p", {
34
68
  className: "user-info-body-username"
35
- }, userInfo.userName || getText('nameNull')), /*#__PURE__*/React.createElement("p", {
69
+ }, userInfo.userName || getText('nameNull')), React.createElement("p", {
36
70
  className: "user-info-body-account"
37
- }, userInfo.account), /*#__PURE__*/React.createElement("a", {
71
+ }, userInfo.account), React.createElement("a", {
38
72
  onClick: onPersonalSetting,
39
73
  href: "/bridge/userCenter?currentTab=1"
40
- }, getText('personalSettings')), /*#__PURE__*/React.createElement("a", {
74
+ }, getText('personalSettings')), React.createElement("a", {
41
75
  onClick: onChangePassword,
42
76
  href: "/bridge/userCenter?currentTab=2"
43
- }, getText('changePwd'))), /*#__PURE__*/React.createElement("div", {
77
+ }, getText('changePwd'))), React.createElement("div", {
44
78
  className: "user-info-footer"
45
- }, /*#__PURE__*/React.createElement(_Button, {
79
+ }, React.createElement(_Button, {
46
80
  className: "user-info-footer-signout",
47
81
  onClick: function onClick() {
48
82
  if (onLogout) {
@@ -53,27 +87,30 @@ var UserInfoContent = function UserInfoContent(props) {
53
87
  window.location.href = "/user/login?callbackUrl=".concat(window.encodeURI(location.href));
54
88
  }
55
89
  }
56
- }, /*#__PURE__*/React.createElement("a", null, getText('signOut')))));
90
+ }, React.createElement("a", null, getText('signOut')))));
57
91
  };
92
+
58
93
  export default (function (props) {
59
94
  var _images$empty2;
95
+
60
96
  var _props$userInfo = props.userInfo,
61
- userInfo = _props$userInfo === void 0 ? {} : _props$userInfo;
97
+ userInfo = _props$userInfo === void 0 ? {} : _props$userInfo;
62
98
  var avatar = userInfo.avatar;
63
- return /*#__PURE__*/React.createElement(Avatar, null, /*#__PURE__*/React.createElement(_Popover, {
99
+ return React.createElement(Avatar, null, React.createElement(_Popover, {
64
100
  popupClassName: "tnt-layout-personal-popover",
65
101
  placement: "bottomRight",
66
102
  title: null,
67
- content: /*#__PURE__*/React.createElement(UserInfoContent, props),
103
+ content: React.createElement(UserInfoContent, props),
68
104
  trigger: "click"
69
- }, avatar ? /*#__PURE__*/React.createElement("img", {
105
+ }, avatar ? React.createElement("img", {
70
106
  src: avatar.indexOf('base64') > 0 ? avatar : get(images[avatar], 'default', images[avatar]),
71
107
  onError: function onError(e) {
72
108
  var _images$empty;
109
+
73
110
  e.target.onerror = null;
74
111
  e.target.src = ((_images$empty = images.empty) == null ? void 0 : _images$empty["default"]) || images.empty;
75
112
  }
76
- }) : /*#__PURE__*/React.createElement("img", {
113
+ }) : React.createElement("img", {
77
114
  src: ((_images$empty2 = images.empty) == null ? void 0 : _images$empty2["default"]) || images.empty
78
- })), /*#__PURE__*/React.createElement(GlobalStyle, null));
115
+ })), React.createElement(GlobalStyle, null));
79
116
  });