tntd 1.4.19 → 1.4.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/Layout/Avatar.js +4 -4
- package/components/Layout/EnterpriseLayout/Avatar.js +10 -7
- package/components/Layout/EnterpriseLayout/Language.js +5 -3
- package/components/Layout/EnterpriseLayout/Theme.js +6 -7
- package/components/Layout/EnterpriseLayout/index.js +1 -1
- package/components/Layout/HeaderActions.js +13 -10
- package/components/Layout/HeaderTabs.js +13 -14
- package/components/Layout/Layout.js +2 -0
- package/components/Layout/index.js +2 -1
- package/components/Layout/storage.js +12 -2
- package/components/Page/index.js +2 -2
- package/components/locale.js +7 -2
- package/dist/1.tntd.js +1 -12
- package/dist/stats.json +28424 -27998
- package/dist/tntd.css +1 -1
- package/dist/tntd.js +13 -7
- package/es/ArrayInput/icon.js +5 -5
- package/es/ArrayInput/index.js +76 -108
- package/es/AuthContext.js +1 -1
- package/es/Columns/index.js +31 -38
- package/es/DevelopmentLogin/LoginModal.js +32 -45
- package/es/DevelopmentLogin/index.js +13 -17
- package/es/Ellipsis/Svg/CopySVG.js +13 -13
- package/es/Ellipsis/Svg/TickSVG.js +8 -8
- package/es/Ellipsis/index.js +58 -69
- package/es/Handle/index.js +25 -35
- package/es/Icon/fonts/iconfont.js +7 -12
- package/es/Icon/index.js +10 -13
- package/es/Img/Contain.js +24 -29
- package/es/Img/Cover.js +40 -54
- package/es/Img/index.js +36 -45
- package/es/Layout/ActionsContext.js +3 -2
- package/es/Layout/AppList.js +37 -92
- package/es/Layout/Application.js +26 -72
- package/es/Layout/Avatar.js +32 -69
- package/es/Layout/CompatibleLanguage.js +39 -94
- package/es/Layout/EnterpriseLayout/Avatar.js +49 -79
- package/es/Layout/EnterpriseLayout/Language.js +19 -34
- package/es/Layout/EnterpriseLayout/Theme.js +23 -37
- package/es/Layout/EnterpriseLayout/index.js +14 -16
- package/es/Layout/GlobalNavigation/NavigationPopup.js +59 -170
- package/es/Layout/GlobalNavigation/index.js +20 -54
- package/es/Layout/Header.js +25 -46
- package/es/Layout/HeaderActions.js +52 -63
- package/es/Layout/HeaderNavs.js +20 -47
- package/es/Layout/HeaderTabs.js +61 -115
- package/es/Layout/Iconfont.js +1 -1
- package/es/Layout/Language.js +14 -32
- package/es/Layout/Layout.js +88 -108
- package/es/Layout/Logo.js +16 -32
- package/es/Layout/OrgAppList.js +62 -107
- package/es/Layout/SideMenu.js +63 -124
- package/es/Layout/Theme.js +23 -61
- package/es/Layout/index.js +29 -36
- package/es/Layout/paaslayout/CompactSideMenu.js +35 -74
- package/es/Layout/paaslayout/Header.js +22 -45
- package/es/Layout/paaslayout/Logo.js +3 -13
- package/es/Layout/paaslayout/SideMenu.js +39 -78
- package/es/Layout/paaslayout/index.js +75 -102
- package/es/Layout/storage.js +26 -9
- package/es/LoadingButton/index.js +15 -24
- package/es/Modal/index.js +38 -46
- package/es/Page/Box.js +34 -41
- package/es/Page/index.js +54 -68
- package/es/Page/utils.js +0 -5
- package/es/QueryForm/Field/Checkbox.js +5 -9
- package/es/QueryForm/Field/Select.js +31 -41
- package/es/QueryForm/Field/SelectInput.js +26 -41
- package/es/QueryForm/Field/fieldsMap.js +0 -1
- package/es/QueryForm/Field/index.js +41 -71
- package/es/QueryForm/createActions.js +6 -7
- package/es/QueryForm/index.js +76 -135
- package/es/QueryListScene/List.js +74 -128
- package/es/QueryListScene/QueryForm.js +46 -81
- package/es/QueryListScene/QueryListScene.js +25 -40
- package/es/QueryListScene/Title.js +3 -3
- package/es/QueryListScene/Toolbar.js +11 -12
- package/es/Select/DropDownWrap.js +29 -50
- package/es/Select/index.js +135 -231
- package/es/Table/ResizableTable/index.js +26 -40
- package/es/Table/index.js +18 -16
- package/es/Title/index.js +21 -23
- package/es/locale.js +9 -7
- package/es/utils/checkAuth.js +3 -5
- package/es/utils/findMenuInfoByPath.js +0 -4
- package/es/utils/index.js +12 -23
- package/lib/ArrayInput/icon.js +6 -6
- package/lib/ArrayInput/index.js +78 -127
- package/lib/AuthContext.js +1 -4
- package/lib/Columns/index.js +31 -47
- package/lib/DevelopmentLogin/LoginModal.js +32 -58
- package/lib/DevelopmentLogin/index.js +16 -27
- package/lib/Ellipsis/Svg/CopySVG.js +13 -15
- package/lib/Ellipsis/Svg/TickSVG.js +8 -10
- package/lib/Ellipsis/index.js +57 -80
- package/lib/Handle/index.js +25 -47
- package/lib/Icon/fonts/iconfont.js +7 -12
- package/lib/Icon/index.js +11 -20
- package/lib/Img/Contain.js +24 -34
- package/lib/Img/Cover.js +42 -65
- package/lib/Img/index.js +36 -51
- package/lib/Layout/ActionsContext.js +1 -4
- package/lib/Layout/AppList.js +40 -118
- package/lib/Layout/Application.js +26 -86
- package/lib/Layout/Avatar.js +35 -89
- package/lib/Layout/CompatibleLanguage.js +39 -110
- package/lib/Layout/EnterpriseLayout/Avatar.js +52 -101
- package/lib/Layout/EnterpriseLayout/Language.js +21 -49
- package/lib/Layout/EnterpriseLayout/Theme.js +22 -46
- package/lib/Layout/EnterpriseLayout/index.js +14 -23
- package/lib/Layout/GlobalNavigation/NavigationPopup.js +59 -186
- package/lib/Layout/GlobalNavigation/index.js +23 -74
- package/lib/Layout/Header.js +28 -63
- package/lib/Layout/HeaderActions.js +48 -74
- package/lib/Layout/HeaderNavs.js +23 -61
- package/lib/Layout/HeaderTabs.js +58 -126
- package/lib/Layout/Iconfont.js +1 -5
- package/lib/Layout/Language.js +17 -48
- package/lib/Layout/Layout.js +90 -128
- package/lib/Layout/Logo.js +19 -43
- package/lib/Layout/OrgAppList.js +64 -127
- package/lib/Layout/SideMenu.js +65 -143
- package/lib/Layout/Theme.js +23 -73
- package/lib/Layout/createActions.js +0 -5
- package/lib/Layout/images/index.js +0 -28
- package/lib/Layout/index.js +33 -57
- package/lib/Layout/paaslayout/CompactSideMenu.js +35 -84
- package/lib/Layout/paaslayout/Header.js +22 -55
- package/lib/Layout/paaslayout/Logo.js +3 -19
- package/lib/Layout/paaslayout/SideMenu.js +39 -87
- package/lib/Layout/paaslayout/index.js +77 -122
- package/lib/Layout/storage.js +29 -35
- package/lib/LoadingButton/index.js +15 -29
- package/lib/Modal/index.js +38 -53
- package/lib/Page/Box.js +34 -45
- package/lib/Page/index.js +54 -78
- package/lib/Page/utils.js +1 -9
- package/lib/QueryForm/Field/Checkbox.js +5 -13
- package/lib/QueryForm/Field/Select.js +33 -53
- package/lib/QueryForm/Field/SelectInput.js +28 -56
- package/lib/QueryForm/Field/fieldsMap.js +1 -15
- package/lib/QueryForm/Field/index.js +43 -81
- package/lib/QueryForm/createActions.js +6 -12
- package/lib/QueryForm/index.js +78 -157
- package/lib/QueryForm/useForm.js +0 -5
- package/lib/QueryListScene/List.js +76 -140
- package/lib/QueryListScene/QueryForm.js +46 -86
- package/lib/QueryListScene/QueryListScene.js +25 -46
- package/lib/QueryListScene/Title.js +3 -7
- package/lib/QueryListScene/Toolbar.js +11 -16
- package/lib/QueryListScene/createActions.js +0 -5
- package/lib/QueryListScene/index.js +0 -10
- package/lib/QueryListScene/useActions.js +0 -5
- package/lib/Select/DropDownWrap.js +31 -56
- package/lib/Select/index.js +135 -241
- package/lib/Table/ResizableTable/index.js +26 -48
- package/lib/Table/index.js +17 -28
- package/lib/Title/index.js +21 -28
- package/lib/index.js +35 -56
- package/lib/locale.js +11 -12
- package/lib/utils/checkAuth.js +4 -9
- package/lib/utils/findMenuInfoByPath.js +1 -8
- package/lib/utils/index.js +15 -42
- package/package.json +2 -2
- package/es/Layout/checkAuth.js +0 -29
- package/es/Layout/utils.js +0 -136
- package/lib/Layout/EnterpriseLayout/Header.js +0 -113
- package/lib/Layout/EnterpriseLayout/HeaderActions.js +0 -104
- package/lib/Layout/checkAuth.js +0 -39
- package/lib/Layout/utils.js +0 -166
package/lib/Layout/HeaderNavs.js
CHANGED
|
@@ -1,63 +1,30 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(obj) {
|
|
4
|
-
|
|
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); }
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports["default"] = exports.HeaderNavs = void 0;
|
|
9
|
-
|
|
10
8
|
var _react = require("react");
|
|
11
|
-
|
|
12
9
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
13
|
-
|
|
14
10
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
15
|
-
|
|
16
11
|
var _lodash = require("lodash");
|
|
17
|
-
|
|
12
|
+
var _excluded = ["theme", "navs", "onChange", "onSelect"];
|
|
13
|
+
var _templateObject, _templateObject2;
|
|
18
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
19
|
-
|
|
20
|
-
function
|
|
21
|
-
|
|
22
|
-
function
|
|
23
|
-
|
|
24
|
-
function
|
|
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
|
-
|
|
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; } }
|
|
30
22
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
31
|
-
|
|
32
23
|
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
|
-
|
|
34
24
|
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
|
-
|
|
56
25
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
57
|
-
|
|
58
|
-
var
|
|
59
|
-
|
|
60
|
-
var NavItem = _styledComponents["default"].li(_templateObject2(), function (props) {
|
|
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) {
|
|
61
28
|
return props.theme.size === 'large' ? '60px' : '50px';
|
|
62
29
|
}, function (props) {
|
|
63
30
|
return props.theme.secondaryTextColor;
|
|
@@ -66,35 +33,30 @@ var NavItem = _styledComponents["default"].li(_templateObject2(), function (prop
|
|
|
66
33
|
}, function (props) {
|
|
67
34
|
return props.theme.primaryColor;
|
|
68
35
|
});
|
|
69
|
-
|
|
70
36
|
var HeaderNavs = (0, _styledComponents.withTheme)(function (_ref) {
|
|
71
37
|
var theme = _ref.theme,
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
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);
|
|
78
43
|
var _useState = (0, _react.useState)(props.selectedKey || (0, _lodash.get)(navs, '0.key')),
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
44
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
45
|
+
selectedKey = _useState2[0],
|
|
46
|
+
setSelectedKey = _useState2[1];
|
|
83
47
|
var onClickNav = function onClickNav(nav) {
|
|
84
48
|
setSelectedKey(nav.key);
|
|
85
49
|
onSelect && onSelect(nav);
|
|
86
|
-
|
|
87
50
|
if (selectedKey !== nav.key) {
|
|
88
51
|
onChange && onChange(nav);
|
|
89
52
|
setSelectedKey(nav.key);
|
|
90
53
|
}
|
|
91
54
|
};
|
|
92
|
-
|
|
93
55
|
(0, _react.useEffect)(function () {
|
|
94
56
|
setSelectedKey(props.selectedKey || (0, _lodash.get)(navs, '0.key'));
|
|
95
57
|
}, [navs, props.selectedKey]);
|
|
96
|
-
return React.createElement(Navs, props, navs.map(function (nav) {
|
|
97
|
-
return React.createElement(NavItem, {
|
|
58
|
+
return /*#__PURE__*/React.createElement(Navs, props, navs.map(function (nav) {
|
|
59
|
+
return /*#__PURE__*/React.createElement(NavItem, {
|
|
98
60
|
key: nav.key,
|
|
99
61
|
theme: theme,
|
|
100
62
|
className: (0, _classnames["default"])({
|
|
@@ -103,7 +65,7 @@ var HeaderNavs = (0, _styledComponents.withTheme)(function (_ref) {
|
|
|
103
65
|
onClick: function onClick() {
|
|
104
66
|
return onClickNav(nav);
|
|
105
67
|
}
|
|
106
|
-
}, React.createElement("a", {
|
|
68
|
+
}, /*#__PURE__*/React.createElement("a", {
|
|
107
69
|
href: nav.key,
|
|
108
70
|
onClick: function onClick(evt) {
|
|
109
71
|
return evt.preventDefault();
|
package/lib/Layout/HeaderTabs.js
CHANGED
|
@@ -1,84 +1,39 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(obj) {
|
|
4
|
-
|
|
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); }
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports["default"] = exports.HeaderTabs = void 0;
|
|
9
|
-
|
|
10
8
|
var _react = require("react");
|
|
11
|
-
|
|
12
9
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
13
|
-
|
|
14
10
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
15
|
-
|
|
16
11
|
var _lodash = require("lodash");
|
|
17
|
-
|
|
18
12
|
var _Icon = _interopRequireDefault(require("../Icon"));
|
|
19
|
-
|
|
13
|
+
var _excluded = ["theme", "className", "tabs", "onTabChange", "onTabSelect", "onTabClose", "appListVisible", "orgListVisible", "orgAppListVisible", "language"];
|
|
14
|
+
var _templateObject, _templateObject2, _templateObject3;
|
|
20
15
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
21
|
-
|
|
22
|
-
function
|
|
23
|
-
|
|
24
|
-
function
|
|
25
|
-
|
|
26
|
-
function
|
|
27
|
-
|
|
28
|
-
function
|
|
29
|
-
|
|
30
|
-
function
|
|
31
|
-
|
|
32
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); }
|
|
33
|
-
|
|
34
|
-
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; }
|
|
35
|
-
|
|
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); }
|
|
19
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
20
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
21
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
22
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
23
|
+
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."); }
|
|
24
|
+
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); }
|
|
25
|
+
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; }
|
|
26
|
+
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; } }
|
|
36
27
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
37
|
-
|
|
38
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; }
|
|
39
|
-
|
|
40
29
|
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; }
|
|
41
|
-
|
|
42
|
-
function _templateObject3() {
|
|
43
|
-
var data = _taggedTemplateLiteral(["\n position: relative;\n margin: 0;\n padding: 0 20px 0 10px;\n cursor: pointer;\n display: inline-block;\n line-height: ", ";\n /* transition: background-color .5; */\n width: 130px;\n color: rgba(255,255,255,.6);\n\n .tnt-icon[type=close] {\n display: none;\n position: absolute;\n right: 0;\n top: 0;\n font-size: 10px;\n padding: 0 10px;\n cursor: pointer;\n z-index: 1;\n }\n\n &:not(:last-child):after {\n position: absolute;\n content: \"\";\n right: 0;\n top: 6px;\n height: 24px;\n width: 1px;\n // opacity: .5;\n // background: #fff;\n background: #E1E6EE;\n opacity: .5;\n // .tnt-themeS1 & {\n // background: #E1E6EE;\n // opacity: 1;\n // }\n }\n\n &.active,\n &.activeTabPreSibling {\n &:after {\n display: none;\n }\n }\n\n a {\n font-size: 14px;\n color: ", ";//rgba(255,255,255,.6);\n text-rendering: optimizeLegibility;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n transition: none;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n display: inline-block;\n line-height: 36px;\n width: 100%;\n // &:hover {\n // color: rgba(255,255,255,.8);\n // }\n // .tnt-themeS1 & {\n // color: ", ";\n // }\n }\n\n &:hover,\n &.active {\n .tnt-icon[type=close] {\n display: unset;\n color: #455064;\n // .tnt-themeS1 & {\n // color: #455064;\n // }\n }\n }\n\n &.active {\n background: #F1F2F5;\n border-radius: 2px 2px 0 0;\n color: ", ";\n font-weight: 600;\n\n a {\n color: ", ";\n }\n }\n"]);
|
|
44
|
-
|
|
45
|
-
_templateObject3 = function _templateObject3() {
|
|
46
|
-
return data;
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
return data;
|
|
50
|
-
}
|
|
51
|
-
|
|
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 0.25s linear;\n position: absolute;\n"]);
|
|
54
|
-
|
|
55
|
-
_templateObject2 = function _templateObject2() {
|
|
56
|
-
return data;
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
return data;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
function _templateObject() {
|
|
63
|
-
var data = _taggedTemplateLiteral(["\n display: flex;\n flex: 1;\n overflow: hidden;\n position: relative;\n margin-right: 12px;\n margin-left: 4px;\n\n .tnt-layout-header-tabs-arrows {\n position: absolute;\n right: 0;\n bottom: 0;\n font-size: 16px;\n line-height: 36px;\n height: 36px;\n background: #fff !important;\n color: rgba(255,255,255,.8) !important;\n .tnt-icon {\n cursor: pointer;\n color: rgba(139,145,158,1);\n &[disabled] {\n color: rgba(139, 145, 158, .5);\n pointer-events: none;\n cursor: not-allowed;\n }\n }\n // background: #191D29;\n // .tnt-icon {\n // cursor: pointer;\n // &[disabled] {\n // color: rgba(139, 145, 158, .5);\n // pointer-events: none;\n // cursor: not-allowed;\n // }\n // }\n // .tnt-themeS1 & {\n // background: #fff;\n // .tnt-icon {\n // color: rgba(139,145,158,1);\n // }\n // }\n // \u591A\u7B7E\u9875\u7684\u7BAD\u5934\u6837\u5F0F\n // .tnt-themeS3 & {\n // background: ", "; //#1D4295;\n // .tnt-icon {\n // color: rgba(255, 255, 255, .5);\n // &[disabled] {\n // color: rgba(139, 145, 158, .5);\n // pointer-events: none;\n // cursor: not-allowed;\n // }\n // }\n // }\n }\n"]);
|
|
64
|
-
|
|
65
|
-
_templateObject = function _templateObject() {
|
|
66
|
-
return data;
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
return data;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
30
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
73
|
-
|
|
74
|
-
var TabsContainer = _styledComponents["default"].div(_templateObject(), function (props) {
|
|
31
|
+
var TabsContainer = _styledComponents["default"].div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n flex: 1;\n overflow: hidden;\n position: relative;\n margin-right: 12px;\n margin-left: 4px;\n\n .tnt-layout-header-tabs-arrows {\n position: absolute;\n right: 0;\n bottom: 0;\n font-size: 16px;\n line-height: 36px;\n height: 36px;\n background: #fff !important;\n color: rgba(255,255,255,.8) !important;\n .tnt-icon {\n cursor: pointer;\n color: rgba(139,145,158,1);\n &[disabled] {\n color: rgba(139, 145, 158, .5);\n pointer-events: none;\n cursor: not-allowed;\n }\n }\n // background: #191D29;\n // .tnt-icon {\n // cursor: pointer;\n // &[disabled] {\n // color: rgba(139, 145, 158, .5);\n // pointer-events: none;\n // cursor: not-allowed;\n // }\n // }\n // .tnt-themeS1 & {\n // background: #fff;\n // .tnt-icon {\n // color: rgba(139,145,158,1);\n // }\n // }\n // \u591A\u7B7E\u9875\u7684\u7BAD\u5934\u6837\u5F0F\n // .tnt-themeS3 & {\n // background: ", "; //#1D4295;\n // .tnt-icon {\n // color: rgba(255, 255, 255, .5);\n // &[disabled] {\n // color: rgba(139, 145, 158, .5);\n // pointer-events: none;\n // cursor: not-allowed;\n // }\n // }\n // }\n }\n"])), function (props) {
|
|
75
32
|
return "".concat(props.theme.blueBgColor);
|
|
76
33
|
});
|
|
77
|
-
|
|
78
|
-
var
|
|
79
|
-
|
|
80
|
-
var TabItem = _styledComponents["default"].li(_templateObject3(), function (props) {
|
|
81
|
-
return props.theme.size === "large" ? "46px" : "36px";
|
|
34
|
+
var Tabs = _styledComponents["default"].ul(_templateObject2 || (_templateObject2 = _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"])));
|
|
35
|
+
var TabItem = _styledComponents["default"].li(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n position: relative;\n margin: 0;\n padding: 0 20px 0 10px;\n cursor: pointer;\n display: inline-block;\n line-height: ", ";\n /* transition: background-color .5; */\n width: 130px;\n color: rgba(255,255,255,.6);\n\n .tnt-icon[type=close] {\n display: none;\n position: absolute;\n right: 0;\n top: 0;\n font-size: 10px;\n padding: 0 10px;\n cursor: pointer;\n z-index: 1;\n }\n\n &:not(:last-child):after {\n position: absolute;\n content: \"\";\n right: 0;\n top: 6px;\n height: 24px;\n width: 1px;\n // opacity: .5;\n // background: #fff;\n background: #E1E6EE;\n opacity: .5;\n // .tnt-themeS1 & {\n // background: #E1E6EE;\n // opacity: 1;\n // }\n }\n\n &.active,\n &.activeTabPreSibling {\n &:after {\n display: none;\n }\n }\n\n a {\n font-size: 14px;\n color: ", ";//rgba(255,255,255,.6);\n text-rendering: optimizeLegibility;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n transition: none;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n display: inline-block;\n line-height: 36px;\n width: 100%;\n // &:hover {\n // color: rgba(255,255,255,.8);\n // }\n // .tnt-themeS1 & {\n // color: ", ";\n // }\n }\n\n &:hover,\n &.active {\n .tnt-icon[type=close] {\n display: unset;\n color: #455064;\n // .tnt-themeS1 & {\n // color: #455064;\n // }\n }\n }\n\n &.active {\n background: #F1F2F5;\n border-radius: 2px 2px 0 0;\n color: ", ";\n font-weight: 600;\n\n a {\n color: ", ";\n }\n }\n"])), function (props) {
|
|
36
|
+
return props.theme.size === 'large' ? '46px' : '36px';
|
|
82
37
|
}, function (props) {
|
|
83
38
|
return props.theme.headerActionsColor;
|
|
84
39
|
}, function (props) {
|
|
@@ -88,59 +43,49 @@ var TabItem = _styledComponents["default"].li(_templateObject3(), function (prop
|
|
|
88
43
|
}, function (props) {
|
|
89
44
|
return props.theme.primaryTextColor;
|
|
90
45
|
});
|
|
91
|
-
|
|
92
46
|
var HeaderTabs = (0, _styledComponents.withTheme)(function (_ref) {
|
|
93
47
|
var theme = _ref.theme,
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
setSelectedKey = _useState2[1];
|
|
110
|
-
|
|
48
|
+
className = _ref.className,
|
|
49
|
+
_ref$tabs = _ref.tabs,
|
|
50
|
+
tabs = _ref$tabs === void 0 ? [] : _ref$tabs,
|
|
51
|
+
onTabChange = _ref.onTabChange,
|
|
52
|
+
onTabSelect = _ref.onTabSelect,
|
|
53
|
+
onTabClose = _ref.onTabClose,
|
|
54
|
+
appListVisible = _ref.appListVisible,
|
|
55
|
+
orgListVisible = _ref.orgListVisible,
|
|
56
|
+
orgAppListVisible = _ref.orgAppListVisible,
|
|
57
|
+
language = _ref.language,
|
|
58
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
59
|
+
var _useState = (0, _react.useState)(props.selectedKey || (0, _lodash.get)(tabs, '0.key')),
|
|
60
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
61
|
+
selectedKey = _useState2[0],
|
|
62
|
+
setSelectedKey = _useState2[1];
|
|
111
63
|
var _useState3 = (0, _react.useState)(tabs || []),
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
64
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
65
|
+
tabItems = _useState4[0],
|
|
66
|
+
setTabItems = _useState4[1];
|
|
116
67
|
var _useState5 = (0, _react.useState)(false),
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
68
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
69
|
+
arrowVisible = _useState6[0],
|
|
70
|
+
setArrowVisible = _useState6[1];
|
|
121
71
|
var _useState7 = (0, _react.useState)({
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
72
|
+
start: true,
|
|
73
|
+
end: true
|
|
74
|
+
}),
|
|
75
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
76
|
+
tabsPositionFlags = _useState8[0],
|
|
77
|
+
setTabsPositionFlags = _useState8[1];
|
|
129
78
|
var tabsRef = (0, _react.useRef)();
|
|
130
|
-
|
|
131
79
|
var getTabsDom = function getTabsDom() {
|
|
132
80
|
return tabsRef.current;
|
|
133
81
|
};
|
|
134
|
-
|
|
135
82
|
var onTabClick = function onTabClick(tab, index) {
|
|
136
83
|
setSelectedKey(tab.key);
|
|
137
84
|
onTabSelect == null ? void 0 : onTabSelect(tab);
|
|
138
|
-
|
|
139
85
|
if (selectedKey !== tab.key) {
|
|
140
86
|
onTabChange == null ? void 0 : onTabChange(tab);
|
|
141
87
|
}
|
|
142
88
|
};
|
|
143
|
-
|
|
144
89
|
var closeTabHandle = function closeTabHandle(tab, index, evt) {
|
|
145
90
|
evt.stopPropagation();
|
|
146
91
|
var newTabItems = tabItems.filter(function (_ref2) {
|
|
@@ -149,25 +94,21 @@ var HeaderTabs = (0, _styledComponents.withTheme)(function (_ref) {
|
|
|
149
94
|
});
|
|
150
95
|
var newSelectedKey = selectedKey;
|
|
151
96
|
setTabItems(newTabItems);
|
|
152
|
-
|
|
153
97
|
if (tab.key === selectedKey) {
|
|
154
98
|
var _newTabItems$, _newTabItems;
|
|
155
|
-
|
|
156
99
|
newSelectedKey = index === 0 ? (_newTabItems$ = newTabItems[0]) == null ? void 0 : _newTabItems$.key : (_newTabItems = newTabItems[index - 1]) == null ? void 0 : _newTabItems.key;
|
|
157
100
|
setSelectedKey(newSelectedKey);
|
|
158
101
|
}
|
|
159
|
-
|
|
160
102
|
onTabClose == null ? void 0 : onTabClose(tab, newTabItems, newTabItems.find(function (_ref3) {
|
|
161
103
|
var key = _ref3.key;
|
|
162
104
|
return key === newSelectedKey;
|
|
163
105
|
}));
|
|
164
106
|
};
|
|
165
|
-
|
|
166
107
|
var onMoveToLeft = function onMoveToLeft() {
|
|
167
108
|
var tabsDom = getTabsDom();
|
|
168
109
|
var parentBBox = tabsDom.parentNode.getBoundingClientRect();
|
|
169
110
|
var parentWidth = parentBBox.width - 32;
|
|
170
|
-
var x = Math.abs(+tabsDom.style.transform.replace(/[^\d.-]/g,
|
|
111
|
+
var x = Math.abs(+tabsDom.style.transform.replace(/[^\d.-]/g, ''));
|
|
171
112
|
var index = Math.ceil(x / 130);
|
|
172
113
|
var trueX = index * 130;
|
|
173
114
|
var newX = Math.min(0, -(trueX - parentWidth));
|
|
@@ -178,13 +119,12 @@ var HeaderTabs = (0, _styledComponents.withTheme)(function (_ref) {
|
|
|
178
119
|
end: Math.abs(newX) < width - parentWidth
|
|
179
120
|
});
|
|
180
121
|
};
|
|
181
|
-
|
|
182
122
|
var onMoveToRight = function onMoveToRight() {
|
|
183
123
|
var tabsDom = getTabsDom();
|
|
184
124
|
var parentBBox = tabsDom.parentNode.getBoundingClientRect();
|
|
185
125
|
var parentWidth = parentBBox.width - 32;
|
|
186
126
|
var width = tabItems.length * 130;
|
|
187
|
-
var x = Math.abs(+tabsDom.style.transform.replace(/[^\d.-]/g,
|
|
127
|
+
var x = Math.abs(+tabsDom.style.transform.replace(/[^\d.-]/g, ''));
|
|
188
128
|
var index = Math.floor(x / 130);
|
|
189
129
|
var trueX = index * 130;
|
|
190
130
|
var newX = Math.max(-(width - parentWidth), -(trueX + parentWidth));
|
|
@@ -194,7 +134,6 @@ var HeaderTabs = (0, _styledComponents.withTheme)(function (_ref) {
|
|
|
194
134
|
end: Math.abs(newX) < width - parentWidth
|
|
195
135
|
});
|
|
196
136
|
};
|
|
197
|
-
|
|
198
137
|
var translateTabsDom = function translateTabsDom(tabs, selectedKey) {
|
|
199
138
|
if (!selectedKey) return;
|
|
200
139
|
var index = tabs.indexOf(tabs.find(function (_ref4) {
|
|
@@ -203,7 +142,7 @@ var HeaderTabs = (0, _styledComponents.withTheme)(function (_ref) {
|
|
|
203
142
|
}));
|
|
204
143
|
if (index === -1) return;
|
|
205
144
|
var tabsDom = getTabsDom();
|
|
206
|
-
var x = -+tabsDom.style.transform.replace(/[^\d.-]/g,
|
|
145
|
+
var x = -+tabsDom.style.transform.replace(/[^\d.-]/g, '');
|
|
207
146
|
var bbox = {
|
|
208
147
|
left: index * 130,
|
|
209
148
|
right: (index + 1) * 130
|
|
@@ -212,19 +151,15 @@ var HeaderTabs = (0, _styledComponents.withTheme)(function (_ref) {
|
|
|
212
151
|
var parentWidth = parentBBox.width - 36;
|
|
213
152
|
var width = tabItems.length * 130;
|
|
214
153
|
var tailX = x + parentWidth; //当前滑动窗口尾部坐标
|
|
215
|
-
|
|
216
154
|
var newX = -x;
|
|
217
|
-
|
|
218
155
|
if (bbox.left < x) {
|
|
219
156
|
newX = -bbox.left;
|
|
220
157
|
} else if (bbox.right >= tailX) {
|
|
221
158
|
newX = parentWidth - bbox.right;
|
|
222
159
|
}
|
|
223
|
-
|
|
224
160
|
if (newX + width < parentWidth) {
|
|
225
161
|
newX = -(width - parentWidth);
|
|
226
162
|
}
|
|
227
|
-
|
|
228
163
|
newX = Math.min(0, newX);
|
|
229
164
|
tabsDom.style.transform = "translateX(".concat(newX, "px)");
|
|
230
165
|
setTabsPositionFlags({
|
|
@@ -232,10 +167,8 @@ var HeaderTabs = (0, _styledComponents.withTheme)(function (_ref) {
|
|
|
232
167
|
end: Math.abs(newX) < width - parentWidth
|
|
233
168
|
});
|
|
234
169
|
};
|
|
235
|
-
|
|
236
170
|
(0, _react.useEffect)(function () {
|
|
237
|
-
setSelectedKey(props.selectedKey || (0, _lodash.get)(tabs,
|
|
238
|
-
|
|
171
|
+
setSelectedKey(props.selectedKey || (0, _lodash.get)(tabs, '0.key'));
|
|
239
172
|
setTabItems(tabs);
|
|
240
173
|
}, [tabs, props.selectedKey]);
|
|
241
174
|
(0, _react.useEffect)(function () {}, [props.orgAppListVisible]);
|
|
@@ -246,15 +179,14 @@ var HeaderTabs = (0, _styledComponents.withTheme)(function (_ref) {
|
|
|
246
179
|
(0, _react.useEffect)(function () {
|
|
247
180
|
translateTabsDom(tabItems, selectedKey);
|
|
248
181
|
}, [tabItems, selectedKey, appListVisible, orgListVisible, orgAppListVisible]);
|
|
249
|
-
return React.createElement(TabsContainer, _extends({}, props, {
|
|
250
|
-
className: (0, _classnames["default"])(
|
|
251
|
-
}), React.createElement(Tabs, {
|
|
182
|
+
return /*#__PURE__*/React.createElement(TabsContainer, _extends({}, props, {
|
|
183
|
+
className: (0, _classnames["default"])('tnt-layout-header-tabs', _defineProperty({}, className, className))
|
|
184
|
+
}), /*#__PURE__*/React.createElement(Tabs, {
|
|
252
185
|
className: "tnt-layout-header-tabs-content",
|
|
253
186
|
ref: tabsRef
|
|
254
187
|
}, tabItems.map(function (tab, index) {
|
|
255
188
|
var _tabItems;
|
|
256
|
-
|
|
257
|
-
return React.createElement(TabItem, {
|
|
189
|
+
return /*#__PURE__*/React.createElement(TabItem, {
|
|
258
190
|
key: tab.key,
|
|
259
191
|
theme: theme,
|
|
260
192
|
className: (0, _classnames["default"])({
|
|
@@ -264,7 +196,7 @@ var HeaderTabs = (0, _styledComponents.withTheme)(function (_ref) {
|
|
|
264
196
|
onClick: function onClick() {
|
|
265
197
|
return onTabClick(tab, index);
|
|
266
198
|
}
|
|
267
|
-
}, React.createElement("a", {
|
|
199
|
+
}, /*#__PURE__*/React.createElement("a", {
|
|
268
200
|
href: tab.key,
|
|
269
201
|
onClick: function onClick(evt) {
|
|
270
202
|
return evt.preventDefault();
|
|
@@ -272,17 +204,17 @@ var HeaderTabs = (0, _styledComponents.withTheme)(function (_ref) {
|
|
|
272
204
|
}, {
|
|
273
205
|
cn: tab.name,
|
|
274
206
|
en: tab.enName || tab.name
|
|
275
|
-
}[language ||
|
|
207
|
+
}[language || 'cn']), tab.closable !== false && tabItems.length > 1 && /*#__PURE__*/React.createElement(_Icon["default"], {
|
|
276
208
|
type: "close",
|
|
277
209
|
onClick: closeTabHandle.bind(null, tab, index)
|
|
278
210
|
}));
|
|
279
|
-
})), arrowVisible && React.createElement("div", {
|
|
211
|
+
})), arrowVisible && /*#__PURE__*/React.createElement("div", {
|
|
280
212
|
className: "tnt-layout-header-tabs-arrows"
|
|
281
|
-
}, React.createElement(_Icon["default"], {
|
|
213
|
+
}, /*#__PURE__*/React.createElement(_Icon["default"], {
|
|
282
214
|
type: "left",
|
|
283
215
|
onClick: onMoveToLeft,
|
|
284
216
|
disabled: !tabsPositionFlags.start
|
|
285
|
-
}), React.createElement(_Icon["default"], {
|
|
217
|
+
}), /*#__PURE__*/React.createElement(_Icon["default"], {
|
|
286
218
|
type: "right",
|
|
287
219
|
onClick: onMoveToRight,
|
|
288
220
|
disabled: !tabsPositionFlags.end
|
package/lib/Layout/Iconfont.js
CHANGED
|
@@ -4,13 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = void 0;
|
|
7
|
-
|
|
8
7
|
var _Icon = _interopRequireDefault(require("../Icon"));
|
|
9
|
-
|
|
10
8
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
11
|
-
|
|
12
9
|
var _default = function _default(props) {
|
|
13
|
-
return React.createElement(_Icon["default"], props);
|
|
10
|
+
return /*#__PURE__*/React.createElement(_Icon["default"], props);
|
|
14
11
|
};
|
|
15
|
-
|
|
16
12
|
exports["default"] = _default;
|