cloud-b2b 1.0.0 → 1.0.3

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 (208) hide show
  1. package/es/Area/Area.js +166 -0
  2. package/es/Area/package.json +6 -0
  3. package/es/Card/Card.js +20 -0
  4. package/es/Card/package.json +6 -0
  5. package/es/Control/Control.js +428 -0
  6. package/es/Control/event.js +57 -0
  7. package/es/Control/package.json +6 -0
  8. package/es/Enhance/Dialogs.js +67 -0
  9. package/es/Enhance/Loading.js +151 -0
  10. package/es/Enhance/index.js +8 -0
  11. package/es/Enhance/package.json +6 -0
  12. package/es/Header/Header.js +194 -0
  13. package/es/Header/Header.less +95 -0
  14. package/es/Header/Vertical.js +129 -0
  15. package/es/Header/Vertical.less +60 -0
  16. package/es/Header/package.json +6 -0
  17. package/es/HomeHeader/Header.js +75 -0
  18. package/es/HomeHeader/Header.less +73 -0
  19. package/es/HomeHeader/package.json +6 -0
  20. package/es/ImageView/ImageView.js +117 -0
  21. package/es/ImageView/ImageView.less +14 -0
  22. package/es/ImageView/package.json +6 -0
  23. package/es/InpurCascader/InputCascader.js +135 -0
  24. package/es/InpurCascader/package.json +6 -0
  25. package/es/InputEditor/InputEditor.js +118 -0
  26. package/es/InputEditor/inputEditor.less +8 -0
  27. package/es/InputEditor/package.json +6 -0
  28. package/es/InputSearch/InputSearch.js +306 -0
  29. package/es/InputSearch/package.json +6 -0
  30. package/es/InputSelect/InputSelect.js +185 -0
  31. package/es/InputSelect/package.json +6 -0
  32. package/es/InputWriting/InputWriting.js +107 -0
  33. package/es/InputWriting/package.json +6 -0
  34. package/es/Layout/Layout.js +232 -0
  35. package/es/Layout/Layout.less +28 -0
  36. package/es/Layout/package.json +6 -0
  37. package/es/LayoutLink/LayoutLink.js +82 -0
  38. package/es/LayoutLink/LayoutLink.less +53 -0
  39. package/es/LayoutLink/package.json +6 -0
  40. package/es/Link/Link.js +108 -0
  41. package/es/Link/package.json +6 -0
  42. package/es/Loading/Loading.js +15 -0
  43. package/es/Loading/Loading.less +13 -0
  44. package/es/Loading/package.json +6 -0
  45. package/es/Loading2/Loading2.js +11 -0
  46. package/es/Loading2/Loading2.less +19 -0
  47. package/es/Loading2/package.json +6 -0
  48. package/es/ModalWithDrag/ModalWithDrag.js +34 -0
  49. package/es/ModalWithDrag/ModalWithDrag.less +6 -0
  50. package/es/ModalWithDrag/drag.js +133 -0
  51. package/es/ModalWithDrag/package.json +6 -0
  52. package/es/NumberInput/NumberInput.js +237 -0
  53. package/es/NumberInput/package.json +6 -0
  54. package/es/Search/Search.js +581 -0
  55. package/es/Search/Search.less +63 -0
  56. package/es/Search/package.json +6 -0
  57. package/es/Sidebar/Sidebar.js +165 -0
  58. package/es/Sidebar/Sidebar.less +78 -0
  59. package/es/Sidebar/package.json +6 -0
  60. package/es/Sidebar2/Sidebar.js +192 -0
  61. package/es/Sidebar2/Sidebar.less +153 -0
  62. package/es/Sidebar2/package.json +6 -0
  63. package/es/SuperForm/SuperForm.js +688 -0
  64. package/es/SuperForm/SuperForm.less +52 -0
  65. package/es/SuperForm/package.json +6 -0
  66. package/es/SuperIcon/SuperIcon.js +30 -0
  67. package/es/SuperIcon/package.json +6 -0
  68. package/es/SuperPagination/SuperPagination.js +126 -0
  69. package/es/SuperPagination/package.json +6 -0
  70. package/es/SuperTable/DragSortRow.js +125 -0
  71. package/es/SuperTable/DragSortRow.less +17 -0
  72. package/es/SuperTable/FilterDropDown.js +188 -0
  73. package/es/SuperTable/FilterDropDown.less +30 -0
  74. package/es/SuperTable/SuperTable.js +933 -0
  75. package/es/SuperTable/SuperTable.less +135 -0
  76. package/es/SuperTable/fixed.js +42 -0
  77. package/es/SuperTable/package.json +6 -0
  78. package/es/SuperTable2/SuperTable2.js +700 -0
  79. package/es/SuperTable2/SuperTable2.less +100 -0
  80. package/es/SuperTable2/SuperTableCell.js +215 -0
  81. package/es/SuperTable2/package.json +6 -0
  82. package/es/SuperToolbar/SuperToolbar.js +223 -0
  83. package/es/SuperToolbar/SuperToolbar.less +17 -0
  84. package/es/SuperToolbar/package.json +6 -0
  85. package/es/SuperUpload/SuperUpload.js +282 -0
  86. package/es/SuperUpload/SuperUpload.less +27 -0
  87. package/es/SuperUpload/package.json +6 -0
  88. package/es/Title/Title.less +35 -35
  89. package/es/Title/package.json +6 -6
  90. package/es/Viewer/ImageViews.js +311 -0
  91. package/es/Viewer/Viewer.js +149 -0
  92. package/es/Viewer/Viewer.less +67 -0
  93. package/es/Viewer/imgView.less +59 -0
  94. package/es/Viewer/package.json +7 -0
  95. package/es/WingBlank/WingBlank.js +20 -0
  96. package/es/WingBlank/WingBlank.less +12 -0
  97. package/es/WingBlank/package.json +6 -0
  98. package/es/adjust.less +89 -0
  99. package/es/helper.js +118 -0
  100. package/es/history.js +5 -0
  101. package/es/index.js +27 -1
  102. package/es/style.less +20 -1
  103. package/es/variables.less +73 -73
  104. package/lib/Area/Area.js +194 -0
  105. package/lib/Area/package.json +6 -0
  106. package/lib/Card/Card.js +38 -0
  107. package/lib/Card/package.json +6 -0
  108. package/lib/Control/Control.js +477 -0
  109. package/lib/Control/event.js +68 -0
  110. package/lib/Control/package.json +6 -0
  111. package/lib/Enhance/Dialogs.js +87 -0
  112. package/lib/Enhance/Loading.js +175 -0
  113. package/lib/Enhance/index.js +35 -0
  114. package/lib/Enhance/package.json +6 -0
  115. package/lib/Header/Header.js +215 -0
  116. package/lib/Header/Header.less +95 -0
  117. package/lib/Header/Vertical.js +150 -0
  118. package/lib/Header/Vertical.less +60 -0
  119. package/lib/Header/package.json +6 -0
  120. package/lib/HomeHeader/Header.js +95 -0
  121. package/lib/HomeHeader/Header.less +73 -0
  122. package/lib/HomeHeader/package.json +6 -0
  123. package/lib/ImageView/ImageView.js +134 -0
  124. package/lib/ImageView/ImageView.less +14 -0
  125. package/lib/ImageView/package.json +6 -0
  126. package/lib/InpurCascader/InputCascader.js +156 -0
  127. package/lib/InpurCascader/package.json +6 -0
  128. package/lib/InputEditor/InputEditor.js +136 -0
  129. package/lib/InputEditor/inputEditor.less +8 -0
  130. package/lib/InputEditor/package.json +6 -0
  131. package/lib/InputSearch/InputSearch.js +322 -0
  132. package/lib/InputSearch/package.json +6 -0
  133. package/lib/InputSelect/InputSelect.js +208 -0
  134. package/lib/InputSelect/package.json +6 -0
  135. package/lib/InputWriting/InputWriting.js +123 -0
  136. package/lib/InputWriting/package.json +6 -0
  137. package/lib/Layout/Layout.js +258 -0
  138. package/lib/Layout/Layout.less +28 -0
  139. package/lib/Layout/package.json +6 -0
  140. package/lib/LayoutLink/LayoutLink.js +114 -0
  141. package/lib/LayoutLink/LayoutLink.less +53 -0
  142. package/lib/LayoutLink/package.json +6 -0
  143. package/lib/Link/Link.js +130 -0
  144. package/lib/Link/package.json +6 -0
  145. package/lib/Loading/Loading.js +30 -0
  146. package/lib/Loading/Loading.less +13 -0
  147. package/lib/Loading/package.json +6 -0
  148. package/lib/Loading2/Loading2.js +26 -0
  149. package/lib/Loading2/Loading2.less +19 -0
  150. package/lib/Loading2/package.json +6 -0
  151. package/lib/ModalWithDrag/ModalWithDrag.js +53 -0
  152. package/lib/ModalWithDrag/ModalWithDrag.less +6 -0
  153. package/lib/ModalWithDrag/drag.js +147 -0
  154. package/lib/ModalWithDrag/package.json +6 -0
  155. package/lib/NumberInput/NumberInput.js +259 -0
  156. package/lib/NumberInput/package.json +6 -0
  157. package/lib/Search/Search.js +603 -0
  158. package/lib/Search/Search.less +63 -0
  159. package/lib/Search/package.json +6 -0
  160. package/lib/Sidebar/Sidebar.js +186 -0
  161. package/lib/Sidebar/Sidebar.less +78 -0
  162. package/lib/Sidebar/package.json +6 -0
  163. package/lib/Sidebar2/Sidebar.js +213 -0
  164. package/lib/Sidebar2/Sidebar.less +153 -0
  165. package/lib/Sidebar2/package.json +6 -0
  166. package/lib/SuperForm/SuperForm.js +702 -0
  167. package/lib/SuperForm/SuperForm.less +52 -0
  168. package/lib/SuperForm/package.json +6 -0
  169. package/lib/SuperIcon/SuperIcon.js +47 -0
  170. package/lib/SuperIcon/package.json +6 -0
  171. package/lib/SuperPagination/SuperPagination.js +145 -0
  172. package/lib/SuperPagination/package.json +6 -0
  173. package/lib/SuperTable/DragSortRow.js +142 -0
  174. package/lib/SuperTable/DragSortRow.less +17 -0
  175. package/lib/SuperTable/FilterDropDown.js +205 -0
  176. package/lib/SuperTable/FilterDropDown.less +30 -0
  177. package/lib/SuperTable/SuperTable.js +937 -0
  178. package/lib/SuperTable/SuperTable.less +135 -0
  179. package/lib/SuperTable/fixed.js +55 -0
  180. package/lib/SuperTable/package.json +6 -0
  181. package/lib/SuperTable2/SuperTable2.js +725 -0
  182. package/lib/SuperTable2/SuperTable2.less +100 -0
  183. package/lib/SuperTable2/SuperTableCell.js +231 -0
  184. package/lib/SuperTable2/package.json +6 -0
  185. package/lib/SuperToolbar/SuperToolbar.js +248 -0
  186. package/lib/SuperToolbar/SuperToolbar.less +17 -0
  187. package/lib/SuperToolbar/package.json +6 -0
  188. package/lib/SuperUpload/SuperUpload.js +324 -0
  189. package/lib/SuperUpload/SuperUpload.less +27 -0
  190. package/lib/SuperUpload/package.json +6 -0
  191. package/lib/Title/Title.less +35 -35
  192. package/lib/Title/package.json +6 -6
  193. package/lib/Viewer/ImageViews.js +323 -0
  194. package/lib/Viewer/Viewer.js +167 -0
  195. package/lib/Viewer/Viewer.less +67 -0
  196. package/lib/Viewer/imgView.less +59 -0
  197. package/lib/Viewer/package.json +7 -0
  198. package/lib/WingBlank/WingBlank.js +37 -0
  199. package/lib/WingBlank/WingBlank.less +12 -0
  200. package/lib/WingBlank/package.json +6 -0
  201. package/lib/adjust.less +89 -0
  202. package/lib/helper.js +147 -0
  203. package/lib/history.js +18 -0
  204. package/lib/index.js +235 -1
  205. package/lib/index.less +25 -1
  206. package/lib/style.less +20 -1
  207. package/lib/variables.less +73 -73
  208. package/package.json +3 -2
