cloud-b2b 1.1.50 → 1.1.52

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