cloud-b2b 1.1.45 → 1.1.50

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 (109) hide show
  1. package/es/Area/Area.js +45 -16
  2. package/es/Card/Card.js +4 -3
  3. package/es/CodeInput/CodeInput.js +59 -30
  4. package/es/Control/Control.js +117 -58
  5. package/es/Control/event.js +14 -0
  6. package/es/Enhance/Dialogs.js +21 -6
  7. package/es/Enhance/Loading.js +46 -26
  8. package/es/Enhance/index.js +2 -0
  9. package/es/Header/Header.js +35 -3
  10. package/es/Header/Vertical.js +24 -1
  11. package/es/ImageView/ImageView.js +22 -5
  12. package/es/Indent/Indent.js +7 -3
  13. package/es/InpurCascader/InputCascader.js +36 -10
  14. package/es/InputEditor/InputEditor.js +52 -53
  15. package/es/InputSearch/InputSearch.js +71 -26
  16. package/es/InputSelect/InputSelect.js +48 -17
  17. package/es/InputTreeSelect/InputTreeSelect.js +147 -0
  18. package/es/InputTreeSelect/package.json +6 -0
  19. package/es/InputWriting/InputWriting.js +28 -6
  20. package/es/Layout/Layout.js +59 -28
  21. package/es/LayoutLink/LayoutLink.js +20 -11
  22. package/es/Link/Link.js +27 -4
  23. package/es/Loading/Loading.js +3 -1
  24. package/es/Loading2/Loading2.js +2 -0
  25. package/es/ModalWithDrag/ModalWithDrag.js +8 -3
  26. package/es/ModalWithDrag/drag.js +29 -12
  27. package/es/NumberInput/NumberInput.js +64 -24
  28. package/es/Search/Search.js +164 -54
  29. package/es/Sidebar/Sidebar.js +34 -13
  30. package/es/Sidebar2/Sidebar.js +30 -3
  31. package/es/SuperForm/SuperForm.js +164 -27
  32. package/es/SuperForm2/SuperForm.js +182 -31
  33. package/es/SuperIcon/SuperIcon.js +6 -3
  34. package/es/SuperPagination/SuperPagination.js +32 -15
  35. package/es/SuperTab/SuperTab.js +27 -4
  36. package/es/SuperTab2/SuperTab2.js +33 -11
  37. package/es/SuperTable/DragSortRow.js +34 -6
  38. package/es/SuperTable/FilterDropDown.js +34 -10
  39. package/es/SuperTable/SuperTable.js +216 -84
  40. package/es/SuperTable/fixed.js +9 -1
  41. package/es/SuperTable2/SuperTable2.js +227 -102
  42. package/es/SuperTable2/SuperTableCell.js +60 -16
  43. package/es/SuperTable3/FilterDropDown.js +34 -10
  44. package/es/SuperTable3/SuperTable.js +175 -50
  45. package/es/SuperTable3/fixed.js +9 -1
  46. package/es/SuperToolbar/SuperToolbar.js +49 -21
  47. package/es/SuperUpload/SuperUpload.js +233 -156
  48. package/es/Title/Title.js +15 -12
  49. package/es/Viewer/ImageViews.js +60 -7
  50. package/es/Viewer/Viewer.js +32 -5
  51. package/es/WingBlank/WingBlank.js +6 -2
  52. package/es/helper.js +29 -7
  53. package/es/history.js +2 -3
  54. package/lib/Area/Area.js +64 -16
  55. package/lib/Card/Card.js +13 -3
  56. package/lib/CodeInput/CodeInput.js +77 -30
  57. package/lib/Control/Control.js +160 -58
  58. package/lib/Control/event.js +16 -0
  59. package/lib/Enhance/Dialogs.js +32 -6
  60. package/lib/Enhance/Loading.js +62 -26
  61. package/lib/Enhance/index.js +9 -0
  62. package/lib/Header/Header.js +48 -3
  63. package/lib/Header/Vertical.js +36 -1
  64. package/lib/ImageView/ImageView.js +30 -5
  65. package/lib/Indent/Indent.js +13 -3
  66. package/lib/InpurCascader/InputCascader.js +50 -11
  67. package/lib/InputEditor/InputEditor.js +61 -53
  68. package/lib/InputSearch/InputSearch.js +78 -26
  69. package/lib/InputSelect/InputSelect.js +62 -17
  70. package/lib/InputTreeSelect/InputTreeSelect.js +169 -0
  71. package/lib/InputTreeSelect/package.json +6 -0
  72. package/lib/InputWriting/InputWriting.js +35 -6
  73. package/lib/Layout/Layout.js +76 -28
  74. package/lib/LayoutLink/LayoutLink.js +38 -11
  75. package/lib/Link/Link.js +40 -4
  76. package/lib/Loading/Loading.js +9 -1
  77. package/lib/Loading2/Loading2.js +8 -0
  78. package/lib/ModalWithDrag/ModalWithDrag.js +18 -3
  79. package/lib/ModalWithDrag/drag.js +34 -12
  80. package/lib/NumberInput/NumberInput.js +77 -24
  81. package/lib/Search/Search.js +171 -54
  82. package/lib/Sidebar/Sidebar.js +46 -13
  83. package/lib/Sidebar2/Sidebar.js +42 -3
  84. package/lib/SuperForm/SuperForm.js +162 -27
  85. package/lib/SuperForm2/SuperForm.js +175 -31
  86. package/lib/SuperIcon/SuperIcon.js +14 -3
  87. package/lib/SuperPagination/SuperPagination.js +42 -15
  88. package/lib/SuperTab/SuperTab.js +34 -4
  89. package/lib/SuperTab2/SuperTab2.js +48 -11
  90. package/lib/SuperTable/DragSortRow.js +42 -6
  91. package/lib/SuperTable/FilterDropDown.js +42 -10
  92. package/lib/SuperTable/SuperTable.js +211 -83
  93. package/lib/SuperTable/fixed.js +13 -1
  94. package/lib/SuperTable2/SuperTable2.js +241 -102
  95. package/lib/SuperTable2/SuperTableCell.js +67 -13
  96. package/lib/SuperTable3/FilterDropDown.js +42 -10
  97. package/lib/SuperTable3/SuperTable.js +170 -49
  98. package/lib/SuperTable3/fixed.js +13 -1
  99. package/lib/SuperToolbar/SuperToolbar.js +64 -20
  100. package/lib/SuperUpload/SuperUpload.js +267 -156
  101. package/lib/Title/Title.js +24 -12
  102. package/lib/Viewer/ImageViews.js +63 -7
  103. package/lib/Viewer/Viewer.js +41 -5
  104. package/lib/WingBlank/WingBlank.js +14 -2
  105. package/lib/helper.js +47 -6
  106. package/lib/history.js +5 -0
  107. package/lib/index.js +76 -0
  108. package/lib/variables.js +4 -0
  109. package/package.json +2 -2
