cloud-b2b 1.1.85 → 1.1.87
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/Area/Area.js +48 -23
- package/es/CodeInput/CodeInput.js +16 -19
- package/es/Enhance/Dialogs.js +11 -14
- package/es/Enhance/Loading.js +15 -18
- package/es/Header/Header.js +17 -20
- package/es/Header/Vertical.js +11 -14
- package/es/ImageView/ImageView.js +10 -13
- package/es/InpurCascader/InputCascader.js +11 -14
- package/es/InputEditor/InputEditor.js +16 -18
- package/es/InputSearch/InputSearch.js +20 -23
- package/es/InputSelect/InputSelect.js +14 -17
- package/es/InputTreeSelect/InputTreeSelect.js +10 -13
- package/es/InputWriting/InputWriting.js +12 -15
- package/es/Layout/Layout.js +14 -17
- package/es/Link/Link.js +7 -10
- package/es/NumberInput/NumberInput.js +13 -16
- package/es/Search/Search.js +52 -55
- package/es/Search2/Search.js +83 -86
- package/es/Search2/Search.less +64 -64
- package/es/Search2/package.json +6 -6
- package/es/Sidebar/Sidebar.js +11 -14
- package/es/Sidebar2/Sidebar.js +13 -16
- package/es/SuperForm/SuperForm.js +74 -79
- package/es/SuperForm2/SuperForm.js +112 -114
- package/es/SuperPagination/SuperPagination.js +8 -11
- package/es/SuperTab/SuperTab.js +12 -15
- package/es/SuperTab2/SuperTab2.js +13 -16
- package/es/SuperTable/DragSortRow.js +12 -15
- package/es/SuperTable/FilterDropDown.js +11 -14
- package/es/SuperTable/SuperTable.js +139 -94
- package/es/SuperTable/SuperTable.less +11 -0
- package/es/SuperTable2/SuperTable2.js +89 -92
- package/es/SuperTable2/SuperTableCell.js +27 -30
- package/es/SuperTable3/FilterDropDown.js +11 -14
- package/es/SuperTable3/SuperTable.js +58 -61
- package/es/SuperToolbar/SuperToolbar.js +12 -15
- package/es/SuperUpload/SuperUpload.js +38 -38
- package/es/Viewer/ImageViews.js +16 -19
- package/es/Viewer/Viewer.js +11 -14
- package/es/helper.js +18 -17
- package/lib/Area/Area.js +49 -25
- package/lib/CodeInput/CodeInput.js +16 -19
- package/lib/Enhance/Dialogs.js +11 -14
- package/lib/Enhance/Loading.js +15 -18
- package/lib/Header/Header.js +17 -20
- package/lib/Header/Vertical.js +11 -14
- package/lib/ImageView/ImageView.js +10 -13
- package/lib/InpurCascader/InputCascader.js +11 -14
- package/lib/InputEditor/InputEditor.js +16 -18
- package/lib/InputSearch/InputSearch.js +20 -23
- package/lib/InputSelect/InputSelect.js +14 -17
- package/lib/InputTreeSelect/InputTreeSelect.js +10 -13
- package/lib/InputWriting/InputWriting.js +12 -15
- package/lib/Layout/Layout.js +14 -17
- package/lib/LayoutLink/LayoutLink.js +1 -2
- package/lib/Link/Link.js +7 -10
- package/lib/NumberInput/NumberInput.js +13 -16
- package/lib/Search/Search.js +53 -57
- package/lib/Search2/Search.js +84 -88
- package/lib/Search2/Search.less +64 -64
- package/lib/Search2/package.json +6 -6
- package/lib/Sidebar/Sidebar.js +11 -14
- package/lib/Sidebar2/Sidebar.js +13 -16
- package/lib/SuperForm/SuperForm.js +75 -81
- package/lib/SuperForm2/SuperForm.js +113 -116
- package/lib/SuperPagination/SuperPagination.js +8 -11
- package/lib/SuperTab/SuperTab.js +12 -15
- package/lib/SuperTab2/SuperTab2.js +13 -16
- package/lib/SuperTable/DragSortRow.js +12 -15
- package/lib/SuperTable/FilterDropDown.js +11 -14
- package/lib/SuperTable/SuperTable.js +139 -94
- package/lib/SuperTable/SuperTable.less +11 -0
- package/lib/SuperTable2/SuperTable2.js +90 -94
- package/lib/SuperTable2/SuperTableCell.js +27 -30
- package/lib/SuperTable3/FilterDropDown.js +11 -14
- package/lib/SuperTable3/SuperTable.js +58 -61
- package/lib/SuperToolbar/SuperToolbar.js +12 -15
- package/lib/SuperUpload/SuperUpload.js +39 -40
- package/lib/Viewer/ImageViews.js +16 -19
- package/lib/Viewer/Viewer.js +11 -14
- package/lib/helper.js +18 -17
- package/package.json +1 -1
|
@@ -32,10 +32,9 @@ var _checkbox = _interopRequireDefault(require("antd/lib/checkbox"));
|
|
|
32
32
|
var _typeof2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/typeof"));
|
|
33
33
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/classCallCheck"));
|
|
34
34
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/createClass"));
|
|
35
|
-
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/assertThisInitialized"));
|
|
36
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/inherits"));
|
|
37
35
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/possibleConstructorReturn"));
|
|
38
36
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/getPrototypeOf"));
|
|
37
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/inherits"));
|
|
39
38
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/defineProperty"));
|
|
40
39
|
var _form = _interopRequireDefault(require("antd/lib/form"));
|
|
41
40
|
var _react = _interopRequireDefault(require("react"));
|
|
@@ -44,12 +43,11 @@ var _reactDom = _interopRequireDefault(require("react-dom"));
|
|
|
44
43
|
var _helper = _interopRequireDefault(require("../helper"));
|
|
45
44
|
var _Control = _interopRequireWildcard(require("../Control"));
|
|
46
45
|
var _variables = _interopRequireDefault(require("../variables"));
|
|
47
|
-
function
|
|
48
|
-
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; }
|
|
46
|
+
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); }
|
|
49
47
|
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; }
|
|
50
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var
|
|
51
|
-
function
|
|
52
|
-
function _isNativeReflectConstruct() {
|
|
48
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context27, _context28; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context27 = ownKeys(Object(t), !0)).call(_context27, function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context28 = ownKeys(Object(t))).call(_context28, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
49
|
+
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)); }
|
|
50
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
53
51
|
var FormItem = _form["default"].Item;
|
|
54
52
|
var defaultSize = 'default';
|
|
55
53
|
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 SuperForm2 = /*#__PURE__*/function (_React$Component2) {
|
|
134
|
-
(0, _inherits2["default"])(SuperForm2, _React$Component2);
|
|
135
|
-
var _super2 = _createSuper(SuperForm2);
|
|
136
130
|
function SuperForm2() {
|
|
137
131
|
var _context;
|
|
138
132
|
var _this2;
|
|
@@ -140,35 +134,35 @@ var SuperForm2 = /*#__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, SuperForm2, (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, "onFileChange", function (_ref, file) {
|
|
149
143
|
var key = _ref.key;
|
|
150
144
|
var onFileChange = _this2.props.onFileChange;
|
|
151
145
|
onFileChange && onFileChange(key, file);
|
|
152
146
|
});
|
|
153
|
-
(0, _defineProperty2["default"])(
|
|
147
|
+
(0, _defineProperty2["default"])(_this2, "onChange", function (key, value) {
|
|
154
148
|
var onChange = _this2.props.onChange;
|
|
155
149
|
if (onChange) {
|
|
156
150
|
_this2.onExitValid(key);
|
|
157
151
|
onChange(key, value);
|
|
158
152
|
}
|
|
159
153
|
});
|
|
160
|
-
(0, _defineProperty2["default"])(
|
|
154
|
+
(0, _defineProperty2["default"])(_this2, "onGetCode", function (key, value) {
|
|
161
155
|
var onGetCode = _this2.props.onGetCode;
|
|
162
156
|
onGetCode && onGetCode();
|
|
163
157
|
});
|
|
164
|
-
(0, _defineProperty2["default"])(
|
|
158
|
+
(0, _defineProperty2["default"])(_this2, "onBlur", function (key, value) {
|
|
165
159
|
var onChange = _this2.props.onChange;
|
|
166
160
|
if (onChange) {
|
|
167
161
|
_this2.onExitValid(key);
|
|
168
162
|
onChange(key, value);
|
|
169
163
|
}
|
|
170
164
|
});
|
|
171
|
-
(0, _defineProperty2["default"])(
|
|
165
|
+
(0, _defineProperty2["default"])(_this2, "onExitValid", function (key, value) {
|
|
172
166
|
if (key === _this2.validKey) {
|
|
173
167
|
_this2.validKey = '';
|
|
174
168
|
_this2.props.onExitValid();
|
|
@@ -176,7 +170,7 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
|
|
|
176
170
|
_this2.props.onChangeOperate && _this2.props.onChangeOperate(key, value);
|
|
177
171
|
});
|
|
178
172
|
// 动态生成getValidState方法
|
|
179
|
-
(0, _defineProperty2["default"])(
|
|
173
|
+
(0, _defineProperty2["default"])(_this2, "initValidState", function () {
|
|
180
174
|
var _this2$props = _this2.props,
|
|
181
175
|
value = _this2$props.value,
|
|
182
176
|
valid = _this2$props.valid;
|
|
@@ -197,7 +191,7 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
|
|
|
197
191
|
};
|
|
198
192
|
_this2.getValidState = valid ? _valid : invalid;
|
|
199
193
|
});
|
|
200
|
-
(0, _defineProperty2["default"])(
|
|
194
|
+
(0, _defineProperty2["default"])(_this2, "validDate", function (_ref3) {
|
|
201
195
|
var key = _ref3.key,
|
|
202
196
|
type = _ref3.type;
|
|
203
197
|
return function (date) {
|
|
@@ -216,25 +210,25 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
|
|
|
216
210
|
}
|
|
217
211
|
};
|
|
218
212
|
});
|
|
219
|
-
(0, _defineProperty2["default"])(
|
|
213
|
+
(0, _defineProperty2["default"])(_this2, "getPopupContainer", function () {
|
|
220
214
|
var container = _this2.props.container;
|
|
221
215
|
if (typeof container === 'undefined') {
|
|
222
|
-
return _reactDom["default"].findDOMNode(
|
|
216
|
+
return _reactDom["default"].findDOMNode(_this2);
|
|
223
217
|
} else if (typeof container === 'boolean') {
|
|
224
218
|
return document.body;
|
|
225
219
|
} else {
|
|
226
220
|
return _reactDom["default"].findDOMNode(container);
|
|
227
221
|
}
|
|
228
222
|
});
|
|
229
|
-
(0, _defineProperty2["default"])(
|
|
223
|
+
(0, _defineProperty2["default"])(_this2, "getMaxWidth", function () {
|
|
230
224
|
var _this2$props$colNum = _this2.props.colNum,
|
|
231
225
|
colNum = _this2$props$colNum === void 0 ? defaultColNum : _this2$props$colNum;
|
|
232
226
|
return colNum * 1200;
|
|
233
227
|
});
|
|
234
|
-
(0, _defineProperty2["default"])(
|
|
228
|
+
(0, _defineProperty2["default"])(_this2, "getContainer", function () {
|
|
235
229
|
return _this2.props.getContainer;
|
|
236
230
|
});
|
|
237
|
-
(0, _defineProperty2["default"])(
|
|
231
|
+
(0, _defineProperty2["default"])(_this2, "getControls", function () {
|
|
238
232
|
var _this2$props2 = _this2.props,
|
|
239
233
|
hideControls = _this2$props2.hideControls,
|
|
240
234
|
controls = _this2$props2.controls;
|
|
@@ -248,7 +242,7 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
|
|
|
248
242
|
});
|
|
249
243
|
}
|
|
250
244
|
});
|
|
251
|
-
(0, _defineProperty2["default"])(
|
|
245
|
+
(0, _defineProperty2["default"])(_this2, "getType", function (_ref4) {
|
|
252
246
|
var _context2;
|
|
253
247
|
var key = _ref4.key,
|
|
254
248
|
type = _ref4.type;
|
|
@@ -267,7 +261,7 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
|
|
|
267
261
|
return type;
|
|
268
262
|
}
|
|
269
263
|
});
|
|
270
|
-
(0, _defineProperty2["default"])(
|
|
264
|
+
(0, _defineProperty2["default"])(_this2, "specialProps", function (type, _ref5) {
|
|
271
265
|
var key = _ref5.key,
|
|
272
266
|
placeholder = _ref5.placeholder,
|
|
273
267
|
_ref5$props = _ref5.props,
|
|
@@ -279,72 +273,72 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
|
|
|
279
273
|
return {
|
|
280
274
|
type: 'textArea',
|
|
281
275
|
readonly: true,
|
|
282
|
-
onBlur: (0, _bind["default"])(_context3 = _this2.onExitValid).call(_context3,
|
|
276
|
+
onBlur: (0, _bind["default"])(_context3 = _this2.onExitValid).call(_context3, _this2, key)
|
|
283
277
|
};
|
|
284
278
|
} else if (originType === 'uploadImg') {
|
|
285
279
|
var _context4;
|
|
286
280
|
var commonProps = _this2.props.buildSuperUploadProps ? _this2.props.buildSuperUploadProps() : {};
|
|
287
281
|
return _objectSpread(_objectSpread(_objectSpread({}, props), commonProps), {}, {
|
|
288
282
|
readonly: true,
|
|
289
|
-
onBlur: (0, _bind["default"])(_context4 = _this2.onExitValid).call(_context4,
|
|
283
|
+
onBlur: (0, _bind["default"])(_context4 = _this2.onExitValid).call(_context4, _this2, key)
|
|
290
284
|
});
|
|
291
285
|
} else {
|
|
292
286
|
var _context5;
|
|
293
287
|
return {
|
|
294
|
-
onBlur: (0, _bind["default"])(_context5 = _this2.onExitValid).call(_context5,
|
|
288
|
+
onBlur: (0, _bind["default"])(_context5 = _this2.onExitValid).call(_context5, _this2, key),
|
|
295
289
|
placeholder: placeholder
|
|
296
290
|
};
|
|
297
291
|
}
|
|
298
292
|
} else if (type === 'text' || type === 'textArea') {
|
|
299
293
|
var _context6, _context7;
|
|
300
294
|
return _objectSpread(_objectSpread({}, props), {}, {
|
|
301
|
-
onChange: (0, _bind["default"])(_context6 = _this2.onExitValid).call(_context6,
|
|
302
|
-
onBlur: (0, _bind["default"])(_context7 = _this2.onChange).call(_context7,
|
|
295
|
+
onChange: (0, _bind["default"])(_context6 = _this2.onExitValid).call(_context6, _this2, key),
|
|
296
|
+
onBlur: (0, _bind["default"])(_context7 = _this2.onChange).call(_context7, _this2, key)
|
|
303
297
|
});
|
|
304
298
|
} else if (type === 'date') {
|
|
305
299
|
var _context8, _context9;
|
|
306
300
|
var propsObj = _objectSpread(_objectSpread({}, props), {}, {
|
|
307
|
-
onChange: (0, _bind["default"])(_context8 = _this2.onBlur).call(_context8,
|
|
308
|
-
onBlur: (0, _bind["default"])(_context9 = _this2.onExitValid).call(_context9,
|
|
301
|
+
onChange: (0, _bind["default"])(_context8 = _this2.onBlur).call(_context8, _this2, key),
|
|
302
|
+
onBlur: (0, _bind["default"])(_context9 = _this2.onExitValid).call(_context9, _this2, key)
|
|
309
303
|
});
|
|
310
304
|
if (_this2.props.onOpenChange && typeof _this2.props.onOpenChange === 'function') {
|
|
311
|
-
var
|
|
312
|
-
propsObj.onOpenChange = (0, _bind["default"])(
|
|
305
|
+
var _context0;
|
|
306
|
+
propsObj.onOpenChange = (0, _bind["default"])(_context0 = _this2.props.onOpenChange).call(_context0, _this2, key);
|
|
313
307
|
}
|
|
314
308
|
return propsObj;
|
|
315
309
|
} else if (type === 'captcha') {
|
|
316
|
-
var
|
|
310
|
+
var _context1, _context10, _context11;
|
|
317
311
|
return _objectSpread(_objectSpread({}, props), {}, {
|
|
318
|
-
onChange: (0, _bind["default"])(
|
|
319
|
-
onBlur: (0, _bind["default"])(
|
|
320
|
-
onGetCode: (0, _bind["default"])(
|
|
312
|
+
onChange: (0, _bind["default"])(_context1 = _this2.onBlur).call(_context1, _this2, key),
|
|
313
|
+
onBlur: (0, _bind["default"])(_context10 = _this2.onExitValid).call(_context10, _this2, key),
|
|
314
|
+
onGetCode: (0, _bind["default"])(_context11 = _this2.onGetCode).call(_context11, _this2, key)
|
|
321
315
|
});
|
|
322
316
|
} else if (type === 'area') {
|
|
323
|
-
var
|
|
317
|
+
var _context12, _context13;
|
|
324
318
|
return _objectSpread(_objectSpread({}, props), {}, {
|
|
325
|
-
onChange: (0, _bind["default"])(
|
|
326
|
-
onBlur: (0, _bind["default"])(
|
|
319
|
+
onChange: (0, _bind["default"])(_context12 = _this2.onBlur).call(_context12, _this2, key),
|
|
320
|
+
onBlur: (0, _bind["default"])(_context13 = _this2.onExitValid).call(_context13, _this2, key),
|
|
327
321
|
onAreaSearch: _this2.props.onAreaSearch,
|
|
328
322
|
onClick: _this2.props.onAdd
|
|
329
323
|
});
|
|
330
324
|
} else if (type === 'uploadImg') {
|
|
331
|
-
var
|
|
325
|
+
var _context14, _context15;
|
|
332
326
|
var _commonProps = _this2.props.buildSuperUploadProps ? _this2.props.buildSuperUploadProps() : {};
|
|
333
327
|
return _objectSpread(_objectSpread(_objectSpread({}, props), _commonProps), {}, {
|
|
334
|
-
onChange: (0, _bind["default"])(
|
|
335
|
-
onBlur: (0, _bind["default"])(
|
|
328
|
+
onChange: (0, _bind["default"])(_context14 = _this2.onBlur).call(_context14, _this2, key),
|
|
329
|
+
onBlur: (0, _bind["default"])(_context15 = _this2.onExitValid).call(_context15, _this2, key)
|
|
336
330
|
});
|
|
337
331
|
} else if (type === 'double') {
|
|
338
332
|
return props;
|
|
339
333
|
} else {
|
|
340
|
-
var
|
|
334
|
+
var _context16, _context17;
|
|
341
335
|
return _objectSpread(_objectSpread({}, props), {}, {
|
|
342
|
-
onChange: (0, _bind["default"])(
|
|
343
|
-
onBlur: (0, _bind["default"])(
|
|
336
|
+
onChange: (0, _bind["default"])(_context16 = _this2.onBlur).call(_context16, _this2, key),
|
|
337
|
+
onBlur: (0, _bind["default"])(_context17 = _this2.onExitValid).call(_context17, _this2, key)
|
|
344
338
|
});
|
|
345
339
|
}
|
|
346
340
|
});
|
|
347
|
-
(0, _defineProperty2["default"])(
|
|
341
|
+
(0, _defineProperty2["default"])(_this2, "getControlProps", function (control, status) {
|
|
348
342
|
var _this2$props3 = _this2.props,
|
|
349
343
|
_this2$props3$value = _this2$props3.value,
|
|
350
344
|
value = _this2$props3$value === void 0 ? {} : _this2$props3$value,
|
|
@@ -365,25 +359,25 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
|
|
|
365
359
|
requiredColor: requiredColor
|
|
366
360
|
});
|
|
367
361
|
});
|
|
368
|
-
(0, _defineProperty2["default"])(
|
|
362
|
+
(0, _defineProperty2["default"])(_this2, "getOptions", function (key, options) {
|
|
369
363
|
var higher = _this2.props.options || {};
|
|
370
364
|
return higher[key] || options;
|
|
371
365
|
});
|
|
372
|
-
(0, _defineProperty2["default"])(
|
|
373
|
-
(0, _defineProperty2["default"])(
|
|
366
|
+
(0, _defineProperty2["default"])(_this2, "toEmpty", function (props) {});
|
|
367
|
+
(0, _defineProperty2["default"])(_this2, "toText", function (props) {
|
|
374
368
|
return /*#__PURE__*/_react["default"].createElement(Controlled, props);
|
|
375
369
|
});
|
|
376
|
-
(0, _defineProperty2["default"])(
|
|
370
|
+
(0, _defineProperty2["default"])(_this2, "toPassword", function (props) {
|
|
377
371
|
return /*#__PURE__*/_react["default"].createElement(Controlled, props);
|
|
378
372
|
});
|
|
379
|
-
(0, _defineProperty2["default"])(
|
|
373
|
+
(0, _defineProperty2["default"])(_this2, "toEditor", function (props, control) {
|
|
380
374
|
props.inputKey = control.key;
|
|
381
375
|
return /*#__PURE__*/_react["default"].createElement(Controlled, props);
|
|
382
376
|
});
|
|
383
|
-
(0, _defineProperty2["default"])(
|
|
377
|
+
(0, _defineProperty2["default"])(_this2, "toSelectWriting", function (props, control) {
|
|
384
378
|
return /*#__PURE__*/_react["default"].createElement(Controlled, props);
|
|
385
379
|
});
|
|
386
|
-
(0, _defineProperty2["default"])(
|
|
380
|
+
(0, _defineProperty2["default"])(_this2, "toTextArea", function (props, control) {
|
|
387
381
|
if (control.allFullFather) {
|
|
388
382
|
props.rows = control.rows;
|
|
389
383
|
props.maxLength = control.maxLength;
|
|
@@ -398,22 +392,22 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
|
|
|
398
392
|
}
|
|
399
393
|
return /*#__PURE__*/_react["default"].createElement(Controlled, props);
|
|
400
394
|
});
|
|
401
|
-
(0, _defineProperty2["default"])(
|
|
395
|
+
(0, _defineProperty2["default"])(_this2, "toNumber", function (props) {
|
|
402
396
|
props.defaultValue = props.value;
|
|
403
397
|
delete props.value;
|
|
404
398
|
return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
|
|
405
399
|
});
|
|
406
|
-
(0, _defineProperty2["default"])(
|
|
407
|
-
var
|
|
400
|
+
(0, _defineProperty2["default"])(_this2, "toDoubleInput", function (props, control, cc) {
|
|
401
|
+
var _context18, _context19;
|
|
408
402
|
props.defaultValue = props.value;
|
|
409
403
|
props.doubleKey = props.key;
|
|
410
404
|
props.doubleValue = _helper["default"].getObject(cc, props.key);
|
|
411
|
-
props.onChangeKey1 = (0, _bind["default"])(
|
|
412
|
-
props.onChangeKey2 = (0, _bind["default"])(
|
|
405
|
+
props.onChangeKey1 = (0, _bind["default"])(_context18 = _this2.onChange).call(_context18, _this2, props.key[0]);
|
|
406
|
+
props.onChangeKey2 = (0, _bind["default"])(_context19 = _this2.onChange).call(_context19, _this2, props.key[1]);
|
|
413
407
|
delete props.value;
|
|
414
408
|
return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
|
|
415
409
|
});
|
|
416
|
-
(0, _defineProperty2["default"])(
|
|
410
|
+
(0, _defineProperty2["default"])(_this2, "toSelect", function (props, _ref6) {
|
|
417
411
|
var options = _ref6.options,
|
|
418
412
|
key = _ref6.key;
|
|
419
413
|
props.getPopupContainer = _this2.getPopupContainer;
|
|
@@ -421,14 +415,14 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
|
|
|
421
415
|
props.dropdownMatchSelectWidth = false;
|
|
422
416
|
return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
|
|
423
417
|
});
|
|
424
|
-
(0, _defineProperty2["default"])(
|
|
418
|
+
(0, _defineProperty2["default"])(_this2, "toTreeSelect", function (props, filter) {
|
|
425
419
|
var container = _this2.getContainer();
|
|
426
420
|
container && (props.getPopupContainer = container);
|
|
427
421
|
props.options = _this2.getOptions(filter);
|
|
428
422
|
props.onSearch = _this2.createSearchEvent(filter);
|
|
429
423
|
return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
|
|
430
424
|
});
|
|
431
|
-
(0, _defineProperty2["default"])(
|
|
425
|
+
(0, _defineProperty2["default"])(_this2, "createSearchEvent", function (control) {
|
|
432
426
|
if (_this2.props.onSearch) {
|
|
433
427
|
return function (value) {
|
|
434
428
|
return _this2.props.onSearch(control.key, value, control);
|
|
@@ -437,7 +431,7 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
|
|
|
437
431
|
return null;
|
|
438
432
|
}
|
|
439
433
|
});
|
|
440
|
-
(0, _defineProperty2["default"])(
|
|
434
|
+
(0, _defineProperty2["default"])(_this2, "createGetCodeEvent", function (control) {
|
|
441
435
|
if (_this2.props.onGetCode) {
|
|
442
436
|
return function (value) {
|
|
443
437
|
return _this2.props.onGetCode(control.key, value, control);
|
|
@@ -446,14 +440,14 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
|
|
|
446
440
|
return null;
|
|
447
441
|
}
|
|
448
442
|
});
|
|
449
|
-
(0, _defineProperty2["default"])(
|
|
443
|
+
(0, _defineProperty2["default"])(_this2, "toSearch", function (props, control) {
|
|
450
444
|
props.getPopupContainer = _this2.getPopupContainer;
|
|
451
445
|
props.options = _this2.getOptions(control.key, control.options);
|
|
452
446
|
props.onSearch = _this2.createSearchEvent(control);
|
|
453
447
|
props.dropdownMatchSelectWidth = false;
|
|
454
448
|
return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
|
|
455
449
|
});
|
|
456
|
-
(0, _defineProperty2["default"])(
|
|
450
|
+
(0, _defineProperty2["default"])(_this2, "toDate", function (props, _ref7) {
|
|
457
451
|
var rule = _ref7.rule;
|
|
458
452
|
props.getCalendarContainer = _this2.getPopupContainer;
|
|
459
453
|
props.style = {
|
|
@@ -462,7 +456,7 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
|
|
|
462
456
|
rule && (props.disabledDate = _this2.validDate(rule));
|
|
463
457
|
return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
|
|
464
458
|
});
|
|
465
|
-
(0, _defineProperty2["default"])(
|
|
459
|
+
(0, _defineProperty2["default"])(_this2, "toRangePicker", function (props, _ref8) {
|
|
466
460
|
var rule = _ref8.rule;
|
|
467
461
|
props.getCalendarContainer = _this2.getPopupContainer;
|
|
468
462
|
props.style = {
|
|
@@ -471,33 +465,36 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
|
|
|
471
465
|
// rule && (props.disabledDate = this.validDate(rule));
|
|
472
466
|
return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
|
|
473
467
|
});
|
|
474
|
-
(0, _defineProperty2["default"])(
|
|
468
|
+
(0, _defineProperty2["default"])(_this2, "toRadioGroup", function (props, _ref9) {
|
|
475
469
|
var key = _ref9.key,
|
|
476
470
|
options = _ref9.options;
|
|
477
471
|
props.options = _this2.getOptions(key, options);
|
|
478
472
|
return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
|
|
479
473
|
});
|
|
480
|
-
(0, _defineProperty2["default"])(
|
|
474
|
+
(0, _defineProperty2["default"])(_this2, "captcha", function (props, control) {
|
|
481
475
|
props.onGetCode = _this2.props.onGetCode;
|
|
482
476
|
return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
|
|
483
477
|
});
|
|
484
|
-
(0, _defineProperty2["default"])(
|
|
485
|
-
var options =
|
|
486
|
-
key =
|
|
478
|
+
(0, _defineProperty2["default"])(_this2, "toReadonly", function (props, _ref0) {
|
|
479
|
+
var options = _ref0.options,
|
|
480
|
+
key = _ref0.key;
|
|
487
481
|
props.value = (0, _Control.getTitle)(props.value, _this2.getOptions(key, options));
|
|
488
482
|
return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
|
|
489
483
|
});
|
|
490
|
-
(0, _defineProperty2["default"])(
|
|
484
|
+
(0, _defineProperty2["default"])(_this2, "selectSearch", function (props, control) {
|
|
491
485
|
props.getPopupContainer = _this2.getPopupContainer;
|
|
492
486
|
props.options = _this2.getOptions(control.key, control.options);
|
|
493
487
|
props.onSearch = _this2.createSearchEvent(control);
|
|
494
488
|
props.dropdownMatchSelectWidth = false;
|
|
495
489
|
return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
|
|
496
490
|
});
|
|
497
|
-
(0, _defineProperty2["default"])(
|
|
498
|
-
var key =
|
|
499
|
-
options =
|
|
491
|
+
(0, _defineProperty2["default"])(_this2, "area", function (props, _ref1) {
|
|
492
|
+
var key = _ref1.key,
|
|
493
|
+
options = _ref1.options,
|
|
494
|
+
_ref1$btnDisabled = _ref1.btnDisabled,
|
|
495
|
+
btnDisabled = _ref1$btnDisabled === void 0 ? false : _ref1$btnDisabled;
|
|
500
496
|
var readonly = _this2.props.readonly;
|
|
497
|
+
props.btnDisabled = btnDisabled;
|
|
501
498
|
props.parentKey = key;
|
|
502
499
|
props.options = _this2.getOptions(key, options);
|
|
503
500
|
props.dropdownMatchSelectWidth = false;
|
|
@@ -506,17 +503,17 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
|
|
|
506
503
|
}) ? true : false;
|
|
507
504
|
return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
|
|
508
505
|
});
|
|
509
|
-
(0, _defineProperty2["default"])(
|
|
510
|
-
var
|
|
506
|
+
(0, _defineProperty2["default"])(_this2, "uploadImg", function (props, control) {
|
|
507
|
+
var _context20;
|
|
511
508
|
var readonly = _this2.props.readonly;
|
|
512
509
|
props.required = control.required || false;
|
|
513
|
-
props.onFileChange = (0, _bind["default"])(
|
|
510
|
+
props.onFileChange = (0, _bind["default"])(_context20 = _this2.onFileChange).call(_context20, _this2, control);
|
|
514
511
|
props.readonly = readonly === true || (0, _isArray["default"])(readonly) && (0, _some["default"])(readonly).call(readonly, function (readonlyKey) {
|
|
515
512
|
return readonlyKey === control.key;
|
|
516
513
|
}) ? true : false;
|
|
517
514
|
return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
|
|
518
515
|
});
|
|
519
|
-
(0, _defineProperty2["default"])(
|
|
516
|
+
(0, _defineProperty2["default"])(_this2, "toCascader", function (props, control) {
|
|
520
517
|
var container = _this2.getContainer();
|
|
521
518
|
container && (props.getPopupContainer = container);
|
|
522
519
|
props.options = control.options || [];
|
|
@@ -525,17 +522,17 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
|
|
|
525
522
|
props.loadData = _this2.createSearchEvent(control);
|
|
526
523
|
return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
|
|
527
524
|
});
|
|
528
|
-
(0, _defineProperty2["default"])(
|
|
529
|
-
var
|
|
525
|
+
(0, _defineProperty2["default"])(_this2, "toCheckbox", function (props, control) {
|
|
526
|
+
var _context21;
|
|
530
527
|
var options = control.options || [];
|
|
531
528
|
return /*#__PURE__*/_react["default"].createElement(_checkbox["default"].Group, {
|
|
532
529
|
options: options,
|
|
533
530
|
disabled: _this2.props.readonly === true,
|
|
534
|
-
onChange: (0, _bind["default"])(
|
|
531
|
+
onChange: (0, _bind["default"])(_context21 = _this2.onBlur).call(_context21, _this2, control.key),
|
|
535
532
|
value: _this2.props.value[control.key]
|
|
536
533
|
});
|
|
537
534
|
});
|
|
538
|
-
(0, _defineProperty2["default"])(
|
|
535
|
+
(0, _defineProperty2["default"])(_this2, "toControl", function (props, control) {
|
|
539
536
|
switch (props.type) {
|
|
540
537
|
case 'readonly':
|
|
541
538
|
return _this2.toReadonly(props, control);
|
|
@@ -585,36 +582,36 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
|
|
|
585
582
|
return 'type error';
|
|
586
583
|
}
|
|
587
584
|
});
|
|
588
|
-
(0, _defineProperty2["default"])(
|
|
589
|
-
var title =
|
|
590
|
-
|
|
591
|
-
preWrap =
|
|
592
|
-
showAdd =
|
|
593
|
-
showQuery =
|
|
594
|
-
key =
|
|
595
|
-
showInfo =
|
|
596
|
-
showInfoTitle =
|
|
597
|
-
showIcon =
|
|
598
|
-
iconType =
|
|
585
|
+
(0, _defineProperty2["default"])(_this2, "toLabel", function (_ref10, type) {
|
|
586
|
+
var title = _ref10.title,
|
|
587
|
+
_ref10$preWrap = _ref10.preWrap,
|
|
588
|
+
preWrap = _ref10$preWrap === void 0 ? false : _ref10$preWrap,
|
|
589
|
+
showAdd = _ref10.showAdd,
|
|
590
|
+
showQuery = _ref10.showQuery,
|
|
591
|
+
key = _ref10.key,
|
|
592
|
+
showInfo = _ref10.showInfo,
|
|
593
|
+
showInfoTitle = _ref10.showInfoTitle,
|
|
594
|
+
showIcon = _ref10.showIcon,
|
|
595
|
+
iconType = _ref10.iconType;
|
|
599
596
|
if (showAdd && type !== 'readonly') {
|
|
600
|
-
var
|
|
601
|
-
var onClick = (0, _bind["default"])(
|
|
597
|
+
var _context22;
|
|
598
|
+
var onClick = (0, _bind["default"])(_context22 = _this2.onAdd).call(_context22, _this2, key, title);
|
|
602
599
|
return /*#__PURE__*/_react["default"].createElement("span", null, title, /*#__PURE__*/_react["default"].createElement(_icon["default"], {
|
|
603
600
|
role: "add",
|
|
604
601
|
type: "plus-circle-o",
|
|
605
602
|
onClick: onClick
|
|
606
603
|
}));
|
|
607
604
|
} else if (showQuery && type !== 'readonly') {
|
|
608
|
-
var
|
|
609
|
-
var _onClick = (0, _bind["default"])(
|
|
605
|
+
var _context23;
|
|
606
|
+
var _onClick = (0, _bind["default"])(_context23 = _this2.onAdd).call(_context23, _this2, key, title);
|
|
610
607
|
return /*#__PURE__*/_react["default"].createElement("span", null, title, /*#__PURE__*/_react["default"].createElement(_icon["default"], {
|
|
611
608
|
role: "add",
|
|
612
609
|
type: "search",
|
|
613
610
|
onClick: _onClick
|
|
614
611
|
}));
|
|
615
612
|
} else if (showIcon && iconType && type !== 'readonly' && showInfoTitle) {
|
|
616
|
-
var
|
|
617
|
-
var _onClick2 = (0, _bind["default"])(
|
|
613
|
+
var _context24;
|
|
614
|
+
var _onClick2 = (0, _bind["default"])(_context24 = _this2.onAdd).call(_context24, _this2, key, title);
|
|
618
615
|
return /*#__PURE__*/_react["default"].createElement("span", null, title, /*#__PURE__*/_react["default"].createElement(_tooltip["default"], {
|
|
619
616
|
title: showInfoTitle
|
|
620
617
|
}, /*#__PURE__*/_react["default"].createElement(_icon["default"], {
|
|
@@ -623,8 +620,8 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
|
|
|
623
620
|
onClick: _onClick2
|
|
624
621
|
})));
|
|
625
622
|
} else if (showIcon && iconType && type !== 'readonly') {
|
|
626
|
-
var
|
|
627
|
-
var _onClick3 = (0, _bind["default"])(
|
|
623
|
+
var _context25;
|
|
624
|
+
var _onClick3 = (0, _bind["default"])(_context25 = _this2.onAdd).call(_context25, _this2, key, title);
|
|
628
625
|
return /*#__PURE__*/_react["default"].createElement("span", null, title, /*#__PURE__*/_react["default"].createElement(_icon["default"], {
|
|
629
626
|
role: "add",
|
|
630
627
|
type: iconType,
|
|
@@ -646,7 +643,7 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
|
|
|
646
643
|
return title;
|
|
647
644
|
}
|
|
648
645
|
});
|
|
649
|
-
(0, _defineProperty2["default"])(
|
|
646
|
+
(0, _defineProperty2["default"])(_this2, "toCol", function (span, control) {
|
|
650
647
|
var factor = control.span || 1;
|
|
651
648
|
var status = _this2.getValidState(control);
|
|
652
649
|
var controlProps = _this2.getControlProps(control, status);
|
|
@@ -667,7 +664,7 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
|
|
|
667
664
|
key: control.key
|
|
668
665
|
}, checkable && /*#__PURE__*/_react["default"].createElement(_checkbox["default"], {
|
|
669
666
|
className: (0, _variables["default"])('SuperForm2').checkbox,
|
|
670
|
-
onChange: (0, _bind["default"])(onCheckItem).call(onCheckItem,
|
|
667
|
+
onChange: (0, _bind["default"])(onCheckItem).call(onCheckItem, _this2, control),
|
|
671
668
|
checked: control.checked
|
|
672
669
|
}), /*#__PURE__*/_react["default"].createElement(FormItem, (0, _extends2["default"])({}, itemProps, {
|
|
673
670
|
className: checkable ? (0, _variables["default"])('SuperForm2').formItemWithCheckbox : '',
|
|
@@ -695,8 +692,8 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
|
|
|
695
692
|
}
|
|
696
693
|
});
|
|
697
694
|
});
|
|
698
|
-
(0, _defineProperty2["default"])(
|
|
699
|
-
var
|
|
695
|
+
(0, _defineProperty2["default"])(_this2, "toCols", function () {
|
|
696
|
+
var _context26;
|
|
700
697
|
var _this2$props5 = _this2.props,
|
|
701
698
|
_this2$props5$colNum = _this2$props5.colNum,
|
|
702
699
|
colNum = _this2$props5$colNum === void 0 ? defaultColNum : _this2$props5$colNum,
|
|
@@ -705,7 +702,7 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
|
|
|
705
702
|
colNum = 1;
|
|
706
703
|
}
|
|
707
704
|
var span = 24 / colNum;
|
|
708
|
-
return (0, _map["default"])(
|
|
705
|
+
return (0, _map["default"])(_context26 = _this2.getControls()).call(_context26, function (control) {
|
|
709
706
|
if (allFullFather) {
|
|
710
707
|
control.allFullFather = allFullFather;
|
|
711
708
|
}
|
|
@@ -714,7 +711,8 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
|
|
|
714
711
|
});
|
|
715
712
|
return _this2;
|
|
716
713
|
}
|
|
717
|
-
(0,
|
|
714
|
+
(0, _inherits2["default"])(SuperForm2, _React$Component2);
|
|
715
|
+
return (0, _createClass2["default"])(SuperForm2, [{
|
|
718
716
|
key: "render",
|
|
719
717
|
value: function render() {
|
|
720
718
|
this.initValidState();
|
|
@@ -732,7 +730,6 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
|
|
|
732
730
|
}, this.toCols())));
|
|
733
731
|
}
|
|
734
732
|
}]);
|
|
735
|
-
return SuperForm2;
|
|
736
733
|
}(_react["default"].Component);
|
|
737
734
|
(0, _defineProperty2["default"])(SuperForm2, "propTypes", {
|
|
738
735
|
controls: _propTypes["default"].arrayOf(_propTypes["default"].shape(ControlType)).isRequired,
|