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