@@ -1,60 +1,107 @@
1
1
  "use strict";
2
2
 
3
3
  var _typeof3 = require("@babel/runtime-corejs3/helpers/typeof");
4
+
4
5
  var _Reflect$construct = require("@babel/runtime-corejs3/core-js-stable/reflect/construct");
6
+
5
7
  var _Object$keys = require("@babel/runtime-corejs3/core-js-stable/object/keys");
8
+
6
9
  var _Object$getOwnPropertySymbols = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols");
10
+
7
11
  var _filterInstanceProperty2 = require("@babel/runtime-corejs3/core-js-stable/instance/filter");
12
+
8
13
  var _Object$getOwnPropertyDescriptor = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor");
14
+
9
15
  var _forEachInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/for-each");
16
+
10
17
  var _Object$getOwnPropertyDescriptors = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors");
18
+
11
19
  var _Object$defineProperties = require("@babel/runtime-corejs3/core-js-stable/object/define-properties");
20
+
12
21
  var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
22
+
13
23
  var _WeakMap = require("@babel/runtime-corejs3/core-js-stable/weak-map");
24
+
14
25
  var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
26
+
15
27
  _Object$defineProperty(exports, "__esModule", {
16
28
  value: true
17
29
  });
30
+
18
31
  exports["default"] = void 0;
32
+
19
33
  var _concat = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/concat"));
34
+
20
35
  var _isArray = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/array/is-array"));
36
+
21
37
  var _filter = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/filter"));
38
+
22
39
  var _some = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/some"));
40
+
23
41
  var _includes = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/includes"));
42
+
24
43
  var _bind = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/bind"));
44
+
25
45
  var _map = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/map"));
46
+
26
47
  var _row = _interopRequireDefault(require("antd/lib/row"));
