tntd 1.4.26 → 1.4.28
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/babel.config.js +20 -20
- package/dist/stats.json +90 -90
- package/es/ArrayInput/icon.js +3 -11
- package/es/ArrayInput/index.js +57 -67
- package/es/AuthContext.js +3 -13
- package/es/Columns/index.js +12 -24
- package/es/DevelopmentLogin/LoginModal.js +22 -29
- package/es/DevelopmentLogin/index.js +13 -29
- package/es/Ellipsis/Svg/CopySVG.js +2 -11
- package/es/Ellipsis/Svg/TickSVG.js +2 -11
- package/es/Ellipsis/index.js +25 -33
- package/es/Handle/index.js +29 -46
- package/es/Icon/fonts/iconfont.js +0 -2
- package/es/Icon/iconList.js +1 -8
- package/es/Icon/index.js +5 -25
- package/es/Img/Contain.js +8 -21
- package/es/Img/Cover.js +11 -29
- package/es/Img/index.js +8 -22
- package/es/Layout/ActionsContext.js +2 -12
- package/es/Layout/AppList.js +42 -58
- package/es/Layout/Application.js +24 -44
- package/es/Layout/Avatar.js +23 -45
- package/es/Layout/CompatibleLanguage.js +29 -51
- package/es/Layout/EnterpriseLayout/Avatar.js +32 -54
- package/es/Layout/EnterpriseLayout/Language.js +15 -39
- package/es/Layout/EnterpriseLayout/Theme.js +15 -31
- package/es/Layout/EnterpriseLayout/index.js +9 -24
- package/es/Layout/GlobalNavigation/NavigationPopup.js +29 -53
- package/es/Layout/GlobalNavigation/index.js +23 -51
- package/es/Layout/Header.js +19 -40
- package/es/Layout/HeaderActions.js +19 -43
- package/es/Layout/HeaderNavs.js +12 -35
- package/es/Layout/HeaderTabs.js +25 -50
- package/es/Layout/Iconfont.js +4 -16
- package/es/Layout/Language.js +14 -38
- package/es/Layout/Layout.js +32 -58
- package/es/Layout/Logo.js +12 -26
- package/es/Layout/OrgAppList.js +36 -52
- package/es/Layout/SideMenu.js +32 -57
- package/es/Layout/Theme.js +21 -39
- package/es/Layout/createActions.js +6 -19
- package/es/Layout/images/index.js +58 -95
- package/es/Layout/index.js +28 -70
- package/es/Layout/paaslayout/CompactSideMenu.js +17 -35
- package/es/Layout/paaslayout/Header.js +17 -31
- package/es/Layout/paaslayout/Logo.js +9 -19
- package/es/Layout/paaslayout/SideMenu.js +12 -29
- package/es/Layout/paaslayout/index.js +32 -58
- package/es/Layout/storage.js +21 -71
- package/es/LoadingButton/index.js +8 -17
- package/es/Modal/index.js +16 -29
- package/es/Page/Box.js +8 -18
- package/es/Page/index.js +29 -47
- package/es/Page/utils.js +1 -12
- package/es/QueryForm/Field/Checkbox.js +5 -13
- package/es/QueryForm/Field/Select.js +12 -28
- package/es/QueryForm/Field/SelectInput.js +18 -33
- package/es/QueryForm/Field/fieldsMap.js +23 -36
- package/es/QueryForm/Field/index.js +12 -25
- package/es/QueryForm/createActions.js +7 -20
- package/es/QueryForm/index.js +50 -66
- package/es/QueryForm/useForm.js +4 -16
- package/es/QueryListScene/List.js +30 -43
- package/es/QueryListScene/QueryForm.js +9 -21
- package/es/QueryListScene/QueryListScene.js +16 -29
- package/es/QueryListScene/Title.js +5 -17
- package/es/QueryListScene/Toolbar.js +4 -16
- package/es/QueryListScene/createActions.js +13 -26
- package/es/QueryListScene/index.js +19 -40
- package/es/QueryListScene/useActions.js +4 -16
- package/es/Select/DropDownWrap.js +6 -18
- package/es/Select/index.js +15 -28
- package/es/Table/ResizableTable/index.js +18 -32
- package/es/Table/index.js +11 -30
- package/es/Title/index.js +5 -18
- package/es/index.js +20 -193
- package/es/locale.js +8 -27
- package/es/utils/checkAuth.js +4 -15
- package/es/utils/findMenuInfoByPath.js +5 -16
- package/es/utils/index.js +10 -70
- package/lib/ArrayInput/index.js +28 -12
- package/lib/Columns/index.js +10 -4
- package/lib/DevelopmentLogin/LoginModal.js +23 -9
- package/lib/Ellipsis/index.js +10 -4
- package/lib/Handle/index.js +19 -9
- package/lib/Layout/AppList.js +30 -12
- package/lib/Layout/Application.js +5 -3
- package/lib/Layout/Avatar.js +12 -6
- package/lib/Layout/CompatibleLanguage.js +5 -3
- package/lib/Layout/EnterpriseLayout/Avatar.js +18 -8
- package/lib/Layout/EnterpriseLayout/Theme.js +5 -3
- package/lib/Layout/HeaderActions.js +7 -5
- package/lib/Layout/Layout.js +9 -7
- package/lib/Layout/OrgAppList.js +19 -7
- package/lib/Layout/SideMenu.js +9 -7
- package/lib/Layout/Theme.js +5 -3
- package/lib/Layout/paaslayout/index.js +10 -8
- package/lib/LoadingButton/index.js +6 -2
- package/lib/Modal/index.js +5 -3
- package/lib/Page/Box.js +5 -3
- package/lib/QueryForm/Field/Checkbox.js +6 -2
- package/lib/QueryForm/Field/Select.js +8 -4
- package/lib/QueryForm/Field/SelectInput.js +13 -5
- package/lib/QueryForm/Field/fieldsMap.js +18 -8
- package/lib/QueryForm/Field/index.js +7 -3
- package/lib/QueryForm/index.js +27 -13
- package/lib/QueryListScene/List.js +7 -5
- package/lib/Select/index.js +14 -8
- package/lib/Table/ResizableTable/index.js +5 -3
- package/lib/Table/index.js +7 -5
- package/package.json +1 -1
|
@@ -1,36 +1,3 @@
|
|
|
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 _reactDom = _interopRequireDefault(require("react-dom"));
|
|
13
|
-
|
|
14
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
15
|
-
|
|
16
|
-
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
17
|
-
|
|
18
|
-
var _lodash = require("lodash");
|
|
19
|
-
|
|
20
|
-
var _ActionsContext = _interopRequireDefault(require("../ActionsContext"));
|
|
21
|
-
|
|
22
|
-
var _utils = require("../../utils");
|
|
23
|
-
|
|
24
|
-
var _Iconfont = _interopRequireDefault(require("../Iconfont"));
|
|
25
|
-
|
|
26
|
-
var _NavigationPopup = _interopRequireDefault(require("./NavigationPopup"));
|
|
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
|
-
|
|
32
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
33
|
-
|
|
34
1
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); }
|
|
35
2
|
|
|
36
3
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); }
|
|
@@ -69,7 +36,16 @@ function _templateObject() {
|
|
|
69
36
|
|
|
70
37
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
71
38
|
|
|
72
|
-
|
|
39
|
+
import { useState, useEffect, useRef, useContext } from 'react';
|
|
40
|
+
import ReactDOM from 'react-dom';
|
|
41
|
+
import cn from 'classnames';
|
|
42
|
+
import styled, { createGlobalStyle, withTheme } from 'styled-components';
|
|
43
|
+
import { uniq } from 'lodash';
|
|
44
|
+
import ActionsContext from '../ActionsContext';
|
|
45
|
+
import { hasLevel3 } from '../../utils';
|
|
46
|
+
import Icon from '../Iconfont';
|
|
47
|
+
import NavigationPopup from './NavigationPopup';
|
|
48
|
+
var Navigation = styled.li(_templateObject(), function (_ref) {
|
|
73
49
|
var theme = _ref.theme;
|
|
74
50
|
return theme.primaryColor;
|
|
75
51
|
}, function (_ref2) {
|
|
@@ -92,25 +68,24 @@ var createPopupContainer = function createPopupContainer() {
|
|
|
92
68
|
return div;
|
|
93
69
|
};
|
|
94
70
|
|
|
95
|
-
var GlobalStyle =
|
|
71
|
+
var GlobalStyle = createGlobalStyle(_templateObject2(), function (props) {
|
|
96
72
|
return props.theme.size === 'large' ? '60px' : '50px';
|
|
97
73
|
}, function (props) {
|
|
98
74
|
return props.hasLevel3 ? '560px' : '530px';
|
|
99
75
|
});
|
|
100
|
-
|
|
101
|
-
var
|
|
102
|
-
var actions = (0, _react.useContext)(_ActionsContext["default"]);
|
|
76
|
+
export default withTheme(function (props) {
|
|
77
|
+
var actions = useContext(ActionsContext);
|
|
103
78
|
var getText = actions.getText;
|
|
104
79
|
var headerRef = props.headerRef,
|
|
105
80
|
menus = props.menus;
|
|
106
81
|
|
|
107
|
-
var _useState =
|
|
82
|
+
var _useState = useState(false),
|
|
108
83
|
_useState2 = _slicedToArray(_useState, 2),
|
|
109
84
|
visible = _useState2[0],
|
|
110
85
|
setVisible = _useState2[1];
|
|
111
86
|
|
|
112
|
-
var popupRef =
|
|
113
|
-
|
|
87
|
+
var popupRef = useRef();
|
|
88
|
+
useEffect(function () {
|
|
114
89
|
var _headerRef$current;
|
|
115
90
|
|
|
116
91
|
popupRef.current = createPopupContainer();
|
|
@@ -121,11 +96,11 @@ var _default = (0, _styledComponents.withTheme)(function (props) {
|
|
|
121
96
|
headerRef == null ? void 0 : (_headerRef$current2 = headerRef.current) == null ? void 0 : _headerRef$current2.removeChild(popupRef.current);
|
|
122
97
|
};
|
|
123
98
|
}, []);
|
|
124
|
-
|
|
99
|
+
useEffect(function () {
|
|
125
100
|
var classNames = popupRef.current.getAttribute('class').split(' ');
|
|
126
101
|
|
|
127
102
|
if (visible) {
|
|
128
|
-
|
|
103
|
+
ReactDOM.render(React.createElement(NavigationPopup, {
|
|
129
104
|
actions: actions,
|
|
130
105
|
theme: props.theme,
|
|
131
106
|
menus: menus,
|
|
@@ -135,12 +110,11 @@ var _default = (0, _styledComponents.withTheme)(function (props) {
|
|
|
135
110
|
return setVisible(false);
|
|
136
111
|
}
|
|
137
112
|
}), popupRef.current);
|
|
138
|
-
|
|
139
113
|
popupRef.current.setAttribute('class', classNames.filter(function (item) {
|
|
140
114
|
return item !== 'hide';
|
|
141
115
|
}).join(' '));
|
|
142
116
|
} else {
|
|
143
|
-
popupRef.current.setAttribute('class',
|
|
117
|
+
popupRef.current.setAttribute('class', uniq([].concat(_toConsumableArray(classNames), ['hide'])).join(' '));
|
|
144
118
|
}
|
|
145
119
|
}, [visible]);
|
|
146
120
|
return React.createElement(Navigation, {
|
|
@@ -152,14 +126,12 @@ var _default = (0, _styledComponents.withTheme)(function (props) {
|
|
|
152
126
|
(_evt$nativeEvent2 = evt.nativeEvent) == null ? void 0 : _evt$nativeEvent2.stopPropagation();
|
|
153
127
|
setVisible(!visible);
|
|
154
128
|
},
|
|
155
|
-
className: (
|
|
129
|
+
className: cn({
|
|
156
130
|
active: visible
|
|
157
131
|
})
|
|
158
|
-
}, React.createElement(
|
|
132
|
+
}, React.createElement(Icon, {
|
|
159
133
|
type: "unordered-list"
|
|
160
134
|
}), React.createElement("span", null, getText('globalNavigation')), React.createElement(GlobalStyle, {
|
|
161
|
-
hasLevel3:
|
|
135
|
+
hasLevel3: hasLevel3(menus)
|
|
162
136
|
}));
|
|
163
|
-
});
|
|
164
|
-
|
|
165
|
-
exports["default"] = _default;
|
|
137
|
+
});
|
package/es/Layout/Header.js
CHANGED
|
@@ -1,30 +1,3 @@
|
|
|
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 _HeaderActions = _interopRequireDefault(require("./HeaderActions"));
|
|
17
|
-
|
|
18
|
-
var _AppList = _interopRequireDefault(require("./AppList"));
|
|
19
|
-
|
|
20
|
-
var _OrgAppList = _interopRequireDefault(require("./OrgAppList"));
|
|
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
1
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
29
2
|
|
|
30
3
|
function _templateObject2() {
|
|
@@ -49,7 +22,17 @@ function _templateObject() {
|
|
|
49
22
|
|
|
50
23
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
51
24
|
|
|
52
|
-
|
|
25
|
+
/**
|
|
26
|
+
* @file Layout header
|
|
27
|
+
* @author zhangyou
|
|
28
|
+
*/
|
|
29
|
+
import { useRef } from 'react';
|
|
30
|
+
import styled, { withTheme } from 'styled-components';
|
|
31
|
+
import Icon from '../Icon';
|
|
32
|
+
import Actions from './HeaderActions';
|
|
33
|
+
import AppList from './AppList';
|
|
34
|
+
import OrgAppList from './OrgAppList';
|
|
35
|
+
var Header = styled.div(_templateObject(), function (props) {
|
|
53
36
|
return "".concat(props.theme.headerHeight, "px");
|
|
54
37
|
}, function (props) {
|
|
55
38
|
return "".concat(props.theme.blueBgColor, " !important");
|
|
@@ -64,10 +47,8 @@ var Header = _styledComponents["default"].div(_templateObject(), function (props
|
|
|
64
47
|
}, function (props) {
|
|
65
48
|
return "".concat(props.theme.primaryTextColor);
|
|
66
49
|
});
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
var _default = (0, _styledComponents.withTheme)(function (props) {
|
|
50
|
+
var Content = styled.div(_templateObject2());
|
|
51
|
+
export default withTheme(function (props) {
|
|
71
52
|
var collapsed = props.collapsed,
|
|
72
53
|
_props$collapseIconPl = props.collapseIconPlacement,
|
|
73
54
|
collapseIconPlacement = _props$collapseIconPl === void 0 ? 'right' : _props$collapseIconPl,
|
|
@@ -83,16 +64,16 @@ var _default = (0, _styledComponents.withTheme)(function (props) {
|
|
|
83
64
|
onOrgChange = props.onOrgChange,
|
|
84
65
|
onCollapseChange = props.onCollapseChange,
|
|
85
66
|
extraActions = props.extraActions;
|
|
86
|
-
var headerRef =
|
|
67
|
+
var headerRef = useRef();
|
|
87
68
|
return React.createElement(Header, {
|
|
88
69
|
className: "tnt-layout-header",
|
|
89
70
|
ref: headerRef
|
|
90
71
|
}, collapseIconPlacement === 'right' && React.createElement("div", {
|
|
91
72
|
className: "sidebar-collapsed-controller",
|
|
92
73
|
onClick: onCollapseChange
|
|
93
|
-
}, React.createElement(
|
|
74
|
+
}, React.createElement(Icon, {
|
|
94
75
|
type: "menu-".concat(collapsed ? 'unfold' : 'fold')
|
|
95
|
-
})), headerTabs, orgList && React.createElement(
|
|
76
|
+
})), headerTabs, orgList && React.createElement(OrgAppList, {
|
|
96
77
|
orgAppShow: orgAppShow,
|
|
97
78
|
selectedOrgKey: selectedOrgKey,
|
|
98
79
|
orgList: orgList,
|
|
@@ -102,15 +83,13 @@ var _default = (0, _styledComponents.withTheme)(function (props) {
|
|
|
102
83
|
orgAppList: orgAppList,
|
|
103
84
|
onAppChange: onAppChange,
|
|
104
85
|
headerTabs: headerTabs
|
|
105
|
-
}), appList && !orgList && React.createElement(
|
|
86
|
+
}), appList && !orgList && React.createElement(AppList, {
|
|
106
87
|
items: appList,
|
|
107
88
|
selectedKey: selectedAppKey,
|
|
108
89
|
onChange: onAppChange
|
|
109
90
|
}), React.createElement(Content, {
|
|
110
91
|
className: "tnt-layout-header-content"
|
|
111
|
-
}, props.children), React.createElement(
|
|
92
|
+
}, props.children), React.createElement(Actions, _extends({}, props, {
|
|
112
93
|
headerRef: headerRef
|
|
113
94
|
}), extraActions));
|
|
114
|
-
});
|
|
115
|
-
|
|
116
|
-
exports["default"] = _default;
|
|
95
|
+
});
|
|
@@ -1,33 +1,5 @@
|
|
|
1
|
-
|
|
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 _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
11
|
-
|
|
12
|
-
var _antd = require("antd");
|
|
13
|
-
|
|
14
|
-
var _GlobalNavigation = _interopRequireDefault(require("./GlobalNavigation"));
|
|
15
|
-
|
|
16
|
-
var _Language = _interopRequireDefault(require("./Language"));
|
|
17
|
-
|
|
18
|
-
var _Theme = _interopRequireDefault(require("./Theme"));
|
|
19
|
-
|
|
20
|
-
var _CompatibleLanguage = _interopRequireDefault(require("./CompatibleLanguage"));
|
|
21
|
-
|
|
22
|
-
var _Application = _interopRequireDefault(require("./Application"));
|
|
23
|
-
|
|
24
|
-
var _Avatar = _interopRequireDefault(require("./Avatar"));
|
|
25
|
-
|
|
26
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
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; }
|
|
1
|
+
import "antd/lib/divider/style";
|
|
2
|
+
import _Divider from "antd/lib/divider";
|
|
31
3
|
|
|
32
4
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
33
5
|
|
|
@@ -45,13 +17,19 @@ function _templateObject() {
|
|
|
45
17
|
|
|
46
18
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
47
19
|
|
|
48
|
-
|
|
20
|
+
import styled, { withTheme } from 'styled-components';
|
|
21
|
+
import GlobalNavigation from './GlobalNavigation';
|
|
22
|
+
import Language from './Language';
|
|
23
|
+
import Theme from './Theme';
|
|
24
|
+
import LanguageTheme from './CompatibleLanguage';
|
|
25
|
+
import Application from './Application';
|
|
26
|
+
import Avatar from './Avatar';
|
|
27
|
+
var Actions = styled.ul(_templateObject(), function (props) {
|
|
49
28
|
return "".concat(props.theme.headerHeight, "px");
|
|
50
29
|
}, function (props) {
|
|
51
30
|
return "".concat(props.theme.headerActionsColor);
|
|
52
31
|
});
|
|
53
|
-
|
|
54
|
-
var _default = (0, _styledComponents.withTheme)(function (props) {
|
|
32
|
+
export default withTheme(function (props) {
|
|
55
33
|
var type = props.type,
|
|
56
34
|
_props$config = props.config;
|
|
57
35
|
_props$config = _props$config === void 0 ? {} : _props$config;
|
|
@@ -86,26 +64,26 @@ var _default = (0, _styledComponents.withTheme)(function (props) {
|
|
|
86
64
|
AvatarCustom = props.AvatarCustom,
|
|
87
65
|
rest = _objectWithoutProperties(props, ["type", "config", "theme", "userInfo", "menus", "apps", "extraActions", "headerRef", "onLanguageChange", "onThemeChange", "onApplicationChange", "onAppChange", "onOrgChange", "onCollapseChange", "onPersonalSetting", "onChangePassword", "onLogout", "onLogoClick", "AvatarCustom"]);
|
|
88
66
|
|
|
89
|
-
return React.createElement(Actions, rest, extraActions, globalNavigation && React.createElement(
|
|
67
|
+
return React.createElement(Actions, rest, extraActions, globalNavigation && React.createElement(GlobalNavigation, {
|
|
90
68
|
headerRef: headerRef,
|
|
91
69
|
menus: menus
|
|
92
|
-
}), type !== 'enterprise' && (!compatible ? React.createElement(React.Fragment, null, language && React.createElement(
|
|
70
|
+
}), type !== 'enterprise' && (!compatible ? React.createElement(React.Fragment, null, language && React.createElement(Language, {
|
|
93
71
|
language: userInfo.lang,
|
|
94
72
|
onChange: onLanguageChange
|
|
95
|
-
}), theme && React.createElement(
|
|
73
|
+
}), theme && React.createElement(Theme, {
|
|
96
74
|
theme: userInfo.theme,
|
|
97
75
|
onChange: onThemeChange
|
|
98
|
-
})) : React.createElement(
|
|
76
|
+
})) : React.createElement(LanguageTheme, {
|
|
99
77
|
config: props.config,
|
|
100
78
|
language: userInfo.lang,
|
|
101
79
|
theme: userInfo.theme,
|
|
102
80
|
onLanguageChange: onLanguageChange,
|
|
103
81
|
onThemeChange: onThemeChange
|
|
104
|
-
})), application && React.createElement(
|
|
82
|
+
})), application && React.createElement(Application, {
|
|
105
83
|
language: userInfo.lang,
|
|
106
84
|
apps: apps,
|
|
107
85
|
onChange: onApplicationChange
|
|
108
|
-
}), avatar && React.createElement(React.Fragment, null, React.createElement(
|
|
86
|
+
}), avatar && React.createElement(React.Fragment, null, React.createElement(_Divider, {
|
|
109
87
|
type: "vertical"
|
|
110
88
|
}), AvatarCustom ? React.createElement(AvatarCustom, {
|
|
111
89
|
userInfo: userInfo,
|
|
@@ -118,7 +96,7 @@ var _default = (0, _styledComponents.withTheme)(function (props) {
|
|
|
118
96
|
language: language
|
|
119
97
|
},
|
|
120
98
|
onLanguageChange: onLanguageChange
|
|
121
|
-
}) : React.createElement(
|
|
99
|
+
}) : React.createElement(Avatar, {
|
|
122
100
|
userInfo: userInfo,
|
|
123
101
|
onPersonalSetting: onPersonalSetting,
|
|
124
102
|
onChangePassword: onChangePassword,
|
|
@@ -129,6 +107,4 @@ var _default = (0, _styledComponents.withTheme)(function (props) {
|
|
|
129
107
|
language: language
|
|
130
108
|
}
|
|
131
109
|
})));
|
|
132
|
-
});
|
|
133
|
-
|
|
134
|
-
exports["default"] = _default;
|
|
110
|
+
});
|
package/es/Layout/HeaderNavs.js
CHANGED
|
@@ -1,26 +1,3 @@
|
|
|
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"] = exports.HeaderNavs = void 0;
|
|
9
|
-
|
|
10
|
-
var _react = require("react");
|
|
11
|
-
|
|
12
|
-
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
13
|
-
|
|
14
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
15
|
-
|
|
16
|
-
var _lodash = require("lodash");
|
|
17
|
-
|
|
18
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
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
1
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }
|
|
25
2
|
|
|
26
3
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); }
|
|
@@ -55,9 +32,12 @@ function _templateObject() {
|
|
|
55
32
|
|
|
56
33
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
57
34
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
35
|
+
import { useState, useEffect } from 'react';
|
|
36
|
+
import styled, { withTheme } from 'styled-components';
|
|
37
|
+
import cn from 'classnames';
|
|
38
|
+
import { get } from 'lodash';
|
|
39
|
+
var Navs = styled.ul(_templateObject());
|
|
40
|
+
var NavItem = styled.li(_templateObject2(), function (props) {
|
|
61
41
|
return props.theme.size === 'large' ? '60px' : '50px';
|
|
62
42
|
}, function (props) {
|
|
63
43
|
return props.theme.secondaryTextColor;
|
|
@@ -66,8 +46,7 @@ var NavItem = _styledComponents["default"].li(_templateObject2(), function (prop
|
|
|
66
46
|
}, function (props) {
|
|
67
47
|
return props.theme.primaryColor;
|
|
68
48
|
});
|
|
69
|
-
|
|
70
|
-
var HeaderNavs = (0, _styledComponents.withTheme)(function (_ref) {
|
|
49
|
+
export var HeaderNavs = withTheme(function (_ref) {
|
|
71
50
|
var theme = _ref.theme,
|
|
72
51
|
_ref$navs = _ref.navs,
|
|
73
52
|
navs = _ref$navs === void 0 ? [] : _ref$navs,
|
|
@@ -75,7 +54,7 @@ var HeaderNavs = (0, _styledComponents.withTheme)(function (_ref) {
|
|
|
75
54
|
onSelect = _ref.onSelect,
|
|
76
55
|
props = _objectWithoutProperties(_ref, ["theme", "navs", "onChange", "onSelect"]);
|
|
77
56
|
|
|
78
|
-
var _useState =
|
|
57
|
+
var _useState = useState(props.selectedKey || get(navs, '0.key')),
|
|
79
58
|
_useState2 = _slicedToArray(_useState, 2),
|
|
80
59
|
selectedKey = _useState2[0],
|
|
81
60
|
setSelectedKey = _useState2[1];
|
|
@@ -90,14 +69,14 @@ var HeaderNavs = (0, _styledComponents.withTheme)(function (_ref) {
|
|
|
90
69
|
}
|
|
91
70
|
};
|
|
92
71
|
|
|
93
|
-
|
|
94
|
-
setSelectedKey(props.selectedKey ||
|
|
72
|
+
useEffect(function () {
|
|
73
|
+
setSelectedKey(props.selectedKey || get(navs, '0.key'));
|
|
95
74
|
}, [navs, props.selectedKey]);
|
|
96
75
|
return React.createElement(Navs, props, navs.map(function (nav) {
|
|
97
76
|
return React.createElement(NavItem, {
|
|
98
77
|
key: nav.key,
|
|
99
78
|
theme: theme,
|
|
100
|
-
className: (
|
|
79
|
+
className: cn({
|
|
101
80
|
active: selectedKey === nav.key
|
|
102
81
|
}),
|
|
103
82
|
onClick: function onClick() {
|
|
@@ -111,6 +90,4 @@ var HeaderNavs = (0, _styledComponents.withTheme)(function (_ref) {
|
|
|
111
90
|
}, nav.name));
|
|
112
91
|
}));
|
|
113
92
|
});
|
|
114
|
-
|
|
115
|
-
var _default = HeaderNavs;
|
|
116
|
-
exports["default"] = _default;
|
|
93
|
+
export default HeaderNavs;
|
package/es/Layout/HeaderTabs.js
CHANGED
|
@@ -1,28 +1,3 @@
|
|
|
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"] = exports.HeaderTabs = void 0;
|
|
9
|
-
|
|
10
|
-
var _react = require("react");
|
|
11
|
-
|
|
12
|
-
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
13
|
-
|
|
14
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
15
|
-
|
|
16
|
-
var _lodash = require("lodash");
|
|
17
|
-
|
|
18
|
-
var _Icon = _interopRequireDefault(require("../Icon"));
|
|
19
|
-
|
|
20
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
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
1
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
27
2
|
|
|
28
3
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
@@ -71,13 +46,16 @@ function _templateObject() {
|
|
|
71
46
|
|
|
72
47
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
73
48
|
|
|
74
|
-
|
|
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
|
+
var TabsContainer = styled.div(_templateObject(), function (props) {
|
|
75
55
|
return "".concat(props.theme.blueBgColor);
|
|
76
56
|
});
|
|
77
|
-
|
|
78
|
-
var
|
|
79
|
-
|
|
80
|
-
var TabItem = _styledComponents["default"].li(_templateObject3(), function (props) {
|
|
57
|
+
var Tabs = styled.ul(_templateObject2());
|
|
58
|
+
var TabItem = styled.li(_templateObject3(), function (props) {
|
|
81
59
|
return props.theme.size === 'large' ? '46px' : '36px';
|
|
82
60
|
}, function (props) {
|
|
83
61
|
return props.theme.headerActionsColor;
|
|
@@ -88,8 +66,7 @@ var TabItem = _styledComponents["default"].li(_templateObject3(), function (prop
|
|
|
88
66
|
}, function (props) {
|
|
89
67
|
return props.theme.primaryTextColor;
|
|
90
68
|
});
|
|
91
|
-
|
|
92
|
-
var HeaderTabs = (0, _styledComponents.withTheme)(function (_ref) {
|
|
69
|
+
export var HeaderTabs = withTheme(function (_ref) {
|
|
93
70
|
var theme = _ref.theme,
|
|
94
71
|
className = _ref.className,
|
|
95
72
|
_ref$tabs = _ref.tabs,
|
|
@@ -103,22 +80,22 @@ var HeaderTabs = (0, _styledComponents.withTheme)(function (_ref) {
|
|
|
103
80
|
language = _ref.language,
|
|
104
81
|
props = _objectWithoutProperties(_ref, ["theme", "className", "tabs", "onTabChange", "onTabSelect", "onTabClose", "appListVisible", "orgListVisible", "orgAppListVisible", "language"]);
|
|
105
82
|
|
|
106
|
-
var _useState =
|
|
83
|
+
var _useState = useState(props.selectedKey || get(tabs, '0.key')),
|
|
107
84
|
_useState2 = _slicedToArray(_useState, 2),
|
|
108
85
|
selectedKey = _useState2[0],
|
|
109
86
|
setSelectedKey = _useState2[1];
|
|
110
87
|
|
|
111
|
-
var _useState3 =
|
|
88
|
+
var _useState3 = useState(tabs || []),
|
|
112
89
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
113
90
|
tabItems = _useState4[0],
|
|
114
91
|
setTabItems = _useState4[1];
|
|
115
92
|
|
|
116
|
-
var _useState5 =
|
|
93
|
+
var _useState5 = useState(false),
|
|
117
94
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
118
95
|
arrowVisible = _useState6[0],
|
|
119
96
|
setArrowVisible = _useState6[1];
|
|
120
97
|
|
|
121
|
-
var _useState7 =
|
|
98
|
+
var _useState7 = useState({
|
|
122
99
|
start: true,
|
|
123
100
|
end: true
|
|
124
101
|
}),
|
|
@@ -126,7 +103,7 @@ var HeaderTabs = (0, _styledComponents.withTheme)(function (_ref) {
|
|
|
126
103
|
tabsPositionFlags = _useState8[0],
|
|
127
104
|
setTabsPositionFlags = _useState8[1];
|
|
128
105
|
|
|
129
|
-
var tabsRef =
|
|
106
|
+
var tabsRef = useRef();
|
|
130
107
|
|
|
131
108
|
var getTabsDom = function getTabsDom() {
|
|
132
109
|
return tabsRef.current;
|
|
@@ -233,20 +210,20 @@ var HeaderTabs = (0, _styledComponents.withTheme)(function (_ref) {
|
|
|
233
210
|
});
|
|
234
211
|
};
|
|
235
212
|
|
|
236
|
-
|
|
237
|
-
setSelectedKey(props.selectedKey ||
|
|
213
|
+
useEffect(function () {
|
|
214
|
+
setSelectedKey(props.selectedKey || get(tabs, '0.key'));
|
|
238
215
|
setTabItems(tabs);
|
|
239
216
|
}, [tabs, props.selectedKey]);
|
|
240
|
-
|
|
241
|
-
|
|
217
|
+
useEffect(function () {}, [props.orgAppListVisible]);
|
|
218
|
+
useEffect(function () {
|
|
242
219
|
var tabsDom = getTabsDom();
|
|
243
220
|
setArrowVisible(tabsDom.offsetWidth - tabsDom.parentNode.offsetWidth > 0);
|
|
244
221
|
}, [tabItems]);
|
|
245
|
-
|
|
222
|
+
useEffect(function () {
|
|
246
223
|
translateTabsDom(tabItems, selectedKey);
|
|
247
224
|
}, [tabItems, selectedKey, appListVisible, orgListVisible, orgAppListVisible]);
|
|
248
225
|
return React.createElement(TabsContainer, _extends({}, props, {
|
|
249
|
-
className: (
|
|
226
|
+
className: cn('tnt-layout-header-tabs', _defineProperty({}, className, className))
|
|
250
227
|
}), React.createElement(Tabs, {
|
|
251
228
|
className: "tnt-layout-header-tabs-content",
|
|
252
229
|
ref: tabsRef
|
|
@@ -256,7 +233,7 @@ var HeaderTabs = (0, _styledComponents.withTheme)(function (_ref) {
|
|
|
256
233
|
return React.createElement(TabItem, {
|
|
257
234
|
key: tab.key,
|
|
258
235
|
theme: theme,
|
|
259
|
-
className: (
|
|
236
|
+
className: cn({
|
|
260
237
|
active: selectedKey === tab.key,
|
|
261
238
|
activeTabPreSibling: ((_tabItems = tabItems[index + 1]) == null ? void 0 : _tabItems.key) === selectedKey
|
|
262
239
|
}),
|
|
@@ -271,22 +248,20 @@ var HeaderTabs = (0, _styledComponents.withTheme)(function (_ref) {
|
|
|
271
248
|
}, {
|
|
272
249
|
cn: tab.name,
|
|
273
250
|
en: tab.enName || tab.name
|
|
274
|
-
}[language || 'cn']), tab.closable !== false && tabItems.length > 1 && React.createElement(
|
|
251
|
+
}[language || 'cn']), tab.closable !== false && tabItems.length > 1 && React.createElement(Icon, {
|
|
275
252
|
type: "close",
|
|
276
253
|
onClick: closeTabHandle.bind(null, tab, index)
|
|
277
254
|
}));
|
|
278
255
|
})), arrowVisible && React.createElement("div", {
|
|
279
256
|
className: "tnt-layout-header-tabs-arrows"
|
|
280
|
-
}, React.createElement(
|
|
257
|
+
}, React.createElement(Icon, {
|
|
281
258
|
type: "left",
|
|
282
259
|
onClick: onMoveToLeft,
|
|
283
260
|
disabled: !tabsPositionFlags.start
|
|
284
|
-
}), React.createElement(
|
|
261
|
+
}), React.createElement(Icon, {
|
|
285
262
|
type: "right",
|
|
286
263
|
onClick: onMoveToRight,
|
|
287
264
|
disabled: !tabsPositionFlags.end
|
|
288
265
|
})));
|
|
289
266
|
});
|
|
290
|
-
|
|
291
|
-
var _default = HeaderTabs;
|
|
292
|
-
exports["default"] = _default;
|
|
267
|
+
export default HeaderTabs;
|
package/es/Layout/Iconfont.js
CHANGED
|
@@ -1,16 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
});
|
|
6
|
-
exports["default"] = void 0;
|
|
7
|
-
|
|
8
|
-
var _Icon = _interopRequireDefault(require("../Icon"));
|
|
9
|
-
|
|
10
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
11
|
-
|
|
12
|
-
var _default = function _default(props) {
|
|
13
|
-
return React.createElement(_Icon["default"], props);
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
exports["default"] = _default;
|
|
1
|
+
import Icon from '../Icon';
|
|
2
|
+
export default (function (props) {
|
|
3
|
+
return React.createElement(Icon, props);
|
|
4
|
+
});
|