@@ -0,0 +1,282 @@
1
+ import _Upload from "antd/es/upload";
2
+ import _slicedToArray from "@babel/runtime-corejs3/helpers/slicedToArray";
3
+ import _Button from "antd/es/button";
4
+ import _Icon from "antd/es/icon";
5
+ import _asyncToGenerator from "@babel/runtime-corejs3/helpers/asyncToGenerator";
6
+ import _defineProperty from "@babel/runtime-corejs3/helpers/defineProperty";
7
+
8
+ var _this = this;
9
+
10
+ import _regeneratorRuntime from "@babel/runtime-corejs3/regenerator";
11
+
12
+ function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
13
+
14
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context5, _context6; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context5 = ownKeys(Object(source), !0)).call(_context5, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context6 = ownKeys(Object(source))).call(_context6, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
15
+
16
+ import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
17
+ import _filterInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/filter";
18
+ import _indexOfInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/index-of";
19
+ import _Object$keys from "@babel/runtime-corejs3/core-js-stable/object/keys";
20
+ import _Object$getOwnPropertySymbols from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols";
21
+ import _Object$getOwnPropertyDescriptor from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor";
22
+ import _forEachInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/for-each";
23
+ import _Object$getOwnPropertyDescriptors from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors";
24
+ import _Object$defineProperties from "@babel/runtime-corejs3/core-js-stable/object/define-properties";
25
+ import _Object$defineProperty from "@babel/runtime-corejs3/core-js-stable/object/define-property";
26
+ import React, { useState, useEffect } from 'react';
27
+ import PropTypes from 'prop-types';
28
+ import helper from '../helper';
29
+ import Title from '../Title';
30
+ import variables from '../variables';
31
+ var FORMATS = ['image/jpeg', 'image/gif', 'image/bmp', 'image/jpg', 'image/png', 'image/tiff', 'image/gif', 'image/pcx', 'image/tga', 'image/exif', 'image/fpx', 'image/svg', 'image/psd', 'image/cdr', 'image/pcd', 'image/dxf', 'image/ufo', 'image/eps', 'image/ai', 'image/raw', 'image/WMF'];
32
+ var FORMATS1 = ['.jpeg', '.gif', '.bmp', '.jpg', '.png', '.tiff', '.pcx', '.tga', '.exif', '.fpx', '.svg', '.psd', '.cdr', '.pcd', '.dxf', '.ufo', '.eps', '.ai', '.raw', '.WMF']; //组件属性定义
33
+
34
+ var propTypes = {
35
+ fileList: PropTypes.array,
36
+ //文件列表
37
+ fileDeleteList: PropTypes.array,
38
+ //需要在页面关闭时删除的服务端文件
39
+ title: PropTypes.string,
40
+ //附件组的标题
41
+ required: PropTypes.bool,
42
+ //是否必须上传,默认false
43
+ listType: PropTypes.oneOf[('text', 'picture', 'picture-card')],
44
+ //上传列表的内建样式,支持三种,默认text
45
+ readonly: PropTypes.bool,
46
+ //所在页面是否只读,默认false
47
+ multiple: PropTypes.bool,
48
+ //可否多选文件上传,默认true
49
+ limitNumber: PropTypes.number,
50
+ //附件限制个数,默认10
51
+ limitText: PropTypes.any,
52
+ //附件个数达到时的文本,或者设置为false则不显示,为true时显示默认文本,默认值true
53
+ limitSize: PropTypes.number,
54
+ //单个附件限制大小,单位M,默认5
55
+ buttonTitle: PropTypes.string,
56
+ //上传按钮的标题,默认‘上传’
57
+ onFileChange: PropTypes.func //文件变更的回掉函数,func({fileList, fileDeleteList})
58
+
59
+ };
60
+
61
+ var convertFileList = function convertFileList(fileList) {
62
+ return _mapInstanceProperty(fileList).call(fileList, function (item) {
63
+ return {
64
+ fileFormat: item.fileFormat || 'id',
65
+ fileName: item.name,
66
+ fileUrl: item.response ? item.response.result : ''
67
+ };
68
+ });
69
+ };
70
+
71
+ var getUploadProps = function getUploadProps(props, onPreview, fileList, setFileList) {
72
+ var _props$readonly = props.readonly,
73
+ readonly = _props$readonly === void 0 ? false : _props$readonly,
74
+ _props$multiple = props.multiple,
75
+ multiple = _props$multiple === void 0 ? true : _props$multiple,
76
+ _props$limitSize = props.limitSize,
77
+ limitSize = _props$limitSize === void 0 ? 5 : _props$limitSize,
78
+ _props$listType = props.listType,
79
+ listType = _props$listType === void 0 ? 'picture-card' : _props$listType,
80
+ _props$fileDeleteList = props.fileDeleteList,
81
+ fileDeleteList = _props$fileDeleteList === void 0 ? [] : _props$fileDeleteList,
82
+ onFileChange = props.onFileChange;
83
+
84
+ var onChange = function onChange(_ref) {
85
+ var file = _ref.file,
86
+ fileList = _ref.fileList;
87
+ if (!file) return; //过滤掉不符合条件的响应
88
+
89
+ var newList = [];
90
+
91
+ if (file.response && file.response.returnCode !== 0) {
92
+ //检查是否上传到文件服务器成功
93
+ helper.showError("\u4E0A\u4F20\u5931\u8D25\uFF0C".concat(file.response.returnMsg || ''));
94
+ newList = _filterInstanceProperty(fileList).call(fileList, function (item) {
95
+ return item.uid !== file.uid;
96
+ });
97
+ } else {
98
+ var _context;
99
+
100
+ newList = _mapInstanceProperty(_context = _filterInstanceProperty(fileList).call(fileList, function (item) {
101
+ return item.status;
102
+ })).call(_context, function (item) {
103
+ return _indexOfInstanceProperty(FORMATS).call(FORMATS, item.type) === -1 ? _objectSpread(_objectSpread({}, item), {}, {
104
+ thumbUrl: '/default.png'
105
+ }) : item;
106
+ });
107
+ }
108
+
109
+ file.response && onFileChange && onFileChange({
110
+ fileList: convertFileList(newList),
111
+ fileDeleteList: fileDeleteList
112
+ });
113
+ setFileList(newList);
114
+ };
115
+
116
+ var onRemove = /*#__PURE__*/function () {
117
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(fileRemove) {
118
+ return _regeneratorRuntime.wrap(function _callee$(_context2) {
119
+ while (1) {
120
+ switch (_context2.prev = _context2.next) {
121
+ case 0:
122
+ case "end":
123
+ return _context2.stop();
124
+ }
125
+ }
126
+ }, _callee);
127
+ }));
128
+
129
+ return function onRemove(_x) {
130
+ return _ref2.apply(this, arguments);
131
+ };
132
+ }();
133
+
134
+ return {
135
+ action: _this.props.action || '/api/proxy/zuul/ict-service/file/upload/document',
136
+ fileList: fileList,
137
+ listType: listType,
138
+ multiple: multiple,
139
+ onChange: onChange,
140
+ onRemove: onRemove,
141
+ onPreview: listType === 'text' ? undefined : onPreview,
142
+ beforeUpload: function beforeUpload(currentFile) {
143
+ var isLt = currentFile.size / 1024 / 1024 < limitSize; // 附件大小限制,单位M
144
+
145
+ if (!isLt) {
146
+ helper.showError("\u9644\u4EF6\u5927\u5C0F\u4E0D\u80FD\u8D85\u8FC7".concat(limitSize, "M"));
147
+ }
148
+
149
+ return isLt;
150
+ },
151
+ showUploadList: {
152
+ showPreviewIcon: listType !== 'text',
153
+ showRemoveIcon: !readonly,
154
+ showDownloadIcon: true
155
+ }
156
+ };
157
+ };
158
+
159
+ function UploadButton(_ref3) {
160
+ var _ref3$buttonLabel = _ref3.buttonLabel,
161
+ buttonLabel = _ref3$buttonLabel === void 0 ? '上传' : _ref3$buttonLabel,
162
+ _ref3$title = _ref3.title,
163
+ title = _ref3$title === void 0 ? '附件' : _ref3$title,
164
+ _ref3$required = _ref3.required,
165
+ required = _ref3$required === void 0 ? false : _ref3$required,
166
+ _ref3$fileList = _ref3.fileList,
167
+ fileList = _ref3$fileList === void 0 ? [] : _ref3$fileList,
168
+ _ref3$limitText = _ref3.limitText,
169
+ limitText = _ref3$limitText === void 0 ? true : _ref3$limitText,
170
+ _ref3$limitNumber = _ref3.limitNumber,
171
+ limitNumber = _ref3$limitNumber === void 0 ? 10 : _ref3$limitNumber,
172
+ _ref3$listType = _ref3.listType,
173
+ listType = _ref3$listType === void 0 ? 'picture-card' : _ref3$listType;
174
+ var canUpload = fileList.length < limitNumber;
175
+ return canUpload ? listType === 'picture-card' ? /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(_Icon, {
176
+ type: "plus"
177
+ }), /*#__PURE__*/React.createElement("div", {
178
+ className: "ant-upload-text"
179
+ }, "Upload")) : /*#__PURE__*/React.createElement(Title, {
180
+ title: title,
181
+ required: required
182
+ }, /*#__PURE__*/React.createElement(_Button, {
183
+ size: "small",
184
+ style: {
185
+ display: 'block',
186
+ margin: '8px'
187
+ }
188
+ }, buttonLabel)) : listType === 'picture-card' ? null : /*#__PURE__*/React.createElement(Title, {
189
+ title: title,
190
+ required: required
191
+ }, !limitText ? null : /*#__PURE__*/React.createElement("span", null, limitText === true ? "\u9644\u4EF6\u4E2A\u6570\u82E5\u5927\u4E8E".concat(limitNumber, "\u4E2A\u8BF7\u538B\u7F29\u540E\u4E0A\u4F20") : limitText));
192
+ }
193
+
194
+ function SuperUpload(props) {
195
+ var _this2 = this;
196
+
197
+ var _useState = useState(true),
198
+ _useState2 = _slicedToArray(_useState, 2),
199
+ loading = _useState2[0],
200
+ setLoading = _useState2[1];
201
+
202
+ var _useState3 = useState([]),
203
+ _useState4 = _slicedToArray(_useState3, 2),
204
+ fileList = _useState4[0],
205
+ setFileList = _useState4[1];
206
+
207
+ var getFileList = this.props.getFileList;
208
+ useEffect(function () {
209
+ function fetchImgData() {
210
+ return _fetchImgData.apply(this, arguments);
211
+ }
212
+
213
+ function _fetchImgData() {
214
+ _fetchImgData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
215
+ var initFileList;
216
+ return _regeneratorRuntime.wrap(function _callee2$(_context3) {
217
+ while (1) {
218
+ switch (_context3.prev = _context3.next) {
219
+ case 0:
220
+ _context3.next = 2;
221
+ return getFileList(props.fileList);
222
+
223
+ case 2:
224
+ initFileList = _context3.sent;
225
+ setFileList(initFileList);
226
+ setLoading(false);
227
+
228
+ case 5:
229
+ case "end":
230
+ return _context3.stop();
231
+ }
232
+ }
233
+ }, _callee2);
234
+ }));
235
+ return _fetchImgData.apply(this, arguments);
236
+ }
237
+
238
+ fetchImgData();
239
+ }, []);
240
+
241
+ var onPreview = /*#__PURE__*/function () {
242
+ var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(file) {
243
+ var onPreview;
244
+ return _regeneratorRuntime.wrap(function _callee3$(_context4) {
245
+ while (1) {
246
+ switch (_context4.prev = _context4.next) {
247
+ case 0:
248
+ onPreview = _this2.props.onPreview;
249
+ onPreview && onPreview(file);
250
+
251
+ case 2:
252
+ case "end":
253
+ return _context4.stop();
254
+ }
255
+ }
256
+ }, _callee3);
257
+ }));
258
+
259
+ return function onPreview(_x2) {
260
+ return _ref4.apply(this, arguments);
261
+ };
262
+ }();
263
+
264
+ var uploadProps = getUploadProps(props, onPreview, fileList, setFileList);
265
+ var _props$listType2 = props.listType,
266
+ listType = _props$listType2 === void 0 ? 'picture-card' : _props$listType2,
267
+ _props$limitNumber = props.limitNumber,
268
+ limitNumber = _props$limitNumber === void 0 ? 10 : _props$limitNumber,
269
+ readonly = props.readonly,
270
+ title = props.title;
271
+ var className = listType === 'picture-card' && fileList.length < limitNumber ? variables('SuperUpload') : variables('SuperUpload2');
272
+ return loading ? /*#__PURE__*/React.createElement("div", null, "loading...") : /*#__PURE__*/React.createElement("div", {
273
+ className: className
274
+ }, (listType === 'picture-card' || readonly) && title ? /*#__PURE__*/React.createElement(Title, {
275
+ title: props.title || '附件',
276
+ required: props.required
277
+ }) : null, /*#__PURE__*/React.createElement(_Upload, uploadProps, readonly ? null : /*#__PURE__*/React.createElement(UploadButton, _objectSpread(_objectSpread({}, props), {}, {
278
+ fileList: fileList
279
+ }))));
280
+ }
281
+
282
+ export default SuperUpload;
@@ -0,0 +1,27 @@
1
+ @import '../variables.less';
2
+
3
+ .@{cloudlink-prefix}-SuperUpload{
4
+ overflow: hidden;
5
+
6
+ :global(.ant-upload-list-item) {
7
+ display: inline-block;
8
+ margin: 10px;
9
+ }
10
+
11
+ :global(.ant-upload-select-picture-card) {
12
+ margin: 10px;
13
+ }
14
+ }
15
+
16
+ .@{cloudlink-prefix}-SuperUpload2 {
17
+ overflow: hidden;
18
+
19
+ :global(.ant-upload-list-item) {
20
+ display: inline-block;
21
+ margin: 10px;
22
+ }
23
+
24
+ :global(.ant-upload-select-picture-card) {
25
+ display: block !important;
26
+ }
27
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "name": "SuperUpload",
3
+ "version": "0.0.0",
4
+ "private": true,
5
+ "main": "./SuperUpload.js"
6
+ }
@@ -1,35 +1,35 @@
1
- @import '../variables';
2
-
3
- .@{cloudlink-prefix}-title {
4
- > *:first-child {
5
- display: inline-block;
6
- color: @brand-primary;
7
- line-height: 1.2;
8
-
9
- &[data-border='true'] {
10
- padding: 0 5px;
11
- border-left: @brand-primary solid 3px;
12
- }
13
-
14
- &[data-fold='true'] {
15
- cursor: pointer;
16
- margin: 8px 0;
17
- }
18
-
19
- &[data-required='true'] {
20
- &::after {
21
- display: inline-block;
22
- margin-left: 4px;
23
- color: #f5222d;
24
- font-size: 12px;
25
- font-family: SimSun, sans-serif;
26
- line-height: 1;
27
- content: '*';
28
- }
29
- }
30
- }
31
-
32
- > [role = 'toolbar'] {
33
- display: inline-block;
34
- }
35
- }
1
+ @import '../variables';
2
+
3
+ .@{cloudlink-prefix}-title {
4
+ > *:first-child {
5
+ display: inline-block;
6
+ color: @brand-primary;
7
+ line-height: 1.2;
8
+
9
+ &[data-border='true'] {
10
+ padding: 0 5px;
11
+ border-left: @brand-primary solid 3px;
12
+ }
13
+
14
+ &[data-fold='true'] {
15
+ cursor: pointer;
16
+ margin: 8px 0;
17
+ }
18
+
19
+ &[data-required='true'] {
20
+ &::after {
21
+ display: inline-block;
22
+ margin-left: 4px;
23
+ color: #f5222d;
24
+ font-size: 12px;
25
+ font-family: SimSun, sans-serif;
26
+ line-height: 1;
27
+ content: '*';
28
+ }
29
+ }
30
+ }
31
+
32
+ > [role = 'toolbar'] {
33
+ display: inline-block;
34
+ }
35
+ }
@@ -1,6 +1,6 @@
1
- {
2
- "name": "Title",
3
- "version": "0.0.0",
4
- "private": true,
5
- "main": "./Title.js"
6
- }
1
+ {
2
+ "name": "Title",
3
+ "version": "0.0.0",
4
+ "private": true,
5
+ "main": "./Title.js"
6
+ }