tntd 1.4.20 → 1.4.21
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 +27 -6
- package/components/locale.js +8 -2
- package/dist/1.tntd.js +1 -1
- package/dist/stats.json +23819 -24067
- 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 +67 -32
- 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 +80 -32
- 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
package/es/Handle/index.js
CHANGED
|
@@ -4,28 +4,41 @@ import "antd/lib/menu/style";
|
|
|
4
4
|
import _Menu from "antd/lib/menu";
|
|
5
5
|
import "antd/lib/divider/style";
|
|
6
6
|
import _Divider from "antd/lib/divider";
|
|
7
|
-
|
|
8
|
-
function _extends() { _extends = Object.assign
|
|
7
|
+
|
|
8
|
+
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); }
|
|
9
|
+
|
|
9
10
|
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; }
|
|
11
|
+
|
|
10
12
|
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; }
|
|
13
|
+
|
|
11
14
|
import { Fragment } from 'react';
|
|
15
|
+
import { getText, getLanguage } from '../locale';
|
|
12
16
|
import Icon from '../Icon';
|
|
13
17
|
import './index.less';
|
|
14
18
|
var clsPrefix = 'tnt-more-menus';
|
|
15
19
|
export default (function (props) {
|
|
16
|
-
var _lastChildPart2
|
|
20
|
+
var _lastChildPart2;
|
|
21
|
+
|
|
17
22
|
var _ref = props || {},
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
23
|
+
_ref$children = _ref.children,
|
|
24
|
+
children = _ref$children === void 0 ? [] : _ref$children,
|
|
25
|
+
type = _ref.type,
|
|
26
|
+
_ref$num = _ref.num,
|
|
27
|
+
num = _ref$num === void 0 ? 3 : _ref$num,
|
|
28
|
+
_ref$divider = _ref.divider,
|
|
29
|
+
divider = _ref$divider === void 0 ? true : _ref$divider,
|
|
30
|
+
lessOneMoreFit = _ref.lessOneMoreFit,
|
|
31
|
+
rest = _objectWithoutProperties(_ref, ["children", "type", "num", "divider", "lessOneMoreFit"]);
|
|
32
|
+
|
|
33
|
+
var _ref2 = props || {},
|
|
34
|
+
lang = _ref2.lang;
|
|
35
|
+
|
|
36
|
+
if (!lang) {
|
|
37
|
+
lang = getLanguage();
|
|
38
|
+
}
|
|
39
|
+
|
|
28
40
|
var newChildren = [];
|
|
41
|
+
|
|
29
42
|
if (Array.isArray(children)) {
|
|
30
43
|
newChildren = (children == null ? void 0 : children.filter(function (item) {
|
|
31
44
|
return !!item;
|
|
@@ -33,50 +46,72 @@ export default (function (props) {
|
|
|
33
46
|
} else if (children) {
|
|
34
47
|
newChildren.push(children);
|
|
35
48
|
}
|
|
49
|
+
|
|
36
50
|
var preChildPart = newChildren,
|
|
37
|
-
|
|
51
|
+
lastChildPart = null; // 只有1个时不适配
|
|
38
52
|
|
|
39
|
-
// 只有1个时不适配
|
|
40
53
|
if (lessOneMoreFit && newChildren.length - num === 1) {
|
|
41
54
|
preChildPart = newChildren;
|
|
42
55
|
} else if (newChildren && num && !isNaN(num) && newChildren.length > num) {
|
|
43
56
|
preChildPart = newChildren.slice(0, num);
|
|
44
57
|
lastChildPart = newChildren.slice(num);
|
|
45
58
|
}
|
|
59
|
+
|
|
46
60
|
;
|
|
61
|
+
|
|
47
62
|
if (divider && preChildPart) {
|
|
48
63
|
var preChildLen = preChildPart.length;
|
|
49
64
|
preChildPart = preChildPart.map(function (dom, i) {
|
|
50
65
|
var _lastChildPart;
|
|
51
|
-
|
|
66
|
+
|
|
67
|
+
return React.createElement(Fragment, {
|
|
52
68
|
key: i
|
|
53
|
-
}, dom, !(i === preChildLen - 1 && !((_lastChildPart = lastChildPart)
|
|
54
|
-
) &&
|
|
69
|
+
}, dom, !(i === preChildLen - 1 && !((_lastChildPart = lastChildPart) == null ? void 0 : _lastChildPart.length) // 没有更多 且 是最后一个时 不显示 Divider
|
|
70
|
+
) && React.createElement(_Divider, {
|
|
55
71
|
type: "vertical"
|
|
56
72
|
}));
|
|
57
73
|
});
|
|
58
74
|
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
75
|
+
|
|
76
|
+
var menu = function menu(childArr) {
|
|
77
|
+
return React.createElement(_Menu, {
|
|
78
|
+
className: "org-pop-opera-btn"
|
|
79
|
+
}, childArr == null ? void 0 : childArr.map(function (child, i) {
|
|
80
|
+
return React.createElement(_Menu.Item, {
|
|
81
|
+
key: i
|
|
82
|
+
}, child);
|
|
83
|
+
}));
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
if (lang === 'en') {
|
|
87
|
+
return React.createElement(_Dropdown, {
|
|
88
|
+
overlay: menu(newChildren || []),
|
|
89
|
+
arrow: true
|
|
90
|
+
}, type === 'icon' ? React.createElement(Icon, {
|
|
91
|
+
type: "more"
|
|
92
|
+
}) : React.createElement("a", {
|
|
93
|
+
className: "ant-dropdown-more"
|
|
94
|
+
}, getText('handleMore', lang), React.createElement("i", {
|
|
95
|
+
className: "".concat(clsPrefix, "-dropdown-icon")
|
|
96
|
+
}, React.createElement(Icon, {
|
|
97
|
+
type: "down"
|
|
98
|
+
}))));
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
return React.createElement("div", _extends({
|
|
67
102
|
onClick: function onClick(e) {
|
|
68
103
|
e.stopPropagation();
|
|
69
104
|
}
|
|
70
|
-
}, rest), preChildPart, ((
|
|
71
|
-
overlay: menu,
|
|
105
|
+
}, rest), preChildPart, !!((_lastChildPart2 = lastChildPart) == null ? void 0 : _lastChildPart2.length) && React.createElement(_Dropdown, {
|
|
106
|
+
overlay: menu(lastChildPart || []),
|
|
72
107
|
arrow: true
|
|
73
|
-
}, type === 'icon' ?
|
|
108
|
+
}, type === 'icon' ? React.createElement(Icon, {
|
|
74
109
|
type: "more"
|
|
75
|
-
}) :
|
|
110
|
+
}) : React.createElement("a", {
|
|
76
111
|
className: "ant-dropdown-more"
|
|
77
|
-
},
|
|
112
|
+
}, getText('handleMore', lang), React.createElement("i", {
|
|
78
113
|
className: "".concat(clsPrefix, "-dropdown-icon")
|
|
79
|
-
},
|
|
114
|
+
}, React.createElement(Icon, {
|
|
80
115
|
type: "down"
|
|
81
116
|
})))));
|
|
82
117
|
});
|