cloud-b2b 1.1.79 → 1.1.80

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 (82) hide show
  1. package/es/Area/Area.js +10 -13
  2. package/es/CodeInput/CodeInput.js +16 -19
  3. package/es/Enhance/Dialogs.js +11 -14
  4. package/es/Enhance/Loading.js +15 -18
  5. package/es/Header/Header.js +17 -20
  6. package/es/Header/Vertical.js +11 -14
  7. package/es/ImageView/ImageView.js +10 -13
  8. package/es/InpurCascader/InputCascader.js +11 -14
  9. package/es/InputEditor/InputEditor.js +16 -18
  10. package/es/InputSearch/InputSearch.js +20 -23
  11. package/es/InputSelect/InputSelect.js +14 -17
  12. package/es/InputTreeSelect/InputTreeSelect.js +10 -13
  13. package/es/InputWriting/InputWriting.js +12 -15
  14. package/es/Layout/Layout.js +14 -17
  15. package/es/Link/Link.js +7 -10
  16. package/es/NumberInput/NumberInput.js +13 -16
  17. package/es/Search/Search.js +52 -55
  18. package/es/Search2/Search.js +83 -86
  19. package/es/Search2/Search.less +64 -64
  20. package/es/Search2/package.json +6 -6
  21. package/es/Sidebar/Sidebar.js +11 -14
  22. package/es/Sidebar2/Sidebar.js +13 -16
  23. package/es/SuperForm/SuperForm.js +74 -79
  24. package/es/SuperForm2/SuperForm.js +107 -112
  25. package/es/SuperPagination/SuperPagination.js +8 -11
  26. package/es/SuperTab/SuperTab.js +12 -15
  27. package/es/SuperTab2/SuperTab2.js +13 -16
  28. package/es/SuperTable/DragSortRow.js +12 -15
  29. package/es/SuperTable/FilterDropDown.js +11 -14
  30. package/es/SuperTable/SuperTable.js +70 -73
  31. package/es/SuperTable2/SuperTable2.js +89 -92
  32. package/es/SuperTable2/SuperTable2.less +3 -1
  33. package/es/SuperTable2/SuperTableCell.js +27 -30
  34. package/es/SuperTable3/FilterDropDown.js +11 -14
  35. package/es/SuperTable3/SuperTable.js +58 -61
  36. package/es/SuperToolbar/SuperToolbar.js +12 -15
  37. package/es/SuperUpload/SuperUpload.js +38 -38
  38. package/es/Viewer/ImageViews.js +16 -19
  39. package/es/Viewer/Viewer.js +11 -14
  40. package/es/helper.js +18 -17
  41. package/lib/Area/Area.js +10 -13
  42. package/lib/CodeInput/CodeInput.js +16 -19
  43. package/lib/Enhance/Dialogs.js +11 -14
  44. package/lib/Enhance/Loading.js +15 -18
  45. package/lib/Header/Header.js +17 -20
  46. package/lib/Header/Vertical.js +11 -14
  47. package/lib/ImageView/ImageView.js +10 -13
  48. package/lib/InpurCascader/InputCascader.js +11 -14
  49. package/lib/InputEditor/InputEditor.js +16 -18
  50. package/lib/InputSearch/InputSearch.js +20 -23
  51. package/lib/InputSelect/InputSelect.js +14 -17
  52. package/lib/InputTreeSelect/InputTreeSelect.js +10 -13
  53. package/lib/InputWriting/InputWriting.js +12 -15
  54. package/lib/Layout/Layout.js +14 -17
  55. package/lib/LayoutLink/LayoutLink.js +1 -2
  56. package/lib/Link/Link.js +7 -10
  57. package/lib/NumberInput/NumberInput.js +13 -16
  58. package/lib/Search/Search.js +53 -57
  59. package/lib/Search2/Search.js +84 -88
  60. package/lib/Search2/Search.less +64 -64
  61. package/lib/Search2/package.json +6 -6
  62. package/lib/Sidebar/Sidebar.js +11 -14
  63. package/lib/Sidebar2/Sidebar.js +13 -16
  64. package/lib/SuperForm/SuperForm.js +75 -81
  65. package/lib/SuperForm2/SuperForm.js +108 -114
  66. package/lib/SuperPagination/SuperPagination.js +8 -11
  67. package/lib/SuperTab/SuperTab.js +12 -15
  68. package/lib/SuperTab2/SuperTab2.js +13 -16
  69. package/lib/SuperTable/DragSortRow.js +12 -15
  70. package/lib/SuperTable/FilterDropDown.js +11 -14
  71. package/lib/SuperTable/SuperTable.js +70 -73
  72. package/lib/SuperTable2/SuperTable2.js +90 -94
  73. package/lib/SuperTable2/SuperTable2.less +3 -1
  74. package/lib/SuperTable2/SuperTableCell.js +27 -30
  75. package/lib/SuperTable3/FilterDropDown.js +11 -14
  76. package/lib/SuperTable3/SuperTable.js +58 -61
  77. package/lib/SuperToolbar/SuperToolbar.js +12 -15
  78. package/lib/SuperUpload/SuperUpload.js +39 -40
  79. package/lib/Viewer/ImageViews.js +16 -19
  80. package/lib/Viewer/Viewer.js +11 -14
  81. package/lib/helper.js +18 -17
  82. package/package.json +1 -1
