tntd 1.4.32 → 1.4.33-beta.1
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/Ellipsis/index.js +47 -15
- package/components/QueryListScene/QueryForm.js +4 -4
- package/components/QueryListScene/createActions.js +4 -4
- package/dist/1.tntd.js +1 -1
- package/dist/stats.json +24089 -23289
- package/dist/tntd.css +1 -1
- package/dist/tntd.js +7 -10
- package/es/ArrayInput/icon.js +5 -5
- package/es/ArrayInput/index.js +79 -111
- package/es/AuthContext.js +1 -1
- package/es/Columns/index.js +33 -40
- package/es/DevelopmentLogin/LoginModal.js +33 -46
- package/es/DevelopmentLogin/index.js +14 -18
- package/es/Ellipsis/Svg/CopySVG.js +13 -13
- package/es/Ellipsis/Svg/TickSVG.js +8 -8
- package/es/Ellipsis/index.js +100 -79
- package/es/Handle/index.js +46 -64
- package/es/Icon/fonts/iconfont.js +7 -12
- package/es/Icon/index.js +12 -15
- package/es/Img/Contain.js +26 -31
- package/es/Img/Cover.js +43 -57
- package/es/Img/index.js +39 -48
- package/es/Layout/ActionsContext.js +3 -2
- package/es/Layout/AppList.js +39 -94
- package/es/Layout/Application.js +28 -74
- package/es/Layout/Avatar.js +30 -67
- package/es/Layout/CompatibleLanguage.js +41 -96
- package/es/Layout/EnterpriseLayout/Avatar.js +39 -77
- package/es/Layout/EnterpriseLayout/Language.js +16 -34
- package/es/Layout/EnterpriseLayout/Theme.js +18 -36
- package/es/Layout/EnterpriseLayout/index.js +14 -16
- package/es/Layout/GlobalNavigation/NavigationPopup.js +61 -172
- package/es/Layout/GlobalNavigation/index.js +22 -56
- package/es/Layout/Header.js +26 -47
- package/es/Layout/HeaderActions.js +45 -59
- package/es/Layout/HeaderNavs.js +24 -51
- package/es/Layout/HeaderTabs.js +53 -106
- package/es/Layout/Iconfont.js +1 -1
- package/es/Layout/Language.js +16 -34
- package/es/Layout/Layout.js +88 -110
- package/es/Layout/Logo.js +17 -33
- package/es/Layout/OrgAppList.js +64 -109
- package/es/Layout/SideMenu.js +67 -128
- package/es/Layout/Theme.js +25 -63
- package/es/Layout/index.js +28 -37
- package/es/Layout/paaslayout/CompactSideMenu.js +37 -76
- package/es/Layout/paaslayout/Header.js +23 -46
- package/es/Layout/paaslayout/Logo.js +4 -14
- package/es/Layout/paaslayout/SideMenu.js +41 -80
- package/es/Layout/paaslayout/index.js +77 -104
- package/es/Layout/storage.js +10 -9
- package/es/LoadingButton/index.js +18 -27
- package/es/Modal/index.js +42 -51
- package/es/Page/Box.js +36 -43
- package/es/Page/index.js +56 -71
- package/es/Page/utils.js +0 -5
- package/es/QueryForm/Field/Checkbox.js +7 -11
- package/es/QueryForm/Field/Select.js +34 -44
- package/es/QueryForm/Field/SelectInput.js +31 -46
- package/es/QueryForm/Field/fieldsMap.js +0 -1
- package/es/QueryForm/Field/index.js +46 -78
- package/es/QueryForm/createActions.js +6 -7
- package/es/QueryForm/index.js +79 -140
- package/es/QueryListScene/List.js +83 -139
- package/es/QueryListScene/QueryForm.js +54 -91
- package/es/QueryListScene/QueryListScene.js +29 -47
- package/es/QueryListScene/Title.js +3 -3
- package/es/QueryListScene/Toolbar.js +13 -14
- package/es/QueryListScene/createActions.js +4 -4
- package/es/Select/DropDownWrap.js +32 -55
- package/es/Select/index.js +140 -232
- package/es/Table/ResizableTable/index.js +29 -43
- package/es/Table/index.js +20 -19
- package/es/Title/index.js +23 -25
- package/es/locale.js +1 -5
- package/es/utils/checkAuth.js +6 -8
- package/es/utils/findMenuInfoByPath.js +0 -4
- package/es/utils/index.js +17 -27
- package/lib/ArrayInput/icon.js +7 -9
- package/lib/ArrayInput/index.js +82 -131
- package/lib/AuthContext.js +2 -6
- package/lib/Columns/index.js +36 -54
- package/lib/DevelopmentLogin/LoginModal.js +36 -63
- package/lib/DevelopmentLogin/index.js +21 -31
- package/lib/Ellipsis/Svg/CopySVG.js +15 -18
- package/lib/Ellipsis/Svg/TickSVG.js +10 -13
- package/lib/Ellipsis/index.js +105 -93
- package/lib/Handle/index.js +51 -87
- package/lib/Icon/fonts/iconfont.js +7 -12
- package/lib/Icon/iconList.js +1 -2
- package/lib/Icon/index.js +16 -26
- package/lib/Img/Contain.js +29 -40
- package/lib/Img/Cover.js +48 -72
- package/lib/Img/index.js +42 -58
- package/lib/Layout/ActionsContext.js +1 -5
- package/lib/Layout/AppList.js +45 -124
- package/lib/Layout/Application.js +31 -92
- package/lib/Layout/Avatar.js +36 -91
- package/lib/Layout/CompatibleLanguage.js +44 -116
- package/lib/Layout/EnterpriseLayout/Avatar.js +45 -105
- package/lib/Layout/EnterpriseLayout/Language.js +22 -54
- package/lib/Layout/EnterpriseLayout/Theme.js +21 -50
- package/lib/Layout/EnterpriseLayout/index.js +17 -27
- package/lib/Layout/GlobalNavigation/NavigationPopup.js +64 -192
- package/lib/Layout/GlobalNavigation/index.js +28 -80
- package/lib/Layout/Header.js +36 -68
- package/lib/Layout/HeaderActions.js +51 -81
- package/lib/Layout/HeaderNavs.js +30 -70
- package/lib/Layout/HeaderTabs.js +58 -127
- package/lib/Layout/Iconfont.js +4 -9
- package/lib/Layout/Language.js +22 -54
- package/lib/Layout/Layout.js +93 -134
- package/lib/Layout/Logo.js +26 -47
- package/lib/Layout/OrgAppList.js +69 -133
- package/lib/Layout/SideMenu.js +72 -151
- package/lib/Layout/Theme.js +28 -79
- package/lib/Layout/createActions.js +3 -9
- package/lib/Layout/images/index.js +5 -36
- package/lib/Layout/index.js +35 -63
- package/lib/Layout/paaslayout/CompactSideMenu.js +40 -90
- package/lib/Layout/paaslayout/Header.js +30 -60
- package/lib/Layout/paaslayout/Logo.js +11 -24
- package/lib/Layout/paaslayout/SideMenu.js +44 -93
- package/lib/Layout/paaslayout/index.js +82 -128
- package/lib/Layout/storage.js +26 -68
- package/lib/LoadingButton/index.js +21 -36
- package/lib/Modal/index.js +45 -62
- package/lib/Page/Box.js +38 -50
- package/lib/Page/index.js +58 -84
- package/lib/Page/utils.js +5 -16
- package/lib/QueryForm/Field/Checkbox.js +10 -19
- package/lib/QueryForm/Field/Select.js +39 -60
- package/lib/QueryForm/Field/SelectInput.js +36 -65
- package/lib/QueryForm/Field/fieldsMap.js +6 -23
- package/lib/QueryForm/Field/index.js +50 -91
- package/lib/QueryForm/createActions.js +9 -16
- package/lib/QueryForm/index.js +83 -165
- package/lib/QueryForm/useForm.js +1 -6
- package/lib/QueryListScene/List.js +89 -153
- package/lib/QueryListScene/QueryForm.js +58 -101
- package/lib/QueryListScene/QueryListScene.js +31 -56
- package/lib/QueryListScene/Title.js +6 -11
- package/lib/QueryListScene/Toolbar.js +16 -22
- package/lib/QueryListScene/createActions.js +7 -13
- package/lib/QueryListScene/index.js +5 -19
- package/lib/QueryListScene/useActions.js +1 -6
- package/lib/Select/DropDownWrap.js +35 -63
- package/lib/Select/index.js +142 -245
- package/lib/Table/ResizableTable/index.js +31 -54
- package/lib/Table/index.js +21 -34
- package/lib/Title/index.js +26 -34
- package/lib/index.js +36 -57
- package/lib/locale.js +9 -25
- package/lib/utils/checkAuth.js +9 -16
- package/lib/utils/findMenuInfoByPath.js +3 -12
- package/lib/utils/index.js +26 -60
- package/package.json +3 -2
package/es/Handle/index.js
CHANGED
|
@@ -1,22 +1,19 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
1
2
|
import "antd/lib/dropdown/style";
|
|
2
3
|
import _Dropdown from "antd/lib/dropdown";
|
|
3
4
|
import "antd/lib/menu/style";
|
|
4
5
|
import _Menu from "antd/lib/menu";
|
|
5
6
|
import "antd/lib/divider/style";
|
|
6
7
|
import _Divider from "antd/lib/divider";
|
|
7
|
-
|
|
8
|
-
function _extends() { _extends = Object.assign
|
|
9
|
-
|
|
10
|
-
function
|
|
11
|
-
|
|
12
|
-
function
|
|
13
|
-
|
|
14
|
-
function
|
|
15
|
-
|
|
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
|
-
|
|
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; }
|
|
19
|
-
|
|
8
|
+
var _excluded = ["children", "type", "num", "divider", "lessOneMoreFit", "popConfirmHandle", "isIconBtn"];
|
|
9
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
10
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
11
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
12
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
13
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
14
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
15
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
16
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
20
17
|
import React, { Fragment, useRef } from 'react';
|
|
21
18
|
import { getText, getLanguage } from '../locale';
|
|
22
19
|
import Icon from '../Icon';
|
|
@@ -24,63 +21,54 @@ import './index.less';
|
|
|
24
21
|
var clsPrefix = 'tnt-more-menus';
|
|
25
22
|
export default (function (props) {
|
|
26
23
|
var _newChildren, _lastChildPart2;
|
|
27
|
-
|
|
28
24
|
var _ref = props || {},
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
25
|
+
_ref$children = _ref.children,
|
|
26
|
+
children = _ref$children === void 0 ? [] : _ref$children,
|
|
27
|
+
type = _ref.type,
|
|
28
|
+
_ref$num = _ref.num,
|
|
29
|
+
num = _ref$num === void 0 ? 3 : _ref$num,
|
|
30
|
+
_ref$divider = _ref.divider,
|
|
31
|
+
divider = _ref$divider === void 0 ? true : _ref$divider,
|
|
32
|
+
lessOneMoreFit = _ref.lessOneMoreFit,
|
|
33
|
+
popConfirmHandle = _ref.popConfirmHandle,
|
|
34
|
+
isIconBtn = _ref.isIconBtn,
|
|
35
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
41
36
|
var _ref2 = props || {},
|
|
42
|
-
|
|
43
|
-
|
|
37
|
+
propsLang = _ref2.lang;
|
|
44
38
|
var langRef = useRef(propsLang || getLanguage());
|
|
45
39
|
var lang = langRef == null ? void 0 : langRef.current;
|
|
46
40
|
var newChildren = [];
|
|
47
|
-
|
|
48
41
|
if (Array.isArray(children)) {
|
|
49
42
|
newChildren = (children == null ? void 0 : children.filter(function (item) {
|
|
50
43
|
return !!item;
|
|
51
44
|
})) || [];
|
|
52
45
|
} else if (children) {
|
|
53
46
|
newChildren.push(children);
|
|
54
|
-
}
|
|
55
|
-
|
|
47
|
+
}
|
|
56
48
|
|
|
49
|
+
// 子元素大于1个,且不是 icon元素
|
|
57
50
|
var specialSceneDefaultShow = ((_newChildren = newChildren) == null ? void 0 : _newChildren.length) > 1 && !isIconBtn;
|
|
58
|
-
|
|
59
51
|
if (specialSceneDefaultShow && (lang === 'en' || popConfirmHandle)) {
|
|
60
52
|
var _newChildren2;
|
|
61
|
-
|
|
62
53
|
(_newChildren2 = newChildren) == null ? void 0 : _newChildren2.forEach(function (v, i) {
|
|
63
54
|
var type = v.type,
|
|
64
|
-
|
|
65
|
-
|
|
55
|
+
props = v.props;
|
|
66
56
|
if ((type == null ? void 0 : type.name) === 'Popconfirm' || props.hasOwnProperty('onConfirm') && typeof (props == null ? void 0 : props.onConfirm) === 'function') {
|
|
67
57
|
var placement = {};
|
|
68
|
-
|
|
69
58
|
if (lang === 'en' || num && !isNaN(num) && i + 1 > num && !(lessOneMoreFit && newChildren.length - num === 1)) {
|
|
70
59
|
placement = {
|
|
71
60
|
placement: 'left'
|
|
72
61
|
};
|
|
73
62
|
}
|
|
74
|
-
|
|
75
|
-
newChildren[i] = React.cloneElement(v, _objectSpread({
|
|
63
|
+
newChildren[i] = /*#__PURE__*/React.cloneElement(v, _objectSpread(_objectSpread(_objectSpread({
|
|
76
64
|
overlayStyle: {
|
|
77
65
|
width: 180
|
|
78
66
|
}
|
|
79
|
-
}, (v == null ? void 0 : v.props) || {}, {
|
|
67
|
+
}, (v == null ? void 0 : v.props) || {}), {}, {
|
|
80
68
|
onClick: function onClick(e) {
|
|
81
69
|
return e.stopPropagation();
|
|
82
70
|
}
|
|
83
|
-
}, placement, {
|
|
71
|
+
}, placement), {}, {
|
|
84
72
|
trigger: 'hover',
|
|
85
73
|
getPopupContainer: function getPopupContainer(trigger) {
|
|
86
74
|
return trigger.parentNode;
|
|
@@ -89,72 +77,66 @@ export default (function (props) {
|
|
|
89
77
|
}
|
|
90
78
|
});
|
|
91
79
|
}
|
|
92
|
-
|
|
93
80
|
var preChildPart = newChildren,
|
|
94
|
-
|
|
81
|
+
lastChildPart = null;
|
|
95
82
|
|
|
83
|
+
// 只有1个时不适配
|
|
96
84
|
if (lessOneMoreFit && newChildren.length - num === 1) {
|
|
97
85
|
preChildPart = newChildren;
|
|
98
86
|
} else if (newChildren && num && !isNaN(num) && newChildren.length > num) {
|
|
99
87
|
preChildPart = newChildren.slice(0, num);
|
|
100
88
|
lastChildPart = newChildren.slice(num);
|
|
101
89
|
}
|
|
102
|
-
|
|
103
90
|
;
|
|
104
|
-
|
|
105
91
|
if (divider && preChildPart) {
|
|
106
92
|
var preChildLen = preChildPart.length;
|
|
107
93
|
preChildPart = preChildPart.map(function (dom, i) {
|
|
108
94
|
var _lastChildPart;
|
|
109
|
-
|
|
110
|
-
return React.createElement(Fragment, {
|
|
95
|
+
return /*#__PURE__*/React.createElement(Fragment, {
|
|
111
96
|
key: i
|
|
112
|
-
}, dom, !(i === preChildLen - 1 && !((_lastChildPart = lastChildPart)
|
|
113
|
-
) && React.createElement(_Divider, {
|
|
97
|
+
}, dom, !(i === preChildLen - 1 && !((_lastChildPart = lastChildPart) != null && _lastChildPart.length) // 没有更多 且 是最后一个时 不显示 Divider
|
|
98
|
+
) && /*#__PURE__*/React.createElement(_Divider, {
|
|
114
99
|
type: "vertical"
|
|
115
100
|
}));
|
|
116
101
|
});
|
|
117
102
|
}
|
|
118
|
-
|
|
119
103
|
var menu = function menu(childArr) {
|
|
120
|
-
return React.createElement(_Menu, {
|
|
104
|
+
return /*#__PURE__*/React.createElement(_Menu, {
|
|
121
105
|
className: "org-pop-opera-btn"
|
|
122
106
|
}, childArr == null ? void 0 : childArr.map(function (child, i) {
|
|
123
|
-
return React.createElement(_Menu.Item, {
|
|
107
|
+
return /*#__PURE__*/React.createElement(_Menu.Item, {
|
|
124
108
|
key: i
|
|
125
109
|
}, child);
|
|
126
110
|
}));
|
|
127
111
|
};
|
|
128
|
-
|
|
129
112
|
if (lang === 'en' && specialSceneDefaultShow) {
|
|
130
|
-
return React.createElement(_Dropdown, {
|
|
113
|
+
return /*#__PURE__*/React.createElement(_Dropdown, {
|
|
131
114
|
overlay: menu(newChildren || []),
|
|
132
115
|
arrow: true
|
|
133
|
-
}, type === 'icon' ? React.createElement(Icon, {
|
|
116
|
+
}, type === 'icon' ? /*#__PURE__*/React.createElement(Icon, {
|
|
134
117
|
type: "more"
|
|
135
|
-
}) : React.createElement("a", {
|
|
118
|
+
}) : /*#__PURE__*/React.createElement("a", {
|
|
136
119
|
className: "ant-dropdown-more"
|
|
137
|
-
}, getText('handleMore', lang), React.createElement("i", {
|
|
120
|
+
}, getText('handleMore', lang), /*#__PURE__*/React.createElement("i", {
|
|
138
121
|
className: "".concat(clsPrefix, "-dropdown-icon")
|
|
139
|
-
}, React.createElement(Icon, {
|
|
122
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
140
123
|
type: "down"
|
|
141
124
|
}))));
|
|
142
125
|
}
|
|
143
|
-
|
|
144
|
-
return React.createElement("div", _extends({
|
|
126
|
+
return /*#__PURE__*/React.createElement("div", _extends({
|
|
145
127
|
onClick: function onClick(e) {
|
|
146
128
|
e.stopPropagation();
|
|
147
129
|
}
|
|
148
|
-
}, rest), preChildPart, !!((_lastChildPart2 = lastChildPart)
|
|
130
|
+
}, rest), preChildPart, !!((_lastChildPart2 = lastChildPart) != null && _lastChildPart2.length) && /*#__PURE__*/React.createElement(_Dropdown, {
|
|
149
131
|
overlay: menu(lastChildPart || []),
|
|
150
132
|
arrow: true
|
|
151
|
-
}, type === 'icon' ? React.createElement(Icon, {
|
|
133
|
+
}, type === 'icon' ? /*#__PURE__*/React.createElement(Icon, {
|
|
152
134
|
type: "more"
|
|
153
|
-
}) : React.createElement("a", {
|
|
135
|
+
}) : /*#__PURE__*/React.createElement("a", {
|
|
154
136
|
className: "ant-dropdown-more"
|
|
155
|
-
}, getText('handleMore', lang), React.createElement("i", {
|
|
137
|
+
}, getText('handleMore', lang), /*#__PURE__*/React.createElement("i", {
|
|
156
138
|
className: "".concat(clsPrefix, "-dropdown-icon")
|
|
157
|
-
}, React.createElement(Icon, {
|
|
139
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
158
140
|
type: "down"
|
|
159
141
|
})))));
|
|
160
142
|
});
|