tntd 1.4.20 → 1.4.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (163) hide show
  1. package/components/Handle/README.md +0 -20
  2. package/components/Handle/index.js +27 -6
  3. package/components/locale.js +8 -2
  4. package/dist/1.tntd.js +1 -1
  5. package/dist/stats.json +23819 -24067
  6. package/dist/tntd.css +1 -1
  7. package/dist/tntd.js +13 -8
  8. package/es/ArrayInput/icon.js +5 -5
  9. package/es/ArrayInput/index.js +108 -76
  10. package/es/AuthContext.js +1 -1
  11. package/es/Columns/index.js +38 -31
  12. package/es/DevelopmentLogin/LoginModal.js +45 -32
  13. package/es/DevelopmentLogin/index.js +17 -13
  14. package/es/Ellipsis/Svg/CopySVG.js +13 -13
  15. package/es/Ellipsis/Svg/TickSVG.js +8 -8
  16. package/es/Ellipsis/index.js +69 -58
  17. package/es/Handle/README.md +0 -20
  18. package/es/Handle/index.js +67 -32
  19. package/es/Icon/fonts/iconfont.js +12 -7
  20. package/es/Icon/index.js +13 -10
  21. package/es/Img/Contain.js +29 -24
  22. package/es/Img/Cover.js +54 -40
  23. package/es/Img/index.js +45 -36
  24. package/es/Layout/ActionsContext.js +2 -3
  25. package/es/Layout/AppList.js +92 -37
  26. package/es/Layout/Application.js +72 -26
  27. package/es/Layout/Avatar.js +66 -29
  28. package/es/Layout/CompatibleLanguage.js +94 -39
  29. package/es/Layout/EnterpriseLayout/Avatar.js +76 -38
  30. package/es/Layout/EnterpriseLayout/Language.js +32 -14
  31. package/es/Layout/EnterpriseLayout/Theme.js +34 -16
  32. package/es/Layout/EnterpriseLayout/index.js +16 -14
  33. package/es/Layout/GlobalNavigation/NavigationPopup.js +170 -59
  34. package/es/Layout/GlobalNavigation/index.js +54 -20
  35. package/es/Layout/Header.js +46 -25
  36. package/es/Layout/HeaderActions.js +56 -42
  37. package/es/Layout/HeaderNavs.js +47 -20
  38. package/es/Layout/HeaderTabs.js +102 -49
  39. package/es/Layout/Iconfont.js +1 -1
  40. package/es/Layout/Language.js +32 -14
  41. package/es/Layout/Layout.js +108 -86
  42. package/es/Layout/Logo.js +32 -16
  43. package/es/Layout/OrgAppList.js +107 -62
  44. package/es/Layout/SideMenu.js +124 -63
  45. package/es/Layout/Theme.js +61 -23
  46. package/es/Layout/checkAuth.js +29 -0
  47. package/es/Layout/index.js +34 -26
  48. package/es/Layout/paaslayout/CompactSideMenu.js +74 -35
  49. package/es/Layout/paaslayout/Header.js +45 -22
  50. package/es/Layout/paaslayout/Logo.js +13 -3
  51. package/es/Layout/paaslayout/SideMenu.js +78 -39
  52. package/es/Layout/paaslayout/index.js +102 -75
  53. package/es/Layout/storage.js +9 -10
  54. package/es/Layout/utils.js +136 -0
  55. package/es/LoadingButton/index.js +24 -15
  56. package/es/Modal/index.js +46 -38
  57. package/es/Page/Box.js +41 -34
  58. package/es/Page/index.js +67 -52
  59. package/es/Page/utils.js +5 -0
  60. package/es/QueryForm/Field/Checkbox.js +9 -5
  61. package/es/QueryForm/Field/Select.js +41 -31
  62. package/es/QueryForm/Field/SelectInput.js +41 -26
  63. package/es/QueryForm/Field/fieldsMap.js +1 -0
  64. package/es/QueryForm/Field/index.js +71 -41
  65. package/es/QueryForm/createActions.js +7 -6
  66. package/es/QueryForm/index.js +135 -76
  67. package/es/QueryListScene/List.js +128 -74
  68. package/es/QueryListScene/QueryForm.js +81 -46
  69. package/es/QueryListScene/QueryListScene.js +40 -25
  70. package/es/QueryListScene/Title.js +3 -3
  71. package/es/QueryListScene/Toolbar.js +12 -11
  72. package/es/Select/DropDownWrap.js +50 -29
  73. package/es/Select/index.js +231 -135
  74. package/es/Table/ResizableTable/index.js +40 -26
  75. package/es/Table/index.js +16 -18
  76. package/es/Title/index.js +23 -21
  77. package/es/locale.js +11 -3
  78. package/es/utils/checkAuth.js +5 -3
  79. package/es/utils/findMenuInfoByPath.js +4 -0
  80. package/es/utils/index.js +23 -12
  81. package/lib/ArrayInput/icon.js +6 -6
  82. package/lib/ArrayInput/index.js +127 -78
  83. package/lib/AuthContext.js +4 -1
  84. package/lib/Columns/index.js +47 -31
  85. package/lib/DevelopmentLogin/LoginModal.js +58 -32
  86. package/lib/DevelopmentLogin/index.js +27 -16
  87. package/lib/Ellipsis/Svg/CopySVG.js +15 -13
  88. package/lib/Ellipsis/Svg/TickSVG.js +10 -8
  89. package/lib/Ellipsis/index.js +80 -57
  90. package/lib/Handle/README.md +0 -20
  91. package/lib/Handle/index.js +80 -32
  92. package/lib/Icon/fonts/iconfont.js +12 -7
  93. package/lib/Icon/index.js +20 -11
  94. package/lib/Img/Contain.js +34 -24
  95. package/lib/Img/Cover.js +65 -42
  96. package/lib/Img/index.js +51 -36
  97. package/lib/Layout/ActionsContext.js +4 -1
  98. package/lib/Layout/AppList.js +118 -40
  99. package/lib/Layout/Application.js +86 -26
  100. package/lib/Layout/Avatar.js +86 -32
  101. package/lib/Layout/CompatibleLanguage.js +110 -39
  102. package/lib/Layout/EnterpriseLayout/Avatar.js +100 -41
  103. package/lib/Layout/EnterpriseLayout/Header.js +113 -0
  104. package/lib/Layout/EnterpriseLayout/HeaderActions.js +104 -0
  105. package/lib/Layout/EnterpriseLayout/Language.js +48 -17
  106. package/lib/Layout/EnterpriseLayout/Theme.js +44 -16
  107. package/lib/Layout/EnterpriseLayout/index.js +23 -14
  108. package/lib/Layout/GlobalNavigation/NavigationPopup.js +186 -59
  109. package/lib/Layout/GlobalNavigation/index.js +74 -23
  110. package/lib/Layout/Header.js +63 -28
  111. package/lib/Layout/HeaderActions.js +74 -45
  112. package/lib/Layout/HeaderNavs.js +61 -23
  113. package/lib/Layout/HeaderTabs.js +118 -51
  114. package/lib/Layout/Iconfont.js +5 -1
  115. package/lib/Layout/Language.js +48 -17
  116. package/lib/Layout/Layout.js +128 -88
  117. package/lib/Layout/Logo.js +43 -19
  118. package/lib/Layout/OrgAppList.js +127 -64
  119. package/lib/Layout/SideMenu.js +143 -65
  120. package/lib/Layout/Theme.js +73 -23
  121. package/lib/Layout/checkAuth.js +39 -0
  122. package/lib/Layout/createActions.js +5 -0
  123. package/lib/Layout/images/index.js +28 -0
  124. package/lib/Layout/index.js +55 -30
  125. package/lib/Layout/paaslayout/CompactSideMenu.js +84 -35
  126. package/lib/Layout/paaslayout/Header.js +55 -22
  127. package/lib/Layout/paaslayout/Logo.js +19 -3
  128. package/lib/Layout/paaslayout/SideMenu.js +87 -39
  129. package/lib/Layout/paaslayout/index.js +122 -77
  130. package/lib/Layout/storage.js +40 -11
  131. package/lib/Layout/utils.js +166 -0
  132. package/lib/LoadingButton/index.js +29 -15
  133. package/lib/Modal/index.js +53 -38
  134. package/lib/Page/Box.js +45 -34
  135. package/lib/Page/index.js +77 -52
  136. package/lib/Page/utils.js +9 -1
  137. package/lib/QueryForm/Field/Checkbox.js +13 -5
  138. package/lib/QueryForm/Field/Select.js +53 -33
  139. package/lib/QueryForm/Field/SelectInput.js +56 -28
  140. package/lib/QueryForm/Field/fieldsMap.js +15 -1
  141. package/lib/QueryForm/Field/index.js +81 -43
  142. package/lib/QueryForm/createActions.js +12 -6
  143. package/lib/QueryForm/index.js +157 -78
  144. package/lib/QueryForm/useForm.js +5 -0
  145. package/lib/QueryListScene/List.js +140 -76
  146. package/lib/QueryListScene/QueryForm.js +86 -46
  147. package/lib/QueryListScene/QueryListScene.js +46 -25
  148. package/lib/QueryListScene/Title.js +7 -3
  149. package/lib/QueryListScene/Toolbar.js +16 -11
  150. package/lib/QueryListScene/createActions.js +5 -0
  151. package/lib/QueryListScene/index.js +10 -0
  152. package/lib/QueryListScene/useActions.js +5 -0
  153. package/lib/Select/DropDownWrap.js +56 -31
  154. package/lib/Select/index.js +241 -135
  155. package/lib/Table/ResizableTable/index.js +48 -26
  156. package/lib/Table/index.js +28 -17
  157. package/lib/Title/index.js +28 -21
  158. package/lib/index.js +56 -35
  159. package/lib/locale.js +19 -4
  160. package/lib/utils/checkAuth.js +9 -4
  161. package/lib/utils/findMenuInfoByPath.js +8 -1
  162. package/lib/utils/index.js +42 -15
  163. package/package.json +2 -2
