cloud-b2b 1.1.46 → 1.1.51

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