cloud-b2b 1.1.26 → 1.1.28
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 +16 -45
- package/es/Card/Card.js +3 -4
- package/es/CodeInput/CodeInput.js +30 -59
- package/es/Control/Control.js +47 -94
- package/es/Control/event.js +0 -14
- package/es/Enhance/Dialogs.js +0 -15
- package/es/Enhance/Loading.js +16 -36
- package/es/Enhance/index.js +0 -2
- package/es/Header/Header.js +3 -35
- package/es/Header/Vertical.js +1 -24
- package/es/ImageView/ImageView.js +5 -22
- package/es/Indent/Indent.js +3 -7
- package/es/InpurCascader/InputCascader.js +10 -36
- package/es/InputEditor/InputEditor.js +55 -55
- package/es/InputSearch/InputSearch.js +26 -71
- package/es/InputSelect/InputSelect.js +17 -48
- package/es/InputWriting/InputWriting.js +6 -28
- package/es/Layout/Layout.js +28 -59
- package/es/LayoutLink/LayoutLink.js +11 -20
- package/es/Link/Link.js +4 -27
- package/es/Loading/Loading.js +1 -3
- package/es/Loading2/Loading2.js +0 -2
- package/es/ModalWithDrag/ModalWithDrag.js +3 -8
- package/es/ModalWithDrag/drag.js +12 -29
- package/es/NumberInput/NumberInput.js +24 -63
- package/es/Search/Search.js +53 -149
- package/es/Sidebar/Sidebar.js +13 -34
- package/es/Sidebar2/Sidebar.js +3 -30
- package/es/SuperForm/SuperForm.js +27 -150
- package/es/SuperForm2/SuperForm.js +31 -165
- package/es/SuperIcon/SuperIcon.js +3 -6
- package/es/SuperPagination/SuperPagination.js +15 -32
- package/es/SuperTab/SuperTab.js +4 -27
- package/es/SuperTab2/SuperTab2.js +11 -33
- package/es/SuperTable/DragSortRow.js +6 -34
- package/es/SuperTable/FilterDropDown.js +10 -34
- package/es/SuperTable/SuperTable.js +91 -216
- package/es/SuperTable/fixed.js +1 -9
- package/es/SuperTable2/SuperTable2.js +104 -206
- package/es/SuperTable2/SuperTableCell.js +16 -55
- package/es/SuperTable3/FilterDropDown.js +10 -34
- package/es/SuperTable3/SuperTable.js +57 -175
- package/es/SuperTable3/fixed.js +1 -9
- package/es/SuperToolbar/SuperToolbar.js +21 -49
- package/es/SuperUpload/SuperUpload.js +73 -110
- package/es/Title/Title.js +12 -15
- package/es/Viewer/ImageViews.js +7 -60
- package/es/Viewer/Viewer.js +7 -34
- package/es/WingBlank/WingBlank.js +2 -6
- package/es/helper.js +36 -23
- package/es/history.js +3 -2
- package/lib/Area/Area.js +16 -64
- package/lib/Card/Card.js +3 -13
- package/lib/CodeInput/CodeInput.js +30 -77
- package/lib/Control/Control.js +47 -135
- package/lib/Control/event.js +0 -16
- package/lib/Enhance/Dialogs.js +0 -26
- package/lib/Enhance/Loading.js +16 -52
- package/lib/Enhance/index.js +0 -9
- package/lib/Header/Header.js +3 -48
- package/lib/Header/Vertical.js +1 -36
- package/lib/ImageView/ImageView.js +5 -30
- package/lib/Indent/Indent.js +3 -13
- package/lib/InpurCascader/InputCascader.js +11 -50
- package/lib/InputEditor/InputEditor.js +55 -64
- package/lib/InputSearch/InputSearch.js +26 -78
- package/lib/InputSelect/InputSelect.js +17 -62
- package/lib/InputWriting/InputWriting.js +6 -35
- package/lib/Layout/Layout.js +28 -76
- package/lib/LayoutLink/LayoutLink.js +11 -38
- package/lib/Link/Link.js +4 -40
- package/lib/Loading/Loading.js +1 -9
- package/lib/Loading2/Loading2.js +0 -8
- package/lib/ModalWithDrag/ModalWithDrag.js +3 -18
- package/lib/ModalWithDrag/drag.js +12 -34
- package/lib/NumberInput/NumberInput.js +24 -76
- package/lib/Search/Search.js +53 -157
- package/lib/Sidebar/Sidebar.js +13 -46
- package/lib/Sidebar2/Sidebar.js +3 -42
- package/lib/SuperForm/SuperForm.js +27 -149
- package/lib/SuperForm2/SuperForm.js +31 -160
- package/lib/SuperIcon/SuperIcon.js +3 -14
- package/lib/SuperPagination/SuperPagination.js +15 -42
- package/lib/SuperTab/SuperTab.js +4 -34
- package/lib/SuperTab2/SuperTab2.js +11 -48
- package/lib/SuperTable/DragSortRow.js +6 -42
- package/lib/SuperTable/FilterDropDown.js +10 -42
- package/lib/SuperTable/SuperTable.js +90 -210
- package/lib/SuperTable/fixed.js +1 -13
- package/lib/SuperTable2/SuperTable2.js +104 -222
- package/lib/SuperTable2/SuperTableCell.js +13 -62
- package/lib/SuperTable3/FilterDropDown.js +10 -42
- package/lib/SuperTable3/SuperTable.js +56 -169
- package/lib/SuperTable3/fixed.js +1 -13
- package/lib/SuperToolbar/SuperToolbar.js +20 -64
- package/lib/SuperUpload/SuperUpload.js +73 -140
- package/lib/Title/Title.js +12 -24
- package/lib/Viewer/ImageViews.js +7 -63
- package/lib/Viewer/Viewer.js +7 -43
- package/lib/WingBlank/WingBlank.js +2 -14
- package/lib/helper.js +36 -37
- package/lib/history.js +0 -5
- package/lib/index.js +0 -76
- package/lib/variables.js +0 -4
- package/package.json +1 -1
|
@@ -28,15 +28,10 @@ import _someInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instanc
|
|
|
28
28
|
import _includesInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/includes";
|
|
29
29
|
import _bindInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/bind";
|
|
30
30
|
import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
|
|
31
|
-
|
|
32
31
|
function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
33
|
-
|
|
34
32
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context24, _context25; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context24 = ownKeys(Object(source), !0)).call(_context24, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context25 = ownKeys(Object(source))).call(_context25, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
35
|
-
|
|
36
33
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = _Reflect$construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
37
|
-
|
|
38
34
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !_Reflect$construct) return false; if (_Reflect$construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
39
|
-
|
|
40
35
|
import React from 'react';
|
|
41
36
|
import PropTypes from 'prop-types';
|
|
42
37
|
import ReactDOM from 'react-dom';
|
|
@@ -47,6 +42,7 @@ var FormItem = _Form.Item;
|
|
|
47
42
|
var defaultSize = 'large';
|
|
48
43
|
var defaultColNum = 4;
|
|
49
44
|
var TYPE = ['readonly', 'text', 'search', 'searchText', 'select', 'selectText', 'radioGroup', 'number', 'date', 'textArea', 'password', 'editor', 'selectWriting', 'selectSearch', 'empty', 'captcha', 'area', 'uploadImg', 'cascader', 'checkbox'];
|
|
45
|
+
|
|
50
46
|
/**
|
|
51
47
|
* key:[必须],用于唯一标识该Form下的一个表单元素
|
|
52
48
|
* title:[必须],表单元素的标签
|
|
@@ -57,7 +53,6 @@ var TYPE = ['readonly', 'text', 'search', 'searchText', 'select', 'selectText',
|
|
|
57
53
|
* showAdd: [可选],是否显示+号,点击+号会触发onAdd事件,默认为false
|
|
58
54
|
* rule: [可选],用于设置校验规则
|
|
59
55
|
*/
|
|
60
|
-
|
|
61
56
|
var ControlType = {
|
|
62
57
|
key: PropTypes.string.isRequired,
|
|
63
58
|
title: PropTypes.string,
|
|
@@ -70,35 +65,25 @@ var ControlType = {
|
|
|
70
65
|
rule: PropTypes.object,
|
|
71
66
|
props: PropTypes.object
|
|
72
67
|
};
|
|
73
|
-
|
|
74
68
|
var Controlled = /*#__PURE__*/function (_React$Component) {
|
|
75
69
|
_inherits(Controlled, _React$Component);
|
|
76
|
-
|
|
77
70
|
var _super = _createSuper(Controlled);
|
|
78
|
-
|
|
79
71
|
function Controlled(props) {
|
|
80
72
|
var _this;
|
|
81
|
-
|
|
82
73
|
_classCallCheck(this, Controlled);
|
|
83
|
-
|
|
84
74
|
_this = _super.call(this, props);
|
|
85
|
-
|
|
86
75
|
_defineProperty(_assertThisInitialized(_this), "onChange", function (value) {
|
|
87
76
|
var onChange = _this.props.onChange;
|
|
88
|
-
|
|
89
77
|
_this.setState({
|
|
90
78
|
value: value
|
|
91
79
|
});
|
|
92
|
-
|
|
93
80
|
onChange && onChange(value);
|
|
94
81
|
});
|
|
95
|
-
|
|
96
82
|
_this.state = {
|
|
97
83
|
value: props.value
|
|
98
84
|
};
|
|
99
85
|
return _this;
|
|
100
86
|
}
|
|
101
|
-
|
|
102
87
|
_createClass(Controlled, [{
|
|
103
88
|
key: "componentWillReceiveProps",
|
|
104
89
|
value: function componentWillReceiveProps(nextProps) {
|
|
@@ -116,11 +101,9 @@ var Controlled = /*#__PURE__*/function (_React$Component) {
|
|
|
116
101
|
value: this.state.value,
|
|
117
102
|
onChange: this.onChange
|
|
118
103
|
});
|
|
119
|
-
|
|
120
104
|
return /*#__PURE__*/React.createElement(Control, props);
|
|
121
105
|
}
|
|
122
106
|
}]);
|
|
123
|
-
|
|
124
107
|
return Controlled;
|
|
125
108
|
}(React.Component);
|
|
126
109
|
/**
|
|
@@ -136,85 +119,62 @@ var Controlled = /*#__PURE__*/function (_React$Component) {
|
|
|
136
119
|
* onAreaSearch:联级选择器触发,原型为func(key - 当前联级key, title - 输入值, parentKey - 主体联级key)
|
|
137
120
|
* onFileChange:上传组件触发,原型为func(key,{fileList, fileDeleteList})
|
|
138
121
|
*/
|
|
139
|
-
|
|
140
|
-
|
|
141
122
|
var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
|
|
142
123
|
_inherits(SuperForm2, _React$Component2);
|
|
143
|
-
|
|
144
124
|
var _super2 = _createSuper(SuperForm2);
|
|
145
|
-
|
|
146
125
|
function SuperForm2() {
|
|
147
126
|
var _context;
|
|
148
|
-
|
|
149
127
|
var _this2;
|
|
150
|
-
|
|
151
128
|
_classCallCheck(this, SuperForm2);
|
|
152
|
-
|
|
153
129
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
154
130
|
args[_key] = arguments[_key];
|
|
155
131
|
}
|
|
156
|
-
|
|
157
132
|
_this2 = _super2.call.apply(_super2, _concatInstanceProperty(_context = [this]).call(_context, args));
|
|
158
|
-
|
|
159
133
|
_defineProperty(_assertThisInitialized(_this2), "onAdd", function (key, title) {
|
|
160
134
|
var onAdd = _this2.props.onAdd;
|
|
161
135
|
onAdd && onAdd(key, title);
|
|
162
136
|
});
|
|
163
|
-
|
|
164
137
|
_defineProperty(_assertThisInitialized(_this2), "onFileChange", function (_ref, file) {
|
|
165
138
|
var key = _ref.key;
|
|
166
139
|
var onFileChange = _this2.props.onFileChange;
|
|
167
140
|
onFileChange && onFileChange(key, file);
|
|
168
141
|
});
|
|
169
|
-
|
|
170
142
|
_defineProperty(_assertThisInitialized(_this2), "onChange", function (key, value) {
|
|
171
143
|
var onChange = _this2.props.onChange;
|
|
172
|
-
|
|
173
144
|
if (onChange) {
|
|
174
145
|
_this2.onExitValid(key);
|
|
175
|
-
|
|
176
146
|
onChange(key, value);
|
|
177
147
|
}
|
|
178
148
|
});
|
|
179
|
-
|
|
180
149
|
_defineProperty(_assertThisInitialized(_this2), "onGetCode", function (key, value) {
|
|
181
150
|
var onGetCode = _this2.props.onGetCode;
|
|
182
151
|
onGetCode && onGetCode();
|
|
183
152
|
});
|
|
184
|
-
|
|
185
153
|
_defineProperty(_assertThisInitialized(_this2), "onBlur", function (key, value) {
|
|
186
154
|
var onChange = _this2.props.onChange;
|
|
187
|
-
|
|
188
155
|
if (onChange) {
|
|
189
156
|
_this2.onExitValid(key);
|
|
190
|
-
|
|
191
157
|
onChange(key, value);
|
|
192
158
|
}
|
|
193
159
|
});
|
|
194
|
-
|
|
195
160
|
_defineProperty(_assertThisInitialized(_this2), "onExitValid", function (key, value) {
|
|
196
161
|
if (key === _this2.validKey) {
|
|
197
162
|
_this2.validKey = '';
|
|
198
|
-
|
|
199
163
|
_this2.props.onExitValid();
|
|
200
164
|
}
|
|
201
|
-
|
|
202
165
|
_this2.props.onChangeOperate && _this2.props.onChangeOperate(key, value);
|
|
203
166
|
});
|
|
204
|
-
|
|
167
|
+
// 动态生成getValidState方法
|
|
205
168
|
_defineProperty(_assertThisInitialized(_this2), "initValidState", function () {
|
|
206
169
|
var _this2$props = _this2.props,
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
170
|
+
value = _this2$props.value,
|
|
171
|
+
valid = _this2$props.valid;
|
|
210
172
|
var invalid = function invalid() {
|
|
211
173
|
return null;
|
|
212
174
|
};
|
|
213
|
-
|
|
214
175
|
var _valid = function _valid(_ref2) {
|
|
215
176
|
var key = _ref2.key,
|
|
216
|
-
|
|
217
|
-
|
|
177
|
+
required = _ref2.required;
|
|
218
178
|
if (required) {
|
|
219
179
|
if (!value || helper.isEmpty2(value[key]) || !_Array$isArray(value[key]) && _typeof(value[key]) === 'object' && helper.isEmpty(value[key].value)) {
|
|
220
180
|
_this2.getValidState = invalid;
|
|
@@ -222,20 +182,16 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
|
|
|
222
182
|
return 'error';
|
|
223
183
|
}
|
|
224
184
|
}
|
|
225
|
-
|
|
226
185
|
return null;
|
|
227
186
|
};
|
|
228
|
-
|
|
229
187
|
_this2.getValidState = valid ? _valid : invalid;
|
|
230
188
|
});
|
|
231
|
-
|
|
232
189
|
_defineProperty(_assertThisInitialized(_this2), "validDate", function (_ref3) {
|
|
233
190
|
var key = _ref3.key,
|
|
234
|
-
|
|
191
|
+
type = _ref3.type;
|
|
235
192
|
return function (date) {
|
|
236
193
|
var _this2$props$value = _this2.props.value,
|
|
237
|
-
|
|
238
|
-
|
|
194
|
+
value = _this2$props$value === void 0 ? {} : _this2$props$value;
|
|
239
195
|
if (!date || !value[key]) {
|
|
240
196
|
return false;
|
|
241
197
|
} else {
|
|
@@ -249,10 +205,8 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
|
|
|
249
205
|
}
|
|
250
206
|
};
|
|
251
207
|
});
|
|
252
|
-
|
|
253
208
|
_defineProperty(_assertThisInitialized(_this2), "getPopupContainer", function () {
|
|
254
209
|
var container = _this2.props.container;
|
|
255
|
-
|
|
256
210
|
if (typeof container === 'undefined') {
|
|
257
211
|
return ReactDOM.findDOMNode(_assertThisInitialized(_this2));
|
|
258
212
|
} else if (typeof container === 'boolean') {
|
|
@@ -261,22 +215,18 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
|
|
|
261
215
|
return ReactDOM.findDOMNode(container);
|
|
262
216
|
}
|
|
263
217
|
});
|
|
264
|
-
|
|
265
218
|
_defineProperty(_assertThisInitialized(_this2), "getMaxWidth", function () {
|
|
266
219
|
var _this2$props$colNum = _this2.props.colNum,
|
|
267
|
-
|
|
220
|
+
colNum = _this2$props$colNum === void 0 ? defaultColNum : _this2$props$colNum;
|
|
268
221
|
return colNum * 1200;
|
|
269
222
|
});
|
|
270
|
-
|
|
271
223
|
_defineProperty(_assertThisInitialized(_this2), "getContainer", function () {
|
|
272
224
|
return _this2.props.getContainer;
|
|
273
225
|
});
|
|
274
|
-
|
|
275
226
|
_defineProperty(_assertThisInitialized(_this2), "getControls", function () {
|
|
276
227
|
var _this2$props2 = _this2.props,
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
228
|
+
hideControls = _this2$props2.hideControls,
|
|
229
|
+
controls = _this2$props2.controls;
|
|
280
230
|
if (!hideControls) {
|
|
281
231
|
return controls;
|
|
282
232
|
} else {
|
|
@@ -287,14 +237,11 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
|
|
|
287
237
|
});
|
|
288
238
|
}
|
|
289
239
|
});
|
|
290
|
-
|
|
291
240
|
_defineProperty(_assertThisInitialized(_this2), "getType", function (_ref4) {
|
|
292
241
|
var _context2;
|
|
293
|
-
|
|
294
242
|
var key = _ref4.key,
|
|
295
|
-
|
|
243
|
+
type = _ref4.type;
|
|
296
244
|
var readonly = _this2.props.readonly;
|
|
297
|
-
|
|
298
245
|
if (_includesInstanceProperty(_context2 = ['area', 'uploadImg']).call(_context2, type)) {
|
|
299
246
|
return type;
|
|
300
247
|
} else if (!readonly) {
|
|
@@ -309,17 +256,14 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
|
|
|
309
256
|
return type;
|
|
310
257
|
}
|
|
311
258
|
});
|
|
312
|
-
|
|
313
259
|
_defineProperty(_assertThisInitialized(_this2), "specialProps", function (type, _ref5) {
|
|
314
260
|
var key = _ref5.key,
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
261
|
+
_ref5$props = _ref5.props,
|
|
262
|
+
props = _ref5$props === void 0 ? {} : _ref5$props,
|
|
263
|
+
originType = _ref5.type;
|
|
319
264
|
if (type === 'readonly') {
|
|
320
265
|
if (originType === 'textArea') {
|
|
321
266
|
var _context3;
|
|
322
|
-
|
|
323
267
|
return {
|
|
324
268
|
type: 'textArea',
|
|
325
269
|
readonly: true,
|
|
@@ -327,7 +271,6 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
|
|
|
327
271
|
};
|
|
328
272
|
} else if (originType === 'uploadImg') {
|
|
329
273
|
var _context4;
|
|
330
|
-
|
|
331
274
|
var commonProps = _this2.props.buildSuperUploadProps ? _this2.props.buildSuperUploadProps() : {};
|
|
332
275
|
return _objectSpread(_objectSpread(_objectSpread({}, props), commonProps), {}, {
|
|
333
276
|
readonly: true,
|
|
@@ -335,36 +278,29 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
|
|
|
335
278
|
});
|
|
336
279
|
} else {
|
|
337
280
|
var _context5;
|
|
338
|
-
|
|
339
281
|
return {
|
|
340
282
|
onBlur: _bindInstanceProperty(_context5 = _this2.onExitValid).call(_context5, _assertThisInitialized(_this2), key)
|
|
341
283
|
};
|
|
342
284
|
}
|
|
343
285
|
} else if (type === 'text' || type === 'textArea') {
|
|
344
286
|
var _context6, _context7;
|
|
345
|
-
|
|
346
287
|
return _objectSpread(_objectSpread({}, props), {}, {
|
|
347
288
|
onChange: _bindInstanceProperty(_context6 = _this2.onExitValid).call(_context6, _assertThisInitialized(_this2), key),
|
|
348
289
|
onBlur: _bindInstanceProperty(_context7 = _this2.onChange).call(_context7, _assertThisInitialized(_this2), key)
|
|
349
290
|
});
|
|
350
291
|
} else if (type === 'date') {
|
|
351
292
|
var _context8, _context9;
|
|
352
|
-
|
|
353
293
|
var propsObj = _objectSpread(_objectSpread({}, props), {}, {
|
|
354
294
|
onChange: _bindInstanceProperty(_context8 = _this2.onBlur).call(_context8, _assertThisInitialized(_this2), key),
|
|
355
295
|
onBlur: _bindInstanceProperty(_context9 = _this2.onExitValid).call(_context9, _assertThisInitialized(_this2), key)
|
|
356
296
|
});
|
|
357
|
-
|
|
358
297
|
if (_this2.props.onOpenChange && typeof _this2.props.onOpenChange === 'function') {
|
|
359
298
|
var _context10;
|
|
360
|
-
|
|
361
299
|
propsObj.onOpenChange = _bindInstanceProperty(_context10 = _this2.props.onOpenChange).call(_context10, _assertThisInitialized(_this2), key);
|
|
362
300
|
}
|
|
363
|
-
|
|
364
301
|
return propsObj;
|
|
365
302
|
} else if (type === 'captcha') {
|
|
366
303
|
var _context11, _context12, _context13;
|
|
367
|
-
|
|
368
304
|
return _objectSpread(_objectSpread({}, props), {}, {
|
|
369
305
|
onChange: _bindInstanceProperty(_context11 = _this2.onBlur).call(_context11, _assertThisInitialized(_this2), key),
|
|
370
306
|
onBlur: _bindInstanceProperty(_context12 = _this2.onExitValid).call(_context12, _assertThisInitialized(_this2), key),
|
|
@@ -372,7 +308,6 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
|
|
|
372
308
|
});
|
|
373
309
|
} else if (type === 'area') {
|
|
374
310
|
var _context14, _context15;
|
|
375
|
-
|
|
376
311
|
return _objectSpread(_objectSpread({}, props), {}, {
|
|
377
312
|
onChange: _bindInstanceProperty(_context14 = _this2.onBlur).call(_context14, _assertThisInitialized(_this2), key),
|
|
378
313
|
onBlur: _bindInstanceProperty(_context15 = _this2.onExitValid).call(_context15, _assertThisInitialized(_this2), key),
|
|
@@ -380,33 +315,26 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
|
|
|
380
315
|
});
|
|
381
316
|
} else if (type === 'uploadImg') {
|
|
382
317
|
var _context16, _context17;
|
|
383
|
-
|
|
384
318
|
var _commonProps = _this2.props.buildSuperUploadProps ? _this2.props.buildSuperUploadProps() : {};
|
|
385
|
-
|
|
386
319
|
return _objectSpread(_objectSpread(_objectSpread({}, props), _commonProps), {}, {
|
|
387
320
|
onChange: _bindInstanceProperty(_context16 = _this2.onBlur).call(_context16, _assertThisInitialized(_this2), key),
|
|
388
321
|
onBlur: _bindInstanceProperty(_context17 = _this2.onExitValid).call(_context17, _assertThisInitialized(_this2), key)
|
|
389
322
|
});
|
|
390
323
|
} else {
|
|
391
324
|
var _context18, _context19;
|
|
392
|
-
|
|
393
325
|
return _objectSpread(_objectSpread({}, props), {}, {
|
|
394
326
|
onChange: _bindInstanceProperty(_context18 = _this2.onBlur).call(_context18, _assertThisInitialized(_this2), key),
|
|
395
327
|
onBlur: _bindInstanceProperty(_context19 = _this2.onExitValid).call(_context19, _assertThisInitialized(_this2), key)
|
|
396
328
|
});
|
|
397
329
|
}
|
|
398
330
|
});
|
|
399
|
-
|
|
400
331
|
_defineProperty(_assertThisInitialized(_this2), "getControlProps", function (control, status) {
|
|
401
332
|
var _this2$props3 = _this2.props,
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
333
|
+
_this2$props3$value = _this2$props3.value,
|
|
334
|
+
value = _this2$props3$value === void 0 ? {} : _this2$props3$value,
|
|
335
|
+
readonly = _this2$props3.readonly;
|
|
406
336
|
var type = _this2.getType(control);
|
|
407
|
-
|
|
408
337
|
var props = _this2.specialProps(type, control);
|
|
409
|
-
|
|
410
338
|
return _objectSpread(_objectSpread({
|
|
411
339
|
autoFocus: !!status,
|
|
412
340
|
type: type
|
|
@@ -415,31 +343,24 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
|
|
|
415
343
|
value: makeString(value[control.key])
|
|
416
344
|
});
|
|
417
345
|
});
|
|
418
|
-
|
|
419
346
|
_defineProperty(_assertThisInitialized(_this2), "getOptions", function (key, options) {
|
|
420
347
|
var higher = _this2.props.options || {};
|
|
421
348
|
return higher[key] || options;
|
|
422
349
|
});
|
|
423
|
-
|
|
424
350
|
_defineProperty(_assertThisInitialized(_this2), "toEmpty", function (props) {});
|
|
425
|
-
|
|
426
351
|
_defineProperty(_assertThisInitialized(_this2), "toText", function (props) {
|
|
427
352
|
return /*#__PURE__*/React.createElement(Controlled, props);
|
|
428
353
|
});
|
|
429
|
-
|
|
430
354
|
_defineProperty(_assertThisInitialized(_this2), "toPassword", function (props) {
|
|
431
355
|
return /*#__PURE__*/React.createElement(Controlled, props);
|
|
432
356
|
});
|
|
433
|
-
|
|
434
357
|
_defineProperty(_assertThisInitialized(_this2), "toEditor", function (props, control) {
|
|
435
358
|
props.inputKey = control.key;
|
|
436
359
|
return /*#__PURE__*/React.createElement(Controlled, props);
|
|
437
360
|
});
|
|
438
|
-
|
|
439
361
|
_defineProperty(_assertThisInitialized(_this2), "toSelectWriting", function (props, control) {
|
|
440
362
|
return /*#__PURE__*/React.createElement(Controlled, props);
|
|
441
363
|
});
|
|
442
|
-
|
|
443
364
|
_defineProperty(_assertThisInitialized(_this2), "toTextArea", function (props, control) {
|
|
444
365
|
if (control.allFullFather) {
|
|
445
366
|
props.rows = control.rows;
|
|
@@ -453,25 +374,21 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
|
|
|
453
374
|
maxRows: 5
|
|
454
375
|
};
|
|
455
376
|
}
|
|
456
|
-
|
|
457
377
|
return /*#__PURE__*/React.createElement(Controlled, props);
|
|
458
378
|
});
|
|
459
|
-
|
|
460
379
|
_defineProperty(_assertThisInitialized(_this2), "toNumber", function (props) {
|
|
461
380
|
props.defaultValue = props.value;
|
|
462
381
|
delete props.value;
|
|
463
382
|
return /*#__PURE__*/React.createElement(Control, props);
|
|
464
383
|
});
|
|
465
|
-
|
|
466
384
|
_defineProperty(_assertThisInitialized(_this2), "toSelect", function (props, _ref6) {
|
|
467
385
|
var options = _ref6.options,
|
|
468
|
-
|
|
386
|
+
key = _ref6.key;
|
|
469
387
|
props.getPopupContainer = _this2.getPopupContainer;
|
|
470
388
|
props.options = _this2.getOptions(key, options);
|
|
471
389
|
props.dropdownMatchSelectWidth = false;
|
|
472
390
|
return /*#__PURE__*/React.createElement(Control, props);
|
|
473
391
|
});
|
|
474
|
-
|
|
475
392
|
_defineProperty(_assertThisInitialized(_this2), "createSearchEvent", function (control) {
|
|
476
393
|
if (_this2.props.onSearch) {
|
|
477
394
|
return function (value) {
|
|
@@ -481,7 +398,6 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
|
|
|
481
398
|
return null;
|
|
482
399
|
}
|
|
483
400
|
});
|
|
484
|
-
|
|
485
401
|
_defineProperty(_assertThisInitialized(_this2), "createGetCodeEvent", function (control) {
|
|
486
402
|
if (_this2.props.onGetCode) {
|
|
487
403
|
return function (value) {
|
|
@@ -491,7 +407,6 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
|
|
|
491
407
|
return null;
|
|
492
408
|
}
|
|
493
409
|
});
|
|
494
|
-
|
|
495
410
|
_defineProperty(_assertThisInitialized(_this2), "toSearch", function (props, control) {
|
|
496
411
|
props.getPopupContainer = _this2.getPopupContainer;
|
|
497
412
|
props.options = _this2.getOptions(control.key, control.options);
|
|
@@ -500,7 +415,6 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
|
|
|
500
415
|
props.size = 'large';
|
|
501
416
|
return /*#__PURE__*/React.createElement(Control, props);
|
|
502
417
|
});
|
|
503
|
-
|
|
504
418
|
_defineProperty(_assertThisInitialized(_this2), "toDate", function (props, _ref7) {
|
|
505
419
|
var rule = _ref7.rule;
|
|
506
420
|
props.getCalendarContainer = _this2.getPopupContainer;
|
|
@@ -510,26 +424,22 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
|
|
|
510
424
|
rule && (props.disabledDate = _this2.validDate(rule));
|
|
511
425
|
return /*#__PURE__*/React.createElement(Control, props);
|
|
512
426
|
});
|
|
513
|
-
|
|
514
427
|
_defineProperty(_assertThisInitialized(_this2), "toRadioGroup", function (props, _ref8) {
|
|
515
428
|
var key = _ref8.key,
|
|
516
|
-
|
|
429
|
+
options = _ref8.options;
|
|
517
430
|
props.options = _this2.getOptions(key, options);
|
|
518
431
|
return /*#__PURE__*/React.createElement(Control, props);
|
|
519
432
|
});
|
|
520
|
-
|
|
521
433
|
_defineProperty(_assertThisInitialized(_this2), "captcha", function (props, control) {
|
|
522
434
|
props.onGetCode = _this2.props.onGetCode;
|
|
523
435
|
return /*#__PURE__*/React.createElement(Control, props);
|
|
524
436
|
});
|
|
525
|
-
|
|
526
437
|
_defineProperty(_assertThisInitialized(_this2), "toReadonly", function (props, _ref9) {
|
|
527
438
|
var options = _ref9.options,
|
|
528
|
-
|
|
439
|
+
key = _ref9.key;
|
|
529
440
|
props.value = getTitle(props.value, _this2.getOptions(key, options));
|
|
530
441
|
return /*#__PURE__*/React.createElement(Control, props);
|
|
531
442
|
});
|
|
532
|
-
|
|
533
443
|
_defineProperty(_assertThisInitialized(_this2), "selectSearch", function (props, control) {
|
|
534
444
|
props.getPopupContainer = _this2.getPopupContainer;
|
|
535
445
|
props.options = _this2.getOptions(control.key, control.options);
|
|
@@ -537,10 +447,9 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
|
|
|
537
447
|
props.dropdownMatchSelectWidth = false;
|
|
538
448
|
return /*#__PURE__*/React.createElement(Control, props);
|
|
539
449
|
});
|
|
540
|
-
|
|
541
450
|
_defineProperty(_assertThisInitialized(_this2), "area", function (props, _ref10) {
|
|
542
451
|
var key = _ref10.key,
|
|
543
|
-
|
|
452
|
+
options = _ref10.options;
|
|
544
453
|
var readonly = _this2.props.readonly;
|
|
545
454
|
props.parentKey = key;
|
|
546
455
|
props.options = _this2.getOptions(key, options);
|
|
@@ -550,10 +459,8 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
|
|
|
550
459
|
}) ? true : false;
|
|
551
460
|
return /*#__PURE__*/React.createElement(Control, props);
|
|
552
461
|
});
|
|
553
|
-
|
|
554
462
|
_defineProperty(_assertThisInitialized(_this2), "uploadImg", function (props, control) {
|
|
555
463
|
var _context20;
|
|
556
|
-
|
|
557
464
|
var readonly = _this2.props.readonly;
|
|
558
465
|
props.required = control.required || false;
|
|
559
466
|
props.onFileChange = _bindInstanceProperty(_context20 = _this2.onFileChange).call(_context20, _assertThisInitialized(_this2), control);
|
|
@@ -562,10 +469,8 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
|
|
|
562
469
|
}) ? true : false;
|
|
563
470
|
return /*#__PURE__*/React.createElement(Control, props);
|
|
564
471
|
});
|
|
565
|
-
|
|
566
472
|
_defineProperty(_assertThisInitialized(_this2), "toCascader", function (props, control) {
|
|
567
473
|
var container = _this2.getContainer();
|
|
568
|
-
|
|
569
474
|
container && (props.getPopupContainer = container);
|
|
570
475
|
props.options = control.options || [];
|
|
571
476
|
props.onSearch = _this2.createSearchEvent(control);
|
|
@@ -573,10 +478,8 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
|
|
|
573
478
|
props.loadData = _this2.createSearchEvent(control);
|
|
574
479
|
return /*#__PURE__*/React.createElement(Control, props);
|
|
575
480
|
});
|
|
576
|
-
|
|
577
481
|
_defineProperty(_assertThisInitialized(_this2), "toCheckbox", function (props, control) {
|
|
578
482
|
var _context21;
|
|
579
|
-
|
|
580
483
|
var options = control.options || [];
|
|
581
484
|
return /*#__PURE__*/React.createElement(_Checkbox.Group, {
|
|
582
485
|
options: options,
|
|
@@ -584,82 +487,59 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
|
|
|
584
487
|
value: _this2.props.value[control.key]
|
|
585
488
|
});
|
|
586
489
|
});
|
|
587
|
-
|
|
588
490
|
_defineProperty(_assertThisInitialized(_this2), "toControl", function (props, control) {
|
|
589
491
|
switch (props.type) {
|
|
590
492
|
case 'readonly':
|
|
591
493
|
return _this2.toReadonly(props, control);
|
|
592
|
-
|
|
593
494
|
case 'text':
|
|
594
495
|
return _this2.toText(props, control);
|
|
595
|
-
|
|
596
496
|
case 'number':
|
|
597
497
|
return _this2.toNumber(props, control);
|
|
598
|
-
|
|
599
498
|
case 'select':
|
|
600
499
|
case 'selectText':
|
|
601
500
|
return _this2.toSelect(props, control);
|
|
602
|
-
|
|
603
501
|
case 'search':
|
|
604
502
|
case 'searchText':
|
|
605
503
|
return _this2.toSearch(props, control);
|
|
606
|
-
|
|
607
504
|
case 'date':
|
|
608
505
|
return _this2.toDate(props, control);
|
|
609
|
-
|
|
610
506
|
case 'radioGroup':
|
|
611
507
|
return _this2.toRadioGroup(props, control);
|
|
612
|
-
|
|
613
508
|
case 'textArea':
|
|
614
509
|
return _this2.toTextArea(props, control);
|
|
615
|
-
|
|
616
510
|
case 'password':
|
|
617
511
|
return _this2.toPassword(props, control);
|
|
618
|
-
|
|
619
512
|
case 'editor':
|
|
620
513
|
return _this2.toEditor(props, control);
|
|
621
|
-
|
|
622
514
|
case 'selectWriting':
|
|
623
515
|
return _this2.toSelectWriting(props, control);
|
|
624
|
-
|
|
625
516
|
case 'selectSearch':
|
|
626
517
|
return _this2.selectSearch(props, control);
|
|
627
|
-
|
|
628
518
|
case 'empty':
|
|
629
519
|
return _this2.toEmpty(props, control);
|
|
630
|
-
|
|
631
520
|
case 'captcha':
|
|
632
521
|
return _this2.captcha(props, control);
|
|
633
|
-
|
|
634
522
|
case 'area':
|
|
635
523
|
return _this2.area(props, control);
|
|
636
|
-
|
|
637
524
|
case 'uploadImg':
|
|
638
525
|
return _this2.uploadImg(props, control);
|
|
639
|
-
|
|
640
526
|
case 'cascader':
|
|
641
527
|
return _this2.toCascader(props, control);
|
|
642
|
-
|
|
643
528
|
case 'checkbox':
|
|
644
529
|
return _this2.toCheckbox(props, control);
|
|
645
|
-
|
|
646
530
|
default:
|
|
647
531
|
return 'type error';
|
|
648
532
|
}
|
|
649
533
|
});
|
|
650
|
-
|
|
651
534
|
_defineProperty(_assertThisInitialized(_this2), "toLabel", function (_ref11, type) {
|
|
652
535
|
var title = _ref11.title,
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
536
|
+
showAdd = _ref11.showAdd,
|
|
537
|
+
key = _ref11.key,
|
|
538
|
+
showInfo = _ref11.showInfo,
|
|
539
|
+
showInfoTitle = _ref11.showInfoTitle;
|
|
658
540
|
if (showAdd && type !== 'readonly') {
|
|
659
541
|
var _context22;
|
|
660
|
-
|
|
661
542
|
var onClick = _bindInstanceProperty(_context22 = _this2.onAdd).call(_context22, _assertThisInitialized(_this2), key, title);
|
|
662
|
-
|
|
663
543
|
return /*#__PURE__*/React.createElement("span", null, title, /*#__PURE__*/React.createElement(_Icon, {
|
|
664
544
|
role: "add",
|
|
665
545
|
type: "plus-circle-o",
|
|
@@ -675,22 +555,18 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
|
|
|
675
555
|
return title;
|
|
676
556
|
}
|
|
677
557
|
});
|
|
678
|
-
|
|
679
558
|
_defineProperty(_assertThisInitialized(_this2), "toCol", function (span, control) {
|
|
680
559
|
var factor = control.span || 1;
|
|
681
|
-
|
|
682
560
|
var status = _this2.getValidState(control);
|
|
683
|
-
|
|
684
561
|
var controlProps = _this2.getControlProps(control, status);
|
|
685
|
-
|
|
686
562
|
var itemProps = {
|
|
687
563
|
label: _this2.toLabel(control, controlProps.type),
|
|
688
564
|
required: control.required,
|
|
689
565
|
validateStatus: status
|
|
690
566
|
};
|
|
691
567
|
var _this2$props4 = _this2.props,
|
|
692
|
-
|
|
693
|
-
|
|
568
|
+
checkable = _this2$props4.checkable,
|
|
569
|
+
onCheckItem = _this2$props4.onCheckItem;
|
|
694
570
|
return control.type !== 'empty' ? /*#__PURE__*/React.createElement(_Col, {
|
|
695
571
|
span: span * factor,
|
|
696
572
|
key: control.key
|
|
@@ -724,38 +600,31 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
|
|
|
724
600
|
}
|
|
725
601
|
});
|
|
726
602
|
});
|
|
727
|
-
|
|
728
603
|
_defineProperty(_assertThisInitialized(_this2), "toCols", function () {
|
|
729
604
|
var _context23;
|
|
730
|
-
|
|
731
605
|
var _this2$props5 = _this2.props,
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
606
|
+
_this2$props5$colNum = _this2$props5.colNum,
|
|
607
|
+
colNum = _this2$props5$colNum === void 0 ? defaultColNum : _this2$props5$colNum,
|
|
608
|
+
allFullFather = _this2$props5.allFullFather;
|
|
736
609
|
if (allFullFather) {
|
|
737
610
|
colNum = 1;
|
|
738
611
|
}
|
|
739
|
-
|
|
740
612
|
var span = 24 / colNum;
|
|
741
613
|
return _mapInstanceProperty(_context23 = _this2.getControls()).call(_context23, function (control) {
|
|
742
614
|
if (allFullFather) {
|
|
743
615
|
control.allFullFather = allFullFather;
|
|
744
616
|
}
|
|
745
|
-
|
|
746
617
|
return _this2.toCol(span, control);
|
|
747
618
|
});
|
|
748
619
|
});
|
|
749
|
-
|
|
750
620
|
return _this2;
|
|
751
621
|
}
|
|
752
|
-
|
|
753
622
|
_createClass(SuperForm2, [{
|
|
754
623
|
key: "render",
|
|
755
624
|
value: function render() {
|
|
756
625
|
this.initValidState();
|
|
757
626
|
var _this$props$layout = this.props.layout,
|
|
758
|
-
|
|
627
|
+
layout = _this$props$layout === void 0 ? 'horizontal' : _this$props$layout;
|
|
759
628
|
return /*#__PURE__*/React.createElement("div", {
|
|
760
629
|
className: variables('SuperForm2')
|
|
761
630
|
}, /*#__PURE__*/React.createElement(_Form, {
|
|
@@ -768,10 +637,8 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
|
|
|
768
637
|
}, this.toCols())));
|
|
769
638
|
}
|
|
770
639
|
}]);
|
|
771
|
-
|
|
772
640
|
return SuperForm2;
|
|
773
641
|
}(React.Component);
|
|
774
|
-
|
|
775
642
|
_defineProperty(SuperForm2, "propTypes", {
|
|
776
643
|
controls: PropTypes.arrayOf(PropTypes.shape(ControlType)).isRequired,
|
|
777
644
|
value: PropTypes.object,
|
|
@@ -793,5 +660,4 @@ _defineProperty(SuperForm2, "propTypes", {
|
|
|
793
660
|
//构建type===uploadImg时,SuperUpload组件需要的公共属性函数,已在项目公共文件state.js中提供,可直接引用
|
|
794
661
|
layout: PropTypes.string
|
|
795
662
|
});
|
|
796
|
-
|
|
797
663
|
export default SuperForm2;
|