cloud-b2b 1.1.52 → 1.1.54

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 (307) 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 +108 -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/Sidebar/Sidebar.js +144 -0
  29. package/es/Sidebar2/Sidebar.js +165 -0
  30. package/es/SuperForm/SuperForm.js +598 -0
  31. package/es/SuperForm2/SuperForm.js +687 -0
  32. package/es/SuperIcon/SuperIcon.js +27 -0
  33. package/es/SuperPagination/SuperPagination.js +109 -0
  34. package/es/SuperTab/SuperTab.js +107 -0
  35. package/es/SuperTab2/SuperTab2.js +145 -0
  36. package/es/SuperTable/DragSortRow.js +97 -0
  37. package/es/SuperTable/FilterDropDown.js +164 -0
  38. package/es/SuperTable/SuperTable.js +808 -0
  39. package/es/SuperTable/fixed.js +34 -0
  40. package/es/SuperTable2/SuperTable2.js +894 -0
  41. package/es/SuperTable2/SuperTableCell.js +198 -0
  42. package/es/SuperTable3/FilterDropDown.js +164 -0
  43. package/es/SuperTable3/SuperTable.js +665 -0
  44. package/es/SuperTable3/fixed.js +34 -0
  45. package/es/SuperToolbar/SuperToolbar.js +195 -0
  46. package/es/SuperUpload/SuperUpload.js +356 -0
  47. package/es/Title/Title.js +33 -0
  48. package/es/Viewer/ImageViews.js +258 -0
  49. package/es/Viewer/Viewer.js +122 -0
  50. package/es/WingBlank/WingBlank.js +16 -0
  51. package/es/helper.js +240 -0
  52. package/{src → es}/history.js +6 -6
  53. package/es/index.js +37 -0
  54. package/es/variables.js +6 -0
  55. package/lib/Area/Area.js +149 -0
  56. package/lib/Area/package.json +6 -0
  57. package/lib/Card/Card.js +27 -0
  58. package/lib/Card/package.json +6 -0
  59. package/lib/CodeInput/CodeInput.js +131 -0
  60. package/lib/CodeInput/package.json +6 -0
  61. package/lib/Control/Control.js +450 -0
  62. package/lib/Control/event.js +51 -0
  63. package/lib/Control/package.json +6 -0
  64. package/lib/Enhance/Dialogs.js +60 -0
  65. package/lib/Enhance/Loading.js +138 -0
  66. package/lib/Enhance/index.js +25 -0
  67. package/lib/Enhance/package.json +6 -0
  68. package/lib/Header/Header.js +169 -0
  69. package/lib/Header/Header.less +95 -0
  70. package/lib/Header/Vertical.js +114 -0
  71. package/lib/Header/Vertical.less +60 -0
  72. package/lib/Header/package.json +6 -0
  73. package/lib/ImageView/ImageView.js +108 -0
  74. package/lib/ImageView/ImageView.less +14 -0
  75. package/lib/ImageView/package.json +6 -0
  76. package/lib/Indent/Indent.js +27 -0
  77. package/lib/Indent/package.json +6 -0
  78. package/lib/InpurCascader/InputCascader.js +115 -0
  79. package/lib/InpurCascader/package.json +6 -0
  80. package/lib/InputEditor/InputEditor.js +181 -0
  81. package/lib/InputEditor/inputEditor.less +8 -0
  82. package/lib/InputEditor/package.json +6 -0
  83. package/lib/InputSearch/InputSearch.js +274 -0
  84. package/lib/InputSearch/package.json +6 -0
  85. package/lib/InputSelect/InputSelect.js +168 -0
  86. package/lib/InputSelect/package.json +6 -0
  87. package/lib/InputTreeSelect/InputTreeSelect.js +128 -0
  88. package/lib/InputTreeSelect/package.json +6 -0
  89. package/lib/InputWriting/InputWriting.js +93 -0
  90. package/lib/InputWriting/package.json +6 -0
  91. package/lib/Layout/Layout.js +209 -0
  92. package/lib/Layout/Layout.less +28 -0
  93. package/lib/Layout/package.json +6 -0
  94. package/lib/LayoutLink/LayoutLink.js +86 -0
  95. package/lib/LayoutLink/LayoutLink.less +53 -0
  96. package/lib/LayoutLink/package.json +6 -0
  97. package/lib/Link/Link.js +93 -0
  98. package/lib/Link/package.json +6 -0
  99. package/lib/Loading/Loading.js +21 -0
  100. package/lib/Loading/Loading.less +13 -0
  101. package/lib/Loading/package.json +6 -0
  102. package/lib/Loading2/Loading2.js +17 -0
  103. package/lib/Loading2/Loading2.less +19 -0
  104. package/lib/Loading2/package.json +6 -0
  105. package/lib/ModalWithDrag/ModalWithDrag.js +37 -0
  106. package/lib/ModalWithDrag/ModalWithDrag.less +6 -0
  107. package/lib/ModalWithDrag/drag.js +124 -0
  108. package/lib/ModalWithDrag/package.json +6 -0
  109. package/lib/NumberInput/NumberInput.js +208 -0
  110. package/lib/NumberInput/package.json +6 -0
  111. package/lib/Search/Search.js +510 -0
  112. package/lib/Search/Search.less +63 -0
  113. package/lib/Search/package.json +6 -0
  114. package/lib/Sidebar/Sidebar.js +152 -0
  115. package/lib/Sidebar/Sidebar.less +78 -0
  116. package/lib/Sidebar/package.json +6 -0
  117. package/lib/Sidebar2/Sidebar.js +173 -0
  118. package/lib/Sidebar2/Sidebar.less +153 -0
  119. package/lib/Sidebar2/package.json +6 -0
  120. package/lib/SuperForm/SuperForm.js +610 -0
  121. package/lib/SuperForm/SuperForm.less +52 -0
  122. package/lib/SuperForm/package.json +6 -0
  123. package/lib/SuperForm2/SuperForm.js +699 -0
  124. package/lib/SuperForm2/SuperForm.less +52 -0
  125. package/lib/SuperForm2/package.json +6 -0
  126. package/lib/SuperIcon/SuperIcon.js +35 -0
  127. package/lib/SuperIcon/package.json +6 -0
  128. package/lib/SuperPagination/SuperPagination.js +117 -0
  129. package/lib/SuperPagination/package.json +6 -0
  130. package/lib/SuperTab/SuperTab.js +115 -0
  131. package/lib/SuperTab/SuperTab.less +43 -0
  132. package/lib/SuperTab/package.json +6 -0
  133. package/lib/SuperTab2/SuperTab2.js +153 -0
  134. package/lib/SuperTab2/SuperTab2.less +18 -0
  135. package/lib/SuperTab2/package.json +6 -0
  136. package/lib/SuperTable/DragSortRow.js +105 -0
  137. package/lib/SuperTable/DragSortRow.less +17 -0
  138. package/lib/SuperTable/FilterDropDown.js +172 -0
  139. package/lib/SuperTable/FilterDropDown.less +30 -0
  140. package/lib/SuperTable/SuperTable.js +816 -0
  141. package/lib/SuperTable/SuperTable.less +132 -0
  142. package/lib/SuperTable/fixed.js +42 -0
  143. package/lib/SuperTable/package.json +6 -0
  144. package/lib/SuperTable2/SuperTable2.js +907 -0
  145. package/lib/SuperTable2/SuperTable2.less +118 -0
  146. package/lib/SuperTable2/SuperTableCell.js +203 -0
  147. package/lib/SuperTable2/package.json +6 -0
  148. package/lib/SuperTable3/FilterDropDown.js +172 -0
  149. package/lib/SuperTable3/FilterDropDown.less +29 -0
  150. package/lib/SuperTable3/SuperTable.js +673 -0
  151. package/lib/SuperTable3/SuperTable.less +99 -0
  152. package/lib/SuperTable3/fixed.js +42 -0
  153. package/lib/SuperTable3/package.json +6 -0
  154. package/lib/SuperToolbar/SuperToolbar.js +203 -0
  155. package/lib/SuperToolbar/SuperToolbar.less +17 -0
  156. package/lib/SuperToolbar/package.json +6 -0
  157. package/lib/SuperUpload/SuperUpload.js +368 -0
  158. package/lib/SuperUpload/SuperUpload.less +28 -0
  159. package/lib/SuperUpload/package.json +6 -0
  160. package/lib/Title/Title.js +41 -0
  161. package/lib/Title/Title.less +35 -0
  162. package/lib/Title/package.json +6 -0
  163. package/lib/Viewer/ImageViews.js +266 -0
  164. package/lib/Viewer/Viewer.js +130 -0
  165. package/lib/Viewer/Viewer.less +67 -0
  166. package/lib/Viewer/imgView.less +59 -0
  167. package/lib/Viewer/package.json +7 -0
  168. package/lib/WingBlank/WingBlank.js +24 -0
  169. package/lib/WingBlank/WingBlank.less +12 -0
  170. package/lib/WingBlank/package.json +6 -0
  171. package/lib/adjust.less +89 -0
  172. package/lib/helper.js +246 -0
  173. package/lib/history.js +12 -0
  174. package/lib/index.js +271 -0
  175. package/lib/index.less +31 -0
  176. package/lib/style.less +30 -0
  177. package/lib/variables.js +14 -0
  178. package/lib/variables.less +73 -0
  179. package/package.json +22 -44
  180. package/src/Area/Area.js +0 -94
  181. package/src/Card/Card.js +0 -16
  182. package/src/CodeInput/CodeInput.js +0 -76
  183. package/src/Control/Control.js +0 -338
  184. package/src/Control/event.js +0 -45
  185. package/src/Enhance/Dialogs.js +0 -24
  186. package/src/Enhance/Loading.js +0 -83
  187. package/src/Header/Header.js +0 -149
  188. package/src/Header/Vertical.js +0 -74
  189. package/src/ImageView/ImageView.js +0 -62
  190. package/src/Indent/Indent.js +0 -12
  191. package/src/InpurCascader/InputCascader.js +0 -83
  192. package/src/InputEditor/InputEditor.js +0 -93
  193. package/src/InputSearch/InputSearch.js +0 -186
  194. package/src/InputSelect/InputSelect.js +0 -103
  195. package/src/InputTreeSelect/InputTreeSelect.js +0 -87
  196. package/src/InputWriting/InputWriting.js +0 -65
  197. package/src/Layout/Layout.js +0 -121
  198. package/src/LayoutLink/LayoutLink.js +0 -59
  199. package/src/Link/Link.js +0 -57
  200. package/src/Loading/Loading.js +0 -15
  201. package/src/Loading2/Loading2.js +0 -15
  202. package/src/ModalWithDrag/ModalWithDrag.js +0 -17
  203. package/src/NumberInput/NumberInput.js +0 -137
  204. package/src/Search/Search.js +0 -368
  205. package/src/Sidebar/Sidebar.js +0 -111
  206. package/src/Sidebar2/Sidebar.js +0 -143
  207. package/src/SuperForm/SuperForm.js +0 -516
  208. package/src/SuperForm2/SuperForm.js +0 -588
  209. package/src/SuperIcon/SuperIcon.js +0 -14
  210. package/src/SuperPagination/SuperPagination.js +0 -65
  211. package/src/SuperTab/SuperTab.js +0 -84
  212. package/src/SuperTab2/SuperTab2.js +0 -94
  213. package/src/SuperTable/DragSortRow.js +0 -62
  214. package/src/SuperTable/FilterDropDown.js +0 -111
  215. package/src/SuperTable/SuperTable.js +0 -590
  216. package/src/SuperTable/fixed.js +0 -34
  217. package/src/SuperTable2/SuperTable2.js +0 -600
  218. package/src/SuperTable2/SuperTableCell.js +0 -144
  219. package/src/SuperTable3/FilterDropDown.js +0 -111
  220. package/src/SuperTable3/SuperTable.js +0 -498
  221. package/src/SuperTable3/fixed.js +0 -34
  222. package/src/SuperToolbar/SuperToolbar.js +0 -128
  223. package/src/SuperUpload/SuperUpload.js +0 -137
  224. package/src/Title/Title.js +0 -18
  225. package/src/Viewer/ImageViews.js +0 -220
  226. package/src/Viewer/Viewer.js +0 -97
  227. package/src/WingBlank/WingBlank.js +0 -14
  228. package/src/helper.js +0 -185
  229. package/src/index.js +0 -38
  230. package/src/variables.js +0 -5
  231. package/test/index.html +0 -10
  232. package/test/test.js +0 -16
  233. package/test/test.less +0 -12
  234. package/test/webpack.config.js +0 -71
  235. package/tools/babel.config.js +0 -14
  236. package/tools/build.js +0 -70
  237. package/tools/publish.js +0 -9
  238. package/tools/util.js +0 -53
  239. /package/{src → es}/Area/package.json +0 -0
  240. /package/{src → es}/Card/package.json +0 -0
  241. /package/{src → es}/CodeInput/package.json +0 -0
  242. /package/{src → es}/Control/package.json +0 -0
  243. /package/{src → es}/Enhance/package.json +0 -0
  244. /package/{src → es}/Header/Header.less +0 -0
  245. /package/{src → es}/Header/Vertical.less +0 -0
  246. /package/{src → es}/Header/package.json +0 -0
  247. /package/{src → es}/ImageView/ImageView.less +0 -0
  248. /package/{src → es}/ImageView/package.json +0 -0
  249. /package/{src → es}/Indent/package.json +0 -0
  250. /package/{src → es}/InpurCascader/package.json +0 -0
  251. /package/{src → es}/InputEditor/inputEditor.less +0 -0
  252. /package/{src → es}/InputEditor/package.json +0 -0
  253. /package/{src → es}/InputSearch/package.json +0 -0
  254. /package/{src → es}/InputSelect/package.json +0 -0
  255. /package/{src → es}/InputTreeSelect/package.json +0 -0
  256. /package/{src → es}/InputWriting/package.json +0 -0
  257. /package/{src → es}/Layout/Layout.less +0 -0
  258. /package/{src → es}/Layout/package.json +0 -0
  259. /package/{src → es}/LayoutLink/LayoutLink.less +0 -0
  260. /package/{src → es}/LayoutLink/package.json +0 -0
  261. /package/{src → es}/Link/package.json +0 -0
  262. /package/{src → es}/Loading/Loading.less +0 -0
  263. /package/{src → es}/Loading/package.json +0 -0
  264. /package/{src → es}/Loading2/Loading2.less +0 -0
  265. /package/{src → es}/Loading2/package.json +0 -0
  266. /package/{src → es}/ModalWithDrag/ModalWithDrag.less +0 -0
  267. /package/{src → es}/ModalWithDrag/package.json +0 -0
  268. /package/{src → es}/NumberInput/package.json +0 -0
  269. /package/{src → es}/Search/Search.less +0 -0
  270. /package/{src → es}/Search/package.json +0 -0
  271. /package/{src → es}/Sidebar/Sidebar.less +0 -0
  272. /package/{src → es}/Sidebar/package.json +0 -0
  273. /package/{src → es}/Sidebar2/Sidebar.less +0 -0
  274. /package/{src → es}/Sidebar2/package.json +0 -0
  275. /package/{src → es}/SuperForm/SuperForm.less +0 -0
  276. /package/{src → es}/SuperForm/package.json +0 -0
  277. /package/{src → es}/SuperForm2/SuperForm.less +0 -0
  278. /package/{src → es}/SuperForm2/package.json +0 -0
  279. /package/{src → es}/SuperIcon/package.json +0 -0
  280. /package/{src → es}/SuperPagination/package.json +0 -0
  281. /package/{src → es}/SuperTab/SuperTab.less +0 -0
  282. /package/{src → es}/SuperTab/package.json +0 -0
  283. /package/{src → es}/SuperTab2/SuperTab2.less +0 -0
  284. /package/{src → es}/SuperTab2/package.json +0 -0
  285. /package/{src → es}/SuperTable/DragSortRow.less +0 -0
  286. /package/{src → es}/SuperTable/FilterDropDown.less +0 -0
  287. /package/{src → es}/SuperTable/SuperTable.less +0 -0
  288. /package/{src → es}/SuperTable/package.json +0 -0
  289. /package/{src → es}/SuperTable2/SuperTable2.less +0 -0
  290. /package/{src → es}/SuperTable2/package.json +0 -0
  291. /package/{src → es}/SuperTable3/FilterDropDown.less +0 -0
  292. /package/{src → es}/SuperTable3/SuperTable.less +0 -0
  293. /package/{src → es}/SuperTable3/package.json +0 -0
  294. /package/{src → es}/SuperToolbar/SuperToolbar.less +0 -0
  295. /package/{src → es}/SuperToolbar/package.json +0 -0
  296. /package/{src → es}/SuperUpload/SuperUpload.less +0 -0
  297. /package/{src → es}/SuperUpload/package.json +0 -0
  298. /package/{src → es}/Title/Title.less +0 -0
  299. /package/{src → es}/Title/package.json +0 -0
  300. /package/{src → es}/Viewer/Viewer.less +0 -0
  301. /package/{src → es}/Viewer/imgView.less +0 -0
  302. /package/{src → es}/Viewer/package.json +0 -0
  303. /package/{src → es}/WingBlank/WingBlank.less +0 -0
  304. /package/{src → es}/WingBlank/package.json +0 -0
  305. /package/{src → es}/adjust.less +0 -0
  306. /package/{src → es}/style.less +0 -0
  307. /package/{src → es}/variables.less +0 -0
