tntd 1.4.20 → 1.4.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (163) hide show
  1. package/components/Handle/README.md +0 -20
  2. package/components/Handle/index.js +44 -7
  3. package/components/locale.js +8 -2
  4. package/dist/1.tntd.js +1 -1
  5. package/dist/stats.json +24430 -24390
  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 +100 -33
  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 +119 -33
  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,23 +1,55 @@
1
1
  "use strict";
2
2
 
3
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
3
+ function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
4
+
4
5
  Object.defineProperty(exports, "__esModule", {
5
6
  value: true
6
7
  });
7
8
  exports["default"] = void 0;
9
+
8
10
  var _react = require("react");
11
+
9
12
  var _styledComponents = _interopRequireWildcard(require("styled-components"));
13
+
10
14
  var _Icon = _interopRequireDefault(require("../Icon"));
15
+
11
16
  var _HeaderActions = _interopRequireDefault(require("./HeaderActions"));
17
+
12
18
  var _AppList = _interopRequireDefault(require("./AppList"));
19
+
13
20
  var _OrgAppList = _interopRequireDefault(require("./OrgAppList"));
14
- var _templateObject, _templateObject2;
21
+
15
22
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
16
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
17
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
18
- 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); }
23
+
24
+ function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
25
+
26
+ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
27
+
28
+ 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); }
29
+
30
+ function _templateObject2() {
31
+ var data = _taggedTemplateLiteral(["\n flex: 1;\n .isInIframe & {\n display: none;\n }\n"]);
32
+
33
+ _templateObject2 = function _templateObject2() {
34
+ return data;
35
+ };
36
+
37
+ return data;
38
+ }
39
+
40
+ function _templateObject() {
41
+ 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"]);
42
+
43
+ _templateObject = function _templateObject() {
44
+ return data;
45
+ };
46
+
47
+ return data;
48
+ }
49
+
19
50
  function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
