cloud-b2b 1.1.61 → 1.1.63

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 (80) hide show
  1. package/es/Area/Area.js +8 -11
  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 +19 -22
  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 +85 -88
  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 +95 -100
  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 +68 -71
  31. package/es/SuperTable2/SuperTable2.js +90 -88
  32. package/es/SuperTable2/SuperTableCell.js +27 -30
  33. package/es/SuperTable3/FilterDropDown.js +11 -14
  34. package/es/SuperTable3/SuperTable.js +58 -61
  35. package/es/SuperToolbar/SuperToolbar.js +11 -14
  36. package/es/SuperUpload/SuperUpload.js +107 -91
  37. package/es/Viewer/ImageViews.js +16 -19
  38. package/es/Viewer/Viewer.js +11 -14
  39. package/es/helper.js +18 -17
  40. package/lib/Area/Area.js +8 -11
  41. package/lib/CodeInput/CodeInput.js +16 -19
  42. package/lib/Enhance/Dialogs.js +11 -14
  43. package/lib/Enhance/Loading.js +15 -18
  44. package/lib/Header/Header.js +17 -20
  45. package/lib/Header/Vertical.js +11 -14
  46. package/lib/ImageView/ImageView.js +10 -13
  47. package/lib/InpurCascader/InputCascader.js +11 -14
  48. package/lib/InputEditor/InputEditor.js +16 -18
  49. package/lib/InputSearch/InputSearch.js +19 -22
  50. package/lib/InputSelect/InputSelect.js +14 -17
  51. package/lib/InputTreeSelect/InputTreeSelect.js +10 -13
  52. package/lib/InputWriting/InputWriting.js +12 -15
  53. package/lib/Layout/Layout.js +14 -17
  54. package/lib/LayoutLink/LayoutLink.js +1 -2
  55. package/lib/Link/Link.js +7 -10
  56. package/lib/NumberInput/NumberInput.js +13 -16
  57. package/lib/Search/Search.js +53 -57
  58. package/lib/Search2/Search.js +86 -90
  59. package/lib/Search2/Search.less +64 -64
  60. package/lib/Search2/package.json +6 -6
  61. package/lib/Sidebar/Sidebar.js +11 -14
  62. package/lib/Sidebar2/Sidebar.js +13 -16
  63. package/lib/SuperForm/SuperForm.js +75 -81
  64. package/lib/SuperForm2/SuperForm.js +96 -102
  65. package/lib/SuperPagination/SuperPagination.js +8 -11
  66. package/lib/SuperTab/SuperTab.js +12 -15
  67. package/lib/SuperTab2/SuperTab2.js +13 -16
  68. package/lib/SuperTable/DragSortRow.js +12 -15
  69. package/lib/SuperTable/FilterDropDown.js +11 -14
  70. package/lib/SuperTable/SuperTable.js +68 -71
  71. package/lib/SuperTable2/SuperTable2.js +91 -90
  72. package/lib/SuperTable2/SuperTableCell.js +27 -30
  73. package/lib/SuperTable3/FilterDropDown.js +11 -14
  74. package/lib/SuperTable3/SuperTable.js +58 -61
  75. package/lib/SuperToolbar/SuperToolbar.js +11 -14
  76. package/lib/SuperUpload/SuperUpload.js +96 -81
  77. package/lib/Viewer/ImageViews.js +16 -19
  78. package/lib/Viewer/Viewer.js +11 -14
  79. package/lib/helper.js +18 -17
  80. 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";
@@ -18,8 +17,8 @@ import _setTimeout from "@babel/runtime-corejs3/core-js-stable/set-timeout";
18
17
  import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
19
18
  import _bindInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/bind";
20
19
  import _Reflect$construct from "@babel/runtime-corejs3/core-js-stable/reflect/construct";
21
- 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); }; }
22
- 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; } }
20
+ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? _Reflect$construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
21
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
23
22
  import React from 'react';
24
23
  import PropTypes from 'prop-types';
25
24
  import variables from '../variables';
