cloud-b2b 1.1.27 → 1.1.28
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/es/Area/Area.js +16 -45
- package/es/Card/Card.js +3 -4
- package/es/CodeInput/CodeInput.js +30 -59
- package/es/Control/Control.js +47 -94
- package/es/Control/event.js +0 -14
- package/es/Enhance/Dialogs.js +0 -15
- package/es/Enhance/Loading.js +16 -36
- package/es/Enhance/index.js +0 -2
- package/es/Header/Header.js +3 -35
- package/es/Header/Vertical.js +1 -24
- package/es/ImageView/ImageView.js +5 -22
- package/es/Indent/Indent.js +3 -7
- package/es/InpurCascader/InputCascader.js +10 -36
- package/es/InputEditor/InputEditor.js +55 -55
- package/es/InputSearch/InputSearch.js +26 -71
- package/es/InputSelect/InputSelect.js +17 -48
- package/es/InputWriting/InputWriting.js +6 -28
- package/es/Layout/Layout.js +28 -59
- package/es/LayoutLink/LayoutLink.js +11 -20
- package/es/Link/Link.js +4 -27
- package/es/Loading/Loading.js +1 -3
- package/es/Loading2/Loading2.js +0 -2
- package/es/ModalWithDrag/ModalWithDrag.js +3 -8
- package/es/ModalWithDrag/drag.js +12 -29
- package/es/NumberInput/NumberInput.js +24 -63
- package/es/Search/Search.js +53 -149
- package/es/Sidebar/Sidebar.js +13 -34
- package/es/Sidebar2/Sidebar.js +3 -30
- package/es/SuperForm/SuperForm.js +27 -150
- package/es/SuperForm2/SuperForm.js +31 -165
- package/es/SuperIcon/SuperIcon.js +3 -6
- package/es/SuperPagination/SuperPagination.js +15 -32
- package/es/SuperTab/SuperTab.js +4 -27
- package/es/SuperTab2/SuperTab2.js +11 -33
- package/es/SuperTable/DragSortRow.js +6 -34
- package/es/SuperTable/FilterDropDown.js +10 -34
- package/es/SuperTable/SuperTable.js +91 -216
- package/es/SuperTable/fixed.js +1 -9
- package/es/SuperTable2/SuperTable2.js +95 -206
- package/es/SuperTable2/SuperTableCell.js +16 -55
- package/es/SuperTable3/FilterDropDown.js +10 -34
- package/es/SuperTable3/SuperTable.js +57 -175
- package/es/SuperTable3/fixed.js +1 -9
- package/es/SuperToolbar/SuperToolbar.js +21 -49
- package/es/SuperUpload/SuperUpload.js +73 -110
- package/es/Title/Title.js +12 -15
- package/es/Viewer/ImageViews.js +7 -60
- package/es/Viewer/Viewer.js +7 -34
- package/es/WingBlank/WingBlank.js +2 -6
- package/es/helper.js +7 -27
- package/es/history.js +3 -2
- package/lib/Area/Area.js +16 -64
- package/lib/Card/Card.js +3 -13
- package/lib/CodeInput/CodeInput.js +30 -77
- package/lib/Control/Control.js +47 -135
- package/lib/Control/event.js +0 -16
- package/lib/Enhance/Dialogs.js +0 -26
- package/lib/Enhance/Loading.js +16 -52
- package/lib/Enhance/index.js +0 -9
- package/lib/Header/Header.js +3 -48
- package/lib/Header/Vertical.js +1 -36
- package/lib/ImageView/ImageView.js +5 -30
- package/lib/Indent/Indent.js +3 -13
- package/lib/InpurCascader/InputCascader.js +11 -50
- package/lib/InputEditor/InputEditor.js +55 -64
- package/lib/InputSearch/InputSearch.js +26 -78
- package/lib/InputSelect/InputSelect.js +17 -62
- package/lib/InputWriting/InputWriting.js +6 -35
- package/lib/Layout/Layout.js +28 -76
- package/lib/LayoutLink/LayoutLink.js +11 -38
- package/lib/Link/Link.js +4 -40
- package/lib/Loading/Loading.js +1 -9
- package/lib/Loading2/Loading2.js +0 -8
- package/lib/ModalWithDrag/ModalWithDrag.js +3 -18
- package/lib/ModalWithDrag/drag.js +12 -34
- package/lib/NumberInput/NumberInput.js +24 -76
- package/lib/Search/Search.js +53 -157
- package/lib/Sidebar/Sidebar.js +13 -46
- package/lib/Sidebar2/Sidebar.js +3 -42
- package/lib/SuperForm/SuperForm.js +27 -149
- package/lib/SuperForm2/SuperForm.js +31 -160
- package/lib/SuperIcon/SuperIcon.js +3 -14
- package/lib/SuperPagination/SuperPagination.js +15 -42
- package/lib/SuperTab/SuperTab.js +4 -34
- package/lib/SuperTab2/SuperTab2.js +11 -48
- package/lib/SuperTable/DragSortRow.js +6 -42
- package/lib/SuperTable/FilterDropDown.js +10 -42
- package/lib/SuperTable/SuperTable.js +90 -210
- package/lib/SuperTable/fixed.js +1 -13
- package/lib/SuperTable2/SuperTable2.js +95 -222
- package/lib/SuperTable2/SuperTableCell.js +13 -62
- package/lib/SuperTable3/FilterDropDown.js +10 -42
- package/lib/SuperTable3/SuperTable.js +56 -169
- package/lib/SuperTable3/fixed.js +1 -13
- package/lib/SuperToolbar/SuperToolbar.js +20 -64
- package/lib/SuperUpload/SuperUpload.js +73 -140
- package/lib/Title/Title.js +12 -24
- package/lib/Viewer/ImageViews.js +7 -63
- package/lib/Viewer/Viewer.js +7 -43
- package/lib/WingBlank/WingBlank.js +2 -14
- package/lib/helper.js +6 -44
- package/lib/history.js +0 -5
- package/lib/index.js +0 -76
- package/lib/variables.js +0 -4
- package/package.json +1 -1
package/es/Layout/Layout.js
CHANGED
|
@@ -7,11 +7,8 @@ import _inherits from "@babel/runtime-corejs3/helpers/inherits";
|
|
|
7
7
|
import _possibleConstructorReturn from "@babel/runtime-corejs3/helpers/possibleConstructorReturn";
|
|
8
8
|
import _getPrototypeOf from "@babel/runtime-corejs3/helpers/getPrototypeOf";
|
|
9
9
|
import _defineProperty from "@babel/runtime-corejs3/helpers/defineProperty";
|
|
10
|
-
|
|
11
10
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = _Reflect$construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
12
|
-
|
|
13
11
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !_Reflect$construct) return false; if (_Reflect$construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
14
|
-
|
|
15
12
|
import _Object$keys2 from "@babel/runtime-corejs3/core-js-stable/object/keys";
|
|
16
13
|
import _someInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/some";
|
|
17
14
|
import _filterInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/filter";
|
|
@@ -27,20 +24,15 @@ import Loading from '../Loading';
|
|
|
27
24
|
import { jump } from '../Link';
|
|
28
25
|
import variables from '../variables';
|
|
29
26
|
var HeaderV = Header.Vertical;
|
|
30
|
-
|
|
31
27
|
var getCurrentSideKey = function getCurrentSideKey() {
|
|
32
28
|
var sidebars = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
33
29
|
var href = arguments.length > 1 ? arguments[1] : undefined;
|
|
34
30
|
if (!href) return '';
|
|
35
|
-
|
|
36
31
|
for (var _i = 0, _Object$keys = _Object$keys2(sidebars); _i < _Object$keys.length; _i++) {
|
|
37
32
|
var _context;
|
|
38
|
-
|
|
39
33
|
var key = _Object$keys[_i];
|
|
40
|
-
|
|
41
34
|
if (_someInstanceProperty(_context = sidebars[key]).call(_context, function (item) {
|
|
42
35
|
var _context2;
|
|
43
|
-
|
|
44
36
|
return item.href === href || item.children && _someInstanceProperty(_context2 = item.children).call(_context2, function (o) {
|
|
45
37
|
return o.href === href;
|
|
46
38
|
});
|
|
@@ -49,36 +41,27 @@ var getCurrentSideKey = function getCurrentSideKey() {
|
|
|
49
41
|
}
|
|
50
42
|
}
|
|
51
43
|
};
|
|
52
|
-
|
|
53
44
|
var Layout = /*#__PURE__*/function (_React$Component) {
|
|
54
45
|
_inherits(Layout, _React$Component);
|
|
55
|
-
|
|
56
46
|
var _super = _createSuper(Layout);
|
|
57
|
-
|
|
58
47
|
function Layout(props) {
|
|
59
48
|
var _this;
|
|
60
|
-
|
|
61
49
|
_classCallCheck(this, Layout);
|
|
62
|
-
|
|
63
50
|
_this = _super.call(this, props);
|
|
64
|
-
|
|
65
51
|
_defineProperty(_assertThisInitialized(_this), "onOpenChange", function (sideKey, openKeys) {
|
|
66
52
|
var onOpenChange = _this.props.onOpenChange;
|
|
67
|
-
|
|
68
53
|
if (onOpenChange) {
|
|
69
54
|
onOpenChange(sideKey, openKeys);
|
|
70
55
|
}
|
|
71
56
|
});
|
|
72
|
-
|
|
73
57
|
_defineProperty(_assertThisInitialized(_this), "getSidebarProps", function (sideKey) {
|
|
74
58
|
var _context3;
|
|
75
|
-
|
|
76
59
|
var _this$props = _this.props,
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
60
|
+
sidebars = _this$props.sidebars,
|
|
61
|
+
nav2 = _this$props.nav2,
|
|
62
|
+
_this$props$openKeys = _this$props.openKeys,
|
|
63
|
+
openKeys = _this$props$openKeys === void 0 ? {} : _this$props$openKeys,
|
|
64
|
+
navigation = _this$props.navigation;
|
|
82
65
|
var sides = sidebars[sideKey] || [];
|
|
83
66
|
return {
|
|
84
67
|
mode: _this.state.mode,
|
|
@@ -96,10 +79,8 @@ var Layout = /*#__PURE__*/function (_React$Component) {
|
|
|
96
79
|
}
|
|
97
80
|
};
|
|
98
81
|
});
|
|
99
|
-
|
|
100
82
|
_defineProperty(_assertThisInitialized(_this), "toSidebar", function (sideKey) {
|
|
101
83
|
var hasHeaderV = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
102
|
-
|
|
103
84
|
if (!sideKey) {
|
|
104
85
|
return null;
|
|
105
86
|
} else {
|
|
@@ -110,24 +91,22 @@ var Layout = /*#__PURE__*/function (_React$Component) {
|
|
|
110
91
|
}, /*#__PURE__*/React.createElement(Sidebar, _this.getSidebarProps(sideKey)));
|
|
111
92
|
}
|
|
112
93
|
});
|
|
113
|
-
|
|
114
94
|
_defineProperty(_assertThisInitialized(_this), "toHeader", function () {
|
|
115
95
|
var _context4, _context5;
|
|
116
|
-
|
|
117
96
|
var _this$props2 = _this.props,
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
97
|
+
loading = _this$props2.loading,
|
|
98
|
+
sidebars = _this$props2.sidebars,
|
|
99
|
+
nav1 = _this$props2.nav1,
|
|
100
|
+
nav2 = _this$props2.nav2,
|
|
101
|
+
homeUrl = _this$props2.homeUrl,
|
|
102
|
+
settingUrl = _this$props2.settingUrl,
|
|
103
|
+
messageUrl = _this$props2.messageUrl,
|
|
104
|
+
messageCount = _this$props2.messageCount,
|
|
105
|
+
userName = _this$props2.userName,
|
|
106
|
+
userIcon = _this$props2.userIcon,
|
|
107
|
+
loginUrl = _this$props2.loginUrl,
|
|
108
|
+
onMenuClick = _this$props2.onMenuClick,
|
|
109
|
+
onLogout = _this$props2.onLogout;
|
|
131
110
|
var selectKey = loading ? '' : getCurrentSideKey(sidebars, _concatInstanceProperty(_context4 = "/".concat(nav1, "/")).call(_context4, nav2));
|
|
132
111
|
var selectUrl = loading ? '' : _concatInstanceProperty(_context5 = "/".concat(nav1, "/")).call(_context5, nav2);
|
|
133
112
|
return /*#__PURE__*/React.createElement(Header, {
|
|
@@ -144,10 +123,8 @@ var Layout = /*#__PURE__*/function (_React$Component) {
|
|
|
144
123
|
onLogout: onLogout
|
|
145
124
|
});
|
|
146
125
|
});
|
|
147
|
-
|
|
148
126
|
_defineProperty(_assertThisInitialized(_this), "headerVProps", function (selectKey) {
|
|
149
127
|
var _context6;
|
|
150
|
-
|
|
151
128
|
var keys = ['setting', 'message'];
|
|
152
129
|
return {
|
|
153
130
|
selectKey: selectKey,
|
|
@@ -157,20 +134,17 @@ var Layout = /*#__PURE__*/function (_React$Component) {
|
|
|
157
134
|
})
|
|
158
135
|
};
|
|
159
136
|
});
|
|
160
|
-
|
|
161
137
|
_this.state = {
|
|
162
138
|
mode: 'expand',
|
|
163
139
|
url: {}
|
|
164
140
|
};
|
|
165
141
|
return _this;
|
|
166
142
|
}
|
|
167
|
-
|
|
168
143
|
_createClass(Layout, [{
|
|
169
144
|
key: "componentWillReceiveProps",
|
|
170
145
|
value: function componentWillReceiveProps(props) {
|
|
171
146
|
if (!props.loading) {
|
|
172
147
|
var _context7, _context8;
|
|
173
|
-
|
|
174
148
|
this.setState({
|
|
175
149
|
url: _Object$assign({}, this.state.url, _defineProperty({}, getCurrentSideKey(props.sidebars, _concatInstanceProperty(_context7 = "/".concat(props.nav1, "/")).call(_context7, props.nav2)), _concatInstanceProperty(_context8 = "/".concat(props.nav1, "/")).call(_context8, props.nav2)))
|
|
176
150
|
});
|
|
@@ -180,21 +154,19 @@ var Layout = /*#__PURE__*/function (_React$Component) {
|
|
|
180
154
|
key: "render",
|
|
181
155
|
value: function render() {
|
|
182
156
|
var _context10;
|
|
183
|
-
|
|
184
157
|
var _this$props3 = this.props,
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
158
|
+
loading = _this$props3.loading,
|
|
159
|
+
sidebars = _this$props3.sidebars,
|
|
160
|
+
_this$props3$nav = _this$props3.nav1,
|
|
161
|
+
nav1 = _this$props3$nav === void 0 ? '' : _this$props3$nav,
|
|
162
|
+
_this$props3$nav2 = _this$props3.nav2,
|
|
163
|
+
nav2 = _this$props3$nav2 === void 0 ? '' : _this$props3$nav2,
|
|
164
|
+
children = _this$props3.children,
|
|
165
|
+
_this$props3$noPrivil = _this$props3.noPrivilege,
|
|
166
|
+
noPrivilege = _this$props3$noPrivil === void 0 ? false : _this$props3$noPrivil,
|
|
167
|
+
navigation = _this$props3.navigation;
|
|
195
168
|
var hasV = _filterInstanceProperty(navigation).call(navigation, function (item) {
|
|
196
169
|
var _context9;
|
|
197
|
-
|
|
198
170
|
return !_includesInstanceProperty(_context9 = ['setting', 'message']).call(_context9, item.key);
|
|
199
171
|
}).length > 1;
|
|
200
172
|
var sideKey = loading || !nav2 ? '' : getCurrentSideKey(sidebars, _concatInstanceProperty(_context10 = "/".concat(nav1, "/")).call(_context10, nav2));
|
|
@@ -216,10 +188,8 @@ var Layout = /*#__PURE__*/function (_React$Component) {
|
|
|
216
188
|
}, this.toHeader(sideKey), loading ? /*#__PURE__*/React.createElement(Loading, null) : /*#__PURE__*/React.createElement("div", null, hasV ? /*#__PURE__*/React.createElement(HeaderV, this.headerVProps(sideKey)) : null, this.toSidebar(sideKey, hasV), /*#__PURE__*/React.createElement("section", null, children)));
|
|
217
189
|
}
|
|
218
190
|
}]);
|
|
219
|
-
|
|
220
191
|
return Layout;
|
|
221
192
|
}(React.Component);
|
|
222
|
-
|
|
223
193
|
_defineProperty(Layout, "propTypes", {
|
|
224
194
|
children: PropTypes.node.isRequired,
|
|
225
195
|
nav1: PropTypes.string,
|
|
@@ -228,5 +198,4 @@ _defineProperty(Layout, "propTypes", {
|
|
|
228
198
|
openKeys: PropTypes.object,
|
|
229
199
|
onOpenChange: PropTypes.func
|
|
230
200
|
});
|
|
231
|
-
|
|
232
201
|
export default Layout;
|
|
@@ -8,21 +8,17 @@ import WingBlank from '../WingBlank';
|
|
|
8
8
|
import Card from '../Card';
|
|
9
9
|
import variables from '../variables';
|
|
10
10
|
var FormItem = _Form.Item;
|
|
11
|
-
|
|
12
11
|
function Search(_ref) {
|
|
13
12
|
var placeholder = _ref.placeholder,
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
onSearch = _ref.onSearch;
|
|
16
14
|
var _useState = useState(''),
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
16
|
+
value = _useState2[0],
|
|
17
|
+
setValue = _useState2[1];
|
|
21
18
|
var _useState3 = useState(''),
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
19
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
20
|
+
status = _useState4[0],
|
|
21
|
+
setStatus = _useState4[1];
|
|
26
22
|
var onClick = function onClick() {
|
|
27
23
|
if (!value) {
|
|
28
24
|
setStatus('error');
|
|
@@ -30,12 +26,10 @@ function Search(_ref) {
|
|
|
30
26
|
onSearch(value);
|
|
31
27
|
}
|
|
32
28
|
};
|
|
33
|
-
|
|
34
29
|
var onChange = function onChange(e) {
|
|
35
30
|
setStatus('');
|
|
36
31
|
setValue(e.target.value);
|
|
37
32
|
};
|
|
38
|
-
|
|
39
33
|
return /*#__PURE__*/React.createElement(Card, {
|
|
40
34
|
className: variables('LayoutLink').search
|
|
41
35
|
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(FormItem, {
|
|
@@ -48,20 +42,18 @@ function Search(_ref) {
|
|
|
48
42
|
onClick: onClick
|
|
49
43
|
}, "\u5F00\u59CB\u67E5\u8BE2")));
|
|
50
44
|
}
|
|
51
|
-
|
|
52
45
|
function Title(_ref2) {
|
|
53
46
|
var title = _ref2.title;
|
|
54
47
|
return /*#__PURE__*/React.createElement("div", {
|
|
55
48
|
className: variables('LayoutLink').title
|
|
56
49
|
}, /*#__PURE__*/React.createElement("div", null, title), /*#__PURE__*/React.createElement("div", null));
|
|
57
50
|
}
|
|
58
|
-
|
|
59
51
|
function LayoutLink(_ref3) {
|
|
60
52
|
var children = _ref3.children,
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
53
|
+
img = _ref3.img,
|
|
54
|
+
title = _ref3.title,
|
|
55
|
+
placeholder = _ref3.placeholder,
|
|
56
|
+
onSearch = _ref3.onSearch;
|
|
65
57
|
return /*#__PURE__*/React.createElement("div", {
|
|
66
58
|
className: variables('LayoutLink')
|
|
67
59
|
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("img", {
|
|
@@ -78,5 +70,4 @@ function LayoutLink(_ref3) {
|
|
|
78
70
|
}
|
|
79
71
|
}))));
|
|
80
72
|
}
|
|
81
|
-
|
|
82
73
|
export default LayoutLink;
|
package/es/Link/Link.js
CHANGED
|
@@ -10,23 +10,17 @@ import _getPrototypeOf from "@babel/runtime-corejs3/helpers/getPrototypeOf";
|
|
|
10
10
|
import _defineProperty from "@babel/runtime-corejs3/helpers/defineProperty";
|
|
11
11
|
var _excluded = ["to", "children", "disabled"];
|
|
12
12
|
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
|
|
13
|
-
|
|
14
13
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = _Reflect$construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
15
|
-
|
|
16
14
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !_Reflect$construct) return false; if (_Reflect$construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
17
|
-
|
|
18
15
|
import React from 'react';
|
|
19
16
|
import PropTypes from 'prop-types';
|
|
20
17
|
import history from '../history';
|
|
21
|
-
|
|
22
18
|
function isLeftClickEvent(event) {
|
|
23
19
|
return event.button === 0;
|
|
24
20
|
}
|
|
25
|
-
|
|
26
21
|
function isModifiedEvent(event) {
|
|
27
22
|
return !!(event.metaKey || event.altKey || event.ctrlKey || event.shiftKey);
|
|
28
23
|
}
|
|
29
|
-
|
|
30
24
|
function jump(url) {
|
|
31
25
|
if (history.location.pathname != url) {
|
|
32
26
|
history.push(url);
|
|
@@ -34,54 +28,40 @@ function jump(url) {
|
|
|
34
28
|
history.replace(url);
|
|
35
29
|
}
|
|
36
30
|
}
|
|
37
|
-
|
|
38
31
|
var Link = /*#__PURE__*/function (_React$Component) {
|
|
39
32
|
_inherits(Link, _React$Component);
|
|
40
|
-
|
|
41
33
|
var _super = _createSuper(Link);
|
|
42
|
-
|
|
43
34
|
function Link() {
|
|
44
35
|
var _context;
|
|
45
|
-
|
|
46
36
|
var _this;
|
|
47
|
-
|
|
48
37
|
_classCallCheck(this, Link);
|
|
49
|
-
|
|
50
38
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
51
39
|
args[_key] = arguments[_key];
|
|
52
40
|
}
|
|
53
|
-
|
|
54
41
|
_this = _super.call.apply(_super, _concatInstanceProperty(_context = [this]).call(_context, args));
|
|
55
|
-
|
|
56
42
|
_defineProperty(_assertThisInitialized(_this), "handleClick", function (event) {
|
|
57
43
|
if (_this.props.onClick) {
|
|
58
44
|
_this.props.onClick(event);
|
|
59
45
|
}
|
|
60
|
-
|
|
61
46
|
if (isModifiedEvent(event) || !isLeftClickEvent(event)) {
|
|
62
47
|
return;
|
|
63
48
|
}
|
|
64
|
-
|
|
65
49
|
if (event.defaultPrevented === true) {
|
|
66
50
|
return;
|
|
67
51
|
}
|
|
68
|
-
|
|
69
52
|
event.preventDefault();
|
|
70
53
|
jump(_this.props.to);
|
|
71
54
|
});
|
|
72
|
-
|
|
73
55
|
return _this;
|
|
74
56
|
}
|
|
75
|
-
|
|
76
57
|
_createClass(Link, [{
|
|
77
58
|
key: "render",
|
|
78
59
|
value: function render() {
|
|
79
60
|
var _this$props = this.props,
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
61
|
+
to = _this$props.to,
|
|
62
|
+
children = _this$props.children,
|
|
63
|
+
disabled = _this$props.disabled,
|
|
64
|
+
props = _objectWithoutProperties(_this$props, _excluded);
|
|
85
65
|
if (disabled) {
|
|
86
66
|
return /*#__PURE__*/React.createElement("a", props, children);
|
|
87
67
|
} else {
|
|
@@ -93,16 +73,13 @@ var Link = /*#__PURE__*/function (_React$Component) {
|
|
|
93
73
|
}
|
|
94
74
|
}
|
|
95
75
|
}]);
|
|
96
|
-
|
|
97
76
|
return Link;
|
|
98
77
|
}(React.Component);
|
|
99
|
-
|
|
100
78
|
_defineProperty(Link, "propTypes", {
|
|
101
79
|
to: PropTypes.string,
|
|
102
80
|
disabled: PropTypes.bool,
|
|
103
81
|
children: PropTypes.node,
|
|
104
82
|
onClick: PropTypes.func
|
|
105
83
|
});
|
|
106
|
-
|
|
107
84
|
export default Link;
|
|
108
85
|
export { jump };
|
package/es/Loading/Loading.js
CHANGED
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
import _Spin from "antd/es/spin";
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import variables from '../variables';
|
|
4
|
-
|
|
5
4
|
function Loading(_ref) {
|
|
6
5
|
var retry = _ref.retry,
|
|
7
|
-
|
|
6
|
+
onRetry = _ref.onRetry;
|
|
8
7
|
return /*#__PURE__*/React.createElement("div", {
|
|
9
8
|
className: variables('Loading')
|
|
10
9
|
}, /*#__PURE__*/React.createElement("div", null, !retry ? /*#__PURE__*/React.createElement(_Spin, null) : /*#__PURE__*/React.createElement("span", null, "\u52A0\u8F7D\u5931\u8D25\uFF0C\u70B9\u51FB", /*#__PURE__*/React.createElement("a", {
|
|
11
10
|
onClick: onRetry
|
|
12
11
|
}, "\u91CD\u8BD5"))));
|
|
13
12
|
}
|
|
14
|
-
|
|
15
13
|
export default Loading;
|
package/es/Loading2/Loading2.js
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import _Spin from "antd/es/spin";
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import variables from '../variables';
|
|
4
|
-
|
|
5
4
|
function Loading() {
|
|
6
5
|
return /*#__PURE__*/React.createElement("div", {
|
|
7
6
|
className: variables('Loading2')
|
|
8
7
|
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(_Spin, null)));
|
|
9
8
|
}
|
|
10
|
-
|
|
11
9
|
export default Loading;
|
|
@@ -6,21 +6,17 @@ import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/insta
|
|
|
6
6
|
import React from 'react';
|
|
7
7
|
import drag from './drag';
|
|
8
8
|
import variables from '../variables';
|
|
9
|
-
|
|
10
9
|
var onLoad = function onLoad(e) {
|
|
11
10
|
var dragElement = e.parentNode.parentNode;
|
|
12
11
|
var targetElement = dragElement.parentNode.parentNode;
|
|
13
12
|
drag(dragElement, targetElement);
|
|
14
13
|
};
|
|
15
|
-
|
|
16
14
|
var ModalWithDrag = function ModalWithDrag(_ref) {
|
|
17
15
|
var _context;
|
|
18
|
-
|
|
19
16
|
var className = _ref.className,
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
17
|
+
children = _ref.children,
|
|
18
|
+
title = _ref.title,
|
|
19
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
24
20
|
props.title = /*#__PURE__*/React.createElement("div", {
|
|
25
21
|
ref: function ref(e) {
|
|
26
22
|
return e && onLoad(e);
|
|
@@ -30,5 +26,4 @@ var ModalWithDrag = function ModalWithDrag(_ref) {
|
|
|
30
26
|
className: _concatInstanceProperty(_context = "".concat(className, " ")).call(_context, variables('ModalWithDrag'))
|
|
31
27
|
}, props), children);
|
|
32
28
|
};
|
|
33
|
-
|
|
34
29
|
export default ModalWithDrag;
|
package/es/ModalWithDrag/drag.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
|
|
2
2
|
import _parseInt from "@babel/runtime-corejs3/core-js-stable/parse-int";
|
|
3
|
-
|
|
4
3
|
// 依据CSS3的transform属性进行移动
|
|
5
4
|
var dragByTransform = function dragByTransform(dragElement, targetElement) {
|
|
6
5
|
var mouseMove = null;
|
|
@@ -11,30 +10,26 @@ var dragByTransform = function dragByTransform(dragElement, targetElement) {
|
|
|
11
10
|
var x = 0;
|
|
12
11
|
var y = 0;
|
|
13
12
|
dragElement.style.cursor = 'move';
|
|
14
|
-
|
|
15
13
|
dragElement.onmousedown = function (e) {
|
|
16
14
|
mouseMove = document.onmousemove;
|
|
17
15
|
mouseUp = document.onmouseup;
|
|
18
16
|
x = e.clientX;
|
|
19
17
|
y = e.clientY;
|
|
20
|
-
active = true;
|
|
18
|
+
active = true;
|
|
21
19
|
|
|
20
|
+
// 如果下拉框拥有焦点,通过使其失去焦点来关闭掉下拉框
|
|
22
21
|
if (document.activeElement && document.activeElement !== dragElement) {
|
|
23
22
|
document.activeElement.blur();
|
|
24
23
|
}
|
|
25
|
-
|
|
26
24
|
document.onmousemove = function (e) {
|
|
27
25
|
if (active) {
|
|
28
26
|
var _context;
|
|
29
|
-
|
|
30
27
|
var x2 = offsetX + e.clientX - x;
|
|
31
28
|
var y2 = offsetY + e.clientY - y;
|
|
32
29
|
targetElement.style.transform = _concatInstanceProperty(_context = "translate(".concat(x2, "px, ")).call(_context, y2, "px)");
|
|
33
30
|
}
|
|
34
|
-
|
|
35
31
|
mouseMove && mouseMove(e);
|
|
36
32
|
};
|
|
37
|
-
|
|
38
33
|
document.onmouseup = function (e) {
|
|
39
34
|
if (active) {
|
|
40
35
|
document.onmousemove = mouseMove;
|
|
@@ -43,20 +38,18 @@ var dragByTransform = function dragByTransform(dragElement, targetElement) {
|
|
|
43
38
|
offsetY += e.clientY - y;
|
|
44
39
|
active = false;
|
|
45
40
|
}
|
|
46
|
-
|
|
47
41
|
mouseUp && mouseUp(e);
|
|
48
42
|
};
|
|
49
|
-
|
|
50
43
|
return false;
|
|
51
44
|
};
|
|
52
|
-
};
|
|
53
|
-
|
|
45
|
+
};
|
|
54
46
|
|
|
47
|
+
// 获取相关CSS属性
|
|
55
48
|
var getCss = function getCss(o, key) {
|
|
56
49
|
return o.currentStyle ? o.currentStyle[key] : document.defaultView.getComputedStyle(o)[key];
|
|
57
|
-
};
|
|
58
|
-
|
|
50
|
+
};
|
|
59
51
|
|
|
52
|
+
// 依据position属性进行移动
|
|
60
53
|
var dragByPosition = function dragByPosition(dragElement, targetElement) {
|
|
61
54
|
var mouseMove = null;
|
|
62
55
|
var mouseUp = null;
|
|
@@ -66,68 +59,58 @@ var dragByPosition = function dragByPosition(dragElement, targetElement) {
|
|
|
66
59
|
var x = 0;
|
|
67
60
|
var y = 0;
|
|
68
61
|
dragElement.style.cursor = 'move';
|
|
69
|
-
|
|
70
62
|
dragElement.onmousedown = function (e) {
|
|
71
63
|
mouseMove = document.onmousemove;
|
|
72
64
|
mouseUp = document.onmouseup;
|
|
73
65
|
x = e.clientX;
|
|
74
66
|
y = e.clientY;
|
|
75
67
|
active = true;
|
|
76
|
-
|
|
77
68
|
if (getCss(targetElement, 'left') !== 'auto') {
|
|
78
69
|
left = _parseInt(getCss(targetElement, "left"));
|
|
79
70
|
}
|
|
80
|
-
|
|
81
71
|
if (getCss(targetElement, 'top') !== 'auto') {
|
|
82
72
|
top = _parseInt(getCss(targetElement, 'top'));
|
|
83
|
-
}
|
|
84
|
-
|
|
73
|
+
}
|
|
85
74
|
|
|
75
|
+
// 如果下拉框拥有焦点,通过使其失去焦点来关闭掉下拉框
|
|
86
76
|
if (document.activeElement && document.activeElement !== dragElement) {
|
|
87
77
|
document.activeElement.blur();
|
|
88
78
|
}
|
|
89
|
-
|
|
90
79
|
document.onmousemove = function (e) {
|
|
91
80
|
if (active) {
|
|
92
81
|
var top2 = top + e.clientY - y;
|
|
93
82
|
targetElement.style.left = "".concat(left + e.clientX - x, "px");
|
|
94
83
|
targetElement.style.top = "".concat(top2 > 0 ? top2 : 0, "px");
|
|
95
84
|
}
|
|
96
|
-
|
|
97
85
|
mouseMove && mouseMove(e);
|
|
98
86
|
};
|
|
99
|
-
|
|
100
87
|
document.onmouseup = function (e) {
|
|
101
88
|
if (active) {
|
|
102
89
|
document.onmousemove = mouseMove;
|
|
103
90
|
document.onmouseup = mouseUp;
|
|
104
91
|
active = false;
|
|
105
92
|
}
|
|
106
|
-
|
|
107
93
|
mouseUp && mouseUp(e);
|
|
108
94
|
};
|
|
109
|
-
|
|
110
95
|
return false;
|
|
111
96
|
};
|
|
112
97
|
};
|
|
113
|
-
|
|
114
98
|
var drag = function drag(dragElement, targetElement) {
|
|
115
99
|
if (!dragElement || !targetElement) {
|
|
116
100
|
console.error('请传入有效的HTML元素对象');
|
|
117
101
|
return;
|
|
118
|
-
}
|
|
119
|
-
|
|
102
|
+
}
|
|
120
103
|
|
|
104
|
+
// 已经绑定过,不需要再次绑定
|
|
121
105
|
if (dragElement.onmousedown) {
|
|
122
106
|
return;
|
|
123
|
-
}
|
|
124
|
-
|
|
107
|
+
}
|
|
125
108
|
|
|
109
|
+
// 如果目标元素是非定位元素采用transform属性进行移动
|
|
126
110
|
if (getCss(targetElement, 'position') === 'static') {
|
|
127
111
|
dragByTransform(dragElement, targetElement);
|
|
128
112
|
} else {
|
|
129
113
|
dragByPosition(dragElement, targetElement);
|
|
130
114
|
}
|
|
131
115
|
};
|
|
132
|
-
|
|
133
116
|
export default drag;
|