20
- var Header = _styledComponents["default"].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) {
51
+
52
+ var Header = _styledComponents["default"].div(_templateObject(), function (props) {
21
53
  return "".concat(props.theme.headerHeight, "px");
22
54
  }, function (props) {
23
55
  return "".concat(props.theme.blueBgColor, " !important");
@@ -32,33 +64,35 @@ var Header = _styledComponents["default"].div(_templateObject || (_templateObjec
32
64
  }, function (props) {
33
65
  return "".concat(props.theme.primaryTextColor);
34
66
  });
35
- var Content = _styledComponents["default"].div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n flex: 1;\n .isInIframe & {\n display: none;\n }\n"])));
67
+
68
+ var Content = _styledComponents["default"].div(_templateObject2());
69
+
36
70
  var _default = (0, _styledComponents.withTheme)(function (props) {
37
71
  var collapsed = props.collapsed,
38
- _props$collapseIconPl = props.collapseIconPlacement,
39
- collapseIconPlacement = _props$collapseIconPl === void 0 ? 'right' : _props$collapseIconPl,
40
- selectedAppKey = props.selectedAppKey,
41
- appList = props.appList,
42
- orgAppShow = props.orgAppShow,
43
- orgAppList = props.orgAppList,
44
- orgTreeConfig = props.orgTreeConfig,
45
- selectedOrgKey = props.selectedOrgKey,
46
- orgList = props.orgList,
47
- headerTabs = props.headerTabs,
48
- onAppChange = props.onAppChange,
49
- onOrgChange = props.onOrgChange,
50
- onCollapseChange = props.onCollapseChange,
51
- extraActions = props.extraActions;
72
+ _props$collapseIconPl = props.collapseIconPlacement,
73
+ collapseIconPlacement = _props$collapseIconPl === void 0 ? 'right' : _props$collapseIconPl,
74
+ selectedAppKey = props.selectedAppKey,
75
+ appList = props.appList,
76
+ orgAppShow = props.orgAppShow,
77
+ orgAppList = props.orgAppList,
78
+ orgTreeConfig = props.orgTreeConfig,
79
+ selectedOrgKey = props.selectedOrgKey,
80
+ orgList = props.orgList,
81
+ headerTabs = props.headerTabs,
82
+ onAppChange = props.onAppChange,
83
+ onOrgChange = props.onOrgChange,
84
+ onCollapseChange = props.onCollapseChange,
85
+ extraActions = props.extraActions;
52
86
  var headerRef = (0, _react.useRef)();
53
- return /*#__PURE__*/React.createElement(Header, {
87
+ return React.createElement(Header, {
54
88
  className: "tnt-layout-header",
55
89
  ref: headerRef
56
- }, collapseIconPlacement === 'right' && /*#__PURE__*/React.createElement("div", {
90
+ }, collapseIconPlacement === 'right' && React.createElement("div", {
57
91
  className: "sidebar-collapsed-controller",
58
92
  onClick: onCollapseChange
59
- }, /*#__PURE__*/React.createElement(_Icon["default"], {
93
+ }, React.createElement(_Icon["default"], {
60
94
  type: "menu-".concat(collapsed ? 'unfold' : 'fold')
61
- })), headerTabs, orgList && /*#__PURE__*/React.createElement(_OrgAppList["default"], {
95
+ })), headerTabs, orgList && React.createElement(_OrgAppList["default"], {
62
96
  orgAppShow: orgAppShow,
63
97
  selectedOrgKey: selectedOrgKey,
64
98
  orgList: orgList,
@@ -68,14 +102,15 @@ var _default = (0, _styledComponents.withTheme)(function (props) {
68
102
  orgAppList: orgAppList,
69
103
  onAppChange: onAppChange,
70
104
  headerTabs: headerTabs
71
- }), appList && !orgList && /*#__PURE__*/React.createElement(_AppList["default"], {
105
+ }), appList && !orgList && React.createElement(_AppList["default"], {
72
106
  items: appList,
73
107
  selectedKey: selectedAppKey,
74
108
  onChange: onAppChange
75
- }), /*#__PURE__*/React.createElement(Content, {
109
+ }), React.createElement(Content, {
76
110
  className: "tnt-layout-header-content"
77
- }, props.children), /*#__PURE__*/React.createElement(_HeaderActions["default"], _extends({}, props, {
111
+ }, props.children), React.createElement(_HeaderActions["default"], _extends({}, props, {
78
112
  headerRef: headerRef
79
113
  }), extraActions));
80
114
  });
115
+
81
116
  exports["default"] = _default;
@@ -1,87 +1,115 @@
1
1
  "use strict";
2
2
 
3
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
3
+ function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
4
+
4
5
  Object.defineProperty(exports, "__esModule", {
5
6
  value: true
6
7
  });
7
8
  exports["default"] = void 0;
9
+
8
10
  require("antd/lib/divider/style");
11
+
9
12
  var _divider = _interopRequireDefault(require("antd/lib/divider"));
13
+
10
14
  var _styledComponents = _interopRequireWildcard(require("styled-components"));
15
+
11
16
  var _GlobalNavigation = _interopRequireDefault(require("./GlobalNavigation"));
17
+
12
18
  var _Language = _interopRequireDefault(require("./Language"));
19
+
13
20
  var _Theme = _interopRequireDefault(require("./Theme"));
21
+
14
22
  var _CompatibleLanguage = _interopRequireDefault(require("./CompatibleLanguage"));
23
+
15
24
  var _Application = _interopRequireDefault(require("./Application"));
25
+
16
26
  var _Avatar = _interopRequireDefault(require("./Avatar"));
17
- var _excluded = ["type", "config", "theme", "userInfo", "menus", "apps", "extraActions", "headerRef", "onLanguageChange", "onThemeChange", "onApplicationChange", "onAppChange", "onOrgChange", "onCollapseChange", "onPersonalSetting", "onChangePassword", "onLogout", "onLogoClick", "AvatarCustom"];
18
- var _templateObject;
19
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
20
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
27
+
28
+ function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
29
+
30
+ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
31
+
21
32
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
33
+
22
34
  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; }
35
+
23
36
  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; }
37
+
38
+ function _templateObject() {
39
+ 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"]);
40
+
41
+ _templateObject = function _templateObject() {
42
+ return data;
43
+ };
44
+
45
+ return data;
46
+ }
47
+
24
48
  function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
25
- var Actions = _styledComponents["default"].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) {
49
+
50
+ var Actions = _styledComponents["default"].ul(_templateObject(), function (props) {
26
51
  return "".concat(props.theme.headerHeight, "px");
27
52
  }, function (props) {
28
53
  return "".concat(props.theme.headerActionsColor);
29
54
  });
55
+
30
56
  var _default = (0, _styledComponents.withTheme)(function (props) {
31
57
  var type = props.type,
32
- _props$config = props.config,
33
- _props$config2 = _props$config === void 0 ? {} : _props$config,
34
- _props$config2$theme = _props$config2.theme,
35
- theme = _props$config2$theme === void 0 ? true : _props$config2$theme,
36
- _props$config2$avatar = _props$config2.avatar,
37
- avatar = _props$config2$avatar === void 0 ? true : _props$config2$avatar,
38
- _props$config2$langua = _props$config2.language,
39
- language = _props$config2$langua === void 0 ? true : _props$config2$langua,
40
- _props$config2$applic = _props$config2.application,
41
- application = _props$config2$applic === void 0 ? false : _props$config2$applic,
42
- _props$config2$global = _props$config2.globalNavigation,
43
- globalNavigation = _props$config2$global === void 0 ? false : _props$config2$global,
44
- compatible = props.theme.compatible,
45
- _props$userInfo = props.userInfo,
46
- userInfo = _props$userInfo === void 0 ? {} : _props$userInfo,
47
- menus = props.menus,
48
- apps = props.apps,
49
- extraActions = props.extraActions,
50
- headerRef = props.headerRef,
51
- onLanguageChange = props.onLanguageChange,
52
- onThemeChange = props.onThemeChange,
53
- onApplicationChange = props.onApplicationChange,
54
- onAppChange = props.onAppChange,
55
- onOrgChange = props.onOrgChange,
56
- onCollapseChange = props.onCollapseChange,
57
- onPersonalSetting = props.onPersonalSetting,
58
- onChangePassword = props.onChangePassword,
59
- onLogout = props.onLogout,
60
- onLogoClick = props.onLogoClick,
61
- AvatarCustom = props.AvatarCustom,
62
- rest = _objectWithoutProperties(props, _excluded);
63
- return /*#__PURE__*/React.createElement(Actions, rest, extraActions, globalNavigation && /*#__PURE__*/React.createElement(_GlobalNavigation["default"], {
58
+ _props$config = props.config;
59
+ _props$config = _props$config === void 0 ? {} : _props$config;
60
+
61
+ var _props$config$theme = _props$config.theme,
62
+ theme = _props$config$theme === void 0 ? true : _props$config$theme,
63
+ _props$config$avatar = _props$config.avatar,
64
+ avatar = _props$config$avatar === void 0 ? true : _props$config$avatar,
65
+ _props$config$languag = _props$config.language,
66
+ language = _props$config$languag === void 0 ? true : _props$config$languag,
67
+ _props$config$applica = _props$config.application,
68
+ application = _props$config$applica === void 0 ? false : _props$config$applica,
69
+ _props$config$globalN = _props$config.globalNavigation,
70
+ globalNavigation = _props$config$globalN === void 0 ? false : _props$config$globalN,
71
+ compatible = props.theme.compatible,
72
+ _props$userInfo = props.userInfo,
73
+ userInfo = _props$userInfo === void 0 ? {} : _props$userInfo,
74
+ menus = props.menus,
75
+ apps = props.apps,
76
+ extraActions = props.extraActions,
77
+ headerRef = props.headerRef,
78
+ onLanguageChange = props.onLanguageChange,
79
+ onThemeChange = props.onThemeChange,
80
+ onApplicationChange = props.onApplicationChange,
81
+ onAppChange = props.onAppChange,
82
+ onOrgChange = props.onOrgChange,
83
+ onCollapseChange = props.onCollapseChange,
84
+ onPersonalSetting = props.onPersonalSetting,
85
+ onChangePassword = props.onChangePassword,
86
+ onLogout = props.onLogout,
87
+ onLogoClick = props.onLogoClick,
88
+ AvatarCustom = props.AvatarCustom,
89
+ rest = _objectWithoutProperties(props, ["type", "config", "theme", "userInfo", "menus", "apps", "extraActions", "headerRef", "onLanguageChange", "onThemeChange", "onApplicationChange", "onAppChange", "onOrgChange", "onCollapseChange", "onPersonalSetting", "onChangePassword", "onLogout", "onLogoClick", "AvatarCustom"]);
90
+
91
+ return React.createElement(Actions, rest, extraActions, globalNavigation && React.createElement(_GlobalNavigation["default"], {
64
92
  headerRef: headerRef,
65
93
  menus: menus
66
- }), type !== 'enterprise' && (!compatible ? /*#__PURE__*/React.createElement(React.Fragment, null, language && /*#__PURE__*/React.createElement(_Language["default"], {
94
+ }), type !== 'enterprise' && (!compatible ? React.createElement(React.Fragment, null, language && React.createElement(_Language["default"], {
67
95
  language: userInfo.lang,
68
96
  onChange: onLanguageChange
69
- }), theme && /*#__PURE__*/React.createElement(_Theme["default"], {
97
+ }), theme && React.createElement(_Theme["default"], {
70
98
  theme: userInfo.theme,
71
99
  onChange: onThemeChange
72
- })) : /*#__PURE__*/React.createElement(_CompatibleLanguage["default"], {
100
+ })) : React.createElement(_CompatibleLanguage["default"], {
73
101
  config: props.config,
74
102
  language: userInfo.lang,
75
103
  theme: userInfo.theme,
76
104
  onLanguageChange: onLanguageChange,
77
105
  onThemeChange: onThemeChange
78
- })), application && /*#__PURE__*/React.createElement(_Application["default"], {
106
+ })), application && React.createElement(_Application["default"], {
79
107
  language: userInfo.lang,
80
108
  apps: apps,
81
109
  onChange: onApplicationChange
82
- }), avatar && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(_divider["default"], {
110
+ }), avatar && React.createElement(React.Fragment, null, React.createElement(_divider["default"], {
83
111
  type: "vertical"
84
- }), AvatarCustom ? /*#__PURE__*/React.createElement(AvatarCustom, {
112
+ }), AvatarCustom ? React.createElement(AvatarCustom, {
85
113
  userInfo: userInfo,
86
114
  onPersonalSetting: onPersonalSetting,
87
115
  onChangePassword: onChangePassword,
@@ -92,7 +120,7 @@ var _default = (0, _styledComponents.withTheme)(function (props) {
92
120
  language: language
93
121
  },
94
122
  onLanguageChange: onLanguageChange
95
- }) : /*#__PURE__*/React.createElement(_Avatar["default"], {
123
+ }) : React.createElement(_Avatar["default"], {
96
124
  userInfo: userInfo,
97
125
  onPersonalSetting: onPersonalSetting,
98
126
  onChangePassword: onChangePassword,
@@ -104,4 +132,5 @@ var _default = (0, _styledComponents.withTheme)(function (props) {
104
132
  }
105
133
  })));
106
134
  });
135
+
107
136
  exports["default"] = _default;
@@ -1,30 +1,63 @@
1
1
  "use strict";
2
2
 
3
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
3
+ function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
4
+
4
5
  Object.defineProperty(exports, "__esModule", {
5
6
  value: true
6
7
  });
7
8
  exports["default"] = exports.HeaderNavs = void 0;
9
+
8
10
  var _react = require("react");
11
+
9
12
  var _styledComponents = _interopRequireWildcard(require("styled-components"));
13
+
10
14
  var _classnames = _interopRequireDefault(require("classnames"));
15
+
11
16
  var _lodash = require("lodash");
12
- var _excluded = ["theme", "navs", "onChange", "onSelect"];
13
- var _templateObject, _templateObject2;
17
+
14
18
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
15
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
16
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
17
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
18
- 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."); }
19
- 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); }
20
- 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; }
21
- 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; } }
19
+
20
+ function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
21
+
22
+ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
23
+
24
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }
25
+
26
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); }
27
+
28
+ function _iterableToArrayLimit(arr, i) { if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) { return; } var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
29
+
22
30
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
31
+
23
32
  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; }
33
+
24
34
  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; }
35
+
36
+ function _templateObject2() {
37
+ 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"]);
38
+
39
+ _templateObject2 = function _templateObject2() {
40
+ return data;
41
+ };
42
+
43
+ return data;
44
+ }
45
+
46
+ function _templateObject() {
47
+ var data = _taggedTemplateLiteral(["\n margin: 0;\n padding: 0;\n list-style: none;\n text-align: right;\n"]);
48
+
49
+ _templateObject = function _templateObject() {
50
+ return data;
51
+ };
52
+
53
+ return data;
54
+ }
55
+
25
56
  function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
26
- var Navs = _styledComponents["default"].ul(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n margin: 0;\n padding: 0;\n list-style: none;\n text-align: right;\n"])));
27
- var NavItem = _styledComponents["default"].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) {
57
+
58
+ var Navs = _styledComponents["default"].ul(_templateObject());
59
+
60
+ var NavItem = _styledComponents["default"].li(_templateObject2(), function (props) {
28
61
  return props.theme.size === 'large' ? '60px' : '50px';
29
62
  }, function (props) {
30
63
  return props.theme.secondaryTextColor;
@@ -33,30 +66,35 @@ var NavItem = _styledComponents["default"].li(_templateObject2 || (_templateObje
33
66
  }, function (props) {
34
67
  return props.theme.primaryColor;
35
68
  });
69
+
36
70
  var HeaderNavs = (0, _styledComponents.withTheme)(function (_ref) {
37
71
  var theme = _ref.theme,
38
- _ref$navs = _ref.navs,
39
- navs = _ref$navs === void 0 ? [] : _ref$navs,
40
- onChange = _ref.onChange,
41
- onSelect = _ref.onSelect,
42
- props = _objectWithoutProperties(_ref, _excluded);
72
+ _ref$navs = _ref.navs,
73
+ navs = _ref$navs === void 0 ? [] : _ref$navs,
74
+ onChange = _ref.onChange,
75
+ onSelect = _ref.onSelect,
76
+ props = _objectWithoutProperties(_ref, ["theme", "navs", "onChange", "onSelect"]);
77
+
43
78
  var _useState = (0, _react.useState)(props.selectedKey || (0, _lodash.get)(navs, '0.key')),
44
- _useState2 = _slicedToArray(_useState, 2),
45
- selectedKey = _useState2[0],
46
- setSelectedKey = _useState2[1];
79
+ _useState2 = _slicedToArray(_useState, 2),
80
+ selectedKey = _useState2[0],
81
+ setSelectedKey = _useState2[1];
82
+
47
83
  var onClickNav = function onClickNav(nav) {
48
84
  setSelectedKey(nav.key);
49
85
  onSelect && onSelect(nav);
86
+
50
87
  if (selectedKey !== nav.key) {
51
88
  onChange && onChange(nav);
52
89
  setSelectedKey(nav.key);
53
90
  }
54
91
  };
92
+
55
93
  (0, _react.useEffect)(function () {
56
94
  setSelectedKey(props.selectedKey || (0, _lodash.get)(navs, '0.key'));
57
95
  }, [navs, props.selectedKey]);
58
- return /*#__PURE__*/React.createElement(Navs, props, navs.map(function (nav) {
59
- return /*#__PURE__*/React.createElement(NavItem, {
96
+ return React.createElement(Navs, props, navs.map(function (nav) {
97
+ return React.createElement(NavItem, {
60
98
  key: nav.key,
61
99
  theme: theme,
62
100
  className: (0, _classnames["default"])({
@@ -65,7 +103,7 @@ var HeaderNavs = (0, _styledComponents.withTheme)(function (_ref) {
65
103
  onClick: function onClick() {
66
104
  return onClickNav(nav);
67
105
  }
68
- }, /*#__PURE__*/React.createElement("a", {
106
+ }, React.createElement("a", {
69
107
  href: nav.key,
70
108
  onClick: function onClick(evt) {
71
109
  return evt.preventDefault();