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.
Files changed (84) hide show
  1. package/es/Area/Area.js +8 -11
  2. package/es/CodeInput/CodeInput.js +16 -19
  3. package/es/Control/Control.js +21 -3
  4. package/es/Enhance/Dialogs.js +11 -14
  5. package/es/Enhance/Loading.js +15 -18
  6. package/es/Header/Header.js +17 -20
  7. package/es/Header/Vertical.js +11 -14
  8. package/es/ImageView/ImageView.js +10 -13
  9. package/es/InpurCascader/InputCascader.js +11 -14
  10. package/es/InputEditor/InputEditor.js +16 -18
  11. package/es/InputSearch/InputSearch.js +22 -24
  12. package/es/InputSelect/InputSelect.js +14 -17
  13. package/es/InputTreeSelect/InputTreeSelect.js +10 -13
  14. package/es/InputWriting/InputWriting.js +12 -15
  15. package/es/Layout/Layout.js +14 -17
  16. package/es/Link/Link.js +7 -10
  17. package/es/NumberInput/NumberInput.js +13 -16
  18. package/es/Search/Search.js +52 -55
  19. package/es/Search2/Search.js +83 -86
  20. package/es/Search2/Search.less +64 -64
  21. package/es/Search2/package.json +6 -6
  22. package/es/Sidebar/Sidebar.js +11 -14
  23. package/es/Sidebar2/Sidebar.js +13 -16
  24. package/es/SuperForm/SuperForm.js +74 -79
  25. package/es/SuperForm2/SuperForm.js +114 -105
  26. package/es/SuperForm2/SuperForm.less +7 -0
  27. package/es/SuperPagination/SuperPagination.js +8 -11
  28. package/es/SuperTab/SuperTab.js +12 -15
  29. package/es/SuperTab2/SuperTab2.js +13 -16
  30. package/es/SuperTable/DragSortRow.js +12 -15
  31. package/es/SuperTable/FilterDropDown.js +11 -14
  32. package/es/SuperTable/SuperTable.js +70 -73
  33. package/es/SuperTable2/SuperTable2.js +89 -92
  34. package/es/SuperTable2/SuperTableCell.js +27 -30
  35. package/es/SuperTable3/FilterDropDown.js +11 -14
  36. package/es/SuperTable3/SuperTable.js +58 -61
  37. package/es/SuperToolbar/SuperToolbar.js +11 -14
  38. package/es/SuperUpload/SuperUpload.js +74 -74
  39. package/es/Viewer/ImageViews.js +16 -19
  40. package/es/Viewer/Viewer.js +11 -14
  41. package/es/helper.js +18 -17
  42. package/lib/Area/Area.js +8 -11
  43. package/lib/CodeInput/CodeInput.js +16 -19
  44. package/lib/Control/Control.js +21 -3
  45. package/lib/Enhance/Dialogs.js +11 -14
  46. package/lib/Enhance/Loading.js +15 -18
  47. package/lib/Header/Header.js +17 -20
  48. package/lib/Header/Vertical.js +11 -14
  49. package/lib/ImageView/ImageView.js +10 -13
  50. package/lib/InpurCascader/InputCascader.js +11 -14
  51. package/lib/InputEditor/InputEditor.js +16 -18
  52. package/lib/InputSearch/InputSearch.js +22 -24
  53. package/lib/InputSelect/InputSelect.js +14 -17
  54. package/lib/InputTreeSelect/InputTreeSelect.js +10 -13
  55. package/lib/InputWriting/InputWriting.js +12 -15
  56. package/lib/Layout/Layout.js +14 -17
  57. package/lib/LayoutLink/LayoutLink.js +1 -2
  58. package/lib/Link/Link.js +7 -10
  59. package/lib/NumberInput/NumberInput.js +13 -16
  60. package/lib/Search/Search.js +53 -57
  61. package/lib/Search2/Search.js +84 -88
  62. package/lib/Search2/Search.less +64 -64
  63. package/lib/Search2/package.json +6 -6
  64. package/lib/Sidebar/Sidebar.js +11 -14
  65. package/lib/Sidebar2/Sidebar.js +13 -16
  66. package/lib/SuperForm/SuperForm.js +75 -81
  67. package/lib/SuperForm2/SuperForm.js +115 -107
  68. package/lib/SuperForm2/SuperForm.less +7 -0
  69. package/lib/SuperPagination/SuperPagination.js +8 -11
  70. package/lib/SuperTab/SuperTab.js +12 -15
  71. package/lib/SuperTab2/SuperTab2.js +13 -16
  72. package/lib/SuperTable/DragSortRow.js +12 -15
  73. package/lib/SuperTable/FilterDropDown.js +11 -14
  74. package/lib/SuperTable/SuperTable.js +70 -73
  75. package/lib/SuperTable2/SuperTable2.js +90 -94
  76. package/lib/SuperTable2/SuperTableCell.js +27 -30
  77. package/lib/SuperTable3/FilterDropDown.js +11 -14
  78. package/lib/SuperTable3/SuperTable.js +58 -61
  79. package/lib/SuperToolbar/SuperToolbar.js +11 -14
  80. package/lib/SuperUpload/SuperUpload.js +75 -76
  81. package/lib/Viewer/ImageViews.js +16 -19
  82. package/lib/Viewer/Viewer.js +11 -14
  83. package/lib/helper.js +18 -17
  84. 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,16 +43,15 @@ 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 _getRequireWildcardCache(e) { if ("function" != typeof _WeakMap) return null; var r = new _WeakMap(), t = new _WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
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 _context26, _context27; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context26 = ownKeys(Object(t), !0)).call(_context26, function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context27 = ownKeys(Object(t))).call(_context27, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
51
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = _Reflect$construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
52
- 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; } }
48
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context24, _context25; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context24 = ownKeys(Object(t), !0)).call(_context24, function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context25 = ownKeys(Object(t))).call(_context25, 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 = 'large';
55
53
  var defaultColNum = 4;
56
- var TYPE = ['readonly', 'text', 'search', 'searchText', 'select', 'selectText', 'radioGroup', 'number', 'date', 'textArea', 'password', 'editor', 'selectWriting', 'selectSearch', 'empty', 'captcha', 'area', 'uploadImg', 'cascader', 'checkbox', 'treeSelect'];
54
+ var TYPE = ['readonly', 'text', 'search', 'searchText', 'select', 'selectText', 'radioGroup', 'number', 'date', 'rangePicker', 'textArea', 'password', 'editor', 'selectWriting', 'selectSearch', 'empty', 'captcha', 'area', 'uploadImg', 'cascader', 'checkbox', 'treeSelect'];
57
55
 
58
56
  /**
59
57
  * key:[必须],用于唯一标识该Form下的一个表单元素
@@ -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 = _super.call(this, props);
87
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onChange", function (value) {
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, _createClass2["default"])(Controlled, [{
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) {
@@ -116,7 +113,6 @@ var Controlled = /*#__PURE__*/function (_React$Component) {
116
113
  return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
117
114
  }
118
115
  }]);