@@ -1,6 +1,27 @@
1
- var _templateObject, _templateObject2;
2
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
1
+ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
+
3
+ function _templateObject2() {
4
+ var data = _taggedTemplateLiteral(["\n flex: 1;\n .isInIframe & {\n display: none;\n }\n"]);
5
+
6
+ _templateObject2 = function _templateObject2() {
7
+ return data;
8
+ };
9
+
10
+ return data;
11
+ }
12
+
13
+ function _templateObject() {
14
+ var data = _taggedTemplateLiteral(["\n position: relative;\n z-index: 201;\n height: ", ";\n display: flex;\n color: rgba(255,255,255,.85);\n background: #fff;\n .hasHeaderTabs & {\n // background: #191D29;\n background: #fff !important;\n box-shadow: 0px 1px 6px 0px rgba(0,0,0,0.18);\n .tnt-layout-header-content {\n display: none;\n }\n }\n\n // .tnt-themeS3.hasHeaderTabs &{\n // background: ", "; //#1D4295 !important;\n // }\n\n .isInIframe.noAppList &,\n .isEmptyLayout & {\n display: none;\n }\n .tnt-themeS1 & {\n background: #FFFFFF;\n box-shadow: 0 1px 10px 0 rgba(0,0,0,0.15);\n }\n .tnt-themeS1.compatible & {\n /* background: #323b4a; */\n }\n padding-right: 20px;\n background: #FFFFFF;\n box-shadow: 0 1px 10px 0 rgba(0,0,0,0.10);\n .compatible & {\n box-shadow: 0 1px 10px 0 rgba(0,0,0,0.10);\n }\n transition: box-shadow .2s cubic-bezier(.4,0,.2,1), -webkit-box-shadow .2s cubic-bezier(.4,0,.2,1);\n\n .sidebar-collapsed-controller {\n text-align: center;\n width: ", ";\n line-height: ", ";\n height: ", ";\n cursor: pointer;\n color: ", ";\n margin-right: 10px;\n\n & > .tnt-icon {\n font-size: 16px;\n .large-size & {\n font-size: 20px;\n }\n }\n\n i {\n position: relative;\n top: -1px;\n vertical-align: sub;\n }\n\n &:hover {\n background-color: rgba(0,0,0,.06);\n }\n\n .tnt-themeS1 & {\n /* color: rgba(255,255,255,.85); */\n color: ", ";\n }\n .large-size & {\n font-size: 18px;\n }\n .isInIframe & {\n display: none;\n }\n }\n"]);
15
+
16
+ _templateObject = function _templateObject() {
17
+ return data;
18
+ };
19
+
20
+ return data;
21
+ }
22
+
3
23
  function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
