cloud-b2b 1.1.57 → 1.1.59

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