cloud-b2b 1.1.59 → 1.1.61

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