cloud-b2b 1.1.52 → 1.1.53

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