cloud-b2b 1.1.80 → 1.1.81
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 +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 +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 +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
|
@@ -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,7 +236,7 @@ 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;
|
|
@@ -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,71 @@ 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(
|
|
308
|
-
onAreaSearch: _this2.props.onAreaSearch
|
|
311
|
+
onChange: _bindInstanceProperty(_context14 = _this2.onBlur).call(_context14, _assertThisInitialized(_this2), key),
|
|
312
|
+
onBlur: _bindInstanceProperty(_context15 = _this2.onExitValid).call(_context15, _assertThisInitialized(_this2), key),
|
|
313
|
+
onAreaSearch: _this2.props.onAreaSearch,
|
|
314
|
+
onClick: _this2.props.onAdd
|
|
309
315
|
});
|
|
310
316
|
} else if (type === 'uploadImg') {
|
|
311
|
-
var
|
|
317
|
+
var _context16, _context17;
|
|
312
318
|
var _commonProps = _this2.props.buildSuperUploadProps ? _this2.props.buildSuperUploadProps() : {};
|
|
313
319
|
return _objectSpread(_objectSpread(_objectSpread({}, props), _commonProps), {}, {
|
|
314
|
-
onChange: _bindInstanceProperty(
|
|
315
|
-
onBlur: _bindInstanceProperty(
|
|
320
|
+
onChange: _bindInstanceProperty(_context16 = _this2.onBlur).call(_context16, _assertThisInitialized(_this2), key),
|
|
321
|
+
onBlur: _bindInstanceProperty(_context17 = _this2.onExitValid).call(_context17, _assertThisInitialized(_this2), key)
|
|
316
322
|
});
|
|
317
323
|
} else if (type === 'double') {
|
|
318
324
|
return props;
|
|
319
325
|
} else {
|
|
320
|
-
var
|
|
326
|
+
var _context18, _context19;
|
|
321
327
|
return _objectSpread(_objectSpread({}, props), {}, {
|
|
322
|
-
onChange: _bindInstanceProperty(
|
|
323
|
-
onBlur: _bindInstanceProperty(
|
|
328
|
+
onChange: _bindInstanceProperty(_context18 = _this2.onBlur).call(_context18, _assertThisInitialized(_this2), key),
|
|
329
|
+
onBlur: _bindInstanceProperty(_context19 = _this2.onExitValid).call(_context19, _assertThisInitialized(_this2), key)
|
|
324
330
|
});
|
|
325
331
|
}
|
|
326
332
|
});
|
|
327
|
-
_defineProperty(_this2, "getControlProps", function (control, status) {
|
|
333
|
+
_defineProperty(_assertThisInitialized(_this2), "getControlProps", function (control, status) {
|
|
328
334
|
var _this2$props3 = _this2.props,
|
|
329
335
|
_this2$props3$value = _this2$props3.value,
|
|
330
336
|
value = _this2$props3$value === void 0 ? {} : _this2$props3$value,
|
|
@@ -345,25 +351,25 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
|
|
|
345
351
|
requiredColor: requiredColor
|
|
346
352
|
});
|
|
347
353
|
});
|
|
348
|
-
_defineProperty(_this2, "getOptions", function (key, options) {
|
|
354
|
+
_defineProperty(_assertThisInitialized(_this2), "getOptions", function (key, options) {
|
|
349
355
|
var higher = _this2.props.options || {};
|
|
350
356
|
return higher[key] || options;
|
|
351
357
|
});
|
|
352
|
-
_defineProperty(_this2, "toEmpty", function (props) {});
|
|
353
|
-
_defineProperty(_this2, "toText", function (props) {
|
|
358
|
+
_defineProperty(_assertThisInitialized(_this2), "toEmpty", function (props) {});
|
|
359
|
+
_defineProperty(_assertThisInitialized(_this2), "toText", function (props) {
|
|
354
360
|
return /*#__PURE__*/React.createElement(Controlled, props);
|
|
355
361
|
});
|
|
356
|
-
_defineProperty(_this2, "toPassword", function (props) {
|
|
362
|
+
_defineProperty(_assertThisInitialized(_this2), "toPassword", function (props) {
|
|
357
363
|
return /*#__PURE__*/React.createElement(Controlled, props);
|
|
358
364
|
});
|
|
359
|
-
_defineProperty(_this2, "toEditor", function (props, control) {
|
|
365
|
+
_defineProperty(_assertThisInitialized(_this2), "toEditor", function (props, control) {
|
|
360
366
|
props.inputKey = control.key;
|
|
361
367
|
return /*#__PURE__*/React.createElement(Controlled, props);
|
|
362
368
|
});
|
|
363
|
-
_defineProperty(_this2, "toSelectWriting", function (props, control) {
|
|
369
|
+
_defineProperty(_assertThisInitialized(_this2), "toSelectWriting", function (props, control) {
|
|
364
370
|
return /*#__PURE__*/React.createElement(Controlled, props);
|
|
365
371
|
});
|
|
366
|
-
_defineProperty(_this2, "toTextArea", function (props, control) {
|
|
372
|
+
_defineProperty(_assertThisInitialized(_this2), "toTextArea", function (props, control) {
|
|
367
373
|
if (control.allFullFather) {
|
|
368
374
|
props.rows = control.rows;
|
|
369
375
|
props.maxLength = control.maxLength;
|
|
@@ -378,22 +384,22 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
|
|
|
378
384
|
}
|
|
379
385
|
return /*#__PURE__*/React.createElement(Controlled, props);
|
|
380
386
|
});
|
|
381
|
-
_defineProperty(_this2, "toNumber", function (props) {
|
|
387
|
+
_defineProperty(_assertThisInitialized(_this2), "toNumber", function (props) {
|
|
382
388
|
props.defaultValue = props.value;
|
|
383
389
|
delete props.value;
|
|
384
390
|
return /*#__PURE__*/React.createElement(Control, props);
|
|
385
391
|
});
|
|
386
|
-
_defineProperty(_this2, "toDoubleInput", function (props, control, cc) {
|
|
387
|
-
var
|
|
392
|
+
_defineProperty(_assertThisInitialized(_this2), "toDoubleInput", function (props, control, cc) {
|
|
393
|
+
var _context20, _context21;
|
|
388
394
|
props.defaultValue = props.value;
|
|
389
395
|
props.doubleKey = props.key;
|
|
390
396
|
props.doubleValue = helper.getObject(cc, props.key);
|
|
391
|
-
props.onChangeKey1 = _bindInstanceProperty(
|
|
392
|
-
props.onChangeKey2 = _bindInstanceProperty(
|
|
397
|
+
props.onChangeKey1 = _bindInstanceProperty(_context20 = _this2.onChange).call(_context20, _assertThisInitialized(_this2), props.key[0]);
|
|
398
|
+
props.onChangeKey2 = _bindInstanceProperty(_context21 = _this2.onChange).call(_context21, _assertThisInitialized(_this2), props.key[1]);
|
|
393
399
|
delete props.value;
|
|
394
400
|
return /*#__PURE__*/React.createElement(Control, props);
|
|
395
401
|
});
|
|
396
|
-
_defineProperty(_this2, "toSelect", function (props, _ref6) {
|
|
402
|
+
_defineProperty(_assertThisInitialized(_this2), "toSelect", function (props, _ref6) {
|
|
397
403
|
var options = _ref6.options,
|
|
398
404
|
key = _ref6.key;
|
|
399
405
|
props.getPopupContainer = _this2.getPopupContainer;
|
|
@@ -401,14 +407,14 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
|
|
|
401
407
|
props.dropdownMatchSelectWidth = false;
|
|
402
408
|
return /*#__PURE__*/React.createElement(Control, props);
|
|
403
409
|
});
|
|
404
|
-
_defineProperty(_this2, "toTreeSelect", function (props, filter) {
|
|
410
|
+
_defineProperty(_assertThisInitialized(_this2), "toTreeSelect", function (props, filter) {
|
|
405
411
|
var container = _this2.getContainer();
|
|
406
412
|
container && (props.getPopupContainer = container);
|
|
407
413
|
props.options = _this2.getOptions(filter);
|
|
408
414
|
props.onSearch = _this2.createSearchEvent(filter);
|
|
409
415
|
return /*#__PURE__*/React.createElement(Control, props);
|
|
410
416
|
});
|
|
411
|
-
_defineProperty(_this2, "createSearchEvent", function (control) {
|
|
417
|
+
_defineProperty(_assertThisInitialized(_this2), "createSearchEvent", function (control) {
|
|
412
418
|
if (_this2.props.onSearch) {
|
|
413
419
|
return function (value) {
|
|
414
420
|
return _this2.props.onSearch(control.key, value, control);
|
|
@@ -417,7 +423,7 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
|
|
|
417
423
|
return null;
|
|
418
424
|
}
|
|
419
425
|
});
|
|
420
|
-
_defineProperty(_this2, "createGetCodeEvent", function (control) {
|
|
426
|
+
_defineProperty(_assertThisInitialized(_this2), "createGetCodeEvent", function (control) {
|
|
421
427
|
if (_this2.props.onGetCode) {
|
|
422
428
|
return function (value) {
|
|
423
429
|
return _this2.props.onGetCode(control.key, value, control);
|
|
@@ -426,14 +432,14 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
|
|
|
426
432
|
return null;
|
|
427
433
|
}
|
|
428
434
|
});
|
|
429
|
-
_defineProperty(_this2, "toSearch", function (props, control) {
|
|
435
|
+
_defineProperty(_assertThisInitialized(_this2), "toSearch", function (props, control) {
|
|
430
436
|
props.getPopupContainer = _this2.getPopupContainer;
|
|
431
437
|
props.options = _this2.getOptions(control.key, control.options);
|
|
432
438
|
props.onSearch = _this2.createSearchEvent(control);
|
|
433
439
|
props.dropdownMatchSelectWidth = false;
|
|
434
440
|
return /*#__PURE__*/React.createElement(Control, props);
|
|
435
441
|
});
|
|
436
|
-
_defineProperty(_this2, "toDate", function (props, _ref7) {
|
|
442
|
+
_defineProperty(_assertThisInitialized(_this2), "toDate", function (props, _ref7) {
|
|
437
443
|
var rule = _ref7.rule;
|
|
438
444
|
props.getCalendarContainer = _this2.getPopupContainer;
|
|
439
445
|
props.style = {
|
|
@@ -442,7 +448,7 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
|
|
|
442
448
|
rule && (props.disabledDate = _this2.validDate(rule));
|
|
443
449
|
return /*#__PURE__*/React.createElement(Control, props);
|
|
444
450
|
});
|
|
445
|
-
_defineProperty(_this2, "toRangePicker", function (props, _ref8) {
|
|
451
|
+
_defineProperty(_assertThisInitialized(_this2), "toRangePicker", function (props, _ref8) {
|
|
446
452
|
var rule = _ref8.rule;
|
|
447
453
|
props.getCalendarContainer = _this2.getPopupContainer;
|
|
448
454
|
props.style = {
|
|
@@ -451,32 +457,32 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
|
|
|
451
457
|
// rule && (props.disabledDate = this.validDate(rule));
|
|
452
458
|
return /*#__PURE__*/React.createElement(Control, props);
|
|
453
459
|
});
|
|
454
|
-
_defineProperty(_this2, "toRadioGroup", function (props, _ref9) {
|
|
460
|
+
_defineProperty(_assertThisInitialized(_this2), "toRadioGroup", function (props, _ref9) {
|
|
455
461
|
var key = _ref9.key,
|
|
456
462
|
options = _ref9.options;
|
|
457
463
|
props.options = _this2.getOptions(key, options);
|
|
458
464
|
return /*#__PURE__*/React.createElement(Control, props);
|
|
459
465
|
});
|
|
460
|
-
_defineProperty(_this2, "captcha", function (props, control) {
|
|
466
|
+
_defineProperty(_assertThisInitialized(_this2), "captcha", function (props, control) {
|
|
461
467
|
props.onGetCode = _this2.props.onGetCode;
|
|
462
468
|
return /*#__PURE__*/React.createElement(Control, props);
|
|
463
469
|
});
|
|
464
|
-
_defineProperty(_this2, "toReadonly", function (props,
|
|
465
|
-
var options =
|
|
466
|
-
key =
|
|
470
|
+
_defineProperty(_assertThisInitialized(_this2), "toReadonly", function (props, _ref10) {
|
|
471
|
+
var options = _ref10.options,
|
|
472
|
+
key = _ref10.key;
|
|
467
473
|
props.value = getTitle(props.value, _this2.getOptions(key, options));
|
|
468
474
|
return /*#__PURE__*/React.createElement(Control, props);
|
|
469
475
|
});
|
|
470
|
-
_defineProperty(_this2, "selectSearch", function (props, control) {
|
|
476
|
+
_defineProperty(_assertThisInitialized(_this2), "selectSearch", function (props, control) {
|
|
471
477
|
props.getPopupContainer = _this2.getPopupContainer;
|
|
472
478
|
props.options = _this2.getOptions(control.key, control.options);
|
|
473
479
|
props.onSearch = _this2.createSearchEvent(control);
|
|
474
480
|
props.dropdownMatchSelectWidth = false;
|
|
475
481
|
return /*#__PURE__*/React.createElement(Control, props);
|
|
476
482
|
});
|
|
477
|
-
_defineProperty(_this2, "area", function (props,
|
|
478
|
-
var key =
|
|
479
|
-
options =
|
|
483
|
+
_defineProperty(_assertThisInitialized(_this2), "area", function (props, _ref11) {
|
|
484
|
+
var key = _ref11.key,
|
|
485
|
+
options = _ref11.options;
|
|
480
486
|
var readonly = _this2.props.readonly;
|
|
481
487
|
props.parentKey = key;
|
|
482
488
|
props.options = _this2.getOptions(key, options);
|
|
@@ -486,17 +492,17 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
|
|
|
486
492
|
}) ? true : false;
|
|
487
493
|
return /*#__PURE__*/React.createElement(Control, props);
|
|
488
494
|
});
|
|
489
|
-
_defineProperty(_this2, "uploadImg", function (props, control) {
|
|
490
|
-
var
|
|
495
|
+
_defineProperty(_assertThisInitialized(_this2), "uploadImg", function (props, control) {
|
|
496
|
+
var _context22;
|
|
491
497
|
var readonly = _this2.props.readonly;
|
|
492
498
|
props.required = control.required || false;
|
|
493
|
-
props.onFileChange = _bindInstanceProperty(
|
|
499
|
+
props.onFileChange = _bindInstanceProperty(_context22 = _this2.onFileChange).call(_context22, _assertThisInitialized(_this2), control);
|
|
494
500
|
props.readonly = readonly === true || _Array$isArray(readonly) && _someInstanceProperty(readonly).call(readonly, function (readonlyKey) {
|
|
495
501
|
return readonlyKey === control.key;
|
|
496
502
|
}) ? true : false;
|
|
497
503
|
return /*#__PURE__*/React.createElement(Control, props);
|
|
498
504
|
});
|
|
499
|
-
_defineProperty(_this2, "toCascader", function (props, control) {
|
|
505
|
+
_defineProperty(_assertThisInitialized(_this2), "toCascader", function (props, control) {
|
|
500
506
|
var container = _this2.getContainer();
|
|
501
507
|
container && (props.getPopupContainer = container);
|
|
502
508
|
props.options = control.options || [];
|
|
@@ -505,17 +511,17 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
|
|
|
505
511
|
props.loadData = _this2.createSearchEvent(control);
|
|
506
512
|
return /*#__PURE__*/React.createElement(Control, props);
|
|
507
513
|
});
|
|
508
|
-
_defineProperty(_this2, "toCheckbox", function (props, control) {
|
|
509
|
-
var
|
|
514
|
+
_defineProperty(_assertThisInitialized(_this2), "toCheckbox", function (props, control) {
|
|
515
|
+
var _context23;
|
|
510
516
|
var options = control.options || [];
|
|
511
517
|
return /*#__PURE__*/React.createElement(_Checkbox.Group, {
|
|
512
518
|
options: options,
|
|
513
519
|
disabled: _this2.props.readonly === true,
|
|
514
|
-
onChange: _bindInstanceProperty(
|
|
520
|
+
onChange: _bindInstanceProperty(_context23 = _this2.onBlur).call(_context23, _assertThisInitialized(_this2), control.key),
|
|
515
521
|
value: _this2.props.value[control.key]
|
|
516
522
|
});
|
|
517
523
|
});
|
|
518
|
-
_defineProperty(_this2, "toControl", function (props, control) {
|
|
524
|
+
_defineProperty(_assertThisInitialized(_this2), "toControl", function (props, control) {
|
|
519
525
|
switch (props.type) {
|
|
520
526
|
case 'readonly':
|
|
521
527
|
return _this2.toReadonly(props, control);
|
|
@@ -565,34 +571,34 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
|
|
|
565
571
|
return 'type error';
|
|
566
572
|
}
|
|
567
573
|
});
|
|
568
|
-
_defineProperty(_this2, "toLabel", function (
|
|
569
|
-
var title =
|
|
570
|
-
showAdd =
|
|
571
|
-
showQuery =
|
|
572
|
-
key =
|
|
573
|
-
showInfo =
|
|
574
|
-
showInfoTitle =
|
|
575
|
-
showIcon =
|
|
576
|
-
iconType =
|
|
574
|
+
_defineProperty(_assertThisInitialized(_this2), "toLabel", function (_ref12, type) {
|
|
575
|
+
var title = _ref12.title,
|
|
576
|
+
showAdd = _ref12.showAdd,
|
|
577
|
+
showQuery = _ref12.showQuery,
|
|
578
|
+
key = _ref12.key,
|
|
579
|
+
showInfo = _ref12.showInfo,
|
|
580
|
+
showInfoTitle = _ref12.showInfoTitle,
|
|
581
|
+
showIcon = _ref12.showIcon,
|
|
582
|
+
iconType = _ref12.iconType;
|
|
577
583
|
if (showAdd && type !== 'readonly') {
|
|
578
|
-
var
|
|
579
|
-
var onClick = _bindInstanceProperty(
|
|
584
|
+
var _context24;
|
|
585
|
+
var onClick = _bindInstanceProperty(_context24 = _this2.onAdd).call(_context24, _assertThisInitialized(_this2), key, title);
|
|
580
586
|
return /*#__PURE__*/React.createElement("span", null, title, /*#__PURE__*/React.createElement(_Icon, {
|
|
581
587
|
role: "add",
|
|
582
588
|
type: "plus-circle-o",
|
|
583
589
|
onClick: onClick
|
|
584
590
|
}));
|
|
585
591
|
} else if (showQuery && type !== 'readonly') {
|
|
586
|
-
var
|
|
587
|
-
var _onClick = _bindInstanceProperty(
|
|
592
|
+
var _context25;
|
|
593
|
+
var _onClick = _bindInstanceProperty(_context25 = _this2.onAdd).call(_context25, _assertThisInitialized(_this2), key, title);
|
|
588
594
|
return /*#__PURE__*/React.createElement("span", null, title, /*#__PURE__*/React.createElement(_Icon, {
|
|
589
595
|
role: "add",
|
|
590
596
|
type: "search",
|
|
591
597
|
onClick: _onClick
|
|
592
598
|
}));
|
|
593
599
|
} else if (showIcon && iconType && type !== 'readonly' && showInfoTitle) {
|
|
594
|
-
var
|
|
595
|
-
var _onClick2 = _bindInstanceProperty(
|
|
600
|
+
var _context26;
|
|
601
|
+
var _onClick2 = _bindInstanceProperty(_context26 = _this2.onAdd).call(_context26, _assertThisInitialized(_this2), key, title);
|
|
596
602
|
return /*#__PURE__*/React.createElement("span", null, title, /*#__PURE__*/React.createElement(_Tooltip, {
|
|
597
603
|
title: showInfoTitle
|
|
598
604
|
}, /*#__PURE__*/React.createElement(_Icon, {
|
|
@@ -601,8 +607,8 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
|
|
|
601
607
|
onClick: _onClick2
|
|
602
608
|
})));
|
|
603
609
|
} else if (showIcon && iconType && type !== 'readonly') {
|
|
604
|
-
var
|
|
605
|
-
var _onClick3 = _bindInstanceProperty(
|
|
610
|
+
var _context27;
|
|
611
|
+
var _onClick3 = _bindInstanceProperty(_context27 = _this2.onAdd).call(_context27, _assertThisInitialized(_this2), key, title);
|
|
606
612
|
return /*#__PURE__*/React.createElement("span", null, title, /*#__PURE__*/React.createElement(_Icon, {
|
|
607
613
|
role: "add",
|
|
608
614
|
type: iconType,
|
|
@@ -618,7 +624,7 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
|
|
|
618
624
|
return title;
|
|
619
625
|
}
|
|
620
626
|
});
|
|
621
|
-
_defineProperty(_this2, "toCol", function (span, control) {
|
|
627
|
+
_defineProperty(_assertThisInitialized(_this2), "toCol", function (span, control) {
|
|
622
628
|
var factor = control.span || 1;
|
|
623
629
|
var status = _this2.getValidState(control);
|
|
624
630
|
var controlProps = _this2.getControlProps(control, status);
|
|
@@ -639,7 +645,7 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
|
|
|
639
645
|
key: control.key
|
|
640
646
|
}, checkable && /*#__PURE__*/React.createElement(_Checkbox, {
|
|
641
647
|
className: variables('SuperForm2').checkbox,
|
|
642
|
-
onChange: _bindInstanceProperty(onCheckItem).call(onCheckItem, _this2, control),
|
|
648
|
+
onChange: _bindInstanceProperty(onCheckItem).call(onCheckItem, _assertThisInitialized(_this2), control),
|
|
643
649
|
checked: control.checked
|
|
644
650
|
}), /*#__PURE__*/React.createElement(FormItem, _extends({}, itemProps, {
|
|
645
651
|
className: checkable ? variables('SuperForm2').formItemWithCheckbox : '',
|
|
@@ -667,8 +673,8 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
|
|
|
667
673
|
}
|
|
668
674
|
});
|
|
669
675
|
});
|
|
670
|
-
_defineProperty(_this2, "toCols", function () {
|
|
671
|
-
var
|
|
676
|
+
_defineProperty(_assertThisInitialized(_this2), "toCols", function () {
|
|
677
|
+
var _context28;
|
|
672
678
|
var _this2$props5 = _this2.props,
|
|
673
679
|
_this2$props5$colNum = _this2$props5.colNum,
|
|
674
680
|
colNum = _this2$props5$colNum === void 0 ? defaultColNum : _this2$props5$colNum,
|
|
@@ -677,7 +683,7 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
|
|
|
677
683
|
colNum = 1;
|
|
678
684
|
}
|
|
679
685
|
var span = 24 / colNum;
|
|
680
|
-
return _mapInstanceProperty(
|
|
686
|
+
return _mapInstanceProperty(_context28 = _this2.getControls()).call(_context28, function (control) {
|
|
681
687
|
if (allFullFather) {
|
|
682
688
|
control.allFullFather = allFullFather;
|
|
683
689
|
}
|
|
@@ -686,8 +692,7 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
|
|
|
686
692
|
});
|
|
687
693
|
return _this2;
|
|
688
694
|
}
|
|
689
|
-
|
|
690
|
-
return _createClass(SuperForm2, [{
|
|
695
|
+
_createClass(SuperForm2, [{
|
|
691
696
|
key: "render",
|
|
692
697
|
value: function render() {
|
|
693
698
|
this.initValidState();
|
|
@@ -705,6 +710,7 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
|
|
|
705
710
|
}, this.toCols())));
|
|
706
711
|
}
|
|
707
712
|
}]);
|
|
713
|
+
return SuperForm2;
|
|
708
714
|
}(React.Component);
|
|
709
715
|
_defineProperty(SuperForm2, "propTypes", {
|
|
710
716
|
controls: PropTypes.arrayOf(PropTypes.shape(ControlType)).isRequired,
|