119
- return Controlled;
120
116
  }(_react["default"].Component);
121
117
  /**
122
118
  * colNum:[可选],表单的列数,默认为4
@@ -132,8 +128,6 @@ var Controlled = /*#__PURE__*/function (_React$Component) {
132
128
  * onFileChange:上传组件触发,原型为func(key,{fileList, fileDeleteList})
133
129
  */
134
130
  var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
135
- (0, _inherits2["default"])(SuperForm2, _React$Component2);
136
- var _super2 = _createSuper(SuperForm2);
137
131
  function SuperForm2() {
138
132
  var _context;
139
133
  var _this2;
@@ -141,35 +135,35 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
141
135
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
142
136
  args[_key] = arguments[_key];
143
137
  }
144
- _this2 = _super2.call.apply(_super2, (0, _concat["default"])(_context = [this]).call(_context, args));
145
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "onAdd", function (key, title) {
138
+ _this2 = _callSuper(this, SuperForm2, (0, _concat["default"])(_context = []).call(_context, args));
139
+ (0, _defineProperty2["default"])(_this2, "onAdd", function (key, title) {
146
140
  var onAdd = _this2.props.onAdd;
147
141
  onAdd && onAdd(key, title);
148
142
  });
149
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "onFileChange", function (_ref, file) {
143
+ (0, _defineProperty2["default"])(_this2, "onFileChange", function (_ref, file) {
150
144
  var key = _ref.key;
151
145
  var onFileChange = _this2.props.onFileChange;
152
146
  onFileChange && onFileChange(key, file);
153
147
  });
154
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "onChange", function (key, value) {
148
+ (0, _defineProperty2["default"])(_this2, "onChange", function (key, value) {
155
149
  var onChange = _this2.props.onChange;
156
150
  if (onChange) {
157
151
  _this2.onExitValid(key);
158
152
  onChange(key, value);
159
153
  }
160
154
  });
161
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "onGetCode", function (key, value) {
155
+ (0, _defineProperty2["default"])(_this2, "onGetCode", function (key, value) {
162
156
  var onGetCode = _this2.props.onGetCode;
163
157
  onGetCode && onGetCode();
164
158
  });
165
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "onBlur", function (key, value) {
159
+ (0, _defineProperty2["default"])(_this2, "onBlur", function (key, value) {
166
160
  var onChange = _this2.props.onChange;
167
161
  if (onChange) {
168
162
  _this2.onExitValid(key);
169
163
  onChange(key, value);
170
164
  }
171
165
  });
172
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "onExitValid", function (key, value) {
166
+ (0, _defineProperty2["default"])(_this2, "onExitValid", function (key, value) {
173
167
  if (key === _this2.validKey) {
174
168
  _this2.validKey = '';
175
169
  _this2.props.onExitValid();
@@ -177,7 +171,7 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
177
171
  _this2.props.onChangeOperate && _this2.props.onChangeOperate(key, value);
178
172
  });
179
173
  // 动态生成getValidState方法
180
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "initValidState", function () {
174
+ (0, _defineProperty2["default"])(_this2, "initValidState", function () {
181
175
  var _this2$props = _this2.props,
182
176
  value = _this2$props.value,
183
177
  valid = _this2$props.valid;
@@ -198,7 +192,7 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
198
192
  };
199
193
  _this2.getValidState = valid ? _valid : invalid;
200
194
  });
201
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "validDate", function (_ref3) {
195
+ (0, _defineProperty2["default"])(_this2, "validDate", function (_ref3) {
202
196
  var key = _ref3.key,
203
197
  type = _ref3.type;
204
198
  return function (date) {
@@ -217,25 +211,25 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
217
211
  }
218
212
  };
219
213
  });
220
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "getPopupContainer", function () {
214
+ (0, _defineProperty2["default"])(_this2, "getPopupContainer", function () {
221
215
  var container = _this2.props.container;
222
216
  if (typeof container === 'undefined') {
223
- return _reactDom["default"].findDOMNode((0, _assertThisInitialized2["default"])(_this2));
217
+ return _reactDom["default"].findDOMNode(_this2);
224
218
  } else if (typeof container === 'boolean') {
225
219
  return document.body;
226
220
  } else {
227
221
  return _reactDom["default"].findDOMNode(container);
228
222
  }
229
223
  });
230
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "getMaxWidth", function () {
224
+ (0, _defineProperty2["default"])(_this2, "getMaxWidth", function () {
231
225
  var _this2$props$colNum = _this2.props.colNum,
232
226
  colNum = _this2$props$colNum === void 0 ? defaultColNum : _this2$props$colNum;
233
227
  return colNum * 1200;
234
228
  });
235
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "getContainer", function () {
229
+ (0, _defineProperty2["default"])(_this2, "getContainer", function () {
236
230
  return _this2.props.getContainer;
237
231
  });
238
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "getControls", function () {
232
+ (0, _defineProperty2["default"])(_this2, "getControls", function () {
239
233
  var _this2$props2 = _this2.props,
240
234
  hideControls = _this2$props2.hideControls,
241
235
  controls = _this2$props2.controls;
@@ -249,7 +243,7 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
249
243
  });
250
244
  }
251
245
  });
252
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "getType", function (_ref4) {
246
+ (0, _defineProperty2["default"])(_this2, "getType", function (_ref4) {
253
247
  var _context2;
254
248
  var key = _ref4.key,
255
249
  type = _ref4.type;
@@ -268,7 +262,7 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
268
262
  return type;
269
263
  }
270
264
  });
271
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "specialProps", function (type, _ref5) {
265
+ (0, _defineProperty2["default"])(_this2, "specialProps", function (type, _ref5) {
272
266
  var key = _ref5.key,
273
267
  _ref5$props = _ref5.props,
274
268
  props = _ref5$props === void 0 ? {} : _ref5$props,
@@ -279,70 +273,70 @@ 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, (0, _assertThisInitialized2["default"])(_this2), key)
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, (0, _assertThisInitialized2["default"])(_this2), key)
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, (0, _assertThisInitialized2["default"])(_this2), key)
288
+ onBlur: (0, _bind["default"])(_context5 = _this2.onExitValid).call(_context5, _this2, key)
295
289
  };
296
290
  }
297
291
  } else if (type === 'text' || type === 'textArea') {
298
292
  var _context6, _context7;
299
293
  return _objectSpread(_objectSpread({}, props), {}, {
300
- onChange: (0, _bind["default"])(_context6 = _this2.onExitValid).call(_context6, (0, _assertThisInitialized2["default"])(_this2), key),
301
- onBlur: (0, _bind["default"])(_context7 = _this2.onChange).call(_context7, (0, _assertThisInitialized2["default"])(_this2), key)
294
+ onChange: (0, _bind["default"])(_context6 = _this2.onExitValid).call(_context6, _this2, key),
295
+ onBlur: (0, _bind["default"])(_context7 = _this2.onChange).call(_context7, _this2, key)
302
296
  });
303
297
  } else if (type === 'date') {
304
298
  var _context8, _context9;
305
299
  var propsObj = _objectSpread(_objectSpread({}, props), {}, {
306
- onChange: (0, _bind["default"])(_context8 = _this2.onBlur).call(_context8, (0, _assertThisInitialized2["default"])(_this2), key),
307
- onBlur: (0, _bind["default"])(_context9 = _this2.onExitValid).call(_context9, (0, _assertThisInitialized2["default"])(_this2), key)
300
+ onChange: (0, _bind["default"])(_context8 = _this2.onBlur).call(_context8, _this2, key),
301
+ onBlur: (0, _bind["default"])(_context9 = _this2.onExitValid).call(_context9, _this2, key)
308
302
  });
309
303
  if (_this2.props.onOpenChange && typeof _this2.props.onOpenChange === 'function') {
310
- var _context10;
311
- propsObj.onOpenChange = (0, _bind["default"])(_context10 = _this2.props.onOpenChange).call(_context10, (0, _assertThisInitialized2["default"])(_this2), key);
304
+ var _context0;
305
+ propsObj.onOpenChange = (0, _bind["default"])(_context0 = _this2.props.onOpenChange).call(_context0, _this2, key);
312
306
  }
313
307
  return propsObj;
314
308
  } else if (type === 'captcha') {
315
- var _context11, _context12, _context13;
309
+ var _context1, _context10, _context11;
316
310
  return _objectSpread(_objectSpread({}, props), {}, {
317
- onChange: (0, _bind["default"])(_context11 = _this2.onBlur).call(_context11, (0, _assertThisInitialized2["default"])(_this2), key),
318
- onBlur: (0, _bind["default"])(_context12 = _this2.onExitValid).call(_context12, (0, _assertThisInitialized2["default"])(_this2), key),
319
- onGetCode: (0, _bind["default"])(_context13 = _this2.onGetCode).call(_context13, (0, _assertThisInitialized2["default"])(_this2), key)
311
+ onChange: (0, _bind["default"])(_context1 = _this2.onBlur).call(_context1, _this2, key),
312
+ onBlur: (0, _bind["default"])(_context10 = _this2.onExitValid).call(_context10, _this2, key),
313
+ onGetCode: (0, _bind["default"])(_context11 = _this2.onGetCode).call(_context11, _this2, key)
320
314
  });
321
315
  } else if (type === 'area') {
322
- var _context14, _context15;
316
+ var _context12, _context13;
323
317
  return _objectSpread(_objectSpread({}, props), {}, {
324
- onChange: (0, _bind["default"])(_context14 = _this2.onBlur).call(_context14, (0, _assertThisInitialized2["default"])(_this2), key),
325
- onBlur: (0, _bind["default"])(_context15 = _this2.onExitValid).call(_context15, (0, _assertThisInitialized2["default"])(_this2), key),
318
+ onChange: (0, _bind["default"])(_context12 = _this2.onBlur).call(_context12, _this2, key),
319
+ onBlur: (0, _bind["default"])(_context13 = _this2.onExitValid).call(_context13, _this2, key),
326
320
  onAreaSearch: _this2.props.onAreaSearch
327
321
  });
328
322
  } else if (type === 'uploadImg') {
329
- var _context16, _context17;
323
+ var _context14, _context15;
330
324
  var _commonProps = _this2.props.buildSuperUploadProps ? _this2.props.buildSuperUploadProps() : {};
331
325
  return _objectSpread(_objectSpread(_objectSpread({}, props), _commonProps), {}, {
332
- onChange: (0, _bind["default"])(_context16 = _this2.onBlur).call(_context16, (0, _assertThisInitialized2["default"])(_this2), key),
333
- onBlur: (0, _bind["default"])(_context17 = _this2.onExitValid).call(_context17, (0, _assertThisInitialized2["default"])(_this2), key)
326
+ onChange: (0, _bind["default"])(_context14 = _this2.onBlur).call(_context14, _this2, key),
327
+ onBlur: (0, _bind["default"])(_context15 = _this2.onExitValid).call(_context15, _this2, key)
334
328
  });
335
329
  } else if (type === 'double') {
336
330
  return props;
337
331
  } else {
338
- var _context18, _context19;
332
+ var _context16, _context17;
339
333
  return _objectSpread(_objectSpread({}, props), {}, {
340
- onChange: (0, _bind["default"])(_context18 = _this2.onBlur).call(_context18, (0, _assertThisInitialized2["default"])(_this2), key),
341
- onBlur: (0, _bind["default"])(_context19 = _this2.onExitValid).call(_context19, (0, _assertThisInitialized2["default"])(_this2), key)
334
+ onChange: (0, _bind["default"])(_context16 = _this2.onBlur).call(_context16, _this2, key),
335
+ onBlur: (0, _bind["default"])(_context17 = _this2.onExitValid).call(_context17, _this2, key)
342
336
  });
343
337
  }
344
338
  });
345
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "getControlProps", function (control, status) {
339
+ (0, _defineProperty2["default"])(_this2, "getControlProps", function (control, status) {
346
340
  var _this2$props3 = _this2.props,
347
341
  _this2$props3$value = _this2$props3.value,
348
342
  value = _this2$props3$value === void 0 ? {} : _this2$props3$value,
@@ -357,25 +351,25 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
357
351
  value: (0, _Control.makeString)(value[control.key])
358
352
  });
359
353
  });
360
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "getOptions", function (key, options) {
354
+ (0, _defineProperty2["default"])(_this2, "getOptions", function (key, options) {
361
355
  var higher = _this2.props.options || {};
362
356
  return higher[key] || options;
363
357
  });
364
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "toEmpty", function (props) {});
365
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "toText", function (props) {
358
+ (0, _defineProperty2["default"])(_this2, "toEmpty", function (props) {});
359
+ (0, _defineProperty2["default"])(_this2, "toText", function (props) {
366
360
  return /*#__PURE__*/_react["default"].createElement(Controlled, props);
367
361
  });
368
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "toPassword", function (props) {
362
+ (0, _defineProperty2["default"])(_this2, "toPassword", function (props) {
369
363
  return /*#__PURE__*/_react["default"].createElement(Controlled, props);
370
364
  });
371
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "toEditor", function (props, control) {
365
+ (0, _defineProperty2["default"])(_this2, "toEditor", function (props, control) {
372
366
  props.inputKey = control.key;
373
367
  return /*#__PURE__*/_react["default"].createElement(Controlled, props);
374
368
  });
375
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "toSelectWriting", function (props, control) {
369
+ (0, _defineProperty2["default"])(_this2, "toSelectWriting", function (props, control) {
376
370
  return /*#__PURE__*/_react["default"].createElement(Controlled, props);
377
371
  });
378
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "toTextArea", function (props, control) {
372
+ (0, _defineProperty2["default"])(_this2, "toTextArea", function (props, control) {
379
373
  if (control.allFullFather) {
380
374
  props.rows = control.rows;
381
375
  props.maxLength = control.maxLength;
@@ -390,30 +384,31 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
390
384
  }
391
385
  return /*#__PURE__*/_react["default"].createElement(Controlled, props);
392
386
  });
393
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "toNumber", function (props) {
387
+ (0, _defineProperty2["default"])(_this2, "toNumber", function (props) {
394
388
  props.defaultValue = props.value;
395
389
  delete props.value;
396
390
  return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
397
391
  });
398
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "toDoubleInput", function (props, control, cc) {
399
- var _context20, _context21;
392
+ (0, _defineProperty2["default"])(_this2, "toDoubleInput", function (props, control, cc) {
393
+ var _context18, _context19;
400
394
  props.defaultValue = props.value;
401
395
  props.doubleKey = props.key;
402
396
  props.doubleValue = _helper["default"].getObject(cc, props.key);
403
- props.onChangeKey1 = (0, _bind["default"])(_context20 = _this2.onChange).call(_context20, (0, _assertThisInitialized2["default"])(_this2), props.key[0]);
404
- props.onChangeKey2 = (0, _bind["default"])(_context21 = _this2.onChange).call(_context21, (0, _assertThisInitialized2["default"])(_this2), props.key[1]);
397
+ props.onChangeKey1 = (0, _bind["default"])(_context18 = _this2.onChange).call(_context18, _this2, props.key[0]);
398
+ props.onChangeKey2 = (0, _bind["default"])(_context19 = _this2.onChange).call(_context19, _this2, props.key[1]);
405
399
  delete props.value;
406
400
  return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
407
401
  });
408
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "toSelect", function (props, _ref6) {
402
+ (0, _defineProperty2["default"])(_this2, "toSelect", function (props, _ref6) {
409
403
  var options = _ref6.options,
410
404
  key = _ref6.key;
411
405
  props.getPopupContainer = _this2.getPopupContainer;
412
406
  props.options = _this2.getOptions(key, options);
413
407
  props.dropdownMatchSelectWidth = false;
408
+ props.placeholder = filter.placeholder || '';
414
409
  return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
415
410
  });
416
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "toTreeSelect", function (props, filter) {
411
+ (0, _defineProperty2["default"])(_this2, "toTreeSelect", function (props, filter) {
417
412
  var container = _this2.getContainer();
418
413
  container && (props.getPopupContainer = container);
419
414
  props.options = _this2.getOptions(filter);
@@ -421,7 +416,7 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
421
416
  props.placeholder = filter.placeholder || '';
422
417
  return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
423
418
  });
424
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "createSearchEvent", function (control) {
419
+ (0, _defineProperty2["default"])(_this2, "createSearchEvent", function (control) {
425
420
  if (_this2.props.onSearch) {
426
421
  return function (value) {
427
422
  return _this2.props.onSearch(control.key, value, control);
@@ -430,7 +425,7 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
430
425
  return null;
431
426
  }
432
427
  });
433
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "createGetCodeEvent", function (control) {
428
+ (0, _defineProperty2["default"])(_this2, "createGetCodeEvent", function (control) {
434
429
  if (_this2.props.onGetCode) {
435
430
  return function (value) {
436
431
  return _this2.props.onGetCode(control.key, value, control);
@@ -439,14 +434,15 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
439
434
  return null;
440
435
  }
441
436
  });
442
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "toSearch", function (props, control) {
437
+ (0, _defineProperty2["default"])(_this2, "toSearch", function (props, control) {
443
438
  props.getPopupContainer = _this2.getPopupContainer;
444
439
  props.options = _this2.getOptions(control.key, control.options);
445
440
  props.onSearch = _this2.createSearchEvent(control);
446
441
  props.dropdownMatchSelectWidth = false;
442
+ props.placeholder = props.placeholder || '';
447
443
  return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
448
444
  });
449
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "toDate", function (props, _ref7) {
445
+ (0, _defineProperty2["default"])(_this2, "toDate", function (props, _ref7) {
450
446
  var rule = _ref7.rule;
451
447
  props.getCalendarContainer = _this2.getPopupContainer;
452
448
  props.style = {
@@ -455,32 +451,42 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
455
451
  rule && (props.disabledDate = _this2.validDate(rule));
456
452
  return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
457
453
  });
458
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "toRadioGroup", function (props, _ref8) {
459
- var key = _ref8.key,
460
- options = _ref8.options;
454
+ (0, _defineProperty2["default"])(_this2, "toRangePicker", function (props, _ref8) {
455
+ var rule = _ref8.rule;
456
+ props.getCalendarContainer = _this2.getPopupContainer;
457
+ props.style = {
458
+ width: '100%'
459
+ };
460
+ // rule && (props.disabledDate = this.validDate(rule));
461
+ return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
462
+ });
463
+ (0, _defineProperty2["default"])(_this2, "toRadioGroup", function (props, _ref9) {
464
+ var key = _ref9.key,
465
+ options = _ref9.options;
461
466
  props.options = _this2.getOptions(key, options);
462
467
  return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
463
468
  });
464
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "captcha", function (props, control) {
469
+ (0, _defineProperty2["default"])(_this2, "captcha", function (props, control) {
465
470
  props.onGetCode = _this2.props.onGetCode;
466
471
  return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
467
472
  });
468
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "toReadonly", function (props, _ref9) {
469
- var options = _ref9.options,
470
- key = _ref9.key;
473
+ (0, _defineProperty2["default"])(_this2, "toReadonly", function (props, _ref0) {
474
+ var options = _ref0.options,
475
+ key = _ref0.key;
471
476
  props.value = (0, _Control.getTitle)(props.value, _this2.getOptions(key, options));
472
477
  return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
473
478
  });
474
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "selectSearch", function (props, control) {
479
+ (0, _defineProperty2["default"])(_this2, "selectSearch", function (props, control) {
475
480
  props.getPopupContainer = _this2.getPopupContainer;
476
481
  props.options = _this2.getOptions(control.key, control.options);
477
482
  props.onSearch = _this2.createSearchEvent(control);
478
483
  props.dropdownMatchSelectWidth = false;
484
+ props.placeholder = props.placeholder || '';
479
485
  return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
480
486
  });
481
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "area", function (props, _ref10) {
482
- var key = _ref10.key,
483
- options = _ref10.options;
487
+ (0, _defineProperty2["default"])(_this2, "area", function (props, _ref1) {
488
+ var key = _ref1.key,
489
+ options = _ref1.options;
484
490
  var readonly = _this2.props.readonly;
485
491
  props.parentKey = key;
486
492
  props.options = _this2.getOptions(key, options);
@@ -490,17 +496,17 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
490
496
  }) ? true : false;
491
497
  return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
492
498
  });
493
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "uploadImg", function (props, control) {
494
- var _context22;
499
+ (0, _defineProperty2["default"])(_this2, "uploadImg", function (props, control) {
500
+ var _context20;
495
501
  var readonly = _this2.props.readonly;
496
502
  props.required = control.required || false;
497
- props.onFileChange = (0, _bind["default"])(_context22 = _this2.onFileChange).call(_context22, (0, _assertThisInitialized2["default"])(_this2), control);
503
+ props.onFileChange = (0, _bind["default"])(_context20 = _this2.onFileChange).call(_context20, _this2, control);
498
504
  props.readonly = readonly === true || (0, _isArray["default"])(readonly) && (0, _some["default"])(readonly).call(readonly, function (readonlyKey) {
499
505
  return readonlyKey === control.key;
500
506
  }) ? true : false;
501
507
  return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
502
508
  });
503
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "toCascader", function (props, control) {
509
+ (0, _defineProperty2["default"])(_this2, "toCascader", function (props, control) {
504
510
  var container = _this2.getContainer();
505
511
  container && (props.getPopupContainer = container);
506
512
  props.options = control.options || [];
@@ -509,16 +515,16 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
509
515
  props.loadData = _this2.createSearchEvent(control);
510
516
  return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
511
517
  });
512
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "toCheckbox", function (props, control) {
513
- var _context23;
518
+ (0, _defineProperty2["default"])(_this2, "toCheckbox", function (props, control) {
519
+ var _context21;
514
520
  var options = control.options || [];
515
521
  return /*#__PURE__*/_react["default"].createElement(_checkbox["default"].Group, {
516
522
  options: options,
517
- onChange: (0, _bind["default"])(_context23 = _this2.onBlur).call(_context23, (0, _assertThisInitialized2["default"])(_this2), control.key),
523
+ onChange: (0, _bind["default"])(_context21 = _this2.onBlur).call(_context21, _this2, control.key),
518
524
  value: _this2.props.value[control.key]
519
525
  });
520
526
  });
521
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "toControl", function (props, control) {
527
+ (0, _defineProperty2["default"])(_this2, "toControl", function (props, control) {
522
528
  switch (props.type) {
523
529
  case 'readonly':
524
530
  return _this2.toReadonly(props, control);
@@ -536,6 +542,8 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
536
542
  return _this2.toSearch(props, control);
537
543
  case 'date':
538
544
  return _this2.toDate(props, control);
545
+ case 'rangePicker':
546
+ return _this2.toRangePicker(props, control);
539
547
  case 'radioGroup':
540
548
  return _this2.toRadioGroup(props, control);
541
549
  case 'textArea':
@@ -566,15 +574,15 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
566
574
  return 'type error';
567
575
  }
568
576
  });
569
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "toLabel", function (_ref11, type) {
570
- var title = _ref11.title,
571
- showAdd = _ref11.showAdd,
572
- key = _ref11.key,
573
- showInfo = _ref11.showInfo,
574
- showInfoTitle = _ref11.showInfoTitle;
577
+ (0, _defineProperty2["default"])(_this2, "toLabel", function (_ref10, type) {
578
+ var title = _ref10.title,
579
+ showAdd = _ref10.showAdd,
580
+ key = _ref10.key,
581
+ showInfo = _ref10.showInfo,
582
+ showInfoTitle = _ref10.showInfoTitle;
575
583
  if (showAdd && type !== 'readonly') {
576
- var _context24;
577
- var onClick = (0, _bind["default"])(_context24 = _this2.onAdd).call(_context24, (0, _assertThisInitialized2["default"])(_this2), key, title);
584
+ var _context22;
585
+ var onClick = (0, _bind["default"])(_context22 = _this2.onAdd).call(_context22, _this2, key, title);
578
586
  return /*#__PURE__*/_react["default"].createElement("span", null, title, /*#__PURE__*/_react["default"].createElement(_icon["default"], {
579
587
  role: "add",
580
588
  type: "plus-circle-o",
@@ -590,7 +598,7 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
590
598
  return title;
591
599
  }
592
600
  });
593
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "toCol", function (span, control) {
601
+ (0, _defineProperty2["default"])(_this2, "toCol", function (span, control) {
594
602
  var factor = control.span || 1;
595
603
  var status = _this2.getValidState(control);
596
604
  var controlProps = _this2.getControlProps(control, status);
@@ -607,7 +615,7 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
607
615
  key: control.key
608
616
  }, checkable && /*#__PURE__*/_react["default"].createElement(_checkbox["default"], {
609
617
  className: (0, _variables["default"])('SuperForm2').checkbox,
610
- onChange: (0, _bind["default"])(onCheckItem).call(onCheckItem, (0, _assertThisInitialized2["default"])(_this2), control),
618
+ onChange: (0, _bind["default"])(onCheckItem).call(onCheckItem, _this2, control),
611
619
  checked: control.checked
612
620
  }), /*#__PURE__*/_react["default"].createElement(FormItem, (0, _extends2["default"])({}, itemProps, {
613
621
  className: checkable ? (0, _variables["default"])('SuperForm2').formItemWithCheckbox : '',
@@ -635,8 +643,8 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
635
643
  }
636
644
  });
637
645
  });
638
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "toCols", function () {
639
- var _context25;
646
+ (0, _defineProperty2["default"])(_this2, "toCols", function () {
647
+ var _context23;
640
648
  var _this2$props5 = _this2.props,
641
649
  _this2$props5$colNum = _this2$props5.colNum,
642
650
  colNum = _this2$props5$colNum === void 0 ? defaultColNum : _this2$props5$colNum,
@@ -645,7 +653,7 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
645
653
  colNum = 1;
646
654
  }
647
655
  var span = 24 / colNum;
648
- return (0, _map["default"])(_context25 = _this2.getControls()).call(_context25, function (control) {
656
+ return (0, _map["default"])(_context23 = _this2.getControls()).call(_context23, function (control) {
649
657
  if (allFullFather) {
650
658
  control.allFullFather = allFullFather;
651
659
  }
@@ -654,7 +662,8 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
654
662
  });
655
663
  return _this2;
656
664
  }
657
- (0, _createClass2["default"])(SuperForm2, [{
665
+ (0, _inherits2["default"])(SuperForm2, _React$Component2);
666
+ return (0, _createClass2["default"])(SuperForm2, [{
658
667
  key: "render",
659
668
  value: function render() {
660
669
  this.initValidState();
@@ -672,7 +681,6 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
672
681
  }, this.toCols())));
673
682
  }
674
683
  }]);
675
- return SuperForm2;
676
684
  }(_react["default"].Component);
677
685
  (0, _defineProperty2["default"])(SuperForm2, "propTypes", {
678
686
  controls: _propTypes["default"].arrayOf(_propTypes["default"].shape(ControlType)).isRequired,
@@ -34,6 +34,13 @@
34
34
  :global(.ant-select-selection--multiple) {
35
35
  border-top-width: 1px;
36
36
  }
37
+ :global(.ant-calendar-picker-input) {
38
+ display: flex;
39
+ }
40
+ :global(.has-error .ant-calendar-picker-input) {
41
+ border-color: #ff4d4f !important;
42
+ box-shadow:0 0 2px rgba(245, 34, 45, 0.2) !important;
43
+ }
37
44
 
38
45
  :global(.ant-radio-group-small) {
39
46
  display: block;