48
+
27
49
  var _col = _interopRequireDefault(require("antd/lib/col"));
50
+
28
51
  var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/extends"));
52
+
29
53
  var _tooltip = _interopRequireDefault(require("antd/lib/tooltip"));
54
+
30
55
  var _icon = _interopRequireDefault(require("antd/lib/icon"));
56
+
31
57
  var _checkbox = _interopRequireDefault(require("antd/lib/checkbox"));
58
+
32
59
  var _typeof2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/typeof"));
60
+
33
61
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/classCallCheck"));
62
+
34
63
  var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/createClass"));
64
+
35
65
  var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/assertThisInitialized"));
66
+
36
67
  var _inherits2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/inherits"));
68
+
37
69
  var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/possibleConstructorReturn"));
70
+
38
71
  var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/getPrototypeOf"));
72
+
39
73
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/defineProperty"));
74
+
40
75
  var _form = _interopRequireDefault(require("antd/lib/form"));
76
+
41
77
  var _react = _interopRequireDefault(require("react"));
78
+
42
79
  var _propTypes = _interopRequireDefault(require("prop-types"));
80
+
43
81
  var _reactDom = _interopRequireDefault(require("react-dom"));
82
+
44
83
  var _helper = _interopRequireDefault(require("../helper"));
84
+
45
85
  var _Control = _interopRequireWildcard(require("../Control"));
86
+
46
87
  var _variables = _interopRequireDefault(require("../variables"));
88
+
47
89
  function _getRequireWildcardCache(nodeInterop) { if (typeof _WeakMap !== "function") return null; var cacheBabelInterop = new _WeakMap(); var cacheNodeInterop = new _WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
90
+
48
91
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof3(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = _Object$defineProperty && _Object$getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? _Object$getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { _Object$defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
92
+
49
93
  function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty2(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
94
+
50
95
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context26, _context27; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context26 = ownKeys(Object(source), !0)).call(_context26, function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context27 = ownKeys(Object(source))).call(_context27, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
96
+
51
97
  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); }; }
98
+
52
99
  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; } }
100
+
53
101
  var FormItem = _form["default"].Item;
54
102
  var defaultSize = 'large';
55
103
  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'];
57
-
104
+ var TYPE = ['readonly', 'text', 'search', 'searchText', 'select', 'selectText', 'radioGroup', 'number', 'date', 'textArea', 'password', 'editor', 'selectWriting', 'selectSearch', 'empty', 'captcha', 'area', 'uploadImg', 'cascader', 'checkbox', 'treeSelect'];
58
105
  /**
59
106
  * key:[必须],用于唯一标识该Form下的一个表单元素
60
107
  * title:[必须],表单元素的标签
@@ -65,6 +112,7 @@ var TYPE = ['readonly', 'text', 'search', 'searchText', 'select', 'selectText',
65
112
  * showAdd: [可选],是否显示+号,点击+号会触发onAdd事件,默认为false
66
113
  * rule: [可选],用于设置校验规则
67
114
  */