@@ -68,8 +67,6 @@ var ButtonEx = function ButtonEx(_ref) {
68
67
  * onSubClick: 按钮为下拉时下拉项子列表项点击时触发,原型为function(key, subKey)
69
68
  */
70
69
  var SuperToolbar = /*#__PURE__*/function (_React$Component) {
71
- _inherits(SuperToolbar, _React$Component);
72
- var _super = _createSuper(SuperToolbar);
73
70
  function SuperToolbar() {
74
71
  var _context;
75
72
  var _this;
@@ -77,8 +74,8 @@ var SuperToolbar = /*#__PURE__*/function (_React$Component) {
77
74
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
78
75
  args[_key] = arguments[_key];
79
76
  }
80
- _this = _super.call.apply(_super, _concatInstanceProperty(_context = [this]).call(_context, args));
81
- _defineProperty(_assertThisInitialized(_this), "onClick", function (e) {
77
+ _this = _callSuper(this, SuperToolbar, _concatInstanceProperty(_context = []).call(_context, args));
78
+ _defineProperty(_this, "onClick", function (e) {
82
79
  var _this$props = _this.props,
83
80
  onClick = _this$props.onClick,
84
81
  onSubClick = _this$props.onSubClick;
@@ -98,7 +95,7 @@ var SuperToolbar = /*#__PURE__*/function (_React$Component) {
98
95
  }
99
96
  }
100
97
  });
101
- _defineProperty(_assertThisInitialized(_this), "toSubMenu", function (_ref2) {
98
+ _defineProperty(_this, "toSubMenu", function (_ref2) {
102
99
  var key = _ref2.key,
103
100
  title = _ref2.title,
104
101
  _ref2$subMenu = _ref2.subMenu,
@@ -114,7 +111,7 @@ var SuperToolbar = /*#__PURE__*/function (_React$Component) {
114
111
  }, title);
115
112
  }));
116
113
  });
117
- _defineProperty(_assertThisInitialized(_this), "toMenu", function (menu) {
114
+ _defineProperty(_this, "toMenu", function (menu) {
118
115
  return /*#__PURE__*/React.createElement(_Menu, {
119
116
  onClick: _this.onClick
120
117
  }, _mapInstanceProperty(menu).call(menu, function (item) {
@@ -130,7 +127,7 @@ var SuperToolbar = /*#__PURE__*/function (_React$Component) {
130
127
  }
131
128
  }));
132
129
  });
133
- _defineProperty(_assertThisInitialized(_this), "toButton", function (_ref4) {
130
+ _defineProperty(_this, "toButton", function (_ref4) {
134
131
  var _context2;
135
132
  var key = _ref4.key,
136
133
  title = _ref4.title,
@@ -138,7 +135,7 @@ var SuperToolbar = /*#__PURE__*/function (_React$Component) {
138
135
  confirm = _ref4.confirm,
139
136
  menu = _ref4.menu,
140
137
  loading = _ref4.loading;
141
- var onClick = _bindInstanceProperty(_context2 = _this.onClick).call(_context2, _assertThisInitialized(_this), key);
138
+ var onClick = _bindInstanceProperty(_context2 = _this.onClick).call(_context2, _this, key);
142
139
  var _this$props$size = _this.props.size,
143
140
  size = _this$props$size === void 0 ? 'small' : _this$props$size;
144
141
  if (menu && menu.length) {
@@ -174,7 +171,8 @@ var SuperToolbar = /*#__PURE__*/function (_React$Component) {
174
171
  });
175
172
  return _this;
176
173
  }
177
- _createClass(SuperToolbar, [{
174
+ _inherits(SuperToolbar, _React$Component);
175
+ return _createClass(SuperToolbar, [{
178
176
  key: "render",
179
177
  value: function render() {
180
178
  var buttons = this.props.buttons;
@@ -184,7 +182,6 @@ var SuperToolbar = /*#__PURE__*/function (_React$Component) {
184
182
  }, _mapInstanceProperty(buttons).call(buttons, this.toButton));
185
183
  }
186
184
  }]);
187
- return SuperToolbar;
188
185
  }(React.Component);
189
186
  _defineProperty(SuperToolbar, "propTypes", {
190
187
  buttons: PropTypes.arrayOf(PropTypes.shape(ButtonType)).isRequired,
@@ -1,18 +1,3 @@
1
- import _Upload from "antd/es/upload";
2
- import _slicedToArray from "@babel/runtime-corejs3/helpers/slicedToArray";
3
- import _Button from "antd/es/button";
4
- import _Icon from "antd/es/icon";
5
- import _asyncToGenerator from "@babel/runtime-corejs3/helpers/asyncToGenerator";
6
- import _defineProperty from "@babel/runtime-corejs3/helpers/defineProperty";
7
- 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; } } }; }
8
- 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); }
9
- 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; }
10
- import _regeneratorRuntime from "@babel/runtime-corejs3/regenerator";
11
- 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; }
12
- 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; }
13
- import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
14
- import _filterInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/filter";
15
- import _indexOfInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/index-of";
16
1
  import _Object$keys from "@babel/runtime-corejs3/core-js-stable/object/keys";
17
2
  import _Object$getOwnPropertySymbols from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols";
18
3
  import _Object$getOwnPropertyDescriptor from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor";
@@ -25,12 +10,28 @@ import _Array$from from "@babel/runtime-corejs3/core-js-stable/array/from";
25
10
  import _Symbol from "@babel/runtime-corejs3/core-js-stable/symbol";
26
11
  import _getIteratorMethod from "@babel/runtime-corejs3/core-js/get-iterator-method";
27
12
  import _Array$isArray from "@babel/runtime-corejs3/core-js-stable/array/is-array";
13
+ import _Upload from "antd/es/upload";
14
+ import _slicedToArray from "@babel/runtime-corejs3/helpers/slicedToArray";
15
+ import _Button from "antd/es/button";
16
+ import _Icon from "antd/es/icon";
17
+ import _asyncToGenerator from "@babel/runtime-corejs3/helpers/asyncToGenerator";
18
+ import _defineProperty from "@babel/runtime-corejs3/helpers/defineProperty";
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
+ import _regeneratorRuntime from "@babel/runtime-corejs3/regenerator";
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
+ 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; }
25
+ import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
26
+ import _filterInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/filter";
27
+ import _indexOfInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/index-of";
28
+ import _includesInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/includes";
28
29
  import React, { useState, useEffect } from 'react';
29
30
  import PropTypes from 'prop-types';
30
31
  import helper from '../helper';
31
32
  import Title from '../Title';
32
33
  import variables from '../variables';
33
- var FORMATS = ['image/jpeg', 'image/gif', 'image/bmp', 'image/jpg', 'image/png', 'image/tiff', 'image/gif', 'image/pcx', 'image/tga', 'image/exif', 'image/fpx', 'image/svg', 'image/psd', 'image/cdr', 'image/pcd', 'image/dxf', 'image/ufo', 'image/eps', 'image/ai', 'image/raw', 'image/WMF', 'video/mp4'];
34
+ var FORMATS = ['image/jpeg', 'image/gif', 'image/bmp', 'image/jpg', 'image/png', 'image/tiff', 'image/gif', 'image/pcx', 'image/tga', 'image/exif', 'image/fpx', 'image/svg', 'image/psd', 'image/cdr', 'image/pcd', 'image/dxf', 'image/ufo', 'image/eps', 'image/ai', 'image/raw', 'image/WMF'];
34
35
  var FORMATS1 = ['.jpeg', '.gif', '.bmp', '.jpg', '.png', '.tiff', '.pcx', '.tga', '.exif', '.fpx', '.svg', '.psd', '.cdr', '.pcd', '.dxf', '.ufo', '.eps', '.ai', '.raw', '.WMF'];
35
36
 
36
37
  //组件属性定义
@@ -43,7 +44,7 @@ var propTypes = {
43
44
  //附件组的标题
44
45
  required: PropTypes.bool,
45
46
  //是否必须上传,默认false
46
- listType: PropTypes.oneOf[('text', 'picture', 'picture-card')],
47
+ listType: PropTypes.oneOf['text', 'picture', 'picture-card'],
47
48
  //上传列表的内建样式,支持三种,默认picture-card
48
49
  readonly: PropTypes.bool,
49
50
  //所在页面是否只读,默认false
@@ -79,7 +80,8 @@ var getUploadProps = function getUploadProps(props, onPreview, fileList, setFile
79
80
  listType = _props$listType === void 0 ? 'picture-card' : _props$listType,
80
81
  _props$fileDeleteList = props.fileDeleteList,
81
82
  fileDeleteList = _props$fileDeleteList === void 0 ? [] : _props$fileDeleteList,
82
- onFileChange = props.onFileChange;
83
+ onFileChange = props.onFileChange,
84
+ accept = props.accept;
83
85
  var onChange = function onChange(_ref) {
84
86
  var file = _ref.file,
85
87
  fileList = _ref.fileList;
@@ -111,8 +113,8 @@ var getUploadProps = function getUploadProps(props, onPreview, fileList, setFile
111
113
  setFileList(newList);
112
114
  };
113
115
  var onRemove = /*#__PURE__*/function () {
114
- var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(fileRemove) {
115
- return _regeneratorRuntime.wrap(function _callee$(_context2) {
116
+ var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(fileRemove) {
117
+ return _regeneratorRuntime.wrap(function (_context2) {
116
118
  while (1) switch (_context2.prev = _context2.next) {
117
119
  case 0:
118
120
  props.onRemove && props.onRemove(fileRemove, fileList, fileDeleteList);
@@ -126,19 +128,33 @@ var getUploadProps = function getUploadProps(props, onPreview, fileList, setFile
126
128
  return _ref2.apply(this, arguments);
127
129
  };
128
130
  }();
129
- return {
131
+ var other = {};
132
+ if (accept) {
133
+ other = {
134
+ accept: accept
135
+ };
136
+ }
137
+ return _objectSpread(_objectSpread({
130
138
  action: props.action || '/api/proxy/zuul/archiver-service/file/upload/document',
131
139
  fileList: fileList,
132
140
  listType: listType,
133
141
  multiple: multiple,
134
142
  onChange: onChange,
135
- onRemove: onRemove,
143
+ onRemove: onRemove
144
+ }, other), {}, {
136
145
  onPreview: listType === 'text' ? undefined : onPreview,
137
146
  beforeUpload: function beforeUpload(currentFile) {
138
147
  var isLt = currentFile.size / 1024 / 1024 < limitSize; // 附件大小限制,单位M
139
148
  if (!isLt) {
140
149
  helper.showError("\u9644\u4EF6\u5927\u5C0F\u4E0D\u80FD\u8D85\u8FC7".concat(limitSize, "M"));
141
150
  }
151
+ if (accept) {
152
+ var ext = currentFile.name.split('.').pop().toLowerCase();
153
+ if (!_includesInstanceProperty(accept).call(accept, ext)) {
154
+ helper.showError("\u4E0A\u4F20\u7684\u6587\u4EF6\u6269\u5C55\u6587\u53EA\u80FD\u4E3A".concat(accept));
155
+ return false;
156
+ }
157
+ }
142
158
  return isLt;
143
159
  },
144
160
  showUploadList: {
@@ -146,7 +162,7 @@ var getUploadProps = function getUploadProps(props, onPreview, fileList, setFile
146
162
  showRemoveIcon: !readonly,
147
163
  showDownloadIcon: true
148
164
  }
149
- };
165
+ });
150
166
  };
151
167
  function UploadButton(_ref3) {
152
168
  var _ref3$buttonLabel = _ref3.buttonLabel,
@@ -200,128 +216,128 @@ function SuperUpload(props) {
200
216
  return _fetchImgData.apply(this, arguments);
201
217
  }
202
218
  function _fetchImgData() {
203
- _fetchImgData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
204
- var _iterator, _step, item, _iterator2, _step2, _item;
205
- return _regeneratorRuntime.wrap(function _callee2$(_context3) {
219
+ _fetchImgData = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
220
+ var _iterator, _step, item, _iterator2, _step2, _item, _t, _t2, _t3, _t4, _t5;
221
+ return _regeneratorRuntime.wrap(function (_context3) {
206
222
  while (1) switch (_context3.prev = _context3.next) {
207
223
  case 0:
208
224
  if (!(props.fileList.length > 0 || fileList.length > 0)) {
209
- _context3.next = 58;
225
+ _context3.next = 24;
210
226
  break;
211
227
  }
212
228
  _iterator = _createForOfIteratorHelper(props.fileList);
213
- _context3.prev = 2;
229
+ _context3.prev = 1;
214
230
  _iterator.s();
215
- case 4:
231
+ case 2:
216
232
  if ((_step = _iterator.n()).done) {
217
- _context3.next = 27;
233
+ _context3.next = 11;
218
234
  break;
219
235
  }
220
236
  item = _step.value;
221
237
  if (!(item.fileUrl == '')) {
222
- _context3.next = 17;
238
+ _context3.next = 6;
223
239
  break;
224
240
  }
225
241
  if (!props.getFileList) {
226
- _context3.next = 13;
242
+ _context3.next = 4;
227
243
  break;
228
244
  }
229
- _context3.next = 10;
245
+ _context3.next = 3;
230
246
  return props.getFileList(fileList);
231
- case 10:
232
- _context3.t0 = _context3.sent;
233
- _context3.next = 14;
247
+ case 3:
248
+ _t = _context3.sent;
249
+ _context3.next = 5;
234
250
  break;
235
- case 13:
236
- _context3.t0 = [];
237
- case 14:
238
- initFileList = _context3.t0;
239
- _context3.next = 25;
251
+ case 4:
252
+ _t = [];
253
+ case 5:
254
+ initFileList = _t;
255
+ _context3.next = 10;
240
256
  break;
241
- case 17:
257
+ case 6:
242
258
  if (!props.getFileList) {
243
- _context3.next = 23;
259
+ _context3.next = 8;
244
260
  break;
245
261
  }
246
- _context3.next = 20;
262
+ _context3.next = 7;
247
263
  return props.getFileList(props.fileList);
248
- case 20:
249
- _context3.t1 = _context3.sent;
250
- _context3.next = 24;
264
+ case 7:
265
+ _t2 = _context3.sent;
266
+ _context3.next = 9;
251
267
  break;
252
- case 23:
253
- _context3.t1 = [];
254
- case 24:
255
- initFileList = _context3.t1;
256
- case 25:
257
- _context3.next = 4;
268
+ case 8:
269
+ _t2 = [];
270
+ case 9:
271
+ initFileList = _t2;
272
+ case 10:
273
+ _context3.next = 2;
258
274
  break;
259
- case 27:
260
- _context3.next = 32;
275
+ case 11:
276
+ _context3.next = 13;
261
277
  break;
262
- case 29:
263
- _context3.prev = 29;
264
- _context3.t2 = _context3["catch"](2);
265
- _iterator.e(_context3.t2);
266
- case 32:
267
- _context3.prev = 32;
278
+ case 12:
279
+ _context3.prev = 12;
280
+ _t3 = _context3["catch"](1);
281
+ _iterator.e(_t3);
282
+ case 13:
283
+ _context3.prev = 13;
268
284
  _iterator.f();
269
- return _context3.finish(32);
270
- case 35:
285
+ return _context3.finish(13);
286
+ case 14:
271
287
  _iterator2 = _createForOfIteratorHelper(fileList);
272
- _context3.prev = 36;
288
+ _context3.prev = 15;
273
289
  _iterator2.s();
274
- case 38:
290
+ case 16:
275
291
  if ((_step2 = _iterator2.n()).done) {
276
- _context3.next = 50;
292
+ _context3.next = 21;
277
293
  break;
278
294
  }
279
295
  _item = _step2.value;
280
296
  if (!props.getFileList) {
281
- _context3.next = 46;
297
+ _context3.next = 18;
282
298
  break;
283
299
  }
284
- _context3.next = 43;
300
+ _context3.next = 17;
285
301
  return props.getFileList(fileList);
286
- case 43:
287
- _context3.t3 = _context3.sent;
288
- _context3.next = 47;
302
+ case 17:
303
+ _t4 = _context3.sent;
304
+ _context3.next = 19;
289
305
  break;
290
- case 46:
291
- _context3.t3 = [];
292
- case 47:
293
- initFileList = _context3.t3;
294
- case 48:
295
- _context3.next = 38;
306
+ case 18:
307
+ _t4 = [];
308
+ case 19:
309
+ initFileList = _t4;
310
+ case 20:
311
+ _context3.next = 16;
296
312
  break;
297
- case 50:
298
- _context3.next = 55;
313
+ case 21:
314
+ _context3.next = 23;
299
315
  break;
300
- case 52:
301
- _context3.prev = 52;
302
- _context3.t4 = _context3["catch"](36);
303
- _iterator2.e(_context3.t4);
304
- case 55:
305
- _context3.prev = 55;
316
+ case 22:
317
+ _context3.prev = 22;
318
+ _t5 = _context3["catch"](15);
319
+ _iterator2.e(_t5);
320
+ case 23:
321
+ _context3.prev = 23;
306
322
  _iterator2.f();
307
- return _context3.finish(55);
308
- case 58:
323
+ return _context3.finish(23);
324
+ case 24:
309
325
  //const initFileList = props.getFileList ? await props.getFileList(props.fileList) : [];
310
326
  setFileList(initFileList ? initFileList : []);
311
327
  setLoading(false);
312
- case 60:
328
+ case 25:
313
329
  case "end":
314
330
  return _context3.stop();
315
331
  }
316
- }, _callee2, null, [[2, 29, 32, 35], [36, 52, 55, 58]]);
332
+ }, _callee2, null, [[1, 12, 13, 14], [15, 22, 23, 24]]);
317
333
  }));
318
334
  return _fetchImgData.apply(this, arguments);
319
335
  }
320
336
  fetchImgData();
321
337
  }, [props.fileList]);
322
338
  var onPreview = /*#__PURE__*/function () {
323
- var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(file) {
324
- return _regeneratorRuntime.wrap(function _callee3$(_context4) {
339
+ var _ref4 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3(file) {
340
+ return _regeneratorRuntime.wrap(function (_context4) {
325
341
  while (1) switch (_context4.prev = _context4.next) {
326
342
  case 0:
327
343
  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是否可见 */