cloud-b2b 1.1.26 → 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.
Files changed (105) hide show
  1. package/es/Area/Area.js +16 -45
  2. package/es/Card/Card.js +3 -4
  3. package/es/CodeInput/CodeInput.js +30 -59
  4. package/es/Control/Control.js +47 -94
  5. package/es/Control/event.js +0 -14
  6. package/es/Enhance/Dialogs.js +0 -15
  7. package/es/Enhance/Loading.js +16 -36
  8. package/es/Enhance/index.js +0 -2
  9. package/es/Header/Header.js +3 -35
  10. package/es/Header/Vertical.js +1 -24
  11. package/es/ImageView/ImageView.js +5 -22
  12. package/es/Indent/Indent.js +3 -7
  13. package/es/InpurCascader/InputCascader.js +10 -36
  14. package/es/InputEditor/InputEditor.js +55 -55
  15. package/es/InputSearch/InputSearch.js +26 -71
  16. package/es/InputSelect/InputSelect.js +17 -48
  17. package/es/InputWriting/InputWriting.js +6 -28
  18. package/es/Layout/Layout.js +28 -59
  19. package/es/LayoutLink/LayoutLink.js +11 -20
  20. package/es/Link/Link.js +4 -27
  21. package/es/Loading/Loading.js +1 -3
  22. package/es/Loading2/Loading2.js +0 -2
  23. package/es/ModalWithDrag/ModalWithDrag.js +3 -8
  24. package/es/ModalWithDrag/drag.js +12 -29
  25. package/es/NumberInput/NumberInput.js +24 -63
  26. package/es/Search/Search.js +53 -149
  27. package/es/Sidebar/Sidebar.js +13 -34
  28. package/es/Sidebar2/Sidebar.js +3 -30
  29. package/es/SuperForm/SuperForm.js +27 -150
  30. package/es/SuperForm2/SuperForm.js +31 -165
  31. package/es/SuperIcon/SuperIcon.js +3 -6
  32. package/es/SuperPagination/SuperPagination.js +15 -32
  33. package/es/SuperTab/SuperTab.js +4 -27
  34. package/es/SuperTab2/SuperTab2.js +11 -33
  35. package/es/SuperTable/DragSortRow.js +6 -34
  36. package/es/SuperTable/FilterDropDown.js +10 -34
  37. package/es/SuperTable/SuperTable.js +91 -216
  38. package/es/SuperTable/fixed.js +1 -9
  39. package/es/SuperTable2/SuperTable2.js +104 -206
  40. package/es/SuperTable2/SuperTableCell.js +16 -55
  41. package/es/SuperTable3/FilterDropDown.js +10 -34
  42. package/es/SuperTable3/SuperTable.js +57 -175
  43. package/es/SuperTable3/fixed.js +1 -9
  44. package/es/SuperToolbar/SuperToolbar.js +21 -49
  45. package/es/SuperUpload/SuperUpload.js +73 -110
  46. package/es/Title/Title.js +12 -15
  47. package/es/Viewer/ImageViews.js +7 -60
  48. package/es/Viewer/Viewer.js +7 -34
  49. package/es/WingBlank/WingBlank.js +2 -6
  50. package/es/helper.js +36 -23
  51. package/es/history.js +3 -2
  52. package/lib/Area/Area.js +16 -64
  53. package/lib/Card/Card.js +3 -13
  54. package/lib/CodeInput/CodeInput.js +30 -77
  55. package/lib/Control/Control.js +47 -135
  56. package/lib/Control/event.js +0 -16
  57. package/lib/Enhance/Dialogs.js +0 -26
  58. package/lib/Enhance/Loading.js +16 -52
  59. package/lib/Enhance/index.js +0 -9
  60. package/lib/Header/Header.js +3 -48
  61. package/lib/Header/Vertical.js +1 -36
  62. package/lib/ImageView/ImageView.js +5 -30
  63. package/lib/Indent/Indent.js +3 -13
  64. package/lib/InpurCascader/InputCascader.js +11 -50
  65. package/lib/InputEditor/InputEditor.js +55 -64
  66. package/lib/InputSearch/InputSearch.js +26 -78
  67. package/lib/InputSelect/InputSelect.js +17 -62
  68. package/lib/InputWriting/InputWriting.js +6 -35
  69. package/lib/Layout/Layout.js +28 -76
  70. package/lib/LayoutLink/LayoutLink.js +11 -38
  71. package/lib/Link/Link.js +4 -40
  72. package/lib/Loading/Loading.js +1 -9
  73. package/lib/Loading2/Loading2.js +0 -8
  74. package/lib/ModalWithDrag/ModalWithDrag.js +3 -18
  75. package/lib/ModalWithDrag/drag.js +12 -34
  76. package/lib/NumberInput/NumberInput.js +24 -76
  77. package/lib/Search/Search.js +53 -157
  78. package/lib/Sidebar/Sidebar.js +13 -46
  79. package/lib/Sidebar2/Sidebar.js +3 -42
  80. package/lib/SuperForm/SuperForm.js +27 -149
  81. package/lib/SuperForm2/SuperForm.js +31 -160
  82. package/lib/SuperIcon/SuperIcon.js +3 -14
  83. package/lib/SuperPagination/SuperPagination.js +15 -42
  84. package/lib/SuperTab/SuperTab.js +4 -34
  85. package/lib/SuperTab2/SuperTab2.js +11 -48
  86. package/lib/SuperTable/DragSortRow.js +6 -42
  87. package/lib/SuperTable/FilterDropDown.js +10 -42
  88. package/lib/SuperTable/SuperTable.js +90 -210
  89. package/lib/SuperTable/fixed.js +1 -13
  90. package/lib/SuperTable2/SuperTable2.js +104 -222
  91. package/lib/SuperTable2/SuperTableCell.js +13 -62
  92. package/lib/SuperTable3/FilterDropDown.js +10 -42
  93. package/lib/SuperTable3/SuperTable.js +56 -169
  94. package/lib/SuperTable3/fixed.js +1 -13
  95. package/lib/SuperToolbar/SuperToolbar.js +20 -64
  96. package/lib/SuperUpload/SuperUpload.js +73 -140
  97. package/lib/Title/Title.js +12 -24
  98. package/lib/Viewer/ImageViews.js +7 -63
  99. package/lib/Viewer/Viewer.js +7 -43
  100. package/lib/WingBlank/WingBlank.js +2 -14
  101. package/lib/helper.js +36 -37
  102. package/lib/history.js +0 -5
  103. package/lib/index.js +0 -76
  104. package/lib/variables.js +0 -4
  105. package/package.json +1 -1
