cloud-b2b 1.1.80 → 1.1.82
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/Area/Area.js +16 -11
- package/es/CodeInput/CodeInput.js +19 -16
- package/es/Control/Control.js +4 -1
- package/es/Enhance/Dialogs.js +14 -11
- package/es/Enhance/Loading.js +18 -15
- package/es/Header/Header.js +20 -17
- package/es/Header/Vertical.js +14 -11
- package/es/ImageView/ImageView.js +13 -10
- package/es/InpurCascader/InputCascader.js +14 -11
- package/es/InputEditor/InputEditor.js +18 -16
- package/es/InputSearch/InputSearch.js +23 -20
- package/es/InputSelect/InputSelect.js +17 -14
- package/es/InputTreeSelect/InputTreeSelect.js +13 -10
- package/es/InputWriting/InputWriting.js +15 -12
- package/es/Layout/Layout.js +17 -14
- package/es/Link/Link.js +10 -7
- package/es/NumberInput/NumberInput.js +16 -13
- package/es/Search/Search.js +55 -52
- package/es/Search2/Search.js +86 -83
- package/es/Search2/Search.less +64 -64
- package/es/Search2/package.json +6 -6
- package/es/Sidebar/Sidebar.js +14 -11
- package/es/Sidebar2/Sidebar.js +16 -13
- package/es/SuperForm/SuperForm.js +79 -74
- package/es/SuperForm2/SuperForm.js +114 -108
- package/es/SuperPagination/SuperPagination.js +11 -8
- package/es/SuperTab/SuperTab.js +15 -12
- package/es/SuperTab2/SuperTab2.js +16 -13
- package/es/SuperTable/DragSortRow.js +15 -12
- package/es/SuperTable/FilterDropDown.js +14 -11
- package/es/SuperTable/SuperTable.js +73 -70
- package/es/SuperTable2/SuperTable2.js +92 -89
- package/es/SuperTable2/SuperTableCell.js +30 -27
- package/es/SuperTable3/FilterDropDown.js +14 -11
- package/es/SuperTable3/SuperTable.js +61 -58
- package/es/SuperToolbar/SuperToolbar.js +15 -12
- package/es/SuperUpload/SuperUpload.js +38 -38
- package/es/Viewer/ImageViews.js +19 -16
- package/es/Viewer/Viewer.js +14 -11
- package/es/helper.js +17 -18
- package/lib/Area/Area.js +16 -11
- package/lib/CodeInput/CodeInput.js +19 -16
- package/lib/Control/Control.js +4 -1
- package/lib/Enhance/Dialogs.js +14 -11
- package/lib/Enhance/Loading.js +18 -15
- package/lib/Header/Header.js +20 -17
- package/lib/Header/Vertical.js +14 -11
- package/lib/ImageView/ImageView.js +13 -10
- package/lib/InpurCascader/InputCascader.js +14 -11
- package/lib/InputEditor/InputEditor.js +18 -16
- package/lib/InputSearch/InputSearch.js +23 -20
- package/lib/InputSelect/InputSelect.js +17 -14
- package/lib/InputTreeSelect/InputTreeSelect.js +13 -10
- package/lib/InputWriting/InputWriting.js +15 -12
- package/lib/Layout/Layout.js +17 -14
- package/lib/LayoutLink/LayoutLink.js +2 -1
- package/lib/Link/Link.js +10 -7
- package/lib/NumberInput/NumberInput.js +16 -13
- package/lib/Search/Search.js +57 -53
- package/lib/Search2/Search.js +88 -84
- package/lib/Search2/Search.less +64 -64
- package/lib/Search2/package.json +6 -6
- package/lib/Sidebar/Sidebar.js +14 -11
- package/lib/Sidebar2/Sidebar.js +16 -13
- package/lib/SuperForm/SuperForm.js +81 -75
- package/lib/SuperForm2/SuperForm.js +116 -109
- package/lib/SuperPagination/SuperPagination.js +11 -8
- package/lib/SuperTab/SuperTab.js +15 -12
- package/lib/SuperTab2/SuperTab2.js +16 -13
- package/lib/SuperTable/DragSortRow.js +15 -12
- package/lib/SuperTable/FilterDropDown.js +14 -11
- package/lib/SuperTable/SuperTable.js +73 -70
- package/lib/SuperTable2/SuperTable2.js +94 -90
- package/lib/SuperTable2/SuperTableCell.js +30 -27
- package/lib/SuperTable3/FilterDropDown.js +14 -11
- package/lib/SuperTable3/SuperTable.js +61 -58
- package/lib/SuperToolbar/SuperToolbar.js +15 -12
- package/lib/SuperUpload/SuperUpload.js +40 -39
- package/lib/Viewer/ImageViews.js +19 -16
- package/lib/Viewer/Viewer.js +14 -11
- package/lib/helper.js +17 -18
- package/package.json +1 -1
|
@@ -4,9 +4,10 @@ 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";
|
|
7
9
|
import _possibleConstructorReturn from "@babel/runtime-corejs3/helpers/possibleConstructorReturn";
|
|
8
10
|
import _getPrototypeOf from "@babel/runtime-corejs3/helpers/getPrototypeOf";
|
|
9
|
-
import _inherits from "@babel/runtime-corejs3/helpers/inherits";
|
|
10
11
|
import _defineProperty from "@babel/runtime-corejs3/helpers/defineProperty";
|
|
11
12
|
import _Button from "antd/es/button";
|
|
12
13
|
import _objectWithoutProperties from "@babel/runtime-corejs3/helpers/objectWithoutProperties";
|
|
@@ -27,8 +28,8 @@ import _forEachInstanceProperty from "@babel/runtime-corejs3/core-js-stable/inst
|
|
|
27
28
|
import _Object$getOwnPropertyDescriptors from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors";
|
|
28
29
|
import _Object$defineProperties from "@babel/runtime-corejs3/core-js-stable/object/define-properties";
|
|
29
30
|
import _Object$defineProperty from "@babel/runtime-corejs3/core-js-stable/object/define-property";
|
|
30
|
-
function
|
|
31
|
-
function _isNativeReflectConstruct() {
|
|
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; } }
|
|
32
33
|
import React from 'react';
|
|
33
34
|
import PropTypes from 'prop-types';
|
|
34
35
|
import variables from '../variables';
|
|
@@ -78,6 +79,8 @@ var ButtonEx = function ButtonEx(_ref) {
|
|
|
78
79
|
* onSubClick: 按钮为下拉时下拉项子列表项点击时触发,原型为function(key, subKey)
|
|
79
80
|
*/
|
|
80
81
|
var SuperToolbar = /*#__PURE__*/function (_React$Component) {
|
|
82
|
+
_inherits(SuperToolbar, _React$Component);
|
|
83
|
+
var _super = _createSuper(SuperToolbar);
|
|
81
84
|
function SuperToolbar() {
|
|
82
85
|
var _context;
|
|
83
86
|
var _this;
|
|
@@ -85,8 +88,8 @@ var SuperToolbar = /*#__PURE__*/function (_React$Component) {
|
|
|
85
88
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
86
89
|
args[_key] = arguments[_key];
|
|
87
90
|
}
|
|
88
|
-
_this =
|
|
89
|
-
_defineProperty(_this, "onClick", function (e) {
|
|
91
|
+
_this = _super.call.apply(_super, _concatInstanceProperty(_context = [this]).call(_context, args));
|
|
92
|
+
_defineProperty(_assertThisInitialized(_this), "onClick", function (e) {
|
|
90
93
|
var _this$props = _this.props,
|
|
91
94
|
onClick = _this$props.onClick,
|
|
92
95
|
onSubClick = _this$props.onSubClick;
|
|
@@ -106,12 +109,12 @@ var SuperToolbar = /*#__PURE__*/function (_React$Component) {
|
|
|
106
109
|
}
|
|
107
110
|
}
|
|
108
111
|
});
|
|
109
|
-
_defineProperty(_this, "onFileChange", function (_ref2, file) {
|
|
112
|
+
_defineProperty(_assertThisInitialized(_this), "onFileChange", function (_ref2, file) {
|
|
110
113
|
var key = _ref2.key;
|
|
111
114
|
var onFileChange = _this.props.onFileChange;
|
|
112
115
|
onFileChange && onFileChange(key, file);
|
|
113
116
|
});
|
|
114
|
-
_defineProperty(_this, "toSubMenu", function (_ref3) {
|
|
117
|
+
_defineProperty(_assertThisInitialized(_this), "toSubMenu", function (_ref3) {
|
|
115
118
|
var key = _ref3.key,
|
|
116
119
|
title = _ref3.title,
|
|
117
120
|
_ref3$subMenu = _ref3.subMenu,
|
|
@@ -127,7 +130,7 @@ var SuperToolbar = /*#__PURE__*/function (_React$Component) {
|
|
|
127
130
|
}, title);
|
|
128
131
|
}));
|
|
129
132
|
});
|
|
130
|
-
_defineProperty(_this, "toMenu", function (menu) {
|
|
133
|
+
_defineProperty(_assertThisInitialized(_this), "toMenu", function (menu) {
|
|
131
134
|
return /*#__PURE__*/React.createElement(_Menu, {
|
|
132
135
|
onClick: _this.onClick
|
|
133
136
|
}, _mapInstanceProperty(menu).call(menu, function (item) {
|
|
@@ -143,7 +146,7 @@ var SuperToolbar = /*#__PURE__*/function (_React$Component) {
|
|
|
143
146
|
}
|
|
144
147
|
}));
|
|
145
148
|
});
|
|
146
|
-
_defineProperty(_this, "toButton", function (control) {
|
|
149
|
+
_defineProperty(_assertThisInitialized(_this), "toButton", function (control) {
|
|
147
150
|
var _context2;
|
|
148
151
|
var _this$props2 = _this.props,
|
|
149
152
|
_this$props2$size = _this$props2.size,
|
|
@@ -159,7 +162,7 @@ var SuperToolbar = /*#__PURE__*/function (_React$Component) {
|
|
|
159
162
|
loading = control.loading,
|
|
160
163
|
_control$isUpload = control.isUpload,
|
|
161
164
|
isUpload = _control$isUpload === void 0 ? false : _control$isUpload;
|
|
162
|
-
var onClick = _bindInstanceProperty(_context2 = _this.onClick).call(_context2, _this, key);
|
|
165
|
+
var onClick = _bindInstanceProperty(_context2 = _this.onClick).call(_context2, _assertThisInitialized(_this), key);
|
|
163
166
|
if (menu && menu.length) {
|
|
164
167
|
return /*#__PURE__*/React.createElement(_Dropdown, {
|
|
165
168
|
key: key,
|
|
@@ -210,8 +213,7 @@ var SuperToolbar = /*#__PURE__*/function (_React$Component) {
|
|
|
210
213
|
});
|
|
211
214
|
return _this;
|
|
212
215
|
}
|
|
213
|
-
|
|
214
|
-
return _createClass(SuperToolbar, [{
|
|
216
|
+
_createClass(SuperToolbar, [{
|
|
215
217
|
key: "render",
|
|
216
218
|
value: function render() {
|
|
217
219
|
var buttons = this.props.buttons;
|
|
@@ -221,6 +223,7 @@ var SuperToolbar = /*#__PURE__*/function (_React$Component) {
|
|
|
221
223
|
}, _mapInstanceProperty(buttons).call(buttons, this.toButton));
|
|
222
224
|
}
|
|
223
225
|
}]);
|
|
226
|
+
return SuperToolbar;
|
|
224
227
|
}(React.Component);
|
|
225
228
|
_defineProperty(SuperToolbar, "propTypes", {
|
|
226
229
|
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(
|
|
20
|
-
function _unsupportedIterableToArray(
|
|
21
|
-
function _arrayLikeToArray(
|
|
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; }
|
|
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 (_context2) {
|
|
119
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(fileRemove) {
|
|
120
|
+
return _regeneratorRuntime.wrap(function _callee$(_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 (_context3) {
|
|
222
|
+
_fetchImgData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
223
|
+
var initFileList, _iterator, _step, item;
|
|
224
|
+
return _regeneratorRuntime.wrap(function _callee2$(_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 =
|
|
229
|
+
_context3.next = 25;
|
|
230
230
|
break;
|
|
231
231
|
}
|
|
232
232
|
_iterator = _createForOfIteratorHelper(props.fileList);
|
|
233
|
-
_context3.prev =
|
|
233
|
+
_context3.prev = 3;
|
|
234
234
|
_iterator.s();
|
|
235
|
-
case
|
|
235
|
+
case 5:
|
|
236
236
|
if ((_step = _iterator.n()).done) {
|
|
237
|
-
_context3.next =
|
|
237
|
+
_context3.next = 17;
|
|
238
238
|
break;
|
|
239
239
|
}
|
|
240
240
|
item = _step.value;
|
|
241
241
|
if (!props.getFileList) {
|
|
242
|
-
_context3.next =
|
|
242
|
+
_context3.next = 13;
|
|
243
243
|
break;
|
|
244
244
|
}
|
|
245
|
-
_context3.next =
|
|
245
|
+
_context3.next = 10;
|
|
246
246
|
return props.getFileList(props.fileList);
|
|
247
|
-
case
|
|
248
|
-
|
|
249
|
-
_context3.next =
|
|
247
|
+
case 10:
|
|
248
|
+
_context3.t0 = _context3.sent;
|
|
249
|
+
_context3.next = 14;
|
|
250
250
|
break;
|
|
251
|
-
case
|
|
252
|
-
|
|
253
|
-
case
|
|
254
|
-
initFileList =
|
|
255
|
-
case
|
|
256
|
-
_context3.next =
|
|
251
|
+
case 13:
|
|
252
|
+
_context3.t0 = [];
|
|
253
|
+
case 14:
|
|
254
|
+
initFileList = _context3.t0;
|
|
255
|
+
case 15:
|
|
256
|
+
_context3.next = 5;
|
|
257
257
|
break;
|
|
258
|
-
case
|
|
259
|
-
_context3.next =
|
|
258
|
+
case 17:
|
|
259
|
+
_context3.next = 22;
|
|
260
260
|
break;
|
|
261
|
-
case
|
|
262
|
-
_context3.prev =
|
|
263
|
-
|
|
264
|
-
_iterator.e(
|
|
265
|
-
case
|
|
266
|
-
_context3.prev =
|
|
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;
|
|
267
267
|
_iterator.f();
|
|
268
|
-
return _context3.finish(
|
|
269
|
-
case
|
|
268
|
+
return _context3.finish(22);
|
|
269
|
+
case 25:
|
|
270
270
|
//const initFileList = props.getFileList ? await props.getFileList(props.fileList) : [];
|
|
271
271
|
setFileList(initFileList ? initFileList : []);
|
|
272
272
|
setLoading(false);
|
|
273
|
-
case
|
|
273
|
+
case 27:
|
|
274
274
|
case "end":
|
|
275
275
|
return _context3.stop();
|
|
276
276
|
}
|
|
277
|
-
}, _callee2, null, [[
|
|
277
|
+
}, _callee2, null, [[3, 19, 22, 25]]);
|
|
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 (_context4) {
|
|
284
|
+
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(file) {
|
|
285
|
+
return _regeneratorRuntime.wrap(function _callee3$(_context4) {
|
|
286
286
|
while (1) switch (_context4.prev = _context4.next) {
|
|
287
287
|
case 0:
|
|
288
288
|
props.onPreview && props.onPreview(file, fileList);
|
package/es/Viewer/ImageViews.js
CHANGED
|
@@ -2,15 +2,16 @@ 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";
|
|
5
7
|
import _possibleConstructorReturn from "@babel/runtime-corejs3/helpers/possibleConstructorReturn";
|
|
6
8
|
import _getPrototypeOf from "@babel/runtime-corejs3/helpers/getPrototypeOf";
|
|
7
|
-
import _inherits from "@babel/runtime-corejs3/helpers/inherits";
|
|
8
9
|
import _defineProperty from "@babel/runtime-corejs3/helpers/defineProperty";
|
|
9
10
|
import _slicedToArray from "@babel/runtime-corejs3/helpers/slicedToArray";
|
|
10
11
|
import _JSON$stringify from "@babel/runtime-corejs3/core-js-stable/json/stringify";
|
|
11
12
|
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
|
|
12
|
-
function
|
|
13
|
-
function _isNativeReflectConstruct() {
|
|
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; } }
|
|
14
15
|
import React from "react";
|
|
15
16
|
import variables from '../variables';
|
|
16
17
|
var addEvent = function addEvent(el, event, handler) {
|
|
@@ -47,11 +48,13 @@ var getRotateDeg = function getRotateDeg(target) {
|
|
|
47
48
|
return Math.round(Math.atan2(b, a) * (180 / Math.PI));
|
|
48
49
|
};
|
|
49
50
|
var ImageViews = /*#__PURE__*/function (_React$Component) {
|
|
51
|
+
_inherits(ImageViews, _React$Component);
|
|
52
|
+
var _super = _createSuper(ImageViews);
|
|
50
53
|
function ImageViews(props) {
|
|
51
54
|
var _this;
|
|
52
55
|
_classCallCheck(this, ImageViews);
|
|
53
|
-
_this =
|
|
54
|
-
_defineProperty(_this, "_onwheel", function (e) {
|
|
56
|
+
_this = _super.call(this, props);
|
|
57
|
+
_defineProperty(_assertThisInitialized(_this), "_onwheel", function (e) {
|
|
55
58
|
var zoom = _this.state.zoom;
|
|
56
59
|
/*事件兼容*/
|
|
57
60
|
var event = e || window.event;
|
|
@@ -73,7 +76,7 @@ var ImageViews = /*#__PURE__*/function (_React$Component) {
|
|
|
73
76
|
zoom: zoomVal
|
|
74
77
|
});
|
|
75
78
|
});
|
|
76
|
-
_defineProperty(_this, "_onMouseDown", function (e) {
|
|
79
|
+
_defineProperty(_assertThisInitialized(_this), "_onMouseDown", function (e) {
|
|
77
80
|
/*事件兼容*/
|
|
78
81
|
var event = e || window.event;
|
|
79
82
|
var imageDOM = _this.imgRef;
|
|
@@ -90,7 +93,7 @@ var ImageViews = /*#__PURE__*/function (_React$Component) {
|
|
|
90
93
|
addEvent(document, 'mousemove', _this._onMouseMove);
|
|
91
94
|
addEvent(document, 'mouseup', _this._onMouseUp);
|
|
92
95
|
});
|
|
93
|
-
_defineProperty(_this, "_onMouseMove", function (e) {
|
|
96
|
+
_defineProperty(_assertThisInitialized(_this), "_onMouseMove", function (e) {
|
|
94
97
|
var event = e || window.event;
|
|
95
98
|
var imageDOM = _this.imgRef;
|
|
96
99
|
var startTouch = _this.state.startTouch;
|
|
@@ -101,7 +104,7 @@ var ImageViews = /*#__PURE__*/function (_React$Component) {
|
|
|
101
104
|
imageDOM.style.left = "".concat(deltaX, "px");
|
|
102
105
|
imageDOM.style.top = "".concat(deltaY, "px");
|
|
103
106
|
});
|
|
104
|
-
_defineProperty(_this, "_onMouseUp", function () {
|
|
107
|
+
_defineProperty(_assertThisInitialized(_this), "_onMouseUp", function () {
|
|
105
108
|
var startTouch = _this.state.startTouch;
|
|
106
109
|
if (!startTouch.initiated) return;
|
|
107
110
|
var endTouch = JSON.parse(_JSON$stringify(startTouch));
|
|
@@ -112,7 +115,7 @@ var ImageViews = /*#__PURE__*/function (_React$Component) {
|
|
|
112
115
|
removeEvent(document, 'mousemove', _this._onMouseMove);
|
|
113
116
|
removeEvent(document, 'mouseup', _this._onMouseDown);
|
|
114
117
|
});
|
|
115
|
-
_defineProperty(_this, "_onPlus", function (event) {
|
|
118
|
+
_defineProperty(_assertThisInitialized(_this), "_onPlus", function (event) {
|
|
116
119
|
var zoom = _this.state.zoom;
|
|
117
120
|
var imageDOM = _this.imgRef;
|
|
118
121
|
var zoomVal = zoom + 0.1;
|
|
@@ -126,7 +129,7 @@ var ImageViews = /*#__PURE__*/function (_React$Component) {
|
|
|
126
129
|
zoom: zoomVal
|
|
127
130
|
});
|
|
128
131
|
});
|
|
129
|
-
_defineProperty(_this, "_onMinus", function () {
|
|
132
|
+
_defineProperty(_assertThisInitialized(_this), "_onMinus", function () {
|
|
130
133
|
var _context2;
|
|
131
134
|
var zoom = _this.state.zoom;
|
|
132
135
|
var imageDOM = _this.imgRef;
|
|
@@ -140,7 +143,7 @@ var ImageViews = /*#__PURE__*/function (_React$Component) {
|
|
|
140
143
|
zoom: zoomVal
|
|
141
144
|
});
|
|
142
145
|
});
|
|
143
|
-
_defineProperty(_this, "_reload", function () {
|
|
146
|
+
_defineProperty(_assertThisInitialized(_this), "_reload", function () {
|
|
144
147
|
var imageDOM = _this.imgRef;
|
|
145
148
|
imageDOM.style.transform = "translate(-50%,-50%) scale(1) rotate(0deg)";
|
|
146
149
|
imageDOM.style.left = "50%";
|
|
@@ -149,7 +152,7 @@ var ImageViews = /*#__PURE__*/function (_React$Component) {
|
|
|
149
152
|
zoom: 1
|
|
150
153
|
});
|
|
151
154
|
});
|
|
152
|
-
_defineProperty(_this, "_arrowLeft", function () {
|
|
155
|
+
_defineProperty(_assertThisInitialized(_this), "_arrowLeft", function () {
|
|
153
156
|
var onLeft = _this.props.onLeft;
|
|
154
157
|
onLeft && onLeft();
|
|
155
158
|
var imageDOM = _this.imgRef;
|
|
@@ -160,7 +163,7 @@ var ImageViews = /*#__PURE__*/function (_React$Component) {
|
|
|
160
163
|
zoom: 1
|
|
161
164
|
});
|
|
162
165
|
});
|
|
163
|
-
_defineProperty(_this, "_arrowRight", function () {
|
|
166
|
+
_defineProperty(_assertThisInitialized(_this), "_arrowRight", function () {
|
|
164
167
|
var onRight = _this.props.onRight;
|
|
165
168
|
onRight && onRight();
|
|
166
169
|
var imageDOM = _this.imgRef;
|
|
@@ -171,7 +174,7 @@ var ImageViews = /*#__PURE__*/function (_React$Component) {
|
|
|
171
174
|
zoom: 1
|
|
172
175
|
});
|
|
173
176
|
});
|
|
174
|
-
_defineProperty(_this, "rotate", function (isLeft) {
|
|
177
|
+
_defineProperty(_assertThisInitialized(_this), "rotate", function (isLeft) {
|
|
175
178
|
return function () {
|
|
176
179
|
var _context3;
|
|
177
180
|
var imageDOM = _this.imgRef;
|
|
@@ -187,8 +190,7 @@ var ImageViews = /*#__PURE__*/function (_React$Component) {
|
|
|
187
190
|
};
|
|
188
191
|
return _this;
|
|
189
192
|
}
|
|
190
|
-
|
|
191
|
-
return _createClass(ImageViews, [{
|
|
193
|
+
_createClass(ImageViews, [{
|
|
192
194
|
key: "render",
|
|
193
195
|
value: function render() {
|
|
194
196
|
var _this2 = this;
|
|
@@ -251,5 +253,6 @@ var ImageViews = /*#__PURE__*/function (_React$Component) {
|
|
|
251
253
|
}))))));
|
|
252
254
|
}
|
|
253
255
|
}]);
|
|
256
|
+
return ImageViews;
|
|
254
257
|
}(React.Component);
|
|
255
258
|
export default ImageViews;
|
package/es/Viewer/Viewer.js
CHANGED
|
@@ -2,29 +2,32 @@ 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";
|
|
5
7
|
import _possibleConstructorReturn from "@babel/runtime-corejs3/helpers/possibleConstructorReturn";
|
|
6
8
|
import _getPrototypeOf from "@babel/runtime-corejs3/helpers/getPrototypeOf";
|
|
7
|
-
import _inherits from "@babel/runtime-corejs3/helpers/inherits";
|
|
8
9
|
import _defineProperty from "@babel/runtime-corejs3/helpers/defineProperty";
|
|
9
10
|
import _setTimeout from "@babel/runtime-corejs3/core-js-stable/set-timeout";
|
|
10
11
|
import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
|
|
11
12
|
import _bindInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/bind";
|
|
12
|
-
function
|
|
13
|
-
function _isNativeReflectConstruct() {
|
|
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; } }
|
|
14
15
|
import React from 'react';
|
|
15
16
|
import PropTypes from 'prop-types';
|
|
16
17
|
import ImageViews from "./ImageViews";
|
|
17
18
|
import variables from '../variables';
|
|
18
19
|
var Viewers = /*#__PURE__*/function (_React$Component) {
|
|
20
|
+
_inherits(Viewers, _React$Component);
|
|
21
|
+
var _super = _createSuper(Viewers);
|
|
19
22
|
function Viewers(props) {
|
|
20
23
|
var _this;
|
|
21
24
|
_classCallCheck(this, Viewers);
|
|
22
|
-
_this =
|
|
25
|
+
_this = _super.call(this, props);
|
|
23
26
|
//修复Warning报错
|
|
24
|
-
_defineProperty(_this, "componentWillUnmount", function () {
|
|
27
|
+
_defineProperty(_assertThisInitialized(_this), "componentWillUnmount", function () {
|
|
25
28
|
_this.timeout = null;
|
|
26
29
|
});
|
|
27
|
-
_defineProperty(_this, "closeViewers", function () {
|
|
30
|
+
_defineProperty(_assertThisInitialized(_this), "closeViewers", function () {
|
|
28
31
|
var _this$props = _this.props,
|
|
29
32
|
onCancel = _this$props.onCancel,
|
|
30
33
|
onClose = _this$props.onClose;
|
|
@@ -33,7 +36,7 @@ var Viewers = /*#__PURE__*/function (_React$Component) {
|
|
|
33
36
|
onCancel && onCancel(onClose);
|
|
34
37
|
}, 1000);
|
|
35
38
|
});
|
|
36
|
-
_defineProperty(_this, "_onLeft", function () {
|
|
39
|
+
_defineProperty(_assertThisInitialized(_this), "_onLeft", function () {
|
|
37
40
|
var imageIndex = _this.state.imageIndex;
|
|
38
41
|
var images = _this.props.images;
|
|
39
42
|
var index = imageIndex - 1;
|
|
@@ -44,7 +47,7 @@ var Viewers = /*#__PURE__*/function (_React$Component) {
|
|
|
44
47
|
imageIndex: index
|
|
45
48
|
});
|
|
46
49
|
});
|
|
47
|
-
_defineProperty(_this, "_onRight", function () {
|
|
50
|
+
_defineProperty(_assertThisInitialized(_this), "_onRight", function () {
|
|
48
51
|
var imageIndex = _this.state.imageIndex;
|
|
49
52
|
var images = _this.props.images;
|
|
50
53
|
var index = imageIndex + 1;
|
|
@@ -55,7 +58,7 @@ var Viewers = /*#__PURE__*/function (_React$Component) {
|
|
|
55
58
|
imageIndex: index
|
|
56
59
|
});
|
|
57
60
|
});
|
|
58
|
-
_defineProperty(_this, "_onSelect", function (index) {
|
|
61
|
+
_defineProperty(_assertThisInitialized(_this), "_onSelect", function (index) {
|
|
59
62
|
_this.setState({
|
|
60
63
|
imageIndex: index
|
|
61
64
|
});
|
|
@@ -65,8 +68,7 @@ var Viewers = /*#__PURE__*/function (_React$Component) {
|
|
|
65
68
|
};
|
|
66
69
|
return _this;
|
|
67
70
|
}
|
|
68
|
-
|
|
69
|
-
return _createClass(Viewers, [{
|
|
71
|
+
_createClass(Viewers, [{
|
|
70
72
|
key: "render",
|
|
71
73
|
value: function render() {
|
|
72
74
|
var _this2 = this;
|
|
@@ -105,6 +107,7 @@ var Viewers = /*#__PURE__*/function (_React$Component) {
|
|
|
105
107
|
}))) : null);
|
|
106
108
|
}
|
|
107
109
|
}]);
|
|
110
|
+
return Viewers;
|
|
108
111
|
}(React.Component);
|
|
109
112
|
_defineProperty(Viewers, "propTypes", {
|
|
110
113
|
/** viewer是否可见 */
|
package/es/helper.js
CHANGED
|
@@ -137,16 +137,15 @@ 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
|
-
|
|
149
|
-
return _regeneratorRuntime.wrap(function (_context4) {
|
|
147
|
+
_args = arguments;
|
|
148
|
+
return _regeneratorRuntime.wrap(function _callee$(_context4) {
|
|
150
149
|
while (1) switch (_context4.prev = _context4.next) {
|
|
151
150
|
case 0:
|
|
152
151
|
cookie = _args.length > 2 && _args[2] !== undefined ? _args[2] : true;
|
|
@@ -173,23 +172,23 @@ export var fetchJson = /*#__PURE__*/function () {
|
|
|
173
172
|
};
|
|
174
173
|
}
|
|
175
174
|
}
|
|
176
|
-
_context4.prev =
|
|
177
|
-
_context4.next =
|
|
175
|
+
_context4.prev = 3;
|
|
176
|
+
_context4.next = 6;
|
|
178
177
|
return fetch(url, option);
|
|
179
|
-
case
|
|
178
|
+
case 6:
|
|
180
179
|
res = _context4.sent;
|
|
181
180
|
if (res.ok) {
|
|
182
|
-
_context4.next =
|
|
181
|
+
_context4.next = 11;
|
|
183
182
|
break;
|
|
184
183
|
}
|
|
185
184
|
return _context4.abrupt("return", {
|
|
186
185
|
returnCode: res.status,
|
|
187
186
|
returnMsg: _concatInstanceProperty(_context3 = "".concat(res.status, " - ")).call(_context3, res.statusText)
|
|
188
187
|
});
|
|
189
|
-
case
|
|
190
|
-
_context4.next =
|
|
188
|
+
case 11:
|
|
189
|
+
_context4.next = 13;
|
|
191
190
|
return res.json();
|
|
192
|
-
case
|
|
191
|
+
case 13:
|
|
193
192
|
json = _context4.sent;
|
|
194
193
|
if (json.returnCode !== 0 && json.errorCode) {
|
|
195
194
|
json.returnCode = Number(json.errorCode) || 10001;
|
|
@@ -205,21 +204,21 @@ export var fetchJson = /*#__PURE__*/function () {
|
|
|
205
204
|
}
|
|
206
205
|
}
|
|
207
206
|
return _context4.abrupt("return", json);
|
|
208
|
-
case
|
|
209
|
-
_context4.next =
|
|
207
|
+
case 17:
|
|
208
|
+
_context4.next = 22;
|
|
210
209
|
break;
|
|
211
|
-
case
|
|
212
|
-
_context4.prev =
|
|
213
|
-
|
|
210
|
+
case 19:
|
|
211
|
+
_context4.prev = 19;
|
|
212
|
+
_context4.t0 = _context4["catch"](3);
|
|
214
213
|
return _context4.abrupt("return", {
|
|
215
214
|
returnCode: 10000,
|
|
216
215
|
returnMsg: '无法请求资源'
|
|
217
216
|
});
|
|
218
|
-
case
|
|
217
|
+
case 22:
|
|
219
218
|
case "end":
|
|
220
219
|
return _context4.stop();
|
|
221
220
|
}
|
|
222
|
-
}, _callee, null, [[
|
|
221
|
+
}, _callee, null, [[3, 19]]);
|
|
223
222
|
}));
|
|
224
223
|
return function fetchJson(_x, _x2) {
|
|
225
224
|
return _ref.apply(this, arguments);
|
package/lib/Area/Area.js
CHANGED
|
@@ -24,9 +24,10 @@ 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"));
|
|
27
29
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/possibleConstructorReturn"));
|
|
28
30
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/getPrototypeOf"));
|
|
29
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/inherits"));
|
|
30
31
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/defineProperty"));
|
|
31
32
|
var _button = _interopRequireDefault(require("antd/lib/button"));
|
|
32
33
|
var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/extends"));
|
|
@@ -38,8 +39,8 @@ var _Control = _interopRequireDefault(require("../Control"));
|
|
|
38
39
|
var _excluded = ["type", "children"];
|
|
39
40
|
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; }
|
|
40
41
|
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; }
|
|
41
|
-
function
|
|
42
|
-
function _isNativeReflectConstruct() {
|
|
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; } }
|
|
43
44
|
var defaultSize = 'small';
|
|
44
45
|
var PROPS = {
|
|
45
46
|
value: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].number, _propTypes["default"].object]),
|
|
@@ -61,11 +62,13 @@ var ButtonEx = function ButtonEx(_ref) {
|
|
|
61
62
|
};
|
|
62
63
|
var PROPS_KEYS = (0, _keys["default"])(PROPS);
|
|
63
64
|
var Area = /*#__PURE__*/function (_React$Component) {
|
|
65
|
+
(0, _inherits2["default"])(Area, _React$Component);
|
|
66
|
+
var _super = _createSuper(Area);
|
|
64
67
|
function Area(_props) {
|
|
65
68
|
var _this;
|
|
66
69
|
(0, _classCallCheck2["default"])(this, Area);
|
|
67
|
-
_this =
|
|
68
|
-
(0, _defineProperty2["default"])(_this, "onChange", function (key, keyValue) {
|
|
70
|
+
_this = _super.call(this, _props);
|
|
71
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onChange", function (key, keyValue) {
|
|
69
72
|
var _this$props = _this.props,
|
|
70
73
|
onParentChange = _this$props.onParentChange,
|
|
71
74
|
child = _this$props.child,
|
|
@@ -87,7 +90,7 @@ var Area = /*#__PURE__*/function (_React$Component) {
|
|
|
87
90
|
return onParentChange && onParentChange(_this.state.value);
|
|
88
91
|
});
|
|
89
92
|
});
|
|
90
|
-
(0, _defineProperty2["default"])(_this, "onSearch", function (key, control, parentKey, KeyValue) {
|
|
93
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onSearch", function (key, control, parentKey, KeyValue) {
|
|
91
94
|
var _this$props2 = _this.props,
|
|
92
95
|
onAreaSearch = _this$props2.onAreaSearch,
|
|
93
96
|
child = _this$props2.child,
|
|
@@ -105,7 +108,7 @@ var Area = /*#__PURE__*/function (_React$Component) {
|
|
|
105
108
|
});
|
|
106
109
|
return flag ? onAreaSearch && onAreaSearch(key, KeyValue, parentKey) : _helper["default"].showError('请输入上级选择器');
|
|
107
110
|
});
|
|
108
|
-
(0, _defineProperty2["default"])(_this, "toControl", function (item, props) {
|
|
111
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "toControl", function (item, props) {
|
|
109
112
|
if (item.type === 'button') {
|
|
110
113
|
var key = item.key,
|
|
111
114
|
title = item.title,
|
|
@@ -122,17 +125,19 @@ var Area = /*#__PURE__*/function (_React$Component) {
|
|
|
122
125
|
} else if (item.type === 'icon') {
|
|
123
126
|
var _onClick = props.onClick;
|
|
124
127
|
var _key = item.key,
|
|
125
|
-
icon = item.icon
|
|
128
|
+
icon = item.icon,
|
|
129
|
+
style = item.style;
|
|
126
130
|
return /*#__PURE__*/_react["default"].createElement(_icon["default"], {
|
|
127
131
|
type: icon,
|
|
128
132
|
key: _key,
|
|
133
|
+
style: style,
|
|
129
134
|
onClick: _onClick
|
|
130
135
|
});
|
|
131
136
|
} else {
|
|
132
137
|
return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
|
|
133
138
|
}
|
|
134
139
|
});
|
|
135
|
-
(0, _defineProperty2["default"])(_this, "onClick", function (e) {
|
|
140
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onClick", function (e) {
|
|
136
141
|
var onClick = _this.props.onClick;
|
|
137
142
|
var key = (0, _typeof2["default"])(e) === 'object' ? e.key : e;
|
|
138
143
|
onClick && onClick(key);
|
|
@@ -143,8 +148,7 @@ var Area = /*#__PURE__*/function (_React$Component) {
|
|
|
143
148
|
};
|
|
144
149
|
return _this;
|
|
145
150
|
}
|
|
146
|
-
(0,
|
|
147
|
-
return (0, _createClass2["default"])(Area, [{
|
|
151
|
+
(0, _createClass2["default"])(Area, [{
|
|
148
152
|
key: "componentWillReceiveProps",
|
|
149
153
|
value: function componentWillReceiveProps(props) {
|
|
150
154
|
if (props.value !== this.props.value) {
|
|
@@ -200,5 +204,6 @@ var Area = /*#__PURE__*/function (_React$Component) {
|
|
|
200
204
|
}));
|
|
201
205
|
}
|
|
202
206
|
}]);
|
|
207
|
+
return Area;
|
|
203
208
|
}(_react["default"].Component);
|
|
204
209
|
var _default = exports["default"] = Area;
|