cloud-b2b 1.1.63 → 1.1.65
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 +11 -8
- 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 +22 -19
- 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 +110 -109
- 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 +100 -96
- 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 +71 -68
- package/es/SuperTable2/SuperTable2.js +88 -85
- 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 +14 -11
- package/es/SuperUpload/SuperUpload.js +74 -74
- 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 +11 -8
- 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 +22 -19
- 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 +112 -110
- 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 +102 -97
- 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 +71 -68
- package/lib/SuperTable2/SuperTable2.js +90 -86
- 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 +14 -11
- package/lib/SuperUpload/SuperUpload.js +76 -75
- 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
|
@@ -14,9 +14,10 @@ import _Icon from "antd/es/icon";
|
|
|
14
14
|
import _typeof from "@babel/runtime-corejs3/helpers/typeof";
|
|
15
15
|
import _classCallCheck from "@babel/runtime-corejs3/helpers/classCallCheck";
|
|
16
16
|
import _createClass from "@babel/runtime-corejs3/helpers/createClass";
|
|
17
|
+
import _assertThisInitialized from "@babel/runtime-corejs3/helpers/assertThisInitialized";
|
|
18
|
+
import _inherits from "@babel/runtime-corejs3/helpers/inherits";
|
|
17
19
|
import _possibleConstructorReturn from "@babel/runtime-corejs3/helpers/possibleConstructorReturn";
|
|
18
20
|
import _getPrototypeOf from "@babel/runtime-corejs3/helpers/getPrototypeOf";
|
|
19
|
-
import _inherits from "@babel/runtime-corejs3/helpers/inherits";
|
|
20
21
|
import _defineProperty from "@babel/runtime-corejs3/helpers/defineProperty";
|
|
21
22
|
import _Form from "antd/es/form";
|
|
22
23
|
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
|
|
@@ -27,9 +28,9 @@ import _includesInstanceProperty from "@babel/runtime-corejs3/core-js-stable/ins
|
|
|
27
28
|
import _bindInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/bind";
|
|
28
29
|
import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
|
|
29
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; }
|
|
30
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var
|
|
31
|
-
function
|
|
32
|
-
function _isNativeReflectConstruct() {
|
|
31
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context17, _context18; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context17 = ownKeys(Object(t), !0)).call(_context17, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context18 = ownKeys(Object(t))).call(_context18, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
32
|
+
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); }; }
|
|
33
|
+
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; } }
|
|
33
34
|
import React from 'react';
|
|
34
35
|
import PropTypes from 'prop-types';
|
|
35
36
|
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 SuperForm = /*#__PURE__*/function (_React$Component2) {
|
|
122
|
+
_inherits(SuperForm, _React$Component2);
|
|
123
|
+
var _super2 = _createSuper(SuperForm);
|
|
119
124
|
function SuperForm() {
|
|
120
125
|
var _context;
|
|
121
126
|
var _this2;
|
|
@@ -123,31 +128,31 @@ var SuperForm = /*#__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, "onChange", function (key, value) {
|
|
136
|
+
_defineProperty(_assertThisInitialized(_this2), "onChange", function (key, value) {
|
|
132
137
|
var onChange = _this2.props.onChange;
|
|
133
138
|
if (onChange) {
|
|
134
139
|
_this2.onExitValid(key);
|
|
135
140
|
onChange(key, value);
|
|
136
141
|
}
|
|
137
142
|
});
|
|
138
|
-
_defineProperty(_this2, "onBlur", function (key, value) {
|
|
143
|
+
_defineProperty(_assertThisInitialized(_this2), "onBlur", function (key, value) {
|
|
139
144
|
var onChange = _this2.props.onChange;
|
|
140
145
|
if (onChange) {
|
|
141
146
|
_this2.onExitValid(key);
|
|
142
147
|
onChange(key, value);
|
|
143
148
|
}
|
|
144
149
|
});
|
|
145
|
-
_defineProperty(_this2, "onFileChange", function (_ref, file) {
|
|
150
|
+
_defineProperty(_assertThisInitialized(_this2), "onFileChange", function (_ref, file) {
|
|
146
151
|
var key = _ref.key;
|
|
147
152
|
var onFileChange = _this2.props.onFileChange;
|
|
148
153
|
onFileChange && onFileChange(key, file);
|
|
149
154
|
});
|
|
150
|
-
_defineProperty(_this2, "onExitValid", function (key, value) {
|
|
155
|
+
_defineProperty(_assertThisInitialized(_this2), "onExitValid", function (key, value) {
|
|
151
156
|
if (key === _this2.validKey) {
|
|
152
157
|
_this2.validKey = '';
|
|
153
158
|
_this2.props.onExitValid();
|
|
@@ -155,7 +160,7 @@ var SuperForm = /*#__PURE__*/function (_React$Component2) {
|
|
|
155
160
|
_this2.props.onChangeOperate && _this2.props.onChangeOperate(key, value);
|
|
156
161
|
});
|
|
157
162
|
// 动态生成getValidState方法
|
|
158
|
-
_defineProperty(_this2, "initValidState", function () {
|
|
163
|
+
_defineProperty(_assertThisInitialized(_this2), "initValidState", function () {
|
|
159
164
|
var _this2$props = _this2.props,
|
|
160
165
|
value = _this2$props.value,
|
|
161
166
|
valid = _this2$props.valid;
|
|
@@ -176,7 +181,7 @@ var SuperForm = /*#__PURE__*/function (_React$Component2) {
|
|
|
176
181
|
};
|
|
177
182
|
_this2.getValidState = valid ? _valid : invalid;
|
|
178
183
|
});
|
|
179
|
-
_defineProperty(_this2, "validDate", function (_ref3) {
|
|
184
|
+
_defineProperty(_assertThisInitialized(_this2), "validDate", function (_ref3) {
|
|
180
185
|
var key = _ref3.key,
|
|
181
186
|
type = _ref3.type;
|
|
182
187
|
return function (date) {
|
|
@@ -195,25 +200,25 @@ var SuperForm = /*#__PURE__*/function (_React$Component2) {
|
|
|
195
200
|
}
|
|
196
201
|
};
|
|
197
202
|
});
|
|
198
|
-
_defineProperty(_this2, "getPopupContainer", function () {
|
|
203
|
+
_defineProperty(_assertThisInitialized(_this2), "getPopupContainer", function () {
|
|
199
204
|
var container = _this2.props.container;
|
|
200
205
|
if (typeof container === 'undefined') {
|
|
201
|
-
return ReactDOM.findDOMNode(_this2);
|
|
206
|
+
return ReactDOM.findDOMNode(_assertThisInitialized(_this2));
|
|
202
207
|
} else if (typeof container === 'boolean') {
|
|
203
208
|
return document.body;
|
|
204
209
|
} else {
|
|
205
210
|
return ReactDOM.findDOMNode(container);
|
|
206
211
|
}
|
|
207
212
|
});
|
|
208
|
-
_defineProperty(_this2, "getMaxWidth", function () {
|
|
213
|
+
_defineProperty(_assertThisInitialized(_this2), "getMaxWidth", function () {
|
|
209
214
|
var _this2$props$colNum = _this2.props.colNum,
|
|
210
215
|
colNum = _this2$props$colNum === void 0 ? defaultColNum : _this2$props$colNum;
|
|
211
216
|
return colNum * 250;
|
|
212
217
|
});
|
|
213
|
-
_defineProperty(_this2, "getContainer", function () {
|
|
218
|
+
_defineProperty(_assertThisInitialized(_this2), "getContainer", function () {
|
|
214
219
|
return _this2.props.getContainer;
|
|
215
220
|
});
|
|
216
|
-
_defineProperty(_this2, "getControls", function () {
|
|
221
|
+
_defineProperty(_assertThisInitialized(_this2), "getControls", function () {
|
|
217
222
|
var _this2$props2 = _this2.props,
|
|
218
223
|
hideControls = _this2$props2.hideControls,
|
|
219
224
|
controls = _this2$props2.controls;
|
|
@@ -227,7 +232,7 @@ var SuperForm = /*#__PURE__*/function (_React$Component2) {
|
|
|
227
232
|
});
|
|
228
233
|
}
|
|
229
234
|
});
|
|
230
|
-
_defineProperty(_this2, "getType", function (_ref4) {
|
|
235
|
+
_defineProperty(_assertThisInitialized(_this2), "getType", function (_ref4) {
|
|
231
236
|
var _context2;
|
|
232
237
|
var key = _ref4.key,
|
|
233
238
|
type = _ref4.type;
|
|
@@ -246,7 +251,7 @@ var SuperForm = /*#__PURE__*/function (_React$Component2) {
|
|
|
246
251
|
return type;
|
|
247
252
|
}
|
|
248
253
|
});
|
|
249
|
-
_defineProperty(_this2, "specialProps", function (type, _ref5) {
|
|
254
|
+
_defineProperty(_assertThisInitialized(_this2), "specialProps", function (type, _ref5) {
|
|
250
255
|
var key = _ref5.key,
|
|
251
256
|
_ref5$props = _ref5.props,
|
|
252
257
|
props = _ref5$props === void 0 ? {} : _ref5$props,
|
|
@@ -266,48 +271,48 @@ var SuperForm = /*#__PURE__*/function (_React$Component2) {
|
|
|
266
271
|
type: 'textArea',
|
|
267
272
|
readonly: true,
|
|
268
273
|
style: style,
|
|
269
|
-
onBlur: _bindInstanceProperty(_context3 = _this2.onExitValid).call(_context3, _this2, key)
|
|
274
|
+
onBlur: _bindInstanceProperty(_context3 = _this2.onExitValid).call(_context3, _assertThisInitialized(_this2), key)
|
|
270
275
|
};
|
|
271
276
|
} else {
|
|
272
277
|
var _context4;
|
|
273
278
|
return {
|
|
274
279
|
style: style,
|
|
275
|
-
onBlur: _bindInstanceProperty(_context4 = _this2.onExitValid).call(_context4, _this2, key)
|
|
280
|
+
onBlur: _bindInstanceProperty(_context4 = _this2.onExitValid).call(_context4, _assertThisInitialized(_this2), key)
|
|
276
281
|
};
|
|
277
282
|
}
|
|
278
283
|
} else if (type === 'text' || type === 'textArea') {
|
|
279
284
|
var _context5, _context6;
|
|
280
285
|
return _objectSpread(_objectSpread({}, props), {}, {
|
|
281
|
-
onChange: _bindInstanceProperty(_context5 = _this2.onExitValid).call(_context5, _this2, key),
|
|
282
|
-
onBlur: _bindInstanceProperty(_context6 = _this2.onChange).call(_context6, _this2, key)
|
|
286
|
+
onChange: _bindInstanceProperty(_context5 = _this2.onExitValid).call(_context5, _assertThisInitialized(_this2), key),
|
|
287
|
+
onBlur: _bindInstanceProperty(_context6 = _this2.onChange).call(_context6, _assertThisInitialized(_this2), key)
|
|
283
288
|
});
|
|
284
289
|
} else if (type === 'date') {
|
|
285
290
|
var _context7, _context8;
|
|
286
291
|
var propsObj = _objectSpread(_objectSpread({}, props), {}, {
|
|
287
|
-
onChange: _bindInstanceProperty(_context7 = _this2.onBlur).call(_context7, _this2, key),
|
|
288
|
-
onBlur: _bindInstanceProperty(_context8 = _this2.onExitValid).call(_context8, _this2, key)
|
|
292
|
+
onChange: _bindInstanceProperty(_context7 = _this2.onBlur).call(_context7, _assertThisInitialized(_this2), key),
|
|
293
|
+
onBlur: _bindInstanceProperty(_context8 = _this2.onExitValid).call(_context8, _assertThisInitialized(_this2), key)
|
|
289
294
|
});
|
|
290
295
|
if (_this2.props.onOpenChange && typeof _this2.props.onOpenChange === 'function') {
|
|
291
296
|
var _context9;
|
|
292
|
-
propsObj.onOpenChange = _bindInstanceProperty(_context9 = _this2.props.onOpenChange).call(_context9, _this2, key);
|
|
297
|
+
propsObj.onOpenChange = _bindInstanceProperty(_context9 = _this2.props.onOpenChange).call(_context9, _assertThisInitialized(_this2), key);
|
|
293
298
|
}
|
|
294
299
|
return propsObj;
|
|
295
300
|
} else if (type === 'area') {
|
|
296
|
-
var
|
|
301
|
+
var _context10, _context11;
|
|
297
302
|
return _objectSpread(_objectSpread({}, props), {}, {
|
|
298
|
-
onChange: _bindInstanceProperty(
|
|
299
|
-
onBlur: _bindInstanceProperty(
|
|
303
|
+
onChange: _bindInstanceProperty(_context10 = _this2.onBlur).call(_context10, _assertThisInitialized(_this2), key),
|
|
304
|
+
onBlur: _bindInstanceProperty(_context11 = _this2.onExitValid).call(_context11, _assertThisInitialized(_this2), key),
|
|
300
305
|
onAreaSearch: _this2.props.onAreaSearch
|
|
301
306
|
});
|
|
302
307
|
} else {
|
|
303
|
-
var
|
|
308
|
+
var _context12, _context13;
|
|
304
309
|
return _objectSpread(_objectSpread({}, props), {}, {
|
|
305
|
-
onChange: _bindInstanceProperty(
|
|
306
|
-
onBlur: _bindInstanceProperty(
|
|
310
|
+
onChange: _bindInstanceProperty(_context12 = _this2.onBlur).call(_context12, _assertThisInitialized(_this2), key),
|
|
311
|
+
onBlur: _bindInstanceProperty(_context13 = _this2.onExitValid).call(_context13, _assertThisInitialized(_this2), key)
|
|
307
312
|
});
|
|
308
313
|
}
|
|
309
314
|
});
|
|
310
|
-
_defineProperty(_this2, "getControlProps", function (control, status) {
|
|
315
|
+
_defineProperty(_assertThisInitialized(_this2), "getControlProps", function (control, status) {
|
|
311
316
|
var _this2$props$value2 = _this2.props.value,
|
|
312
317
|
value = _this2$props$value2 === void 0 ? {} : _this2$props$value2;
|
|
313
318
|
var type = _this2.getType(control);
|
|
@@ -320,25 +325,25 @@ var SuperForm = /*#__PURE__*/function (_React$Component2) {
|
|
|
320
325
|
value: makeString(value[control.key])
|
|
321
326
|
});
|
|
322
327
|
});
|
|
323
|
-
_defineProperty(_this2, "getOptions", function (key, options) {
|
|
328
|
+
_defineProperty(_assertThisInitialized(_this2), "getOptions", function (key, options) {
|
|
324
329
|
var higher = _this2.props.options || {};
|
|
325
330
|
return higher[key] || options;
|
|
326
331
|
});
|
|
327
|
-
_defineProperty(_this2, "toEmpty", function (props) {});
|
|
328
|
-
_defineProperty(_this2, "toText", function (props) {
|
|
332
|
+
_defineProperty(_assertThisInitialized(_this2), "toEmpty", function (props) {});
|
|
333
|
+
_defineProperty(_assertThisInitialized(_this2), "toText", function (props) {
|
|
329
334
|
return /*#__PURE__*/React.createElement(Controlled, props);
|
|
330
335
|
});
|
|
331
|
-
_defineProperty(_this2, "toPassword", function (props) {
|
|
336
|
+
_defineProperty(_assertThisInitialized(_this2), "toPassword", function (props) {
|
|
332
337
|
return /*#__PURE__*/React.createElement(Controlled, props);
|
|
333
338
|
});
|
|
334
|
-
_defineProperty(_this2, "toEditor", function (props, control) {
|
|
339
|
+
_defineProperty(_assertThisInitialized(_this2), "toEditor", function (props, control) {
|
|
335
340
|
props.inputKey = control.key;
|
|
336
341
|
return /*#__PURE__*/React.createElement(Controlled, props);
|
|
337
342
|
});
|
|
338
|
-
_defineProperty(_this2, "toSelectWriting", function (props, control) {
|
|
343
|
+
_defineProperty(_assertThisInitialized(_this2), "toSelectWriting", function (props, control) {
|
|
339
344
|
return /*#__PURE__*/React.createElement(Controlled, props);
|
|
340
345
|
});
|
|
341
|
-
_defineProperty(_this2, "toTextArea", function (props, control) {
|
|
346
|
+
_defineProperty(_assertThisInitialized(_this2), "toTextArea", function (props, control) {
|
|
342
347
|
if (control.allFullFather) {
|
|
343
348
|
props.rows = control.rows;
|
|
344
349
|
props.maxLength = control.maxLength;
|
|
@@ -353,12 +358,12 @@ var SuperForm = /*#__PURE__*/function (_React$Component2) {
|
|
|
353
358
|
}
|
|
354
359
|
return /*#__PURE__*/React.createElement(Controlled, props);
|
|
355
360
|
});
|
|
356
|
-
_defineProperty(_this2, "toNumber", function (props) {
|
|
361
|
+
_defineProperty(_assertThisInitialized(_this2), "toNumber", function (props) {
|
|
357
362
|
props.defaultValue = props.value;
|
|
358
363
|
delete props.value;
|
|
359
364
|
return /*#__PURE__*/React.createElement(Control, props);
|
|
360
365
|
});
|
|
361
|
-
_defineProperty(_this2, "toSelect", function (props, _ref6) {
|
|
366
|
+
_defineProperty(_assertThisInitialized(_this2), "toSelect", function (props, _ref6) {
|
|
362
367
|
var options = _ref6.options,
|
|
363
368
|
key = _ref6.key;
|
|
364
369
|
props.getPopupContainer = _this2.getPopupContainer;
|
|
@@ -366,7 +371,7 @@ var SuperForm = /*#__PURE__*/function (_React$Component2) {
|
|
|
366
371
|
props.dropdownMatchSelectWidth = false;
|
|
367
372
|
return /*#__PURE__*/React.createElement(Control, props);
|
|
368
373
|
});
|
|
369
|
-
_defineProperty(_this2, "createSearchEvent", function (control) {
|
|
374
|
+
_defineProperty(_assertThisInitialized(_this2), "createSearchEvent", function (control) {
|
|
370
375
|
if (_this2.props.onSearch) {
|
|
371
376
|
return function (value) {
|
|
372
377
|
return _this2.props.onSearch(control.key, value, control);
|
|
@@ -375,14 +380,14 @@ var SuperForm = /*#__PURE__*/function (_React$Component2) {
|
|
|
375
380
|
return null;
|
|
376
381
|
}
|
|
377
382
|
});
|
|
378
|
-
_defineProperty(_this2, "toSearch", function (props, control) {
|
|
383
|
+
_defineProperty(_assertThisInitialized(_this2), "toSearch", function (props, control) {
|
|
379
384
|
props.getPopupContainer = _this2.getPopupContainer;
|
|
380
385
|
props.options = _this2.getOptions(control.key, control.options);
|
|
381
386
|
props.onSearch = _this2.createSearchEvent(control);
|
|
382
387
|
props.dropdownMatchSelectWidth = false;
|
|
383
388
|
return /*#__PURE__*/React.createElement(Control, props);
|
|
384
389
|
});
|
|
385
|
-
_defineProperty(_this2, "toDate", function (props, _ref7) {
|
|
390
|
+
_defineProperty(_assertThisInitialized(_this2), "toDate", function (props, _ref7) {
|
|
386
391
|
var rule = _ref7.rule;
|
|
387
392
|
props.getCalendarContainer = _this2.getPopupContainer;
|
|
388
393
|
props.style = {
|
|
@@ -391,28 +396,28 @@ var SuperForm = /*#__PURE__*/function (_React$Component2) {
|
|
|
391
396
|
rule && (props.disabledDate = _this2.validDate(rule));
|
|
392
397
|
return /*#__PURE__*/React.createElement(Control, props);
|
|
393
398
|
});
|
|
394
|
-
_defineProperty(_this2, "toRadioGroup", function (props, _ref8) {
|
|
399
|
+
_defineProperty(_assertThisInitialized(_this2), "toRadioGroup", function (props, _ref8) {
|
|
395
400
|
var key = _ref8.key,
|
|
396
401
|
options = _ref8.options;
|
|
397
402
|
props.options = _this2.getOptions(key, options);
|
|
398
403
|
return /*#__PURE__*/React.createElement(Control, props);
|
|
399
404
|
});
|
|
400
|
-
_defineProperty(_this2, "toReadonly", function (props, _ref9) {
|
|
405
|
+
_defineProperty(_assertThisInitialized(_this2), "toReadonly", function (props, _ref9) {
|
|
401
406
|
var options = _ref9.options,
|
|
402
407
|
key = _ref9.key;
|
|
403
408
|
props.value = getTitle(props.value, _this2.getOptions(key, options));
|
|
404
409
|
return /*#__PURE__*/React.createElement(Control, props);
|
|
405
410
|
});
|
|
406
|
-
_defineProperty(_this2, "selectSearch", function (props, control) {
|
|
411
|
+
_defineProperty(_assertThisInitialized(_this2), "selectSearch", function (props, control) {
|
|
407
412
|
props.getPopupContainer = _this2.getPopupContainer;
|
|
408
413
|
props.options = _this2.getOptions(control.key, control.options);
|
|
409
414
|
props.onSearch = _this2.createSearchEvent(control);
|
|
410
415
|
props.dropdownMatchSelectWidth = false;
|
|
411
416
|
return /*#__PURE__*/React.createElement(Control, props);
|
|
412
417
|
});
|
|
413
|
-
_defineProperty(_this2, "area", function (props,
|
|
414
|
-
var key =
|
|
415
|
-
options =
|
|
418
|
+
_defineProperty(_assertThisInitialized(_this2), "area", function (props, _ref10) {
|
|
419
|
+
var key = _ref10.key,
|
|
420
|
+
options = _ref10.options;
|
|
416
421
|
var readonly = _this2.props.readonly;
|
|
417
422
|
props.parentKey = key;
|
|
418
423
|
props.options = _this2.getOptions(key, options);
|
|
@@ -422,17 +427,17 @@ var SuperForm = /*#__PURE__*/function (_React$Component2) {
|
|
|
422
427
|
}) ? true : false;
|
|
423
428
|
return /*#__PURE__*/React.createElement(Control, props);
|
|
424
429
|
});
|
|
425
|
-
_defineProperty(_this2, "uploadImg", function (props, control) {
|
|
426
|
-
var
|
|
430
|
+
_defineProperty(_assertThisInitialized(_this2), "uploadImg", function (props, control) {
|
|
431
|
+
var _context14;
|
|
427
432
|
var readonly = _this2.props.readonly;
|
|
428
433
|
props.required = control.required || false;
|
|
429
|
-
props.onFileChange = _bindInstanceProperty(
|
|
434
|
+
props.onFileChange = _bindInstanceProperty(_context14 = _this2.onFileChange).call(_context14, _assertThisInitialized(_this2), control);
|
|
430
435
|
props.readonly = readonly === true || _Array$isArray(readonly) && _someInstanceProperty(readonly).call(readonly, function (readonlyKey) {
|
|
431
436
|
return readonlyKey === control.key;
|
|
432
437
|
}) ? true : false;
|
|
433
438
|
return /*#__PURE__*/React.createElement(Control, props);
|
|
434
439
|
});
|
|
435
|
-
_defineProperty(_this2, "toCascader", function (props, control) {
|
|
440
|
+
_defineProperty(_assertThisInitialized(_this2), "toCascader", function (props, control) {
|
|
436
441
|
var container = _this2.getContainer();
|
|
437
442
|
container && (props.getPopupContainer = container);
|
|
438
443
|
props.options = control.options || [];
|
|
@@ -441,7 +446,7 @@ var SuperForm = /*#__PURE__*/function (_React$Component2) {
|
|
|
441
446
|
props.loadData = _this2.createSearchEvent(control);
|
|
442
447
|
return /*#__PURE__*/React.createElement(Control, props);
|
|
443
448
|
});
|
|
444
|
-
_defineProperty(_this2, "toTreeSelect", function (props, filter) {
|
|
449
|
+
_defineProperty(_assertThisInitialized(_this2), "toTreeSelect", function (props, filter) {
|
|
445
450
|
var container = _this2.getContainer();
|
|
446
451
|
container && (props.getPopupContainer = container);
|
|
447
452
|
props.options = _this2.getOptions(filter);
|
|
@@ -449,7 +454,7 @@ var SuperForm = /*#__PURE__*/function (_React$Component2) {
|
|
|
449
454
|
props.placeholder = filter.placeholder || '';
|
|
450
455
|
return /*#__PURE__*/React.createElement(Control, props);
|
|
451
456
|
});
|
|
452
|
-
_defineProperty(_this2, "toControl", function (props, control) {
|
|
457
|
+
_defineProperty(_assertThisInitialized(_this2), "toControl", function (props, control) {
|
|
453
458
|
switch (props.type) {
|
|
454
459
|
case 'readonly':
|
|
455
460
|
return _this2.toReadonly(props, control);
|
|
@@ -491,13 +496,13 @@ var SuperForm = /*#__PURE__*/function (_React$Component2) {
|
|
|
491
496
|
return 'type error';
|
|
492
497
|
}
|
|
493
498
|
});
|
|
494
|
-
_defineProperty(_this2, "toLabel", function (
|
|
495
|
-
var title =
|
|
496
|
-
showAdd =
|
|
497
|
-
key =
|
|
499
|
+
_defineProperty(_assertThisInitialized(_this2), "toLabel", function (_ref11, type) {
|
|
500
|
+
var title = _ref11.title,
|
|
501
|
+
showAdd = _ref11.showAdd,
|
|
502
|
+
key = _ref11.key;
|
|
498
503
|
if (showAdd && type !== 'readonly') {
|
|
499
|
-
var
|
|
500
|
-
var onClick = _bindInstanceProperty(
|
|
504
|
+
var _context15;
|
|
505
|
+
var onClick = _bindInstanceProperty(_context15 = _this2.onAdd).call(_context15, _assertThisInitialized(_this2), key, title);
|
|
501
506
|
return /*#__PURE__*/React.createElement("span", null, title, /*#__PURE__*/React.createElement(_Icon, {
|
|
502
507
|
role: "add",
|
|
503
508
|
type: "plus-circle-o",
|
|
@@ -507,7 +512,7 @@ var SuperForm = /*#__PURE__*/function (_React$Component2) {
|
|
|
507
512
|
return title;
|
|
508
513
|
}
|
|
509
514
|
});
|
|
510
|
-
_defineProperty(_this2, "toCol", function (span, control) {
|
|
515
|
+
_defineProperty(_assertThisInitialized(_this2), "toCol", function (span, control) {
|
|
511
516
|
var factor = control.span || 1;
|
|
512
517
|
var status = _this2.getValidState(control);
|
|
513
518
|
var controlProps = _this2.getControlProps(control, status);
|
|
@@ -524,7 +529,7 @@ var SuperForm = /*#__PURE__*/function (_React$Component2) {
|
|
|
524
529
|
key: control.key
|
|
525
530
|
}, checkable && /*#__PURE__*/React.createElement(_Checkbox, {
|
|
526
531
|
className: variables('SuperForm').checkbox,
|
|
527
|
-
onChange: _bindInstanceProperty(onCheckItem).call(onCheckItem, _this2, control),
|
|
532
|
+
onChange: _bindInstanceProperty(onCheckItem).call(onCheckItem, _assertThisInitialized(_this2), control),
|
|
528
533
|
checked: control.checked
|
|
529
534
|
}), /*#__PURE__*/React.createElement(FormItem, _extends({}, itemProps, {
|
|
530
535
|
className: checkable ? variables('SuperForm').formItemWithCheckbox : ''
|
|
@@ -536,8 +541,8 @@ var SuperForm = /*#__PURE__*/function (_React$Component2) {
|
|
|
536
541
|
}
|
|
537
542
|
});
|
|
538
543
|
});
|
|
539
|
-
_defineProperty(_this2, "toCols", function () {
|
|
540
|
-
var
|
|
544
|
+
_defineProperty(_assertThisInitialized(_this2), "toCols", function () {
|
|
545
|
+
var _context16;
|
|
541
546
|
var _this2$props4 = _this2.props,
|
|
542
547
|
_this2$props4$colNum = _this2$props4.colNum,
|
|
543
548
|
colNum = _this2$props4$colNum === void 0 ? defaultColNum : _this2$props4$colNum,
|
|
@@ -546,7 +551,7 @@ var SuperForm = /*#__PURE__*/function (_React$Component2) {
|
|
|
546
551
|
colNum = 1;
|
|
547
552
|
}
|
|
548
553
|
var span = 24 / colNum;
|
|
549
|
-
return _mapInstanceProperty(
|
|
554
|
+
return _mapInstanceProperty(_context16 = _this2.getControls()).call(_context16, function (control) {
|
|
550
555
|
if (allFullFather) {
|
|
551
556
|
control.allFullFather = allFullFather;
|
|
552
557
|
}
|
|
@@ -555,8 +560,7 @@ var SuperForm = /*#__PURE__*/function (_React$Component2) {
|
|
|
555
560
|
});
|
|
556
561
|
return _this2;
|
|
557
562
|
}
|
|
558
|
-
|
|
559
|
-
return _createClass(SuperForm, [{
|
|
563
|
+
_createClass(SuperForm, [{
|
|
560
564
|
key: "render",
|
|
561
565
|
value: function render() {
|
|
562
566
|
this.initValidState();
|
|
@@ -572,6 +576,7 @@ var SuperForm = /*#__PURE__*/function (_React$Component2) {
|
|
|
572
576
|
}, this.toCols())));
|
|
573
577
|
}
|
|
574
578
|
}]);
|
|
579
|
+
return SuperForm;
|
|
575
580
|
}(React.Component);
|
|
576
581
|
_defineProperty(SuperForm, "propTypes", {
|
|
577
582
|
controls: PropTypes.arrayOf(PropTypes.shape(ControlType)).isRequired,
|