cloud-b2b 1.1.50 → 1.1.51

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