tntd 1.3.56 → 1.3.60
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 +2 -2
- package/components/Layout/OrgAppList.js +1 -1
- package/components/QueryListScene/List.js +17 -13
- package/lib/0645cf743e4e44ca9da321d689897f07.png +0 -0
- package/lib/09db77de0c24fa0f45f8a5cf299a3d11.png +0 -0
- package/lib/1d0b52448de217857b270af807e9360d.png +0 -0
- package/lib/25d78d77c9c2f0d403e5d899ceb5b1ef.png +0 -0
- package/lib/27fa44ff0c98e1594d79b73045aabedf.png +0 -0
- package/lib/2c95075adb68d6131b59cae9fa554ec2.png +0 -0
- package/lib/377c871d922a25c773a9e7c2f42ed7c0.png +0 -0
- package/lib/3d901589b40bd56ff1fde2bbb700bfe1.png +0 -0
- package/lib/4abe481e130d7be0574e45573de8beb7.png +0 -0
- package/lib/95ee2260a509cd630d89c5367ed1973b.png +0 -0
- package/lib/ArrayInput/icon.js +31 -27
- package/lib/ArrayInput/index.js +298 -211
- package/lib/AuthContext.js +13 -2
- package/lib/BlockHeader/README.md +83 -0
- package/lib/BlockHeader/fonts/OswaldLight.ttf +0 -0
- package/lib/BlockHeader/index.js +42 -0
- package/lib/BlockHeader/index.less +141 -0
- package/lib/Columns/index.js +100 -71
- package/lib/DevelopmentLogin/LoginModal.js +141 -79
- package/lib/DevelopmentLogin/index.js +55 -28
- package/lib/Ellipsis/Svg/CopySVG.js +71 -23
- package/lib/Ellipsis/Svg/TickSVG.js +49 -17
- package/lib/Ellipsis/index.js +155 -149
- package/lib/Handle/index.js +109 -72
- package/lib/Icon/fonts/iconfont.js +43 -1
- package/lib/Icon/iconList.js +8 -119
- package/lib/Icon/index.js +45 -13
- package/lib/Img/Contain.js +81 -49
- package/lib/Img/Cover.js +136 -88
- package/lib/Img/index.js +89 -36
- package/lib/Layout/ActionsContext.js +11 -2
- package/lib/Layout/AppList.js +256 -262
- package/lib/Layout/Application.js +135 -119
- package/lib/Layout/Avatar.js +137 -137
- package/lib/Layout/CompatibleLanguage.js +195 -214
- package/lib/Layout/EnterpriseLayout/Avatar.js +168 -156
- package/lib/Layout/EnterpriseLayout/Language.js +100 -75
- package/lib/Layout/EnterpriseLayout/Theme.js +94 -96
- package/lib/Layout/EnterpriseLayout/index.js +45 -32
- package/lib/Layout/GlobalNavigation/NavigationPopup.js +407 -335
- package/lib/Layout/GlobalNavigation/index.js +158 -110
- package/lib/Layout/Header.js +116 -165
- package/lib/Layout/HeaderActions.js +129 -170
- package/lib/Layout/HeaderNavs.js +113 -90
- package/lib/Layout/HeaderTabs.js +278 -312
- package/lib/Layout/Iconfont.js +15 -2
- package/lib/Layout/Language.js +102 -63
- package/lib/Layout/Layout.js +261 -272
- package/lib/Layout/Logo.js +87 -132
- package/lib/Layout/OrgAppList.js +319 -440
- package/lib/Layout/SideMenu.js +343 -429
- package/lib/Layout/Theme.js +124 -95
- package/lib/Layout/checkAuth.js +35 -21
- package/lib/Layout/createActions.js +51 -38
- package/lib/Layout/images/index.js +41 -33
- package/lib/Layout/index.js +161 -110
- package/lib/Layout/locale.js +53 -0
- package/lib/Layout/paaslayout/CompactSideMenu.js +178 -200
- package/lib/Layout/paaslayout/Header.js +90 -84
- package/lib/Layout/paaslayout/Logo.js +32 -27
- package/lib/Layout/paaslayout/SideMenu.js +174 -161
- package/lib/Layout/paaslayout/index.js +261 -240
- package/lib/Layout/paaslayout/index.less +75 -0
- package/lib/Layout/storage.js +78 -20
- package/lib/Layout/utils.js +143 -93
- package/lib/LoadingButton/index.js +57 -29
- package/lib/Modal/index.js +108 -83
- package/lib/Page/Box.js +81 -56
- package/lib/Page/index.js +173 -151
- package/lib/Page/utils.js +30 -12
- package/lib/QueryForm/Field/Checkbox.js +33 -11
- package/lib/QueryForm/Field/Select.js +99 -63
- package/lib/QueryForm/Field/SelectInput.js +114 -69
- package/lib/QueryForm/Field/fieldsMap.js +52 -30
- package/lib/QueryForm/Field/index.js +156 -75
- package/lib/QueryForm/createActions.js +65 -50
- package/lib/QueryForm/index.js +382 -303
- package/lib/QueryForm/useForm.js +17 -6
- package/lib/QueryListScene/Field/SelectInput.js +115 -0
- package/lib/QueryListScene/Field/fieldsMap.js +52 -0
- package/lib/QueryListScene/Field/index.js +159 -0
- package/lib/QueryListScene/Field/select.js +100 -0
- package/lib/QueryListScene/List.js +362 -285
- package/lib/QueryListScene/QueryForm/index.js +423 -0
- package/lib/QueryListScene/QueryForm/index.less +141 -0
- package/lib/QueryListScene/QueryForm.js +159 -91
- package/lib/QueryListScene/QueryListScene.js +87 -33
- package/lib/QueryListScene/Title.js +20 -10
- package/lib/QueryListScene/Toolbar.js +31 -8
- package/lib/QueryListScene/createActions.js +79 -64
- package/lib/QueryListScene/index.js +40 -23
- package/lib/QueryListScene/useActions.js +17 -6
- package/lib/Select/DropDownWrap.js +124 -60
- package/lib/Select/index.js +563 -426
- package/lib/Table/ResizableTable/index.js +121 -77
- package/lib/Table/index.js +51 -19
- package/lib/Title/index.js +52 -34
- package/lib/b9dd5ff3622296fbee51ed68f4bca1bf.png +0 -0
- package/lib/bd2921989f9296089ba58efb7a76f3ef.png +0 -0
- package/lib/index.html +6 -0
- package/lib/index.js +159 -19
- package/lib/locale.js +63 -48
- package/lib/main.css +16420 -0
- package/lib/tntd.js +2 -0
- package/lib/tntd.js.LICENSE.txt +36 -0
- package/package.json +2 -2
|
@@ -1,117 +1,165 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
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
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); }
|
|
35
|
+
|
|
36
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); }
|
|
37
|
+
|
|
38
|
+
function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); }
|
|
33
39
|
|
|
34
|
-
|
|
35
|
-
const div = document.createElement('div');
|
|
40
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } }
|
|
36
41
|
|
|
37
|
-
|
|
42
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }
|
|
38
43
|
|
|
39
|
-
|
|
44
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); }
|
|
45
|
+
|
|
46
|
+
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; }
|
|
47
|
+
|
|
48
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
49
|
+
|
|
50
|
+
function _templateObject2() {
|
|
51
|
+
var data = _taggedTemplateLiteral(["\n .tnt-navigation-popup {\n position: absolute;\n left: 0;\n top: ", ";\n width: 100%;\n height: ", ";\n background: #FFF;\n box-shadow: 0 10px 10px -8px rgba(0,0,0,.1) inset,\n 0 10px 10px -8px rgba(0,0,0,.1);\n transition: all .15s ease-in-out;\n overflow: hidden;\n padding: 20px 16px;\n box-sizing: border-box;\n &.hide {\n height: 0;\n padding: 0;\n }\n }\n"]);
|
|
52
|
+
|
|
53
|
+
_templateObject2 = function _templateObject2() {
|
|
54
|
+
return data;
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
return data;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function _templateObject() {
|
|
61
|
+
var data = _taggedTemplateLiteral(["\n &.active {\n color: ", " !important;\n }\n font-size: ", ";\n .tnt-icon {\n font-size: ", ";\n margin-right: 4px;\n }\n span {\n position: relative;\n font-size: ", ";\n top: ", ";\n font-family: auto;\n .tnt-themeS1 & {\n /* color: rgba(255,255,255,.85); */\n }\n }\n .isInIframe & {\n display: none;\n }\n"]);
|
|
62
|
+
|
|
63
|
+
_templateObject = function _templateObject() {
|
|
64
|
+
return data;
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
return data;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
71
|
+
|
|
72
|
+
var Navigation = _styledComponents["default"].li(_templateObject(), function (_ref) {
|
|
73
|
+
var theme = _ref.theme;
|
|
74
|
+
return theme.primaryColor;
|
|
75
|
+
}, function (_ref2) {
|
|
76
|
+
var size = _ref2.theme.size;
|
|
77
|
+
return size === 'large' ? '14px' : '12px';
|
|
78
|
+
}, function (_ref3) {
|
|
79
|
+
var size = _ref3.theme.size;
|
|
80
|
+
return size === 'large' ? '22px' : '18px';
|
|
81
|
+
}, function (_ref4) {
|
|
82
|
+
var size = _ref4.theme.size;
|
|
83
|
+
return size === 'large' ? '14px' : '12px';
|
|
84
|
+
}, function (_ref5) {
|
|
85
|
+
var size = _ref5.theme.size;
|
|
86
|
+
return size === 'large' ? '-3px' : '-2px';
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
var createPopupContainer = function createPopupContainer() {
|
|
90
|
+
var div = document.createElement('div');
|
|
91
|
+
div.setAttribute('class', 'tnt-navigation-popup');
|
|
92
|
+
return div;
|
|
40
93
|
};
|
|
41
94
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
95
|
+
var GlobalStyle = (0, _styledComponents.createGlobalStyle)(_templateObject2(), function (props) {
|
|
96
|
+
return props.theme.size === 'large' ? '60px' : '50px';
|
|
97
|
+
}, function (props) {
|
|
98
|
+
return props.hasLevel3 ? '560px' : '530px';
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
var _default = (0, _styledComponents.withTheme)(function (props) {
|
|
102
|
+
var actions = (0, _react.useContext)(_ActionsContext["default"]);
|
|
103
|
+
var getText = actions.getText;
|
|
104
|
+
var headerRef = props.headerRef,
|
|
105
|
+
menus = props.menus;
|
|
106
|
+
|
|
107
|
+
var _useState = (0, _react.useState)(false),
|
|
108
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
109
|
+
visible = _useState2[0],
|
|
110
|
+
setVisible = _useState2[1];
|
|
111
|
+
|
|
112
|
+
var popupRef = (0, _react.useRef)();
|
|
113
|
+
(0, _react.useEffect)(function () {
|
|
114
|
+
var _headerRef$current;
|
|
115
|
+
|
|
116
|
+
popupRef.current = createPopupContainer();
|
|
117
|
+
headerRef == null ? void 0 : (_headerRef$current = headerRef.current) == null ? void 0 : _headerRef$current.appendChild(popupRef.current);
|
|
118
|
+
return function () {
|
|
119
|
+
var _headerRef$current2;
|
|
120
|
+
|
|
121
|
+
headerRef == null ? void 0 : (_headerRef$current2 = headerRef.current) == null ? void 0 : _headerRef$current2.removeChild(popupRef.current);
|
|
122
|
+
};
|
|
123
|
+
}, []);
|
|
124
|
+
(0, _react.useEffect)(function () {
|
|
125
|
+
var classNames = popupRef.current.getAttribute('class').split(' ');
|
|
126
|
+
|
|
127
|
+
if (visible) {
|
|
128
|
+
_reactDom["default"].render(React.createElement(_NavigationPopup["default"], {
|
|
129
|
+
actions: actions,
|
|
130
|
+
theme: props.theme,
|
|
131
|
+
menus: menus,
|
|
132
|
+
containerRef: headerRef,
|
|
133
|
+
popupRef: popupRef,
|
|
134
|
+
close: function close() {
|
|
135
|
+
return setVisible(false);
|
|
59
136
|
}
|
|
137
|
+
}), popupRef.current);
|
|
138
|
+
|
|
139
|
+
popupRef.current.setAttribute('class', classNames.filter(function (item) {
|
|
140
|
+
return item !== 'hide';
|
|
141
|
+
}).join(' '));
|
|
142
|
+
} else {
|
|
143
|
+
popupRef.current.setAttribute('class', (0, _lodash.uniq)([].concat(_toConsumableArray(classNames), ['hide'])).join(' '));
|
|
60
144
|
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
if (visible) {
|
|
84
|
-
ReactDOM.render(
|
|
85
|
-
<NavigationPopup
|
|
86
|
-
actions={actions}
|
|
87
|
-
theme={props.theme}
|
|
88
|
-
menus={menus}
|
|
89
|
-
containerRef={headerRef}
|
|
90
|
-
popupRef={popupRef}
|
|
91
|
-
close={() => setVisible(false)}
|
|
92
|
-
/>,
|
|
93
|
-
popupRef.current
|
|
94
|
-
);
|
|
95
|
-
popupRef.current.setAttribute('class', classNames.filter(item => item !== 'hide').join(' '));
|
|
96
|
-
} else {
|
|
97
|
-
popupRef.current.setAttribute('class', uniq([...classNames, 'hide']).join(' '));
|
|
98
|
-
}
|
|
99
|
-
}, [visible]);
|
|
100
|
-
|
|
101
|
-
return (
|
|
102
|
-
<Navigation
|
|
103
|
-
onClick={evt => {
|
|
104
|
-
evt.stopPropagation();
|
|
105
|
-
evt.nativeEvent?.stopImmediatePropagation();
|
|
106
|
-
evt.nativeEvent?.stopPropagation();
|
|
107
|
-
setVisible(!visible);
|
|
108
|
-
}}
|
|
109
|
-
className={cn({ active: visible })}
|
|
110
|
-
>
|
|
111
|
-
<Icon type="unordered-list" />
|
|
112
|
-
<span>{getText('globalNavigation')}</span>
|
|
113
|
-
<GlobalStyle hasLevel3={hasLevel3(menus)}/>
|
|
114
|
-
</Navigation>
|
|
115
|
-
);
|
|
116
|
-
}
|
|
117
|
-
);
|
|
145
|
+
}, [visible]);
|
|
146
|
+
return React.createElement(Navigation, {
|
|
147
|
+
onClick: function onClick(evt) {
|
|
148
|
+
var _evt$nativeEvent, _evt$nativeEvent2;
|
|
149
|
+
|
|
150
|
+
evt.stopPropagation();
|
|
151
|
+
(_evt$nativeEvent = evt.nativeEvent) == null ? void 0 : _evt$nativeEvent.stopImmediatePropagation();
|
|
152
|
+
(_evt$nativeEvent2 = evt.nativeEvent) == null ? void 0 : _evt$nativeEvent2.stopPropagation();
|
|
153
|
+
setVisible(!visible);
|
|
154
|
+
},
|
|
155
|
+
className: (0, _classnames["default"])({
|
|
156
|
+
active: visible
|
|
157
|
+
})
|
|
158
|
+
}, React.createElement(_Iconfont["default"], {
|
|
159
|
+
type: "unordered-list"
|
|
160
|
+
}), React.createElement("span", null, getText('globalNavigation')), React.createElement(GlobalStyle, {
|
|
161
|
+
hasLevel3: (0, _utils.hasLevel3)(menus)
|
|
162
|
+
}));
|
|
163
|
+
});
|
|
164
|
+
|
|
165
|
+
exports["default"] = _default;
|
package/lib/Layout/Header.js
CHANGED
|
@@ -1,165 +1,116 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
/* background: #323b4a;
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
<Header className="tnt-layout-header" ref={headerRef}>
|
|
118
|
-
{
|
|
119
|
-
collapseIconPlacement === 'right' && (
|
|
120
|
-
<div
|
|
121
|
-
className="sidebar-collapsed-controller"
|
|
122
|
-
onClick={onCollapseChange}
|
|
123
|
-
>
|
|
124
|
-
<Icon type={`menu-${collapsed ? 'unfold' : 'fold'}`}/>
|
|
125
|
-
</div>
|
|
126
|
-
)
|
|
127
|
-
}
|
|
128
|
-
{headerTabs}
|
|
129
|
-
|
|
130
|
-
{/* 展示机构+应用 */}
|
|
131
|
-
{
|
|
132
|
-
orgList && (
|
|
133
|
-
<OrgAppList
|
|
134
|
-
orgAppShow={orgAppShow}
|
|
135
|
-
selectedOrgKey={selectedOrgKey}
|
|
136
|
-
orgList = {orgList}
|
|
137
|
-
selectedAppKey={selectedAppKey}
|
|
138
|
-
onOrgChange={onOrgChange}
|
|
139
|
-
orgTreeConfig={orgTreeConfig}
|
|
140
|
-
orgAppList={orgAppList}
|
|
141
|
-
onAppChange={onAppChange}
|
|
142
|
-
headerTabs={headerTabs}
|
|
143
|
-
/>
|
|
144
|
-
)
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
{/* 只展示应用 走老逻辑 */}
|
|
148
|
-
{
|
|
149
|
-
appList &&
|
|
150
|
-
!orgList && (
|
|
151
|
-
<AppList
|
|
152
|
-
items={appList}
|
|
153
|
-
selectedKey={selectedAppKey}
|
|
154
|
-
onChange={onAppChange}
|
|
155
|
-
/>
|
|
156
|
-
)
|
|
157
|
-
}
|
|
158
|
-
<Content className="tnt-layout-header-content">{props.children}</Content>
|
|
159
|
-
<Actions {...props} headerRef={headerRef}>
|
|
160
|
-
{extraActions}
|
|
161
|
-
</Actions>
|
|
162
|
-
</Header>
|
|
163
|
-
);
|
|
164
|
-
}
|
|
165
|
-
);
|
|
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
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
29
|
+
|
|
30
|
+
function _templateObject2() {
|
|
31
|
+
var data = _taggedTemplateLiteral(["\n flex: 1;\n .isInIframe & {\n display: none;\n }\n"]);
|
|
32
|
+
|
|
33
|
+
_templateObject2 = function _templateObject2() {
|
|
34
|
+
return data;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
return data;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function _templateObject() {
|
|
41
|
+
var data = _taggedTemplateLiteral(["\n position: relative;\n z-index: 201;\n height: ", ";\n display: flex;\n color: rgba(255,255,255,.85);\n background: #fff;\n .hasHeaderTabs & {\n // background: #191D29;\n background: #fff !important;\n box-shadow: 0px 1px 6px 0px rgba(0,0,0,0.18);\n .tnt-layout-header-content {\n display: none;\n }\n }\n\n // .tnt-themeS3.hasHeaderTabs &{\n // background: ", "; //#1D4295 !important;\n // }\n\n .isInIframe.noAppList &,\n .isEmptyLayout & {\n display: none;\n }\n .tnt-themeS1 & {\n background: #FFFFFF;\n box-shadow: 0 1px 10px 0 rgba(0,0,0,0.15);\n }\n .tnt-themeS1.compatible & {\n /* background: #323b4a; */\n }\n padding-right: 20px;\n background: #FFFFFF;\n box-shadow: 0 1px 10px 0 rgba(0,0,0,0.10);\n .compatible & {\n box-shadow: 0 1px 10px 0 rgba(0,0,0,0.10);\n }\n transition: box-shadow .2s cubic-bezier(.4,0,.2,1), -webkit-box-shadow .2s cubic-bezier(.4,0,.2,1);\n\n .sidebar-collapsed-controller {\n text-align: center;\n width: ", ";\n line-height: ", ";\n height: ", ";\n cursor: pointer;\n color: ", ";\n margin-right: 10px;\n\n & > .tnt-icon {\n font-size: 16px;\n .large-size & {\n font-size: 20px;\n }\n }\n\n i {\n position: relative;\n top: -1px;\n vertical-align: sub;\n }\n\n &:hover {\n background-color: rgba(0,0,0,.06);\n }\n\n .tnt-themeS1 & {\n /* color: rgba(255,255,255,.85); */\n color: ", ";\n }\n .large-size & {\n font-size: 18px;\n }\n .isInIframe & {\n display: none;\n }\n }\n"]);
|
|
42
|
+
|
|
43
|
+
_templateObject = function _templateObject() {
|
|
44
|
+
return data;
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
return data;
|
|
48
|
+
}
|
|
49
|
+
|
|
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
|
+
orgTreeConfig = props.orgTreeConfig,
|
|
79
|
+
selectedOrgKey = props.selectedOrgKey,
|
|
80
|
+
orgList = props.orgList,
|
|
81
|
+
headerTabs = props.headerTabs,
|
|
82
|
+
onAppChange = props.onAppChange,
|
|
83
|
+
onOrgChange = props.onOrgChange,
|
|
84
|
+
onCollapseChange = props.onCollapseChange,
|
|
85
|
+
extraActions = props.extraActions;
|
|
86
|
+
var headerRef = (0, _react.useRef)();
|
|
87
|
+
return React.createElement(Header, {
|
|
88
|
+
className: "tnt-layout-header",
|
|
89
|
+
ref: headerRef
|
|
90
|
+
}, collapseIconPlacement === 'right' && React.createElement("div", {
|
|
91
|
+
className: "sidebar-collapsed-controller",
|
|
92
|
+
onClick: onCollapseChange
|
|
93
|
+
}, React.createElement(_Icon["default"], {
|
|
94
|
+
type: "menu-".concat(collapsed ? 'unfold' : 'fold')
|
|
95
|
+
})), headerTabs, orgList && React.createElement(_OrgAppList["default"], {
|
|
96
|
+
orgAppShow: orgAppShow,
|
|
97
|
+
selectedOrgKey: selectedOrgKey,
|
|
98
|
+
orgList: orgList,
|
|
99
|
+
selectedAppKey: selectedAppKey,
|
|
100
|
+
onOrgChange: onOrgChange,
|
|
101
|
+
orgTreeConfig: orgTreeConfig,
|
|
102
|
+
orgAppList: orgAppList,
|
|
103
|
+
onAppChange: onAppChange,
|
|
104
|
+
headerTabs: headerTabs
|
|
105
|
+
}), appList && !orgList && React.createElement(_AppList["default"], {
|
|
106
|
+
items: appList,
|
|
107
|
+
selectedKey: selectedAppKey,
|
|
108
|
+
onChange: onAppChange
|
|
109
|
+
}), React.createElement(Content, {
|
|
110
|
+
className: "tnt-layout-header-content"
|
|
111
|
+
}, props.children), React.createElement(_HeaderActions["default"], _extends({}, props, {
|
|
112
|
+
headerRef: headerRef
|
|
113
|
+
}), extraActions));
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
exports["default"] = _default;
|