@@ -0,0 +1,816 @@
1
+ "use strict";
2
+
3
+ var _Reflect$construct = require("@babel/runtime-corejs3/core-js-stable/reflect/construct");
4
+ var _Object$keys = require("@babel/runtime-corejs3/core-js-stable/object/keys");
5
+ var _Object$getOwnPropertySymbols = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols");
6
+ var _filterInstanceProperty2 = require("@babel/runtime-corejs3/core-js-stable/instance/filter");
7
+ var _Object$getOwnPropertyDescriptor = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor");
8
+ var _forEachInstanceProperty2 = require("@babel/runtime-corejs3/core-js-stable/instance/for-each");
9
+ var _Object$getOwnPropertyDescriptors = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors");
10
+ var _Object$defineProperties = require("@babel/runtime-corejs3/core-js-stable/object/define-properties");
11
+ var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
12
+ var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
13
+ _Object$defineProperty(exports, "__esModule", {
14
+ value: true
15
+ });
16
+ exports["default"] = void 0;
17
+ var _table = _interopRequireDefault(require("antd/lib/table"));
18
+ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/objectWithoutProperties"));
19
+ var _concat = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/concat"));
20
+ var _slice = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/slice"));
21
+ var _filter = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/filter"));
22
+ var _every = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/every"));
23
+ var _findIndex = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/find-index"));
24
+ var _some = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/some"));
25
+ var _setTimeout2 = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/set-timeout"));
26
+ var _includes = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/includes"));
27
+ var _reduce = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/reduce"));
28
+ var _assign = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/assign"));
29
+ var _isArray = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/array/is-array"));
30
+ var _map = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/map"));
31
+ var _bind = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/bind"));
32
+ var _forEach = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/for-each"));
33
+ var _parseFloat2 = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/parse-float"));
34
+ var _tooltip = _interopRequireDefault(require("antd/lib/tooltip"));
35
+ var _objectDestructuringEmpty2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/objectDestructuringEmpty"));
36
+ var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/extends"));
37
+ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/classCallCheck"));
38
+ var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/createClass"));
39
+ var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/assertThisInitialized"));
40
+ var _inherits2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/inherits"));
41
+ var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/possibleConstructorReturn"));
42
+ var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/getPrototypeOf"));
43
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/defineProperty"));
44
+ var _react = _interopRequireDefault(require("react"));
45
+ var _propTypes = _interopRequireDefault(require("prop-types"));
46
+ var _reactDom = _interopRequireDefault(require("react-dom"));
47
+ var _Control = require("../Control");
48
+ var _FilterDropDown = _interopRequireDefault(require("./FilterDropDown"));
49
+ var _fixed = _interopRequireDefault(require("./fixed"));
50
+ var _DragSortRow = _interopRequireDefault(require("./DragSortRow"));
51
+ var _variables = _interopRequireDefault(require("../variables"));
52
+ var _excluded = ["onRowClick"];
53
+ 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; }
54
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context9, _context10; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty2(_context9 = ownKeys(Object(t), !0)).call(_context9, function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty2(_context10 = ownKeys(Object(t))).call(_context10, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
55
+ 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); }; }
56
+ 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; } }
57
+ /**
58
+ * sorter: [可选],不传表示该列不支持排序;为string表示按字符串排序;为number表示按数字大小排序
59
+ * filter: [可选],是否支持过滤,默认为false
60
+ * link: [可选],为true表示超链接,内容来至items;为字符串表示超链接,内容就是该字符串;为字符串‘list’表示超链接数组,内容就是该items对应key对象数组的linkTitleKey属性拼接
61
+ * linkTitleKey: [可选],当link为'list'表示超链接组时,该值表示要拼接展示的属性key值
62
+ * isDateFilterByStartAndEnd: [可选],为true时做过滤操作会显示时间段搜索,默认为false
63
+ *
64
+ */
65
+ var ColType = {
66
+ key: _propTypes["default"].string.isRequired,
67
+ title: _propTypes["default"].string,
68
+ align: _propTypes["default"].oneOf(['left', 'center', 'right']),
69
+ sorter: _propTypes["default"].oneOf(['string', 'number']),
70
+ filter: _propTypes["default"].bool,
71
+ hide: _propTypes["default"].bool,
72
+ options: _propTypes["default"].array,
73
+ link: _propTypes["default"].oneOfType([_propTypes["default"].bool, _propTypes["default"].string]),
74
+ linkTitleKey: _propTypes["default"].string,
75
+ noWrap: _propTypes["default"].bool,
76
+ isDateFilterByStartAndEnd: _propTypes["default"].bool
77
+ };
78
+ var ItemType = {
79
+ checked: _propTypes["default"].bool
80
+ };
81
+
82
+ /**
83
+ * onCheck:点击复选框时触发,原型func(isAll, checked, rowIndex);isolation为true时,原型为onCheck(checkedRows)
84
+ * onRadio: 点击单选按钮时触发,原型为func(checkedRows)
85
+ * onDoubleClick: 行双击时触发,原型func(rowIndex)
86
+ * onLink: 点击超链接时触发,原型为func(key, rowIndex, item)
87
+ * onTableChange: 排序信息改变时触发,原型为func(sortInfo, filterInfo)
88
+ * onMoveRow:行拖曳排序时触发,原型为func(dragIndex, targetIndex)
89
+ */
90
+ var CallbackType = {
91
+ onCheck: _propTypes["default"].func,
92
+ onRadio: _propTypes["default"].func,
93
+ onDoubleClick: _propTypes["default"].func,
94
+ onLink: _propTypes["default"].func,
95
+ onTableChange: _propTypes["default"].func,
96
+ onMoveRow: _propTypes["default"].func
97
+ };
98
+
99
+ /**
100
+ * checkbox: [可选],是否有复选框,默认为true
101
+ * isPaging: [可选],是否分页,默认为false
102
+ * radio: [可选],是否为单选按钮,当checkbox为true时生效,默认值为false
103
+ * isolation: [可选],为true时,复选框的选中行采用checkedRows存储
104
+ * checkedRows: [可选],选中的行数,radio为true时生效
105
+ * index: [可选],是否有序号,默认值为true
106
+ * indexTitle:[可选],序号标题,默认为'序号'
107
+ * sortInfo: [可选],排序信息,默认为null
108
+ * filterInfo: [可选],过滤信息,默认为null
109
+ * maxHeight: [可选],设置表格的最大高度
110
+ * dragSort: [可选], 为true表示支持行拖曳排序,且不支持行单击选中复选或单选按钮和双击事件,默认为false
111
+ * isEmphasized: [可选],是否强调,行字体加粗显示;要实现字体加粗显示除了isEmphasized设置为true之外,加粗行数据里要设置__isEmphasized为true
112
+ * isWeaken: [可选],是否弱化行字体置灰显示,除了isWeaken设置为true之外,置灰行数据里要设置__isWeaken为true
113
+ * pageTotal: [可选], 为true表示开启表格末行自动汇总表格列数据,默认为false || searchTotal,当开启时,需要汇总的列需设置属性total为true,当dragSort为true时,该选项失效
114
+ * searchTotal: [可选], 表格汇总数据对象,该属性不为空时pageTotal默认开启,当dragSort为true时,该选项失效
115
+ */
116
+ var SuperTable = /*#__PURE__*/function (_React$Component) {
117
+ (0, _inherits2["default"])(SuperTable, _React$Component);
118
+ var _super = _createSuper(SuperTable);
119
+ function SuperTable() {
120
+ var _context;
121
+ var _this;
122
+ (0, _classCallCheck2["default"])(this, SuperTable);
123
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
124
+ args[_key] = arguments[_key];
125
+ }
126
+ _this = _super.call.apply(_super, (0, _concat["default"])(_context = [this]).call(_context, args));
127
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "state", {
128
+ filterVisibleKey: ''
129
+ });
130
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onTableChange", function (pagination, filters, sorter) {
131
+ var _ref = _this.props.callback || {},
132
+ onTableChange = _ref.onTableChange;
133
+ var _this$props$filterInf = _this.props.filterInfo,
134
+ filterInfo = _this$props$filterInf === void 0 ? null : _this$props$filterInf;
135
+ onTableChange && onTableChange(sorter, filterInfo);
136
+ });
137
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onChange", function () {
138
+ var selectedKeyArr = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
139
+ var _ref2 = _this.props.callback || {},
140
+ onCheck = _ref2.onCheck;
141
+ if (onCheck) {
142
+ var _this$props = _this.props,
143
+ _this$props$items = _this$props.items,
144
+ items = _this$props$items === void 0 ? [] : _this$props$items,
145
+ _this$props$isWeaken = _this$props.isWeaken,
146
+ isWeaken = _this$props$isWeaken === void 0 ? false : _this$props$isWeaken,
147
+ pageTotal = _this$props.pageTotal,
148
+ searchTotal = _this$props.searchTotal;
149
+ var offset = 0;
150
+ pageTotal && offset--;
151
+ searchTotal && offset--;
152
+ var realSlectedList = selectedKeyArr.length > items.length ? (0, _slice["default"])(selectedKeyArr).call(selectedKeyArr, 0, selectedKeyArr.length + offset) : selectedKeyArr;
153
+ var selectedKeys = isWeaken ? (0, _filter["default"])(realSlectedList).call(realSlectedList, function (o) {
154
+ return !items[o].__isWeaken;
155
+ }) : realSlectedList;
156
+ var newItems = isWeaken ? (0, _filter["default"])(items).call(items, function (o) {
157
+ return !o.__isWeaken;
158
+ }) : items;
159
+ if (selectedKeys.length === 0) {
160
+ onCheck(true, false, -1);
161
+ } else if (selectedKeys.length === newItems.length) {
162
+ var checked = (0, _every["default"])(newItems).call(newItems, function (o) {
163
+ return o.checked;
164
+ });
165
+ onCheck(true, !checked, -1);
166
+ } else {
167
+ var defaultSelectedKeys = _this.getSelectedRowKeys(newItems);
168
+ if (selectedKeys.length > defaultSelectedKeys.length) {
169
+ if (_this.props.isPaging && selectedKeys.length - defaultSelectedKeys.length > 1) {
170
+ return onCheck(true, true, -1);
171
+ }
172
+ onCheck(false, true, selectedKeys[selectedKeys.length - 1]);
173
+ } else {
174
+ var index = (0, _findIndex["default"])(defaultSelectedKeys).call(defaultSelectedKeys, function (key) {
175
+ return !(0, _some["default"])(selectedKeys).call(selectedKeys, function (select) {
176
+ return select === key;
177
+ });
178
+ });
179
+ onCheck(false, false, defaultSelectedKeys[index]);
180
+ }
181
+ }
182
+ }
183
+ });
184
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onCheckChange", function (selectedKeys) {
185
+ var _ref3 = _this.props.callback || {},
186
+ onCheck = _ref3.onCheck;
187
+ onCheck && onCheck(selectedKeys);
188
+ });
189
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onRadioChange", function (selectedKeys) {
190
+ var _ref4 = _this.props.callback || {},
191
+ onRadio = _ref4.onRadio;
192
+ onRadio && onRadio(selectedKeys);
193
+ });
194
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onRadioRowClick", function (record) {
195
+ var _ref5 = _this.props.callback || {},
196
+ onRadio = _ref5.onRadio;
197
+ onRadio && onRadio([record.key]);
198
+ });
199
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onRowClick", function (record) {
200
+ var _this$props2 = _this.props,
201
+ _this$props2$isWeaken = _this$props2.isWeaken,
202
+ isWeaken = _this$props2$isWeaken === void 0 ? false : _this$props2$isWeaken,
203
+ items = _this$props2.items;
204
+ if (items.length <= record.key) return;
205
+ clearTimeout(_this.timer);
206
+ _this.timer = (0, _setTimeout2["default"])(function () {
207
+ var _ref6 = _this.props.callback || {},
208
+ onCheck = _ref6.onCheck;
209
+ if (onCheck) {
210
+ var _this$props3 = _this.props,
211
+ isolation = _this$props3.isolation,
212
+ _this$props3$checkedR = _this$props3.checkedRows,
213
+ checkedRows = _this$props3$checkedR === void 0 ? [] : _this$props3$checkedR;
214
+ if (isolation) {
215
+ if ((0, _includes["default"])(checkedRows).call(checkedRows, record.key)) {
216
+ onCheck((0, _filter["default"])(checkedRows).call(checkedRows, function (key) {
217
+ return record.key !== key;
218
+ }));
219
+ } else {
220
+ onCheck((0, _concat["default"])(checkedRows).call(checkedRows, record.key));
221
+ }
222
+ } else {
223
+ var checked = isWeaken && items[record.key].__isWeaken ? false : !record.checked;
224
+ onCheck(false, checked, record.key);
225
+ }
226
+ }
227
+ }, 250);
228
+ });
229
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onDoubleClick", function (record) {
230
+ clearTimeout(_this.timer);
231
+ var _ref7 = _this.props.callback || {},
232
+ onDoubleClick = _ref7.onDoubleClick;
233
+ onDoubleClick && onDoubleClick(record.key);
234
+ });
235
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onLink", function (key, index, item, e) {
236
+ var _ref8 = _this.props.callback || {},
237
+ onLink = _ref8.onLink;
238
+ onLink && onLink(key, index, item);
239
+ e.stopPropagation();
240
+ });
241
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onLinkDouble", function (e) {
242
+ e.stopPropagation();
243
+ });
244
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onMoveRow", function (dragIndex, targetIndex) {
245
+ var _ref9 = _this.props.callback || {},
246
+ onMoveRow = _ref9.onMoveRow;
247
+ onMoveRow && onMoveRow(dragIndex, targetIndex);
248
+ });
249
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getSelectedRowKeys", function (items) {
250
+ return (0, _reduce["default"])(items).call(items, function (result, item, index) {
251
+ item.checked && result.push(index);
252
+ return result;
253
+ }, []);
254
+ });
255
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getIndexInfo", function () {
256
+ var items = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
257
+ var _this$props4 = _this.props,
258
+ _this$props4$index = _this$props4.index,
259
+ index = _this$props4$index === void 0 ? true : _this$props4$index,
260
+ _this$props4$indexTit = _this$props4.indexTitle,
261
+ indexTitle = _this$props4$indexTit === void 0 ? '序号' : _this$props4$indexTit;
262
+ return index ? [{
263
+ key: 'index',
264
+ title: indexTitle,
265
+ render: function render(text, record, index) {
266
+ return items[record.key].__totalIndexTitle || index + 1;
267
+ }
268
+ }] : [];
269
+ });
270
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "setSortInfo", function (col, sortInfo) {
271
+ if (col.sorter === 'string') {
272
+ col.sortOrder = sortInfo.columnKey === col.key && sortInfo.order;
273
+ col.sorter = function (row1, row2) {
274
+ var a = !col.link ? row1[col.key] : row1[col.key].props.children;
275
+ var b = !col.link ? row2[col.key] : row2[col.key].props.children;
276
+ if (a > b) {
277
+ return 1;
278
+ } else if (a === b) {
279
+ return 0;
280
+ } else {
281
+ return -1;
282
+ }
283
+ };
284
+ } else if (col.sorter === 'number') {
285
+ col.sortOrder = sortInfo.columnKey === col.key && sortInfo.order;
286
+ col.sorter = function (a, b) {
287
+ return a[col.key] - b[col.key];
288
+ };
289
+ } else {
290
+ delete col.sorter;
291
+ }
292
+ });
293
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "setFilterInfo", function (col, filterInfo, visibleKey) {
294
+ if ((0, _filter["default"])(col)) {
295
+ var _col$isDateFilterBySt = col.isDateFilterByStartAndEnd,
296
+ isDateFilterByStartAndEnd = _col$isDateFilterBySt === void 0 ? false : _col$isDateFilterBySt;
297
+ var onSearch = function onSearch(value) {
298
+ var _ref10 = _this.props.callback || {},
299
+ onTableChange = _ref10.onTableChange;
300
+ var _this$props$sortInfo = _this.props.sortInfo,
301
+ sortInfo = _this$props$sortInfo === void 0 ? null : _this$props$sortInfo;
302
+ var newFilterInfo = (0, _assign["default"])({}, filterInfo, (0, _defineProperty2["default"])({}, col.key, value));
303
+ _this.setState({
304
+ filterVisibleKey: ''
305
+ });
306
+ onTableChange && onTableChange(sortInfo, newFilterInfo);
307
+ };
308
+ var value = filterInfo[col.key];
309
+ col.filteredValue = value ? [value] : null;
310
+ col.filterDropdownVisible = visibleKey === col.key;
311
+ var onClose = function onClose() {
312
+ _this.setState({
313
+ filterVisibleKey: ''
314
+ });
315
+ };
316
+ col.filterDropdown = /*#__PURE__*/_react["default"].createElement(_FilterDropDown["default"], {
317
+ value: value,
318
+ onSearch: onSearch,
319
+ onClose: onClose,
320
+ isDateFilterByStartAndEnd: isDateFilterByStartAndEnd
321
+ });
322
+ col.onFilterDropdownVisibleChange = function (visible) {
323
+ if (isDateFilterByStartAndEnd) {
324
+ visible && _this.setState({
325
+ filterVisibleKey: col.key
326
+ });
327
+ } else {
328
+ _this.setState({
329
+ filterVisibleKey: visible ? col.key : ''
330
+ });
331
+ }
332
+ };
333
+ col.onFilter = function (value, record) {
334
+ var items = _this.getItems();
335
+ if (items[record.key].__total) return true;
336
+ var content = !col.link ? record[col.key] : record[col.key].props.children;
337
+ if (!col.isDateFilterByStartAndEnd) {
338
+ var con = (0, _isArray["default"])(content) ? content : String(content);
339
+ return (0, _includes["default"])(con).call(con, value);
340
+ } else {
341
+ return !(value.start && new Date(value.start) > new Date(content) || value.end && value.end < content);
342
+ }
343
+ };
344
+ }
345
+ delete col.filter;
346
+ });
347
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "linkList", function (key, index, item) {
348
+ var linkTitleKey = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'fileName';
349
+ var list = item[key] || [];
350
+ return /*#__PURE__*/_react["default"].createElement("div", null, (0, _map["default"])(list).call(list, function (item2, index2) {
351
+ var _context2, _context3;
352
+ var split = index2 === list.length - 1 ? '' : ',';
353
+ var onClick = (0, _bind["default"])(_context2 = _this.onLink).call(_context2, null, key, index, item2);
354
+ return /*#__PURE__*/_react["default"].createElement("a", {
355
+ key: index2,
356
+ onClick: onClick,
357
+ onDoubleClick: _this.onLinkDouble
358
+ }, (0, _concat["default"])(_context3 = "".concat(item2[linkTitleKey])).call(_context3, split));
359
+ }));
360
+ });
361
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "waring", function (key, index, item, warningKey) {
362
+ var text = item[key] ? item[key] : '';
363
+ var color = item[warningKey] == 1 ? 'red' : 'rgba(0, 0, 0, 0.65)';
364
+ return /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("p", {
365
+ style: {
366
+ color: color
367
+ }
368
+ }, text.title ? text.title : text));
369
+ });
370
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "defaultList", function (key, index, item, text, link) {
371
+ var _context4;
372
+ var onClick = (0, _bind["default"])(_context4 = _this.onLink).call(_context4, null, key, index, item);
373
+ if (link && typeof link === 'string') {
374
+ return /*#__PURE__*/_react["default"].createElement("a", {
375
+ onClick: onClick,
376
+ onDoubleClick: _this.onLinkDouble
377
+ }, text);
378
+ }
379
+ return /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("p", null, text));
380
+ });
381
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getColumns", function (cols, items) {
382
+ var _context5, _context6;
383
+ var _this$props5 = _this.props,
384
+ sortInfo = _this$props5.sortInfo,
385
+ filterInfo = _this$props5.filterInfo;
386
+ var filterVisibleKey = _this.state.filterVisibleKey;
387
+ return (0, _map["default"])(_context5 = (0, _concat["default"])(_context6 = _this.getIndexInfo(items)).call(_context6, (0, _filter["default"])(cols).call(cols, function (col) {
388
+ return !col.hide;
389
+ }))).call(_context5, function (_ref11) {
390
+ var col = (0, _extends2["default"])({}, ((0, _objectDestructuringEmpty2["default"])(_ref11), _ref11));
391
+ col.dataIndex = col.key;
392
+ col.className = col.key === 'index' ? 'ant-table-selection-column' : col.align ? (0, _variables["default"])('SuperTable')[col.align] : '';
393
+ col.noWrap && (col.className = (0, _variables["default"])('SuperTable').noWrap);
394
+ _this.setSortInfo(col, sortInfo || {});
395
+ _this.setFilterInfo(col, filterInfo || {}, filterVisibleKey);
396
+ if (col.defaultValue) {
397
+ col.render = function (text, record, index) {
398
+ return _this.defaultList(col.key, index, items[index], col.defaultValue, col.link);
399
+ };
400
+ } else if (col.link === 'list') {
401
+ col.render = function (text, record, index) {
402
+ return _this.linkList(col.key, index, items[index], col.linkTitleKey);
403
+ };
404
+ } else if (col.link && typeof col.link === 'string') {
405
+ col.render = function (text, record, index) {
406
+ return _this.link(col.key, index, items[index], col.link);
407
+ };
408
+ } else if (col.isWarning) {
409
+ col.render = function (text, record, index) {
410
+ return _this.waring(col.key, index, items[index], col.warningKey);
411
+ };
412
+ } else if (col.tooltip) {
413
+ col.render = function (text, record, index) {
414
+ return _this.tooltip(col.key, index, items[index], col);
415
+ };
416
+ }
417
+ return col;
418
+ });
419
+ });
420
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getText", function (value, options) {
421
+ if ((0, _isArray["default"])(value)) {
422
+ return (0, _map["default"])(value).call(value, function (v) {
423
+ return (0, _Control.getTitle)(v, options);
424
+ }).toString();
425
+ } else {
426
+ return (0, _Control.getTitle)(value, options);
427
+ }
428
+ });
429
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "link", function (key, index, item, text) {
430
+ var _context7;
431
+ var onClick = (0, _bind["default"])(_context7 = _this.onLink).call(_context7, null, key, index, item);
432
+ return /*#__PURE__*/_react["default"].createElement("a", {
433
+ onClick: onClick,
434
+ onDoubleClick: _this.onLinkDouble
435
+ }, text);
436
+ });
437
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "tooltip", function (key, index, item, _ref12) {
438
+ var tipLen = _ref12.tooltip,
439
+ options = _ref12.options;
440
+ var text = _this.getText(item[key], options);
441
+ var needTip = tipLen > 1 && text && typeof text === 'string' && text.length > tipLen;
442
+ return needTip ? /*#__PURE__*/_react["default"].createElement(_tooltip["default"], {
443
+ title: text
444
+ }, /*#__PURE__*/_react["default"].createElement("span", null, (0, _slice["default"])(text).call(text, 0, tipLen) + '...')) : /*#__PURE__*/_react["default"].createElement("span", null, (0, _isArray["default"])(text) ? text.join(',') : text);
445
+ });
446
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getImgSrc", function (value, options) {
447
+ var index = (0, _findIndex["default"])(options).call(options, function (obj) {
448
+ return obj.value == value;
449
+ });
450
+ return index === -1 ? null : options[index].img;
451
+ });
452
+ /**
453
+ *
454
+ * @param item{array}:列数据
455
+ * @param key{string}:字段key
456
+ * @param options{array}:字段options
457
+ * @param dataSource{string,array}:数据源,如果列数据有多层则用此决定
458
+ */
459
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getSourceText", function (item, key, options, dataSource) {
460
+ var value = {};
461
+ if (typeof dataSource === 'string') {
462
+ value = item[dataSource] || {};
463
+ } else if ((0, _isArray["default"])(dataSource)) {
464
+ (0, _forEach["default"])(dataSource).call(dataSource, function (source, index) {
465
+ /*如果字段重复则用dataSource取到结果,key不作为取字段的标准*/
466
+ if (index === 0) {
467
+ value = item[source] || {};
468
+ } else {
469
+ value = value[source] || {};
470
+ }
471
+ });
472
+ }
473
+ /*如果上面已经取到结果则不进入*/
474
+ if (typeof value !== 'string') {
475
+ value = value[key];
476
+ }
477
+ return _this.getText(value, options);
478
+ });
479
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getDataSource", function (items, cols) {
480
+ return (0, _map["default"])(items).call(items, function (item, index) {
481
+ return (0, _reduce["default"])(cols).call(cols, function (result, _ref13) {
482
+ var key = _ref13.key,
483
+ options = _ref13.options,
484
+ link = _ref13.link,
485
+ icon = _ref13.icon,
486
+ dataSource = _ref13.dataSource;
487
+ if (link) {
488
+ if (typeof link === 'boolean') {
489
+ result[key] = _this.link(key, index, item, _this.getText(item[key], options));
490
+ }
491
+ } else if (icon) {
492
+ var _context8;
493
+ //单独的icon列,icon=true数据值根据options获得显示的图片url
494
+ var src = _this.getImgSrc(item[key], options);
495
+ var onClick = (0, _bind["default"])(_context8 = _this.onLink).call(_context8, null, key, index, item);
496
+ result[key] = src ? /*#__PURE__*/_react["default"].createElement("img", {
497
+ src: src,
498
+ onClick: onClick
499
+ }) : '';
500
+ } else if (dataSource) {
501
+ result[key] = _this.getSourceText(item, key, options, dataSource);
502
+ } else {
503
+ result[key] = _this.getText(item[key], options);
504
+ }
505
+ return result;
506
+ }, {
507
+ key: index,
508
+ checked: !!item.checked
509
+ });
510
+ });
511
+ });
512
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getPropsByCheckbox", function (items) {
513
+ var _this$props6 = _this.props,
514
+ _this$props6$checkbox = _this$props6.checkbox,
515
+ checkbox = _this$props6$checkbox === void 0 ? true : _this$props6$checkbox,
516
+ _this$props6$radio = _this$props6.radio,
517
+ radio = _this$props6$radio === void 0 ? false : _this$props6$radio,
518
+ isolation = _this$props6.isolation,
519
+ _this$props6$checkedR = _this$props6.checkedRows,
520
+ checkedRows = _this$props6$checkedR === void 0 ? [] : _this$props6$checkedR,
521
+ _this$props6$isEmphas = _this$props6.isEmphasized,
522
+ isEmphasized = _this$props6$isEmphas === void 0 ? false : _this$props6$isEmphas,
523
+ _this$props6$isWeaken = _this$props6.isWeaken,
524
+ isWeaken = _this$props6$isWeaken === void 0 ? true : _this$props6$isWeaken;
525
+ var rowClassName1 = function rowClassName1(record) {
526
+ if (items[record.key].__total) return (0, _variables["default"])('SuperTable').totalRow;
527
+ if (items[record.key].__warningRow) return (0, _variables["default"])('SuperTable').warningRow;
528
+ return (0, _includes["default"])(checkedRows).call(checkedRows, record.key) ? (0, _variables["default"])('SuperTable').select : '';
529
+ };
530
+ var rowClassName2 = function rowClassName2(record) {
531
+ if (items[record.key].__total) return (0, _variables["default"])('SuperTable').totalRow;
532
+ if (items[record.key].__warningRow) return (0, _variables["default"])('SuperTable').warningRow;
533
+ if (isEmphasized && items[record.key].__isEmphasized) {
534
+ return items[record.key].checked ? (0, _variables["default"])('SuperTable').emphasizedSelectRow : (0, _variables["default"])('SuperTable').emphasizedUnselectRow;
535
+ }
536
+ if (isWeaken && items[record.key].__isWeaken) {
537
+ return items[record.key].checked ? (0, _variables["default"])('SuperTable').weakenedSelectRow : (0, _variables["default"])('SuperTable').weakenedUnselectRow;
538
+ }
539
+ return items[record.key].checked ? (0, _variables["default"])('SuperTable').select : '';
540
+ };
541
+ if (checkbox) {
542
+ if (radio) {
543
+ return {
544
+ rowClassName: rowClassName1,
545
+ onRowClick: _this.onRadioRowClick,
546
+ rowSelection: {
547
+ type: 'radio',
548
+ selectedRowKeys: checkedRows,
549
+ onChange: _this.onRadioChange
550
+ }
551
+ };
552
+ } else if (isolation) {
553
+ return {
554
+ rowClassName: rowClassName1,
555
+ onRowClick: _this.onRowClick,
556
+ rowSelection: {
557
+ selectedRowKeys: checkedRows,
558
+ onChange: _this.onCheckChange,
559
+ getCheckboxProps: function getCheckboxProps(record) {
560
+ var checked = (0, _includes["default"])(checkedRows).call(checkedRows, record.key);
561
+ return {
562
+ checked: checked,
563
+ disabled: items[record.key].__isWeaken,
564
+ style: items[record.key].__total ? {
565
+ display: 'none'
566
+ } : {}
567
+ };
568
+ }
569
+ }
570
+ };
571
+ } else {
572
+ return {
573
+ rowClassName: rowClassName2,
574
+ onRowClick: _this.onRowClick,
575
+ rowSelection: {
576
+ selectedRowKeys: _this.getSelectedRowKeys(items),
577
+ onChange: _this.onChange,
578
+ getCheckboxProps: function getCheckboxProps(record) {
579
+ var checked = isWeaken && items[record.key].__isWeaken ? false : !!record.checked;
580
+ return {
581
+ checked: checked,
582
+ disabled: items[record.key].__isWeaken,
583
+ style: items[record.key].__total ? {
584
+ display: 'none'
585
+ } : {}
586
+ };
587
+ }
588
+ }
589
+ };
590
+ }
591
+ } else {
592
+ return {
593
+ rowClassName: rowClassName2
594
+ };
595
+ }
596
+ });
597
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getRowProps", function (onRowClick) {
598
+ return function (record) {
599
+ return {
600
+ onClick: function onClick() {
601
+ return onRowClick && onRowClick(record);
602
+ },
603
+ onDoubleClick: function onDoubleClick() {
604
+ return _this.onDoubleClick(record);
605
+ }
606
+ };
607
+ };
608
+ });
609
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getRowPropsForDrag", function () {
610
+ return function (record, index) {
611
+ return {
612
+ index: index,
613
+ onMoveRow: _this.onMoveRow
614
+ };
615
+ };
616
+ });
617
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getItems", function () {
618
+ var _this$props7 = _this.props,
619
+ items = _this$props7.items,
620
+ cols = _this$props7.cols,
621
+ _this$props7$dragSort = _this$props7.dragSort,
622
+ dragSort = _this$props7$dragSort === void 0 ? false : _this$props7$dragSort,
623
+ _this$props7$pageTota = _this$props7.pageTotal,
624
+ pageTotal = _this$props7$pageTota === void 0 ? false : _this$props7$pageTota,
625
+ searchTotal = _this$props7.searchTotal;
626
+ var resItems = items;
627
+ if (!dragSort && items.length > 1) {
628
+ if (pageTotal || searchTotal) {
629
+ var totalItem = (0, _reduce["default"])(cols).call(cols, function (result, _ref14) {
630
+ var key = _ref14.key,
631
+ _ref14$total = _ref14.total,
632
+ total = _ref14$total === void 0 ? false : _ref14$total;
633
+ if (total) {
634
+ result[key] = (0, _parseFloat2["default"])(Number((0, _reduce["default"])(items).call(items, function (result, item) {
635
+ return (0, _parseFloat2["default"])(String(item[key] || 0)) + result;
636
+ }, 0)).toFixed(4));
637
+ }
638
+ return result;
639
+ }, {
640
+ __total: true,
641
+ __totalIndexTitle: '本页汇总'
642
+ });
643
+ resItems = (0, _concat["default"])(resItems).call(resItems, [totalItem]);
644
+ }
645
+ if (searchTotal) {
646
+ resItems = (0, _concat["default"])(resItems).call(resItems, [_objectSpread(_objectSpread({}, searchTotal), {}, {
647
+ __total: true,
648
+ __totalIndexTitle: '查询汇总'
649
+ })]);
650
+ }
651
+ }
652
+ return resItems;
653
+ });
654
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "toTotalFooter", function () {
655
+ var _this$props8 = _this.props,
656
+ cols = _this$props8.cols,
657
+ items = _this$props8.items,
658
+ isolation = _this$props8.isolation,
659
+ checkedRows = _this$props8.checkedRows;
660
+ var totalCols = (0, _filter["default"])(cols).call(cols, function (item) {
661
+ return item.total;
662
+ });
663
+ if (totalCols.length > 0) {
664
+ var checkedItems = isolation ? (0, _filter["default"])(items).call(items, function (item, index) {
665
+ return (0, _includes["default"])(checkedRows).call(checkedRows, index);
666
+ }) : (0, _filter["default"])(items).call(items, function (item) {
667
+ return item.checked;
668
+ });
669
+ var countItems = checkedItems.length ? checkedItems : items;
670
+ var totalItems = (0, _map["default"])(totalCols).call(totalCols, function (_ref15) {
671
+ var title = _ref15.title,
672
+ key = _ref15.key,
673
+ _ref15$props = _ref15.props,
674
+ props = _ref15$props === void 0 ? {} : _ref15$props;
675
+ var value = (0, _reduce["default"])(countItems).call(countItems, function (result, item) {
676
+ return (0, _parseFloat2["default"])((result + Number(item[key] || 0)).toFixed(props.precision || 6));
677
+ }, 0);
678
+ return {
679
+ title: title,
680
+ value: value
681
+ };
682
+ });
683
+ return /*#__PURE__*/_react["default"].createElement("div", {
684
+ style: {
685
+ height: '36px',
686
+ lineHeight: '36px'
687
+ }
688
+ }, /*#__PURE__*/_react["default"].createElement("span", {
689
+ style: {
690
+ marginRight: "15px"
691
+ }
692
+ }, checkedItems.length ? '【当页勾选汇总】' : '【当页汇总】'), (0, _map["default"])(totalItems).call(totalItems, function (_ref16, index) {
693
+ var title = _ref16.title,
694
+ value = _ref16.value;
695
+ return /*#__PURE__*/_react["default"].createElement("span", {
696
+ key: index,
697
+ style: {
698
+ marginRight: "10px"
699
+ }
700
+ }, /*#__PURE__*/_react["default"].createElement("span", null, title, ": "), /*#__PURE__*/_react["default"].createElement("span", {
701
+ style: {
702
+ color: '#01a4ff'
703
+ }
704
+ }, value));
705
+ }));
706
+ } else {
707
+ return null;
708
+ }
709
+ });
710
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getProps", function () {
711
+ var _this$props9 = _this.props,
712
+ cols = _this$props9.cols,
713
+ _this$props9$isPaging = _this$props9.isPaging,
714
+ isPaging = _this$props9$isPaging === void 0 ? false : _this$props9$isPaging,
715
+ _this$props9$isEmphas = _this$props9.isEmphasized,
716
+ isEmphasized = _this$props9$isEmphas === void 0 ? false : _this$props9$isEmphas,
717
+ _this$props9$isWeaken = _this$props9.isWeaken,
718
+ isWeaken = _this$props9$isWeaken === void 0 ? false : _this$props9$isWeaken,
719
+ dragSort = _this$props9.dragSort,
720
+ _this$props9$footer = _this$props9.footer,
721
+ footer = _this$props9$footer === void 0 ? null : _this$props9$footer;
722
+ var items = _this.getItems();
723
+ var _this$getPropsByCheck = _this.getPropsByCheckbox(items),
724
+ onRowClick = _this$getPropsByCheck.onRowClick,
725
+ extraProps = (0, _objectWithoutProperties2["default"])(_this$getPropsByCheck, _excluded);
726
+ var renderProps = _objectSpread({
727
+ className: !isEmphasized || !isWeaken ? (0, _variables["default"])('SuperTable') : (0, _variables["default"])('SuperTable').noTransition,
728
+ columns: _this.getColumns(cols, items),
729
+ dataSource: _this.getDataSource(items, cols),
730
+ size: 'small',
731
+ pagination: isPaging,
732
+ scroll: {
733
+ x: true
734
+ },
735
+ onChange: _this.onTableChange,
736
+ onRow: dragSort ? _this.getRowPropsForDrag() : _this.getRowProps(onRowClick),
737
+ components: dragSort ? {
738
+ body: {
739
+ row: _DragSortRow["default"]
740
+ }
741
+ } : {},
742
+ footer: footer ? footer : _this.toTotalFooter
743
+ }, extraProps);
744
+ return renderProps;
745
+ });
746
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "setScroll", function () {
747
+ var _this$props10 = _this.props,
748
+ maxHeight = _this$props10.maxHeight,
749
+ pageTotal = _this$props10.pageTotal,
750
+ searchTotal = _this$props10.searchTotal;
751
+ if (maxHeight && _this.getItems().length) {
752
+ var root = _reactDom["default"].findDOMNode((0, _assertThisInitialized2["default"])(_this));
753
+ var container = root.getElementsByClassName('ant-table-body')[0];
754
+ var header = root.getElementsByClassName('ant-table-thead')[0];
755
+ var tbody = root.getElementsByClassName('ant-table-tbody')[0];
756
+ var pageTotalOffset = searchTotal ? 2 : 1;
757
+ var pageTotalElement = pageTotal && tbody && tbody.children ? tbody.children[tbody.children.length - pageTotalOffset] : null;
758
+ var searchTotalElement = searchTotal && tbody && tbody.children ? tbody.children[tbody.children.length - 1] : null;
759
+ (0, _fixed["default"])(container, header, maxHeight, {
760
+ pageTotalElement: pageTotalElement,
761
+ searchTotalElement: searchTotalElement
762
+ });
763
+ }
764
+ });
765
+ return _this;
766
+ }
767
+ (0, _createClass2["default"])(SuperTable, [{
768
+ key: "shouldComponentUpdate",
769
+ value: function shouldComponentUpdate(props, state) {
770
+ var _this2 = this;
771
+ var keys = ['cols', 'items', 'maxHeight', 'checkedRows', 'sortInfo', 'filterInfo'];
772
+ return (0, _some["default"])(keys).call(keys, function (key) {
773
+ return props[key] !== _this2.props[key];
774
+ }) || state.filterVisibleKey !== this.state.filterVisibleKey;
775
+ }
776
+ }, {
777
+ key: "componentDidMount",
778
+ value: function componentDidMount() {
779
+ this.setScroll();
780
+ }
781
+ }, {
782
+ key: "componentDidUpdate",
783
+ value: function componentDidUpdate() {
784
+ this.setScroll();
785
+ }
786
+ }, {
787
+ key: "render",
788
+ value: function render() {
789
+ return /*#__PURE__*/_react["default"].createElement(_table["default"], (0, _extends2["default"])({}, this.getProps(), {
790
+ key: this.props.items.length
791
+ }));
792
+ }
793
+ }]);
794
+ return SuperTable;
795
+ }(_react["default"].Component);
796
+ (0, _defineProperty2["default"])(SuperTable, "propTypes", {
797
+ cols: _propTypes["default"].arrayOf(_propTypes["default"].shape(ColType)).isRequired,
798
+ items: _propTypes["default"].arrayOf(_propTypes["default"].shape(ItemType)).isRequired,
799
+ isPaging: _propTypes["default"].bool,
800
+ checkbox: _propTypes["default"].bool,
801
+ radio: _propTypes["default"].bool,
802
+ isolation: _propTypes["default"].bool,
803
+ checkedRows: _propTypes["default"].array,
804
+ index: _propTypes["default"].bool,
805
+ indexTitle: _propTypes["default"].string,
806
+ sortInfo: _propTypes["default"].object,
807
+ filterInfo: _propTypes["default"].object,
808
+ maxHeight: _propTypes["default"].string,
809
+ callback: _propTypes["default"].shape(CallbackType),
810
+ isEmphasized: _propTypes["default"].bool,
811
+ isWeaken: _propTypes["default"].bool,
812
+ dragSort: _propTypes["default"].bool,
813
+ pageTotal: _propTypes["default"].bool,
814
+ searchTotal: _propTypes["default"].object
815
+ });
816
+ var _default = exports["default"] = SuperTable;