tntd 1.4.27 → 1.4.29
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/components/Handle/index.js +12 -5
- package/dist/stats.json +5278 -5260
- package/dist/tntd.js +1 -1
- 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 +41 -51
- 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 +32 -15
- 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
package/babel.config.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
const presets = [
|
|
7
|
-
"@babel/
|
|
7
|
+
"@babel/env",
|
|
8
8
|
"@babel/preset-react"
|
|
9
9
|
|
|
10
10
|
];
|
|
@@ -31,26 +31,26 @@ const plugins = [
|
|
|
31
31
|
// ['babel-plugin-styless']
|
|
32
32
|
];
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
const isES = process.env.BUILD_ENV === 'es';
|
|
35
35
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
36
|
+
if (isES) {
|
|
37
|
+
presets[0] = [
|
|
38
|
+
presets[0],
|
|
39
|
+
{
|
|
40
|
+
modules: false
|
|
41
|
+
}
|
|
42
|
+
];
|
|
43
|
+
}
|
|
44
44
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
//
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
45
|
+
if (process.env.BUILD_ENV !== 'umd' && !process.env.WEBPACK_DEV_SERVER) {
|
|
46
|
+
plugins.push([
|
|
47
|
+
'import',
|
|
48
|
+
{
|
|
49
|
+
libraryName: 'antd',
|
|
50
|
+
// libraryDirectory: isES ? 'es' : 'lib',
|
|
51
|
+
style: true,
|
|
52
|
+
}
|
|
53
|
+
]);
|
|
54
|
+
}
|
|
55
55
|
|
|
56
56
|
module.exports = { presets, plugins };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { Fragment } from 'react';
|
|
1
|
+
import React, { Fragment, useRef } from 'react';
|
|
2
2
|
import { Dropdown, Menu, Divider } from 'antd';
|
|
3
3
|
import { getText, getLanguage } from '../locale';
|
|
4
4
|
import Icon from '../Icon';
|
|
@@ -8,10 +8,10 @@ const clsPrefix = 'tnt-more-menus';
|
|
|
8
8
|
|
|
9
9
|
export default props => {
|
|
10
10
|
const { children = [], type, num = 3, divider = true, lessOneMoreFit, popConfirmHandle, ...rest } = props || {};
|
|
11
|
-
let { lang } = props||{};
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
let { lang:propsLang } = props||{};
|
|
12
|
+
const langRef = useRef(propsLang || getLanguage());
|
|
13
|
+
const lang = langRef?.current;
|
|
14
|
+
|
|
15
15
|
let newChildren = [];
|
|
16
16
|
if(Array.isArray(children)){
|
|
17
17
|
newChildren = children?.filter(item => !!item) || [];
|
|
@@ -23,10 +23,17 @@ export default props => {
|
|
|
23
23
|
newChildren?.forEach((v,i)=>{
|
|
24
24
|
const { type, props } = v;
|
|
25
25
|
if(type?.name === 'Popconfirm' || (props.hasOwnProperty('onConfirm') && typeof props?.onConfirm === 'function')){
|
|
26
|
+
let placement ={};
|
|
27
|
+
if(lang === 'en' || (num && !isNaN(num) && (i+1) > num && !(lessOneMoreFit && newChildren.length - num === 1))){
|
|
28
|
+
placement = {
|
|
29
|
+
placement:'left'
|
|
30
|
+
};
|
|
31
|
+
}
|
|
26
32
|
newChildren[i]= React.cloneElement(v, {
|
|
27
33
|
overlayStyle: { width: 180 },
|
|
28
34
|
...(v?.props || {}),
|
|
29
35
|
onClick:(e) => e.stopPropagation(),
|
|
36
|
+
...placement,
|
|
30
37
|
trigger:'hover',
|
|
31
38
|
getPopupContainer:(trigger) => trigger.parentNode,
|
|
32
39
|
});
|