115
+
68
116
  var ControlType = {
69
117
  key: _propTypes["default"].string.isRequired,
70
118
  title: _propTypes["default"].string,
@@ -77,18 +125,24 @@ var ControlType = {
77
125
  rule: _propTypes["default"].object,
78
126
  props: _propTypes["default"].object
79
127
  };
128
+
80
129
  var Controlled = /*#__PURE__*/function (_React$Component) {
81
130
  (0, _inherits2["default"])(Controlled, _React$Component);
131
+
82
132
  var _super = _createSuper(Controlled);
133
+
83
134
  function Controlled(props) {
84
135
  var _this;
136
+
85
137
  (0, _classCallCheck2["default"])(this, Controlled);
86
138
  _this = _super.call(this, props);
87
139
  (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onChange", function (value) {
88
140
  var onChange = _this.props.onChange;
141
+
89
142
  _this.setState({
90
143
  value: value
91
144
  });
145
+
92
146
  onChange && onChange(value);
93
147
  });
94
148
  _this.state = {
@@ -96,6 +150,7 @@ var Controlled = /*#__PURE__*/function (_React$Component) {
96
150
  };
97
151
  return _this;
98
152
  }
153
+
99
154
  (0, _createClass2["default"])(Controlled, [{
100
155
  key: "componentWillReceiveProps",
101
156
  value: function componentWillReceiveProps(nextProps) {
@@ -113,6 +168,7 @@ var Controlled = /*#__PURE__*/function (_React$Component) {
113
168
  value: this.state.value,
114
169
  onChange: this.onChange
115
170
  });
171
+
116
172
  return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
117
173
  }
118
174
  }]);
@@ -131,16 +187,24 @@ var Controlled = /*#__PURE__*/function (_React$Component) {
131
187
  * onAreaSearch:联级选择器触发,原型为func(key - 当前联级key, title - 输入值, parentKey - 主体联级key)
132
188
  * onFileChange:上传组件触发,原型为func(key,{fileList, fileDeleteList})
133
189
  */
190
+
191
+
134
192
  var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
135
193
  (0, _inherits2["default"])(SuperForm2, _React$Component2);
194
+
136
195
  var _super2 = _createSuper(SuperForm2);
196
+
137
197
  function SuperForm2() {
138
198
  var _context;
199
+
139
200
  var _this2;
201
+
140
202
  (0, _classCallCheck2["default"])(this, SuperForm2);
203
+
141
204
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
142
205
  args[_key] = arguments[_key];
143
206
  }
207
+
144
208
  _this2 = _super2.call.apply(_super2, (0, _concat["default"])(_context = [this]).call(_context, args));
145
209
  (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "onAdd", function (key, title) {
146
210
  var onAdd = _this2.props.onAdd;
@@ -153,8 +217,10 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
153
217
  });
154
218
  (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "onChange", function (key, value) {
155
219
  var onChange = _this2.props.onChange;
220
+
156
221
  if (onChange) {
157
222
  _this2.onExitValid(key);
223
+
158
224
  onChange(key, value);
159
225
  }
160
226
  });
@@ -164,29 +230,36 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
164
230
  });
165
231
  (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "onBlur", function (key, value) {
166
232
  var onChange = _this2.props.onChange;
233
+
167
234
  if (onChange) {
168
235
  _this2.onExitValid(key);
236
+
169
237
  onChange(key, value);
170
238
  }
171
239
  });
172
240
  (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "onExitValid", function (key, value) {
173
241
  if (key === _this2.validKey) {
174
242
  _this2.validKey = '';
243
+
175
244
  _this2.props.onExitValid();
176
245
  }
246
+
177
247
  _this2.props.onChangeOperate && _this2.props.onChangeOperate(key, value);
178
248
  });
179
249
  // 动态生成getValidState方法
180
250
  (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "initValidState", function () {
181
251
  var _this2$props = _this2.props,
182
- value = _this2$props.value,
183
- valid = _this2$props.valid;
252
+ value = _this2$props.value,
253
+ valid = _this2$props.valid;
254
+
184
255
  var invalid = function invalid() {
185
256
  return null;
186
257
  };
258
+
187
259
  var _valid = function _valid(_ref2) {
188
260
  var key = _ref2.key,
189
- required = _ref2.required;
261
+ required = _ref2.required;
262
+
190
263
  if (required) {
191
264
  if (!value || _helper["default"].isEmpty2(value[key]) || !(0, _isArray["default"])(value[key]) && (0, _typeof2["default"])(value[key]) === 'object' && _helper["default"].isEmpty(value[key].value)) {
192
265
  _this2.getValidState = invalid;
@@ -194,16 +267,19 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
194
267
  return 'error';
195
268
  }
196
269
  }
270
+
197
271
  return null;
198
272
  };
273
+
199
274
  _this2.getValidState = valid ? _valid : invalid;
200
275
  });
