cloud-b2b 1.1.77 → 1.1.79
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 +13 -10
- package/es/CodeInput/CodeInput.js +19 -16
- 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 +68 -26
- package/es/SuperUpload/SuperUpload.js +63 -53
- 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 +13 -10
- package/lib/CodeInput/CodeInput.js +19 -16
- 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 +67 -26
- package/lib/SuperUpload/SuperUpload.js +65 -54
- 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
|
@@ -15,9 +15,10 @@ import _Checkbox from "antd/es/checkbox";
|
|
|
15
15
|
import _typeof from "@babel/runtime-corejs3/helpers/typeof";
|
|
16
16
|
import _classCallCheck from "@babel/runtime-corejs3/helpers/classCallCheck";
|
|
17
17
|
import _createClass from "@babel/runtime-corejs3/helpers/createClass";
|
|
18
|
+
import _assertThisInitialized from "@babel/runtime-corejs3/helpers/assertThisInitialized";
|
|
19
|
+
import _inherits from "@babel/runtime-corejs3/helpers/inherits";
|
|
18
20
|
import _possibleConstructorReturn from "@babel/runtime-corejs3/helpers/possibleConstructorReturn";
|
|
19
21
|
import _getPrototypeOf from "@babel/runtime-corejs3/helpers/getPrototypeOf";
|
|
20
|
-
import _inherits from "@babel/runtime-corejs3/helpers/inherits";
|
|
21
22
|
import _defineProperty from "@babel/runtime-corejs3/helpers/defineProperty";
|
|
22
23
|
import _Form from "antd/es/form";
|
|
23
24
|
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
|
|
@@ -28,9 +29,9 @@ import _includesInstanceProperty from "@babel/runtime-corejs3/core-js-stable/ins
|
|
|
28
29
|
import _bindInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/bind";
|
|
29
30
|
import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
|
|
30
31
|
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; }
|
|
31
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var
|
|
32
|
-
function
|
|
33
|
-
function _isNativeReflectConstruct() {
|
|
32
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context29, _context30; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context29 = ownKeys(Object(t), !0)).call(_context29, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context30 = ownKeys(Object(t))).call(_context30, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
33
|
+
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); }; }
|
|
34
|
+
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; } }
|
|
34
35
|
import React from 'react';
|
|
35
36
|
import PropTypes from 'prop-types';
|
|
36
37
|
import ReactDOM from 'react-dom';
|
|
@@ -65,11 +66,13 @@ var ControlType = {
|
|
|
65
66
|
props: PropTypes.object
|
|
66
67
|
};
|
|
67
68
|
var Controlled = /*#__PURE__*/function (_React$Component) {
|
|
69
|
+
_inherits(Controlled, _React$Component);
|
|
70
|
+
var _super = _createSuper(Controlled);
|
|
68
71
|
function Controlled(props) {
|
|
69
72
|
var _this;
|
|
70
73
|
_classCallCheck(this, Controlled);
|
|
71
|
-
_this =
|
|
72
|
-
_defineProperty(_this, "onChange", function (value) {
|
|
74
|
+
_this = _super.call(this, props);
|
|
75
|
+
_defineProperty(_assertThisInitialized(_this), "onChange", function (value) {
|
|
73
76
|
var onChange = _this.props.onChange;
|
|
74
77
|
_this.setState({
|
|
75
78
|
value: value
|
|
@@ -81,8 +84,7 @@ var Controlled = /*#__PURE__*/function (_React$Component) {
|
|
|
81
84
|
};
|
|
82
85
|
return _this;
|
|
83
86
|
}
|
|
84
|
-
|
|
85
|
-
return _createClass(Controlled, [{
|
|
87
|
+
_createClass(Controlled, [{
|
|
86
88
|
key: "componentWillReceiveProps",
|
|
87
89
|
value: function componentWillReceiveProps(nextProps) {
|
|
88
90
|
if (this.props.value !== nextProps.value) {
|
|
@@ -101,6 +103,7 @@ var Controlled = /*#__PURE__*/function (_React$Component) {
|
|
|
101
103
|
return /*#__PURE__*/React.createElement(Control, props);
|
|
102
104
|
}
|
|
103
105
|
}]);
|
|
106
|
+
return Controlled;
|
|
104
107
|
}(React.Component);
|
|
105
108
|
/**
|
|
106
109
|
* colNum:[可选],表单的列数,默认为4
|
|
@@ -116,6 +119,8 @@ var Controlled = /*#__PURE__*/function (_React$Component) {
|
|
|
116
119
|
* onFileChange:上传组件触发,原型为func(key,{fileList, fileDeleteList})
|
|
117
120
|
*/
|
|
118
121
|
var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
|
|
122
|
+
_inherits(SuperForm2, _React$Component2);
|
|
123
|
+
var _super2 = _createSuper(SuperForm2);
|
|
119
124
|
function SuperForm2() {
|
|
120
125
|
var _context;
|
|
121
126
|
var _this2;
|
|
@@ -123,35 +128,35 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
|
|
|
123
128
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
124
129
|
args[_key] = arguments[_key];
|
|
125
130
|
}
|
|
126
|
-
_this2 =
|
|
127
|
-
_defineProperty(_this2, "onAdd", function (key, title) {
|
|
131
|
+
_this2 = _super2.call.apply(_super2, _concatInstanceProperty(_context = [this]).call(_context, args));
|
|
132
|
+
_defineProperty(_assertThisInitialized(_this2), "onAdd", function (key, title) {
|
|
128
133
|
var onAdd = _this2.props.onAdd;
|
|
129
134
|
onAdd && onAdd(key, title);
|
|
130
135
|
});
|
|
131
|
-
_defineProperty(_this2, "onFileChange", function (_ref, file) {
|
|
136
|
+
_defineProperty(_assertThisInitialized(_this2), "onFileChange", function (_ref, file) {
|
|
132
137
|
var key = _ref.key;
|
|
133
138
|
var onFileChange = _this2.props.onFileChange;
|
|
134
139
|
onFileChange && onFileChange(key, file);
|
|
135
140
|
});
|
|
136
|
-
_defineProperty(_this2, "onChange", function (key, value) {
|
|
141
|
+
_defineProperty(_assertThisInitialized(_this2), "onChange", function (key, value) {
|
|
137
142
|
var onChange = _this2.props.onChange;
|
|
138
143
|
if (onChange) {
|
|
139
144
|
_this2.onExitValid(key);
|
|
140
145
|
onChange(key, value);
|
|
141
146
|
}
|
|
142
147
|
});
|
|
143
|
-
_defineProperty(_this2, "onGetCode", function (key, value) {
|
|
148
|
+
_defineProperty(_assertThisInitialized(_this2), "onGetCode", function (key, value) {
|
|
144
149
|
var onGetCode = _this2.props.onGetCode;
|
|
145
150
|
onGetCode && onGetCode();
|
|
146
151
|
});
|
|
147
|
-
_defineProperty(_this2, "onBlur", function (key, value) {
|
|
152
|
+
_defineProperty(_assertThisInitialized(_this2), "onBlur", function (key, value) {
|
|
148
153
|
var onChange = _this2.props.onChange;
|
|
149
154
|
if (onChange) {
|
|
150
155
|
_this2.onExitValid(key);
|
|
151
156
|
onChange(key, value);
|
|
152
157
|
}
|
|
153
158
|
});
|
|
154
|
-
_defineProperty(_this2, "onExitValid", function (key, value) {
|
|
159
|
+
_defineProperty(_assertThisInitialized(_this2), "onExitValid", function (key, value) {
|
|
155
160
|
if (key === _this2.validKey) {
|
|
156
161
|
_this2.validKey = '';
|
|
157
162
|
_this2.props.onExitValid();
|
|
@@ -159,7 +164,7 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
|
|
|
159
164
|
_this2.props.onChangeOperate && _this2.props.onChangeOperate(key, value);
|
|
160
165
|
});
|
|
161
166
|
// 动态生成getValidState方法
|
|
162
|
-
_defineProperty(_this2, "initValidState", function () {
|
|
167
|
+
_defineProperty(_assertThisInitialized(_this2), "initValidState", function () {
|
|
163
168
|
var _this2$props = _this2.props,
|
|
164
169
|
value = _this2$props.value,
|
|
165
170
|
valid = _this2$props.valid;
|
|
@@ -180,7 +185,7 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
|
|
|
180
185
|
};
|
|
181
186
|
_this2.getValidState = valid ? _valid : invalid;
|
|
182
187
|
});
|
|
183
|
-
_defineProperty(_this2, "validDate", function (_ref3) {
|
|
188
|
+
_defineProperty(_assertThisInitialized(_this2), "validDate", function (_ref3) {
|
|
184
189
|
var key = _ref3.key,
|
|
185
190
|
type = _ref3.type;
|
|
186
191
|
return function (date) {
|
|
@@ -199,25 +204,25 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
|
|
|
199
204
|
}
|
|
200
205
|
};
|
|
201
206
|
});
|
|
202
|
-
_defineProperty(_this2, "getPopupContainer", function () {
|
|
207
|
+
_defineProperty(_assertThisInitialized(_this2), "getPopupContainer", function () {
|
|
203
208
|
var container = _this2.props.container;
|
|
204
209
|
if (typeof container === 'undefined') {
|
|
205
|
-
return ReactDOM.findDOMNode(_this2);
|
|
210
|
+
return ReactDOM.findDOMNode(_assertThisInitialized(_this2));
|
|
206
211
|
} else if (typeof container === 'boolean') {
|
|
207
212
|
return document.body;
|
|
208
213
|
} else {
|
|
209
214
|
return ReactDOM.findDOMNode(container);
|
|
210
215
|
}
|
|
211
216
|
});
|
|
212
|
-
_defineProperty(_this2, "getMaxWidth", function () {
|
|
217
|
+
_defineProperty(_assertThisInitialized(_this2), "getMaxWidth", function () {
|
|
213
218
|
var _this2$props$colNum = _this2.props.colNum,
|
|
214
219
|
colNum = _this2$props$colNum === void 0 ? defaultColNum : _this2$props$colNum;
|
|
215
220
|
return colNum * 1200;
|
|
216
221
|
});
|
|
217
|
-
_defineProperty(_this2, "getContainer", function () {
|
|
222
|
+
_defineProperty(_assertThisInitialized(_this2), "getContainer", function () {
|
|
218
223
|
return _this2.props.getContainer;
|
|
219
224
|
});
|
|
220
|
-
_defineProperty(_this2, "getControls", function () {
|
|
225
|
+
_defineProperty(_assertThisInitialized(_this2), "getControls", function () {
|
|
221
226
|
var _this2$props2 = _this2.props,
|
|
222
227
|
hideControls = _this2$props2.hideControls,
|
|
223
228
|
controls = _this2$props2.controls;
|
|
@@ -231,12 +236,12 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
|
|
|
231
236
|
});
|
|
232
237
|
}
|
|
233
238
|
});
|
|
234
|
-
_defineProperty(_this2, "getType", function (_ref4) {
|
|
239
|
+
_defineProperty(_assertThisInitialized(_this2), "getType", function (_ref4) {
|
|
235
240
|
var _context2;
|
|
236
241
|
var key = _ref4.key,
|
|
237
242
|
type = _ref4.type;
|
|
238
243
|
var readonly = _this2.props.readonly;
|
|
239
|
-
if (_includesInstanceProperty(_context2 = ['area', 'uploadImg']).call(_context2, type)) {
|
|
244
|
+
if (_includesInstanceProperty(_context2 = ['area', 'uploadImg', 'checkbox']).call(_context2, type)) {
|
|
240
245
|
return type;
|
|
241
246
|
} else if (!readonly) {
|
|
242
247
|
return type;
|
|
@@ -250,7 +255,7 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
|
|
|
250
255
|
return type;
|
|
251
256
|
}
|
|
252
257
|
});
|
|
253
|
-
_defineProperty(_this2, "specialProps", function (type, _ref5) {
|
|
258
|
+
_defineProperty(_assertThisInitialized(_this2), "specialProps", function (type, _ref5) {
|
|
254
259
|
var key = _ref5.key,
|
|
255
260
|
_ref5$props = _ref5.props,
|
|
256
261
|
props = _ref5$props === void 0 ? {} : _ref5$props,
|
|
@@ -261,70 +266,70 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
|
|
|
261
266
|
return {
|
|
262
267
|
type: 'textArea',
|
|
263
268
|
readonly: true,
|
|
264
|
-
onBlur: _bindInstanceProperty(_context3 = _this2.onExitValid).call(_context3, _this2, key)
|
|
269
|
+
onBlur: _bindInstanceProperty(_context3 = _this2.onExitValid).call(_context3, _assertThisInitialized(_this2), key)
|
|
265
270
|
};
|
|
266
271
|
} else if (originType === 'uploadImg') {
|
|
267
272
|
var _context4;
|
|
268
273
|
var commonProps = _this2.props.buildSuperUploadProps ? _this2.props.buildSuperUploadProps() : {};
|
|
269
274
|
return _objectSpread(_objectSpread(_objectSpread({}, props), commonProps), {}, {
|
|
270
275
|
readonly: true,
|
|
271
|
-
onBlur: _bindInstanceProperty(_context4 = _this2.onExitValid).call(_context4, _this2, key)
|
|
276
|
+
onBlur: _bindInstanceProperty(_context4 = _this2.onExitValid).call(_context4, _assertThisInitialized(_this2), key)
|
|
272
277
|
});
|
|
273
278
|
} else {
|
|
274
279
|
var _context5;
|
|
275
280
|
return {
|
|
276
|
-
onBlur: _bindInstanceProperty(_context5 = _this2.onExitValid).call(_context5, _this2, key)
|
|
281
|
+
onBlur: _bindInstanceProperty(_context5 = _this2.onExitValid).call(_context5, _assertThisInitialized(_this2), key)
|
|
277
282
|
};
|
|
278
283
|
}
|
|
279
284
|
} else if (type === 'text' || type === 'textArea') {
|
|
280
285
|
var _context6, _context7;
|
|
281
286
|
return _objectSpread(_objectSpread({}, props), {}, {
|
|
282
|
-
onChange: _bindInstanceProperty(_context6 = _this2.onExitValid).call(_context6, _this2, key),
|
|
283
|
-
onBlur: _bindInstanceProperty(_context7 = _this2.onChange).call(_context7, _this2, key)
|
|
287
|
+
onChange: _bindInstanceProperty(_context6 = _this2.onExitValid).call(_context6, _assertThisInitialized(_this2), key),
|
|
288
|
+
onBlur: _bindInstanceProperty(_context7 = _this2.onChange).call(_context7, _assertThisInitialized(_this2), key)
|
|
284
289
|
});
|
|
285
290
|
} else if (type === 'date') {
|
|
286
291
|
var _context8, _context9;
|
|
287
292
|
var propsObj = _objectSpread(_objectSpread({}, props), {}, {
|
|
288
|
-
onChange: _bindInstanceProperty(_context8 = _this2.onBlur).call(_context8, _this2, key),
|
|
289
|
-
onBlur: _bindInstanceProperty(_context9 = _this2.onExitValid).call(_context9, _this2, key)
|
|
293
|
+
onChange: _bindInstanceProperty(_context8 = _this2.onBlur).call(_context8, _assertThisInitialized(_this2), key),
|
|
294
|
+
onBlur: _bindInstanceProperty(_context9 = _this2.onExitValid).call(_context9, _assertThisInitialized(_this2), key)
|
|
290
295
|
});
|
|
291
296
|
if (_this2.props.onOpenChange && typeof _this2.props.onOpenChange === 'function') {
|
|
292
|
-
var
|
|
293
|
-
propsObj.onOpenChange = _bindInstanceProperty(
|
|
297
|
+
var _context10;
|
|
298
|
+
propsObj.onOpenChange = _bindInstanceProperty(_context10 = _this2.props.onOpenChange).call(_context10, _assertThisInitialized(_this2), key);
|
|
294
299
|
}
|
|
295
300
|
return propsObj;
|
|
296
301
|
} else if (type === 'captcha') {
|
|
297
|
-
var
|
|
302
|
+
var _context11, _context12, _context13;
|
|
298
303
|
return _objectSpread(_objectSpread({}, props), {}, {
|
|
299
|
-
onChange: _bindInstanceProperty(
|
|
300
|
-
onBlur: _bindInstanceProperty(
|
|
301
|
-
onGetCode: _bindInstanceProperty(
|
|
304
|
+
onChange: _bindInstanceProperty(_context11 = _this2.onBlur).call(_context11, _assertThisInitialized(_this2), key),
|
|
305
|
+
onBlur: _bindInstanceProperty(_context12 = _this2.onExitValid).call(_context12, _assertThisInitialized(_this2), key),
|
|
306
|
+
onGetCode: _bindInstanceProperty(_context13 = _this2.onGetCode).call(_context13, _assertThisInitialized(_this2), key)
|
|
302
307
|
});
|
|
303
308
|
} else if (type === 'area') {
|
|
304
|
-
var
|
|
309
|
+
var _context14, _context15;
|
|
305
310
|
return _objectSpread(_objectSpread({}, props), {}, {
|
|
306
|
-
onChange: _bindInstanceProperty(
|
|
307
|
-
onBlur: _bindInstanceProperty(
|
|
311
|
+
onChange: _bindInstanceProperty(_context14 = _this2.onBlur).call(_context14, _assertThisInitialized(_this2), key),
|
|
312
|
+
onBlur: _bindInstanceProperty(_context15 = _this2.onExitValid).call(_context15, _assertThisInitialized(_this2), key),
|
|
308
313
|
onAreaSearch: _this2.props.onAreaSearch
|
|
309
314
|
});
|
|
310
315
|
} else if (type === 'uploadImg') {
|
|
311
|
-
var
|
|
316
|
+
var _context16, _context17;
|
|
312
317
|
var _commonProps = _this2.props.buildSuperUploadProps ? _this2.props.buildSuperUploadProps() : {};
|
|
313
318
|
return _objectSpread(_objectSpread(_objectSpread({}, props), _commonProps), {}, {
|
|
314
|
-
onChange: _bindInstanceProperty(
|
|
315
|
-
onBlur: _bindInstanceProperty(
|
|
319
|
+
onChange: _bindInstanceProperty(_context16 = _this2.onBlur).call(_context16, _assertThisInitialized(_this2), key),
|
|
320
|
+
onBlur: _bindInstanceProperty(_context17 = _this2.onExitValid).call(_context17, _assertThisInitialized(_this2), key)
|
|
316
321
|
});
|
|
317
322
|
} else if (type === 'double') {
|
|
318
323
|
return props;
|
|
319
324
|
} else {
|
|
320
|
-
var
|
|
325
|
+
var _context18, _context19;
|
|
321
326
|
return _objectSpread(_objectSpread({}, props), {}, {
|
|
322
|
-
onChange: _bindInstanceProperty(
|
|
323
|
-
onBlur: _bindInstanceProperty(
|
|
327
|
+
onChange: _bindInstanceProperty(_context18 = _this2.onBlur).call(_context18, _assertThisInitialized(_this2), key),
|
|
328
|
+
onBlur: _bindInstanceProperty(_context19 = _this2.onExitValid).call(_context19, _assertThisInitialized(_this2), key)
|
|
324
329
|
});
|
|
325
330
|
}
|
|
326
331
|
});
|
|
327
|
-
_defineProperty(_this2, "getControlProps", function (control, status) {
|
|
332
|
+
_defineProperty(_assertThisInitialized(_this2), "getControlProps", function (control, status) {
|
|
328
333
|
var _this2$props3 = _this2.props,
|
|
329
334
|
_this2$props3$value = _this2$props3.value,
|
|
330
335
|
value = _this2$props3$value === void 0 ? {} : _this2$props3$value,
|
|
@@ -345,25 +350,25 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
|
|
|
345
350
|
requiredColor: requiredColor
|
|
346
351
|
});
|
|
347
352
|
});
|
|
348
|
-
_defineProperty(_this2, "getOptions", function (key, options) {
|
|
353
|
+
_defineProperty(_assertThisInitialized(_this2), "getOptions", function (key, options) {
|
|
349
354
|
var higher = _this2.props.options || {};
|
|
350
355
|
return higher[key] || options;
|
|
351
356
|
});
|
|
352
|
-
_defineProperty(_this2, "toEmpty", function (props) {});
|
|
353
|
-
_defineProperty(_this2, "toText", function (props) {
|
|
357
|
+
_defineProperty(_assertThisInitialized(_this2), "toEmpty", function (props) {});
|
|
358
|
+
_defineProperty(_assertThisInitialized(_this2), "toText", function (props) {
|
|
354
359
|
return /*#__PURE__*/React.createElement(Controlled, props);
|
|
355
360
|
});
|
|
356
|
-
_defineProperty(_this2, "toPassword", function (props) {
|
|
361
|
+
_defineProperty(_assertThisInitialized(_this2), "toPassword", function (props) {
|
|
357
362
|
return /*#__PURE__*/React.createElement(Controlled, props);
|
|
358
363
|
});
|
|
359
|
-
_defineProperty(_this2, "toEditor", function (props, control) {
|
|
364
|
+
_defineProperty(_assertThisInitialized(_this2), "toEditor", function (props, control) {
|
|
360
365
|
props.inputKey = control.key;
|
|
361
366
|
return /*#__PURE__*/React.createElement(Controlled, props);
|
|
362
367
|
});
|
|
363
|
-
_defineProperty(_this2, "toSelectWriting", function (props, control) {
|
|
368
|
+
_defineProperty(_assertThisInitialized(_this2), "toSelectWriting", function (props, control) {
|
|
364
369
|
return /*#__PURE__*/React.createElement(Controlled, props);
|
|
365
370
|
});
|
|
366
|
-
_defineProperty(_this2, "toTextArea", function (props, control) {
|
|
371
|
+
_defineProperty(_assertThisInitialized(_this2), "toTextArea", function (props, control) {
|
|
367
372
|
if (control.allFullFather) {
|
|
368
373
|
props.rows = control.rows;
|
|
369
374
|
props.maxLength = control.maxLength;
|
|
@@ -378,22 +383,22 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
|
|
|
378
383
|
}
|
|
379
384
|
return /*#__PURE__*/React.createElement(Controlled, props);
|
|
380
385
|
});
|
|
381
|
-
_defineProperty(_this2, "toNumber", function (props) {
|
|
386
|
+
_defineProperty(_assertThisInitialized(_this2), "toNumber", function (props) {
|
|
382
387
|
props.defaultValue = props.value;
|
|
383
388
|
delete props.value;
|
|
384
389
|
return /*#__PURE__*/React.createElement(Control, props);
|
|
385
390
|
});
|
|
386
|
-
_defineProperty(_this2, "toDoubleInput", function (props, control, cc) {
|
|
387
|
-
var
|
|
391
|
+
_defineProperty(_assertThisInitialized(_this2), "toDoubleInput", function (props, control, cc) {
|
|
392
|
+
var _context20, _context21;
|
|
388
393
|
props.defaultValue = props.value;
|
|
389
394
|
props.doubleKey = props.key;
|
|
390
395
|
props.doubleValue = helper.getObject(cc, props.key);
|
|
391
|
-
props.onChangeKey1 = _bindInstanceProperty(
|
|
392
|
-
props.onChangeKey2 = _bindInstanceProperty(
|
|
396
|
+
props.onChangeKey1 = _bindInstanceProperty(_context20 = _this2.onChange).call(_context20, _assertThisInitialized(_this2), props.key[0]);
|
|
397
|
+
props.onChangeKey2 = _bindInstanceProperty(_context21 = _this2.onChange).call(_context21, _assertThisInitialized(_this2), props.key[1]);
|
|
393
398
|
delete props.value;
|
|
394
399
|
return /*#__PURE__*/React.createElement(Control, props);
|
|
395
400
|
});
|
|
396
|
-
_defineProperty(_this2, "toSelect", function (props, _ref6) {
|
|
401
|
+
_defineProperty(_assertThisInitialized(_this2), "toSelect", function (props, _ref6) {
|
|
397
402
|
var options = _ref6.options,
|
|
398
403
|
key = _ref6.key;
|
|
399
404
|
props.getPopupContainer = _this2.getPopupContainer;
|
|
@@ -401,14 +406,14 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
|
|
|
401
406
|
props.dropdownMatchSelectWidth = false;
|
|
402
407
|
return /*#__PURE__*/React.createElement(Control, props);
|
|
403
408
|
});
|
|
404
|
-
_defineProperty(_this2, "toTreeSelect", function (props, filter) {
|
|
409
|
+
_defineProperty(_assertThisInitialized(_this2), "toTreeSelect", function (props, filter) {
|
|
405
410
|
var container = _this2.getContainer();
|
|
406
411
|
container && (props.getPopupContainer = container);
|
|
407
412
|
props.options = _this2.getOptions(filter);
|
|
408
413
|
props.onSearch = _this2.createSearchEvent(filter);
|
|
409
414
|
return /*#__PURE__*/React.createElement(Control, props);
|
|
410
415
|
});
|
|
411
|
-
_defineProperty(_this2, "createSearchEvent", function (control) {
|
|
416
|
+
_defineProperty(_assertThisInitialized(_this2), "createSearchEvent", function (control) {
|
|
412
417
|
if (_this2.props.onSearch) {
|
|
413
418
|
return function (value) {
|
|
414
419
|
return _this2.props.onSearch(control.key, value, control);
|
|
@@ -417,7 +422,7 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
|
|
|
417
422
|
return null;
|
|
418
423
|
}
|
|
419
424
|
});
|
|
420
|
-
_defineProperty(_this2, "createGetCodeEvent", function (control) {
|
|
425
|
+
_defineProperty(_assertThisInitialized(_this2), "createGetCodeEvent", function (control) {
|
|
421
426
|
if (_this2.props.onGetCode) {
|
|
422
427
|
return function (value) {
|
|
423
428
|
return _this2.props.onGetCode(control.key, value, control);
|
|
@@ -426,14 +431,14 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
|
|
|
426
431
|
return null;
|
|
427
432
|
}
|
|
428
433
|
});
|
|
429
|
-
_defineProperty(_this2, "toSearch", function (props, control) {
|
|
434
|
+
_defineProperty(_assertThisInitialized(_this2), "toSearch", function (props, control) {
|
|
430
435
|
props.getPopupContainer = _this2.getPopupContainer;
|
|
431
436
|
props.options = _this2.getOptions(control.key, control.options);
|
|
432
437
|
props.onSearch = _this2.createSearchEvent(control);
|
|
433
438
|
props.dropdownMatchSelectWidth = false;
|
|
434
439
|
return /*#__PURE__*/React.createElement(Control, props);
|
|
435
440
|
});
|
|
436
|
-
_defineProperty(_this2, "toDate", function (props, _ref7) {
|
|
441
|
+
_defineProperty(_assertThisInitialized(_this2), "toDate", function (props, _ref7) {
|
|
437
442
|
var rule = _ref7.rule;
|
|
438
443
|
props.getCalendarContainer = _this2.getPopupContainer;
|
|
439
444
|
props.style = {
|
|
@@ -442,7 +447,7 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
|
|
|
442
447
|
rule && (props.disabledDate = _this2.validDate(rule));
|
|
443
448
|
return /*#__PURE__*/React.createElement(Control, props);
|
|
444
449
|
});
|
|
445
|
-
_defineProperty(_this2, "toRangePicker", function (props, _ref8) {
|
|
450
|
+
_defineProperty(_assertThisInitialized(_this2), "toRangePicker", function (props, _ref8) {
|
|
446
451
|
var rule = _ref8.rule;
|
|
447
452
|
props.getCalendarContainer = _this2.getPopupContainer;
|
|
448
453
|
props.style = {
|
|
@@ -451,32 +456,32 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
|
|
|
451
456
|
// rule && (props.disabledDate = this.validDate(rule));
|
|
452
457
|
return /*#__PURE__*/React.createElement(Control, props);
|
|
453
458
|
});
|
|
454
|
-
_defineProperty(_this2, "toRadioGroup", function (props, _ref9) {
|
|
459
|
+
_defineProperty(_assertThisInitialized(_this2), "toRadioGroup", function (props, _ref9) {
|
|
455
460
|
var key = _ref9.key,
|
|
456
461
|
options = _ref9.options;
|
|
457
462
|
props.options = _this2.getOptions(key, options);
|
|
458
463
|
return /*#__PURE__*/React.createElement(Control, props);
|
|
459
464
|
});
|
|
460
|
-
_defineProperty(_this2, "captcha", function (props, control) {
|
|
465
|
+
_defineProperty(_assertThisInitialized(_this2), "captcha", function (props, control) {
|
|
461
466
|
props.onGetCode = _this2.props.onGetCode;
|
|
462
467
|
return /*#__PURE__*/React.createElement(Control, props);
|
|
463
468
|
});
|
|
464
|
-
_defineProperty(_this2, "toReadonly", function (props,
|
|
465
|
-
var options =
|
|
466
|
-
key =
|
|
469
|
+
_defineProperty(_assertThisInitialized(_this2), "toReadonly", function (props, _ref10) {
|
|
470
|
+
var options = _ref10.options,
|
|
471
|
+
key = _ref10.key;
|
|
467
472
|
props.value = getTitle(props.value, _this2.getOptions(key, options));
|
|
468
473
|
return /*#__PURE__*/React.createElement(Control, props);
|
|
469
474
|
});
|
|
470
|
-
_defineProperty(_this2, "selectSearch", function (props, control) {
|
|
475
|
+
_defineProperty(_assertThisInitialized(_this2), "selectSearch", function (props, control) {
|
|
471
476
|
props.getPopupContainer = _this2.getPopupContainer;
|
|
472
477
|
props.options = _this2.getOptions(control.key, control.options);
|
|
473
478
|
props.onSearch = _this2.createSearchEvent(control);
|
|
474
479
|
props.dropdownMatchSelectWidth = false;
|
|
475
480
|
return /*#__PURE__*/React.createElement(Control, props);
|
|
476
481
|
});
|
|
477
|
-
_defineProperty(_this2, "area", function (props,
|
|
478
|
-
var key =
|
|
479
|
-
options =
|
|
482
|
+
_defineProperty(_assertThisInitialized(_this2), "area", function (props, _ref11) {
|
|
483
|
+
var key = _ref11.key,
|
|
484
|
+
options = _ref11.options;
|
|
480
485
|
var readonly = _this2.props.readonly;
|
|
481
486
|
props.parentKey = key;
|
|
482
487
|
props.options = _this2.getOptions(key, options);
|
|
@@ -486,17 +491,17 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
|
|
|
486
491
|
}) ? true : false;
|
|
487
492
|
return /*#__PURE__*/React.createElement(Control, props);
|
|
488
493
|
});
|
|
489
|
-
_defineProperty(_this2, "uploadImg", function (props, control) {
|
|
490
|
-
var
|
|
494
|
+
_defineProperty(_assertThisInitialized(_this2), "uploadImg", function (props, control) {
|
|
495
|
+
var _context22;
|
|
491
496
|
var readonly = _this2.props.readonly;
|
|
492
497
|
props.required = control.required || false;
|
|
493
|
-
props.onFileChange = _bindInstanceProperty(
|
|
498
|
+
props.onFileChange = _bindInstanceProperty(_context22 = _this2.onFileChange).call(_context22, _assertThisInitialized(_this2), control);
|
|
494
499
|
props.readonly = readonly === true || _Array$isArray(readonly) && _someInstanceProperty(readonly).call(readonly, function (readonlyKey) {
|
|
495
500
|
return readonlyKey === control.key;
|
|
496
501
|
}) ? true : false;
|
|
497
502
|
return /*#__PURE__*/React.createElement(Control, props);
|
|
498
503
|
});
|
|
499
|
-
_defineProperty(_this2, "toCascader", function (props, control) {
|
|
504
|
+
_defineProperty(_assertThisInitialized(_this2), "toCascader", function (props, control) {
|
|
500
505
|
var container = _this2.getContainer();
|
|
501
506
|
container && (props.getPopupContainer = container);
|
|
502
507
|
props.options = control.options || [];
|
|
@@ -505,16 +510,17 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
|
|
|
505
510
|
props.loadData = _this2.createSearchEvent(control);
|
|
506
511
|
return /*#__PURE__*/React.createElement(Control, props);
|
|
507
512
|
});
|
|
508
|
-
_defineProperty(_this2, "toCheckbox", function (props, control) {
|
|
509
|
-
var
|
|
513
|
+
_defineProperty(_assertThisInitialized(_this2), "toCheckbox", function (props, control) {
|
|
514
|
+
var _context23;
|
|
510
515
|
var options = control.options || [];
|
|
511
516
|
return /*#__PURE__*/React.createElement(_Checkbox.Group, {
|
|
512
517
|
options: options,
|
|
513
|
-
|
|
518
|
+
disabled: _this2.props.readonly === true,
|
|
519
|
+
onChange: _bindInstanceProperty(_context23 = _this2.onBlur).call(_context23, _assertThisInitialized(_this2), control.key),
|
|
514
520
|
value: _this2.props.value[control.key]
|
|
515
521
|
});
|
|
516
522
|
});
|
|
517
|
-
_defineProperty(_this2, "toControl", function (props, control) {
|
|
523
|
+
_defineProperty(_assertThisInitialized(_this2), "toControl", function (props, control) {
|
|
518
524
|
switch (props.type) {
|
|
519
525
|
case 'readonly':
|
|
520
526
|
return _this2.toReadonly(props, control);
|
|
@@ -564,34 +570,34 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
|
|
|
564
570
|
return 'type error';
|
|
565
571
|
}
|
|
566
572
|
});
|
|
567
|
-
_defineProperty(_this2, "toLabel", function (
|
|
568
|
-
var title =
|
|
569
|
-
showAdd =
|
|
570
|
-
showQuery =
|
|
571
|
-
key =
|
|
572
|
-
showInfo =
|
|
573
|
-
showInfoTitle =
|
|
574
|
-
showIcon =
|
|
575
|
-
iconType =
|
|
573
|
+
_defineProperty(_assertThisInitialized(_this2), "toLabel", function (_ref12, type) {
|
|
574
|
+
var title = _ref12.title,
|
|
575
|
+
showAdd = _ref12.showAdd,
|
|
576
|
+
showQuery = _ref12.showQuery,
|
|
577
|
+
key = _ref12.key,
|
|
578
|
+
showInfo = _ref12.showInfo,
|
|
579
|
+
showInfoTitle = _ref12.showInfoTitle,
|
|
580
|
+
showIcon = _ref12.showIcon,
|
|
581
|
+
iconType = _ref12.iconType;
|
|
576
582
|
if (showAdd && type !== 'readonly') {
|
|
577
|
-
var
|
|
578
|
-
var onClick = _bindInstanceProperty(
|
|
583
|
+
var _context24;
|
|
584
|
+
var onClick = _bindInstanceProperty(_context24 = _this2.onAdd).call(_context24, _assertThisInitialized(_this2), key, title);
|
|
579
585
|
return /*#__PURE__*/React.createElement("span", null, title, /*#__PURE__*/React.createElement(_Icon, {
|
|
580
586
|
role: "add",
|
|
581
587
|
type: "plus-circle-o",
|
|
582
588
|
onClick: onClick
|
|
583
589
|
}));
|
|
584
590
|
} else if (showQuery && type !== 'readonly') {
|
|
585
|
-
var
|
|
586
|
-
var _onClick = _bindInstanceProperty(
|
|
591
|
+
var _context25;
|
|
592
|
+
var _onClick = _bindInstanceProperty(_context25 = _this2.onAdd).call(_context25, _assertThisInitialized(_this2), key, title);
|
|
587
593
|
return /*#__PURE__*/React.createElement("span", null, title, /*#__PURE__*/React.createElement(_Icon, {
|
|
588
594
|
role: "add",
|
|
589
595
|
type: "search",
|
|
590
596
|
onClick: _onClick
|
|
591
597
|
}));
|
|
592
598
|
} else if (showIcon && iconType && type !== 'readonly' && showInfoTitle) {
|
|
593
|
-
var
|
|
594
|
-
var _onClick2 = _bindInstanceProperty(
|
|
599
|
+
var _context26;
|
|
600
|
+
var _onClick2 = _bindInstanceProperty(_context26 = _this2.onAdd).call(_context26, _assertThisInitialized(_this2), key, title);
|
|
595
601
|
return /*#__PURE__*/React.createElement("span", null, title, /*#__PURE__*/React.createElement(_Tooltip, {
|
|
596
602
|
title: showInfoTitle
|
|
597
603
|
}, /*#__PURE__*/React.createElement(_Icon, {
|
|
@@ -600,8 +606,8 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
|
|
|
600
606
|
onClick: _onClick2
|
|
601
607
|
})));
|
|
602
608
|
} else if (showIcon && iconType && type !== 'readonly') {
|
|
603
|
-
var
|
|
604
|
-
var _onClick3 = _bindInstanceProperty(
|
|
609
|
+
var _context27;
|
|
610
|
+
var _onClick3 = _bindInstanceProperty(_context27 = _this2.onAdd).call(_context27, _assertThisInitialized(_this2), key, title);
|
|
605
611
|
return /*#__PURE__*/React.createElement("span", null, title, /*#__PURE__*/React.createElement(_Icon, {
|
|
606
612
|
role: "add",
|
|
607
613
|
type: iconType,
|
|
@@ -617,7 +623,7 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
|
|
|
617
623
|
return title;
|
|
618
624
|
}
|
|
619
625
|
});
|
|
620
|
-
_defineProperty(_this2, "toCol", function (span, control) {
|
|
626
|
+
_defineProperty(_assertThisInitialized(_this2), "toCol", function (span, control) {
|
|
621
627
|
var factor = control.span || 1;
|
|
622
628
|
var status = _this2.getValidState(control);
|
|
623
629
|
var controlProps = _this2.getControlProps(control, status);
|
|
@@ -638,7 +644,7 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
|
|
|
638
644
|
key: control.key
|
|
639
645
|
}, checkable && /*#__PURE__*/React.createElement(_Checkbox, {
|
|
640
646
|
className: variables('SuperForm2').checkbox,
|
|
641
|
-
onChange: _bindInstanceProperty(onCheckItem).call(onCheckItem, _this2, control),
|
|
647
|
+
onChange: _bindInstanceProperty(onCheckItem).call(onCheckItem, _assertThisInitialized(_this2), control),
|
|
642
648
|
checked: control.checked
|
|
643
649
|
}), /*#__PURE__*/React.createElement(FormItem, _extends({}, itemProps, {
|
|
644
650
|
className: checkable ? variables('SuperForm2').formItemWithCheckbox : '',
|
|
@@ -666,8 +672,8 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
|
|
|
666
672
|
}
|
|
667
673
|
});
|
|
668
674
|
});
|
|
669
|
-
_defineProperty(_this2, "toCols", function () {
|
|
670
|
-
var
|
|
675
|
+
_defineProperty(_assertThisInitialized(_this2), "toCols", function () {
|
|
676
|
+
var _context28;
|
|
671
677
|
var _this2$props5 = _this2.props,
|
|
672
678
|
_this2$props5$colNum = _this2$props5.colNum,
|
|
673
679
|
colNum = _this2$props5$colNum === void 0 ? defaultColNum : _this2$props5$colNum,
|
|
@@ -676,7 +682,7 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
|
|
|
676
682
|
colNum = 1;
|
|
677
683
|
}
|
|
678
684
|
var span = 24 / colNum;
|
|
679
|
-
return _mapInstanceProperty(
|
|
685
|
+
return _mapInstanceProperty(_context28 = _this2.getControls()).call(_context28, function (control) {
|
|
680
686
|
if (allFullFather) {
|
|
681
687
|
control.allFullFather = allFullFather;
|
|
682
688
|
}
|
|
@@ -685,8 +691,7 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
|
|
|
685
691
|
});
|
|
686
692
|
return _this2;
|
|
687
693
|
}
|
|
688
|
-
|
|
689
|
-
return _createClass(SuperForm2, [{
|
|
694
|
+
_createClass(SuperForm2, [{
|
|
690
695
|
key: "render",
|
|
691
696
|
value: function render() {
|
|
692
697
|
this.initValidState();
|
|
@@ -704,6 +709,7 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
|
|
|
704
709
|
}, this.toCols())));
|
|
705
710
|
}
|
|
706
711
|
}]);
|
|
712
|
+
return SuperForm2;
|
|
707
713
|
}(React.Component);
|
|
708
714
|
_defineProperty(SuperForm2, "propTypes", {
|
|
709
715
|
controls: PropTypes.arrayOf(PropTypes.shape(ControlType)).isRequired,
|