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,673 @@
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 _every = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/every"));
22
+ var _findIndex = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/find-index"));
23
+ var _some = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/some"));
24
+ var _setTimeout2 = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/set-timeout"));
25
+ var _includes = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/includes"));
26
+ var _filter = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/filter"));
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 _variables = _interopRequireDefault(require("../variables"));
51
+ var _excluded = ["onRowClick"];
52
+ 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; }
53
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context11, _context12; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty2(_context11 = ownKeys(Object(t), !0)).call(_context11, function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty2(_context12 = ownKeys(Object(t))).call(_context12, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
54
+ 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); }; }
55
+ 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; } }
56
+ /**
57
+ * sorter: [可选],不传表示该列不支持排序;为string表示按字符串排序;为number表示按数字大小排序
58
+ * filter: [可选],是否支持过滤,默认为false
59
+ * link: [可选],为true表示超链接,内容来至items;为字符串表示超链接,内容就是该字符串;为字符串‘list’表示超链接数组,内容就是该items对应key对象数组的linkTitleKey属性拼接
60
+ * linkTitleKey: [可选],当link为'list'表示超链接组时,该值表示要拼接展示的属性key值
61
+ * isDateFilterByStartAndEnd: [可选],为true时做过滤操作会显示时间段搜索,默认为false
62
+ *
63
+ */
64
+ var ColType = {
65
+ key: _propTypes["default"].string.isRequired,
66
+ title: _propTypes["default"].string,
67
+ align: _propTypes["default"].oneOf(['left', 'center', 'right']),
68
+ sorter: _propTypes["default"].oneOf(['string', 'number']),
69
+ filter: _propTypes["default"].bool,
70
+ hide: _propTypes["default"].bool,
71
+ options: _propTypes["default"].array,
72
+ link: _propTypes["default"].oneOfType([_propTypes["default"].bool, _propTypes["default"].string]),
73
+ linkTitleKey: _propTypes["default"].string,
74
+ noWrap: _propTypes["default"].bool,
75
+ isDateFilterByStartAndEnd: _propTypes["default"].bool
76
+ };
77
+ var ItemType = {
78
+ checked: _propTypes["default"].bool
79
+ };
80
+
81
+ /**
82
+ * onCheck:点击复选框时触发, 原型为onCheck(checkedRows)
83
+ * onRadio: 点击单选按钮时触发,原型为func(checkedRows)
84
+ * onDoubleClick: 行双击时触发,原型func(rowIndex)
85
+ * onLink: 点击超链接时触发,原型为func(key, rowIndex, item)
86
+ * onTableChange: 排序信息改变时触发,原型为func(sortInfo, filterInfo)
87
+ */
88
+ var CallbackType = {
89
+ onCheck: _propTypes["default"].func,
90
+ onRadio: _propTypes["default"].func,
91
+ onDoubleClick: _propTypes["default"].func,
92
+ onLink: _propTypes["default"].func,
93
+ onTableChange: _propTypes["default"].func
94
+ };
95
+
96
+ /**
97
+ * checkbox: [可选],是否有复选框,默认为true
98
+ * isPaging: [可选],是否分页,默认为false
99
+ * radio: [可选],是否为单选按钮,当checkbox为true时生效,默认值为false
100
+ * checkedRows: [可选],选中的行数,radio为true时生效
101
+ * index: [可选],是否有序号,默认值为true
102
+ * indexTitle:[可选],序号标题,默认为'序号'
103
+ * sortInfo: [可选],排序信息,默认为null
104
+ * filterInfo: [可选],过滤信息,默认为null
105
+ * maxHeight: [可选],设置表格的最大高度
106
+ * childrenKey: [可选],设置子列表数据的key,默认children
107
+ */
108
+ var SuperTable = /*#__PURE__*/function (_React$Component) {
109
+ (0, _inherits2["default"])(SuperTable, _React$Component);
110
+ var _super = _createSuper(SuperTable);
111
+ function SuperTable() {
112
+ var _context;
113
+ var _this;
114
+ (0, _classCallCheck2["default"])(this, SuperTable);
115
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
116
+ args[_key] = arguments[_key];
117
+ }
118
+ _this = _super.call.apply(_super, (0, _concat["default"])(_context = [this]).call(_context, args));
119
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "state", {
120
+ filterVisibleKey: ''
121
+ });
122
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onTableChange", function (pagination, filters, sorter) {
123
+ var _ref = _this.props.callback || {},
124
+ onTableChange = _ref.onTableChange;
125
+ var _this$props$filterInf = _this.props.filterInfo,
126
+ filterInfo = _this$props$filterInf === void 0 ? null : _this$props$filterInf;
127
+ onTableChange && onTableChange(sorter, filterInfo);
128
+ });
129
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onChange", function () {
130
+ var selectedKeyArr = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
131
+ var _ref2 = _this.props.callback || {},
132
+ onCheck = _ref2.onCheck;
133
+ if (onCheck) {
134
+ var _this$props$items = _this.props.items,
135
+ items = _this$props$items === void 0 ? [] : _this$props$items;
136
+ var offset = 0;
137
+ var realSlectedList = selectedKeyArr.length > items.length ? (0, _slice["default"])(selectedKeyArr).call(selectedKeyArr, 0, selectedKeyArr.length + offset) : selectedKeyArr;
138
+ var selectedKeys = realSlectedList;
139
+ var newItems = items;
140
+ if (selectedKeys.length === 0) {
141
+ onCheck(true, false, -1);
142
+ } else if (selectedKeys.length === newItems.length) {
143
+ var checked = (0, _every["default"])(newItems).call(newItems, function (o) {
144
+ return o.checked;
145
+ });
146
+ onCheck(true, !checked, -1);
147
+ } else {
148
+ var defaultSelectedKeys = _this.getSelectedRowKeys(newItems);
149
+ if (selectedKeys.length > defaultSelectedKeys.length) {
150
+ if (_this.props.isPaging && selectedKeys.length - defaultSelectedKeys.length > 1) {
151
+ return onCheck(true, true, -1);
152
+ }
153
+ onCheck(false, true, selectedKeys[selectedKeys.length - 1]);
154
+ } else {
155
+ var index = (0, _findIndex["default"])(defaultSelectedKeys).call(defaultSelectedKeys, function (key) {
156
+ return !(0, _some["default"])(selectedKeys).call(selectedKeys, function (select) {
157
+ return select === key;
158
+ });
159
+ });
160
+ onCheck(false, false, defaultSelectedKeys[index]);
161
+ }
162
+ }
163
+ }
164
+ });
165
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onCheckChange", function (selectedKeys) {
166
+ var _ref3 = _this.props.callback || {},
167
+ onCheck = _ref3.onCheck;
168
+ onCheck && onCheck(selectedKeys);
169
+ });
170
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onRadioChange", function (selectedKeys) {
171
+ var _ref4 = _this.props.callback || {},
172
+ onRadio = _ref4.onRadio;
173
+ onRadio && onRadio(selectedKeys);
174
+ });
175
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onRadioRowClick", function (record) {
176
+ var _ref5 = _this.props.callback || {},
177
+ onRadio = _ref5.onRadio;
178
+ onRadio && onRadio([record.key]);
179
+ });
180
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onRowClick", function (record) {
181
+ var items = _this.props.items;
182
+ if (items.length <= record.key) return;
183
+ clearTimeout(_this.timer);
184
+ _this.timer = (0, _setTimeout2["default"])(function () {
185
+ var _ref6 = _this.props.callback || {},
186
+ onCheck = _ref6.onCheck;
187
+ if (onCheck) {
188
+ var _this$props$checkedRo = _this.props.checkedRows,
189
+ checkedRows = _this$props$checkedRo === void 0 ? [] : _this$props$checkedRo;
190
+ if ((0, _includes["default"])(checkedRows).call(checkedRows, record.key)) {
191
+ onCheck((0, _filter["default"])(checkedRows).call(checkedRows, function (key) {
192
+ return record.key !== key;
193
+ }));
194
+ } else {
195
+ onCheck((0, _concat["default"])(checkedRows).call(checkedRows, record.key));
196
+ }
197
+ }
198
+ }, 250);
199
+ });
200
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onDoubleClick", function (record) {
201
+ clearTimeout(_this.timer);
202
+ var _ref7 = _this.props.callback || {},
203
+ onDoubleClick = _ref7.onDoubleClick;
204
+ onDoubleClick && onDoubleClick(record.key);
205
+ });
206
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onLink", function (key, index, item, e) {
207
+ var _ref8 = _this.props.callback || {},
208
+ onLink = _ref8.onLink;
209
+ onLink && onLink(key, index, item);
210
+ e.stopPropagation();
211
+ });
212
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onLinkDouble", function (e) {
213
+ e.stopPropagation();
214
+ });
215
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getSelectedRowKeys", function (items) {
216
+ return (0, _reduce["default"])(items).call(items, function (result, item, index) {
217
+ item.checked && result.push(index);
218
+ return result;
219
+ }, []);
220
+ });
221
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getIndexInfo", function () {
222
+ var items = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
223
+ var _this$props = _this.props,
224
+ _this$props$index = _this$props.index,
225
+ index = _this$props$index === void 0 ? true : _this$props$index,
226
+ _this$props$indexTitl = _this$props.indexTitle,
227
+ indexTitle = _this$props$indexTitl === void 0 ? '序号' : _this$props$indexTitl;
228
+ return index ? [{
229
+ key: 'index',
230
+ title: indexTitle,
231
+ render: function render(text, record, index) {
232
+ return index + 1;
233
+ }
234
+ }] : [];
235
+ });
236
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "setSortInfo", function (col, sortInfo) {
237
+ if (col.sorter === 'string') {
238
+ col.sortOrder = sortInfo.columnKey === col.key && sortInfo.order;
239
+ col.sorter = function (row1, row2) {
240
+ var a = !col.link ? row1[col.key] : row1[col.key].props.children;
241
+ var b = !col.link ? row2[col.key] : row2[col.key].props.children;
242
+ if (a > b) {
243
+ return 1;
244
+ } else if (a === b) {
245
+ return 0;
246
+ } else {
247
+ return -1;
248
+ }
249
+ };
250
+ } else if (col.sorter === 'number') {
251
+ col.sortOrder = sortInfo.columnKey === col.key && sortInfo.order;
252
+ col.sorter = function (a, b) {
253
+ return a[col.key] - b[col.key];
254
+ };
255
+ } else {
256
+ delete col.sorter;
257
+ }
258
+ });
259
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "setFilterInfo", function (col, filterInfo, visibleKey) {
260
+ if ((0, _filter["default"])(col)) {
261
+ var _col$isDateFilterBySt = col.isDateFilterByStartAndEnd,
262
+ isDateFilterByStartAndEnd = _col$isDateFilterBySt === void 0 ? false : _col$isDateFilterBySt;
263
+ var onSearch = function onSearch(value) {
264
+ var _ref9 = _this.props.callback || {},
265
+ onTableChange = _ref9.onTableChange;
266
+ var _this$props$sortInfo = _this.props.sortInfo,
267
+ sortInfo = _this$props$sortInfo === void 0 ? null : _this$props$sortInfo;
268
+ var newFilterInfo = (0, _assign["default"])({}, filterInfo, (0, _defineProperty2["default"])({}, col.key, value));
269
+ _this.setState({
270
+ filterVisibleKey: ''
271
+ });
272
+ onTableChange && onTableChange(sortInfo, newFilterInfo);
273
+ };
274
+ var value = filterInfo[col.key];
275
+ col.filteredValue = value ? [value] : null;
276
+ col.filterDropdownVisible = visibleKey === col.key;
277
+ var onClose = function onClose() {
278
+ _this.setState({
279
+ filterVisibleKey: ''
280
+ });
281
+ };
282
+ col.filterDropdown = /*#__PURE__*/_react["default"].createElement(_FilterDropDown["default"], {
283
+ value: value,
284
+ onSearch: onSearch,
285
+ onClose: onClose,
286
+ isDateFilterByStartAndEnd: isDateFilterByStartAndEnd
287
+ });
288
+ col.onFilterDropdownVisibleChange = function (visible) {
289
+ if (isDateFilterByStartAndEnd) {
290
+ visible && _this.setState({
291
+ filterVisibleKey: col.key
292
+ });
293
+ } else {
294
+ _this.setState({
295
+ filterVisibleKey: visible ? col.key : ''
296
+ });
297
+ }
298
+ };
299
+ col.onFilter = function (value, record) {
300
+ var content = !col.link ? record[col.key] : record[col.key].props.children;
301
+ if (!col.isDateFilterByStartAndEnd) {
302
+ var con = (0, _isArray["default"])(content) ? content : String(content);
303
+ return (0, _includes["default"])(con).call(con, value);
304
+ } else {
305
+ return !(value.start && new Date(value.start) > new Date(content) || value.end && value.end < content);
306
+ }
307
+ };
308
+ }
309
+ delete col.filter;
310
+ });
311
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "linkList", function (key, index, item) {
312
+ var linkTitleKey = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'fileName';
313
+ var list = item[key] || [];
314
+ return /*#__PURE__*/_react["default"].createElement("div", null, (0, _map["default"])(list).call(list, function (item2, index2) {
315
+ var _context2, _context3;
316
+ var split = index2 === list.length - 1 ? '' : ',';
317
+ var onClick = (0, _bind["default"])(_context2 = _this.onLink).call(_context2, null, key, index, item2);
318
+ return /*#__PURE__*/_react["default"].createElement("a", {
319
+ key: index2,
320
+ onClick: onClick,
321
+ onDoubleClick: _this.onLinkDouble
322
+ }, (0, _concat["default"])(_context3 = "".concat(item2[linkTitleKey])).call(_context3, split));
323
+ }));
324
+ });
325
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "waring", function (key, index, item, warningKey) {
326
+ var text = item[key] ? item[key] : '';
327
+ var color = item[warningKey] == 1 ? 'red' : 'rgba(0, 0, 0, 0.65)';
328
+ return /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("p", {
329
+ style: {
330
+ color: color
331
+ }
332
+ }, text.title ? text.title : text));
333
+ });
334
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "defaultList", function (key, index, item, text, link) {
335
+ var _context4;
336
+ var onClick = (0, _bind["default"])(_context4 = _this.onLink).call(_context4, null, key, index, item);
337
+ if (link && typeof link === 'string') {
338
+ return /*#__PURE__*/_react["default"].createElement("a", {
339
+ onClick: onClick,
340
+ onDoubleClick: _this.onLinkDouble
341
+ }, text);
342
+ }
343
+ return /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("p", null, text));
344
+ });
345
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getColumns", function (cols, items) {
346
+ var _context5, _context6;
347
+ var _this$props2 = _this.props,
348
+ sortInfo = _this$props2.sortInfo,
349
+ filterInfo = _this$props2.filterInfo;
350
+ var filterVisibleKey = _this.state.filterVisibleKey;
351
+ return (0, _map["default"])(_context5 = (0, _concat["default"])(_context6 = _this.getIndexInfo(items)).call(_context6, (0, _filter["default"])(cols).call(cols, function (col) {
352
+ return !col.hide;
353
+ }))).call(_context5, function (_ref10) {
354
+ var col = (0, _extends2["default"])({}, ((0, _objectDestructuringEmpty2["default"])(_ref10), _ref10));
355
+ col.dataIndex = col.key;
356
+ col.className = col.key === 'index' ? 'ant-table-selection-column' : col.align ? s[col.align] : '';
357
+ col.noWrap && (col.className = (0, _variables["default"])('SuperTable3').noWrap);
358
+ _this.setSortInfo(col, sortInfo || {});
359
+ _this.setFilterInfo(col, filterInfo || {}, filterVisibleKey);
360
+ if (col.defaultValue) {
361
+ col.render = function (text, record, index) {
362
+ return _this.defaultList(col.key, index, items[index], col.defaultValue, col.link);
363
+ };
364
+ } else if (col.link === 'list') {
365
+ col.render = function (text, record, index) {
366
+ return _this.linkList(col.key, index, items[index], col.linkTitleKey);
367
+ };
368
+ } else if (col.link && typeof col.link === 'string') {
369
+ col.render = function (text, record, index) {
370
+ return _this.link(col.key, index, items[index], col.link);
371
+ };
372
+ } else if (col.isWarning) {
373
+ col.render = function (text, record, index) {
374
+ return _this.waring(col.key, index, items[index], col.warningKey);
375
+ };
376
+ } else if (col.tooltip) {
377
+ col.render = function (text, record, index) {
378
+ return _this.tooltip(col.key, index, items[index], col);
379
+ };
380
+ }
381
+ return col;
382
+ });
383
+ });
384
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getText", function (value, options) {
385
+ if ((0, _isArray["default"])(value)) {
386
+ return (0, _map["default"])(value).call(value, function (v) {
387
+ return (0, _Control.getTitle)(v, options);
388
+ }).toString();
389
+ } else {
390
+ return (0, _Control.getTitle)(value, options);
391
+ }
392
+ });
393
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "link", function (key, index, item, text) {
394
+ var _context7;
395
+ var onClick = (0, _bind["default"])(_context7 = _this.onLink).call(_context7, null, key, index, item);
396
+ return /*#__PURE__*/_react["default"].createElement("a", {
397
+ onClick: onClick,
398
+ onDoubleClick: _this.onLinkDouble
399
+ }, text);
400
+ });
401
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "tooltip", function (key, index, item, _ref11) {
402
+ var tipLen = _ref11.tooltip,
403
+ options = _ref11.options;
404
+ var text = _this.getText(item[key], options);
405
+ var needTip = tipLen > 1 && text && typeof text === 'string' && text.length > tipLen;
406
+ return needTip ? /*#__PURE__*/_react["default"].createElement(_tooltip["default"], {
407
+ title: text
408
+ }, /*#__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);
409
+ });
410
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getImgSrc", function (value, options) {
411
+ var index = (0, _findIndex["default"])(options).call(options, function (obj) {
412
+ return obj.value == value;
413
+ });
414
+ return index === -1 ? null : options[index].img;
415
+ });
416
+ /**
417
+ *
418
+ * @param item{array}:列数据
419
+ * @param key{string}:字段key
420
+ * @param options{array}:字段options
421
+ * @param dataSource{string,array}:数据源,如果列数据有多层则用此决定
422
+ */
423
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getSourceText", function (item, key, options, dataSource) {
424
+ var value = {};
425
+ if (typeof dataSource === 'string') {
426
+ value = item[dataSource] || {};
427
+ } else if ((0, _isArray["default"])(dataSource)) {
428
+ (0, _forEach["default"])(dataSource).call(dataSource, function (source, index) {
429
+ /*如果字段重复则用dataSource取到结果,key不作为取字段的标准*/
430
+ if (index === 0) {
431
+ value = item[source] || {};
432
+ } else {
433
+ value = value[source] || {};
434
+ }
435
+ });
436
+ }
437
+ /*如果上面已经取到结果则不进入*/
438
+ if (typeof value !== 'string') {
439
+ value = value[key];
440
+ }
441
+ return _this.getText(value, options);
442
+ });
443
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getDataSource", function (items, cols) {
444
+ var getItemObj = function getItemObj(item, index) {
445
+ return (0, _reduce["default"])(cols).call(cols, function (result, _ref12) {
446
+ var key = _ref12.key,
447
+ options = _ref12.options,
448
+ link = _ref12.link,
449
+ icon = _ref12.icon,
450
+ dataSource = _ref12.dataSource;
451
+ if (link) {
452
+ if (typeof link === 'boolean') {
453
+ result[key] = _this.link(key, index, item, _this.getText(item[key], options));
454
+ }
455
+ } else if (icon) {
456
+ var _context8;
457
+ //单独的icon列,icon=true数据值根据options获得显示的图片url
458
+ var src = _this.getImgSrc(item[key], options);
459
+ var onClick = (0, _bind["default"])(_context8 = _this.onLink).call(_context8, null, key, index, item);
460
+ result[key] = src ? /*#__PURE__*/_react["default"].createElement("img", {
461
+ src: src,
462
+ onClick: onClick
463
+ }) : '';
464
+ } else if (dataSource) {
465
+ result[key] = _this.getSourceText(item, key, options, dataSource);
466
+ } else {
467
+ result[key] = _this.getText(item[key], options);
468
+ }
469
+ return result;
470
+ }, {
471
+ key: index,
472
+ checked: !!item.checked
473
+ });
474
+ };
475
+ var data = (0, _map["default"])(items).call(items, function (item, index) {
476
+ var _context9;
477
+ return _objectSpread(_objectSpread({}, getItemObj(item, index)), {}, {
478
+ children: item.children ? (0, _map["default"])(_context9 = item.children).call(_context9, function (item2, index2) {
479
+ var _context10;
480
+ return getItemObj(item2, (0, _concat["default"])(_context10 = "".concat(index, "-")).call(_context10, index2));
481
+ }) : null
482
+ });
483
+ });
484
+ return data;
485
+ });
486
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getPropsByCheckbox", function () {
487
+ var _this$props3 = _this.props,
488
+ _this$props3$checkbox = _this$props3.checkbox,
489
+ checkbox = _this$props3$checkbox === void 0 ? true : _this$props3$checkbox,
490
+ _this$props3$checkedR = _this$props3.checkedRows,
491
+ checkedRows = _this$props3$checkedR === void 0 ? [] : _this$props3$checkedR;
492
+ var rowClassName1 = function rowClassName1(record) {
493
+ return (0, _includes["default"])(checkedRows).call(checkedRows, record.key) ? (0, _variables["default"])('SuperTable3').select : '';
494
+ };
495
+ if (checkbox) {
496
+ return {
497
+ rowClassName: rowClassName1,
498
+ onRowClick: _this.onRowClick,
499
+ rowSelection: {
500
+ selectedRowKeys: checkedRows,
501
+ onChange: _this.onCheckChange,
502
+ getCheckboxProps: function getCheckboxProps(record) {
503
+ var checked = (0, _includes["default"])(checkedRows).call(checkedRows, record.key);
504
+ return {
505
+ checked: checked
506
+ };
507
+ }
508
+ }
509
+ };
510
+ }
511
+ });
512
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getRowProps", function (onRowClick) {
513
+ return function (record) {
514
+ return {
515
+ onClick: function onClick() {
516
+ return onRowClick && onRowClick(record);
517
+ },
518
+ onDoubleClick: function onDoubleClick() {
519
+ return _this.onDoubleClick(record);
520
+ }
521
+ };
522
+ };
523
+ });
524
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getItems", function () {
525
+ var _this$props4 = _this.props,
526
+ items = _this$props4.items,
527
+ childrenKey = _this$props4.childrenKey;
528
+ var resItems = items;
529
+ if (childrenKey) {
530
+ resItems = (0, _map["default"])(items).call(items, function (o) {
531
+ return o[childrenKey] && o[childrenKey].length ? _objectSpread(_objectSpread({}, o), {}, {
532
+ children: o[childrenKey]
533
+ }) : o;
534
+ });
535
+ }
536
+ return resItems;
537
+ });
538
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "toTotalFooter", function () {
539
+ var _this$props5 = _this.props,
540
+ cols = _this$props5.cols,
541
+ items = _this$props5.items,
542
+ checkedRows = _this$props5.checkedRows;
543
+ var totalCols = (0, _filter["default"])(cols).call(cols, function (item) {
544
+ return item.total;
545
+ });
546
+ if (totalCols.length > 0) {
547
+ var checkedItems = (0, _filter["default"])(items).call(items, function (item, index) {
548
+ return (0, _includes["default"])(checkedRows).call(checkedRows, index);
549
+ });
550
+ var countItems = checkedItems.length ? checkedItems : items;
551
+ var totalItems = (0, _map["default"])(totalCols).call(totalCols, function (_ref13) {
552
+ var title = _ref13.title,
553
+ key = _ref13.key,
554
+ _ref13$props = _ref13.props,
555
+ props = _ref13$props === void 0 ? {} : _ref13$props;
556
+ var value = (0, _reduce["default"])(countItems).call(countItems, function (result, item) {
557
+ return (0, _parseFloat2["default"])((result + Number(item[key] || 0)).toFixed(props.precision || 6));
558
+ }, 0);
559
+ return {
560
+ title: title,
561
+ value: value
562
+ };
563
+ });
564
+ return /*#__PURE__*/_react["default"].createElement("div", {
565
+ style: {
566
+ height: '36px',
567
+ lineHeight: '36px'
568
+ }
569
+ }, /*#__PURE__*/_react["default"].createElement("span", {
570
+ style: {
571
+ marginRight: "15px"
572
+ }
573
+ }, checkedItems.length ? '【当页勾选汇总】' : '【当页汇总】'), (0, _map["default"])(totalItems).call(totalItems, function (_ref14, index) {
574
+ var title = _ref14.title,
575
+ value = _ref14.value;
576
+ return /*#__PURE__*/_react["default"].createElement("span", {
577
+ key: index,
578
+ style: {
579
+ marginRight: "10px"
580
+ }
581
+ }, /*#__PURE__*/_react["default"].createElement("span", null, title, ": "), /*#__PURE__*/_react["default"].createElement("span", {
582
+ style: {
583
+ color: '#01a4ff'
584
+ }
585
+ }, value));
586
+ }));
587
+ } else {
588
+ return null;
589
+ }
590
+ });
591
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getProps", function () {
592
+ var _this$props6 = _this.props,
593
+ cols = _this$props6.cols,
594
+ _this$props6$isPaging = _this$props6.isPaging,
595
+ isPaging = _this$props6$isPaging === void 0 ? false : _this$props6$isPaging,
596
+ _this$props6$footer = _this$props6.footer,
597
+ footer = _this$props6$footer === void 0 ? null : _this$props6$footer;
598
+ var items = _this.getItems();
599
+ var _this$getPropsByCheck = _this.getPropsByCheckbox(items),
600
+ onRowClick = _this$getPropsByCheck.onRowClick,
601
+ extraProps = (0, _objectWithoutProperties2["default"])(_this$getPropsByCheck, _excluded);
602
+ var renderProps = _objectSpread({
603
+ className: (0, _variables["default"])('SuperTable3'),
604
+ columns: _this.getColumns(cols, items),
605
+ dataSource: _this.getDataSource(items, cols),
606
+ size: 'small',
607
+ pagination: isPaging,
608
+ scroll: {
609
+ x: true
610
+ },
611
+ onChange: _this.onTableChange,
612
+ onRow: _this.getRowProps(onRowClick),
613
+ components: {},
614
+ footer: footer ? footer : _this.toTotalFooter
615
+ }, extraProps);
616
+ return renderProps;
617
+ });
618
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "setScroll", function () {
619
+ var maxHeight = _this.props.maxHeight;
620
+ if (maxHeight && _this.getItems().length) {
621
+ var root = _reactDom["default"].findDOMNode((0, _assertThisInitialized2["default"])(_this));
622
+ var container = root.getElementsByClassName('ant-table-body')[0];
623
+ var header = root.getElementsByClassName('ant-table-thead')[0];
624
+ (0, _fixed["default"])(container, header, maxHeight);
625
+ }
626
+ });
627
+ return _this;
628
+ }
629
+ (0, _createClass2["default"])(SuperTable, [{
630
+ key: "shouldComponentUpdate",
631
+ value: function shouldComponentUpdate(props, state) {
632
+ var _this2 = this;
633
+ var keys = ['cols', 'items', 'maxHeight', 'checkedRows', 'sortInfo', 'filterInfo'];
634
+ return (0, _some["default"])(keys).call(keys, function (key) {
635
+ return props[key] !== _this2.props[key];
636
+ }) || state.filterVisibleKey !== this.state.filterVisibleKey;
637
+ }
638
+ }, {
639
+ key: "componentDidMount",
640
+ value: function componentDidMount() {
641
+ this.setScroll();
642
+ }
643
+ }, {
644
+ key: "componentDidUpdate",
645
+ value: function componentDidUpdate() {
646
+ this.setScroll();
647
+ }
648
+ }, {
649
+ key: "render",
650
+ value: function render() {
651
+ return /*#__PURE__*/_react["default"].createElement(_table["default"], (0, _extends2["default"])({}, this.getProps(), {
652
+ key: this.props.items.length
653
+ }));
654
+ }
655
+ }]);
656
+ return SuperTable;
657
+ }(_react["default"].Component);
658
+ (0, _defineProperty2["default"])(SuperTable, "propTypes", {
659
+ cols: _propTypes["default"].arrayOf(_propTypes["default"].shape(ColType)).isRequired,
660
+ items: _propTypes["default"].arrayOf(_propTypes["default"].shape(ItemType)).isRequired,
661
+ isPaging: _propTypes["default"].bool,
662
+ checkbox: _propTypes["default"].bool,
663
+ radio: _propTypes["default"].bool,
664
+ checkedRows: _propTypes["default"].array,
665
+ index: _propTypes["default"].bool,
666
+ indexTitle: _propTypes["default"].string,
667
+ sortInfo: _propTypes["default"].object,
668
+ filterInfo: _propTypes["default"].object,
669
+ maxHeight: _propTypes["default"].string,
670
+ callback: _propTypes["default"].shape(CallbackType),
671
+ childrenKey: _propTypes["default"].string
672
+ });
673
+ var _default = exports["default"] = SuperTable;