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,939 @@
1
+ "use strict";
2
+
3
+ var _typeof = require("@babel/runtime-corejs3/helpers/typeof");
4
+ var _Reflect$construct = require("@babel/runtime-corejs3/core-js-stable/reflect/construct");
5
+ var _Object$keys = require("@babel/runtime-corejs3/core-js-stable/object/keys");
6
+ var _Object$getOwnPropertySymbols = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols");
7
+ var _filterInstanceProperty2 = require("@babel/runtime-corejs3/core-js-stable/instance/filter");
8
+ var _Object$getOwnPropertyDescriptor = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor");
9
+ var _forEachInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/for-each");
10
+ var _Object$getOwnPropertyDescriptors = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors");
11
+ var _Object$defineProperties = require("@babel/runtime-corejs3/core-js-stable/object/define-properties");
12
+ var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
13
+ var _sliceInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/slice");
14
+ var _Array$from = require("@babel/runtime-corejs3/core-js-stable/array/from");
15
+ var _Symbol = require("@babel/runtime-corejs3/core-js-stable/symbol");
16
+ var _getIteratorMethod = require("@babel/runtime-corejs3/core-js/get-iterator-method");
17
+ var _Array$isArray2 = require("@babel/runtime-corejs3/core-js-stable/array/is-array");
18
+ var _WeakMap = require("@babel/runtime-corejs3/core-js-stable/weak-map");
19
+ var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
20
+ _Object$defineProperty(exports, "__esModule", {
21
+ value: true
22
+ });
23
+ exports["default"] = void 0;
24
+ var _table = _interopRequireDefault(require("antd/lib/table"));
25
+ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/objectWithoutProperties"));
26
+ var _concat = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/concat"));
27
+ var _isArray = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/array/is-array"));
28
+ var _map = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/map"));
29
+ var _includes = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/includes"));
30
+ var _bind = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/bind"));
31
+ var _filter = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/filter"));
32
+ var _reduce = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/reduce"));
33
+ var _some = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/some"));
34
+ var _assign = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/assign"));
35
+ var _objectDestructuringEmpty2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/objectDestructuringEmpty"));
36
+ var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/extends"));
37
+ var _switch = _interopRequireDefault(require("antd/lib/switch"));
38
+ var _button = _interopRequireDefault(require("antd/lib/button"));
39
+ var _checkbox = _interopRequireDefault(require("antd/lib/checkbox"));
40
+ var _icon = _interopRequireDefault(require("antd/lib/icon"));
41
+ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/classCallCheck"));
42
+ var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/createClass"));
43
+ var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/assertThisInitialized"));
44
+ var _inherits2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/inherits"));
45
+ var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/possibleConstructorReturn"));
46
+ var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/getPrototypeOf"));
47
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/defineProperty"));
48
+ var _radio = _interopRequireDefault(require("antd/lib/radio"));
49
+ var _react = _interopRequireDefault(require("react"));
50
+ var _propTypes = _interopRequireDefault(require("prop-types"));
51
+ var _reactDom = _interopRequireDefault(require("react-dom"));
52
+ var _Control = _interopRequireWildcard(require("../Control"));
53
+ var _SuperTableCell = _interopRequireDefault(require("./SuperTableCell"));
54
+ var _fixed = _interopRequireDefault(require("../SuperTable/fixed"));
55
+ var _SuperToolbar = _interopRequireDefault(require("../SuperToolbar"));
56
+ var _variables = _interopRequireDefault(require("../variables"));
57
+ var _helper = _interopRequireWildcard(require("../helper"));
58
+ var _DragSortRow = _interopRequireDefault(require("../SuperTable/DragSortRow"));
59
+ var _excluded = ["onRowClick"];
60
+ function _getRequireWildcardCache(e) { if ("function" != typeof _WeakMap) return null; var r = new _WeakMap(), t = new _WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
61
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = _Object$defineProperty && _Object$getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? _Object$getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? _Object$defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
62
+ function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof _Symbol !== "undefined" && _getIteratorMethod(o) || o["@@iterator"]; if (!it) { if (_Array$isArray2(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
63
+ function _unsupportedIterableToArray(o, minLen) { var _context20; if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = _sliceInstanceProperty(_context20 = Object.prototype.toString.call(o)).call(_context20, 8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return _Array$from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
64
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
65
+ function ownKeys(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = _filterInstanceProperty2(o).call(o, function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
66
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context18, _context19; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context18 = ownKeys(Object(t), !0)).call(_context18, function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context19 = ownKeys(Object(t))).call(_context19, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
67
+ 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); }; }
68
+ 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; } }
69
+ var RadioGroup = _radio["default"].Group;
70
+ var TypeEnum = ['readonly', 'index', 'checkbox', 'text', 'number', 'select',
71
+ //存储value
72
+ 'selectText',
73
+ //存储title
74
+ 'search', 'searchText', 'selectSearch',
75
+ //多选下拉搜索
76
+ 'date', 'button', 'custom', 'switch', 'textArea', 'link', 'cascader', 'toolbar',
77
+ //按钮组
78
+ 'img',
79
+ //图片标题组 value为{src,title}时显示图片标题 为字符串时 只显示图片
80
+ 'uploadImg', 'double', 'radioGroup', 'selectWriting'];
81
+
82
+ /**
83
+ * key:标识所在列,在一个表格中必须唯一
84
+ * title:列的标题,type为checkbox时,title为空字符串时,表头才会显示为复选框
85
+ * type:嵌入的表单元素类型
86
+ * link: 是否为超链接,type未设置时,该属性才生效。为true表示内容来至items,为字符串表示超链接内容就是该字符串
87
+ * options: 对象(包含value和title)数组
88
+ * props:传递参数给被嵌入的组件
89
+ * width: 嵌入的组件的宽度,默认值为100
90
+ * align:对齐方式,index默认center,其他类型默认为left
91
+ * showAdd: 表头是否显示+号,默认为false,加号会触发onAdd事件
92
+ * hide: 为true时隐藏该列
93
+ */
94
+ var ColType = {
95
+ key: _propTypes["default"].string.isRequired,
96
+ title: _propTypes["default"].string.isRequired,
97
+ type: _propTypes["default"].oneOf(TypeEnum),
98
+ link: _propTypes["default"].oneOfType([_propTypes["default"].bool, _propTypes["default"].string]),
99
+ align: _propTypes["default"].oneOf(['left', 'center', 'right']),
100
+ width: _propTypes["default"].number,
101
+ options: _propTypes["default"].array,
102
+ showAdd: _propTypes["default"].any,
103
+ hide: _propTypes["default"].bool,
104
+ props: _propTypes["default"].any
105
+ };
106
+
107
+ /**
108
+ * onCheck:点击复选框时触发,原型func(rowIndex, keyName, checked)
109
+ * onContentChange: 输入框内容改变时触发,原型为function(rowIndex, keyName, value)
110
+ * onBlur: 输入框失去焦点时触发,原型为function(rowIndex, keyName, value)
111
+ * onSearch:search组件输入内容时触发,原型为function(rowIndex, keyName, value, col)
112
+ * onLink: 点击超链接时触发,原型为function(keyName, rowIndex, item)
113
+ * onAdd:点击+号时触发,原型为function(keyName)
114
+ * onRenderCustom:(废弃)用于渲染type为custom类型的单元格,原型为function(rowIndex, keyName, value,props)
115
+ * onToolbar:点击表格列按钮组时触发,原型为function(按钮组列的key,rowIndex,该行数据的值,按钮key);
116
+ * onDoubleClick: 双击单元格触发(只针对于type类型为空的情况下)
117
+ */
118
+ var CallbackType = {
119
+ onExitValid: _propTypes["default"].func,
120
+ onCheck: _propTypes["default"].func,
121
+ onContentChange: _propTypes["default"].func,
122
+ onBlur: _propTypes["default"].func,
123
+ onSearch: _propTypes["default"].func,
124
+ onLink: _propTypes["default"].func,
125
+ onAdd: _propTypes["default"].func,
126
+ onRenderCustom: _propTypes["default"].func,
127
+ onToolbar: _propTypes["default"].func,
128
+ onDoubleClick: _propTypes["default"].func,
129
+ onTableFileChange: _propTypes["default"].func,
130
+ buildSuperUploadProps: _propTypes["default"].func,
131
+ //构建type===uploadImg时,SuperUpload组件需要的公共属性函数,已在项目公共文件state.js中提供,可直接引用
132
+ onImgTileClick: _propTypes["default"].func,
133
+ //点击img类型标题触发事件
134
+ onMoveRow: _propTypes["default"].func
135
+ };
136
+
137
+ /**
138
+ * base[可选]:序号的开始数字,所有回调函数中的序号值都会加上这个值,默认值为0
139
+ * isEmphasized: [可选],是否强调,行字体加粗显示, 除了isEmphasized设置为true之外,加粗行数据里要设置__isEmphasized为true
140
+ */
141
+ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
142
+ (0, _inherits2["default"])(SuperTable2, _React$Component);
143
+ var _super = _createSuper(SuperTable2);
144
+ function SuperTable2() {
145
+ var _context;
146
+ var _this;
147
+ (0, _classCallCheck2["default"])(this, SuperTable2);
148
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
149
+ args[_key] = arguments[_key];
150
+ }
151
+ _this = _super.call.apply(_super, (0, _concat["default"])(_context = [this]).call(_context, args));
152
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onSwitch", function (key, rowIndex) {
153
+ return function (value) {
154
+ var _ref = _this.props.callback || {},
155
+ onContentChange = _ref.onContentChange;
156
+ onContentChange && onContentChange(_this.getIndex(rowIndex), key, value);
157
+ };
158
+ });
159
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onCheck", function (key, rowIndex) {
160
+ return function (e) {
161
+ var _ref2 = _this.props.callback || {},
162
+ onCheck = _ref2.onCheck;
163
+ onCheck && onCheck(_this.getIndex(rowIndex), key, e.target.checked);
164
+ };
165
+ });
166
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onChange", function (key, rowIndex) {
167
+ return function (value) {
168
+ var _ref3 = _this.props.callback || {},
169
+ onContentChange = _ref3.onContentChange;
170
+ _this.closeValid();
171
+ onContentChange && onContentChange(_this.getIndex(rowIndex), key, value);
172
+ };
173
+ });
174
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onDoubleChange1", function (key, rowIndex) {
175
+ return function (doublekey, value) {
176
+ var _ref4 = _this.props.callback || {},
177
+ onContentChange = _ref4.onContentChange;
178
+ _this.closeValid();
179
+ onContentChange && onContentChange(_this.getIndex(rowIndex), doublekey, value);
180
+ };
181
+ });
182
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onSearch", function (key, rowIndex, config) {
183
+ return function (value) {
184
+ var _ref5 = _this.props.callback || {},
185
+ onSearch = _ref5.onSearch;
186
+ onSearch && onSearch(_this.getIndex(rowIndex), key, value, config);
187
+ };
188
+ });
189
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onAdd", function (key) {
190
+ return function () {
191
+ var _ref6 = _this.props.callback || {},
192
+ onAdd = _ref6.onAdd;
193
+ onAdd && onAdd(key);
194
+ };
195
+ });
196
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onRowAdd", function (key, index) {
197
+ return function () {
198
+ var _ref7 = _this.props.callback || {},
199
+ onLink = _ref7.onLink;
200
+ onLink && onLink(key, index, _this.props.items[index]);
201
+ };
202
+ });
203
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onBlur", function (key, rowIndex) {
204
+ return function (value) {
205
+ var _ref8 = _this.props.callback || {},
206
+ onBlur = _ref8.onBlur;
207
+ _this.closeValid();
208
+ onBlur && onBlur(_this.getIndex(rowIndex), key, value);
209
+ };
210
+ });
211
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onDoubleClick", function (key, value) {
212
+ return function () {
213
+ var _ref9 = _this.props.callback || {},
214
+ onDoubleClick = _ref9.onDoubleClick;
215
+ onDoubleClick && onDoubleClick(key, value);
216
+ };
217
+ });
218
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onImgTileClick", function (col, value, rowIndex) {
219
+ return function () {
220
+ var _ref10 = _this.props.callback || {},
221
+ onImgTileClick = _ref10.onImgTileClick;
222
+ onImgTileClick && onImgTileClick(col, value, rowIndex);
223
+ };
224
+ });
225
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onMoveRow", function (dragIndex, targetIndex) {
226
+ var _ref11 = _this.props.callback || {},
227
+ onMoveRow = _ref11.onMoveRow;
228
+ onMoveRow && onMoveRow(dragIndex, targetIndex);
229
+ });
230
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "closeValid", function () {
231
+ var _this$props = _this.props,
232
+ valid = _this$props.valid,
233
+ _this$props$callback = _this$props.callback,
234
+ callback = _this$props$callback === void 0 ? {} : _this$props$callback;
235
+ valid && callback.onExitValid();
236
+ });
237
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getOptions", function (key, colOptions, index) {
238
+ var options = _this.props.items[index].options;
239
+ var options2 = _this.props.options;
240
+ if (options && (0, _isArray["default"])(options[key])) {
241
+ return options[key];
242
+ } else if (options2 && (0, _isArray["default"])(options2[key])) {
243
+ return options2[key];
244
+ } else {
245
+ return colOptions;
246
+ }
247
+ });
248
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "validField", function (required, value) {
249
+ if (!_this.props.valid || _this.error || !required || value) {
250
+ return false;
251
+ } else if (typeof value === 'number') {
252
+ return false;
253
+ } else {
254
+ _this.error = true;
255
+ return true;
256
+ }
257
+ });
258
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "toRadio", function (_ref12, index) {
259
+ var value = _ref12.value,
260
+ title = _ref12.title;
261
+ return /*#__PURE__*/_react["default"].createElement(_radio["default"], {
262
+ key: index,
263
+ value: String(value)
264
+ }, title);
265
+ });
266
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "renderRadioGroup", function (config, value, index) {
267
+ var key = config.key,
268
+ options = config.options;
269
+ var radioGroupProps = {
270
+ onChange: function onChange(e) {
271
+ _this.onChange(key, index)(e.target.value);
272
+ },
273
+ value: String(value)
274
+ };
275
+ return /*#__PURE__*/_react["default"].createElement(RadioGroup, radioGroupProps, (0, _map["default"])(options).call(options, _this.toRadio));
276
+ });
277
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "renderEditableCell", function (config, value, index) {
278
+ var key = config.key,
279
+ type = config.type,
280
+ options = config.options,
281
+ props = config.props,
282
+ required = config.required,
283
+ width = config.width,
284
+ showRowAdd = config.showRowAdd;
285
+ var _this$props$items$ind = _this.props.items[index],
286
+ readonly = _this$props$items$ind.readonly,
287
+ _this$props$items$ind2 = _this$props$items$ind.isReadonly,
288
+ isReadonly = _this$props$items$ind2 === void 0 ? [] : _this$props$items$ind2,
289
+ _this$props$items$ind3 = _this$props$items$ind.isRequired,
290
+ isRequired = _this$props$items$ind3 === void 0 ? [] : _this$props$items$ind3,
291
+ _this$props$items$ind4 = _this$props$items$ind._extraProps,
292
+ _extraProps = _this$props$items$ind4 === void 0 ? {} : _this$props$items$ind4;
293
+ var cellProps = {
294
+ value: value,
295
+ width: width,
296
+ items: _this.props.items[index],
297
+ type: readonly || (0, _isArray["default"])(isReadonly) && (0, _includes["default"])(isReadonly).call(isReadonly, key) || _this.props.readonly ? 'readonly' : type,
298
+ props: readonly ? {} : props,
299
+ error: _this.validField(required, value),
300
+ options: _this.getOptions(key, options, index),
301
+ onChange: _this.onChange(key, index),
302
+ onSearch: _this.onSearch(key, index, config),
303
+ onBlur: _this.onBlur(key, index)
304
+ };
305
+ if (showRowAdd && (0, _isArray["default"])(isRequired) && (0, _includes["default"])(isRequired).call(isRequired, key)) {
306
+ cellProps.error = _this.validField(true, value);
307
+ cellProps.props = _objectSpread(_objectSpread({}, cellProps.props), _extraProps);
308
+ return /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("span", {
309
+ style: {
310
+ color: 'red',
311
+ display: 'inline-block'
312
+ }
313
+ }, "*"), /*#__PURE__*/_react["default"].createElement("span", {
314
+ style: {
315
+ marginLeft: '5px',
316
+ display: 'inline-block',
317
+ width: 'calc(100% - 12px)'
318
+ }
319
+ }, /*#__PURE__*/_react["default"].createElement(_SuperTableCell["default"], cellProps)), /*#__PURE__*/_react["default"].createElement("span", {
320
+ style: {
321
+ color: '#2196f3',
322
+ verticalAlign: 'super'
323
+ }
324
+ }, /*#__PURE__*/_react["default"].createElement(_icon["default"], {
325
+ type: "plus-circle-o",
326
+ role: "add",
327
+ onClick: _this.onRowAdd(key, index)
328
+ })));
329
+ }
330
+ if ((0, _isArray["default"])(isRequired) && (0, _includes["default"])(isRequired).call(isRequired, key)) {
331
+ cellProps.error = _this.validField(true, value);
332
+ cellProps.props = _objectSpread(_objectSpread({}, cellProps.props), _extraProps);
333
+ return /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("span", {
334
+ style: {
335
+ color: 'red',
336
+ display: 'inline-block'
337
+ }
338
+ }, "*"), /*#__PURE__*/_react["default"].createElement("span", {
339
+ style: {
340
+ marginLeft: '5px',
341
+ display: 'inline-block',
342
+ width: 'calc(100% - 12px)'
343
+ }
344
+ }, /*#__PURE__*/_react["default"].createElement(_SuperTableCell["default"], cellProps)));
345
+ }
346
+ if (showRowAdd) {
347
+ return /*#__PURE__*/_react["default"].createElement("div", {
348
+ style: {
349
+ clear: 'both'
350
+ }
351
+ }, /*#__PURE__*/_react["default"].createElement("span", {
352
+ style: {
353
+ marginRight: '5px',
354
+ "float": 'left'
355
+ }
356
+ }, /*#__PURE__*/_react["default"].createElement(_SuperTableCell["default"], cellProps)), /*#__PURE__*/_react["default"].createElement("span", {
357
+ style: {
358
+ color: '#2196f3',
359
+ verticalAlign: 'middle'
360
+ }
361
+ }, /*#__PURE__*/_react["default"].createElement(_icon["default"], {
362
+ type: "plus-circle-o",
363
+ role: "add",
364
+ onClick: _this.onRowAdd(key, index)
365
+ })));
366
+ }
367
+ return /*#__PURE__*/_react["default"].createElement(_SuperTableCell["default"], cellProps);
368
+ });
369
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "renderDoubleEditableCell", function (config, value, index) {
370
+ var key = config.key,
371
+ type = config.type,
372
+ options = config.options,
373
+ props = config.props,
374
+ required = config.required,
375
+ width = config.width,
376
+ showRowAdd = config.showRowAdd;
377
+ var _this$props$items$ind5 = _this.props.items[index],
378
+ readonly = _this$props$items$ind5.readonly,
379
+ _this$props$items$ind6 = _this$props$items$ind5.isReadonly,
380
+ isReadonly = _this$props$items$ind6 === void 0 ? [] : _this$props$items$ind6,
381
+ _this$props$items$ind7 = _this$props$items$ind5.isRequired,
382
+ isRequired = _this$props$items$ind7 === void 0 ? [] : _this$props$items$ind7,
383
+ _this$props$items$ind8 = _this$props$items$ind5._extraProps,
384
+ _extraProps = _this$props$items$ind8 === void 0 ? {} : _this$props$items$ind8;
385
+ var cellProps = {
386
+ value: value,
387
+ width: width,
388
+ items: _this.props.items[index],
389
+ type: readonly || (0, _isArray["default"])(isReadonly) && (0, _includes["default"])(isReadonly).call(isReadonly, key) || _this.props.readonly ? 'readonly' : type,
390
+ props: readonly ? {} : props,
391
+ error: _this.validField(required, value),
392
+ options: _this.getOptions(key, options, index),
393
+ onChange: _this.onDoubleChange1(key, index),
394
+ onSearch: _this.onSearch(key, index, config),
395
+ onBlur: _this.onBlur(key, index)
396
+ };
397
+ return /*#__PURE__*/_react["default"].createElement(_SuperTableCell["default"], cellProps);
398
+ });
399
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "renderLinkCell", function (col, value, record, index) {
400
+ if (col.link === 'list') {
401
+ var list = value && (0, _isArray["default"])(value) ? value : [];
402
+ return /*#__PURE__*/_react["default"].createElement("div", {
403
+ style: {
404
+ whiteSpace: 'pre-wrap'
405
+ }
406
+ }, (0, _map["default"])(list).call(list, function (item2, index2) {
407
+ var _context2;
408
+ var split = index2 === list.length - 1 ? '' : ',';
409
+ var onClick = function onClick() {
410
+ var _ref13 = _this.props.callback || {},
411
+ onLink = _ref13.onLink;
412
+ onLink && onLink(col.key, index, item2);
413
+ };
414
+ return /*#__PURE__*/_react["default"].createElement("a", {
415
+ key: index2,
416
+ onClick: onClick
417
+ }, (0, _concat["default"])(_context2 = "".concat(item2[col.linkTitleKey])).call(_context2, split));
418
+ }));
419
+ } else {
420
+ var title = typeof col.link === 'string' ? col.link : value;
421
+ var onClick = function onClick() {
422
+ var _ref14 = _this.props.callback || {},
423
+ onLink = _ref14.onLink;
424
+ onLink && onLink(col.key, index, record);
425
+ };
426
+ return /*#__PURE__*/_react["default"].createElement("a", {
427
+ style: {
428
+ whiteSpace: 'normal',
429
+ wordBreak: "break-all"
430
+ },
431
+ onClick: onClick
432
+ }, title);
433
+ }
434
+ });
435
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getIndex", function (index) {
436
+ return (_this.props.base || 0) + index;
437
+ });
438
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getCellRender", function (col) {
439
+ return function (value, record, index) {
440
+ var _context3, _context4, _context5, _context6, _context7, _context8, _context9, _context10;
441
+ var realType = record._isEdit === true && _this.canReadonly(col.type) ? col.editType : col.type;
442
+ if (!realType) {
443
+ return /*#__PURE__*/_react["default"].createElement("div", {
444
+ onDoubleClick: _this.onDoubleClick(col.key, record.key),
445
+ style: {
446
+ minHeight: '20px',
447
+ minWidth: '100px',
448
+ maxWidth: "".concat(col.width - 16, "px"),
449
+ color: col.isNeedShow ? '#1890ff' : '',
450
+ overflow: 'hidden',
451
+ textOverflow: 'ellipsis',
452
+ display: '-webkit-box',
453
+ WebkitLineClamp: 2,
454
+ WebkitBoxOrient: "vertical",
455
+ whiteSpace: 'break-spaces'
456
+ },
457
+ title: value
458
+ }, value);
459
+ }
460
+ switch (realType) {
461
+ case 'checkbox':
462
+ return /*#__PURE__*/_react["default"].createElement(_checkbox["default"], {
463
+ onChange: _this.onCheck(col.key, record.key),
464
+ checked: value || false
465
+ });
466
+ case 'index':
467
+ return _this.getIndex(index) + 1;
468
+ case 'link':
469
+ return _this.renderLinkCell(col, value, record, record.key);
470
+ case 'button':
471
+ var onClick = _this.props.callback.onLink ? (0, _bind["default"])(_context3 = _this.props.callback.onLink).call(_context3, null, col.key, record.key, record) : undefined;
472
+ if (col.icon === 'add') {
473
+ return /*#__PURE__*/_react["default"].createElement(_button["default"], {
474
+ onClick: onClick,
475
+ type: "primary",
476
+ shape: "circle",
477
+ size: "small",
478
+ ghost: true,
479
+ icon: "plus"
480
+ });
481
+ } else {
482
+ return /*#__PURE__*/_react["default"].createElement(_button["default"], {
483
+ onClick: onClick,
484
+ size: "small",
485
+ ghost: true,
486
+ type: col.bsStyle
487
+ }, record[col.key] || col.typeRelated);
488
+ }
489
+ // case 'radioGroup':
490
+ // return this.renderRadioGroup(col, value, record.key);
491
+ case 'switch':
492
+ return typeof value === 'string' ? /*#__PURE__*/_react["default"].createElement("div", null, value) : /*#__PURE__*/_react["default"].createElement(_switch["default"], {
493
+ checkedChildren: col.props.checkedChildren || '',
494
+ unCheckedChildren: col.props.unCheckedChildren || '',
495
+ onChange: _this.onSwitch(col.key, record.key),
496
+ size: "default",
497
+ checked: typeof value === 'number' ? Boolean(value) : value || false,
498
+ disabled: !(record._isEdit === true)
499
+ });
500
+ case 'custom':
501
+ return _this.props.callback.onRenderCustom(record.key, col.key, value, col.props, col);
502
+ case 'toolbar':
503
+ //showByKey为true时,每条数据中与按钮key相同的属性值决定按钮是否显示,建议key用下划线开始命名,避免与后台数据冲突
504
+ var props = {
505
+ onClick: _this.props.callback.onToolbar ? (0, _bind["default"])(_context4 = _this.props.callback.onToolbar).call(_context4, null, col.key, record.key, record) : undefined,
506
+ buttons: col.props.showByKey ? (0, _filter["default"])(_context5 = col.props.buttons).call(_context5, function (item) {
507
+ return record[item.key] === true;
508
+ }) : (0, _filter["default"])(_context6 = col.props.buttons).call(_context6, function (item) {
509
+ return item.defaultShow === !record._isEdit;
510
+ })
511
+ };
512
+ return /*#__PURE__*/_react["default"].createElement(_SuperToolbar["default"], props);
513
+ case 'img':
514
+ return value ? typeof value === 'string' ? /*#__PURE__*/_react["default"].createElement("img", {
515
+ src: (0, _includes["default"])(value).call(value, 'http') ? value : (0, _concat["default"])(_context7 = "".concat(window.location.origin, "/api/proxy/file-center-service/")).call(_context7, value),
516
+ style: {
517
+ width: '80px',
518
+ height: '80px'
519
+ }
520
+ }) : /*#__PURE__*/_react["default"].createElement("div", {
521
+ role: 'imgBox',
522
+ style: {
523
+ maxWidth: "".concat(col.width, "px")
524
+ }
525
+ }, /*#__PURE__*/_react["default"].createElement("img", {
526
+ src: value.img === '' ? '/productDefault.png' : (0, _includes["default"])(_context8 = value.img).call(_context8, 'http') ? value.img : (0, _concat["default"])(_context9 = "".concat(window.location.origin, "/api/proxy/file-center-service/")).call(_context9, value.img),
527
+ onError: function onError(e) {
528
+ return e.target.src = '/productDefault.png';
529
+ },
530
+ style: {
531
+ width: '80px',
532
+ height: '80px'
533
+ }
534
+ }), /*#__PURE__*/_react["default"].createElement("div", {
535
+ style: {
536
+ display: 'inline-block'
537
+ }
538
+ }, /*#__PURE__*/_react["default"].createElement("span", {
539
+ style: {
540
+ display: 'block',
541
+ whiteSpace: 'nowrap',
542
+ overflow: 'hidden',
543
+ textOverflow: 'ellipsis',
544
+ width: '100px'
545
+ },
546
+ onClick: _this.onImgTileClick(col, record, index)
547
+ }, value.title), _helper["default"].isEmpty2(value.remark) ? null : /*#__PURE__*/_react["default"].createElement("span", {
548
+ style: {
549
+ display: 'block',
550
+ whiteSpace: 'nowrap',
551
+ overflow: 'hidden',
552
+ textOverflow: 'ellipsis',
553
+ width: '100px',
554
+ color: '#333'
555
+ }
556
+ }, value.remark))) : /*#__PURE__*/_react["default"].createElement("div", null);
557
+ case 'uploadImg':
558
+ var commonProps = _this.props.callback.buildSuperUploadProps ? _this.props.callback.buildSuperUploadProps() : {};
559
+ var uploadProps = _objectSpread(_objectSpread(_objectSpread(_objectSpread({
560
+ onFileChange: _this.props.callback.onTableFileChange ? (0, _bind["default"])(_context10 = _this.props.callback.onTableFileChange).call(_context10, null, col.key, index) : undefined,
561
+ type: col.type
562
+ }, col.props), _this.props), commonProps), {}, {
563
+ value: _this.props.items[index][col.key]
564
+ });
565
+ return /*#__PURE__*/_react["default"].createElement(_Control["default"], uploadProps);
566
+ case 'double':
567
+ return _this.renderDoubleEditableCell(_objectSpread(_objectSpread({}, col), {}, {
568
+ type: realType
569
+ }), value, record.key);
570
+ default:
571
+ return _this.renderEditableCell(_objectSpread(_objectSpread({}, col), {}, {
572
+ type: realType
573
+ }), value, record.key);
574
+ }
575
+ };
576
+ });
577
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getCheckedStatus", function (key) {
578
+ var has = false,
579
+ not = false;
580
+ var items = _this.props.items;
581
+ var _iterator = _createForOfIteratorHelper(items),
582
+ _step;
583
+ try {
584
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
585
+ var item = _step.value;
586
+ item[key] ? has = true : not = true;
587
+ }
588
+ } catch (err) {
589
+ _iterator.e(err);
590
+ } finally {
591
+ _iterator.f();
592
+ }
593
+ return {
594
+ checked: has && !not,
595
+ indeterminate: has && not
596
+ };
597
+ });
598
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "toAdd", function (key, showAdd) {
599
+ if (showAdd) {
600
+ var onClick = _this.onAdd(key);
601
+ return /*#__PURE__*/_react["default"].createElement(_icon["default"], {
602
+ type: "plus-circle-o",
603
+ role: "add",
604
+ onClick: onClick
605
+ });
606
+ } else {
607
+ return null;
608
+ }
609
+ });
610
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getColumnTitle", function (_ref15) {
611
+ var required = _ref15.required,
612
+ title = _ref15.title,
613
+ type = _ref15.type,
614
+ key = _ref15.key,
615
+ showAdd = _ref15.showAdd;
616
+ if (type === 'checkbox') {
617
+ var status = _this.getCheckedStatus(key);
618
+ return /*#__PURE__*/_react["default"].createElement(_checkbox["default"], (0, _extends2["default"])({
619
+ onChange: _this.onCheck(key, -1)
620
+ }, status));
621
+ } else {
622
+ var className = required ? 'ant-form-item-required' : '';
623
+ return /*#__PURE__*/_react["default"].createElement("span", {
624
+ className: className
625
+ }, title, _this.toAdd(key, showAdd));
626
+ }
627
+ });
628
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getColumnClassName", function (_ref16) {
629
+ var type = _ref16.type,
630
+ align = _ref16.align;
631
+ if (type === 'index' || type === 'checkbox') {
632
+ return 'ant-table-selection-column';
633
+ } else {
634
+ return align ? (0, _variables["default"])('SuperTable2')[align] : '';
635
+ }
636
+ });
637
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "canReadonly", function (type) {
638
+ var _context11;
639
+ return !(0, _includes["default"])(_context11 = ['index', 'checkbox', 'link', 'button', 'switch', 'custom', 'img', 'toolbar', 'uploadImg', 'double']).call(_context11, type);
640
+ });
641
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getColumns", function (cols) {
642
+ var _context12;
643
+ var readonly = _this.props.readonly;
644
+ return (0, _map["default"])(_context12 = (0, _filter["default"])(cols).call(cols, function (col) {
645
+ return !col.hide;
646
+ })).call(_context12, function (_ref17, index) {
647
+ var _context13;
648
+ var col = (0, _extends2["default"])({}, ((0, _objectDestructuringEmpty2["default"])(_ref17), _ref17));
649
+ col.className = _this.getColumnClassName(col);
650
+ col.title = _this.getColumnTitle(col);
651
+ col.dataIndex = col.key;
652
+ col.width = col.width ? col.width : (0, _includes["default"])(_context13 = ['index', 'checked']).call(_context13, col.key) ? 70 : col.type === 'img' ? 200 : 120;
653
+ // const {props = {}} =
654
+ // const {edit = false} = props
655
+ // if (!(readonly || col.type === 'readonly') || !this.canReadonly(col.type)) {
656
+ // if ( !edit && ['text', 'number', 'select', 'date', 'search', 'readonly', 'textArea', 'selectSearch'].includes(col.type)){
657
+ // return col
658
+ // }
659
+ // }
660
+ col.readonly = readonly;
661
+ col.render = _this.getCellRender(col);
662
+ if (col.link) {
663
+ col.type = 'link';
664
+ col.render = _this.getCellRender(col);
665
+ } else if (col.showPrice || col.decimalPlaces) {
666
+ col.render = function (text, record, index) {
667
+ if (col.showPrice && text) {
668
+ text = _helper["default"].toThousands(text, col.decimalPlaces ? col.decimalPlaces : 2);
669
+ return "\uFFE5".concat(text);
670
+ } else {
671
+ return text ? "\uFFE5".concat(text.toFixed(2)) : text;
672
+ }
673
+ };
674
+ }
675
+ return col;
676
+ });
677
+ });
678
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getText", function (value, options) {
679
+ if ((0, _isArray["default"])(value)) {
680
+ return (0, _map["default"])(value).call(value, function (v) {
681
+ return (0, _Control.getTitle)(v, options);
682
+ }).toString();
683
+ } else {
684
+ return (0, _Control.getTitle)(value, options);
685
+ }
686
+ });
687
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getDataSource", function (items, cols) {
688
+ return (0, _map["default"])(items).call(items, function (item, index) {
689
+ return (0, _reduce["default"])(cols).call(cols, function (result, _ref18) {
690
+ var _context14, _context15;
691
+ var key = _ref18.key,
692
+ type = _ref18.type,
693
+ options = _ref18.options;
694
+ if (!_this.props.readonly && type && type !== 'readonly' && (!item.isReadonly || (0, _isArray["default"])(item.isReadonly) && !(0, _includes["default"])(_context14 = item.isReadonly).call(_context14, key)) || (0, _includes["default"])(_context15 = ['img', 'switch', 'custom', 'img', 'toolbar', 'uploadImg']).call(_context15, type)) {
695
+ result[key] = item[key];
696
+ } else {
697
+ result[key] = _this.getText(item[key], options);
698
+ }
699
+ return result;
700
+ }, _objectSpread(_objectSpread({}, item), {}, {
701
+ key: index,
702
+ disabled: item.isCanConfigHide
703
+ }));
704
+ });
705
+ });
706
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getPropsByCheckbox", function () {
707
+ var _this$props2 = _this.props,
708
+ items = _this$props2.items,
709
+ _this$props2$isEmphas = _this$props2.isEmphasized,
710
+ isEmphasized = _this$props2$isEmphas === void 0 ? false : _this$props2$isEmphas;
711
+ var rowClassName = function rowClassName(record) {
712
+ if (isEmphasized && items[record.key].__isEmphasized) {
713
+ return items[record.key].checked ? (0, _variables["default"])('SuperTable2').emphasizedSelectRow : (0, _variables["default"])('SuperTable2').emphasizedUnselectRow;
714
+ }
715
+ return items[record.key].checked ? (0, _variables["default"])('SuperTable2').select : '';
716
+ };
717
+ return {
718
+ rowClassName: rowClassName
719
+ };
720
+ });
721
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getSelectedRowKeys", function (items) {
722
+ return (0, _reduce["default"])(items).call(items, function (result, item, index) {
723
+ item.checked && result.push(index);
724
+ return result;
725
+ }, []);
726
+ });
727
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getPropsByCheckbox2", function (items) {
728
+ var _this$props3 = _this.props,
729
+ _this$props3$checkbox = _this$props3.checkbox,
730
+ checkbox = _this$props3$checkbox === void 0 ? true : _this$props3$checkbox,
731
+ _this$props3$radio = _this$props3.radio,
732
+ radio = _this$props3$radio === void 0 ? false : _this$props3$radio,
733
+ isolation = _this$props3.isolation,
734
+ _this$props3$checkedR = _this$props3.checkedRows,
735
+ checkedRows = _this$props3$checkedR === void 0 ? [] : _this$props3$checkedR,
736
+ _this$props3$isEmphas = _this$props3.isEmphasized,
737
+ isEmphasized = _this$props3$isEmphas === void 0 ? false : _this$props3$isEmphas,
738
+ _this$props3$isWeaken = _this$props3.isWeaken,
739
+ isWeaken = _this$props3$isWeaken === void 0 ? true : _this$props3$isWeaken;
740
+ var rowClassName1 = function rowClassName1(record) {
741
+ if (items[record.key].__total) return (0, _variables["default"])('SuperTable').totalRow;
742
+ if (items[record.key].__warningRow) return (0, _variables["default"])('SuperTable').warningRow;
743
+ return (0, _includes["default"])(checkedRows).call(checkedRows, record.key) ? (0, _variables["default"])('SuperTable').select : '';
744
+ };
745
+ var rowClassName2 = function rowClassName2(record) {
746
+ if (items[record.key].__total) return (0, _variables["default"])('SuperTable').totalRow;
747
+ if (items[record.key].__warningRow) return (0, _variables["default"])('SuperTable').warningRow;
748
+ if (isEmphasized && items[record.key].__isEmphasized) {
749
+ return items[record.key].checked ? (0, _variables["default"])('SuperTable').emphasizedSelectRow : (0, _variables["default"])('SuperTable').emphasizedUnselectRow;
750
+ }
751
+ if (isWeaken && items[record.key].__isWeaken) {
752
+ return items[record.key].checked ? (0, _variables["default"])('SuperTable').weakenedSelectRow : (0, _variables["default"])('SuperTable').weakenedUnselectRow;
753
+ }
754
+ return items[record.key].checked ? (0, _variables["default"])('SuperTable').select : '';
755
+ };
756
+ if (checkbox) {
757
+ if (radio) {
758
+ return {
759
+ rowClassName: rowClassName1,
760
+ onRowClick: _this.onRadioRowClick,
761
+ rowSelection: {
762
+ type: 'radio',
763
+ selectedRowKeys: checkedRows,
764
+ onChange: _this.onRadioChange
765
+ }
766
+ };
767
+ } else if (isolation) {
768
+ return {
769
+ rowClassName: rowClassName1,
770
+ onRowClick: _this.onRowClick,
771
+ rowSelection: {
772
+ selectedRowKeys: checkedRows,
773
+ onChange: _this.onCheckChange,
774
+ getCheckboxProps: function getCheckboxProps(record) {
775
+ var checked = (0, _includes["default"])(checkedRows).call(checkedRows, record.key);
776
+ return {
777
+ checked: checked,
778
+ disabled: items[record.key].__isWeaken,
779
+ style: items[record.key].__total ? {
780
+ display: 'none'
781
+ } : {}
782
+ };
783
+ }
784
+ }
785
+ };
786
+ } else {
787
+ return {
788
+ rowClassName: rowClassName2,
789
+ onRowClick: _this.onRowClick,
790
+ rowSelection: {
791
+ selectedRowKeys: _this.getSelectedRowKeys(items),
792
+ onChange: _this.onChange,
793
+ getCheckboxProps: function getCheckboxProps(record) {
794
+ var checked = isWeaken && items[record.key].__isWeaken ? false : !!record.checked;
795
+ return {
796
+ checked: checked,
797
+ disabled: items[record.key].__isWeaken,
798
+ style: items[record.key].__total ? {
799
+ display: 'none'
800
+ } : {}
801
+ };
802
+ }
803
+ }
804
+ };
805
+ }
806
+ } else {
807
+ return {
808
+ rowClassName: rowClassName2
809
+ };
810
+ }
811
+ });
812
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getRowPropsForDrag", function () {
813
+ return function (record, index) {
814
+ return {
815
+ index: index,
816
+ onMoveRow: _this.onMoveRow
817
+ };
818
+ };
819
+ });
820
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getRowProps", function (onRowClick) {
821
+ return function (record) {
822
+ return {
823
+ onClick: function onClick() {
824
+ return onRowClick && onRowClick(record);
825
+ },
826
+ onDoubleClick: function onDoubleClick() {
827
+ return _this.onDoubleClick(record);
828
+ }
829
+ };
830
+ };
831
+ });
832
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getProps", function () {
833
+ var _context16;
834
+ var _this$props4 = _this.props,
835
+ cols = _this$props4.cols,
836
+ items = _this$props4.items,
837
+ _this$props4$style = _this$props4.style,
838
+ style = _this$props4$style === void 0 ? {} : _this$props4$style,
839
+ _this$props4$footer = _this$props4.footer,
840
+ footer = _this$props4$footer === void 0 ? null : _this$props4$footer,
841
+ _this$props4$paginati = _this$props4.pagination,
842
+ pagination = _this$props4$paginati === void 0 ? false : _this$props4$paginati,
843
+ dragSort = _this$props4.dragSort,
844
+ _this$props4$isEmphas = _this$props4.isEmphasized,
845
+ isEmphasized = _this$props4$isEmphas === void 0 ? false : _this$props4$isEmphas,
846
+ maxHeight = _this$props4.maxHeight,
847
+ _this$props4$expanded = _this$props4.expandedRowRender,
848
+ expandedRowRender = _this$props4$expanded === void 0 ? undefined : _this$props4$expanded,
849
+ _this$props4$onExpand = _this$props4.onExpand,
850
+ onExpand = _this$props4$onExpand === void 0 ? undefined : _this$props4$onExpand;
851
+ var widthX = (0, _reduce["default"])(_context16 = (0, _filter["default"])(cols).call(cols, function (col) {
852
+ return !col.hide;
853
+ })).call(_context16, function (width, item) {
854
+ var _context17;
855
+ return width += item.width ? item.width : (0, _includes["default"])(_context17 = ['index', 'checked']).call(_context17, item.key) ? 70 : item.type === 'img' ? 200 : 120;
856
+ }, 0);
857
+ var scrollProps = !_helper["default"].isEmpty2(expandedRowRender) ? {
858
+ expandedRowRender: expandedRowRender
859
+ } : {
860
+ scroll: {
861
+ x: (0, _some["default"])(cols).call(cols, function (item) {
862
+ return !_helper["default"].isEmpty2(item.fixed);
863
+ }) ? widthX : true,
864
+ y: maxHeight
865
+ }
866
+ };
867
+ var _this$getPropsByCheck = _this.getPropsByCheckbox2(items),
868
+ onRowClick = _this$getPropsByCheck.onRowClick,
869
+ extraProps = (0, _objectWithoutProperties2["default"])(_this$getPropsByCheck, _excluded);
870
+ return _objectSpread(_objectSpread({
871
+ className: !isEmphasized ? (0, _variables["default"])('SuperTable2') : (0, _variables["default"])('SuperTable2').noTransition,
872
+ columns: _this.getColumns(cols),
873
+ dataSource: _this.getDataSource(items, cols),
874
+ style: (0, _assign["default"])({}, {
875
+ whiteSpace: 'nowrap'
876
+ }, style),
877
+ size: 'small',
878
+ pagination: pagination,
879
+ footer: footer,
880
+ onRow: dragSort ? _this.getRowPropsForDrag() : _this.getRowProps(onRowClick),
881
+ components: dragSort ? {
882
+ body: {
883
+ row: _DragSortRow["default"]
884
+ }
885
+ } : {},
886
+ locale: _this.props.emptyText ? {
887
+ emptyText: _this.props.emptyText
888
+ } : null
889
+ }, _this.getPropsByCheckbox()), {}, {
890
+ onExpand: onExpand
891
+ }, scrollProps);
892
+ });
893
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "setScroll", function () {
894
+ if (_this.props.maxHeight && _this.props.items.length) {
895
+ var root = _reactDom["default"].findDOMNode((0, _assertThisInitialized2["default"])(_this));
896
+ var container = root.getElementsByClassName('ant-table-body')[0];
897
+ var header = root.getElementsByClassName('ant-table-thead')[0];
898
+ (0, _fixed["default"])(container, header, _this.props.maxHeight);
899
+ }
900
+ });
901
+ return _this;
902
+ }
903
+ (0, _createClass2["default"])(SuperTable2, [{
904
+ key: "componentDidMount",
905
+ value: function componentDidMount() {
906
+ this.setScroll();
907
+ }
908
+ }, {
909
+ key: "componentDidUpdate",
910
+ value: function componentDidUpdate() {
911
+ this.setScroll();
912
+ }
913
+ }, {
914
+ key: "render",
915
+ value: function render() {
916
+ this.error = false;
917
+ return /*#__PURE__*/_react["default"].createElement(_table["default"], (0, _extends2["default"])({}, this.getProps(), {
918
+ key: this.props.items.length
919
+ }));
920
+ }
921
+ }]);
922
+ return SuperTable2;
923
+ }(_react["default"].Component);
924
+ (0, _defineProperty2["default"])(SuperTable2, "propTypes", {
925
+ cols: _propTypes["default"].arrayOf(_propTypes["default"].shape(ColType)).isRequired,
926
+ items: _propTypes["default"].array.isRequired,
927
+ base: _propTypes["default"].number,
928
+ options: _propTypes["default"].object,
929
+ valid: _propTypes["default"].bool,
930
+ readonly: _propTypes["default"].bool,
931
+ style: _propTypes["default"].object,
932
+ maxHeight: _propTypes["default"].string,
933
+ emptyText: _propTypes["default"].string,
934
+ footer: _propTypes["default"].func,
935
+ callback: _propTypes["default"].shape(CallbackType),
936
+ isEmphasized: _propTypes["default"].bool,
937
+ dragSort: _propTypes["default"].bool
938
+ });
939
+ var _default = exports["default"] = SuperTable2;