cloud-b2b 1.1.57 → 1.1.59

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