cloud-b2b 1.1.59 → 1.1.61

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