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
package/es/Handle/index.js
CHANGED
|
@@ -4,28 +4,48 @@ 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
|
+
|
|
10
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
11
|
+
|
|
12
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
13
|
+
|
|
14
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
15
|
+
|
|
9
16
|
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; }
|
|
17
|
+
|
|
10
18
|
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; }
|
|
11
|
-
|
|
19
|
+
|
|
20
|
+
import React, { Fragment } from 'react';
|
|
21
|
+
import { getText, getLanguage } from '../locale';
|
|
12
22
|
import Icon from '../Icon';
|
|
13
23
|
import './index.less';
|
|
14
24
|
var clsPrefix = 'tnt-more-menus';
|
|
15
25
|
export default (function (props) {
|
|
16
|
-
var _lastChildPart2
|
|
26
|
+
var _lastChildPart2;
|
|
27
|
+
|
|
17
28
|
var _ref = props || {},
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
29
|
+
_ref$children = _ref.children,
|
|
30
|
+
children = _ref$children === void 0 ? [] : _ref$children,
|
|
31
|
+
type = _ref.type,
|
|
32
|
+
_ref$num = _ref.num,
|
|
33
|
+
num = _ref$num === void 0 ? 3 : _ref$num,
|
|
34
|
+
_ref$divider = _ref.divider,
|
|
35
|
+
divider = _ref$divider === void 0 ? true : _ref$divider,
|
|
36
|
+
lessOneMoreFit = _ref.lessOneMoreFit,
|
|
37
|
+
popConfirmHandle = _ref.popConfirmHandle,
|
|
38
|
+
rest = _objectWithoutProperties(_ref, ["children", "type", "num", "divider", "lessOneMoreFit", "popConfirmHandle"]);
|
|
39
|
+
|
|
40
|
+
var _ref2 = props || {},
|
|
41
|
+
lang = _ref2.lang;
|
|
42
|
+
|
|
43
|
+
if (!lang) {
|
|
44
|
+
lang = getLanguage();
|
|
45
|
+
}
|
|
46
|
+
|
|
28
47
|
var newChildren = [];
|
|
48
|
+
|
|
29
49
|
if (Array.isArray(children)) {
|
|
30
50
|
newChildren = (children == null ? void 0 : children.filter(function (item) {
|
|
31
51
|
return !!item;
|
|
@@ -33,50 +53,97 @@ export default (function (props) {
|
|
|
33
53
|
} else if (children) {
|
|
34
54
|
newChildren.push(children);
|
|
35
55
|
}
|
|
56
|
+
|
|
57
|
+
if (lang === 'en' || popConfirmHandle) {
|
|
58
|
+
var _newChildren;
|
|
59
|
+
|
|
60
|
+
(_newChildren = newChildren) == null ? void 0 : _newChildren.forEach(function (v, i) {
|
|
61
|
+
var type = v.type,
|
|
62
|
+
props = v.props;
|
|
63
|
+
|
|
64
|
+
if ((type == null ? void 0 : type.name) === 'Popconfirm') {
|
|
65
|
+
newChildren[i] = React.cloneElement(v, _objectSpread({
|
|
66
|
+
overlayStyle: {
|
|
67
|
+
width: 180
|
|
68
|
+
}
|
|
69
|
+
}, (v == null ? void 0 : v.props) || {}, {
|
|
70
|
+
onClick: function onClick(e) {
|
|
71
|
+
return e.stopPropagation();
|
|
72
|
+
},
|
|
73
|
+
trigger: 'hover',
|
|
74
|
+
getPopupContainer: function getPopupContainer(trigger) {
|
|
75
|
+
return trigger.parentNode;
|
|
76
|
+
}
|
|
77
|
+
}));
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
|
|
36
82
|
var preChildPart = newChildren,
|
|
37
|
-
|
|
83
|
+
lastChildPart = null; // 只有1个时不适配
|
|
38
84
|
|
|
39
|
-
// 只有1个时不适配
|
|
40
85
|
if (lessOneMoreFit && newChildren.length - num === 1) {
|
|
41
86
|
preChildPart = newChildren;
|
|
42
87
|
} else if (newChildren && num && !isNaN(num) && newChildren.length > num) {
|
|
43
88
|
preChildPart = newChildren.slice(0, num);
|
|
44
89
|
lastChildPart = newChildren.slice(num);
|
|
45
90
|
}
|
|
91
|
+
|
|
46
92
|
;
|
|
93
|
+
|
|
47
94
|
if (divider && preChildPart) {
|
|
48
95
|
var preChildLen = preChildPart.length;
|
|
49
96
|
preChildPart = preChildPart.map(function (dom, i) {
|
|
50
97
|
var _lastChildPart;
|
|
51
|
-
|
|
98
|
+
|
|
99
|
+
return React.createElement(Fragment, {
|
|
52
100
|
key: i
|
|
53
|
-
}, dom, !(i === preChildLen - 1 && !((_lastChildPart = lastChildPart)
|
|
54
|
-
) &&
|
|
101
|
+
}, dom, !(i === preChildLen - 1 && !((_lastChildPart = lastChildPart) == null ? void 0 : _lastChildPart.length) // 没有更多 且 是最后一个时 不显示 Divider
|
|
102
|
+
) && React.createElement(_Divider, {
|
|
55
103
|
type: "vertical"
|
|
56
104
|
}));
|
|
57
105
|
});
|
|
58
106
|
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
107
|
+
|
|
108
|
+
var menu = function menu(childArr) {
|
|
109
|
+
return React.createElement(_Menu, {
|
|
110
|
+
className: "org-pop-opera-btn"
|
|
111
|
+
}, childArr == null ? void 0 : childArr.map(function (child, i) {
|
|
112
|
+
return React.createElement(_Menu.Item, {
|
|
113
|
+
key: i
|
|
114
|
+
}, child);
|
|
115
|
+
}));
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
if (lang === 'en') {
|
|
119
|
+
return React.createElement(_Dropdown, {
|
|
120
|
+
overlay: menu(newChildren || []),
|
|
121
|
+
arrow: true
|
|
122
|
+
}, type === 'icon' ? React.createElement(Icon, {
|
|
123
|
+
type: "more"
|
|
124
|
+
}) : React.createElement("a", {
|
|
125
|
+
className: "ant-dropdown-more"
|
|
126
|
+
}, getText('handleMore', lang), React.createElement("i", {
|
|
127
|
+
className: "".concat(clsPrefix, "-dropdown-icon")
|
|
128
|
+
}, React.createElement(Icon, {
|
|
129
|
+
type: "down"
|
|
130
|
+
}))));
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
return React.createElement("div", _extends({
|
|
67
134
|
onClick: function onClick(e) {
|
|
68
135
|
e.stopPropagation();
|
|
69
136
|
}
|
|
70
|
-
}, rest), preChildPart, ((
|
|
71
|
-
overlay: menu,
|
|
137
|
+
}, rest), preChildPart, !!((_lastChildPart2 = lastChildPart) == null ? void 0 : _lastChildPart2.length) && React.createElement(_Dropdown, {
|
|
138
|
+
overlay: menu(lastChildPart || []),
|
|
72
139
|
arrow: true
|
|
73
|
-
}, type === 'icon' ?
|
|
140
|
+
}, type === 'icon' ? React.createElement(Icon, {
|
|
74
141
|
type: "more"
|
|
75
|
-
}) :
|
|
142
|
+
}) : React.createElement("a", {
|
|
76
143
|
className: "ant-dropdown-more"
|
|
77
|
-
},
|
|
144
|
+
}, getText('handleMore', lang), React.createElement("i", {
|
|
78
145
|
className: "".concat(clsPrefix, "-dropdown-icon")
|
|
79
|
-
},
|
|
146
|
+
}, React.createElement(Icon, {
|
|
80
147
|
type: "down"
|
|
81
148
|
})))));
|
|
82
149
|
});
|