cloud-b2b 1.1.58 → 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 -141
  68. package/es/Card/Card.js +0 -19
  69. package/es/CodeInput/CodeInput.js +0 -123
  70. package/es/Control/Control.js +0 -444
  71. package/es/Control/event.js +0 -43
  72. package/es/Enhance/Dialogs.js +0 -52
  73. package/es/Enhance/Loading.js +0 -131
  74. package/es/Header/Header.js +0 -162
  75. package/es/Header/Vertical.js +0 -106
  76. package/es/ImageView/ImageView.js +0 -100
  77. package/es/Indent/Indent.js +0 -19
  78. package/es/InpurCascader/InputCascader.js +0 -117
  79. package/es/InputEditor/InputEditor.js +0 -173
  80. package/es/InputSearch/InputSearch.js +0 -266
  81. package/es/InputSelect/InputSelect.js +0 -160
  82. package/es/InputTreeSelect/InputTreeSelect.js +0 -121
  83. package/es/InputWriting/InputWriting.js +0 -85
  84. package/es/Layout/Layout.js +0 -201
  85. package/es/LayoutLink/LayoutLink.js +0 -73
  86. package/es/Link/Link.js +0 -85
  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 -200
  91. package/es/Search/Search.js +0 -497
  92. package/es/Sidebar/Sidebar.js +0 -144
  93. package/es/Sidebar2/Sidebar.js +0 -165
  94. package/es/SuperForm/SuperForm.js +0 -598
  95. package/es/SuperForm2/SuperForm.js +0 -687
  96. package/es/SuperIcon/SuperIcon.js +0 -27
  97. package/es/SuperPagination/SuperPagination.js +0 -109
  98. package/es/SuperTab/SuperTab.js +0 -107
  99. package/es/SuperTab2/SuperTab2.js +0 -145
  100. package/es/SuperTable/DragSortRow.js +0 -97
  101. package/es/SuperTable/FilterDropDown.js +0 -164
  102. package/es/SuperTable/SuperTable.js +0 -808
  103. package/es/SuperTable/fixed.js +0 -34
  104. package/es/SuperTable2/SuperTable2.js +0 -926
  105. package/es/SuperTable2/SuperTableCell.js +0 -225
  106. package/es/SuperTable3/FilterDropDown.js +0 -164
  107. package/es/SuperTable3/SuperTable.js +0 -665
  108. package/es/SuperTable3/fixed.js +0 -34
  109. package/es/SuperToolbar/SuperToolbar.js +0 -195
  110. package/es/SuperUpload/SuperUpload.js +0 -356
  111. package/es/Title/Title.js +0 -33
  112. package/es/Viewer/ImageViews.js +0 -258
  113. package/es/Viewer/Viewer.js +0 -122
  114. package/es/WingBlank/WingBlank.js +0 -16
  115. package/es/helper.js +0 -240
  116. package/es/index.js +0 -37
  117. package/es/variables.js +0 -6
  118. package/lib/Area/Area.js +0 -149
  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 -131
  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 -60
  128. package/lib/Enhance/Loading.js +0 -138
  129. package/lib/Enhance/index.js +0 -25
  130. package/lib/Enhance/package.json +0 -6
  131. package/lib/Header/Header.js +0 -169
  132. package/lib/Header/Header.less +0 -95
  133. package/lib/Header/Vertical.js +0 -114
  134. package/lib/Header/Vertical.less +0 -60
  135. package/lib/Header/package.json +0 -6
  136. package/lib/ImageView/ImageView.js +0 -108
  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 -124
  142. package/lib/InpurCascader/package.json +0 -6
  143. package/lib/InputEditor/InputEditor.js +0 -181
  144. package/lib/InputEditor/inputEditor.less +0 -8
  145. package/lib/InputEditor/package.json +0 -6
  146. package/lib/InputSearch/InputSearch.js +0 -274
  147. package/lib/InputSearch/package.json +0 -6
  148. package/lib/InputSelect/InputSelect.js +0 -168
  149. package/lib/InputSelect/package.json +0 -6
  150. package/lib/InputTreeSelect/InputTreeSelect.js +0 -128
  151. package/lib/InputTreeSelect/package.json +0 -6
  152. package/lib/InputWriting/InputWriting.js +0 -93
  153. package/lib/InputWriting/package.json +0 -6
  154. package/lib/Layout/Layout.js +0 -209
  155. package/lib/Layout/Layout.less +0 -28
  156. package/lib/Layout/package.json +0 -6
  157. package/lib/LayoutLink/LayoutLink.js +0 -86
  158. package/lib/LayoutLink/LayoutLink.less +0 -53
  159. package/lib/LayoutLink/package.json +0 -6
  160. package/lib/Link/Link.js +0 -93
  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 -208
  173. package/lib/NumberInput/package.json +0 -6
  174. package/lib/Search/Search.js +0 -510
  175. package/lib/Sidebar/Sidebar.js +0 -152
  176. package/lib/Sidebar/Sidebar.less +0 -78
  177. package/lib/Sidebar/package.json +0 -6
  178. package/lib/Sidebar2/Sidebar.js +0 -173
  179. package/lib/Sidebar2/Sidebar.less +0 -153
  180. package/lib/Sidebar2/package.json +0 -6
  181. package/lib/SuperForm/SuperForm.js +0 -610
  182. package/lib/SuperForm/SuperForm.less +0 -52
  183. package/lib/SuperForm/package.json +0 -6
  184. package/lib/SuperForm2/SuperForm.js +0 -699
  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 -117
  190. package/lib/SuperPagination/package.json +0 -6
  191. package/lib/SuperTab/SuperTab.js +0 -115
  192. package/lib/SuperTab/SuperTab.less +0 -43
  193. package/lib/SuperTab/package.json +0 -6
  194. package/lib/SuperTab2/SuperTab2.js +0 -153
  195. package/lib/SuperTab2/SuperTab2.less +0 -18
  196. package/lib/SuperTab2/package.json +0 -6
  197. package/lib/SuperTable/DragSortRow.js +0 -105
  198. package/lib/SuperTable/DragSortRow.less +0 -17
  199. package/lib/SuperTable/FilterDropDown.js +0 -172
  200. package/lib/SuperTable/FilterDropDown.less +0 -30
  201. package/lib/SuperTable/SuperTable.js +0 -816
  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 -939
  206. package/lib/SuperTable2/SuperTable2.less +0 -118
  207. package/lib/SuperTable2/SuperTableCell.js +0 -230
  208. package/lib/SuperTable2/package.json +0 -6
  209. package/lib/SuperTable3/FilterDropDown.js +0 -172
  210. package/lib/SuperTable3/FilterDropDown.less +0 -29
  211. package/lib/SuperTable3/SuperTable.js +0 -673
  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 -203
  216. package/lib/SuperToolbar/SuperToolbar.less +0 -17
  217. package/lib/SuperToolbar/package.json +0 -6
  218. package/lib/SuperUpload/SuperUpload.js +0 -368
  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 -266
  225. package/lib/Viewer/Viewer.js +0 -130
  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 -246
  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,610 +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 _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), "onFileChange", function (_ref, file) {
163
- var key = _ref.key;
164
- var onFileChange = _this2.props.onFileChange;
165
- onFileChange && onFileChange(key, file);
166
- });
167
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "onExitValid", function (key, value) {
168
- if (key === _this2.validKey) {
169
- _this2.validKey = '';
170
- _this2.props.onExitValid();
171
- }
172
- _this2.props.onChangeOperate && _this2.props.onChangeOperate(key, value);
173
- });
174
- // 动态生成getValidState方法
175
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "initValidState", function () {
176
- var _this2$props = _this2.props,
177
- value = _this2$props.value,
178
- valid = _this2$props.valid;
179
- var invalid = function invalid() {
180
- return null;
181
- };
182
- var _valid = function _valid(_ref2) {
183
- var key = _ref2.key,
184
- required = _ref2.required;
185
- if (required) {
186
- if (!value || _helper["default"].isEmpty2(value[key]) || !(0, _isArray["default"])(value[key]) && (0, _typeof2["default"])(value[key]) === 'object' && _helper["default"].isEmpty(value[key].value)) {
187
- _this2.getValidState = invalid;
188
- _this2.validKey = key;
189
- return 'error';
190
- }
191
- }
192
- return null;
193
- };
194
- _this2.getValidState = valid ? _valid : invalid;
195
- });
196
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "validDate", function (_ref3) {
197
- var key = _ref3.key,
198
- type = _ref3.type;
199
- return function (date) {
200
- var _this2$props$value = _this2.props.value,
201
- value = _this2$props$value === void 0 ? {} : _this2$props$value;
202
- if (!date || !value[key]) {
203
- return false;
204
- } else {
205
- if (type === '>') {
206
- return date.format('YYYY-MM-DD') <= value[key];
207
- } else if (type === '<') {
208
- return date.format('YYYY-MM-DD') >= value[key];
209
- } else {
210
- return false;
211
- }
212
- }
213
- };
214
- });
215
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "getPopupContainer", function () {
216
- var container = _this2.props.container;
217
- if (typeof container === 'undefined') {
218
- return _reactDom["default"].findDOMNode((0, _assertThisInitialized2["default"])(_this2));
219
- } else if (typeof container === 'boolean') {
220
- return document.body;
221
- } else {
222
- return _reactDom["default"].findDOMNode(container);
223
- }
224
- });
225
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "getMaxWidth", function () {
226
- var _this2$props$colNum = _this2.props.colNum,
227
- colNum = _this2$props$colNum === void 0 ? defaultColNum : _this2$props$colNum;
228
- return colNum * 250;
229
- });
230
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "getContainer", function () {
231
- return _this2.props.getContainer;
232
- });
233
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "getControls", function () {
234
- var _this2$props2 = _this2.props,
235
- hideControls = _this2$props2.hideControls,
236
- controls = _this2$props2.controls;
237
- if (!hideControls) {
238
- return controls;
239
- } else {
240
- return (0, _filter["default"])(controls).call(controls, function (control) {
241
- return !(0, _some["default"])(hideControls).call(hideControls, function (key) {
242
- return control.key === key;
243
- });
244
- });
245
- }
246
- });
247
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "getType", function (_ref4) {
248
- var _context2;
249
- var key = _ref4.key,
250
- type = _ref4.type;
251
- var readonly = _this2.props.readonly;
252
- if ((0, _includes["default"])(_context2 = ['area', 'uploadImg']).call(_context2, type)) {
253
- return type;
254
- } else if (!readonly) {
255
- return type;
256
- } else if (readonly === true) {
257
- return 'readonly';
258
- } else if ((0, _isArray["default"])(readonly) && (0, _some["default"])(readonly).call(readonly, function (readonlyKey) {
259
- return readonlyKey === key;
260
- })) {
261
- return 'readonly';
262
- } else {
263
- return type;
264
- }
265
- });
266
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "specialProps", function (type, _ref5) {
267
- var key = _ref5.key,
268
- _ref5$props = _ref5.props,
269
- props = _ref5$props === void 0 ? {} : _ref5$props,
270
- originType = _ref5.type;
271
- if (type === 'readonly') {
272
- var _this2$props$highLigh = _this2.props.highLightKeys,
273
- highLightKeys = _this2$props$highLigh === void 0 ? [] : _this2$props$highLigh;
274
- var style = (0, _includes["default"])(highLightKeys).call(highLightKeys, key) ? {
275
- backgroundColor: 'red',
276
- color: 'white'
277
- } : {
278
- backgroundColor: '#f0f0f0'
279
- };
280
- if (originType === 'textArea') {
281
- var _context3;
282
- return {
283
- type: 'textArea',
284
- readonly: true,
285
- style: style,
286
- onBlur: (0, _bind["default"])(_context3 = _this2.onExitValid).call(_context3, (0, _assertThisInitialized2["default"])(_this2), key)
287
- };
288
- } else {
289
- var _context4;
290
- return {
291
- style: style,
292
- onBlur: (0, _bind["default"])(_context4 = _this2.onExitValid).call(_context4, (0, _assertThisInitialized2["default"])(_this2), key)
293
- };
294
- }
295
- } else if (type === 'text' || type === 'textArea') {
296
- var _context5, _context6;
297
- return _objectSpread(_objectSpread({}, props), {}, {
298
- onChange: (0, _bind["default"])(_context5 = _this2.onExitValid).call(_context5, (0, _assertThisInitialized2["default"])(_this2), key),
299
- onBlur: (0, _bind["default"])(_context6 = _this2.onChange).call(_context6, (0, _assertThisInitialized2["default"])(_this2), key)
300
- });
301
- } else if (type === 'date') {
302
- var _context7, _context8;
303
- var propsObj = _objectSpread(_objectSpread({}, props), {}, {
304
- onChange: (0, _bind["default"])(_context7 = _this2.onBlur).call(_context7, (0, _assertThisInitialized2["default"])(_this2), key),
305
- onBlur: (0, _bind["default"])(_context8 = _this2.onExitValid).call(_context8, (0, _assertThisInitialized2["default"])(_this2), key)
306
- });
307
- if (_this2.props.onOpenChange && typeof _this2.props.onOpenChange === 'function') {
308
- var _context9;
309
- propsObj.onOpenChange = (0, _bind["default"])(_context9 = _this2.props.onOpenChange).call(_context9, (0, _assertThisInitialized2["default"])(_this2), key);
310
- }
311
- return propsObj;
312
- } else if (type === 'area') {
313
- var _context10, _context11;
314
- return _objectSpread(_objectSpread({}, props), {}, {
315
- onChange: (0, _bind["default"])(_context10 = _this2.onBlur).call(_context10, (0, _assertThisInitialized2["default"])(_this2), key),
316
- onBlur: (0, _bind["default"])(_context11 = _this2.onExitValid).call(_context11, (0, _assertThisInitialized2["default"])(_this2), key),
317
- onAreaSearch: _this2.props.onAreaSearch
318
- });
319
- } else {
320
- var _context12, _context13;
321
- return _objectSpread(_objectSpread({}, props), {}, {
322
- onChange: (0, _bind["default"])(_context12 = _this2.onBlur).call(_context12, (0, _assertThisInitialized2["default"])(_this2), key),
323
- onBlur: (0, _bind["default"])(_context13 = _this2.onExitValid).call(_context13, (0, _assertThisInitialized2["default"])(_this2), key)
324
- });
325
- }
326
- });
327
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "getControlProps", function (control, status) {
328
- var _this2$props$value2 = _this2.props.value,
329
- value = _this2$props$value2 === void 0 ? {} : _this2$props$value2;
330
- var type = _this2.getType(control);
331
- var props = _this2.specialProps(type, control);
332
- return _objectSpread(_objectSpread({
333
- autoFocus: !!status,
334
- type: type
335
- }, props), {}, {
336
- size: defaultSize,
337
- value: (0, _Control.makeString)(value[control.key])
338
- });
339
- });
340
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "getOptions", function (key, options) {
341
- var higher = _this2.props.options || {};
342
- return higher[key] || options;
343
- });
344
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "toEmpty", function (props) {});
345
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "toText", function (props) {
346
- return /*#__PURE__*/_react["default"].createElement(Controlled, props);
347
- });
348
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "toPassword", function (props) {
349
- return /*#__PURE__*/_react["default"].createElement(Controlled, props);
350
- });
351
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "toEditor", function (props, control) {
352
- props.inputKey = control.key;
353
- return /*#__PURE__*/_react["default"].createElement(Controlled, props);
354
- });
355
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "toSelectWriting", function (props, control) {
356
- return /*#__PURE__*/_react["default"].createElement(Controlled, props);
357
- });
358
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "toTextArea", function (props, control) {
359
- if (control.allFullFather) {
360
- props.rows = control.rows;
361
- props.maxLength = control.maxLength;
362
- props.style = {
363
- 'resize': 'none'
364
- };
365
- } else {
366
- props.autoSize = {
367
- minRows: 1,
368
- maxRows: 5
369
- };
370
- }
371
- return /*#__PURE__*/_react["default"].createElement(Controlled, props);
372
- });
373
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "toNumber", function (props) {
374
- props.defaultValue = props.value;
375
- delete props.value;
376
- return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
377
- });
378
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "toSelect", function (props, _ref6) {
379
- var options = _ref6.options,
380
- key = _ref6.key;
381
- props.getPopupContainer = _this2.getPopupContainer;
382
- props.options = _this2.getOptions(key, options);
383
- props.dropdownMatchSelectWidth = false;
384
- return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
385
- });
386
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "createSearchEvent", function (control) {
387
- if (_this2.props.onSearch) {
388
- return function (value) {
389
- return _this2.props.onSearch(control.key, value, control);
390
- };
391
- } else {
392
- return null;
393
- }
394
- });
395
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "toSearch", function (props, control) {
396
- props.getPopupContainer = _this2.getPopupContainer;
397
- props.options = _this2.getOptions(control.key, control.options);
398
- props.onSearch = _this2.createSearchEvent(control);
399
- props.dropdownMatchSelectWidth = false;
400
- return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
401
- });
402
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "toDate", function (props, _ref7) {
403
- var rule = _ref7.rule;
404
- props.getCalendarContainer = _this2.getPopupContainer;
405
- props.style = {
406
- width: '100%'
407
- };
408
- rule && (props.disabledDate = _this2.validDate(rule));
409
- return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
410
- });
411
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "toRadioGroup", function (props, _ref8) {
412
- var key = _ref8.key,
413
- options = _ref8.options;
414
- props.options = _this2.getOptions(key, options);
415
- return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
416
- });
417
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "toReadonly", function (props, _ref9) {
418
- var options = _ref9.options,
419
- key = _ref9.key;
420
- props.value = (0, _Control.getTitle)(props.value, _this2.getOptions(key, options));
421
- return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
422
- });
423
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "selectSearch", function (props, control) {
424
- props.getPopupContainer = _this2.getPopupContainer;
425
- props.options = _this2.getOptions(control.key, control.options);
426
- props.onSearch = _this2.createSearchEvent(control);
427
- props.dropdownMatchSelectWidth = false;
428
- return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
429
- });
430
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "area", function (props, _ref10) {
431
- var key = _ref10.key,
432
- options = _ref10.options;
433
- var readonly = _this2.props.readonly;
434
- props.parentKey = key;
435
- props.options = _this2.getOptions(key, options);
436
- props.dropdownMatchSelectWidth = false;
437
- props.readonly = readonly === true || (0, _isArray["default"])(readonly) && (0, _some["default"])(readonly).call(readonly, function (readonlyKey) {
438
- return readonlyKey === key;
439
- }) ? true : false;
440
- return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
441
- });
442
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "uploadImg", function (props, control) {
443
- var _context14;
444
- var readonly = _this2.props.readonly;
445
- props.required = control.required || false;
446
- props.onFileChange = (0, _bind["default"])(_context14 = _this2.onFileChange).call(_context14, (0, _assertThisInitialized2["default"])(_this2), control);
447
- props.readonly = readonly === true || (0, _isArray["default"])(readonly) && (0, _some["default"])(readonly).call(readonly, function (readonlyKey) {
448
- return readonlyKey === control.key;
449
- }) ? true : false;
450
- return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
451
- });
452
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "toCascader", function (props, control) {
453
- var container = _this2.getContainer();
454
- container && (props.getPopupContainer = container);
455
- props.options = control.options || [];
456
- props.onSearch = _this2.createSearchEvent(control);
457
- props.placeholder = props.placeholder || '';
458
- props.loadData = _this2.createSearchEvent(control);
459
- return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
460
- });
461
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "toTreeSelect", function (props, filter) {
462
- var container = _this2.getContainer();
463
- container && (props.getPopupContainer = container);
464
- props.options = _this2.getOptions(filter);
465
- props.onSearch = _this2.createSearchEvent(filter);
466
- props.placeholder = filter.placeholder || '';
467
- return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
468
- });
469
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "toControl", function (props, control) {
470
- switch (props.type) {
471
- case 'readonly':
472
- return _this2.toReadonly(props, control);
473
- case 'text':
474
- return _this2.toText(props, control);
475
- case 'number':
476
- return _this2.toNumber(props, control);
477
- case 'select':
478
- case 'selectText':
479
- return _this2.toSelect(props, control);
480
- case 'search':
481
- case 'searchText':
482
- return _this2.toSearch(props, control);
483
- case 'date':
484
- return _this2.toDate(props, control);
485
- case 'radioGroup':
486
- return _this2.toRadioGroup(props, control);
487
- case 'textArea':
488
- return _this2.toTextArea(props, control);
489
- case 'password':
490
- return _this2.toPassword(props, control);
491
- case 'editor':
492
- return _this2.toEditor(props, control);
493
- case 'selectWriting':
494
- return _this2.toSelectWriting(props, control);
495
- case 'selectSearch':
496
- return _this2.selectSearch(props, control);
497
- case 'empty':
498
- return _this2.toEmpty(props, control);
499
- case 'area':
500
- return _this2.area(props, control);
501
- case 'uploadImg':
502
- return _this2.uploadImg(props, control);
503
- case 'cascader':
504
- return _this2.toCascader(props, control);
505
- case 'treeSelect':
506
- return _this2.toTreeSelect(props, control);
507
- default:
508
- return 'type error';
509
- }
510
- });
511
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "toLabel", function (_ref11, type) {
512
- var title = _ref11.title,
513
- showAdd = _ref11.showAdd,
514
- key = _ref11.key;
515
- if (showAdd && type !== 'readonly') {
516
- var _context15;
517
- var onClick = (0, _bind["default"])(_context15 = _this2.onAdd).call(_context15, (0, _assertThisInitialized2["default"])(_this2), key, title);
518
- return /*#__PURE__*/_react["default"].createElement("span", null, title, /*#__PURE__*/_react["default"].createElement(_icon["default"], {
519
- role: "add",
520
- type: "plus-circle-o",
521
- onClick: onClick
522
- }));
523
- } else {
524
- return title;
525
- }
526
- });
527
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "toCol", function (span, control) {
528
- var factor = control.span || 1;
529
- var status = _this2.getValidState(control);
530
- var controlProps = _this2.getControlProps(control, status);
531
- var itemProps = {
532
- label: _this2.toLabel(control, controlProps.type),
533
- required: control.required,
534
- validateStatus: status
535
- };
536
- var _this2$props3 = _this2.props,
537
- checkable = _this2$props3.checkable,
538
- onCheckItem = _this2$props3.onCheckItem;
539
- return control.type !== 'empty' ? /*#__PURE__*/_react["default"].createElement(_col["default"], {
540
- span: span * factor,
541
- key: control.key
542
- }, checkable && /*#__PURE__*/_react["default"].createElement(_checkbox["default"], {
543
- className: (0, _variables["default"])('SuperForm').checkbox,
544
- onChange: (0, _bind["default"])(onCheckItem).call(onCheckItem, (0, _assertThisInitialized2["default"])(_this2), control),
545
- checked: control.checked
546
- }), /*#__PURE__*/_react["default"].createElement(FormItem, (0, _extends2["default"])({}, itemProps, {
547
- className: checkable ? (0, _variables["default"])('SuperForm').formItemWithCheckbox : ''
548
- }), _this2.toControl(controlProps, control))) : /*#__PURE__*/_react["default"].createElement(_col["default"], {
549
- span: span * factor,
550
- key: control.key,
551
- style: {
552
- height: '44px'
553
- }
554
- });
555
- });
556
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "toCols", function () {
557
- var _context16;
558
- var _this2$props4 = _this2.props,
559
- _this2$props4$colNum = _this2$props4.colNum,
560
- colNum = _this2$props4$colNum === void 0 ? defaultColNum : _this2$props4$colNum,
561
- allFullFather = _this2$props4.allFullFather;
562
- if (allFullFather) {
563
- colNum = 1;
564
- }
565
- var span = 24 / colNum;
566
- return (0, _map["default"])(_context16 = _this2.getControls()).call(_context16, function (control) {
567
- if (allFullFather) {
568
- control.allFullFather = allFullFather;
569
- }
570
- return _this2.toCol(span, control);
571
- });
572
- });
573
- return _this2;
574
- }
575
- (0, _createClass2["default"])(SuperForm, [{
576
- key: "render",
577
- value: function render() {
578
- this.initValidState();
579
- return /*#__PURE__*/_react["default"].createElement("div", {
580
- className: (0, _variables["default"])('SuperForm')
581
- }, /*#__PURE__*/_react["default"].createElement(_form["default"], {
582
- layout: "vertical",
583
- style: {
584
- maxWidth: this.props.allFullFather ? '100%' : this.getMaxWidth()
585
- }
586
- }, /*#__PURE__*/_react["default"].createElement(_row["default"], {
587
- gutter: 20
588
- }, this.toCols())));
589
- }
590
- }]);
591
- return SuperForm;
592
- }(_react["default"].Component);
593
- (0, _defineProperty2["default"])(SuperForm, "propTypes", {
594
- controls: _propTypes["default"].arrayOf(_propTypes["default"].shape(ControlType)).isRequired,
595
- value: _propTypes["default"].object,
596
- colNum: _propTypes["default"].number,
597
- valid: _propTypes["default"].bool,
598
- readonly: _propTypes["default"].oneOfType([_propTypes["default"].bool, _propTypes["default"].array]),
599
- hideControls: _propTypes["default"].array,
600
- options: _propTypes["default"].object,
601
- onChange: _propTypes["default"].func,
602
- onSearch: _propTypes["default"].func,
603
- onExitValid: _propTypes["default"].func,
604
- onAdd: _propTypes["default"].func,
605
- checkable: _propTypes["default"].bool,
606
- onOpenChange: _propTypes["default"].func,
607
- onAreaSearch: _propTypes["default"].func,
608
- OnFileChange: _propTypes["default"].func
609
- });
610
- var _default = exports["default"] = SuperForm;
@@ -1,52 +0,0 @@
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
- }
@@ -1,6 +0,0 @@
1
- {
2
- "name": "SuperForm",
3
- "version": "0.0.0",
4
- "private": true,
5
- "main": "./SuperForm.js"
6
- }