201
276
  (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "validDate", function (_ref3) {
202
277
  var key = _ref3.key,
203
- type = _ref3.type;
278
+ type = _ref3.type;
204
279
  return function (date) {
205
280
  var _this2$props$value = _this2.props.value,
206
- value = _this2$props$value === void 0 ? {} : _this2$props$value;
281
+ value = _this2$props$value === void 0 ? {} : _this2$props$value;
282
+
207
283
  if (!date || !value[key]) {
208
284
  return false;
209
285
  } else {
@@ -219,6 +295,7 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
219
295
  });
220
296
  (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "getPopupContainer", function () {
221
297
  var container = _this2.props.container;
298
+
222
299
  if (typeof container === 'undefined') {
223
300
  return _reactDom["default"].findDOMNode((0, _assertThisInitialized2["default"])(_this2));
224
301
  } else if (typeof container === 'boolean') {
@@ -229,7 +306,7 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
229
306
  });
230
307
  (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "getMaxWidth", function () {
231
308
  var _this2$props$colNum = _this2.props.colNum,
232
- colNum = _this2$props$colNum === void 0 ? defaultColNum : _this2$props$colNum;
309
+ colNum = _this2$props$colNum === void 0 ? defaultColNum : _this2$props$colNum;
233
310
  return colNum * 1200;
234
311
  });
235
312
  (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "getContainer", function () {
@@ -237,8 +314,9 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
237
314
  });
238
315
  (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "getControls", function () {
239
316
  var _this2$props2 = _this2.props,
240
- hideControls = _this2$props2.hideControls,
241
- controls = _this2$props2.controls;
317
+ hideControls = _this2$props2.hideControls,
318
+ controls = _this2$props2.controls;
319
+
242
320
  if (!hideControls) {
243
321
  return controls;
244
322
  } else {
@@ -251,9 +329,11 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
251
329
  });
252
330
  (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "getType", function (_ref4) {
253
331
  var _context2;
332
+
254
333
  var key = _ref4.key,
255
- type = _ref4.type;
334
+ type = _ref4.type;
256
335
  var readonly = _this2.props.readonly;
336
+
257
337
  if ((0, _includes["default"])(_context2 = ['area', 'uploadImg']).call(_context2, type)) {
258
338
  return type;
259
339
  } else if (!readonly) {
@@ -270,12 +350,14 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
270
350
  });
271
351
  (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "specialProps", function (type, _ref5) {
272
352
  var key = _ref5.key,
273
- _ref5$props = _ref5.props,
274
- props = _ref5$props === void 0 ? {} : _ref5$props,
275
- originType = _ref5.type;
353
+ _ref5$props = _ref5.props,
354
+ props = _ref5$props === void 0 ? {} : _ref5$props,
355
+ originType = _ref5.type;
356
+
276
357
  if (type === 'readonly') {
277
358
  if (originType === 'textArea') {
278
359
  var _context3;
360
+
279
361
  return {
280
362
  type: 'textArea',
281
363
  readonly: true,
@@ -283,6 +365,7 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
283
365
  };
284
366
  } else if (originType === 'uploadImg') {
285
367
  var _context4;
368
+
286
369
  var commonProps = _this2.props.buildSuperUploadProps ? _this2.props.buildSuperUploadProps() : {};
287
370
  return _objectSpread(_objectSpread(_objectSpread({}, props), commonProps), {}, {
288
371
  readonly: true,
@@ -290,29 +373,36 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
290
373
  });
291
374
  } else {
292
375
  var _context5;
376
+
293
377
  return {
294
378
  onBlur: (0, _bind["default"])(_context5 = _this2.onExitValid).call(_context5, (0, _assertThisInitialized2["default"])(_this2), key)
295
379
  };
296
380
  }
297
381
  } else if (type === 'text' || type === 'textArea') {
298
382
  var _context6, _context7;
383
+
299
384
  return _objectSpread(_objectSpread({}, props), {}, {
300
385
  onChange: (0, _bind["default"])(_context6 = _this2.onExitValid).call(_context6, (0, _assertThisInitialized2["default"])(_this2), key),
301
386
  onBlur: (0, _bind["default"])(_context7 = _this2.onChange).call(_context7, (0, _assertThisInitialized2["default"])(_this2), key)
302
387
  });
303
388
  } else if (type === 'date') {
304
389
  var _context8, _context9;
390
+
305
391
  var propsObj = _objectSpread(_objectSpread({}, props), {}, {
306
392
  onChange: (0, _bind["default"])(_context8 = _this2.onBlur).call(_context8, (0, _assertThisInitialized2["default"])(_this2), key),
307
393
  onBlur: (0, _bind["default"])(_context9 = _this2.onExitValid).call(_context9, (0, _assertThisInitialized2["default"])(_this2), key)
308
394
  });
395
+
309
396
  if (_this2.props.onOpenChange && typeof _this2.props.onOpenChange === 'function') {
310
397
  var _context10;
398
+
311
399
  propsObj.onOpenChange = (0, _bind["default"])(_context10 = _this2.props.onOpenChange).call(_context10, (0, _assertThisInitialized2["default"])(_this2), key);
312
400
  }
401
+
313
402
  return propsObj;
314
403
  } else if (type === 'captcha') {
315
404
  var _context11, _context12, _context13;
405
+
316
406
  return _objectSpread(_objectSpread({}, props), {}, {
317
407
  onChange: (0, _bind["default"])(_context11 = _this2.onBlur).call(_context11, (0, _assertThisInitialized2["default"])(_this2), key),
318
408
  onBlur: (0, _bind["default"])(_context12 = _this2.onExitValid).call(_context12, (0, _assertThisInitialized2["default"])(_this2), key),
@@ -320,6 +410,7 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
320
410
  });
321
411
  } else if (type === 'area') {
322
412
  var _context14, _context15;
413
+
323
414
  return _objectSpread(_objectSpread({}, props), {}, {
324
415
  onChange: (0, _bind["default"])(_context14 = _this2.onBlur).call(_context14, (0, _assertThisInitialized2["default"])(_this2), key),
325
416
  onBlur: (0, _bind["default"])(_context15 = _this2.onExitValid).call(_context15, (0, _assertThisInitialized2["default"])(_this2), key),
@@ -327,7 +418,9 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
327
418
  });
328
419
  } else if (type === 'uploadImg') {
329
420
  var _context16, _context17;
421
+
330
422
  var _commonProps = _this2.props.buildSuperUploadProps ? _this2.props.buildSuperUploadProps() : {};
423
+
331
424
  return _objectSpread(_objectSpread(_objectSpread({}, props), _commonProps), {}, {
332
425
  onChange: (0, _bind["default"])(_context16 = _this2.onBlur).call(_context16, (0, _assertThisInitialized2["default"])(_this2), key),
333
426
  onBlur: (0, _bind["default"])(_context17 = _this2.onExitValid).call(_context17, (0, _assertThisInitialized2["default"])(_this2), key)
@@ -336,6 +429,7 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
336
429
  return props;
337
430
  } else {
338
431
  var _context18, _context19;
432
+
339
433
  return _objectSpread(_objectSpread({}, props), {}, {
340
434
  onChange: (0, _bind["default"])(_context18 = _this2.onBlur).call(_context18, (0, _assertThisInitialized2["default"])(_this2), key),
341
435
  onBlur: (0, _bind["default"])(_context19 = _this2.onExitValid).call(_context19, (0, _assertThisInitialized2["default"])(_this2), key)
@@ -344,11 +438,14 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
344
438
  });
345
439
  (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "getControlProps", function (control, status) {
346
440
  var _this2$props3 = _this2.props,
347
- _this2$props3$value = _this2$props3.value,
348
- value = _this2$props3$value === void 0 ? {} : _this2$props3$value,
349
- readonly = _this2$props3.readonly;
441
+ _this2$props3$value = _this2$props3.value,
442
+ value = _this2$props3$value === void 0 ? {} : _this2$props3$value,
443
+ readonly = _this2$props3.readonly;
444
+
350
445
  var type = _this2.getType(control);
446
+
351
447
  var props = _this2.specialProps(type, control);
448
+
352
449
  return _objectSpread(_objectSpread({
353
450
  autoFocus: !!status,
354
451
  type: type
@@ -388,6 +485,7 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
388
485
  maxRows: 5
389
486
  };
390
487
  }
488
+
391
489
  return /*#__PURE__*/_react["default"].createElement(Controlled, props);
392
490
  });
393
491
  (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "toNumber", function (props) {
@@ -397,6 +495,7 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
397
495
  });
398
496
  (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "toDoubleInput", function (props, control, cc) {
399
497
  var _context20, _context21;
498
+
400
499
  props.defaultValue = props.value;
401
500
  props.doubleKey = props.key;
402
501
  props.doubleValue = _helper["default"].getObject(cc, props.key);
@@ -407,12 +506,21 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
407
506
  });
408
507
  (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "toSelect", function (props, _ref6) {
409
508
  var options = _ref6.options,
410
- key = _ref6.key;
509
+ key = _ref6.key;
411
510
  props.getPopupContainer = _this2.getPopupContainer;
412
511
  props.options = _this2.getOptions(key, options);
413
512
  props.dropdownMatchSelectWidth = false;
414
513
  return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
415
514
  });
515
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "toTreeSelect", function (props, filter) {
516
+ var container = _this2.getContainer();
517
+
518
+ container && (props.getPopupContainer = container);
519
+ props.options = _this2.getOptions(filter);
520
+ props.onSearch = _this2.createSearchEvent(filter);
521
+ props.placeholder = filter.placeholder || '';
522
+ return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
523
+ });
416
524
  (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "createSearchEvent", function (control) {
417
525
  if (_this2.props.onSearch) {
418
526
  return function (value) {
@@ -450,7 +558,7 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
450
558
  });
451
559
  (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "toRadioGroup", function (props, _ref8) {
452
560
  var key = _ref8.key,
453
- options = _ref8.options;
561
+ options = _ref8.options;
454
562
  props.options = _this2.getOptions(key, options);
455
563
  return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
456
564
  });
@@ -460,7 +568,7 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
460
568
  });
461
569
  (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "toReadonly", function (props, _ref9) {
462
570
  var options = _ref9.options,
463
- key = _ref9.key;
571
+ key = _ref9.key;
464
572
  props.value = (0, _Control.getTitle)(props.value, _this2.getOptions(key, options));
465
573
  return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
466
574
  });
@@ -473,7 +581,7 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
473
581
  });
474
582
  (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "area", function (props, _ref10) {
475
583
  var key = _ref10.key,
476
- options = _ref10.options;
584
+ options = _ref10.options;
477
585
  var readonly = _this2.props.readonly;
478
586
  props.parentKey = key;
479
587
  props.options = _this2.getOptions(key, options);
@@ -485,6 +593,7 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
485
593
  });
486
594
  (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "uploadImg", function (props, control) {
487
595
  var _context22;
596
+
488
597
  var readonly = _this2.props.readonly;
489
598
  props.required = control.required || false;
490
599
  props.onFileChange = (0, _bind["default"])(_context22 = _this2.onFileChange).call(_context22, (0, _assertThisInitialized2["default"])(_this2), control);
@@ -495,6 +604,7 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
495
604
  });
496
605
  (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "toCascader", function (props, control) {
497
606
  var container = _this2.getContainer();
607
+
498
608
  container && (props.getPopupContainer = container);
499
609
  props.options = control.options || [];
500
610
  props.onSearch = _this2.createSearchEvent(control);
@@ -504,6 +614,7 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
504
614
  });
505
615
  (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "toCheckbox", function (props, control) {
506
616
  var _context23;
617
+
507
618
  var options = control.options || [];
508
619
  return /*#__PURE__*/_react["default"].createElement(_checkbox["default"].Group, {
509
620
  options: options,
@@ -515,56 +626,80 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
515
626
  switch (props.type) {
516
627
  case 'readonly':
517
628
  return _this2.toReadonly(props, control);
629
+
518
630
  case 'double':
519
631
  return _this2.toDoubleInput(props, control, _this2.props.value);
632
+
520
633
  case 'text':
521
634
  return _this2.toText(props, control);
635
+
522
636
  case 'number':
523
637
  return _this2.toNumber(props, control);
638
+
524
639
  case 'select':
525
640
  case 'selectText':
526
641
  return _this2.toSelect(props, control);
642
+
527
643
  case 'search':
528
644
  case 'searchText':
529
645
  return _this2.toSearch(props, control);
646
+
530
647
  case 'date':
531
648
  return _this2.toDate(props, control);
649
+
532
650
  case 'radioGroup':
533
651
  return _this2.toRadioGroup(props, control);
652
+
534
653
  case 'textArea':
535
654
  return _this2.toTextArea(props, control);
655
+
536
656
  case 'password':
537
657
  return _this2.toPassword(props, control);
658
+
538
659
  case 'editor':
539
660
  return _this2.toEditor(props, control);
661
+
540
662
  case 'selectWriting':
541
663
  return _this2.toSelectWriting(props, control);
664
+
542
665
  case 'selectSearch':
543
666
  return _this2.selectSearch(props, control);
667
+
544
668
  case 'empty':
545
669
  return _this2.toEmpty(props, control);
670
+
546
671
  case 'captcha':
547
672
  return _this2.captcha(props, control);
673
+
548
674
  case 'area':
549
675
  return _this2.area(props, control);
676
+
550
677
  case 'uploadImg':
551
678
  return _this2.uploadImg(props, control);
679
+
552
680
  case 'cascader':
553
681
  return _this2.toCascader(props, control);
682
+
683
+ case 'treeSelect':
684
+ return _this2.toTreeSelect(props, control);
685
+
554
686
  case 'checkbox':
555
687
  return _this2.toCheckbox(props, control);
688
+
556
689
  default:
557
690
  return 'type error';
558
691
  }
559
692
  });
560
693
  (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "toLabel", function (_ref11, type) {
561
694
  var title = _ref11.title,
562
- showAdd = _ref11.showAdd,
563
- key = _ref11.key,
564
- showInfo = _ref11.showInfo,
565
- showInfoTitle = _ref11.showInfoTitle;
695
+ showAdd = _ref11.showAdd,
696
+ key = _ref11.key,
697
+ showInfo = _ref11.showInfo,
698
+ showInfoTitle = _ref11.showInfoTitle;
699
+
566
700
  if (showAdd && type !== 'readonly') {
567
701
  var _context24;
702
+
568
703
  var onClick = (0, _bind["default"])(_context24 = _this2.onAdd).call(_context24, (0, _assertThisInitialized2["default"])(_this2), key, title);
569
704
  return /*#__PURE__*/_react["default"].createElement("span", null, title, /*#__PURE__*/_react["default"].createElement(_icon["default"], {
570
705
  role: "add",
@@ -583,16 +718,19 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
583
718
  });
584
719
  (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "toCol", function (span, control) {
585
720
  var factor = control.span || 1;
721
+
586
722
  var status = _this2.getValidState(control);
723
+
587
724
  var controlProps = _this2.getControlProps(control, status);
725
+
588
726
  var itemProps = {
589
727
  label: _this2.toLabel(control, controlProps.type),
590
728
  required: control.required,
591
729
  validateStatus: status
592
730
  };
593
731
  var _this2$props4 = _this2.props,
594
- checkable = _this2$props4.checkable,
595
- onCheckItem = _this2$props4.onCheckItem;
732
+ checkable = _this2$props4.checkable,
733
+ onCheckItem = _this2$props4.onCheckItem;
596
734
  return control.type !== 'empty' ? /*#__PURE__*/_react["default"].createElement(_col["default"], {
597
735
  span: span * factor,
598
736
  key: control.key
@@ -628,29 +766,34 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
628
766
  });
629
767
  (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "toCols", function () {
630
768
  var _context25;
769
+
631
770
  var _this2$props5 = _this2.props,
632
- _this2$props5$colNum = _this2$props5.colNum,
633
- colNum = _this2$props5$colNum === void 0 ? defaultColNum : _this2$props5$colNum,
634
- allFullFather = _this2$props5.allFullFather;
771
+ _this2$props5$colNum = _this2$props5.colNum,
772
+ colNum = _this2$props5$colNum === void 0 ? defaultColNum : _this2$props5$colNum,
773
+ allFullFather = _this2$props5.allFullFather;
774
+
635
775
  if (allFullFather) {
636
776
  colNum = 1;
637
777
  }
778
+
638
779
  var span = 24 / colNum;
639
780
  return (0, _map["default"])(_context25 = _this2.getControls()).call(_context25, function (control) {
640
781
  if (allFullFather) {
641
782
  control.allFullFather = allFullFather;
642
783
  }
784
+
643
785
  return _this2.toCol(span, control);
644
786
  });
645
787
  });
646
788
  return _this2;
647
789
  }
790
+
648
791
  (0, _createClass2["default"])(SuperForm2, [{
649
792
  key: "render",
650
793
  value: function render() {
651
794
  this.initValidState();
652
795
  var _this$props$layout = this.props.layout,
653
- layout = _this$props$layout === void 0 ? 'horizontal' : _this$props$layout;
796
+ layout = _this$props$layout === void 0 ? 'horizontal' : _this$props$layout;
654
797
  return /*#__PURE__*/_react["default"].createElement("div", {
655
798
  className: (0, _variables["default"])('SuperForm2')
656
799
  }, /*#__PURE__*/_react["default"].createElement(_form["default"], {
@@ -665,6 +808,7 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
665
808
  }]);
666
809
  return SuperForm2;
667
810
  }(_react["default"].Component);
811
+
668
812
  (0, _defineProperty2["default"])(SuperForm2, "propTypes", {
669
813
  controls: _propTypes["default"].arrayOf(_propTypes["default"].shape(ControlType)).isRequired,
670
814
  value: _propTypes["default"].object,