@@ -4,10 +4,9 @@ import _Icon from "antd/es/icon";
4
4
  import _typeof from "@babel/runtime-corejs3/helpers/typeof";
5
5
  import _classCallCheck from "@babel/runtime-corejs3/helpers/classCallCheck";
6
6
  import _createClass from "@babel/runtime-corejs3/helpers/createClass";
7
- import _assertThisInitialized from "@babel/runtime-corejs3/helpers/assertThisInitialized";
8
- import _inherits from "@babel/runtime-corejs3/helpers/inherits";
9
7
  import _possibleConstructorReturn from "@babel/runtime-corejs3/helpers/possibleConstructorReturn";
10
8
  import _getPrototypeOf from "@babel/runtime-corejs3/helpers/getPrototypeOf";
9
+ import _inherits from "@babel/runtime-corejs3/helpers/inherits";
11
10
  import _defineProperty from "@babel/runtime-corejs3/helpers/defineProperty";
12
11
  import _Button from "antd/es/button";
13
12
  import _objectWithoutProperties from "@babel/runtime-corejs3/helpers/objectWithoutProperties";
@@ -28,8 +27,8 @@ import _forEachInstanceProperty from "@babel/runtime-corejs3/core-js-stable/inst
28
27
  import _Object$getOwnPropertyDescriptors from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors";
29
28
  import _Object$defineProperties from "@babel/runtime-corejs3/core-js-stable/object/define-properties";
30
29
  import _Object$defineProperty from "@babel/runtime-corejs3/core-js-stable/object/define-property";
31
- 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); }; }
32
- 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; } }
30
+ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? _Reflect$construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
31
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
33
32
  import React from 'react';
34
33
  import PropTypes from 'prop-types';
35
34
  import variables from '../variables';
