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