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