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
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
1
|
import "antd/lib/modal/style";
|
|
3
2
|
import _Modal from "antd/lib/modal";
|
|
4
3
|
import "antd/lib/form/style";
|
|
@@ -7,59 +6,71 @@ import "antd/lib/input/style";
|
|
|
7
6
|
import _Input from "antd/lib/input";
|
|
8
7
|
import "antd/lib/message/style";
|
|
9
8
|
import _message from "antd/lib/message";
|
|
10
|
-
|
|
11
|
-
function
|
|
12
|
-
|
|
13
|
-
function
|
|
14
|
-
|
|
15
|
-
function
|
|
16
|
-
|
|
17
|
-
function
|
|
18
|
-
|
|
19
|
-
function
|
|
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
|
+
|
|
16
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }
|
|
17
|
+
|
|
18
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); }
|
|
19
|
+
|
|
20
|
+
function _iterableToArrayLimit(arr, i) { if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) { return; } var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
21
|
+
|
|
20
22
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
23
|
+
|
|
21
24
|
import { useState } from 'react';
|
|
22
25
|
import Cookies from 'universal-cookie';
|
|
23
|
-
var cookies = new Cookies();
|
|
24
|
-
|
|
26
|
+
var cookies = new Cookies(); // 默认
|
|
27
|
+
|
|
25
28
|
var accountInfoDefault = {
|
|
26
29
|
account: undefined,
|
|
27
30
|
password: undefined
|
|
28
31
|
};
|
|
29
32
|
export default (function (_ref) {
|
|
30
33
|
var visible = _ref.visible,
|
|
31
|
-
|
|
32
|
-
|
|
34
|
+
close = _ref.close,
|
|
35
|
+
signIn = _ref.signIn;
|
|
36
|
+
|
|
33
37
|
var _useState = useState(false),
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
38
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
39
|
+
confirmLoading = _useState2[0],
|
|
40
|
+
setConfirmLoading = _useState2[1]; // 如果storage中已存在,则取storage
|
|
41
|
+
|
|
37
42
|
|
|
38
|
-
// 如果storage中已存在,则取storage
|
|
39
43
|
var storageAccountInfo = localStorage.getItem('accountInfo');
|
|
44
|
+
|
|
40
45
|
if (storageAccountInfo) {
|
|
41
46
|
try {
|
|
42
47
|
accountInfoDefault = JSON.parse(storageAccountInfo);
|
|
43
48
|
} catch (e) {}
|
|
44
49
|
}
|
|
50
|
+
|
|
45
51
|
var _useState3 = useState(accountInfoDefault),
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
52
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
53
|
+
accountInfo = _useState4[0],
|
|
54
|
+
setAccountInfo = _useState4[1];
|
|
55
|
+
|
|
49
56
|
var account = accountInfo.account,
|
|
50
|
-
|
|
57
|
+
password = accountInfo.password;
|
|
58
|
+
|
|
51
59
|
var onSubmit = function onSubmit() {
|
|
52
60
|
setConfirmLoading(true);
|
|
53
61
|
var returnVal = signIn && signIn(accountInfo);
|
|
62
|
+
|
|
54
63
|
if (returnVal && returnVal.then) {
|
|
55
64
|
returnVal.then(function (res) {
|
|
56
65
|
_message.success('模拟登陆成功');
|
|
66
|
+
|
|
57
67
|
localStorage.setItem('accountInfo', JSON.stringify(accountInfo));
|
|
58
68
|
setConfirmLoading(false);
|
|
59
69
|
setTimeout(function () {
|
|
60
70
|
var _ref2 = res || {},
|
|
61
|
-
|
|
62
|
-
|
|
71
|
+
token = _ref2.tdToken,
|
|
72
|
+
userId = _ref2.userId;
|
|
73
|
+
|
|
63
74
|
cookies.set('_td_token_', token, {
|
|
64
75
|
path: '/'
|
|
65
76
|
});
|
|
@@ -74,35 +85,37 @@ export default (function (_ref) {
|
|
|
74
85
|
});
|
|
75
86
|
}
|
|
76
87
|
};
|
|
88
|
+
|
|
77
89
|
var changeFieldValue = function changeFieldValue(key, evt) {
|
|
78
|
-
setAccountInfo(_objectSpread(
|
|
90
|
+
setAccountInfo(_objectSpread({}, accountInfo, _defineProperty({}, key, evt.target.value)));
|
|
79
91
|
};
|
|
80
|
-
|
|
92
|
+
|
|
93
|
+
return React.createElement(_Modal, {
|
|
81
94
|
title: "\u5F00\u53D1\u8005\u6A21\u62DF\u767B\u9646",
|
|
82
95
|
visible: visible,
|
|
83
96
|
maskClosable: false,
|
|
84
97
|
onOk: onSubmit,
|
|
85
98
|
onCancel: close,
|
|
86
99
|
confirmLoading: confirmLoading
|
|
87
|
-
},
|
|
100
|
+
}, React.createElement(_Form, {
|
|
88
101
|
labelCol: {
|
|
89
102
|
span: 5
|
|
90
103
|
},
|
|
91
104
|
wrapperCol: {
|
|
92
105
|
span: 18
|
|
93
106
|
}
|
|
94
|
-
},
|
|
107
|
+
}, React.createElement(_Form.Item, {
|
|
95
108
|
label: "\u7528\u6237\u540D\uFF1A"
|
|
96
|
-
},
|
|
109
|
+
}, React.createElement(_Input, {
|
|
97
110
|
type: "text",
|
|
98
111
|
placeholder: "\u8BF7\u8F93\u5165\u7528\u6237\u540D",
|
|
99
112
|
value: account || undefined,
|
|
100
113
|
onChange: function onChange(evt) {
|
|
101
114
|
return changeFieldValue('account', evt);
|
|
102
115
|
}
|
|
103
|
-
})),
|
|
116
|
+
})), React.createElement(_Form.Item, {
|
|
104
117
|
label: "\u5BC6\u7801\uFF1A"
|
|
105
|
-
},
|
|
118
|
+
}, React.createElement(_Input, {
|
|
106
119
|
type: "text",
|
|
107
120
|
placeholder: "\u8BF7\u8F93\u5165\u7528\u6237\u540D",
|
|
108
121
|
value: password || undefined,
|
|
@@ -1,32 +1,36 @@
|
|
|
1
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) ||
|
|
2
|
-
|
|
3
|
-
function
|
|
4
|
-
|
|
5
|
-
function _iterableToArrayLimit(arr, i) {
|
|
1
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }
|
|
2
|
+
|
|
3
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); }
|
|
4
|
+
|
|
5
|
+
function _iterableToArrayLimit(arr, i) { if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) { return; } var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
6
|
+
|
|
6
7
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
8
|
+
|
|
7
9
|
/**
|
|
8
10
|
* @file 本地开发登录入口
|
|
9
11
|
*/
|
|
10
12
|
import React, { useState } from 'react';
|
|
11
|
-
var DevelopmentLoginModal =
|
|
13
|
+
var DevelopmentLoginModal = React.lazy(function () {
|
|
12
14
|
return import('./LoginModal');
|
|
13
15
|
});
|
|
14
16
|
export default (function (_ref) {
|
|
15
17
|
var signIn = _ref.signIn;
|
|
18
|
+
|
|
16
19
|
var _useState = useState(false),
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
20
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
21
|
+
loginVisible = _useState2[0],
|
|
22
|
+
setLoginVisible = _useState2[1];
|
|
23
|
+
|
|
24
|
+
return React.createElement(React.Fragment, null, React.createElement("a", {
|
|
21
25
|
style: {
|
|
22
26
|
fontSize: 14
|
|
23
27
|
},
|
|
24
28
|
onClick: function onClick() {
|
|
25
29
|
return setLoginVisible(true);
|
|
26
30
|
}
|
|
27
|
-
}, "\u6A21\u62DF\u767B\u5F55"), loginVisible &&
|
|
28
|
-
fallback:
|
|
29
|
-
},
|
|
31
|
+
}, "\u6A21\u62DF\u767B\u5F55"), loginVisible && React.createElement(React.Suspense, {
|
|
32
|
+
fallback: React.createElement("div", null, "\u6B63\u5728\u52A0\u8F7D\u4E2D")
|
|
33
|
+
}, React.createElement(DevelopmentLoginModal, {
|
|
30
34
|
visible: loginVisible,
|
|
31
35
|
signIn: signIn,
|
|
32
36
|
close: function close() {
|
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
export default (function (props) {
|
|
2
|
-
return
|
|
2
|
+
return React.createElement("div", props, React.createElement("svg", {
|
|
3
3
|
width: "16px",
|
|
4
4
|
height: "16px",
|
|
5
5
|
viewBox: "0 0 16 16"
|
|
6
|
-
},
|
|
6
|
+
}, React.createElement("g", {
|
|
7
7
|
id: "\u5168\u5BB6\u6876\u89C6\u89C9\u65B9\u6848\u4F18\u5316",
|
|
8
8
|
stroke: "none",
|
|
9
9
|
"stroke-width": "1",
|
|
10
10
|
fill: "none",
|
|
11
11
|
"fill-rule": "evenodd"
|
|
12
|
-
},
|
|
12
|
+
}, React.createElement("g", {
|
|
13
13
|
id: "\u5DE5\u4F5C\u53F01",
|
|
14
14
|
transform: "translate(-730.000000, -299.000000)"
|
|
15
|
-
},
|
|
15
|
+
}, React.createElement("g", {
|
|
16
16
|
id: "\u5206\u7EC4-6",
|
|
17
17
|
transform: "translate(240.000000, 96.000000)"
|
|
18
|
-
},
|
|
18
|
+
}, React.createElement("g", {
|
|
19
19
|
id: "\u7F16\u7EC4-18",
|
|
20
20
|
transform: "translate(0.000000, 171.000000)"
|
|
21
|
-
},
|
|
21
|
+
}, React.createElement("g", {
|
|
22
22
|
id: "\u590D\u5236",
|
|
23
23
|
transform: "translate(490.000000, 32.000000)"
|
|
24
|
-
},
|
|
24
|
+
}, React.createElement("rect", {
|
|
25
25
|
id: "\u77E9\u5F62",
|
|
26
26
|
fill: "#D8D8D8",
|
|
27
27
|
opacity: "0",
|
|
@@ -29,31 +29,31 @@ export default (function (props) {
|
|
|
29
29
|
y: "0",
|
|
30
30
|
width: "16",
|
|
31
31
|
height: "16"
|
|
32
|
-
}),
|
|
32
|
+
}), React.createElement("g", {
|
|
33
33
|
id: "\u7F16\u7EC4-5",
|
|
34
34
|
transform: "translate(2.223389, 1.330322)",
|
|
35
35
|
stroke: "#1e90ff",
|
|
36
36
|
"stroke-linecap": "round",
|
|
37
37
|
"stroke-width": "1.2"
|
|
38
|
-
},
|
|
38
|
+
}, React.createElement("polygon", {
|
|
39
39
|
id: "\u8DEF\u5F84",
|
|
40
40
|
"stroke-linejoin": "round",
|
|
41
41
|
points: "2 11.3333333 11.3333333 11.3333333 11.3333333 4 7.66666667 -8.8817842e-15 2 -8.8817842e-15"
|
|
42
|
-
}),
|
|
42
|
+
}), React.createElement("polyline", {
|
|
43
43
|
id: "\u8DEF\u5F84",
|
|
44
44
|
"stroke-linejoin": "round",
|
|
45
45
|
points: "7.66666667 0 7.66666667 4 11.3333333 4"
|
|
46
|
-
}),
|
|
46
|
+
}), React.createElement("polyline", {
|
|
47
47
|
id: "\u8DEF\u5F84",
|
|
48
48
|
"stroke-linejoin": "round",
|
|
49
49
|
points: "0 5.33333333 0 13.3333333 7 13.3333333"
|
|
50
|
-
}),
|
|
50
|
+
}), React.createElement("line", {
|
|
51
51
|
x1: "4",
|
|
52
52
|
y1: "5.33333333",
|
|
53
53
|
x2: "5.33333333",
|
|
54
54
|
y2: "5.33333333",
|
|
55
55
|
id: "\u8DEF\u5F84"
|
|
56
|
-
}),
|
|
56
|
+
}), React.createElement("line", {
|
|
57
57
|
x1: "4",
|
|
58
58
|
y1: "8",
|
|
59
59
|
x2: "8",
|
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
export default (function (props) {
|
|
2
|
-
return
|
|
2
|
+
return React.createElement("div", props, React.createElement("svg", {
|
|
3
3
|
width: "17px",
|
|
4
4
|
height: "16px",
|
|
5
5
|
viewBox: "0 0 17 16"
|
|
6
|
-
},
|
|
6
|
+
}, React.createElement("g", {
|
|
7
7
|
id: "\u5168\u5BB6\u6876\u89C6\u89C9\u65B9\u6848\u4F18\u5316",
|
|
8
8
|
stroke: "none",
|
|
9
9
|
"stroke-width": "1",
|
|
10
10
|
fill: "none",
|
|
11
11
|
"fill-rule": "evenodd"
|
|
12
|
-
},
|
|
12
|
+
}, React.createElement("g", {
|
|
13
13
|
id: "\u5DE5\u4F5C\u53F01",
|
|
14
14
|
transform: "translate(-754.000000, -299.000000)"
|
|
15
|
-
},
|
|
15
|
+
}, React.createElement("g", {
|
|
16
16
|
id: "\u5206\u7EC4-6",
|
|
17
17
|
transform: "translate(240.000000, 96.000000)"
|
|
18
|
-
},
|
|
18
|
+
}, React.createElement("g", {
|
|
19
19
|
id: "\u7F16\u7EC4-18",
|
|
20
20
|
transform: "translate(0.000000, 171.000000)"
|
|
21
|
-
},
|
|
21
|
+
}, React.createElement("g", {
|
|
22
22
|
id: "\u590D\u5236\u6210\u529F",
|
|
23
23
|
transform: "translate(514.500000, 32.000000)"
|
|
24
|
-
},
|
|
24
|
+
}, React.createElement("rect", {
|
|
25
25
|
id: "\u77E9\u5F62",
|
|
26
26
|
"fill-opacity": "0.01",
|
|
27
27
|
fill: "#FFFFFF",
|
|
@@ -30,7 +30,7 @@ export default (function (props) {
|
|
|
30
30
|
y: "0",
|
|
31
31
|
width: "16",
|
|
32
32
|
height: "16"
|
|
33
|
-
}),
|
|
33
|
+
}), React.createElement("polyline", {
|
|
34
34
|
id: "\u8DEF\u5F84",
|
|
35
35
|
stroke: "#07C790",
|
|
36
36
|
"stroke-width": "1.2",
|
package/es/Ellipsis/index.js
CHANGED
|
@@ -1,26 +1,29 @@
|
|
|
1
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
1
|
import "antd/lib/tooltip/style";
|
|
3
2
|
import _Tooltip from "antd/lib/tooltip";
|
|
4
3
|
import "antd/lib/popover/style";
|
|
5
4
|
import _Popover from "antd/lib/popover";
|
|
6
|
-
|
|
7
|
-
function
|
|
8
|
-
|
|
9
|
-
function
|
|
10
|
-
|
|
11
|
-
function
|
|
12
|
-
|
|
13
|
-
function
|
|
14
|
-
|
|
15
|
-
function
|
|
16
|
-
|
|
5
|
+
|
|
6
|
+
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; }
|
|
7
|
+
|
|
8
|
+
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; }
|
|
9
|
+
|
|
10
|
+
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; }
|
|
11
|
+
|
|
12
|
+
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); }
|
|
13
|
+
|
|
14
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }
|
|
15
|
+
|
|
16
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); }
|
|
17
|
+
|
|
18
|
+
function _iterableToArrayLimit(arr, i) { if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) { return; } var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
19
|
+
|
|
17
20
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
21
|
+
|
|
18
22
|
/*
|
|
19
23
|
* @Author: 梁洪刚
|
|
20
24
|
* @CreatDate: 2021-03-31 13:57:32
|
|
21
25
|
* @Describe: 省略号组件
|
|
22
26
|
*/
|
|
23
|
-
|
|
24
27
|
import { useState, useEffect, useRef } from 'react';
|
|
25
28
|
import copy from 'copy-to-clipboard';
|
|
26
29
|
import CopySVG from './Svg/CopySVG';
|
|
@@ -31,67 +34,73 @@ var tolerance = 0; // In px. Depends on the font you are using
|
|
|
31
34
|
var isEllipsisActive = function isEllipsisActive(e) {
|
|
32
35
|
if (e.offsetWidth === e.scrollWidth && e.offsetHeight === e.scrollHeight) {
|
|
33
36
|
var _e$parentNode, _e$parentNode$getAttr;
|
|
37
|
+
|
|
34
38
|
var styleStr = 'overflow:visible; ';
|
|
35
|
-
|
|
39
|
+
|
|
40
|
+
if (!(e == null ? void 0 : (_e$parentNode = e.parentNode) == null ? void 0 : (_e$parentNode$getAttr = _e$parentNode.getAttribute('style')) == null ? void 0 : _e$parentNode$getAttr.includes('width'))) {
|
|
36
41
|
styleStr += 'max-width:100%;';
|
|
37
42
|
}
|
|
43
|
+
|
|
38
44
|
e.parentNode.setAttribute('style', styleStr);
|
|
39
45
|
}
|
|
46
|
+
|
|
40
47
|
return e.offsetWidth + tolerance < e.scrollWidth || e.offsetHeight < e.scrollHeight;
|
|
41
48
|
};
|
|
49
|
+
|
|
42
50
|
export default (function (props) {
|
|
43
51
|
var _props$_popover = props._popover,
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
52
|
+
_popover = _props$_popover === void 0 ? props.Popover : _props$_popover,
|
|
53
|
+
title = props.title,
|
|
54
|
+
content = props.content,
|
|
55
|
+
className = props.className,
|
|
56
|
+
style = props.style,
|
|
57
|
+
widthLimit = props.widthLimit,
|
|
58
|
+
_props$_lines = props._lines,
|
|
59
|
+
_lines = _props$_lines === void 0 ? props.lines !== 1 && props.lines : _props$_lines,
|
|
60
|
+
children = props.children,
|
|
61
|
+
emptyText = props.emptyText,
|
|
62
|
+
_props$_copyable = props._copyable,
|
|
63
|
+
_copyable = _props$_copyable === void 0 ? props.copyable : _props$_copyable,
|
|
64
|
+
prefix = props.prefix,
|
|
65
|
+
suffix = props.suffix; // allow visible or not state
|
|
66
|
+
|
|
67
|
+
|
|
60
68
|
var _useState = useState(true),
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
69
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
70
|
+
flag = _useState2[0],
|
|
71
|
+
setFlag = _useState2[1]; // visible[Tooltip/Popover] state
|
|
72
|
+
|
|
73
|
+
|
|
65
74
|
var _useState3 = useState(false),
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
75
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
76
|
+
tipVisible = _useState4[0],
|
|
77
|
+
setTipVisible = _useState4[1]; // copy animation state
|
|
78
|
+
|
|
79
|
+
|
|
70
80
|
var _useState5 = useState(false),
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
81
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
82
|
+
hasCopy = _useState6[0],
|
|
83
|
+
setHasCopy = _useState6[1];
|
|
84
|
+
|
|
74
85
|
var elementRef = useRef();
|
|
75
86
|
useEffect(function () {
|
|
76
87
|
elementRef.current && isEllipsisActive(elementRef.current) ? setFlag(true) : (setFlag(false), setTipVisible(false));
|
|
77
|
-
});
|
|
88
|
+
}); // original Node
|
|
78
89
|
|
|
79
|
-
//
|
|
80
|
-
var inner = typeof children === 'string' ? children : _popover ? content : title;
|
|
90
|
+
var inner = typeof children === 'string' ? children : _popover ? content : title; // for className
|
|
81
91
|
|
|
82
|
-
// for className
|
|
83
92
|
var getClassName = function getClassName() {
|
|
84
93
|
return "overflow ".concat(_lines ? 'ellipsis-wrap' : 'ellipsis-nowrap', " ").concat(className || '');
|
|
85
|
-
};
|
|
94
|
+
}; // Tooltip.trigger(default 'hover') ==trigger==> onVisibleChange(visible)
|
|
95
|
+
|
|
86
96
|
|
|
87
|
-
// Tooltip.trigger(default 'hover') ==trigger==> onVisibleChange(visible)
|
|
88
97
|
var handleVisibleChange = function handleVisibleChange(visible) {
|
|
89
98
|
// const { onVisibleChange } = props;
|
|
90
99
|
// onVisibleChange(visible);
|
|
91
100
|
flag && setTipVisible(visible);
|
|
92
|
-
};
|
|
101
|
+
}; // onClick Copy Button
|
|
102
|
+
|
|
93
103
|
|
|
94
|
-
// onClick Copy Button
|
|
95
104
|
var handleCopy = function handleCopy(innerText) {
|
|
96
105
|
copy(innerText);
|
|
97
106
|
setHasCopy(!hasCopy);
|
|
@@ -99,27 +108,28 @@ export default (function (props) {
|
|
|
99
108
|
setHasCopy(false);
|
|
100
109
|
}, 1000);
|
|
101
110
|
};
|
|
111
|
+
|
|
102
112
|
var renderNode = function renderNode() {
|
|
103
|
-
var popoverNode =
|
|
113
|
+
var popoverNode = React.createElement(_Popover, _extends({}, props, {
|
|
104
114
|
content: content || children,
|
|
105
115
|
visible: tipVisible,
|
|
106
116
|
onVisibleChange: function onVisibleChange(visible) {
|
|
107
117
|
return handleVisibleChange(visible);
|
|
108
118
|
}
|
|
109
|
-
}),
|
|
119
|
+
}), React.createElement("div", {
|
|
110
120
|
className: className,
|
|
111
121
|
style: {
|
|
112
122
|
WebkitLineClamp: _lines
|
|
113
123
|
},
|
|
114
124
|
ref: elementRef
|
|
115
125
|
}, children || content));
|
|
116
|
-
var tooltipNode =
|
|
126
|
+
var tooltipNode = React.createElement(_Tooltip, _extends({}, props, {
|
|
117
127
|
title: title || children,
|
|
118
128
|
visible: tipVisible,
|
|
119
129
|
onVisibleChange: function onVisibleChange(visible) {
|
|
120
130
|
return handleVisibleChange(visible);
|
|
121
131
|
}
|
|
122
|
-
}),
|
|
132
|
+
}), React.createElement("div", {
|
|
123
133
|
className: className,
|
|
124
134
|
style: {
|
|
125
135
|
WebkitLineClamp: _lines
|
|
@@ -128,17 +138,18 @@ export default (function (props) {
|
|
|
128
138
|
}, children || title));
|
|
129
139
|
return _popover ? popoverNode : tooltipNode;
|
|
130
140
|
};
|
|
131
|
-
|
|
141
|
+
|
|
142
|
+
return React.createElement(React.Fragment, null, React.createElement("div", {
|
|
132
143
|
className: "tnt-ellipsis",
|
|
133
|
-
style: _objectSpread(
|
|
144
|
+
style: _objectSpread({}, style, {
|
|
134
145
|
maxWidth: widthLimit
|
|
135
146
|
})
|
|
136
|
-
}, prefix && prefix,
|
|
147
|
+
}, prefix && prefix, React.createElement("div", {
|
|
137
148
|
className: getClassName()
|
|
138
|
-
}, inner ? renderNode() : emptyText), suffix && suffix, inner && _copyable &&
|
|
149
|
+
}, inner ? renderNode() : emptyText), suffix && suffix, inner && _copyable && React.createElement("div", {
|
|
139
150
|
className: "svg-button",
|
|
140
151
|
onClick: function onClick() {
|
|
141
152
|
return handleCopy(elementRef.current.innerText);
|
|
142
153
|
}
|
|
143
|
-
}, !hasCopy ?
|
|
154
|
+
}, !hasCopy ? React.createElement(CopySVG, null) : React.createElement(TickSVG, null))));
|
|
144
155
|
});
|
package/es/Handle/README.md
CHANGED
|
@@ -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
|
}
|