24
+
4
25
  /**
5
26
  * @file Layout header
6
27
  * @author zhangyou
@@ -11,7 +32,7 @@ import Icon from '../Icon';
11
32
  import Actions from './HeaderActions';
12
33
  import AppList from './AppList';
13
34
  import OrgAppList from './OrgAppList';
14
- var Header = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: relative;\n z-index: 201;\n height: ", ";\n display: flex;\n color: rgba(255,255,255,.85);\n background: #fff;\n .hasHeaderTabs & {\n // background: #191D29;\n background: #fff !important;\n box-shadow: 0px 1px 6px 0px rgba(0,0,0,0.18);\n .tnt-layout-header-content {\n display: none;\n }\n }\n\n // .tnt-themeS3.hasHeaderTabs &{\n // background: ", "; //#1D4295 !important;\n // }\n\n .isInIframe.noAppList &,\n .isEmptyLayout & {\n display: none;\n }\n .tnt-themeS1 & {\n background: #FFFFFF;\n box-shadow: 0 1px 10px 0 rgba(0,0,0,0.15);\n }\n .tnt-themeS1.compatible & {\n /* background: #323b4a; */\n }\n padding-right: 20px;\n background: #FFFFFF;\n box-shadow: 0 1px 10px 0 rgba(0,0,0,0.10);\n .compatible & {\n box-shadow: 0 1px 10px 0 rgba(0,0,0,0.10);\n }\n transition: box-shadow .2s cubic-bezier(.4,0,.2,1), -webkit-box-shadow .2s cubic-bezier(.4,0,.2,1);\n\n .sidebar-collapsed-controller {\n text-align: center;\n width: ", ";\n line-height: ", ";\n height: ", ";\n cursor: pointer;\n color: ", ";\n margin-right: 10px;\n\n & > .tnt-icon {\n font-size: 16px;\n .large-size & {\n font-size: 20px;\n }\n }\n\n i {\n position: relative;\n top: -1px;\n vertical-align: sub;\n }\n\n &:hover {\n background-color: rgba(0,0,0,.06);\n }\n\n .tnt-themeS1 & {\n /* color: rgba(255,255,255,.85); */\n color: ", ";\n }\n .large-size & {\n font-size: 18px;\n }\n .isInIframe & {\n display: none;\n }\n }\n"])), function (props) {
35
+ var Header = styled.div(_templateObject(), function (props) {
15
36
  return "".concat(props.theme.headerHeight, "px");
16
37
  }, function (props) {
17
38
  return "".concat(props.theme.blueBgColor, " !important");
@@ -26,33 +47,33 @@ var Header = styled.div(_templateObject || (_templateObject = _taggedTemplateLit
26
47
  }, function (props) {
27
48
  return "".concat(props.theme.primaryTextColor);
28
49
  });
29
- var Content = styled.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n flex: 1;\n .isInIframe & {\n display: none;\n }\n"])));
50
+ var Content = styled.div(_templateObject2());
30
51
  export default withTheme(function (props) {
31
52
  var collapsed = props.collapsed,
32
- _props$collapseIconPl = props.collapseIconPlacement,
33
- collapseIconPlacement = _props$collapseIconPl === void 0 ? 'right' : _props$collapseIconPl,
34
- selectedAppKey = props.selectedAppKey,
35
- appList = props.appList,
36
- orgAppShow = props.orgAppShow,
37
- orgAppList = props.orgAppList,
38
- orgTreeConfig = props.orgTreeConfig,
39
- selectedOrgKey = props.selectedOrgKey,
40
- orgList = props.orgList,
41
- headerTabs = props.headerTabs,
42
- onAppChange = props.onAppChange,
43
- onOrgChange = props.onOrgChange,
44
- onCollapseChange = props.onCollapseChange,
45
- extraActions = props.extraActions;
53
+ _props$collapseIconPl = props.collapseIconPlacement,
54
+ collapseIconPlacement = _props$collapseIconPl === void 0 ? 'right' : _props$collapseIconPl,
55
+ selectedAppKey = props.selectedAppKey,
56
+ appList = props.appList,
57
+ orgAppShow = props.orgAppShow,
58
+ orgAppList = props.orgAppList,
59
+ orgTreeConfig = props.orgTreeConfig,
60
+ selectedOrgKey = props.selectedOrgKey,
61
+ orgList = props.orgList,
62
+ headerTabs = props.headerTabs,
63
+ onAppChange = props.onAppChange,
64
+ onOrgChange = props.onOrgChange,
65
+ onCollapseChange = props.onCollapseChange,
66
+ extraActions = props.extraActions;
46
67
  var headerRef = useRef();
47
- return /*#__PURE__*/React.createElement(Header, {
68
+ return React.createElement(Header, {
48
69
  className: "tnt-layout-header",
49
70
  ref: headerRef
50
- }, collapseIconPlacement === 'right' && /*#__PURE__*/React.createElement("div", {
71
+ }, collapseIconPlacement === 'right' && React.createElement("div", {
51
72
  className: "sidebar-collapsed-controller",
52
73
  onClick: onCollapseChange
53
- }, /*#__PURE__*/React.createElement(Icon, {
74
+ }, React.createElement(Icon, {
54
75
  type: "menu-".concat(collapsed ? 'unfold' : 'fold')
55
- })), headerTabs, orgList && /*#__PURE__*/React.createElement(OrgAppList, {
76
+ })), headerTabs, orgList && React.createElement(OrgAppList, {
56
77
  orgAppShow: orgAppShow,
57
78
  selectedOrgKey: selectedOrgKey,
58
79
  orgList: orgList,
@@ -62,13 +83,13 @@ export default withTheme(function (props) {
62
83
  orgAppList: orgAppList,
63
84
  onAppChange: onAppChange,
64
85
  headerTabs: headerTabs
65
- }), appList && !orgList && /*#__PURE__*/React.createElement(AppList, {
86
+ }), appList && !orgList && React.createElement(AppList, {
66
87
  items: appList,
67
88
  selectedKey: selectedAppKey,
68
89
  onChange: onAppChange
69
- }), /*#__PURE__*/React.createElement(Content, {
90
+ }), React.createElement(Content, {
70
91
  className: "tnt-layout-header-content"
71
- }, props.children), /*#__PURE__*/React.createElement(Actions, _extends({}, props, {
92
+ }, props.children), React.createElement(Actions, _extends({}, props, {
72
93
  headerRef: headerRef
73
94
  }), extraActions));
74
95
  });
@@ -1,10 +1,22 @@
1
1
  import "antd/lib/divider/style";
2
2
  import _Divider from "antd/lib/divider";
3
- var _excluded = ["type", "config", "theme", "userInfo", "menus", "apps", "extraActions", "headerRef", "onLanguageChange", "onThemeChange", "onApplicationChange", "onAppChange", "onOrgChange", "onCollapseChange", "onPersonalSetting", "onChangePassword", "onLogout", "onLogoClick", "AvatarCustom"];
4
- var _templateObject;
3
+
5
4
  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; }
5
+
6
6
  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; }
7
+
8
+ function _templateObject() {
9
+ 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 & {\n color: #455064;\n }\n // \u5220\u9664\u8272\u7CFB\u533A\u5206 \u7EDF\u4E00\u8272\u8C03\n // .hasHeaderTabs:not(.tnt-themeS1) & {\n // color: rgba(255,255,255,.8);\n // }\n .hasHeaderTabs:not(.tnt-themeS1) & {\n color: #455064 !important;\n }\n }\n"]);
10
+
11
+ _templateObject = function _templateObject() {
12
+ return data;
13
+ };
14
+
15
+ return data;
16
+ }
17
+
7
18
  function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
19
+
8
20
  import styled, { withTheme } from 'styled-components';
9
21
  import GlobalNavigation from './GlobalNavigation';
10
22
  import Language from './Language';
@@ -12,66 +24,68 @@ import Theme from './Theme';
12
24
  import LanguageTheme from './CompatibleLanguage';
13
25
  import Application from './Application';
14
26
  import Avatar from './Avatar';
15
- var Actions = styled.ul(_templateObject || (_templateObject = _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 & {\n color: #455064;\n }\n // \u5220\u9664\u8272\u7CFB\u533A\u5206 \u7EDF\u4E00\u8272\u8C03\n // .hasHeaderTabs:not(.tnt-themeS1) & {\n // color: rgba(255,255,255,.8);\n // }\n .hasHeaderTabs:not(.tnt-themeS1) & {\n color: #455064 !important;\n }\n }\n"])), function (props) {
27
+ var Actions = styled.ul(_templateObject(), function (props) {
16
28
  return "".concat(props.theme.headerHeight, "px");
17
29
  }, function (props) {
18
30
  return "".concat(props.theme.headerActionsColor);
19
31
  });
20
32
  export default withTheme(function (props) {
21
33
  var type = props.type,
22
- _props$config = props.config,
23
- _props$config2 = _props$config === void 0 ? {} : _props$config,
24
- _props$config2$theme = _props$config2.theme,
25
- theme = _props$config2$theme === void 0 ? true : _props$config2$theme,
26
- _props$config2$avatar = _props$config2.avatar,
27
- avatar = _props$config2$avatar === void 0 ? true : _props$config2$avatar,
28
- _props$config2$langua = _props$config2.language,
29
- language = _props$config2$langua === void 0 ? true : _props$config2$langua,
30
- _props$config2$applic = _props$config2.application,
31
- application = _props$config2$applic === void 0 ? false : _props$config2$applic,
32
- _props$config2$global = _props$config2.globalNavigation,
33
- globalNavigation = _props$config2$global === void 0 ? false : _props$config2$global,
34
- compatible = props.theme.compatible,
35
- _props$userInfo = props.userInfo,
36
- userInfo = _props$userInfo === void 0 ? {} : _props$userInfo,
37
- menus = props.menus,
38
- apps = props.apps,
39
- extraActions = props.extraActions,
40
- headerRef = props.headerRef,
41
- onLanguageChange = props.onLanguageChange,
42
- onThemeChange = props.onThemeChange,
43
- onApplicationChange = props.onApplicationChange,
44
- onAppChange = props.onAppChange,
45
- onOrgChange = props.onOrgChange,
46
- onCollapseChange = props.onCollapseChange,
47
- onPersonalSetting = props.onPersonalSetting,
48
- onChangePassword = props.onChangePassword,
49
- onLogout = props.onLogout,
50
- onLogoClick = props.onLogoClick,
51
- AvatarCustom = props.AvatarCustom,
52
- rest = _objectWithoutProperties(props, _excluded);
53
- return /*#__PURE__*/React.createElement(Actions, rest, extraActions, globalNavigation && /*#__PURE__*/React.createElement(GlobalNavigation, {
34
+ _props$config = props.config;
35
+ _props$config = _props$config === void 0 ? {} : _props$config;
36
+
37
+ var _props$config$theme = _props$config.theme,
38
+ theme = _props$config$theme === void 0 ? true : _props$config$theme,
39
+ _props$config$avatar = _props$config.avatar,
40
+ avatar = _props$config$avatar === void 0 ? true : _props$config$avatar,
41
+ _props$config$languag = _props$config.language,
42
+ language = _props$config$languag === void 0 ? true : _props$config$languag,
43
+ _props$config$applica = _props$config.application,
44
+ application = _props$config$applica === void 0 ? false : _props$config$applica,
45
+ _props$config$globalN = _props$config.globalNavigation,
46
+ globalNavigation = _props$config$globalN === void 0 ? false : _props$config$globalN,
47
+ compatible = props.theme.compatible,
48
+ _props$userInfo = props.userInfo,
49
+ userInfo = _props$userInfo === void 0 ? {} : _props$userInfo,
50
+ menus = props.menus,
51
+ apps = props.apps,
52
+ extraActions = props.extraActions,
53
+ headerRef = props.headerRef,
54
+ onLanguageChange = props.onLanguageChange,
55
+ onThemeChange = props.onThemeChange,
56
+ onApplicationChange = props.onApplicationChange,
57
+ onAppChange = props.onAppChange,
58
+ onOrgChange = props.onOrgChange,
59
+ onCollapseChange = props.onCollapseChange,
60
+ onPersonalSetting = props.onPersonalSetting,
61
+ onChangePassword = props.onChangePassword,
62
+ onLogout = props.onLogout,
63
+ onLogoClick = props.onLogoClick,
64
+ AvatarCustom = props.AvatarCustom,
65
+ rest = _objectWithoutProperties(props, ["type", "config", "theme", "userInfo", "menus", "apps", "extraActions", "headerRef", "onLanguageChange", "onThemeChange", "onApplicationChange", "onAppChange", "onOrgChange", "onCollapseChange", "onPersonalSetting", "onChangePassword", "onLogout", "onLogoClick", "AvatarCustom"]);
66
+
67
+ return React.createElement(Actions, rest, extraActions, globalNavigation && React.createElement(GlobalNavigation, {
54
68
  headerRef: headerRef,
55
69
  menus: menus
56
- }), type !== 'enterprise' && (!compatible ? /*#__PURE__*/React.createElement(React.Fragment, null, language && /*#__PURE__*/React.createElement(Language, {
70
+ }), type !== 'enterprise' && (!compatible ? React.createElement(React.Fragment, null, language && React.createElement(Language, {
57
71
  language: userInfo.lang,
58
72
  onChange: onLanguageChange
59
- }), theme && /*#__PURE__*/React.createElement(Theme, {
73
+ }), theme && React.createElement(Theme, {
60
74
  theme: userInfo.theme,
61
75
  onChange: onThemeChange
62
- })) : /*#__PURE__*/React.createElement(LanguageTheme, {
76
+ })) : React.createElement(LanguageTheme, {
63
77
  config: props.config,
64
78
  language: userInfo.lang,
65
79
  theme: userInfo.theme,
66
80
  onLanguageChange: onLanguageChange,
67
81
  onThemeChange: onThemeChange
68
- })), application && /*#__PURE__*/React.createElement(Application, {
82
+ })), application && React.createElement(Application, {
69
83
  language: userInfo.lang,
70
84
  apps: apps,
71
85
  onChange: onApplicationChange
72
- }), avatar && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(_Divider, {
86
+ }), avatar && React.createElement(React.Fragment, null, React.createElement(_Divider, {
73
87
  type: "vertical"
74
- }), AvatarCustom ? /*#__PURE__*/React.createElement(AvatarCustom, {
88
+ }), AvatarCustom ? React.createElement(AvatarCustom, {
75
89
  userInfo: userInfo,
76
90
  onPersonalSetting: onPersonalSetting,
77
91
  onChangePassword: onChangePassword,
@@ -82,7 +96,7 @@ export default withTheme(function (props) {
82
96
  language: language
83
97
  },
84
98
  onLanguageChange: onLanguageChange
85
- }) : /*#__PURE__*/React.createElement(Avatar, {
99
+ }) : React.createElement(Avatar, {
86
100
  userInfo: userInfo,
87
101
  onPersonalSetting: onPersonalSetting,
88
102
  onChangePassword: onChangePassword,
@@ -1,20 +1,43 @@
1
- var _excluded = ["theme", "navs", "onChange", "onSelect"];
2
- var _templateObject, _templateObject2;
3
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
4
- 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."); }
5
- 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); }
6
- 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; }
7
- function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
1
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }
2
+
3
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); }
4
+
5
+ function _iterableToArrayLimit(arr, i) { if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) { return; } var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
6
+
8
7
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
8
+
9
9
  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; }
10
+
10
11
  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; }
12
+
13
+ function _templateObject2() {
14
+ var data = _taggedTemplateLiteral(["\n position: relative;\n margin: 0;\n padding: 0 20px;\n cursor: pointer;\n display: inline-block;\n line-height: ", ";\n transition: background-color .5;\n\n a {\n font-size: 14px;\n color: ", ";\n text-rendering: optimizeLegibility;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n .tnt-themeS1 & {\n color: rgba(255,255,255,.8);\n }\n }\n\n &:hover, &.active {\n a {\n color: ", ";\n .tnt-themeS1 & {\n color: #418AFF;\n }\n }\n }\n &.active {\n &:after {\n position: absolute;\n left: 0;\n bottom: 0;\n width: 100%;\n height: 3px;\n background: ", ";\n display: inline-block;\n content: \"\";\n .tnt-themeS1 & {\n background: #418AFF;\n }\n }\n }\n"]);
15
+
16
+ _templateObject2 = function _templateObject2() {
17
+ return data;
18
+ };
19
+
20
+ return data;
21
+ }
22
+
23
+ function _templateObject() {
24
+ var data = _taggedTemplateLiteral(["\n margin: 0;\n padding: 0;\n list-style: none;\n text-align: right;\n"]);
25
+
26
+ _templateObject = function _templateObject() {
27
+ return data;
28
+ };
29
+
30
+ return data;
31
+ }
32
+
11
33
  function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
34
+
12
35
  import { useState, useEffect } from 'react';
13
36
  import styled, { withTheme } from 'styled-components';
14
37
  import cn from 'classnames';
15
38
  import { get } from 'lodash';
16
- var Navs = styled.ul(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n margin: 0;\n padding: 0;\n list-style: none;\n text-align: right;\n"])));
17
- var NavItem = styled.li(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n position: relative;\n margin: 0;\n padding: 0 20px;\n cursor: pointer;\n display: inline-block;\n line-height: ", ";\n transition: background-color .5;\n\n a {\n font-size: 14px;\n color: ", ";\n text-rendering: optimizeLegibility;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n .tnt-themeS1 & {\n color: rgba(255,255,255,.8);\n }\n }\n\n &:hover, &.active {\n a {\n color: ", ";\n .tnt-themeS1 & {\n color: #418AFF;\n }\n }\n }\n &.active {\n &:after {\n position: absolute;\n left: 0;\n bottom: 0;\n width: 100%;\n height: 3px;\n background: ", ";\n display: inline-block;\n content: \"\";\n .tnt-themeS1 & {\n background: #418AFF;\n }\n }\n }\n"])), function (props) {
39
+ var Navs = styled.ul(_templateObject());
40
+ var NavItem = styled.li(_templateObject2(), function (props) {
18
41
  return props.theme.size === 'large' ? '60px' : '50px';
19
42
  }, function (props) {
20
43
  return props.theme.secondaryTextColor;
@@ -25,28 +48,32 @@ var NavItem = styled.li(_templateObject2 || (_templateObject2 = _taggedTemplateL
25
48
  });
26
49
  export var HeaderNavs = withTheme(function (_ref) {
27
50
  var theme = _ref.theme,
28
- _ref$navs = _ref.navs,
29
- navs = _ref$navs === void 0 ? [] : _ref$navs,
30
- onChange = _ref.onChange,
31
- onSelect = _ref.onSelect,
32
- props = _objectWithoutProperties(_ref, _excluded);
51
+ _ref$navs = _ref.navs,
52
+ navs = _ref$navs === void 0 ? [] : _ref$navs,
53
+ onChange = _ref.onChange,
54
+ onSelect = _ref.onSelect,
55
+ props = _objectWithoutProperties(_ref, ["theme", "navs", "onChange", "onSelect"]);
56
+
33
57
  var _useState = useState(props.selectedKey || get(navs, '0.key')),
34
- _useState2 = _slicedToArray(_useState, 2),
35
- selectedKey = _useState2[0],
36
- setSelectedKey = _useState2[1];
58
+ _useState2 = _slicedToArray(_useState, 2),
59
+ selectedKey = _useState2[0],
60
+ setSelectedKey = _useState2[1];
61
+
37
62
  var onClickNav = function onClickNav(nav) {
38
63
  setSelectedKey(nav.key);
39
64
  onSelect && onSelect(nav);
65
+
40
66
  if (selectedKey !== nav.key) {
41
67
  onChange && onChange(nav);
42
68
  setSelectedKey(nav.key);
43
69
  }
44
70
  };
71
+
45
72
  useEffect(function () {
46
73
  setSelectedKey(props.selectedKey || get(navs, '0.key'));
47
74
  }, [navs, props.selectedKey]);
48
- return /*#__PURE__*/React.createElement(Navs, props, navs.map(function (nav) {
49
- return /*#__PURE__*/React.createElement(NavItem, {
75
+ return React.createElement(Navs, props, navs.map(function (nav) {
76
+ return React.createElement(NavItem, {
50
77
  key: nav.key,
51
78
  theme: theme,
52
79
  className: cn({
@@ -55,7 +82,7 @@ export var HeaderNavs = withTheme(function (_ref) {
55
82
  onClick: function onClick() {
56
83
  return onClickNav(nav);
57
84
  }
58
- }, /*#__PURE__*/React.createElement("a", {
85
+ }, React.createElement("a", {
59
86
  href: nav.key,
60
87
  onClick: function onClick(evt) {
61
88
  return evt.preventDefault();