tntd 1.4.6 → 1.4.7
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/HeaderActions.js +90 -128
- package/components/LoadingButton/index.js +11 -15
- package/dist/stats.json +4958 -4958
- package/dist/tntd.js +1 -1
- package/es/Layout/HeaderActions.js +10 -10
- package/es/LoadingButton/index.js +20 -10
- package/lib/ArrayInput/icon.js +27 -31
- package/lib/ArrayInput/index.js +211 -298
- package/lib/AuthContext.js +2 -13
- package/lib/Columns/index.js +71 -100
- package/lib/DevelopmentLogin/LoginModal.js +79 -141
- package/lib/DevelopmentLogin/index.js +28 -55
- package/lib/Ellipsis/Svg/CopySVG.js +23 -71
- package/lib/Ellipsis/Svg/TickSVG.js +17 -49
- package/lib/Ellipsis/index.js +148 -154
- package/lib/Handle/index.js +72 -109
- package/lib/Icon/fonts/iconfont.js +1 -43
- package/lib/Icon/iconList.js +119 -8
- package/lib/Icon/index.js +13 -45
- package/lib/Img/Contain.js +49 -81
- package/lib/Img/Cover.js +88 -136
- package/lib/Img/index.js +36 -89
- package/lib/Layout/ActionsContext.js +2 -11
- package/lib/Layout/AppList.js +262 -256
- package/lib/Layout/Application.js +119 -135
- package/lib/Layout/Avatar.js +137 -137
- package/lib/Layout/CompatibleLanguage.js +214 -195
- package/lib/Layout/EnterpriseLayout/Avatar.js +156 -168
- package/lib/Layout/EnterpriseLayout/Language.js +75 -100
- package/lib/Layout/EnterpriseLayout/Theme.js +96 -94
- package/lib/Layout/EnterpriseLayout/index.js +32 -45
- package/lib/Layout/GlobalNavigation/NavigationPopup.js +335 -407
- package/lib/Layout/GlobalNavigation/index.js +110 -158
- package/lib/Layout/Header.js +165 -116
- package/lib/Layout/HeaderActions.js +132 -129
- package/lib/Layout/HeaderNavs.js +90 -113
- package/lib/Layout/HeaderTabs.js +312 -278
- package/lib/Layout/Iconfont.js +2 -15
- package/lib/Layout/Language.js +63 -102
- package/lib/Layout/Layout.js +272 -261
- package/lib/Layout/Logo.js +132 -87
- package/lib/Layout/OrgAppList.js +440 -319
- package/lib/Layout/SideMenu.js +429 -343
- package/lib/Layout/Theme.js +95 -124
- package/lib/Layout/checkAuth.js +21 -35
- package/lib/Layout/createActions.js +38 -51
- package/lib/Layout/images/index.js +33 -41
- package/lib/Layout/index.js +110 -161
- package/lib/Layout/paaslayout/CompactSideMenu.js +200 -178
- package/lib/Layout/paaslayout/Header.js +84 -90
- package/lib/Layout/paaslayout/Logo.js +27 -32
- package/lib/Layout/paaslayout/SideMenu.js +161 -174
- package/lib/Layout/paaslayout/index.js +240 -261
- package/lib/Layout/storage.js +20 -78
- package/lib/Layout/utils.js +93 -143
- package/lib/LoadingButton/index.js +25 -57
- package/lib/Modal/index.js +83 -108
- package/lib/Page/Box.js +56 -81
- package/lib/Page/index.js +151 -173
- package/lib/Page/utils.js +12 -30
- package/lib/QueryForm/Field/Checkbox.js +11 -33
- package/lib/QueryForm/Field/Select.js +63 -99
- package/lib/QueryForm/Field/SelectInput.js +69 -114
- package/lib/QueryForm/Field/fieldsMap.js +30 -52
- package/lib/QueryForm/Field/index.js +76 -158
- package/lib/QueryForm/createActions.js +50 -65
- package/lib/QueryForm/index.js +304 -383
- package/lib/QueryForm/useForm.js +6 -17
- package/lib/QueryListScene/List.js +290 -366
- package/lib/QueryListScene/QueryForm.js +93 -161
- package/lib/QueryListScene/QueryListScene.js +33 -87
- package/lib/QueryListScene/Title.js +10 -20
- package/lib/QueryListScene/Toolbar.js +8 -31
- package/lib/QueryListScene/createActions.js +64 -79
- package/lib/QueryListScene/index.js +23 -40
- package/lib/QueryListScene/useActions.js +6 -17
- package/lib/Select/DropDownWrap.js +60 -124
- package/lib/Select/index.js +425 -561
- package/lib/Table/ResizableTable/index.js +77 -121
- package/lib/Table/index.js +19 -51
- package/lib/Title/index.js +34 -52
- package/lib/index.js +19 -159
- package/lib/locale.js +48 -63
- package/package.json +1 -1
- package/lib/Layout/EnterpriseLayout/Header.js +0 -113
- package/lib/Layout/EnterpriseLayout/HeaderActions.js +0 -104
package/lib/Layout/utils.js
CHANGED
|
@@ -1,166 +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
|
-
if (selectedKey) {
|
|
29
|
-
traverseTree(menus, function (node, pnode, pnodes) {
|
|
30
|
-
if (!isGroupMenu(node) && node.code === selectedKey) {
|
|
31
|
-
subMenu = node;
|
|
32
|
-
menu = pnode;
|
|
33
|
-
parentMenus = pnodes;
|
|
34
|
-
return false;
|
|
35
|
-
}
|
|
36
|
-
});
|
|
37
|
-
} else {
|
|
38
|
-
// 默认找到第一个菜单项
|
|
39
|
-
traverseTree(menus, function (node, pnode, pnodes) {
|
|
40
|
-
if (!isGroupMenu(node)) {
|
|
41
|
-
subMenu = node;
|
|
42
|
-
menu = pnode;
|
|
43
|
-
parentMenus = pnodes;
|
|
44
|
-
return false;
|
|
45
|
-
}
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
return {
|
|
50
|
-
subMenu: subMenu,
|
|
51
|
-
menu: menu,
|
|
52
|
-
parentMenus: parentMenus
|
|
53
|
-
};
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
exports.getSelectedMenuInfo = getSelectedMenuInfo;
|
|
57
|
-
|
|
58
|
-
var findMenuInfoByPath = function findMenuInfoByPath(menuTree, path, matchFunc) {
|
|
59
|
-
var menu;
|
|
60
|
-
var subMenu;
|
|
61
|
-
var matchedSubMenu;
|
|
62
|
-
var parentMenus;
|
|
63
|
-
|
|
64
|
-
if (path) {
|
|
65
|
-
traverseTree(menuTree, function (menu, pnode, pnodes) {
|
|
66
|
-
if (!isGroupMenu(menu)) {
|
|
67
|
-
var _menu;
|
|
68
|
-
|
|
69
|
-
if (((_menu = menu) == null ? void 0 : _menu.path) === path) {
|
|
70
|
-
subMenu = menu;
|
|
71
|
-
menu = pnode;
|
|
72
|
-
parentMenus = pnodes;
|
|
73
|
-
return false;
|
|
74
|
-
}
|
|
1
|
+
export const isGroupMenu = menu => menu?.children && !menu?.path;
|
|
2
|
+
|
|
3
|
+
export const getSelectedMenuInfo = (selectedKey, menus = []) => {
|
|
4
|
+
let subMenu;
|
|
5
|
+
let menu;
|
|
6
|
+
let parentMenus = [];
|
|
7
|
+
|
|
8
|
+
if (selectedKey) {
|
|
9
|
+
traverseTree(menus, (node, pnode, pnodes) => {
|
|
10
|
+
if (!isGroupMenu(node) && node.code === selectedKey) {
|
|
11
|
+
subMenu = node;
|
|
12
|
+
menu = pnode;
|
|
13
|
+
parentMenus = pnodes;
|
|
14
|
+
return false;
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
} else { // 默认找到第一个菜单项
|
|
18
|
+
traverseTree(menus, (node, pnode, pnodes) => {
|
|
19
|
+
if (!isGroupMenu(node)) {
|
|
20
|
+
subMenu = node;
|
|
21
|
+
menu = pnode;
|
|
22
|
+
parentMenus = pnodes;
|
|
23
|
+
return false;
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
}
|
|
75
27
|
|
|
76
|
-
if (!matchedSubMenu && matchFunc && matchFunc(menu)) {
|
|
77
|
-
matchedSubMenu = menu;
|
|
78
|
-
menu = pnode;
|
|
79
|
-
parentMenus = pnodes;
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
});
|
|
83
28
|
return {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
parentMenus: parentMenus
|
|
29
|
+
subMenu,
|
|
30
|
+
menu,
|
|
31
|
+
parentMenus
|
|
88
32
|
};
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
return {
|
|
92
|
-
subMenu: subMenu,
|
|
93
|
-
menu: menu,
|
|
94
|
-
parentMenus: parentMenus
|
|
95
|
-
};
|
|
96
33
|
};
|
|
97
34
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
35
|
+
export const findMenuInfoByPath = (menuTree, path, matchFunc) => {
|
|
36
|
+
let menu;
|
|
37
|
+
let subMenu;
|
|
38
|
+
let matchedSubMenu;
|
|
39
|
+
let parentMenus;
|
|
40
|
+
|
|
41
|
+
if (path) {
|
|
42
|
+
traverseTree(menuTree, (menu, pnode, pnodes) => {
|
|
43
|
+
if (!isGroupMenu(menu)) {
|
|
44
|
+
if (menu?.path === path) {
|
|
45
|
+
subMenu = menu;
|
|
46
|
+
menu = pnode;
|
|
47
|
+
parentMenus = pnodes;
|
|
48
|
+
return false;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
if (!matchedSubMenu && matchFunc && matchFunc(menu)) {
|
|
52
|
+
matchedSubMenu = menu;
|
|
53
|
+
menu = pnode;
|
|
54
|
+
parentMenus = pnodes;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
return {
|
|
60
|
+
subMenu,
|
|
61
|
+
matchedSubMenu,
|
|
62
|
+
menu,
|
|
63
|
+
parentMenus
|
|
64
|
+
};
|
|
65
|
+
}
|
|
106
66
|
|
|
107
|
-
|
|
108
|
-
});
|
|
109
|
-
});
|
|
67
|
+
return { subMenu, menu, parentMenus };
|
|
110
68
|
};
|
|
111
69
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
target = _ref.target,
|
|
117
|
-
path = _ref.path;
|
|
118
|
-
|
|
119
|
-
return target === '_blank' || /^http/i.test(path) && /blankType=newTarget/.test(path);
|
|
70
|
+
export const hasLevel3 = menus => {
|
|
71
|
+
return menus?.some(
|
|
72
|
+
menu => menu?.children?.some(item => item?.children?.length)
|
|
73
|
+
);
|
|
120
74
|
};
|
|
121
75
|
|
|
122
|
-
|
|
76
|
+
export const isNewTabMenu = menu => {
|
|
77
|
+
const { target, path } = menu || {};
|
|
123
78
|
|
|
124
|
-
|
|
125
|
-
window.open(path, '_blank');
|
|
79
|
+
return target === '_blank' || (/^http/i.test(path) && /blankType=newTarget/.test(path));
|
|
126
80
|
};
|
|
127
81
|
|
|
128
|
-
|
|
82
|
+
export const openInNewTab = path => {
|
|
83
|
+
window.open(path, '_blank');
|
|
84
|
+
};
|
|
129
85
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
var result;
|
|
86
|
+
export const traverseTree = (treeData, callback, pnode, pnodes = []) => {
|
|
87
|
+
(treeData || []).every((node, index) => {
|
|
88
|
+
let result;
|
|
134
89
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
}), index);
|
|
139
|
-
} // 回调函数返回false则终止遍历
|
|
90
|
+
if (callback) {
|
|
91
|
+
result = callback(node, pnode, pnodes?.length ? pnodes : [pnode].filter(item => !!item), index);
|
|
92
|
+
}
|
|
140
93
|
|
|
94
|
+
// 回调函数返回false则终止遍历
|
|
95
|
+
if (result !== false) {
|
|
96
|
+
node && traverseTree(node.children || [], callback, node, [node, ...pnodes]);
|
|
97
|
+
}
|
|
141
98
|
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
}
|
|
99
|
+
return result !== false;
|
|
100
|
+
});
|
|
145
101
|
|
|
146
|
-
return
|
|
147
|
-
});
|
|
148
|
-
return treeData;
|
|
102
|
+
return treeData;
|
|
149
103
|
};
|
|
150
104
|
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
var safeParseJSON = function safeParseJSON(str, defaultObj) {
|
|
154
|
-
var result;
|
|
105
|
+
export const safeParseJSON = (str, defaultObj) => {
|
|
106
|
+
let result;
|
|
155
107
|
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
108
|
+
try {
|
|
109
|
+
result = JSON.parse(str);
|
|
110
|
+
} catch (err) {
|
|
111
|
+
console.warn('json parse error:', err);
|
|
112
|
+
result = typeof defaultObj === 'undefined' ? str : defaultObj;
|
|
113
|
+
}
|
|
162
114
|
|
|
163
|
-
|
|
115
|
+
return result || defaultObj;
|
|
164
116
|
};
|
|
165
|
-
|
|
166
|
-
exports.safeParseJSON = safeParseJSON;
|
|
@@ -1,58 +1,26 @@
|
|
|
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
|
-
var _default = function _default(props) {
|
|
27
|
-
var _useState = (0, _react.useState)(props.loading),
|
|
28
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
29
|
-
loading = _useState2[0],
|
|
30
|
-
setLoading = _useState2[1];
|
|
31
|
-
|
|
32
|
-
var onClick = function onClick(evt) {
|
|
33
|
-
if (!loading) {
|
|
34
|
-
setLoading(true);
|
|
35
|
-
var returnVal = props.onClick && props.onClick(evt, function () {
|
|
36
|
-
return setLoading(false);
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
if (returnVal instanceof Promise) {
|
|
40
|
-
returnVal.then(function () {
|
|
41
|
-
return setLoading(false);
|
|
42
|
-
})["catch"](function () {
|
|
43
|
-
return setLoading(false);
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
(0, _react.useEffect)(function () {
|
|
50
|
-
setLoading(props.loading);
|
|
51
|
-
}, [props.loading]);
|
|
52
|
-
return React.createElement(_button["default"], _extends({}, props, {
|
|
53
|
-
loading: loading,
|
|
54
|
-
onClick: onClick
|
|
55
|
-
}), loading ? props.loadingText || props.children : props.children);
|
|
1
|
+
import { useState, useEffect } from "react";
|
|
2
|
+
import { Button } from "antd";
|
|
3
|
+
|
|
4
|
+
export default ({ loadingText, loading: pLoading, onClick, children, ...otherProps }) => {
|
|
5
|
+
const [loading, setLoading] = useState(pLoading);
|
|
6
|
+
const doClick = (evt) => {
|
|
7
|
+
if (!loading) {
|
|
8
|
+
setLoading(true);
|
|
9
|
+
const returnVal = onClick && onClick(evt, () => setLoading(false));
|
|
10
|
+
|
|
11
|
+
if (returnVal instanceof Promise) {
|
|
12
|
+
returnVal.then(() => setLoading(false)).catch(() => setLoading(false));
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
useEffect(() => {
|
|
18
|
+
setLoading(pLoading);
|
|
19
|
+
}, [pLoading]);
|
|
20
|
+
|
|
21
|
+
return (
|
|
22
|
+
<Button {...otherProps} loading={loading} onClick={doClick}>
|
|
23
|
+
{loading ? loadingText || children : children}
|
|
24
|
+
</Button>
|
|
25
|
+
);
|
|
56
26
|
};
|
|
57
|
-
|
|
58
|
-
exports["default"] = _default;
|
package/lib/Modal/index.js
CHANGED
|
@@ -1,111 +1,86 @@
|
|
|
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
|
-
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
35
|
-
|
|
36
|
-
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
37
|
-
|
|
38
|
-
var Title = function Title(_ref) {
|
|
39
|
-
var title = _ref.title,
|
|
40
|
-
logo = _ref.logo,
|
|
41
|
-
fullscreen = _ref.fullscreen,
|
|
42
|
-
_ref$supportFullscree = _ref.supportFullscreen,
|
|
43
|
-
supportFullscreen = _ref$supportFullscree === void 0 ? true : _ref$supportFullscree,
|
|
44
|
-
onToggleFullscreen = _ref.onToggleFullscreen,
|
|
45
|
-
onClose = _ref.onClose;
|
|
46
|
-
return React.createElement(_react.Fragment, null, React.createElement("div", null, logo && React.createElement("img", {
|
|
47
|
-
src: logo
|
|
48
|
-
}), React.createElement("span", null, title)), React.createElement("div", {
|
|
49
|
-
className: "tnt-modal-header-actions"
|
|
50
|
-
}, supportFullscreen && React.createElement(_Icon["default"], {
|
|
51
|
-
className: "fullscreen",
|
|
52
|
-
type: fullscreen ? 'fullscreen-exit' : 'fullscreen',
|
|
53
|
-
onClick: onToggleFullscreen
|
|
54
|
-
}), React.createElement(_Icon["default"], {
|
|
55
|
-
className: "close",
|
|
56
|
-
type: "close",
|
|
57
|
-
onClick: onClose
|
|
58
|
-
})));
|
|
1
|
+
import { useState, useEffect, Fragment } from 'react';
|
|
2
|
+
import cn from 'classnames';
|
|
3
|
+
import { Modal } from 'antd';
|
|
4
|
+
import Icon from '../Icon';
|
|
5
|
+
import './index.less';
|
|
6
|
+
|
|
7
|
+
const Title = ({ title, logo, fullscreen, supportFullscreen = true, onToggleFullscreen, onClose }) => {
|
|
8
|
+
return (
|
|
9
|
+
<Fragment>
|
|
10
|
+
<div>
|
|
11
|
+
{
|
|
12
|
+
logo && <img src={logo} />
|
|
13
|
+
}
|
|
14
|
+
<span>{title}</span>
|
|
15
|
+
</div>
|
|
16
|
+
<div className="tnt-modal-header-actions">
|
|
17
|
+
{
|
|
18
|
+
supportFullscreen && (
|
|
19
|
+
<Icon
|
|
20
|
+
className="fullscreen"
|
|
21
|
+
type={fullscreen ? 'fullscreen-exit' : 'fullscreen'}
|
|
22
|
+
onClick={onToggleFullscreen}
|
|
23
|
+
/>
|
|
24
|
+
)
|
|
25
|
+
}
|
|
26
|
+
<Icon
|
|
27
|
+
className="close"
|
|
28
|
+
type="close"
|
|
29
|
+
onClick={onClose}
|
|
30
|
+
/>
|
|
31
|
+
</div>
|
|
32
|
+
</Fragment>
|
|
33
|
+
);
|
|
59
34
|
};
|
|
60
35
|
|
|
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
|
-
|
|
36
|
+
export default props => {
|
|
37
|
+
const {
|
|
38
|
+
visible,
|
|
39
|
+
children,
|
|
40
|
+
logo,
|
|
41
|
+
title,
|
|
42
|
+
height = '90vh',
|
|
43
|
+
width = '85%',
|
|
44
|
+
className,
|
|
45
|
+
supportFullscreen,
|
|
46
|
+
onToggleFullscreen,
|
|
47
|
+
onCancel,
|
|
48
|
+
...rest
|
|
49
|
+
} = props;
|
|
50
|
+
const [fullscreen, setFullscreen] = useState(rest.fullscreen || false);
|
|
51
|
+
|
|
52
|
+
useEffect(() => {
|
|
53
|
+
setFullscreen(rest.fullscreen);
|
|
54
|
+
}, [rest.fullscreen, visible]);
|
|
55
|
+
|
|
56
|
+
return (
|
|
57
|
+
<Modal
|
|
58
|
+
visible={visible}
|
|
59
|
+
title={
|
|
60
|
+
<Title
|
|
61
|
+
logo={logo}
|
|
62
|
+
title={title}
|
|
63
|
+
fullscreen={fullscreen}
|
|
64
|
+
supportFullscreen={supportFullscreen}
|
|
65
|
+
onClose={onCancel}
|
|
66
|
+
onToggleFullscreen={() => {
|
|
67
|
+
setFullscreen(!fullscreen);
|
|
68
|
+
onToggleFullscreen && onToggleFullscreen(!fullscreen);
|
|
69
|
+
}}
|
|
70
|
+
/>
|
|
71
|
+
}
|
|
72
|
+
onCancel={onCancel}
|
|
73
|
+
destroyOnClose
|
|
74
|
+
centered
|
|
75
|
+
footer={null}
|
|
76
|
+
width={fullscreen ? '100%' : width}
|
|
77
|
+
style={{
|
|
78
|
+
height: fullscreen ? '100vh' : height
|
|
79
|
+
}}
|
|
80
|
+
className={cn('tnt-modal', { [className]: className, fullscreen })}
|
|
81
|
+
{...rest}
|
|
82
|
+
>
|
|
83
|
+
{children}
|
|
84
|
+
</Modal>
|
|
85
|
+
);
|
|
109
86
|
};
|
|
110
|
-
|
|
111
|
-
exports["default"] = _default;
|