cloud-b2b 1.1.59 → 1.1.60

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (314) hide show
  1. package/es/Area/Area.js +141 -0
  2. package/es/Card/Card.js +19 -0
  3. package/es/CodeInput/CodeInput.js +123 -0
  4. package/es/Control/Control.js +444 -0
  5. package/es/Control/event.js +43 -0
  6. package/es/Enhance/Dialogs.js +52 -0
  7. package/es/Enhance/Loading.js +131 -0
  8. package/{src → es}/Enhance/index.js +6 -8
  9. package/es/Header/Header.js +162 -0
  10. package/es/Header/Vertical.js +106 -0
  11. package/es/ImageView/ImageView.js +100 -0
  12. package/es/Indent/Indent.js +19 -0
  13. package/es/InpurCascader/InputCascader.js +117 -0
  14. package/es/InputEditor/InputEditor.js +173 -0
  15. package/es/InputSearch/InputSearch.js +266 -0
  16. package/es/InputSelect/InputSelect.js +160 -0
  17. package/es/InputTreeSelect/InputTreeSelect.js +121 -0
  18. package/es/InputWriting/InputWriting.js +85 -0
  19. package/es/Layout/Layout.js +201 -0
  20. package/es/LayoutLink/LayoutLink.js +73 -0
  21. package/es/Link/Link.js +85 -0
  22. package/es/Loading/Loading.js +13 -0
  23. package/es/Loading2/Loading2.js +9 -0
  24. package/es/ModalWithDrag/ModalWithDrag.js +29 -0
  25. package/{src → es}/ModalWithDrag/drag.js +116 -128
  26. package/es/NumberInput/NumberInput.js +200 -0
  27. package/es/Search/Search.js +497 -0
  28. package/es/Search2/Search.js +597 -0
  29. package/es/Sidebar/Sidebar.js +144 -0
  30. package/es/Sidebar2/Sidebar.js +165 -0
  31. package/es/SuperForm/SuperForm.js +598 -0
  32. package/es/SuperForm2/SuperForm.js +687 -0
  33. package/es/SuperIcon/SuperIcon.js +27 -0
  34. package/es/SuperPagination/SuperPagination.js +109 -0
  35. package/es/SuperTab/SuperTab.js +107 -0
  36. package/es/SuperTab2/SuperTab2.js +145 -0
  37. package/es/SuperTable/DragSortRow.js +97 -0
  38. package/es/SuperTable/FilterDropDown.js +164 -0
  39. package/es/SuperTable/SuperTable.js +808 -0
  40. package/es/SuperTable/fixed.js +34 -0
  41. package/es/SuperTable2/SuperTable2.js +926 -0
  42. package/es/SuperTable2/SuperTableCell.js +234 -0
  43. package/es/SuperTable3/FilterDropDown.js +164 -0
  44. package/es/SuperTable3/SuperTable.js +665 -0
  45. package/es/SuperTable3/fixed.js +34 -0
  46. package/es/SuperToolbar/SuperToolbar.js +195 -0
  47. package/es/SuperUpload/SuperUpload.js +356 -0
  48. package/es/Title/Title.js +33 -0
  49. package/es/Viewer/ImageViews.js +258 -0
  50. package/es/Viewer/Viewer.js +122 -0
  51. package/es/WingBlank/WingBlank.js +16 -0
  52. package/es/helper.js +240 -0
  53. package/{src → es}/history.js +6 -6
  54. package/es/index.js +38 -0
  55. package/es/variables.js +6 -0
  56. package/lib/Area/Area.js +149 -0
  57. package/lib/Area/package.json +6 -0
  58. package/lib/Card/Card.js +27 -0
  59. package/lib/Card/package.json +6 -0
  60. package/lib/CodeInput/CodeInput.js +131 -0
  61. package/lib/CodeInput/package.json +6 -0
  62. package/lib/Control/Control.js +450 -0
  63. package/lib/Control/event.js +51 -0
  64. package/lib/Control/package.json +6 -0
  65. package/lib/Enhance/Dialogs.js +60 -0
  66. package/lib/Enhance/Loading.js +138 -0
  67. package/lib/Enhance/index.js +25 -0
  68. package/lib/Enhance/package.json +6 -0
  69. package/lib/Header/Header.js +169 -0
  70. package/lib/Header/Header.less +95 -0
  71. package/lib/Header/Vertical.js +114 -0
  72. package/lib/Header/Vertical.less +60 -0
  73. package/lib/Header/package.json +6 -0
  74. package/lib/ImageView/ImageView.js +108 -0
  75. package/lib/ImageView/ImageView.less +14 -0
  76. package/lib/ImageView/package.json +6 -0
  77. package/lib/Indent/Indent.js +27 -0
  78. package/lib/Indent/package.json +6 -0
  79. package/lib/InpurCascader/InputCascader.js +124 -0
  80. package/lib/InpurCascader/package.json +6 -0
  81. package/lib/InputEditor/InputEditor.js +181 -0
  82. package/lib/InputEditor/inputEditor.less +8 -0
  83. package/lib/InputEditor/package.json +6 -0
  84. package/lib/InputSearch/InputSearch.js +274 -0
  85. package/lib/InputSearch/package.json +6 -0
  86. package/lib/InputSelect/InputSelect.js +168 -0
  87. package/lib/InputSelect/package.json +6 -0
  88. package/lib/InputTreeSelect/InputTreeSelect.js +128 -0
  89. package/lib/InputTreeSelect/package.json +6 -0
  90. package/lib/InputWriting/InputWriting.js +93 -0
  91. package/lib/InputWriting/package.json +6 -0
  92. package/lib/Layout/Layout.js +209 -0
  93. package/lib/Layout/Layout.less +28 -0
  94. package/lib/Layout/package.json +6 -0
  95. package/lib/LayoutLink/LayoutLink.js +86 -0
  96. package/lib/LayoutLink/LayoutLink.less +53 -0
  97. package/lib/LayoutLink/package.json +6 -0
  98. package/lib/Link/Link.js +93 -0
  99. package/lib/Link/package.json +6 -0
  100. package/lib/Loading/Loading.js +21 -0
  101. package/lib/Loading/Loading.less +13 -0
  102. package/lib/Loading/package.json +6 -0
  103. package/lib/Loading2/Loading2.js +17 -0
  104. package/lib/Loading2/Loading2.less +19 -0
  105. package/lib/Loading2/package.json +6 -0
  106. package/lib/ModalWithDrag/ModalWithDrag.js +37 -0
  107. package/lib/ModalWithDrag/ModalWithDrag.less +6 -0
  108. package/lib/ModalWithDrag/drag.js +124 -0
  109. package/lib/ModalWithDrag/package.json +6 -0
  110. package/lib/NumberInput/NumberInput.js +208 -0
  111. package/lib/NumberInput/package.json +6 -0
  112. package/lib/Search/Search.js +510 -0
  113. package/lib/Search/Search.less +63 -0
  114. package/lib/Search/package.json +6 -0
  115. package/lib/Search2/Search.js +609 -0
  116. package/lib/Search2/Search.less +65 -0
  117. package/lib/Search2/package.json +6 -0
  118. package/lib/Sidebar/Sidebar.js +152 -0
  119. package/lib/Sidebar/Sidebar.less +78 -0
  120. package/lib/Sidebar/package.json +6 -0
  121. package/lib/Sidebar2/Sidebar.js +173 -0
  122. package/lib/Sidebar2/Sidebar.less +153 -0
  123. package/lib/Sidebar2/package.json +6 -0
  124. package/lib/SuperForm/SuperForm.js +610 -0
  125. package/lib/SuperForm/SuperForm.less +52 -0
  126. package/lib/SuperForm/package.json +6 -0
  127. package/lib/SuperForm2/SuperForm.js +699 -0
  128. package/lib/SuperForm2/SuperForm.less +52 -0
  129. package/lib/SuperForm2/package.json +6 -0
  130. package/lib/SuperIcon/SuperIcon.js +35 -0
  131. package/lib/SuperIcon/package.json +6 -0
  132. package/lib/SuperPagination/SuperPagination.js +117 -0
  133. package/lib/SuperPagination/package.json +6 -0
  134. package/lib/SuperTab/SuperTab.js +115 -0
  135. package/lib/SuperTab/SuperTab.less +43 -0
  136. package/lib/SuperTab/package.json +6 -0
  137. package/lib/SuperTab2/SuperTab2.js +153 -0
  138. package/lib/SuperTab2/SuperTab2.less +18 -0
  139. package/lib/SuperTab2/package.json +6 -0
  140. package/lib/SuperTable/DragSortRow.js +105 -0
  141. package/lib/SuperTable/DragSortRow.less +17 -0
  142. package/lib/SuperTable/FilterDropDown.js +172 -0
  143. package/lib/SuperTable/FilterDropDown.less +30 -0
  144. package/lib/SuperTable/SuperTable.js +816 -0
  145. package/lib/SuperTable/SuperTable.less +132 -0
  146. package/lib/SuperTable/fixed.js +42 -0
  147. package/lib/SuperTable/package.json +6 -0
  148. package/lib/SuperTable2/SuperTable2.js +939 -0
  149. package/lib/SuperTable2/SuperTable2.less +118 -0
  150. package/lib/SuperTable2/SuperTableCell.js +239 -0
  151. package/lib/SuperTable2/package.json +6 -0
  152. package/lib/SuperTable3/FilterDropDown.js +172 -0
  153. package/lib/SuperTable3/FilterDropDown.less +29 -0
  154. package/lib/SuperTable3/SuperTable.js +673 -0
  155. package/lib/SuperTable3/SuperTable.less +99 -0
  156. package/lib/SuperTable3/fixed.js +42 -0
  157. package/lib/SuperTable3/package.json +6 -0
  158. package/lib/SuperToolbar/SuperToolbar.js +203 -0
  159. package/lib/SuperToolbar/SuperToolbar.less +17 -0
  160. package/lib/SuperToolbar/package.json +6 -0
  161. package/lib/SuperUpload/SuperUpload.js +368 -0
  162. package/lib/SuperUpload/SuperUpload.less +28 -0
  163. package/lib/SuperUpload/package.json +6 -0
  164. package/lib/Title/Title.js +41 -0
  165. package/lib/Title/Title.less +35 -0
  166. package/lib/Title/package.json +6 -0
  167. package/lib/Viewer/ImageViews.js +266 -0
  168. package/lib/Viewer/Viewer.js +130 -0
  169. package/lib/Viewer/Viewer.less +67 -0
  170. package/lib/Viewer/imgView.less +59 -0
  171. package/lib/Viewer/package.json +7 -0
  172. package/lib/WingBlank/WingBlank.js +24 -0
  173. package/lib/WingBlank/WingBlank.less +12 -0
  174. package/lib/WingBlank/package.json +6 -0
  175. package/lib/adjust.less +89 -0
  176. package/lib/helper.js +246 -0
  177. package/lib/history.js +12 -0
  178. package/lib/index.js +278 -0
  179. package/lib/index.less +32 -0
  180. package/lib/style.less +30 -0
  181. package/lib/variables.js +14 -0
  182. package/lib/variables.less +73 -0
  183. package/package.json +22 -44
  184. package/src/Area/Area.js +0 -94
  185. package/src/Card/Card.js +0 -16
  186. package/src/CodeInput/CodeInput.js +0 -76
  187. package/src/Control/Control.js +0 -338
  188. package/src/Control/event.js +0 -45
  189. package/src/Enhance/Dialogs.js +0 -24
  190. package/src/Enhance/Loading.js +0 -83
  191. package/src/Header/Header.js +0 -149
  192. package/src/Header/Vertical.js +0 -74
  193. package/src/ImageView/ImageView.js +0 -62
  194. package/src/Indent/Indent.js +0 -12
  195. package/src/InpurCascader/InputCascader.js +0 -83
  196. package/src/InputEditor/InputEditor.js +0 -93
  197. package/src/InputSearch/InputSearch.js +0 -186
  198. package/src/InputSelect/InputSelect.js +0 -103
  199. package/src/InputTreeSelect/InputTreeSelect.js +0 -87
  200. package/src/InputWriting/InputWriting.js +0 -65
  201. package/src/Layout/Layout.js +0 -121
  202. package/src/LayoutLink/LayoutLink.js +0 -59
  203. package/src/Link/Link.js +0 -57
  204. package/src/Loading/Loading.js +0 -15
  205. package/src/Loading2/Loading2.js +0 -15
  206. package/src/ModalWithDrag/ModalWithDrag.js +0 -17
  207. package/src/NumberInput/NumberInput.js +0 -137
  208. package/src/Search/Search.js +0 -368
  209. package/src/Search2/Search.js +0 -436
  210. package/src/Sidebar/Sidebar.js +0 -111
  211. package/src/Sidebar2/Sidebar.js +0 -143
  212. package/src/SuperForm/SuperForm.js +0 -519
  213. package/src/SuperForm2/SuperForm.js +0 -588
  214. package/src/SuperIcon/SuperIcon.js +0 -14
  215. package/src/SuperPagination/SuperPagination.js +0 -65
  216. package/src/SuperTab/SuperTab.js +0 -84
  217. package/src/SuperTab2/SuperTab2.js +0 -94
  218. package/src/SuperTable/DragSortRow.js +0 -62
  219. package/src/SuperTable/FilterDropDown.js +0 -111
  220. package/src/SuperTable/SuperTable.js +0 -590
  221. package/src/SuperTable/fixed.js +0 -34
  222. package/src/SuperTable2/SuperTable2.js +0 -624
  223. package/src/SuperTable2/SuperTableCell.js +0 -175
  224. package/src/SuperTable3/FilterDropDown.js +0 -111
  225. package/src/SuperTable3/SuperTable.js +0 -498
  226. package/src/SuperTable3/fixed.js +0 -34
  227. package/src/SuperToolbar/SuperToolbar.js +0 -128
  228. package/src/SuperUpload/SuperUpload.js +0 -137
  229. package/src/Title/Title.js +0 -18
  230. package/src/Viewer/ImageViews.js +0 -220
  231. package/src/Viewer/Viewer.js +0 -97
  232. package/src/WingBlank/WingBlank.js +0 -14
  233. package/src/helper.js +0 -185
  234. package/src/index.js +0 -39
  235. package/src/variables.js +0 -5
  236. package/test/index.html +0 -10
  237. package/test/test.js +0 -16
  238. package/test/test.less +0 -12
  239. package/test/webpack.config.js +0 -71
  240. package/tools/babel.config.js +0 -14
  241. package/tools/build.js +0 -70
  242. package/tools/publish.js +0 -9
  243. package/tools/util.js +0 -53
  244. /package/{src → es}/Area/package.json +0 -0
  245. /package/{src → es}/Card/package.json +0 -0
  246. /package/{src → es}/CodeInput/package.json +0 -0
  247. /package/{src → es}/Control/package.json +0 -0
  248. /package/{src → es}/Enhance/package.json +0 -0
  249. /package/{src → es}/Header/Header.less +0 -0
  250. /package/{src → es}/Header/Vertical.less +0 -0
  251. /package/{src → es}/Header/package.json +0 -0
  252. /package/{src → es}/ImageView/ImageView.less +0 -0
  253. /package/{src → es}/ImageView/package.json +0 -0
  254. /package/{src → es}/Indent/package.json +0 -0
  255. /package/{src → es}/InpurCascader/package.json +0 -0
  256. /package/{src → es}/InputEditor/inputEditor.less +0 -0
  257. /package/{src → es}/InputEditor/package.json +0 -0
  258. /package/{src → es}/InputSearch/package.json +0 -0
  259. /package/{src → es}/InputSelect/package.json +0 -0
  260. /package/{src → es}/InputTreeSelect/package.json +0 -0
  261. /package/{src → es}/InputWriting/package.json +0 -0
  262. /package/{src → es}/Layout/Layout.less +0 -0
  263. /package/{src → es}/Layout/package.json +0 -0
  264. /package/{src → es}/LayoutLink/LayoutLink.less +0 -0
  265. /package/{src → es}/LayoutLink/package.json +0 -0
  266. /package/{src → es}/Link/package.json +0 -0
  267. /package/{src → es}/Loading/Loading.less +0 -0
  268. /package/{src → es}/Loading/package.json +0 -0
  269. /package/{src → es}/Loading2/Loading2.less +0 -0
  270. /package/{src → es}/Loading2/package.json +0 -0
  271. /package/{src → es}/ModalWithDrag/ModalWithDrag.less +0 -0
  272. /package/{src → es}/ModalWithDrag/package.json +0 -0
  273. /package/{src → es}/NumberInput/package.json +0 -0
  274. /package/{src → es}/Search/Search.less +0 -0
  275. /package/{src → es}/Search/package.json +0 -0
  276. /package/{src → es}/Search2/Search.less +0 -0
  277. /package/{src → es}/Search2/package.json +0 -0
  278. /package/{src → es}/Sidebar/Sidebar.less +0 -0
  279. /package/{src → es}/Sidebar/package.json +0 -0
  280. /package/{src → es}/Sidebar2/Sidebar.less +0 -0
  281. /package/{src → es}/Sidebar2/package.json +0 -0
  282. /package/{src → es}/SuperForm/SuperForm.less +0 -0
  283. /package/{src → es}/SuperForm/package.json +0 -0
  284. /package/{src → es}/SuperForm2/SuperForm.less +0 -0
  285. /package/{src → es}/SuperForm2/package.json +0 -0
  286. /package/{src → es}/SuperIcon/package.json +0 -0
  287. /package/{src → es}/SuperPagination/package.json +0 -0
  288. /package/{src → es}/SuperTab/SuperTab.less +0 -0
  289. /package/{src → es}/SuperTab/package.json +0 -0
  290. /package/{src → es}/SuperTab2/SuperTab2.less +0 -0
  291. /package/{src → es}/SuperTab2/package.json +0 -0
  292. /package/{src → es}/SuperTable/DragSortRow.less +0 -0
  293. /package/{src → es}/SuperTable/FilterDropDown.less +0 -0
  294. /package/{src → es}/SuperTable/SuperTable.less +0 -0
  295. /package/{src → es}/SuperTable/package.json +0 -0
  296. /package/{src → es}/SuperTable2/SuperTable2.less +0 -0
  297. /package/{src → es}/SuperTable2/package.json +0 -0
  298. /package/{src → es}/SuperTable3/FilterDropDown.less +0 -0
  299. /package/{src → es}/SuperTable3/SuperTable.less +0 -0
  300. /package/{src → es}/SuperTable3/package.json +0 -0
  301. /package/{src → es}/SuperToolbar/SuperToolbar.less +0 -0
  302. /package/{src → es}/SuperToolbar/package.json +0 -0
  303. /package/{src → es}/SuperUpload/SuperUpload.less +0 -0
  304. /package/{src → es}/SuperUpload/package.json +0 -0
  305. /package/{src → es}/Title/Title.less +0 -0
  306. /package/{src → es}/Title/package.json +0 -0
  307. /package/{src → es}/Viewer/Viewer.less +0 -0
  308. /package/{src → es}/Viewer/imgView.less +0 -0
  309. /package/{src → es}/Viewer/package.json +0 -0
  310. /package/{src → es}/WingBlank/WingBlank.less +0 -0
  311. /package/{src → es}/WingBlank/package.json +0 -0
  312. /package/{src → es}/adjust.less +0 -0
  313. /package/{src → es}/style.less +0 -0
  314. /package/{src → es}/variables.less +0 -0
