tntd 1.4.20 → 1.4.22
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/Handle/README.md +0 -20
- package/components/Handle/index.js +44 -7
- package/components/locale.js +8 -2
- package/dist/1.tntd.js +1 -1
- package/dist/stats.json +24430 -24390
- package/dist/tntd.css +1 -1
- package/dist/tntd.js +13 -8
- package/es/ArrayInput/icon.js +5 -5
- package/es/ArrayInput/index.js +108 -76
- package/es/AuthContext.js +1 -1
- package/es/Columns/index.js +38 -31
- package/es/DevelopmentLogin/LoginModal.js +45 -32
- package/es/DevelopmentLogin/index.js +17 -13
- package/es/Ellipsis/Svg/CopySVG.js +13 -13
- package/es/Ellipsis/Svg/TickSVG.js +8 -8
- package/es/Ellipsis/index.js +69 -58
- package/es/Handle/README.md +0 -20
- package/es/Handle/index.js +100 -33
- package/es/Icon/fonts/iconfont.js +12 -7
- package/es/Icon/index.js +13 -10
- package/es/Img/Contain.js +29 -24
- package/es/Img/Cover.js +54 -40
- package/es/Img/index.js +45 -36
- package/es/Layout/ActionsContext.js +2 -3
- package/es/Layout/AppList.js +92 -37
- package/es/Layout/Application.js +72 -26
- package/es/Layout/Avatar.js +66 -29
- package/es/Layout/CompatibleLanguage.js +94 -39
- package/es/Layout/EnterpriseLayout/Avatar.js +76 -38
- package/es/Layout/EnterpriseLayout/Language.js +32 -14
- package/es/Layout/EnterpriseLayout/Theme.js +34 -16
- package/es/Layout/EnterpriseLayout/index.js +16 -14
- package/es/Layout/GlobalNavigation/NavigationPopup.js +170 -59
- package/es/Layout/GlobalNavigation/index.js +54 -20
- package/es/Layout/Header.js +46 -25
- package/es/Layout/HeaderActions.js +56 -42
- package/es/Layout/HeaderNavs.js +47 -20
- package/es/Layout/HeaderTabs.js +102 -49
- package/es/Layout/Iconfont.js +1 -1
- package/es/Layout/Language.js +32 -14
- package/es/Layout/Layout.js +108 -86
- package/es/Layout/Logo.js +32 -16
- package/es/Layout/OrgAppList.js +107 -62
- package/es/Layout/SideMenu.js +124 -63
- package/es/Layout/Theme.js +61 -23
- package/es/Layout/checkAuth.js +29 -0
- package/es/Layout/index.js +34 -26
- package/es/Layout/paaslayout/CompactSideMenu.js +74 -35
- package/es/Layout/paaslayout/Header.js +45 -22
- package/es/Layout/paaslayout/Logo.js +13 -3
- package/es/Layout/paaslayout/SideMenu.js +78 -39
- package/es/Layout/paaslayout/index.js +102 -75
- package/es/Layout/storage.js +9 -10
- package/es/Layout/utils.js +136 -0
- package/es/LoadingButton/index.js +24 -15
- package/es/Modal/index.js +46 -38
- package/es/Page/Box.js +41 -34
- package/es/Page/index.js +67 -52
- package/es/Page/utils.js +5 -0
- package/es/QueryForm/Field/Checkbox.js +9 -5
- package/es/QueryForm/Field/Select.js +41 -31
- package/es/QueryForm/Field/SelectInput.js +41 -26
- package/es/QueryForm/Field/fieldsMap.js +1 -0
- package/es/QueryForm/Field/index.js +71 -41
- package/es/QueryForm/createActions.js +7 -6
- package/es/QueryForm/index.js +135 -76
- package/es/QueryListScene/List.js +128 -74
- package/es/QueryListScene/QueryForm.js +81 -46
- package/es/QueryListScene/QueryListScene.js +40 -25
- package/es/QueryListScene/Title.js +3 -3
- package/es/QueryListScene/Toolbar.js +12 -11
- package/es/Select/DropDownWrap.js +50 -29
- package/es/Select/index.js +231 -135
- package/es/Table/ResizableTable/index.js +40 -26
- package/es/Table/index.js +16 -18
- package/es/Title/index.js +23 -21
- package/es/locale.js +11 -3
- package/es/utils/checkAuth.js +5 -3
- package/es/utils/findMenuInfoByPath.js +4 -0
- package/es/utils/index.js +23 -12
- package/lib/ArrayInput/icon.js +6 -6
- package/lib/ArrayInput/index.js +127 -78
- package/lib/AuthContext.js +4 -1
- package/lib/Columns/index.js +47 -31
- package/lib/DevelopmentLogin/LoginModal.js +58 -32
- package/lib/DevelopmentLogin/index.js +27 -16
- package/lib/Ellipsis/Svg/CopySVG.js +15 -13
- package/lib/Ellipsis/Svg/TickSVG.js +10 -8
- package/lib/Ellipsis/index.js +80 -57
- package/lib/Handle/README.md +0 -20
- package/lib/Handle/index.js +119 -33
- package/lib/Icon/fonts/iconfont.js +12 -7
- package/lib/Icon/index.js +20 -11
- package/lib/Img/Contain.js +34 -24
- package/lib/Img/Cover.js +65 -42
- package/lib/Img/index.js +51 -36
- package/lib/Layout/ActionsContext.js +4 -1
- package/lib/Layout/AppList.js +118 -40
- package/lib/Layout/Application.js +86 -26
- package/lib/Layout/Avatar.js +86 -32
- package/lib/Layout/CompatibleLanguage.js +110 -39
- package/lib/Layout/EnterpriseLayout/Avatar.js +100 -41
- package/lib/Layout/EnterpriseLayout/Header.js +113 -0
- package/lib/Layout/EnterpriseLayout/HeaderActions.js +104 -0
- package/lib/Layout/EnterpriseLayout/Language.js +48 -17
- package/lib/Layout/EnterpriseLayout/Theme.js +44 -16
- package/lib/Layout/EnterpriseLayout/index.js +23 -14
- package/lib/Layout/GlobalNavigation/NavigationPopup.js +186 -59
- package/lib/Layout/GlobalNavigation/index.js +74 -23
- package/lib/Layout/Header.js +63 -28
- package/lib/Layout/HeaderActions.js +74 -45
- package/lib/Layout/HeaderNavs.js +61 -23
- package/lib/Layout/HeaderTabs.js +118 -51
- package/lib/Layout/Iconfont.js +5 -1
- package/lib/Layout/Language.js +48 -17
- package/lib/Layout/Layout.js +128 -88
- package/lib/Layout/Logo.js +43 -19
- package/lib/Layout/OrgAppList.js +127 -64
- package/lib/Layout/SideMenu.js +143 -65
- package/lib/Layout/Theme.js +73 -23
- package/lib/Layout/checkAuth.js +39 -0
- package/lib/Layout/createActions.js +5 -0
- package/lib/Layout/images/index.js +28 -0
- package/lib/Layout/index.js +55 -30
- package/lib/Layout/paaslayout/CompactSideMenu.js +84 -35
- package/lib/Layout/paaslayout/Header.js +55 -22
- package/lib/Layout/paaslayout/Logo.js +19 -3
- package/lib/Layout/paaslayout/SideMenu.js +87 -39
- package/lib/Layout/paaslayout/index.js +122 -77
- package/lib/Layout/storage.js +40 -11
- package/lib/Layout/utils.js +166 -0
- package/lib/LoadingButton/index.js +29 -15
- package/lib/Modal/index.js +53 -38
- package/lib/Page/Box.js +45 -34
- package/lib/Page/index.js +77 -52
- package/lib/Page/utils.js +9 -1
- package/lib/QueryForm/Field/Checkbox.js +13 -5
- package/lib/QueryForm/Field/Select.js +53 -33
- package/lib/QueryForm/Field/SelectInput.js +56 -28
- package/lib/QueryForm/Field/fieldsMap.js +15 -1
- package/lib/QueryForm/Field/index.js +81 -43
- package/lib/QueryForm/createActions.js +12 -6
- package/lib/QueryForm/index.js +157 -78
- package/lib/QueryForm/useForm.js +5 -0
- package/lib/QueryListScene/List.js +140 -76
- package/lib/QueryListScene/QueryForm.js +86 -46
- package/lib/QueryListScene/QueryListScene.js +46 -25
- package/lib/QueryListScene/Title.js +7 -3
- package/lib/QueryListScene/Toolbar.js +16 -11
- package/lib/QueryListScene/createActions.js +5 -0
- package/lib/QueryListScene/index.js +10 -0
- package/lib/QueryListScene/useActions.js +5 -0
- package/lib/Select/DropDownWrap.js +56 -31
- package/lib/Select/index.js +241 -135
- package/lib/Table/ResizableTable/index.js +48 -26
- package/lib/Table/index.js +28 -17
- package/lib/Title/index.js +28 -21
- package/lib/index.js +56 -35
- package/lib/locale.js +19 -4
- package/lib/utils/checkAuth.js +9 -4
- package/lib/utils/findMenuInfoByPath.js +8 -1
- package/lib/utils/index.js +42 -15
- package/package.json +2 -2
|
@@ -54,26 +54,6 @@ const Demo = props => {
|
|
|
54
54
|
<a>查看</a>
|
|
55
55
|
<a>编辑</a>
|
|
56
56
|
<a>测试</a>
|
|
57
|
-
{
|
|
58
|
-
false &&
|
|
59
|
-
<a>导入</a>
|
|
60
|
-
}
|
|
61
|
-
<a>导出</a>
|
|
62
|
-
<Popconfirm
|
|
63
|
-
title="Are you sure delete this task?"
|
|
64
|
-
onConfirm={void 0}
|
|
65
|
-
onCancel={void 0}
|
|
66
|
-
okText="Yes"
|
|
67
|
-
cancelText="No"
|
|
68
|
-
onClick={e => e.stopPropagation()}
|
|
69
|
-
getPopupContainer={trigger => trigger.parentNode}
|
|
70
|
-
trigger="hover"
|
|
71
|
-
overlayStyle={{
|
|
72
|
-
width: 300
|
|
73
|
-
}}
|
|
74
|
-
>
|
|
75
|
-
<a>Delete</a>
|
|
76
|
-
</Popconfirm>
|
|
77
57
|
</Handle>
|
|
78
58
|
)
|
|
79
59
|
}
|
|
@@ -1,12 +1,17 @@
|
|
|
1
|
-
import { Fragment } from 'react';
|
|
1
|
+
import React, { Fragment } from 'react';
|
|
2
2
|
import { Dropdown, Menu, Divider } from 'antd';
|
|
3
|
+
import { getText, getLanguage } from '../locale';
|
|
3
4
|
import Icon from '../Icon';
|
|
4
5
|
import './index.less';
|
|
5
6
|
|
|
6
7
|
const clsPrefix = 'tnt-more-menus';
|
|
7
8
|
|
|
8
9
|
export default props => {
|
|
9
|
-
const { children = [], type, num = 3,
|
|
10
|
+
const { children = [], type, num = 3, divider = true, lessOneMoreFit, popConfirmHandle, ...rest } = props || {};
|
|
11
|
+
let { lang } = props||{};
|
|
12
|
+
if(!lang){
|
|
13
|
+
lang = getLanguage();
|
|
14
|
+
}
|
|
10
15
|
let newChildren = [];
|
|
11
16
|
if(Array.isArray(children)){
|
|
12
17
|
newChildren = children?.filter(item => !!item) || [];
|
|
@@ -14,6 +19,22 @@ export default props => {
|
|
|
14
19
|
newChildren.push(children);
|
|
15
20
|
}
|
|
16
21
|
|
|
22
|
+
if(lang === 'en' || popConfirmHandle){
|
|
23
|
+
newChildren?.forEach((v,i)=>{
|
|
24
|
+
const { type, props } = v;
|
|
25
|
+
if(type?.name === 'Popconfirm'){
|
|
26
|
+
newChildren[i]= React.cloneElement(v, {
|
|
27
|
+
overlayStyle: { width: 180 },
|
|
28
|
+
...(v?.props || {}),
|
|
29
|
+
onClick:(e) => e.stopPropagation(),
|
|
30
|
+
trigger:'hover',
|
|
31
|
+
getPopupContainer:(trigger) => trigger.parentNode,
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
|
|
17
38
|
let [preChildPart, lastChildPart] = [newChildren, null];
|
|
18
39
|
|
|
19
40
|
// 只有1个时不适配
|
|
@@ -39,16 +60,32 @@ export default props => {
|
|
|
39
60
|
</Fragment>
|
|
40
61
|
));
|
|
41
62
|
}
|
|
42
|
-
const menu = (
|
|
63
|
+
const menu = (childArr)=>(
|
|
43
64
|
<Menu className="org-pop-opera-btn">
|
|
44
65
|
{
|
|
45
|
-
|
|
66
|
+
childArr?.map(
|
|
46
67
|
(child,i) => <Menu.Item key={i}>{child}</Menu.Item>
|
|
47
68
|
)
|
|
48
69
|
}
|
|
49
70
|
</Menu>
|
|
50
71
|
);
|
|
51
72
|
|
|
73
|
+
if(lang === 'en'){
|
|
74
|
+
return (
|
|
75
|
+
<Dropdown overlay={menu(newChildren||[])} arrow>
|
|
76
|
+
{
|
|
77
|
+
type === 'icon' ?
|
|
78
|
+
<Icon type="more" /> :
|
|
79
|
+
<a className="ant-dropdown-more">
|
|
80
|
+
{getText('handleMore',lang)}
|
|
81
|
+
<i className={`${clsPrefix}-dropdown-icon`}>
|
|
82
|
+
<Icon type="down" />
|
|
83
|
+
</i>
|
|
84
|
+
</a>
|
|
85
|
+
}
|
|
86
|
+
</Dropdown>
|
|
87
|
+
);
|
|
88
|
+
}
|
|
52
89
|
return (
|
|
53
90
|
<div
|
|
54
91
|
onClick={(e) => { e.stopPropagation(); }}
|
|
@@ -56,13 +93,13 @@ export default props => {
|
|
|
56
93
|
>
|
|
57
94
|
{preChildPart}
|
|
58
95
|
{
|
|
59
|
-
lastChildPart?.length
|
|
60
|
-
<Dropdown overlay={menu} arrow>
|
|
96
|
+
!!lastChildPart?.length &&
|
|
97
|
+
<Dropdown overlay={menu(lastChildPart||[])} arrow>
|
|
61
98
|
{
|
|
62
99
|
type === 'icon' ?
|
|
63
100
|
<Icon type="more" /> :
|
|
64
101
|
<a className="ant-dropdown-more">
|
|
65
|
-
{
|
|
102
|
+
{getText('handleMore',lang)}
|
|
66
103
|
<i className={`${clsPrefix}-dropdown-icon`}>
|
|
67
104
|
<Icon type="down" />
|
|
68
105
|
</i>
|
package/components/locale.js
CHANGED
|
@@ -20,7 +20,10 @@ export const zh_CN = {
|
|
|
20
20
|
nameNull: '暂无昵称',
|
|
21
21
|
personalSettings: '个人设置',
|
|
22
22
|
changePwd: '修改密码',
|
|
23
|
-
signOut: '退出'
|
|
23
|
+
signOut: '退出',
|
|
24
|
+
|
|
25
|
+
// Handle
|
|
26
|
+
handleMore:'更多'
|
|
24
27
|
};
|
|
25
28
|
|
|
26
29
|
export const en_US = {
|
|
@@ -42,7 +45,10 @@ export const en_US = {
|
|
|
42
45
|
nameNull: 'No nickname yet',
|
|
43
46
|
personalSettings: 'Setting',
|
|
44
47
|
changePwd: 'Change password',
|
|
45
|
-
signOut: 'Sign out'
|
|
48
|
+
signOut: 'Sign out',
|
|
49
|
+
|
|
50
|
+
// Handle
|
|
51
|
+
handleMore:'More'
|
|
46
52
|
};
|
|
47
53
|
|
|
48
54
|
export const getText = (key, language = 'cn', ...params) => {
|
package/dist/1.tntd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(window.webpackJsonptntd=window.webpackJsonptntd||[]).push([[1],{
|
|
1
|
+
(window.webpackJsonptntd=window.webpackJsonptntd||[]).push([[1],{76:function(e,t,n){"use strict";n.r(t);var s=n(0),p=n(1);function f(t,e){var n,r=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)),r}function b(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function d(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)){var n=[],r=!0,o=!1,a=void 0;try{for(var c,i=e[Symbol.iterator]();!(r=(c=i.next()).done)&&(n.push(c.value),!t||n.length!==t);r=!0);}catch(e){o=!0,a=e}finally{try{r||null==i.return||i.return()}finally{if(o)throw a}}return n}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var y=new(n(10).a),m={account:void 0,password:void 0};t.default=function(e){var t=e.visible,r=e.close,n=e.signIn,o=d(Object(s.useState)(!1),2),a=o[0],c=o[1],e=localStorage.getItem("accountInfo");if(e)try{m=JSON.parse(e)}catch(e){}function i(e,t){l(function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?f(Object(n),!0).forEach(function(e){b(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):f(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}({},u,b({},e,t.target.value)))}var o=d(Object(s.useState)(m),2),u=o[0],l=o[1],e=u.account,o=u.password;return React.createElement(p.Modal,{title:"开发者模拟登陆",visible:t,maskClosable:!1,onOk:function(){c(!0);var e=n&&n(u);e&&e.then&&e.then(function(n){p.message.success("模拟登陆成功"),localStorage.setItem("accountInfo",JSON.stringify(u)),c(!1),setTimeout(function(){var e=n||{},t=e.tdToken,e=e.userId;y.set("_td_token_",t,{path:"/"}),y.set("_uid_",e,{path:"/"}),r()},500)}).catch(function(e){throw c(!1),e})},onCancel:r,confirmLoading:a},React.createElement(p.Form,{labelCol:{span:5},wrapperCol:{span:18}},React.createElement(p.Form.Item,{label:"用户名:"},React.createElement(p.Input,{type:"text",placeholder:"请输入用户名",value:e||void 0,onChange:function(e){return i("account",e)}})),React.createElement(p.Form.Item,{label:"密码:"},React.createElement(p.Input,{type:"text",placeholder:"请输入用户名",value:o||void 0,onChange:function(e){return i("password",e)}}))))}}}]);
|