tntd 1.4.9 → 1.4.10

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.
@@ -25,7 +25,7 @@ function _templateObject3() {
25
25
  }
26
26
 
27
27
  function _templateObject2() {
28
- var data = _taggedTemplateLiteral(["\n margin: 14px 0 0;\n padding: 0;\n list-style: none;\n text-align: left;\n height: 36px;\n line-height: 36px;\n flex: 1;\n white-space: nowrap;\n padding-right: 40px;\n transition: transform .25s linear;\n position:absolute;\n"]);
28
+ var data = _taggedTemplateLiteral(["\n margin: 14px 0 0;\n padding: 0;\n list-style: none;\n text-align: left;\n height: 36px;\n line-height: 36px;\n flex: 1;\n white-space: nowrap;\n padding-right: 40px;\n transition: transform 0.25s linear;\n position: absolute;\n"]);
29
29
 
30
30
  _templateObject2 = function _templateObject2() {
31
31
  return data;
@@ -46,17 +46,17 @@ function _templateObject() {
46
46
 
47
47
  function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
48
48
 
49
- import { useState, useEffect, useRef } from 'react';
50
- import styled, { withTheme } from 'styled-components';
51
- import cn from 'classnames';
52
- import { get } from 'lodash';
53
- import Icon from '../Icon';
49
+ import { useState, useEffect, useRef } from "react";
50
+ import styled, { withTheme } from "styled-components";
51
+ import cn from "classnames";
52
+ import { get } from "lodash";
53
+ import Icon from "../Icon";
54
54
  var TabsContainer = styled.div(_templateObject(), function (props) {
55
55
  return "".concat(props.theme.blueBgColor);
56
56
  });
57
57
  var Tabs = styled.ul(_templateObject2());
58
58
  var TabItem = styled.li(_templateObject3(), function (props) {
59
- return props.theme.size === 'large' ? '46px' : '36px';
59
+ return props.theme.size === "large" ? "46px" : "36px";
60
60
  }, function (props) {
61
61
  return props.theme.headerActionsColor;
62
62
  }, function (props) {
@@ -77,9 +77,10 @@ export var HeaderTabs = withTheme(function (_ref) {
77
77
  appListVisible = _ref.appListVisible,
78
78
  orgListVisible = _ref.orgListVisible,
79
79
  orgAppListVisible = _ref.orgAppListVisible,
80
- props = _objectWithoutProperties(_ref, ["theme", "className", "tabs", "onTabChange", "onTabSelect", "onTabClose", "appListVisible", "orgListVisible", "orgAppListVisible"]);
80
+ language = _ref.language,
81
+ props = _objectWithoutProperties(_ref, ["theme", "className", "tabs", "onTabChange", "onTabSelect", "onTabClose", "appListVisible", "orgListVisible", "orgAppListVisible", "language"]);
81
82
 
82
- var _useState = useState(props.selectedKey || get(tabs, '0.key')),
83
+ var _useState = useState(props.selectedKey || get(tabs, "0.key")),
83
84
  _useState2 = _slicedToArray(_useState, 2),
84
85
  selectedKey = _useState2[0],
85
86
  setSelectedKey = _useState2[1];
@@ -143,7 +144,7 @@ export var HeaderTabs = withTheme(function (_ref) {
143
144
  var tabsDom = getTabsDom();
144
145
  var parentBBox = tabsDom.parentNode.getBoundingClientRect();
145
146
  var parentWidth = parentBBox.width - 32;
146
- var x = Math.abs(+tabsDom.style.transform.replace(/[^\d.-]/g, ''));
147
+ var x = Math.abs(+tabsDom.style.transform.replace(/[^\d.-]/g, ""));
147
148
  var index = Math.ceil(x / 130);
148
149
  var trueX = index * 130;
149
150
  var newX = Math.min(0, -(trueX - parentWidth));
@@ -160,7 +161,7 @@ export var HeaderTabs = withTheme(function (_ref) {
160
161
  var parentBBox = tabsDom.parentNode.getBoundingClientRect();
161
162
  var parentWidth = parentBBox.width - 32;
162
163
  var width = tabItems.length * 130;
163
- var x = Math.abs(+tabsDom.style.transform.replace(/[^\d.-]/g, ''));
164
+ var x = Math.abs(+tabsDom.style.transform.replace(/[^\d.-]/g, ""));
164
165
  var index = Math.floor(x / 130);
165
166
  var trueX = index * 130;
166
167
  var newX = Math.max(-(width - parentWidth), -(trueX + parentWidth));
@@ -179,7 +180,7 @@ export var HeaderTabs = withTheme(function (_ref) {
179
180
  }));
180
181
  if (index === -1) return;
181
182
  var tabsDom = getTabsDom();
182
- var x = -+tabsDom.style.transform.replace(/[^\d.-]/g, '');
183
+ var x = -+tabsDom.style.transform.replace(/[^\d.-]/g, "");
183
184
  var bbox = {
184
185
  left: index * 130,
185
186
  right: (index + 1) * 130
@@ -210,7 +211,7 @@ export var HeaderTabs = withTheme(function (_ref) {
210
211
  };
211
212
 
212
213
  useEffect(function () {
213
- setSelectedKey(props.selectedKey || get(tabs, '0.key')); // const t = [{'code':'tagdata','enName':'tagdata','icon':'layer-color','menuName':'打标数据管理打标数据管理打标数据管理','path':'/orion/tag/datalist','key':'tagdata','name':'打标数据管理打标数据管理打标数据管理'},{'code':'taglist','enName':'taglist','icon':'home','menuName':'标签管理','path':'http://baidu.com/orion/tag/list','key':'taglist','name':'标签管理'},{'code':'relation1','enName':'dadicasesearch1','icon':'home','menuName':'案件检索1','path':'/orion/case/relation1','key':'relation1','name':'案件检索1'},{'code':'dadicasesearch-0','enName':'dadicasesearch','icon':'home','menuName':'案件检索-0','path':'/orion/case/relation0','key':'dadicasesearch-0','name':'案件检索-0'},{'code':'dadicasesearch-1','enName':'dadicasesearch','icon':'home','menuName':'案件检索-1','path':'/orion/case/relation1','key':'dadicasesearch-1','name':'案件检索-1'},{'code':'dadicasesearch-2','enName':'dadicasesearch','icon':'home','menuName':'案件检索-2','path':'/orion/case/relation2','key':'dadicasesearch-2','name':'案件检索-2'},{'code':'dadicasesearch-3','enName':'dadicasesearch','icon':'home','menuName':'案件检索-3','path':'/orion/case/relation3','key':'dadicasesearch-3','name':'案件检索-3'},{'code':'dadicasesearch-4','enName':'dadicasesearch','icon':'home','menuName':'案件检索-4','path':'/orion/case/relation4','key':'dadicasesearch-4','name':'案件检索-4'},{'code':'dadicasesearch-5','enName':'dadicasesearch','icon':'home','menuName':'案件检索-5','path':'/orion/case/relation5','key':'dadicasesearch-5','name':'案件检索-5'},{'code':'dadicasesearch-6','enName':'dadicasesearch','icon':'home','menuName':'案件检索-6','path':'/orion/case/relation6','key':'dadicasesearch-6','name':'案件检索-6'},{'code':'dadicasesearch-7','enName':'dadicasesearch','icon':'home','menuName':'案件检索-7','path':'/orion/case/relation7','key':'dadicasesearch-7','name':'案件检索-7'},{'code':'dadicasesearch-8','enName':'dadicasesearch','icon':'home','menuName':'案件检索-8','path':'/orion/case/relation8','key':'dadicasesearch-8','name':'案件检索-8'}] ;
214
+ setSelectedKey(props.selectedKey || get(tabs, "0.key")); // const t = [{'code':'tagdata','enName':'tagdata','icon':'layer-color','menuName':'打标数据管理打标数据管理打标数据管理','path':'/orion/tag/datalist','key':'tagdata','name':'打标数据管理打标数据管理打标数据管理'},{'code':'taglist','enName':'taglist','icon':'home','menuName':'标签管理','path':'http://baidu.com/orion/tag/list','key':'taglist','name':'标签管理'},{'code':'relation1','enName':'dadicasesearch1','icon':'home','menuName':'案件检索1','path':'/orion/case/relation1','key':'relation1','name':'案件检索1'},{'code':'dadicasesearch-0','enName':'dadicasesearch','icon':'home','menuName':'案件检索-0','path':'/orion/case/relation0','key':'dadicasesearch-0','name':'案件检索-0'},{'code':'dadicasesearch-1','enName':'dadicasesearch','icon':'home','menuName':'案件检索-1','path':'/orion/case/relation1','key':'dadicasesearch-1','name':'案件检索-1'},{'code':'dadicasesearch-2','enName':'dadicasesearch','icon':'home','menuName':'案件检索-2','path':'/orion/case/relation2','key':'dadicasesearch-2','name':'案件检索-2'},{'code':'dadicasesearch-3','enName':'dadicasesearch','icon':'home','menuName':'案件检索-3','path':'/orion/case/relation3','key':'dadicasesearch-3','name':'案件检索-3'},{'code':'dadicasesearch-4','enName':'dadicasesearch','icon':'home','menuName':'案件检索-4','path':'/orion/case/relation4','key':'dadicasesearch-4','name':'案件检索-4'},{'code':'dadicasesearch-5','enName':'dadicasesearch','icon':'home','menuName':'案件检索-5','path':'/orion/case/relation5','key':'dadicasesearch-5','name':'案件检索-5'},{'code':'dadicasesearch-6','enName':'dadicasesearch','icon':'home','menuName':'案件检索-6','path':'/orion/case/relation6','key':'dadicasesearch-6','name':'案件检索-6'},{'code':'dadicasesearch-7','enName':'dadicasesearch','icon':'home','menuName':'案件检索-7','path':'/orion/case/relation7','key':'dadicasesearch-7','name':'案件检索-7'},{'code':'dadicasesearch-8','enName':'dadicasesearch','icon':'home','menuName':'案件检索-8','path':'/orion/case/relation8','key':'dadicasesearch-8','name':'案件检索-8'}] ;
214
215
 
215
216
  setTabItems(tabs);
216
217
  }, [tabs, props.selectedKey]);
@@ -223,7 +224,7 @@ export var HeaderTabs = withTheme(function (_ref) {
223
224
  translateTabsDom(tabItems, selectedKey);
224
225
  }, [tabItems, selectedKey, appListVisible, orgListVisible, orgAppListVisible]);
225
226
  return React.createElement(TabsContainer, _extends({}, props, {
226
- className: cn('tnt-layout-header-tabs', _defineProperty({}, className, className))
227
+ className: cn("tnt-layout-header-tabs", _defineProperty({}, className, className))
227
228
  }), React.createElement(Tabs, {
228
229
  className: "tnt-layout-header-tabs-content",
229
230
  ref: tabsRef
@@ -245,7 +246,10 @@ export var HeaderTabs = withTheme(function (_ref) {
245
246
  onClick: function onClick(evt) {
246
247
  return evt.preventDefault();
247
248
  }
248
- }, tab.name), tabItems.length > 1 && React.createElement(Icon, {
249
+ }, {
250
+ cn: tab.name,
251
+ en: tab.enName || tab.name
252
+ }[language || "cn"]), tab.closable !== false && tabItems.length > 1 && React.createElement(Icon, {
249
253
  type: "close",
250
254
  onClick: closeTabHandle.bind(null, tab, index)
251
255
  }));
@@ -50,7 +50,7 @@ function _templateObject3() {
50
50
  }
51
51
 
52
52
  function _templateObject2() {
53
- var data = _taggedTemplateLiteral(["\n margin: 14px 0 0;\n padding: 0;\n list-style: none;\n text-align: left;\n height: 36px;\n line-height: 36px;\n flex: 1;\n white-space: nowrap;\n padding-right: 40px;\n transition: transform .25s linear;\n position:absolute;\n"]);
53
+ var data = _taggedTemplateLiteral(["\n margin: 14px 0 0;\n padding: 0;\n list-style: none;\n text-align: left;\n height: 36px;\n line-height: 36px;\n flex: 1;\n white-space: nowrap;\n padding-right: 40px;\n transition: transform 0.25s linear;\n position: absolute;\n"]);
54
54
 
55
55
  _templateObject2 = function _templateObject2() {
56
56
  return data;
@@ -78,7 +78,7 @@ var TabsContainer = _styledComponents["default"].div(_templateObject(), function
78
78
  var Tabs = _styledComponents["default"].ul(_templateObject2());
79
79
 
80
80
  var TabItem = _styledComponents["default"].li(_templateObject3(), function (props) {
81
- return props.theme.size === 'large' ? '46px' : '36px';
81
+ return props.theme.size === "large" ? "46px" : "36px";
82
82
  }, function (props) {
83
83
  return props.theme.headerActionsColor;
84
84
  }, function (props) {
@@ -100,9 +100,10 @@ var HeaderTabs = (0, _styledComponents.withTheme)(function (_ref) {
100
100
  appListVisible = _ref.appListVisible,
101
101
  orgListVisible = _ref.orgListVisible,
102
102
  orgAppListVisible = _ref.orgAppListVisible,
103
- props = _objectWithoutProperties(_ref, ["theme", "className", "tabs", "onTabChange", "onTabSelect", "onTabClose", "appListVisible", "orgListVisible", "orgAppListVisible"]);
103
+ language = _ref.language,
104
+ props = _objectWithoutProperties(_ref, ["theme", "className", "tabs", "onTabChange", "onTabSelect", "onTabClose", "appListVisible", "orgListVisible", "orgAppListVisible", "language"]);
104
105
 
105
- var _useState = (0, _react.useState)(props.selectedKey || (0, _lodash.get)(tabs, '0.key')),
106
+ var _useState = (0, _react.useState)(props.selectedKey || (0, _lodash.get)(tabs, "0.key")),
106
107
  _useState2 = _slicedToArray(_useState, 2),
107
108
  selectedKey = _useState2[0],
108
109
  setSelectedKey = _useState2[1];
@@ -166,7 +167,7 @@ var HeaderTabs = (0, _styledComponents.withTheme)(function (_ref) {
166
167
  var tabsDom = getTabsDom();
167
168
  var parentBBox = tabsDom.parentNode.getBoundingClientRect();
168
169
  var parentWidth = parentBBox.width - 32;
169
- var x = Math.abs(+tabsDom.style.transform.replace(/[^\d.-]/g, ''));
170
+ var x = Math.abs(+tabsDom.style.transform.replace(/[^\d.-]/g, ""));
170
171
  var index = Math.ceil(x / 130);
171
172
  var trueX = index * 130;
172
173
  var newX = Math.min(0, -(trueX - parentWidth));
@@ -183,7 +184,7 @@ var HeaderTabs = (0, _styledComponents.withTheme)(function (_ref) {
183
184
  var parentBBox = tabsDom.parentNode.getBoundingClientRect();
184
185
  var parentWidth = parentBBox.width - 32;
185
186
  var width = tabItems.length * 130;
186
- var x = Math.abs(+tabsDom.style.transform.replace(/[^\d.-]/g, ''));
187
+ var x = Math.abs(+tabsDom.style.transform.replace(/[^\d.-]/g, ""));
187
188
  var index = Math.floor(x / 130);
188
189
  var trueX = index * 130;
189
190
  var newX = Math.max(-(width - parentWidth), -(trueX + parentWidth));
@@ -202,7 +203,7 @@ var HeaderTabs = (0, _styledComponents.withTheme)(function (_ref) {
202
203
  }));
203
204
  if (index === -1) return;
204
205
  var tabsDom = getTabsDom();
205
- var x = -+tabsDom.style.transform.replace(/[^\d.-]/g, '');
206
+ var x = -+tabsDom.style.transform.replace(/[^\d.-]/g, "");
206
207
  var bbox = {
207
208
  left: index * 130,
208
209
  right: (index + 1) * 130
@@ -233,7 +234,7 @@ var HeaderTabs = (0, _styledComponents.withTheme)(function (_ref) {
233
234
  };
234
235
 
235
236
  (0, _react.useEffect)(function () {
236
- setSelectedKey(props.selectedKey || (0, _lodash.get)(tabs, '0.key')); // const t = [{'code':'tagdata','enName':'tagdata','icon':'layer-color','menuName':'打标数据管理打标数据管理打标数据管理','path':'/orion/tag/datalist','key':'tagdata','name':'打标数据管理打标数据管理打标数据管理'},{'code':'taglist','enName':'taglist','icon':'home','menuName':'标签管理','path':'http://baidu.com/orion/tag/list','key':'taglist','name':'标签管理'},{'code':'relation1','enName':'dadicasesearch1','icon':'home','menuName':'案件检索1','path':'/orion/case/relation1','key':'relation1','name':'案件检索1'},{'code':'dadicasesearch-0','enName':'dadicasesearch','icon':'home','menuName':'案件检索-0','path':'/orion/case/relation0','key':'dadicasesearch-0','name':'案件检索-0'},{'code':'dadicasesearch-1','enName':'dadicasesearch','icon':'home','menuName':'案件检索-1','path':'/orion/case/relation1','key':'dadicasesearch-1','name':'案件检索-1'},{'code':'dadicasesearch-2','enName':'dadicasesearch','icon':'home','menuName':'案件检索-2','path':'/orion/case/relation2','key':'dadicasesearch-2','name':'案件检索-2'},{'code':'dadicasesearch-3','enName':'dadicasesearch','icon':'home','menuName':'案件检索-3','path':'/orion/case/relation3','key':'dadicasesearch-3','name':'案件检索-3'},{'code':'dadicasesearch-4','enName':'dadicasesearch','icon':'home','menuName':'案件检索-4','path':'/orion/case/relation4','key':'dadicasesearch-4','name':'案件检索-4'},{'code':'dadicasesearch-5','enName':'dadicasesearch','icon':'home','menuName':'案件检索-5','path':'/orion/case/relation5','key':'dadicasesearch-5','name':'案件检索-5'},{'code':'dadicasesearch-6','enName':'dadicasesearch','icon':'home','menuName':'案件检索-6','path':'/orion/case/relation6','key':'dadicasesearch-6','name':'案件检索-6'},{'code':'dadicasesearch-7','enName':'dadicasesearch','icon':'home','menuName':'案件检索-7','path':'/orion/case/relation7','key':'dadicasesearch-7','name':'案件检索-7'},{'code':'dadicasesearch-8','enName':'dadicasesearch','icon':'home','menuName':'案件检索-8','path':'/orion/case/relation8','key':'dadicasesearch-8','name':'案件检索-8'}] ;
237
+ setSelectedKey(props.selectedKey || (0, _lodash.get)(tabs, "0.key")); // const t = [{'code':'tagdata','enName':'tagdata','icon':'layer-color','menuName':'打标数据管理打标数据管理打标数据管理','path':'/orion/tag/datalist','key':'tagdata','name':'打标数据管理打标数据管理打标数据管理'},{'code':'taglist','enName':'taglist','icon':'home','menuName':'标签管理','path':'http://baidu.com/orion/tag/list','key':'taglist','name':'标签管理'},{'code':'relation1','enName':'dadicasesearch1','icon':'home','menuName':'案件检索1','path':'/orion/case/relation1','key':'relation1','name':'案件检索1'},{'code':'dadicasesearch-0','enName':'dadicasesearch','icon':'home','menuName':'案件检索-0','path':'/orion/case/relation0','key':'dadicasesearch-0','name':'案件检索-0'},{'code':'dadicasesearch-1','enName':'dadicasesearch','icon':'home','menuName':'案件检索-1','path':'/orion/case/relation1','key':'dadicasesearch-1','name':'案件检索-1'},{'code':'dadicasesearch-2','enName':'dadicasesearch','icon':'home','menuName':'案件检索-2','path':'/orion/case/relation2','key':'dadicasesearch-2','name':'案件检索-2'},{'code':'dadicasesearch-3','enName':'dadicasesearch','icon':'home','menuName':'案件检索-3','path':'/orion/case/relation3','key':'dadicasesearch-3','name':'案件检索-3'},{'code':'dadicasesearch-4','enName':'dadicasesearch','icon':'home','menuName':'案件检索-4','path':'/orion/case/relation4','key':'dadicasesearch-4','name':'案件检索-4'},{'code':'dadicasesearch-5','enName':'dadicasesearch','icon':'home','menuName':'案件检索-5','path':'/orion/case/relation5','key':'dadicasesearch-5','name':'案件检索-5'},{'code':'dadicasesearch-6','enName':'dadicasesearch','icon':'home','menuName':'案件检索-6','path':'/orion/case/relation6','key':'dadicasesearch-6','name':'案件检索-6'},{'code':'dadicasesearch-7','enName':'dadicasesearch','icon':'home','menuName':'案件检索-7','path':'/orion/case/relation7','key':'dadicasesearch-7','name':'案件检索-7'},{'code':'dadicasesearch-8','enName':'dadicasesearch','icon':'home','menuName':'案件检索-8','path':'/orion/case/relation8','key':'dadicasesearch-8','name':'案件检索-8'}] ;
237
238
 
238
239
  setTabItems(tabs);
239
240
  }, [tabs, props.selectedKey]);
@@ -246,7 +247,7 @@ var HeaderTabs = (0, _styledComponents.withTheme)(function (_ref) {
246
247
  translateTabsDom(tabItems, selectedKey);
247
248
  }, [tabItems, selectedKey, appListVisible, orgListVisible, orgAppListVisible]);
248
249
  return React.createElement(TabsContainer, _extends({}, props, {
249
- className: (0, _classnames["default"])('tnt-layout-header-tabs', _defineProperty({}, className, className))
250
+ className: (0, _classnames["default"])("tnt-layout-header-tabs", _defineProperty({}, className, className))
250
251
  }), React.createElement(Tabs, {
251
252
  className: "tnt-layout-header-tabs-content",
252
253
  ref: tabsRef
@@ -268,7 +269,10 @@ var HeaderTabs = (0, _styledComponents.withTheme)(function (_ref) {
268
269
  onClick: function onClick(evt) {
269
270
  return evt.preventDefault();
270
271
  }
271
- }, tab.name), tabItems.length > 1 && React.createElement(_Icon["default"], {
272
+ }, {
273
+ cn: tab.name,
274
+ en: tab.enName || tab.name
275
+ }[language || "cn"]), tab.closable !== false && tabItems.length > 1 && React.createElement(_Icon["default"], {
272
276
  type: "close",
273
277
  onClick: closeTabHandle.bind(null, tab, index)
274
278
  }));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tntd",
3
- "version": "1.4.9",
3
+ "version": "1.4.10",
4
4
  "description": "ued tnt design",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -1,113 +0,0 @@
1
- "use strict";
2
-
3
- function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
4
-
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports["default"] = void 0;
9
-
10
- var _react = require("react");
11
-
12
- var _styledComponents = _interopRequireWildcard(require("styled-components"));
13
-
14
- var _Icon = _interopRequireDefault(require("../../Icon"));
15
-
16
- var _AppList = _interopRequireDefault(require("../AppList"));
17
-
18
- var _OrgAppList = _interopRequireDefault(require("../OrgAppList"));
19
-
20
- var _HeaderActions = _interopRequireDefault(require("./HeaderActions"));
21
-
22
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
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\n .hasHeaderTabs & {\n background: #191D29;\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
-
50
- function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
51
-
52
- var Header = _styledComponents["default"].div(_templateObject(), function (props) {
53
- return "".concat(props.theme.headerHeight, "px");
54
- }, function (props) {
55
- return "".concat(props.theme.blueBgColor, " !important");
56
- }, function (props) {
57
- return "".concat(props.theme.headerHeight, "px");
58
- }, function (props) {
59
- return "".concat(props.theme.headerHeight, "px");
60
- }, function (props) {
61
- return "".concat(props.theme.headerHeight, "px");
62
- }, function (props) {
63
- return "".concat(props.theme.primaryTextColor);
64
- }, function (props) {
65
- return "".concat(props.theme.primaryTextColor);
66
- });
67
-
68
- var Content = _styledComponents["default"].div(_templateObject2());
69
-
70
- var _default = (0, _styledComponents.withTheme)(function (props) {
71
- var collapsed = props.collapsed,
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
- selectedOrgKey = props.selectedOrgKey,
79
- orgList = props.orgList,
80
- headerTabs = props.headerTabs,
81
- onAppChange = props.onAppChange,
82
- onOrgChange = props.onOrgChange,
83
- onCollapseChange = props.onCollapseChange,
84
- extraActions = props.extraActions;
85
- var headerRef = (0, _react.useRef)();
86
- return React.createElement(Header, {
87
- className: "tnt-layout-header",
88
- ref: headerRef
89
- }, collapseIconPlacement === 'right' && React.createElement("div", {
90
- className: "sidebar-collapsed-controller",
91
- onClick: onCollapseChange
92
- }, React.createElement(_Icon["default"], {
93
- type: "menu-".concat(collapsed ? 'unfold' : 'fold')
94
- })), headerTabs, orgList && React.createElement(_OrgAppList["default"], {
95
- orgAppShow: orgAppShow,
96
- selectedOrgKey: selectedOrgKey,
97
- orgList: orgList,
98
- onOrgChange: onOrgChange,
99
- selectedAppKey: selectedAppKey,
100
- orgAppList: orgAppList,
101
- onAppChange: onAppChange
102
- }), appList && !orgList && React.createElement(_AppList["default"], {
103
- items: appList,
104
- selectedKey: selectedAppKey,
105
- onChange: onAppChange
106
- }), React.createElement(Content, {
107
- className: "tnt-layout-header-content"
108
- }, props.children), React.createElement(_HeaderActions["default"], _extends({}, props, {
109
- headerRef: headerRef
110
- }), extraActions));
111
- });
112
-
113
- exports["default"] = _default;
@@ -1,104 +0,0 @@
1
- "use strict";
2
-
3
- function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
4
-
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports["default"] = void 0;
9
-
10
- require("antd/lib/divider/style");
11
-
12
- var _divider = _interopRequireDefault(require("antd/lib/divider"));
13
-
14
- var _styledComponents = _interopRequireWildcard(require("styled-components"));
15
-
16
- var _GlobalNavigation = _interopRequireDefault(require("../GlobalNavigation"));
17
-
18
- var _Application = _interopRequireDefault(require("../Application"));
19
-
20
- var _Avatar = _interopRequireDefault(require("./Avatar"));
21
-
22
- function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
23
-
24
- function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
25
-
26
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
27
-
28
- function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
29
-
30
- function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
31
-
32
- function _templateObject() {
33
- var data = _taggedTemplateLiteral(["\n list-style: none;\n display: inline-block;\n line-height: ", ";\n margin: 0 0 0 20px;\n .hasHeaderTabs & {\n margin: 0;\n }\n padding: 0;\n white-space: nowrap;\n\n .isInIframe & {\n display: none;\n }\n\n & > li {\n height: 100%;\n display: inline-block;\n vertical-align: top;\n cursor: pointer;\n font-size: 20px;\n margin: 0 7.5px;\n color: ", ";\n .large-size & {\n margin: 0 10px;\n }\n .tnt-themeS1 & {\n /* color: rgba(255,255,255,.85); */\n }\n &:last-of-type {\n margin-right: 0;\n }\n .hasHeaderTabs:not(.tnt-themeS1) & {\n color: rgba(255,255,255,.8);\n }\n }\n"]);
34
-
35
- _templateObject = function _templateObject() {
36
- return data;
37
- };
38
-
39
- return data;
40
- }
41
-
42
- function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
43
-
44
- var Actions = _styledComponents["default"].ul(_templateObject(), function (props) {
45
- return "".concat(props.theme.headerHeight, "px");
46
- }, function (props) {
47
- return "".concat(props.theme.headerActionsColor);
48
- });
49
-
50
- var _default = (0, _styledComponents.withTheme)(function (props) {
51
- var _props$config = props.config;
52
- _props$config = _props$config === void 0 ? {} : _props$config;
53
-
54
- var _props$config$theme = _props$config.theme,
55
- theme = _props$config$theme === void 0 ? true : _props$config$theme,
56
- _props$config$avatar = _props$config.avatar,
57
- avatar = _props$config$avatar === void 0 ? true : _props$config$avatar,
58
- _props$config$languag = _props$config.language,
59
- language = _props$config$languag === void 0 ? true : _props$config$languag,
60
- _props$config$applica = _props$config.application,
61
- application = _props$config$applica === void 0 ? false : _props$config$applica,
62
- _props$config$globalN = _props$config.globalNavigation,
63
- globalNavigation = _props$config$globalN === void 0 ? false : _props$config$globalN,
64
- compatible = props.theme.compatible,
65
- _props$userInfo = props.userInfo,
66
- userInfo = _props$userInfo === void 0 ? {} : _props$userInfo,
67
- menus = props.menus,
68
- apps = props.apps,
69
- extraActions = props.extraActions,
70
- headerRef = props.headerRef,
71
- onLanguageChange = props.onLanguageChange,
72
- onThemeChange = props.onThemeChange,
73
- onApplicationChange = props.onApplicationChange,
74
- onAppChange = props.onAppChange,
75
- onCollapseChange = props.onCollapseChange,
76
- onPersonalSetting = props.onPersonalSetting,
77
- onChangePassword = props.onChangePassword,
78
- onLogout = props.onLogout,
79
- onLogoClick = props.onLogoClick,
80
- rest = _objectWithoutProperties(props, ["config", "theme", "userInfo", "menus", "apps", "extraActions", "headerRef", "onLanguageChange", "onThemeChange", "onApplicationChange", "onAppChange", "onCollapseChange", "onPersonalSetting", "onChangePassword", "onLogout", "onLogoClick"]);
81
-
82
- return React.createElement(Actions, rest, extraActions, globalNavigation && React.createElement(_GlobalNavigation["default"], {
83
- headerRef: headerRef,
84
- menus: menus
85
- }), application && React.createElement(_Application["default"], {
86
- language: userInfo.lang,
87
- apps: apps,
88
- onChange: onApplicationChange
89
- }), avatar && React.createElement(React.Fragment, null, React.createElement(_divider["default"], {
90
- type: "vertical"
91
- }), React.createElement(_Avatar["default"], {
92
- userInfo: userInfo,
93
- onThemeChange: onThemeChange,
94
- onPersonalSetting: onPersonalSetting,
95
- onChangePassword: onChangePassword,
96
- onLogout: onLogout,
97
- config: {
98
- theme: theme,
99
- language: language
100
- }
101
- })));
102
- });
103
-
104
- exports["default"] = _default;