cloud-b2b 1.1.69 → 1.1.71
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 +8 -11
- package/es/CodeInput/CodeInput.js +16 -19
- package/es/Control/Control.js +21 -3
- 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 +22 -24
- 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 +114 -105
- package/es/SuperForm2/SuperForm.less +7 -0
- 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/SuperTableCell.js +27 -30
- package/es/SuperTable3/FilterDropDown.js +11 -14
- package/es/SuperTable3/SuperTable.js +58 -61
- package/es/SuperToolbar/SuperToolbar.js +11 -14
- package/es/SuperUpload/SuperUpload.js +74 -74
- 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 +8 -11
- package/lib/CodeInput/CodeInput.js +16 -19
- package/lib/Control/Control.js +21 -3
- 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 +22 -24
- 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 +115 -107
- package/lib/SuperForm2/SuperForm.less +7 -0
- 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/SuperTableCell.js +27 -30
- package/lib/SuperTable3/FilterDropDown.js +11 -14
- package/lib/SuperTable3/SuperTable.js +58 -61
- package/lib/SuperToolbar/SuperToolbar.js +11 -14
- package/lib/SuperUpload/SuperUpload.js +75 -76
- 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
|
@@ -31,10 +31,9 @@ var _icon = _interopRequireDefault(require("antd/lib/icon"));
|
|
|
31
31
|
var _typeof2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/typeof"));
|
|
32
32
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/classCallCheck"));
|
|
33
33
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/createClass"));
|
|
34
|
-
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/assertThisInitialized"));
|
|
35
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/inherits"));
|
|
36
34
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/possibleConstructorReturn"));
|
|
37
35
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/getPrototypeOf"));
|
|
36
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/inherits"));
|
|
38
37
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/defineProperty"));
|
|
39
38
|
var _form = _interopRequireDefault(require("antd/lib/form"));
|
|
40
39
|
var _react = _interopRequireDefault(require("react"));
|
|
@@ -43,12 +42,11 @@ var _reactDom = _interopRequireDefault(require("react-dom"));
|
|
|
43
42
|
var _helper = _interopRequireDefault(require("../helper"));
|
|
44
43
|
var _Control = _interopRequireWildcard(require("../Control"));
|
|
45
44
|
var _variables = _interopRequireDefault(require("../variables"));
|
|
46
|
-
function
|
|
47
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof3(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = _Object$defineProperty && _Object$getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? _Object$getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? _Object$defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
|
45
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof _WeakMap) var r = new _WeakMap(), n = new _WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof3(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = _Object$defineProperty) && _Object$getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
48
46
|
function ownKeys(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = _filterInstanceProperty2(o).call(o, function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
49
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var
|
|
50
|
-
function
|
|
51
|
-
function _isNativeReflectConstruct() {
|
|
47
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context15, _context16; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context15 = ownKeys(Object(t), !0)).call(_context15, function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context16 = ownKeys(Object(t))).call(_context16, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
48
|
+
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2["default"])(o), (0, _possibleConstructorReturn2["default"])(t, _isNativeReflectConstruct() ? _Reflect$construct(o, e || [], (0, _getPrototypeOf2["default"])(t).constructor) : o.apply(t, e)); }
|
|
49
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
52
50
|
var FormItem = _form["default"].Item;
|
|
53
51
|
var defaultSize = 'small';
|
|
54
52
|
var defaultColNum = 4;
|
|
@@ -78,13 +76,11 @@ var ControlType = {
|
|
|
78
76
|
props: _propTypes["default"].object
|
|
79
77
|
};
|
|
80
78
|
var Controlled = /*#__PURE__*/function (_React$Component) {
|
|
81
|
-
(0, _inherits2["default"])(Controlled, _React$Component);
|
|
82
|
-
var _super = _createSuper(Controlled);
|
|
83
79
|
function Controlled(props) {
|
|
84
80
|
var _this;
|
|
85
81
|
(0, _classCallCheck2["default"])(this, Controlled);
|
|
86
|
-
_this =
|
|
87
|
-
(0, _defineProperty2["default"])(
|
|
82
|
+
_this = _callSuper(this, Controlled, [props]);
|
|
83
|
+
(0, _defineProperty2["default"])(_this, "onChange", function (value) {
|
|
88
84
|
var onChange = _this.props.onChange;
|
|
89
85
|
_this.setState({
|
|
90
86
|
value: value
|
|
@@ -96,7 +92,8 @@ var Controlled = /*#__PURE__*/function (_React$Component) {
|
|
|
96
92
|
};
|
|
97
93
|
return _this;
|
|
98
94
|
}
|
|
99
|
-
(0,
|
|
95
|
+
(0, _inherits2["default"])(Controlled, _React$Component);
|
|
96
|
+
return (0, _createClass2["default"])(Controlled, [{
|
|
100
97
|
key: "componentWillReceiveProps",
|
|
101
98
|
value: function componentWillReceiveProps(nextProps) {
|
|
102
99
|
if (this.props.value !== nextProps.value) {
|
|
@@ -115,7 +112,6 @@ var Controlled = /*#__PURE__*/function (_React$Component) {
|
|
|
115
112
|
return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
|
|
116
113
|
}
|
|
117
114
|
}]);
|
|
118
|
-
return Controlled;
|
|
119
115
|
}(_react["default"].Component);
|
|
120
116
|
/**
|
|
121
117
|
* colNum:[可选],表单的列数,默认为4
|
|
@@ -131,8 +127,6 @@ var Controlled = /*#__PURE__*/function (_React$Component) {
|
|
|
131
127
|
* OnFileChange:上传组件触发,原型为func(key,{fileList, fileDeleteList})
|
|
132
128
|
*/
|
|
133
129
|
var SuperForm = /*#__PURE__*/function (_React$Component2) {
|
|
134
|
-
(0, _inherits2["default"])(SuperForm, _React$Component2);
|
|
135
|
-
var _super2 = _createSuper(SuperForm);
|
|
136
130
|
function SuperForm() {
|
|
137
131
|
var _context;
|
|
138
132
|
var _this2;
|
|
@@ -140,31 +134,31 @@ var SuperForm = /*#__PURE__*/function (_React$Component2) {
|
|
|
140
134
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
141
135
|
args[_key] = arguments[_key];
|
|
142
136
|
}
|
|
143
|
-
_this2 =
|
|
144
|
-
(0, _defineProperty2["default"])(
|
|
137
|
+
_this2 = _callSuper(this, SuperForm, (0, _concat["default"])(_context = []).call(_context, args));
|
|
138
|
+
(0, _defineProperty2["default"])(_this2, "onAdd", function (key, title) {
|
|
145
139
|
var onAdd = _this2.props.onAdd;
|
|
146
140
|
onAdd && onAdd(key, title);
|
|
147
141
|
});
|
|
148
|
-
(0, _defineProperty2["default"])(
|
|
142
|
+
(0, _defineProperty2["default"])(_this2, "onChange", function (key, value) {
|
|
149
143
|
var onChange = _this2.props.onChange;
|
|
150
144
|
if (onChange) {
|
|
151
145
|
_this2.onExitValid(key);
|
|
152
146
|
onChange(key, value);
|
|
153
147
|
}
|
|
154
148
|
});
|
|
155
|
-
(0, _defineProperty2["default"])(
|
|
149
|
+
(0, _defineProperty2["default"])(_this2, "onBlur", function (key, value) {
|
|
156
150
|
var onChange = _this2.props.onChange;
|
|
157
151
|
if (onChange) {
|
|
158
152
|
_this2.onExitValid(key);
|
|
159
153
|
onChange(key, value);
|
|
160
154
|
}
|
|
161
155
|
});
|
|
162
|
-
(0, _defineProperty2["default"])(
|
|
156
|
+
(0, _defineProperty2["default"])(_this2, "onFileChange", function (_ref, file) {
|
|
163
157
|
var key = _ref.key;
|
|
164
158
|
var onFileChange = _this2.props.onFileChange;
|
|
165
159
|
onFileChange && onFileChange(key, file);
|
|
166
160
|
});
|
|
167
|
-
(0, _defineProperty2["default"])(
|
|
161
|
+
(0, _defineProperty2["default"])(_this2, "onExitValid", function (key, value) {
|
|
168
162
|
if (key === _this2.validKey) {
|
|
169
163
|
_this2.validKey = '';
|
|
170
164
|
_this2.props.onExitValid();
|
|
@@ -172,7 +166,7 @@ var SuperForm = /*#__PURE__*/function (_React$Component2) {
|
|
|
172
166
|
_this2.props.onChangeOperate && _this2.props.onChangeOperate(key, value);
|
|
173
167
|
});
|
|
174
168
|
// 动态生成getValidState方法
|
|
175
|
-
(0, _defineProperty2["default"])(
|
|
169
|
+
(0, _defineProperty2["default"])(_this2, "initValidState", function () {
|
|
176
170
|
var _this2$props = _this2.props,
|
|
177
171
|
value = _this2$props.value,
|
|
178
172
|
valid = _this2$props.valid;
|
|
@@ -193,7 +187,7 @@ var SuperForm = /*#__PURE__*/function (_React$Component2) {
|
|
|
193
187
|
};
|
|
194
188
|
_this2.getValidState = valid ? _valid : invalid;
|
|
195
189
|
});
|
|
196
|
-
(0, _defineProperty2["default"])(
|
|
190
|
+
(0, _defineProperty2["default"])(_this2, "validDate", function (_ref3) {
|
|
197
191
|
var key = _ref3.key,
|
|
198
192
|
type = _ref3.type;
|
|
199
193
|
return function (date) {
|
|
@@ -212,25 +206,25 @@ var SuperForm = /*#__PURE__*/function (_React$Component2) {
|
|
|
212
206
|
}
|
|
213
207
|
};
|
|
214
208
|
});
|
|
215
|
-
(0, _defineProperty2["default"])(
|
|
209
|
+
(0, _defineProperty2["default"])(_this2, "getPopupContainer", function () {
|
|
216
210
|
var container = _this2.props.container;
|
|
217
211
|
if (typeof container === 'undefined') {
|
|
218
|
-
return _reactDom["default"].findDOMNode(
|
|
212
|
+
return _reactDom["default"].findDOMNode(_this2);
|
|
219
213
|
} else if (typeof container === 'boolean') {
|
|
220
214
|
return document.body;
|
|
221
215
|
} else {
|
|
222
216
|
return _reactDom["default"].findDOMNode(container);
|
|
223
217
|
}
|
|
224
218
|
});
|
|
225
|
-
(0, _defineProperty2["default"])(
|
|
219
|
+
(0, _defineProperty2["default"])(_this2, "getMaxWidth", function () {
|
|
226
220
|
var _this2$props$colNum = _this2.props.colNum,
|
|
227
221
|
colNum = _this2$props$colNum === void 0 ? defaultColNum : _this2$props$colNum;
|
|
228
222
|
return colNum * 250;
|
|
229
223
|
});
|
|
230
|
-
(0, _defineProperty2["default"])(
|
|
224
|
+
(0, _defineProperty2["default"])(_this2, "getContainer", function () {
|
|
231
225
|
return _this2.props.getContainer;
|
|
232
226
|
});
|
|
233
|
-
(0, _defineProperty2["default"])(
|
|
227
|
+
(0, _defineProperty2["default"])(_this2, "getControls", function () {
|
|
234
228
|
var _this2$props2 = _this2.props,
|
|
235
229
|
hideControls = _this2$props2.hideControls,
|
|
236
230
|
controls = _this2$props2.controls;
|
|
@@ -244,7 +238,7 @@ var SuperForm = /*#__PURE__*/function (_React$Component2) {
|
|
|
244
238
|
});
|
|
245
239
|
}
|
|
246
240
|
});
|
|
247
|
-
(0, _defineProperty2["default"])(
|
|
241
|
+
(0, _defineProperty2["default"])(_this2, "getType", function (_ref4) {
|
|
248
242
|
var _context2;
|
|
249
243
|
var key = _ref4.key,
|
|
250
244
|
type = _ref4.type;
|
|
@@ -263,7 +257,7 @@ var SuperForm = /*#__PURE__*/function (_React$Component2) {
|
|
|
263
257
|
return type;
|
|
264
258
|
}
|
|
265
259
|
});
|
|
266
|
-
(0, _defineProperty2["default"])(
|
|
260
|
+
(0, _defineProperty2["default"])(_this2, "specialProps", function (type, _ref5) {
|
|
267
261
|
var key = _ref5.key,
|
|
268
262
|
_ref5$props = _ref5.props,
|
|
269
263
|
props = _ref5$props === void 0 ? {} : _ref5$props,
|
|
@@ -283,48 +277,48 @@ var SuperForm = /*#__PURE__*/function (_React$Component2) {
|
|
|
283
277
|
type: 'textArea',
|
|
284
278
|
readonly: true,
|
|
285
279
|
style: style,
|
|
286
|
-
onBlur: (0, _bind["default"])(_context3 = _this2.onExitValid).call(_context3,
|
|
280
|
+
onBlur: (0, _bind["default"])(_context3 = _this2.onExitValid).call(_context3, _this2, key)
|
|
287
281
|
};
|
|
288
282
|
} else {
|
|
289
283
|
var _context4;
|
|
290
284
|
return {
|
|
291
285
|
style: style,
|
|
292
|
-
onBlur: (0, _bind["default"])(_context4 = _this2.onExitValid).call(_context4,
|
|
286
|
+
onBlur: (0, _bind["default"])(_context4 = _this2.onExitValid).call(_context4, _this2, key)
|
|
293
287
|
};
|
|
294
288
|
}
|
|
295
289
|
} else if (type === 'text' || type === 'textArea') {
|
|
296
290
|
var _context5, _context6;
|
|
297
291
|
return _objectSpread(_objectSpread({}, props), {}, {
|
|
298
|
-
onChange: (0, _bind["default"])(_context5 = _this2.onExitValid).call(_context5,
|
|
299
|
-
onBlur: (0, _bind["default"])(_context6 = _this2.onChange).call(_context6,
|
|
292
|
+
onChange: (0, _bind["default"])(_context5 = _this2.onExitValid).call(_context5, _this2, key),
|
|
293
|
+
onBlur: (0, _bind["default"])(_context6 = _this2.onChange).call(_context6, _this2, key)
|
|
300
294
|
});
|
|
301
295
|
} else if (type === 'date') {
|
|
302
296
|
var _context7, _context8;
|
|
303
297
|
var propsObj = _objectSpread(_objectSpread({}, props), {}, {
|
|
304
|
-
onChange: (0, _bind["default"])(_context7 = _this2.onBlur).call(_context7,
|
|
305
|
-
onBlur: (0, _bind["default"])(_context8 = _this2.onExitValid).call(_context8,
|
|
298
|
+
onChange: (0, _bind["default"])(_context7 = _this2.onBlur).call(_context7, _this2, key),
|
|
299
|
+
onBlur: (0, _bind["default"])(_context8 = _this2.onExitValid).call(_context8, _this2, key)
|
|
306
300
|
});
|
|
307
301
|
if (_this2.props.onOpenChange && typeof _this2.props.onOpenChange === 'function') {
|
|
308
302
|
var _context9;
|
|
309
|
-
propsObj.onOpenChange = (0, _bind["default"])(_context9 = _this2.props.onOpenChange).call(_context9,
|
|
303
|
+
propsObj.onOpenChange = (0, _bind["default"])(_context9 = _this2.props.onOpenChange).call(_context9, _this2, key);
|
|
310
304
|
}
|
|
311
305
|
return propsObj;
|
|
312
306
|
} else if (type === 'area') {
|
|
313
|
-
var
|
|
307
|
+
var _context0, _context1;
|
|
314
308
|
return _objectSpread(_objectSpread({}, props), {}, {
|
|
315
|
-
onChange: (0, _bind["default"])(
|
|
316
|
-
onBlur: (0, _bind["default"])(
|
|
309
|
+
onChange: (0, _bind["default"])(_context0 = _this2.onBlur).call(_context0, _this2, key),
|
|
310
|
+
onBlur: (0, _bind["default"])(_context1 = _this2.onExitValid).call(_context1, _this2, key),
|
|
317
311
|
onAreaSearch: _this2.props.onAreaSearch
|
|
318
312
|
});
|
|
319
313
|
} else {
|
|
320
|
-
var
|
|
314
|
+
var _context10, _context11;
|
|
321
315
|
return _objectSpread(_objectSpread({}, props), {}, {
|
|
322
|
-
onChange: (0, _bind["default"])(
|
|
323
|
-
onBlur: (0, _bind["default"])(
|
|
316
|
+
onChange: (0, _bind["default"])(_context10 = _this2.onBlur).call(_context10, _this2, key),
|
|
317
|
+
onBlur: (0, _bind["default"])(_context11 = _this2.onExitValid).call(_context11, _this2, key)
|
|
324
318
|
});
|
|
325
319
|
}
|
|
326
320
|
});
|
|
327
|
-
(0, _defineProperty2["default"])(
|
|
321
|
+
(0, _defineProperty2["default"])(_this2, "getControlProps", function (control, status) {
|
|
328
322
|
var _this2$props$value2 = _this2.props.value,
|
|
329
323
|
value = _this2$props$value2 === void 0 ? {} : _this2$props$value2;
|
|
330
324
|
var type = _this2.getType(control);
|
|
@@ -337,25 +331,25 @@ var SuperForm = /*#__PURE__*/function (_React$Component2) {
|
|
|
337
331
|
value: (0, _Control.makeString)(value[control.key])
|
|
338
332
|
});
|
|
339
333
|
});
|
|
340
|
-
(0, _defineProperty2["default"])(
|
|
334
|
+
(0, _defineProperty2["default"])(_this2, "getOptions", function (key, options) {
|
|
341
335
|
var higher = _this2.props.options || {};
|
|
342
336
|
return higher[key] || options;
|
|
343
337
|
});
|
|
344
|
-
(0, _defineProperty2["default"])(
|
|
345
|
-
(0, _defineProperty2["default"])(
|
|
338
|
+
(0, _defineProperty2["default"])(_this2, "toEmpty", function (props) {});
|
|
339
|
+
(0, _defineProperty2["default"])(_this2, "toText", function (props) {
|
|
346
340
|
return /*#__PURE__*/_react["default"].createElement(Controlled, props);
|
|
347
341
|
});
|
|
348
|
-
(0, _defineProperty2["default"])(
|
|
342
|
+
(0, _defineProperty2["default"])(_this2, "toPassword", function (props) {
|
|
349
343
|
return /*#__PURE__*/_react["default"].createElement(Controlled, props);
|
|
350
344
|
});
|
|
351
|
-
(0, _defineProperty2["default"])(
|
|
345
|
+
(0, _defineProperty2["default"])(_this2, "toEditor", function (props, control) {
|
|
352
346
|
props.inputKey = control.key;
|
|
353
347
|
return /*#__PURE__*/_react["default"].createElement(Controlled, props);
|
|
354
348
|
});
|
|
355
|
-
(0, _defineProperty2["default"])(
|
|
349
|
+
(0, _defineProperty2["default"])(_this2, "toSelectWriting", function (props, control) {
|
|
356
350
|
return /*#__PURE__*/_react["default"].createElement(Controlled, props);
|
|
357
351
|
});
|
|
358
|
-
(0, _defineProperty2["default"])(
|
|
352
|
+
(0, _defineProperty2["default"])(_this2, "toTextArea", function (props, control) {
|
|
359
353
|
if (control.allFullFather) {
|
|
360
354
|
props.rows = control.rows;
|
|
361
355
|
props.maxLength = control.maxLength;
|
|
@@ -370,12 +364,12 @@ var SuperForm = /*#__PURE__*/function (_React$Component2) {
|
|
|
370
364
|
}
|
|
371
365
|
return /*#__PURE__*/_react["default"].createElement(Controlled, props);
|
|
372
366
|
});
|
|
373
|
-
(0, _defineProperty2["default"])(
|
|
367
|
+
(0, _defineProperty2["default"])(_this2, "toNumber", function (props) {
|
|
374
368
|
props.defaultValue = props.value;
|
|
375
369
|
delete props.value;
|
|
376
370
|
return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
|
|
377
371
|
});
|
|
378
|
-
(0, _defineProperty2["default"])(
|
|
372
|
+
(0, _defineProperty2["default"])(_this2, "toSelect", function (props, _ref6) {
|
|
379
373
|
var options = _ref6.options,
|
|
380
374
|
key = _ref6.key;
|
|
381
375
|
props.getPopupContainer = _this2.getPopupContainer;
|
|
@@ -383,7 +377,7 @@ var SuperForm = /*#__PURE__*/function (_React$Component2) {
|
|
|
383
377
|
props.dropdownMatchSelectWidth = false;
|
|
384
378
|
return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
|
|
385
379
|
});
|
|
386
|
-
(0, _defineProperty2["default"])(
|
|
380
|
+
(0, _defineProperty2["default"])(_this2, "createSearchEvent", function (control) {
|
|
387
381
|
if (_this2.props.onSearch) {
|
|
388
382
|
return function (value) {
|
|
389
383
|
return _this2.props.onSearch(control.key, value, control);
|
|
@@ -392,14 +386,14 @@ var SuperForm = /*#__PURE__*/function (_React$Component2) {
|
|
|
392
386
|
return null;
|
|
393
387
|
}
|
|
394
388
|
});
|
|
395
|
-
(0, _defineProperty2["default"])(
|
|
389
|
+
(0, _defineProperty2["default"])(_this2, "toSearch", function (props, control) {
|
|
396
390
|
props.getPopupContainer = _this2.getPopupContainer;
|
|
397
391
|
props.options = _this2.getOptions(control.key, control.options);
|
|
398
392
|
props.onSearch = _this2.createSearchEvent(control);
|
|
399
393
|
props.dropdownMatchSelectWidth = false;
|
|
400
394
|
return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
|
|
401
395
|
});
|
|
402
|
-
(0, _defineProperty2["default"])(
|
|
396
|
+
(0, _defineProperty2["default"])(_this2, "toDate", function (props, _ref7) {
|
|
403
397
|
var rule = _ref7.rule;
|
|
404
398
|
props.getCalendarContainer = _this2.getPopupContainer;
|
|
405
399
|
props.style = {
|
|
@@ -408,28 +402,28 @@ var SuperForm = /*#__PURE__*/function (_React$Component2) {
|
|
|
408
402
|
rule && (props.disabledDate = _this2.validDate(rule));
|
|
409
403
|
return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
|
|
410
404
|
});
|
|
411
|
-
(0, _defineProperty2["default"])(
|
|
405
|
+
(0, _defineProperty2["default"])(_this2, "toRadioGroup", function (props, _ref8) {
|
|
412
406
|
var key = _ref8.key,
|
|
413
407
|
options = _ref8.options;
|
|
414
408
|
props.options = _this2.getOptions(key, options);
|
|
415
409
|
return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
|
|
416
410
|
});
|
|
417
|
-
(0, _defineProperty2["default"])(
|
|
411
|
+
(0, _defineProperty2["default"])(_this2, "toReadonly", function (props, _ref9) {
|
|
418
412
|
var options = _ref9.options,
|
|
419
413
|
key = _ref9.key;
|
|
420
414
|
props.value = (0, _Control.getTitle)(props.value, _this2.getOptions(key, options));
|
|
421
415
|
return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
|
|
422
416
|
});
|
|
423
|
-
(0, _defineProperty2["default"])(
|
|
417
|
+
(0, _defineProperty2["default"])(_this2, "selectSearch", function (props, control) {
|
|
424
418
|
props.getPopupContainer = _this2.getPopupContainer;
|
|
425
419
|
props.options = _this2.getOptions(control.key, control.options);
|
|
426
420
|
props.onSearch = _this2.createSearchEvent(control);
|
|
427
421
|
props.dropdownMatchSelectWidth = false;
|
|
428
422
|
return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
|
|
429
423
|
});
|
|
430
|
-
(0, _defineProperty2["default"])(
|
|
431
|
-
var key =
|
|
432
|
-
options =
|
|
424
|
+
(0, _defineProperty2["default"])(_this2, "area", function (props, _ref0) {
|
|
425
|
+
var key = _ref0.key,
|
|
426
|
+
options = _ref0.options;
|
|
433
427
|
var readonly = _this2.props.readonly;
|
|
434
428
|
props.parentKey = key;
|
|
435
429
|
props.options = _this2.getOptions(key, options);
|
|
@@ -439,17 +433,17 @@ var SuperForm = /*#__PURE__*/function (_React$Component2) {
|
|
|
439
433
|
}) ? true : false;
|
|
440
434
|
return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
|
|
441
435
|
});
|
|
442
|
-
(0, _defineProperty2["default"])(
|
|
443
|
-
var
|
|
436
|
+
(0, _defineProperty2["default"])(_this2, "uploadImg", function (props, control) {
|
|
437
|
+
var _context12;
|
|
444
438
|
var readonly = _this2.props.readonly;
|
|
445
439
|
props.required = control.required || false;
|
|
446
|
-
props.onFileChange = (0, _bind["default"])(
|
|
440
|
+
props.onFileChange = (0, _bind["default"])(_context12 = _this2.onFileChange).call(_context12, _this2, control);
|
|
447
441
|
props.readonly = readonly === true || (0, _isArray["default"])(readonly) && (0, _some["default"])(readonly).call(readonly, function (readonlyKey) {
|
|
448
442
|
return readonlyKey === control.key;
|
|
449
443
|
}) ? true : false;
|
|
450
444
|
return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
|
|
451
445
|
});
|
|
452
|
-
(0, _defineProperty2["default"])(
|
|
446
|
+
(0, _defineProperty2["default"])(_this2, "toCascader", function (props, control) {
|
|
453
447
|
var container = _this2.getContainer();
|
|
454
448
|
container && (props.getPopupContainer = container);
|
|
455
449
|
props.options = control.options || [];
|
|
@@ -458,7 +452,7 @@ var SuperForm = /*#__PURE__*/function (_React$Component2) {
|
|
|
458
452
|
props.loadData = _this2.createSearchEvent(control);
|
|
459
453
|
return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
|
|
460
454
|
});
|
|
461
|
-
(0, _defineProperty2["default"])(
|
|
455
|
+
(0, _defineProperty2["default"])(_this2, "toTreeSelect", function (props, filter) {
|
|
462
456
|
var container = _this2.getContainer();
|
|
463
457
|
container && (props.getPopupContainer = container);
|
|
464
458
|
props.options = _this2.getOptions(filter);
|
|
@@ -466,7 +460,7 @@ var SuperForm = /*#__PURE__*/function (_React$Component2) {
|
|
|
466
460
|
props.placeholder = filter.placeholder || '';
|
|
467
461
|
return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
|
|
468
462
|
});
|
|
469
|
-
(0, _defineProperty2["default"])(
|
|
463
|
+
(0, _defineProperty2["default"])(_this2, "toControl", function (props, control) {
|
|
470
464
|
switch (props.type) {
|
|
471
465
|
case 'readonly':
|
|
472
466
|
return _this2.toReadonly(props, control);
|
|
@@ -508,13 +502,13 @@ var SuperForm = /*#__PURE__*/function (_React$Component2) {
|
|
|
508
502
|
return 'type error';
|
|
509
503
|
}
|
|
510
504
|
});
|
|
511
|
-
(0, _defineProperty2["default"])(
|
|
512
|
-
var title =
|
|
513
|
-
showAdd =
|
|
514
|
-
key =
|
|
505
|
+
(0, _defineProperty2["default"])(_this2, "toLabel", function (_ref1, type) {
|
|
506
|
+
var title = _ref1.title,
|
|
507
|
+
showAdd = _ref1.showAdd,
|
|
508
|
+
key = _ref1.key;
|
|
515
509
|
if (showAdd && type !== 'readonly') {
|
|
516
|
-
var
|
|
517
|
-
var onClick = (0, _bind["default"])(
|
|
510
|
+
var _context13;
|
|
511
|
+
var onClick = (0, _bind["default"])(_context13 = _this2.onAdd).call(_context13, _this2, key, title);
|
|
518
512
|
return /*#__PURE__*/_react["default"].createElement("span", null, title, /*#__PURE__*/_react["default"].createElement(_icon["default"], {
|
|
519
513
|
role: "add",
|
|
520
514
|
type: "plus-circle-o",
|
|
@@ -524,7 +518,7 @@ var SuperForm = /*#__PURE__*/function (_React$Component2) {
|
|
|
524
518
|
return title;
|
|
525
519
|
}
|
|
526
520
|
});
|
|
527
|
-
(0, _defineProperty2["default"])(
|
|
521
|
+
(0, _defineProperty2["default"])(_this2, "toCol", function (span, control) {
|
|
528
522
|
var factor = control.span || 1;
|
|
529
523
|
var status = _this2.getValidState(control);
|
|
530
524
|
var controlProps = _this2.getControlProps(control, status);
|
|
@@ -541,7 +535,7 @@ var SuperForm = /*#__PURE__*/function (_React$Component2) {
|
|
|
541
535
|
key: control.key
|
|
542
536
|
}, checkable && /*#__PURE__*/_react["default"].createElement(_checkbox["default"], {
|
|
543
537
|
className: (0, _variables["default"])('SuperForm').checkbox,
|
|
544
|
-
onChange: (0, _bind["default"])(onCheckItem).call(onCheckItem,
|
|
538
|
+
onChange: (0, _bind["default"])(onCheckItem).call(onCheckItem, _this2, control),
|
|
545
539
|
checked: control.checked
|
|
546
540
|
}), /*#__PURE__*/_react["default"].createElement(FormItem, (0, _extends2["default"])({}, itemProps, {
|
|
547
541
|
className: checkable ? (0, _variables["default"])('SuperForm').formItemWithCheckbox : ''
|
|
@@ -553,8 +547,8 @@ var SuperForm = /*#__PURE__*/function (_React$Component2) {
|
|
|
553
547
|
}
|
|
554
548
|
});
|
|
555
549
|
});
|
|
556
|
-
(0, _defineProperty2["default"])(
|
|
557
|
-
var
|
|
550
|
+
(0, _defineProperty2["default"])(_this2, "toCols", function () {
|
|
551
|
+
var _context14;
|
|
558
552
|
var _this2$props4 = _this2.props,
|
|
559
553
|
_this2$props4$colNum = _this2$props4.colNum,
|
|
560
554
|
colNum = _this2$props4$colNum === void 0 ? defaultColNum : _this2$props4$colNum,
|
|
@@ -563,7 +557,7 @@ var SuperForm = /*#__PURE__*/function (_React$Component2) {
|
|
|
563
557
|
colNum = 1;
|
|
564
558
|
}
|
|
565
559
|
var span = 24 / colNum;
|
|
566
|
-
return (0, _map["default"])(
|
|
560
|
+
return (0, _map["default"])(_context14 = _this2.getControls()).call(_context14, function (control) {
|
|
567
561
|
if (allFullFather) {
|
|
568
562
|
control.allFullFather = allFullFather;
|
|
569
563
|
}
|
|
@@ -572,7 +566,8 @@ var SuperForm = /*#__PURE__*/function (_React$Component2) {
|
|
|
572
566
|
});
|
|
573
567
|
return _this2;
|
|
574
568
|
}
|
|
575
|
-
(0,
|
|
569
|
+
(0, _inherits2["default"])(SuperForm, _React$Component2);
|
|
570
|
+
return (0, _createClass2["default"])(SuperForm, [{
|
|
576
571
|
key: "render",
|
|
577
572
|
value: function render() {
|
|
578
573
|
this.initValidState();
|
|
@@ -588,7 +583,6 @@ var SuperForm = /*#__PURE__*/function (_React$Component2) {
|
|
|
588
583
|
}, this.toCols())));
|
|
589
584
|
}
|
|
590
585
|
}]);
|
|
591
|
-
return SuperForm;
|
|
592
586
|
}(_react["default"].Component);
|
|
593
587
|
(0, _defineProperty2["default"])(SuperForm, "propTypes", {
|
|
594
588
|
controls: _propTypes["default"].arrayOf(_propTypes["default"].shape(ControlType)).isRequired,
|