@@ -0,0 +1,497 @@
1
+ import _Reflect$construct from "@babel/runtime-corejs3/core-js-stable/reflect/construct";
2
+ import _Object$getOwnPropertySymbols from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols";
3
+ import _Object$getOwnPropertyDescriptor from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor";
4
+ import _forEachInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/for-each";
5
+ import _Object$getOwnPropertyDescriptors from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors";
6
+ import _Object$defineProperties from "@babel/runtime-corejs3/core-js-stable/object/define-properties";
7
+ import _Object$defineProperty from "@babel/runtime-corejs3/core-js-stable/object/define-property";
8
+ import _Row from "antd/es/row";
9
+ import _asyncToGenerator from "@babel/runtime-corejs3/helpers/asyncToGenerator";
10
+ import _Col from "antd/es/col";
11
+ import _Icon from "antd/es/icon";
12
+ import _Button from "antd/es/button";
13
+ import _extends from "@babel/runtime-corejs3/helpers/extends";
14
+ import _classCallCheck from "@babel/runtime-corejs3/helpers/classCallCheck";
15
+ import _createClass from "@babel/runtime-corejs3/helpers/createClass";
16
+ import _assertThisInitialized from "@babel/runtime-corejs3/helpers/assertThisInitialized";
17
+ import _inherits from "@babel/runtime-corejs3/helpers/inherits";
18
+ import _possibleConstructorReturn from "@babel/runtime-corejs3/helpers/possibleConstructorReturn";
19
+ import _getPrototypeOf from "@babel/runtime-corejs3/helpers/getPrototypeOf";
20
+ import _defineProperty from "@babel/runtime-corejs3/helpers/defineProperty";
21
+ import _Form from "antd/es/form";
22
+ import _regeneratorRuntime from "@babel/runtime-corejs3/regenerator";
23
+ function ownKeys(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = _filterInstanceProperty(o).call(o, function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
24
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context12, _context13; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context12 = ownKeys(Object(t), !0)).call(_context12, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context13 = ownKeys(Object(t))).call(_context13, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
25
+ import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
26
+ import _includesInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/includes";
27
+ import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
28
+ import _Object$keys from "@babel/runtime-corejs3/core-js-stable/object/keys";
29
+ import _bindInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/bind";
30
+ import _sortInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/sort";
31
+ import _filterInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/filter";
32
+ import _Array$isArray from "@babel/runtime-corejs3/core-js-stable/array/is-array";
33
+ import _JSON$stringify from "@babel/runtime-corejs3/core-js-stable/json/stringify";
34
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = _Reflect$construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
35
+ 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; } }
36
+ import React from 'react';
37
+ import PropTypes from 'prop-types';
38
+ import ReactDOM from 'react-dom';
39
+ import Control, { getTitle, makeString } from '../Control';
40
+ import { getPathValue } from "../helper";
41
+ import variables from '../variables';
42
+ var FormItem = _Form.Item;
43
+ var defaultSize = 'small';
44
+ var defaultColNum = 4;
45
+ var TYPE = ['text', 'search', 'select', 'number', 'date', 'readonly', 'selectSearch', 'cascader',
46
+ //级联选择下拉
47
+ 'treeSelect' //树选择
48
+ ];
49
+
50
+ /**
51
+ * search: 搜索按钮的标题
52
+ * more:更多按钮的标题
53
+ * reset:重置按钮的标题
54
+ * sort:排序按钮的标题
55
+ */
56
+ var ConfigType = {
57
+ search: PropTypes.string.isRequired,
58
+ reset: PropTypes.string,
59
+ sort: PropTypes.string,
60
+ more: PropTypes.string
61
+ };
62
+
63
+ /**
64
+ * key: 唯一标识一个表单元素
65
+ * title:表单元素旁边的标题
66
+ * type:表单元素的类型
67
+ * props:传递给表单元素的额外属性
68
+ */
69
+ var FilterType = {
70
+ key: PropTypes.string.isRequired,
71
+ title: PropTypes.string.isRequired,
72
+ type: PropTypes.oneOf(TYPE).isRequired,
73
+ options: PropTypes.array,
74
+ props: PropTypes.object
75
+ };
76
+
77
+ /**
78
+ * data:传递给filters的默认值,为key:value的形式,此处的key为FilterType中的key
79
+ * isSort:是否需要排序按钮,默认false,当设置为true时,onClick函数需要实现key为sort的响应函数
80
+ * options: 作用同FilterType.options类似,但优先级高于它
81
+ * onClick:按钮点击事件,原型为func(key)
82
+ * onChange:表单控件内容改变时触发,原型为func(key, value)
83
+ * onSearch:search控件发出的事件,原型为func(key, value)
84
+ * displayRow:折叠时需要展示的行数,整数,默认为1
85
+ */
86
+ var Search = /*#__PURE__*/function (_React$Component) {
87
+ _inherits(Search, _React$Component);
88
+ var _super = _createSuper(Search);
89
+ function Search() {
90
+ var _context;
91
+ var _this;
92
+ _classCallCheck(this, Search);
93
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
94
+ args[_key] = arguments[_key];
95
+ }
96
+ _this = _super.call.apply(_super, _concatInstanceProperty(_context = [this]).call(_context, args));
97
+ _defineProperty(_assertThisInitialized(_this), "state", {
98
+ more: false
99
+ });
100
+ _defineProperty(_assertThisInitialized(_this), "onClick", function (key) {
101
+ var onClick = _this.props.onClick;
102
+ onClick && onClick(key);
103
+ });
104
+ _defineProperty(_assertThisInitialized(_this), "onMore", function () {
105
+ var onHeightChange = _this.props.onHeightChange;
106
+ _this.setState({
107
+ more: !_this.state.more
108
+ });
109
+ onHeightChange && onHeightChange(_this.calHeight(!_this.state.more));
110
+ });
111
+ _defineProperty(_assertThisInitialized(_this), "onChange", function (dictionary, key, value) {
112
+ var _context2, _context3;
113
+ var onChange = _this.props.onChange;
114
+ if (value && key === 'queryGroup' && dictionary && global.dictionary && global.dictionary[dictionary] && !_includesInstanceProperty(_context2 = _mapInstanceProperty(_context3 = global.dictionary[dictionary]).call(_context3, function (item) {
115
+ return item.value;
116
+ })).call(_context2, value)) {
117
+ var _context4;
118
+ var realValue = JSON.parse(value);
119
+ _this.onClick('reset');
120
+ _mapInstanceProperty(_context4 = _Object$keys(realValue)).call(_context4, function (objectKey) {
121
+ onChange && objectKey !== 'queryId' && onChange(objectKey, realValue[objectKey]);
122
+ });
123
+ }
124
+ onChange && onChange(key, value);
125
+ });
126
+ _defineProperty(_assertThisInitialized(_this), "onPressEnter", function () {
127
+ ReactDOM.findDOMNode(_this.refs.search).click();
128
+ });
129
+ _defineProperty(_assertThisInitialized(_this), "toButton", function (key) {
130
+ var _context5;
131
+ var props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
132
+ var config = _this.props.config;
133
+ var onClick = _bindInstanceProperty(_context5 = _this.onClick).call(_context5, _assertThisInitialized(_this), key);
134
+ return /*#__PURE__*/React.createElement(_Button, _extends({
135
+ size: defaultSize,
136
+ onClick: onClick
137
+ }, props), config[key]);
138
+ });
139
+ _defineProperty(_assertThisInitialized(_this), "toMore", function () {
140
+ return /*#__PURE__*/React.createElement("a", {
141
+ role: "more",
142
+ onClick: _this.onMore
143
+ }, _this.props.config.more, /*#__PURE__*/React.createElement(_Icon, {
144
+ type: "down",
145
+ "data-status": !_this.state.more ? 'down' : 'up'
146
+ }));
147
+ });
148
+ _defineProperty(_assertThisInitialized(_this), "toButtons", function () {
149
+ var config = _this.props.config;
150
+ return /*#__PURE__*/React.createElement("div", {
151
+ role: "buttons"
152
+ }, _this.toButton('search', {
153
+ ref: 'search',
154
+ type: 'primary'
155
+ }), config.reset ? _this.toButton('reset') : null, _this.isSort() ? _this.toButton('sort') : null, _this.isMore() ? _this.toMore() : null);
156
+ });
157
+ _defineProperty(_assertThisInitialized(_this), "isSort", function () {
158
+ var _this$props = _this.props,
159
+ config = _this$props.config,
160
+ _this$props$colNum = _this$props.colNum,
161
+ colNum = _this$props$colNum === void 0 ? defaultColNum : _this$props$colNum,
162
+ filters = _this$props.filters,
163
+ _this$props$isSort = _this$props.isSort,
164
+ isSort = _this$props$isSort === void 0 ? false : _this$props$isSort;
165
+ return isSort && _sortInstanceProperty(config) && filters.length > colNum;
166
+ });
167
+ _defineProperty(_assertThisInitialized(_this), "isMore", function () {
168
+ var _this$props2 = _this.props,
169
+ config = _this$props2.config,
170
+ _this$props2$colNum = _this$props2.colNum,
171
+ colNum = _this$props2$colNum === void 0 ? defaultColNum : _this$props2$colNum,
172
+ filters = _this$props2.filters,
173
+ _this$props2$displayR = _this$props2.displayRow,
174
+ displayRow = _this$props2$displayR === void 0 ? 1 : _this$props2$displayR;
175
+ return config.more && _filterInstanceProperty(filters).call(filters, function (item) {
176
+ return !item.hide;
177
+ }).length > colNum * displayRow;
178
+ });
179
+ _defineProperty(_assertThisInitialized(_this), "getOptions", function (filter) {
180
+ var options = _this.props.options;
181
+ if (options && _Array$isArray(options[filter.key])) {
182
+ return options[filter.key];
183
+ } else {
184
+ return filter.options || filter.typeRelated || [];
185
+ }
186
+ });
187
+ _defineProperty(_assertThisInitialized(_this), "getContainer", function () {
188
+ return _this.props.getContainer;
189
+ });
190
+ _defineProperty(_assertThisInitialized(_this), "getControlProps", function (control) {
191
+ var _context6;
192
+ var _this$props$data = _this.props.data,
193
+ data = _this$props$data === void 0 ? {} : _this$props$data;
194
+ return _objectSpread(_objectSpread({}, control.props || {}), {}, {
195
+ size: defaultSize,
196
+ type: control.type,
197
+ value: makeString(data[control.key]),
198
+ onChange: _bindInstanceProperty(_context6 = _this.onChange).call(_context6, _assertThisInitialized(_this), control.dictionary, control.key)
199
+ });
200
+ });
201
+ _defineProperty(_assertThisInitialized(_this), "validDate", function (_ref) {
202
+ var key = _ref.key,
203
+ type = _ref.type;
204
+ return function (date) {
205
+ var _this$props$data2 = _this.props.data,
206
+ data = _this$props$data2 === void 0 ? {} : _this$props$data2;
207
+ if (!date || !data[key]) {
208
+ return false;
209
+ } else {
210
+ if (type === '>') {
211
+ return date.format('YYYY-MM-DD HH:mm:ss') <= data[key].valueOf();
212
+ } else if (type === '<') {
213
+ return date.format('YYYY-MM-DD HH:mm:ss') >= data[key].valueOf();
214
+ } else {
215
+ return false;
216
+ }
217
+ }
218
+ };
219
+ });
220
+ _defineProperty(_assertThisInitialized(_this), "toText", function (props) {
221
+ props.onPressEnter = _this.onPressEnter;
222
+ return /*#__PURE__*/React.createElement(Control, props);
223
+ });
224
+ _defineProperty(_assertThisInitialized(_this), "toNumber", function (props) {
225
+ props.defaultValue = props.value;
226
+ delete props.value;
227
+ return /*#__PURE__*/React.createElement(Control, props);
228
+ });
229
+ _defineProperty(_assertThisInitialized(_this), "getQueryGroupOptions", function (_ref2) {
230
+ var dictionary = _ref2.dictionary,
231
+ _ref2$configCode = _ref2.configCode,
232
+ configCode = _ref2$configCode === void 0 ? 'unknown' : _ref2$configCode;
233
+ var realOptions = [];
234
+ if (dictionary && global.dictionary) {
235
+ var dicOptions = global.dictionary[dictionary] || [];
236
+ realOptions = _concatInstanceProperty(realOptions).call(realOptions, dicOptions);
237
+ }
238
+ var state = global.store.getState();
239
+ var path = ['layout', 'tableColsSetting', configCode];
240
+ var _ref3 = getPathValue(state, path) || {},
241
+ _ref3$queryList = _ref3.queryList,
242
+ queryList = _ref3$queryList === void 0 ? [] : _ref3$queryList;
243
+ return _concatInstanceProperty(realOptions).call(realOptions, _mapInstanceProperty(queryList).call(queryList, function (item) {
244
+ return {
245
+ title: item.name,
246
+ value: _JSON$stringify(item.query)
247
+ };
248
+ }));
249
+ });
250
+ _defineProperty(_assertThisInitialized(_this), "toSelect", function (props, filter) {
251
+ var container = _this.getContainer();
252
+ container && (props.getPopupContainer = container);
253
+ props.options = filter.key === 'queryGroup' ? _this.getQueryGroupOptions(filter) : _this.getOptions(filter);
254
+ props.dropdownMatchSelectWidth = false;
255
+ return /*#__PURE__*/React.createElement(Control, props);
256
+ });
257
+ _defineProperty(_assertThisInitialized(_this), "createSearchEvent", function (filter) {
258
+ if (_this.props.onSearch) {
259
+ return function (value) {
260
+ return _this.props.onSearch(filter.key, value, filter);
261
+ };
262
+ } else {
263
+ return null;
264
+ }
265
+ });
266
+ _defineProperty(_assertThisInitialized(_this), "toSearch", function (props, filter) {
267
+ var container = _this.getContainer();
268
+ container && (props.getPopupContainer = container);
269
+ props.options = _this.getOptions(filter);
270
+ props.onSearch = _this.createSearchEvent(filter);
271
+ props.dropdownMatchSelectWidth = false;
272
+ return /*#__PURE__*/React.createElement(Control, props);
273
+ });
274
+ _defineProperty(_assertThisInitialized(_this), "selectSearch", function (props, filter) {
275
+ var container = _this.getContainer();
276
+ container && (props.getPopupContainer = container);
277
+ props.options = _this.getOptions(filter);
278
+ props.onSearch = _this.createSearchEvent(filter);
279
+ props.dropdownMatchSelectWidth = false;
280
+ return /*#__PURE__*/React.createElement(Control, props);
281
+ });
282
+ _defineProperty(_assertThisInitialized(_this), "toDate", function (props, _ref4) {
283
+ var rule = _ref4.rule;
284
+ var container = _this.getContainer();
285
+ container && (props.getCalendarContainer = container);
286
+ rule && (props.disabledDate = _this.validDate(rule));
287
+ props.style = {
288
+ width: '100%'
289
+ };
290
+ return /*#__PURE__*/React.createElement(Control, props);
291
+ });
292
+ _defineProperty(_assertThisInitialized(_this), "toReadonly", function (props, filter) {
293
+ props.value = getTitle(props.value, _this.getOptions(filter));
294
+ return /*#__PURE__*/React.createElement(Control, props);
295
+ });
296
+ _defineProperty(_assertThisInitialized(_this), "toCascader", function (props, filter) {
297
+ var container = _this.getContainer();
298
+ container && (props.getPopupContainer = container);
299
+ props.options = _this.getOptions(filter);
300
+ props.onSearch = _this.createSearchEvent(filter);
301
+ props.placeholder = filter.placeholder || '';
302
+ return /*#__PURE__*/React.createElement(Control, props);
303
+ });
304
+ _defineProperty(_assertThisInitialized(_this), "toTreeSelect", function (props, filter) {
305
+ var container = _this.getContainer();
306
+ container && (props.getPopupContainer = container);
307
+ props.options = _this.getOptions(filter);
308
+ props.onSearch = _this.createSearchEvent(filter);
309
+ props.placeholder = filter.placeholder || '';
310
+ return /*#__PURE__*/React.createElement(Control, props);
311
+ });
312
+ _defineProperty(_assertThisInitialized(_this), "toControl", function (control) {
313
+ var props = _this.getControlProps(control);
314
+ switch (control.type) {
315
+ case 'text':
316
+ return _this.toText(props, control);
317
+ case 'number':
318
+ return _this.toNumber(props, control);
319
+ case 'select':
320
+ return _this.toSelect(props, control);
321
+ case 'selectSearch':
322
+ return _this.selectSearch(props, control);
323
+ case 'search':
324
+ return _this.toSearch(props, control);
325
+ case 'date':
326
+ return _this.toDate(props, control);
327
+ case 'readonly':
328
+ return _this.toReadonly(props, control);
329
+ case 'cascader':
330
+ return _this.toCascader(props, control);
331
+ case 'treeSelect':
332
+ return _this.toTreeSelect(props, control);
333
+ default:
334
+ return 'type error';
335
+ }
336
+ });
337
+ _defineProperty(_assertThisInitialized(_this), "toLabel", function (_ref5) {
338
+ var title = _ref5.title,
339
+ key = _ref5.key,
340
+ dictionary = _ref5.dictionary,
341
+ _ref5$configCode = _ref5.configCode,
342
+ configCode = _ref5$configCode === void 0 ? 'unknown' : _ref5$configCode;
343
+ if (key === 'queryGroup') {
344
+ var _context7, _context8;
345
+ //查询组合
346
+ return /*#__PURE__*/React.createElement("span", null, title, /*#__PURE__*/React.createElement(_Icon, {
347
+ role: "icon",
348
+ type: "plus-circle-o",
349
+ onClick: _bindInstanceProperty(_context7 = _this.onAddQueryGroup).call(_context7, _assertThisInitialized(_this), configCode, _this.props.data, dictionary)
350
+ }), /*#__PURE__*/React.createElement(_Icon, {
351
+ role: "icon",
352
+ type: "minus-circle-o",
353
+ onClick: _bindInstanceProperty(_context8 = _this.onDelQueryGroup).call(_context8, _assertThisInitialized(_this), configCode, _this.props.data, dictionary)
354
+ }));
355
+ } else {
356
+ return title;
357
+ }
358
+ });
359
+ _defineProperty(_assertThisInitialized(_this), "toCol", function (span, control, more) {
360
+ var factor = control.span || 1;
361
+ return /*#__PURE__*/React.createElement(_Col, {
362
+ span: span * factor,
363
+ key: control.key,
364
+ onFocus: more ? function () {
365
+ _this.setState({
366
+ more: true
367
+ });
368
+ } : undefined
369
+ }, /*#__PURE__*/React.createElement(FormItem, {
370
+ label: _this.toLabel(control),
371
+ required: control.required
372
+ }, _this.toControl(control)));
373
+ });
374
+ _defineProperty(_assertThisInitialized(_this), "toCols", function () {
375
+ var _context9;
376
+ var _this$props3 = _this.props,
377
+ _this$props3$colNum = _this$props3.colNum,
378
+ colNum = _this$props3$colNum === void 0 ? defaultColNum : _this$props3$colNum,
379
+ filters = _this$props3.filters,
380
+ _this$props3$displayR = _this$props3.displayRow,
381
+ displayRow = _this$props3$displayR === void 0 ? 1 : _this$props3$displayR;
382
+ var span = 24 / Math.min(colNum, _filterInstanceProperty(filters).call(filters, function (item) {
383
+ return !item.hide;
384
+ }).length);
385
+ return _mapInstanceProperty(_context9 = _filterInstanceProperty(filters).call(filters, function (item) {
386
+ return !item.hide;
387
+ })).call(_context9, function (control, index) {
388
+ return _this.toCol(span, control, index >= colNum * displayRow);
389
+ });
390
+ });
391
+ _defineProperty(_assertThisInitialized(_this), "calWidth", function () {
392
+ var _this$props4 = _this.props,
393
+ _this$props4$colNum = _this$props4.colNum,
394
+ colNum = _this$props4$colNum === void 0 ? defaultColNum : _this$props4$colNum,
395
+ filters = _this$props4.filters;
396
+ var length = _filterInstanceProperty(filters).call(filters, function (item) {
397
+ return !item.hide;
398
+ }).length;
399
+ if (length < colNum) {
400
+ return "".concat(length * 18, "%");
401
+ } else {
402
+ return "".concat(defaultColNum * 18, "%");
403
+ }
404
+ });
405
+ _defineProperty(_assertThisInitialized(_this), "calHeight", function (more) {
406
+ var _this$props5 = _this.props,
407
+ _this$props5$colNum = _this$props5.colNum,
408
+ colNum = _this$props5$colNum === void 0 ? defaultColNum : _this$props5$colNum,
409
+ filters = _this$props5.filters,
410
+ _this$props5$displayR = _this$props5.displayRow,
411
+ displayRow = _this$props5$displayR === void 0 ? 1 : _this$props5$displayR;
412
+ if (more) {
413
+ var row = Math.ceil(_filterInstanceProperty(filters).call(filters, function (item) {
414
+ return !item.hide;
415
+ }).length / colNum);
416
+ return row * 36 + (row - 1) * 10;
417
+ } else {
418
+ return displayRow * 36 + (displayRow - 1) * 10;
419
+ }
420
+ });
421
+ return _this;
422
+ }
423
+ _createClass(Search, [{
424
+ key: "onAddQueryGroup",
425
+ value: function () {
426
+ var _onAddQueryGroup = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(configCode, searchData, dictionary) {
427
+ var onAddQueryGroup;
428
+ return _regeneratorRuntime.wrap(function _callee$(_context10) {
429
+ while (1) switch (_context10.prev = _context10.next) {
430
+ case 0:
431
+ onAddQueryGroup = this.props.onAddQueryGroup;
432
+ onAddQueryGroup && onAddQueryGroup(configCode, searchData, dictionary);
433
+ case 2:
434
+ case "end":
435
+ return _context10.stop();
436
+ }
437
+ }, _callee, this);
438
+ }));
439
+ function onAddQueryGroup(_x, _x2, _x3) {
440
+ return _onAddQueryGroup.apply(this, arguments);
441
+ }
442
+ return onAddQueryGroup;
443
+ }()
444
+ }, {
445
+ key: "onDelQueryGroup",
446
+ value: function () {
447
+ var _onDelQueryGroup = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(configCode, searchData, dictionary) {
448
+ var onDelQueryGroup;
449
+ return _regeneratorRuntime.wrap(function _callee2$(_context11) {
450
+ while (1) switch (_context11.prev = _context11.next) {
451
+ case 0:
452
+ onDelQueryGroup = this.props.onDelQueryGroup;
453
+ onDelQueryGroup && onDelQueryGroup(configCode, searchData, dictionary);
454
+ case 2:
455
+ case "end":
456
+ return _context11.stop();
457
+ }
458
+ }, _callee2, this);
459
+ }));
460
+ function onDelQueryGroup(_x4, _x5, _x6) {
461
+ return _onDelQueryGroup.apply(this, arguments);
462
+ }
463
+ return onDelQueryGroup;
464
+ }()
465
+ }, {
466
+ key: "render",
467
+ value: function render() {
468
+ return /*#__PURE__*/React.createElement("div", {
469
+ className: variables('Search'),
470
+ style: {
471
+ height: this.calHeight(this.state.more)
472
+ }
473
+ }, /*#__PURE__*/React.createElement(_Form, {
474
+ layout: "vertical",
475
+ style: {
476
+ width: this.calWidth()
477
+ }
478
+ }, /*#__PURE__*/React.createElement(_Row, {
479
+ gutter: 20
480
+ }, this.toCols())), this.toButtons());
481
+ }
482
+ }]);
483
+ return Search;
484
+ }(React.Component);
485
+ _defineProperty(Search, "propTypes", {
486
+ config: PropTypes.shape(ConfigType).isRequired,
487
+ filters: PropTypes.arrayOf(PropTypes.shape(FilterType)).isRequired,
488
+ data: PropTypes.object,
489
+ options: PropTypes.object,
490
+ getContainer: PropTypes.func,
491
+ onClick: PropTypes.func,
492
+ onChange: PropTypes.func,
493
+ onSearch: PropTypes.func,
494
+ onHeightChange: PropTypes.func,
495
+ displayRow: PropTypes.number
496
+ });
497
+ export default Search;