@@ -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
- sidebars = _this$props.sidebars,
78
- nav2 = _this$props.nav2,
79
- _this$props$openKeys = _this$props.openKeys,
80
- openKeys = _this$props$openKeys === void 0 ? {} : _this$props$openKeys,
81
- navigation = _this$props.navigation;
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
- loading = _this$props2.loading,
119
- sidebars = _this$props2.sidebars,
120
- nav1 = _this$props2.nav1,
121
- nav2 = _this$props2.nav2,
122
- homeUrl = _this$props2.homeUrl,
123
- settingUrl = _this$props2.settingUrl,
124
- messageUrl = _this$props2.messageUrl,
125
- messageCount = _this$props2.messageCount,
126
- userName = _this$props2.userName,
127
- userIcon = _this$props2.userIcon,
128
- loginUrl = _this$props2.loginUrl,
129
- onMenuClick = _this$props2.onMenuClick,
130
- onLogout = _this$props2.onLogout;
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
- loading = _this$props3.loading,
186
- sidebars = _this$props3.sidebars,
187
- _this$props3$nav = _this$props3.nav1,
188
- nav1 = _this$props3$nav === void 0 ? '' : _this$props3$nav,
189
- _this$props3$nav2 = _this$props3.nav2,
190
- nav2 = _this$props3$nav2 === void 0 ? '' : _this$props3$nav2,
191
- children = _this$props3.children,
192
- _this$props3$noPrivil = _this$props3.noPrivilege,
193
- noPrivilege = _this$props3$noPrivil === void 0 ? false : _this$props3$noPrivil,
194
- navigation = _this$props3.navigation;
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
- onSearch = _ref.onSearch;
15
-
13
+ onSearch = _ref.onSearch;
16
14
  var _useState = useState(''),
17
- _useState2 = _slicedToArray(_useState, 2),
18
- value = _useState2[0],
19
- setValue = _useState2[1];
20
-
15
+ _useState2 = _slicedToArray(_useState, 2),
16
+ value = _useState2[0],
17
+ setValue = _useState2[1];
21
18
  var _useState3 = useState(''),
22
- _useState4 = _slicedToArray(_useState3, 2),
23
- status = _useState4[0],
24
- setStatus = _useState4[1];
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
- img = _ref3.img,
62
- title = _ref3.title,
63
- placeholder = _ref3.placeholder,
64
- onSearch = _ref3.onSearch;
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
- to = _this$props.to,
81
- children = _this$props.children,
82
- disabled = _this$props.disabled,
83
- props = _objectWithoutProperties(_this$props, _excluded);
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 };
@@ -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
- onRetry = _ref.onRetry;
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;
@@ -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
- children = _ref.children,
21
- title = _ref.title,
22
- props = _objectWithoutProperties(_ref, _excluded);
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;
@@ -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
- }; // 获取相关CSS属性
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
- }; // 依据position属性进行移动
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
- } // 如果目标元素是非定位元素采用transform属性进行移动
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;