@@ -79,8 +78,6 @@ var ButtonEx = function ButtonEx(_ref) {
79
78
  * onSubClick: 按钮为下拉时下拉项子列表项点击时触发,原型为function(key, subKey)
80
79
  */
81
80
  var SuperToolbar = /*#__PURE__*/function (_React$Component) {
82
- _inherits(SuperToolbar, _React$Component);
83
- var _super = _createSuper(SuperToolbar);
84
81
  function SuperToolbar() {
85
82
  var _context;
86
83
  var _this;
@@ -88,8 +85,8 @@ var SuperToolbar = /*#__PURE__*/function (_React$Component) {
88
85
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
89
86
  args[_key] = arguments[_key];
90
87
  }
91
- _this = _super.call.apply(_super, _concatInstanceProperty(_context = [this]).call(_context, args));
92
- _defineProperty(_assertThisInitialized(_this), "onClick", function (e) {
88
+ _this = _callSuper(this, SuperToolbar, _concatInstanceProperty(_context = []).call(_context, args));
89
+ _defineProperty(_this, "onClick", function (e) {
93
90
  var _this$props = _this.props,
94
91
  onClick = _this$props.onClick,
95
92
  onSubClick = _this$props.onSubClick;
@@ -109,12 +106,12 @@ var SuperToolbar = /*#__PURE__*/function (_React$Component) {
109
106
  }
110
107
  }
111
108
  });
112
- _defineProperty(_assertThisInitialized(_this), "onFileChange", function (_ref2, file) {
109
+ _defineProperty(_this, "onFileChange", function (_ref2, file) {
113
110
  var key = _ref2.key;
114
111
  var onFileChange = _this.props.onFileChange;
115
112
  onFileChange && onFileChange(key, file);
116
113
  });
117
- _defineProperty(_assertThisInitialized(_this), "toSubMenu", function (_ref3) {
114
+ _defineProperty(_this, "toSubMenu", function (_ref3) {
118
115
  var key = _ref3.key,
119
116
  title = _ref3.title,
120
117
  _ref3$subMenu = _ref3.subMenu,
@@ -130,7 +127,7 @@ var SuperToolbar = /*#__PURE__*/function (_React$Component) {
130
127
  }, title);
131
128
  }));
132
129
  });
133
- _defineProperty(_assertThisInitialized(_this), "toMenu", function (menu) {
130
+ _defineProperty(_this, "toMenu", function (menu) {
134
131
  return /*#__PURE__*/React.createElement(_Menu, {
135
132
  onClick: _this.onClick
136
133
  }, _mapInstanceProperty(menu).call(menu, function (item) {
@@ -146,7 +143,7 @@ var SuperToolbar = /*#__PURE__*/function (_React$Component) {
146
143
  }
147
144
  }));
148
145
  });
149
- _defineProperty(_assertThisInitialized(_this), "toButton", function (control) {
146
+ _defineProperty(_this, "toButton", function (control) {
150
147
  var _context2;
151
148
  var _this$props2 = _this.props,
152
149
  _this$props2$size = _this$props2.size,
@@ -162,7 +159,7 @@ var SuperToolbar = /*#__PURE__*/function (_React$Component) {
162
159
  loading = control.loading,
163
160
  _control$isUpload = control.isUpload,
164
161
  isUpload = _control$isUpload === void 0 ? false : _control$isUpload;
165
- var onClick = _bindInstanceProperty(_context2 = _this.onClick).call(_context2, _assertThisInitialized(_this), key);
162
+ var onClick = _bindInstanceProperty(_context2 = _this.onClick).call(_context2, _this, key);
166
163
  if (menu && menu.length) {
167
164
  return /*#__PURE__*/React.createElement(_Dropdown, {
168
165
  key: key,
@@ -213,7 +210,8 @@ var SuperToolbar = /*#__PURE__*/function (_React$Component) {
213
210
  });
214
211
  return _this;
215
212
  }
216
- _createClass(SuperToolbar, [{
213
+ _inherits(SuperToolbar, _React$Component);
214
+ return _createClass(SuperToolbar, [{
217
215
  key: "render",
218
216
  value: function render() {
219
217
  var buttons = this.props.buttons;
@@ -223,7 +221,6 @@ var SuperToolbar = /*#__PURE__*/function (_React$Component) {
223
221
  }, _mapInstanceProperty(buttons).call(buttons, this.toButton));
224
222
  }
225
223
  }]);
226
- return SuperToolbar;
227
224
  }(React.Component);
228
225
  _defineProperty(SuperToolbar, "propTypes", {
229
226
  buttons: PropTypes.arrayOf(PropTypes.shape(ButtonType)).isRequired,
@@ -16,9 +16,9 @@ import _Button from "antd/es/button";
16
16
  import _Icon from "antd/es/icon";
17
17
  import _asyncToGenerator from "@babel/runtime-corejs3/helpers/asyncToGenerator";
18
18
  import _defineProperty from "@babel/runtime-corejs3/helpers/defineProperty";
19
- function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof _Symbol !== "undefined" && _getIteratorMethod(o) || o["@@iterator"]; if (!it) { if (_Array$isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
20
- function _unsupportedIterableToArray(o, minLen) { var _context7; if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = _sliceInstanceProperty(_context7 = Object.prototype.toString.call(o)).call(_context7, 8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return _Array$from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
21
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
19
+ function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof _Symbol && _getIteratorMethod(r) || r["@@iterator"]; if (!t) { if (_Array$isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
20
+ function _unsupportedIterableToArray(r, a) { if (r) { var _context7; if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = _sliceInstanceProperty(_context7 = {}.toString.call(r)).call(_context7, 8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? _Array$from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
21
+ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
22
22
  import _regeneratorRuntime from "@babel/runtime-corejs3/regenerator";
23
23
  function ownKeys(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = _filterInstanceProperty(o).call(o, function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
24
24
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context5, _context6; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context5 = ownKeys(Object(t), !0)).call(_context5, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context6 = ownKeys(Object(t))).call(_context6, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
@@ -44,7 +44,7 @@ var propTypes = {
44
44
  //附件组的标题
45
45
  required: PropTypes.bool,
46
46
  //是否必须上传,默认false
47
- listType: PropTypes.oneOf[('text', 'picture', 'picture-card')],
47
+ listType: PropTypes.oneOf['text', 'picture', 'picture-card'],
48
48
  //上传列表的内建样式,支持三种,默认picture-card
49
49
  readonly: PropTypes.bool,
50
50
  //所在页面是否只读,默认false
@@ -116,8 +116,8 @@ var getUploadProps = function getUploadProps(props, onPreview, fileList, setFile
116
116
  setFileList(newList);
117
117
  };
118
118
  var onRemove = /*#__PURE__*/function () {
119
- var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(fileRemove) {
120
- return _regeneratorRuntime.wrap(function _callee$(_context2) {
119
+ var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(fileRemove) {
120
+ return _regeneratorRuntime.wrap(function (_context2) {
121
121
  while (1) switch (_context2.prev = _context2.next) {
122
122
  case 0:
123
123
  props.onRemove && props.onRemove(fileRemove, fileList, fileDeleteList);
@@ -219,70 +219,70 @@ function SuperUpload(props) {
219
219
  return _fetchImgData.apply(this, arguments);
220
220
  }
221
221
  function _fetchImgData() {
222
- _fetchImgData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
223
- var initFileList, _iterator, _step, item;
224
- return _regeneratorRuntime.wrap(function _callee2$(_context3) {
222
+ _fetchImgData = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
223
+ var initFileList, _iterator, _step, item, _t, _t2;
224
+ return _regeneratorRuntime.wrap(function (_context3) {
225
225
  while (1) switch (_context3.prev = _context3.next) {
226
226
  case 0:
227
227
  initFileList = [];
228
228
  if (!(props.fileList.length > 0)) {
229
- _context3.next = 25;
229
+ _context3.next = 10;
230
230
  break;
231
231
  }
232
232
  _iterator = _createForOfIteratorHelper(props.fileList);
233
- _context3.prev = 3;
233
+ _context3.prev = 1;
234
234
  _iterator.s();
235
- case 5:
235
+ case 2:
236
236
  if ((_step = _iterator.n()).done) {
237
- _context3.next = 17;
237
+ _context3.next = 7;
238
238
  break;
239
239
  }
240
240
  item = _step.value;
241
241
  if (!props.getFileList) {
242
- _context3.next = 13;
242
+ _context3.next = 4;
243
243
  break;
244
244
  }
245
- _context3.next = 10;
245
+ _context3.next = 3;
246
246
  return props.getFileList(props.fileList);
247
- case 10:
248
- _context3.t0 = _context3.sent;
249
- _context3.next = 14;
250
- break;
251
- case 13:
252
- _context3.t0 = [];
253
- case 14:
254
- initFileList = _context3.t0;
255
- case 15:
247
+ case 3:
248
+ _t = _context3.sent;
256
249
  _context3.next = 5;
257
250
  break;
258
- case 17:
259
- _context3.next = 22;
251
+ case 4:
252
+ _t = [];
253
+ case 5:
254
+ initFileList = _t;
255
+ case 6:
256
+ _context3.next = 2;
257
+ break;
258
+ case 7:
259
+ _context3.next = 9;
260
260
  break;
261
- case 19:
262
- _context3.prev = 19;
263
- _context3.t1 = _context3["catch"](3);
264
- _iterator.e(_context3.t1);
265
- case 22:
266
- _context3.prev = 22;
261
+ case 8:
262
+ _context3.prev = 8;
263
+ _t2 = _context3["catch"](1);
264
+ _iterator.e(_t2);
265
+ case 9:
266
+ _context3.prev = 9;
267
267
  _iterator.f();
268
- return _context3.finish(22);
269
- case 25:
268
+ return _context3.finish(9);
269
+ case 10:
270
270
  //const initFileList = props.getFileList ? await props.getFileList(props.fileList) : [];
271
271
  setFileList(initFileList ? initFileList : []);
272
272
  setLoading(false);
273
- case 27:
273
+ case 11:
274
274
  case "end":
275
275
  return _context3.stop();
276
276
  }
277
- }, _callee2, null, [[3, 19, 22, 25]]);
277
+ }, _callee2, null, [[1, 8, 9, 10]]);
278
278
  }));
279
279
  return _fetchImgData.apply(this, arguments);
280
280
  }
281
281
  fetchImgData();
282
282
  }, [props.fileList]);
283
283
  var onPreview = /*#__PURE__*/function () {
284
- var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(file) {
285
- return _regeneratorRuntime.wrap(function _callee3$(_context4) {
284
+ var _ref4 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3(file) {
285
+ return _regeneratorRuntime.wrap(function (_context4) {
286
286
  while (1) switch (_context4.prev = _context4.next) {
287
287
  case 0:
288
288
  props.onPreview && props.onPreview(file, fileList);
@@ -2,16 +2,15 @@ import _Reflect$construct from "@babel/runtime-corejs3/core-js-stable/reflect/co
2
2
  import _Icon from "antd/es/icon";
3
3
  import _classCallCheck from "@babel/runtime-corejs3/helpers/classCallCheck";
4
4
  import _createClass from "@babel/runtime-corejs3/helpers/createClass";
5
- import _assertThisInitialized from "@babel/runtime-corejs3/helpers/assertThisInitialized";
6
- import _inherits from "@babel/runtime-corejs3/helpers/inherits";
7
5
  import _possibleConstructorReturn from "@babel/runtime-corejs3/helpers/possibleConstructorReturn";
8
6
  import _getPrototypeOf from "@babel/runtime-corejs3/helpers/getPrototypeOf";
7
+ import _inherits from "@babel/runtime-corejs3/helpers/inherits";
9
8
  import _defineProperty from "@babel/runtime-corejs3/helpers/defineProperty";
10
9
  import _slicedToArray from "@babel/runtime-corejs3/helpers/slicedToArray";
11
10
  import _JSON$stringify from "@babel/runtime-corejs3/core-js-stable/json/stringify";
12
11
  import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
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); }; }
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; } }
12
+ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? _Reflect$construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
13
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
15
14
  import React from "react";
16
15
  import variables from '../variables';
17
16
  var addEvent = function addEvent(el, event, handler) {
@@ -48,13 +47,11 @@ var getRotateDeg = function getRotateDeg(target) {
48
47
  return Math.round(Math.atan2(b, a) * (180 / Math.PI));
49
48
  };
50
49
  var ImageViews = /*#__PURE__*/function (_React$Component) {
51
- _inherits(ImageViews, _React$Component);
52
- var _super = _createSuper(ImageViews);
53
50
  function ImageViews(props) {
54
51
  var _this;
55
52
  _classCallCheck(this, ImageViews);
56
- _this = _super.call(this, props);
57
- _defineProperty(_assertThisInitialized(_this), "_onwheel", function (e) {
53
+ _this = _callSuper(this, ImageViews, [props]);
54
+ _defineProperty(_this, "_onwheel", function (e) {
58
55
  var zoom = _this.state.zoom;
59
56
  /*事件兼容*/
60
57
  var event = e || window.event;
@@ -76,7 +73,7 @@ var ImageViews = /*#__PURE__*/function (_React$Component) {
76
73
  zoom: zoomVal
77
74
  });
78
75
  });
79
- _defineProperty(_assertThisInitialized(_this), "_onMouseDown", function (e) {
76
+ _defineProperty(_this, "_onMouseDown", function (e) {
80
77
  /*事件兼容*/
81
78
  var event = e || window.event;
82
79
  var imageDOM = _this.imgRef;
@@ -93,7 +90,7 @@ var ImageViews = /*#__PURE__*/function (_React$Component) {
93
90
  addEvent(document, 'mousemove', _this._onMouseMove);
94
91
  addEvent(document, 'mouseup', _this._onMouseUp);
95
92
  });
96
- _defineProperty(_assertThisInitialized(_this), "_onMouseMove", function (e) {
93
+ _defineProperty(_this, "_onMouseMove", function (e) {
97
94
  var event = e || window.event;
98
95
  var imageDOM = _this.imgRef;
99
96
  var startTouch = _this.state.startTouch;
@@ -104,7 +101,7 @@ var ImageViews = /*#__PURE__*/function (_React$Component) {
104
101
  imageDOM.style.left = "".concat(deltaX, "px");
105
102
  imageDOM.style.top = "".concat(deltaY, "px");
106
103
  });
107
- _defineProperty(_assertThisInitialized(_this), "_onMouseUp", function () {
104
+ _defineProperty(_this, "_onMouseUp", function () {
108
105
  var startTouch = _this.state.startTouch;
109
106
  if (!startTouch.initiated) return;
110
107
  var endTouch = JSON.parse(_JSON$stringify(startTouch));
@@ -115,7 +112,7 @@ var ImageViews = /*#__PURE__*/function (_React$Component) {
115
112
  removeEvent(document, 'mousemove', _this._onMouseMove);
116
113
  removeEvent(document, 'mouseup', _this._onMouseDown);
117
114
  });
118
- _defineProperty(_assertThisInitialized(_this), "_onPlus", function (event) {
115
+ _defineProperty(_this, "_onPlus", function (event) {
119
116
  var zoom = _this.state.zoom;
120
117
  var imageDOM = _this.imgRef;
121
118
  var zoomVal = zoom + 0.1;
@@ -129,7 +126,7 @@ var ImageViews = /*#__PURE__*/function (_React$Component) {
129
126
  zoom: zoomVal
130
127
  });
131
128
  });
132
- _defineProperty(_assertThisInitialized(_this), "_onMinus", function () {
129
+ _defineProperty(_this, "_onMinus", function () {
133
130
  var _context2;
134
131
  var zoom = _this.state.zoom;
135
132
  var imageDOM = _this.imgRef;
@@ -143,7 +140,7 @@ var ImageViews = /*#__PURE__*/function (_React$Component) {
143
140
  zoom: zoomVal
144
141
  });
145
142
  });
146
- _defineProperty(_assertThisInitialized(_this), "_reload", function () {
143
+ _defineProperty(_this, "_reload", function () {
147
144
  var imageDOM = _this.imgRef;
148
145
  imageDOM.style.transform = "translate(-50%,-50%) scale(1) rotate(0deg)";
149
146
  imageDOM.style.left = "50%";
@@ -152,7 +149,7 @@ var ImageViews = /*#__PURE__*/function (_React$Component) {
152
149
  zoom: 1
153
150
  });
154
151
  });
155
- _defineProperty(_assertThisInitialized(_this), "_arrowLeft", function () {
152
+ _defineProperty(_this, "_arrowLeft", function () {
156
153
  var onLeft = _this.props.onLeft;
157
154
  onLeft && onLeft();
158
155
  var imageDOM = _this.imgRef;
@@ -163,7 +160,7 @@ var ImageViews = /*#__PURE__*/function (_React$Component) {
163
160
  zoom: 1
164
161
  });
165
162
  });
166
- _defineProperty(_assertThisInitialized(_this), "_arrowRight", function () {
163
+ _defineProperty(_this, "_arrowRight", function () {
167
164
  var onRight = _this.props.onRight;
168
165
  onRight && onRight();
169
166
  var imageDOM = _this.imgRef;
@@ -174,7 +171,7 @@ var ImageViews = /*#__PURE__*/function (_React$Component) {
174
171
  zoom: 1
175
172
  });
176
173
  });
177
- _defineProperty(_assertThisInitialized(_this), "rotate", function (isLeft) {
174
+ _defineProperty(_this, "rotate", function (isLeft) {
178
175
  return function () {
179
176
  var _context3;
180
177
  var imageDOM = _this.imgRef;
@@ -190,7 +187,8 @@ var ImageViews = /*#__PURE__*/function (_React$Component) {
190
187
  };
191
188
  return _this;
192
189
  }
193
- _createClass(ImageViews, [{
190
+ _inherits(ImageViews, _React$Component);
191
+ return _createClass(ImageViews, [{
194
192
  key: "render",
195
193
  value: function render() {
196
194
  var _this2 = this;
@@ -253,6 +251,5 @@ var ImageViews = /*#__PURE__*/function (_React$Component) {
253
251
  }))))));
254
252
  }
255
253
  }]);
256
- return ImageViews;
257
254
  }(React.Component);
258
255
  export default ImageViews;
@@ -2,32 +2,29 @@ import _Reflect$construct from "@babel/runtime-corejs3/core-js-stable/reflect/co
2
2
  import _Icon from "antd/es/icon";
3
3
  import _classCallCheck from "@babel/runtime-corejs3/helpers/classCallCheck";
4
4
  import _createClass from "@babel/runtime-corejs3/helpers/createClass";
5
- import _assertThisInitialized from "@babel/runtime-corejs3/helpers/assertThisInitialized";
6
- import _inherits from "@babel/runtime-corejs3/helpers/inherits";
7
5
  import _possibleConstructorReturn from "@babel/runtime-corejs3/helpers/possibleConstructorReturn";
8
6
  import _getPrototypeOf from "@babel/runtime-corejs3/helpers/getPrototypeOf";
7
+ import _inherits from "@babel/runtime-corejs3/helpers/inherits";
9
8
  import _defineProperty from "@babel/runtime-corejs3/helpers/defineProperty";
10
9
  import _setTimeout from "@babel/runtime-corejs3/core-js-stable/set-timeout";
11
10
  import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
12
11
  import _bindInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/bind";
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); }; }
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; } }
12
+ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? _Reflect$construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
13
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
15
14
  import React from 'react';
16
15
  import PropTypes from 'prop-types';
17
16
  import ImageViews from "./ImageViews";
18
17
  import variables from '../variables';
19
18
  var Viewers = /*#__PURE__*/function (_React$Component) {
20
- _inherits(Viewers, _React$Component);
21
- var _super = _createSuper(Viewers);
22
19
  function Viewers(props) {
23
20
  var _this;
24
21
  _classCallCheck(this, Viewers);
25
- _this = _super.call(this, props);
22
+ _this = _callSuper(this, Viewers, [props]);
26
23
  //修复Warning报错
27
- _defineProperty(_assertThisInitialized(_this), "componentWillUnmount", function () {
24
+ _defineProperty(_this, "componentWillUnmount", function () {
28
25
  _this.timeout = null;
29
26
  });
30
- _defineProperty(_assertThisInitialized(_this), "closeViewers", function () {
27
+ _defineProperty(_this, "closeViewers", function () {
31
28
  var _this$props = _this.props,
32
29
  onCancel = _this$props.onCancel,
33
30
  onClose = _this$props.onClose;
@@ -36,7 +33,7 @@ var Viewers = /*#__PURE__*/function (_React$Component) {
36
33
  onCancel && onCancel(onClose);
37
34
  }, 1000);
38
35
  });
39
- _defineProperty(_assertThisInitialized(_this), "_onLeft", function () {
36
+ _defineProperty(_this, "_onLeft", function () {
40
37
  var imageIndex = _this.state.imageIndex;
41
38
  var images = _this.props.images;
42
39
  var index = imageIndex - 1;
@@ -47,7 +44,7 @@ var Viewers = /*#__PURE__*/function (_React$Component) {
47
44
  imageIndex: index
48
45
  });
49
46
  });
50
- _defineProperty(_assertThisInitialized(_this), "_onRight", function () {
47
+ _defineProperty(_this, "_onRight", function () {
51
48
  var imageIndex = _this.state.imageIndex;
52
49
  var images = _this.props.images;
53
50
  var index = imageIndex + 1;
@@ -58,7 +55,7 @@ var Viewers = /*#__PURE__*/function (_React$Component) {
58
55
  imageIndex: index
59
56
  });
60
57
  });
61
- _defineProperty(_assertThisInitialized(_this), "_onSelect", function (index) {
58
+ _defineProperty(_this, "_onSelect", function (index) {
62
59
  _this.setState({
63
60
  imageIndex: index
64
61
  });
@@ -68,7 +65,8 @@ var Viewers = /*#__PURE__*/function (_React$Component) {
68
65
  };
69
66
  return _this;
70
67
  }
71
- _createClass(Viewers, [{
68
+ _inherits(Viewers, _React$Component);
69
+ return _createClass(Viewers, [{
72
70
  key: "render",
73
71
  value: function render() {
74
72
  var _this2 = this;
@@ -107,7 +105,6 @@ var Viewers = /*#__PURE__*/function (_React$Component) {
107
105
  }))) : null);
108
106
  }
109
107
  }]);
110
- return Viewers;
111
108
  }(React.Component);
112
109
  _defineProperty(Viewers, "propTypes", {
113
110
  /** viewer是否可见 */
package/es/helper.js CHANGED
@@ -137,15 +137,16 @@ var getObject = function getObject(obj, keys) {
137
137
  }, {});
138
138
  };
139
139
  export var fetchJson = /*#__PURE__*/function () {
140
- var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(url, option) {
140
+ var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(url, option) {
141
141
  var cookie,
142
142
  jump,
143
143
  res,
144
144
  _context3,
145
145
  json,
146
146
  roleKey,
147
- _args = arguments;
148
- return _regeneratorRuntime.wrap(function _callee$(_context4) {
147
+ _args = arguments,
148
+ _t;
149
+ return _regeneratorRuntime.wrap(function (_context4) {
149
150
  while (1) switch (_context4.prev = _context4.next) {
150
151
  case 0:
151
152
  cookie = _args.length > 2 && _args[2] !== undefined ? _args[2] : true;
@@ -172,23 +173,23 @@ export var fetchJson = /*#__PURE__*/function () {
172
173
  };
173
174
  }
174
175
  }
175
- _context4.prev = 3;
176
- _context4.next = 6;
176
+ _context4.prev = 1;
177
+ _context4.next = 2;
177
178
  return fetch(url, option);
178
- case 6:
179
+ case 2:
179
180
  res = _context4.sent;
180
181
  if (res.ok) {
181
- _context4.next = 11;
182
+ _context4.next = 3;
182
183
  break;
183
184
  }
184
185
  return _context4.abrupt("return", {
185
186
  returnCode: res.status,
186
187
  returnMsg: _concatInstanceProperty(_context3 = "".concat(res.status, " - ")).call(_context3, res.statusText)
187
188
  });
188
- case 11:
189
- _context4.next = 13;
189
+ case 3:
190
+ _context4.next = 4;
190
191
  return res.json();
191
- case 13:
192
+ case 4:
192
193
  json = _context4.sent;
193
194
  if (json.returnCode !== 0 && json.errorCode) {
194
195
  json.returnCode = Number(json.errorCode) || 10001;
@@ -204,21 +205,21 @@ export var fetchJson = /*#__PURE__*/function () {
204
205
  }
205
206
  }
206
207
  return _context4.abrupt("return", json);
207
- case 17:
208
- _context4.next = 22;
208
+ case 5:
209
+ _context4.next = 7;
209
210
  break;
210
- case 19:
211
- _context4.prev = 19;
212
- _context4.t0 = _context4["catch"](3);
211
+ case 6:
212
+ _context4.prev = 6;
213
+ _t = _context4["catch"](1);
213
214
  return _context4.abrupt("return", {
214
215
  returnCode: 10000,
215
216
  returnMsg: '无法请求资源'
216
217
  });
217
- case 22:
218
+ case 7:
218
219
  case "end":
219
220
  return _context4.stop();
220
221
  }
221
- }, _callee, null, [[3, 19]]);
222
+ }, _callee, null, [[1, 6]]);
222
223
  }));
223
224
  return function fetchJson(_x, _x2) {
224
225
  return _ref.apply(this, arguments);
package/lib/Area/Area.js CHANGED
@@ -24,10 +24,9 @@ var _typeof2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/ty
24
24
  var _icon = _interopRequireDefault(require("antd/lib/icon"));
25
25
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/classCallCheck"));
26
26
  var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/createClass"));
27
- var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/assertThisInitialized"));
28
- var _inherits2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/inherits"));
29
27
  var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/possibleConstructorReturn"));
30
28
  var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/getPrototypeOf"));
29
+ var _inherits2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/inherits"));
31
30
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/defineProperty"));
32
31
  var _button = _interopRequireDefault(require("antd/lib/button"));
33
32
  var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/extends"));
@@ -39,8 +38,8 @@ var _Control = _interopRequireDefault(require("../Control"));
39
38
  var _excluded = ["type", "children"];
40
39
  function ownKeys(e, r) { var t = _Object$keys2(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = _filterInstanceProperty(o).call(o, function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
41
40
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context5, _context6; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context5 = ownKeys(Object(t), !0)).call(_context5, function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context6 = ownKeys(Object(t))).call(_context6, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
42
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = _Reflect$construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
43
- 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; } }
41
+ function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2["default"])(o), (0, _possibleConstructorReturn2["default"])(t, _isNativeReflectConstruct() ? _Reflect$construct(o, e || [], (0, _getPrototypeOf2["default"])(t).constructor) : o.apply(t, e)); }
42
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
44
43
  var defaultSize = 'small';
45
44
  var PROPS = {
46
45
  value: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].number, _propTypes["default"].object]),
@@ -62,13 +61,11 @@ var ButtonEx = function ButtonEx(_ref) {
62
61
  };
63
62
  var PROPS_KEYS = (0, _keys["default"])(PROPS);
64
63
  var Area = /*#__PURE__*/function (_React$Component) {
65
- (0, _inherits2["default"])(Area, _React$Component);
66
- var _super = _createSuper(Area);
67
64
  function Area(_props) {
68
65
  var _this;
69
66
  (0, _classCallCheck2["default"])(this, Area);
70
- _this = _super.call(this, _props);
71
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onChange", function (key, keyValue) {
67
+ _this = _callSuper(this, Area, [_props]);
68
+ (0, _defineProperty2["default"])(_this, "onChange", function (key, keyValue) {
72
69
  var _this$props = _this.props,
73
70
  onParentChange = _this$props.onParentChange,
74
71
  child = _this$props.child,
@@ -90,7 +87,7 @@ var Area = /*#__PURE__*/function (_React$Component) {
90
87
  return onParentChange && onParentChange(_this.state.value);
91
88
  });
92
89
  });
93
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onSearch", function (key, control, parentKey, KeyValue) {
90
+ (0, _defineProperty2["default"])(_this, "onSearch", function (key, control, parentKey, KeyValue) {
94
91
  var _this$props2 = _this.props,
95
92
  onAreaSearch = _this$props2.onAreaSearch,
96
93
  child = _this$props2.child,
@@ -108,7 +105,7 @@ var Area = /*#__PURE__*/function (_React$Component) {
108
105
  });
109
106
  return flag ? onAreaSearch && onAreaSearch(key, KeyValue, parentKey) : _helper["default"].showError('请输入上级选择器');
110
107
  });
111
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "toControl", function (item, props) {
108
+ (0, _defineProperty2["default"])(_this, "toControl", function (item, props) {
112
109
  if (item.type === 'button') {
113
110
  var key = item.key,
114
111
  title = item.title,
@@ -135,7 +132,7 @@ var Area = /*#__PURE__*/function (_React$Component) {
135
132
  return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
136
133
  }
137
134
  });
138
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onClick", function (e) {
135
+ (0, _defineProperty2["default"])(_this, "onClick", function (e) {
139
136
  var onClick = _this.props.onClick;
140
137
  var key = (0, _typeof2["default"])(e) === 'object' ? e.key : e;
141
138
  onClick && onClick(key);
@@ -146,7 +143,8 @@ var Area = /*#__PURE__*/function (_React$Component) {
146
143
  };
147
144
  return _this;
148
145
  }
149
- (0, _createClass2["default"])(Area, [{
146
+ (0, _inherits2["default"])(Area, _React$Component);
147
+ return (0, _createClass2["default"])(Area, [{
150
148
  key: "componentWillReceiveProps",
151
149
  value: function componentWillReceiveProps(props) {
152
150
  if (props.value !== this.props.value) {
@@ -202,6 +200,5 @@ var Area = /*#__PURE__*/function (_React$Component) {
202
200
  }));
203
201
  }
204
202
  }]);
205
- return Area;
206
203
  }(_react["default"].Component);
207
204
  var _default = exports["default"] = Area;