linkmore-design 1.0.68 → 1.0.71

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 (314) hide show
  1. package/README.md +11 -7
  2. package/dist/Approval/demos/basic.d.ts +1 -0
  3. package/dist/ImageViewer/LmImageViewer.d.ts +5 -0
  4. package/dist/ImageViewer/demos/basic.d.ts +2 -0
  5. package/dist/ImageViewer/index.d.ts +2 -0
  6. package/dist/ImageViewer/style/index.d.ts +1 -0
  7. package/dist/ImageViewer/wrapeer/Root.d.ts +3 -0
  8. package/dist/LmFilter/components/InputFilter.d.ts +2 -2
  9. package/dist/LmFilter/filterFns/index.d.ts +1 -1
  10. package/dist/LmFilter/localization.d.ts +1 -0
  11. package/dist/LmFilter/utils.d.ts +1 -1
  12. package/dist/LmSelect/useCheckboxOptions.d.ts +1 -0
  13. package/dist/LmUpload/LmUpload.d.ts +2 -0
  14. package/dist/LmUpload/UploadList/ItemPicture.d.ts +2 -1
  15. package/dist/LmUpload/UploadList/ItemText.d.ts +2 -1
  16. package/dist/LmUpload/UploadList/RenderItem.d.ts +1 -5
  17. package/dist/LmUpload/UploadList/index.d.ts +4 -3
  18. package/dist/LmUpload/demos/card.d.ts +2 -0
  19. package/dist/LmUpload/demos/picture.d.ts +2 -0
  20. package/dist/LmUpload/fns/index.d.ts +5 -0
  21. package/dist/LmUpload/utils.d.ts +1 -0
  22. package/dist/LmUpload/wrapper/UploadContainer.d.ts +4 -3
  23. package/dist/index.d.ts +1 -0
  24. package/dist/index.umd.js +4081 -603
  25. package/dist/index.umd.min.js +6 -6
  26. package/es/Affix/style/index.css +6 -0
  27. package/es/Alert/style/index.css +6 -0
  28. package/es/Approval/index.js +4 -4
  29. package/es/Approval/style/index.css +18 -4
  30. package/es/AutoComplete/style/index.css +6 -0
  31. package/es/Avatar/style/index.css +6 -0
  32. package/es/Breadcrumb/style/index.css +6 -0
  33. package/es/ButtonTags/style/index.css +6 -0
  34. package/es/Calendar/style/index.css +6 -0
  35. package/es/Card/style/index.css +6 -0
  36. package/es/CardTable/fns/index.js +5 -8
  37. package/es/CardTable/table/TableRoot.js +2 -1
  38. package/es/Carousel/style/index.css +6 -0
  39. package/es/Cascader/style/index.css +6 -0
  40. package/es/CkFilter/complexFilter/drawer.js +1 -4
  41. package/es/CkFilter/complexFilter/saveModal.js +5 -7
  42. package/es/CkFilter/components/CustomModal.js +2 -3
  43. package/es/CkFilter/components/filterTypes.js +1 -3
  44. package/es/CkFilter/components/modal.js +2 -5
  45. package/es/CkFilter/components/modalBack.js +2 -3
  46. package/es/CkFilter/customFilter/drawer.js +6 -11
  47. package/es/CkFilter/style/index.css +6 -0
  48. package/es/Col/style/index.css +6 -0
  49. package/es/Collapse/style/index.css +6 -0
  50. package/es/Comment/style/index.css +6 -0
  51. package/es/CustomTableOption/style/index.css +6 -0
  52. package/es/CustomerService/style/index.css +6 -0
  53. package/es/DatePicker/style/index.css +6 -0
  54. package/es/Descriptions/style/index.css +6 -0
  55. package/es/Drawer/style/index.css +6 -0
  56. package/es/Dropdown/style/index.css +6 -0
  57. package/es/EditTable/style/index.css +6 -0
  58. package/es/Empty/style/index.css +6 -0
  59. package/es/Filter/baseFilter/Popover.js +0 -1
  60. package/es/Filter/baseFilter/ToggleFilter.js +0 -1
  61. package/es/Filter/edit/editFilter.js +2 -6
  62. package/es/Filter/remember.js +0 -1
  63. package/es/Filter/style/index.css +6 -0
  64. package/es/Form/style/index.css +6 -0
  65. package/es/Grid/style/index.css +6 -0
  66. package/es/Icon/style/index.css +6 -0
  67. package/es/IconFont/font/iconfont.js +1 -1
  68. package/es/Image/style/index.css +6 -0
  69. package/es/ImageViewer/LmImageViewer.d.ts +5 -0
  70. package/es/ImageViewer/LmImageViewer.js +26 -0
  71. package/es/ImageViewer/index.d.ts +2 -0
  72. package/es/ImageViewer/index.js +2 -0
  73. package/es/ImageViewer/style/index.css +211 -0
  74. package/es/ImageViewer/style/index.js +3 -0
  75. package/es/ImageViewer/wrapeer/Root.d.ts +3 -0
  76. package/es/ImageViewer/wrapeer/Root.js +12 -0
  77. package/es/Input/style/index.css +6 -0
  78. package/es/InputNumber/style/index.css +6 -0
  79. package/es/Layout/style/index.css +6 -0
  80. package/es/LeftTable/style/index.css +6 -0
  81. package/es/List/style/index.css +6 -0
  82. package/es/LmEditTable/style/index.css +6 -0
  83. package/es/LmFilter/complexFilter/drawer.js +2 -7
  84. package/es/LmFilter/complexFilter/valueDrawer.js +2 -5
  85. package/es/LmFilter/components/CascaderFilter.js +3 -2
  86. package/es/LmFilter/components/CheckboxFilter.js +3 -3
  87. package/es/LmFilter/components/DropdownFIlter.js +71 -65
  88. package/es/LmFilter/components/InputFilter.js +1 -2
  89. package/es/LmFilter/components/SelectFilter.js +2 -2
  90. package/es/LmFilter/components/index.js +7 -5
  91. package/es/LmFilter/customFilter/drawer.js +7 -25
  92. package/es/LmFilter/customFilter/saveModal.js +2 -3
  93. package/es/LmFilter/customFilter/valueDrawer.js +2 -5
  94. package/es/LmFilter/filterFns/index.js +4 -6
  95. package/es/LmFilter/localization.d.ts +1 -0
  96. package/es/LmFilter/localization.js +2 -1
  97. package/es/LmFilter/utils.js +41 -22
  98. package/es/LmFilter/wrapper/FilterRoot.js +0 -2
  99. package/es/LmSelect/style/index.css +6 -0
  100. package/es/LmSelect/useCheckboxOptions.d.ts +1 -0
  101. package/es/LmSelect/useCheckboxOptions.js +4 -3
  102. package/es/LmTable/Table.js +0 -1
  103. package/es/LmTable/autosize.js +0 -3
  104. package/es/LmTable/style/index.css +6 -0
  105. package/es/LmUpload/LmUpload.d.ts +2 -0
  106. package/es/LmUpload/LmUpload.js +54 -22
  107. package/es/LmUpload/UploadList/ItemPicture.d.ts +2 -1
  108. package/es/LmUpload/UploadList/ItemPicture.js +23 -8
  109. package/es/LmUpload/UploadList/ItemPictureCard.js +18 -9
  110. package/es/LmUpload/UploadList/ItemText.d.ts +2 -1
  111. package/es/LmUpload/UploadList/ItemText.js +13 -7
  112. package/es/LmUpload/UploadList/RenderItem.d.ts +1 -5
  113. package/es/LmUpload/UploadList/RenderItem.js +3 -3
  114. package/es/LmUpload/UploadList/index.d.ts +4 -3
  115. package/es/LmUpload/UploadList/index.js +14 -8
  116. package/es/LmUpload/body/Progress.js +2 -2
  117. package/es/LmUpload/body/UploadCore.js +5 -4
  118. package/es/LmUpload/body/UploadPicture.js +4 -4
  119. package/es/LmUpload/fns/index.d.ts +5 -0
  120. package/es/LmUpload/fns/index.js +138 -42
  121. package/es/LmUpload/style/index.css +6 -0
  122. package/es/LmUpload/utils.d.ts +1 -0
  123. package/es/LmUpload/utils.js +14 -1
  124. package/es/LmUpload/view/index.js +2 -2
  125. package/es/LmUpload/wrapper/UploadContainer.d.ts +4 -3
  126. package/es/LmUpload/wrapper/UploadContainer.js +19 -3
  127. package/es/LmUpload/wrapper/UploadRoot.js +9 -1
  128. package/es/LmUpload/wrapper/UploadWrapper.js +4 -8
  129. package/es/LmUpload/wrapper/reducer.js +2 -1
  130. package/es/Mentions/style/index.css +6 -0
  131. package/es/Menu/style/index.css +6 -0
  132. package/es/Modal/style/index.css +6 -0
  133. package/es/PageHeader/style/index.css +6 -0
  134. package/es/Pagination/style/index.css +6 -0
  135. package/es/PopTable/style/index.css +6 -0
  136. package/es/Popconfirm/style/index.css +6 -0
  137. package/es/Popover/style/index.css +6 -0
  138. package/es/ProTable/Table.js +0 -1
  139. package/es/ProTable/autosize.js +0 -3
  140. package/es/ProTable/style/index.css +6 -0
  141. package/es/Progress/style/index.css +6 -0
  142. package/es/QuickMenu/style/index.css +6 -0
  143. package/es/Rate/style/index.css +6 -0
  144. package/es/Row/style/index.css +6 -0
  145. package/es/Segmented/style/index.css +6 -0
  146. package/es/Select/style/index.css +6 -0
  147. package/es/Slider/style/index.css +6 -0
  148. package/es/Space/style/index.css +6 -0
  149. package/es/Spin/style/index.css +6 -0
  150. package/es/Statistic/style/index.css +6 -0
  151. package/es/Steps/style/index.css +6 -0
  152. package/es/Switch/style/index.css +6 -0
  153. package/es/Table/style/index.css +6 -0
  154. package/es/Tabs/style/index.css +6 -0
  155. package/es/Tag/style/index.css +6 -0
  156. package/es/TimePicker/style/index.css +6 -0
  157. package/es/Timeline/style/index.css +6 -0
  158. package/es/Tooltip/style/index.css +6 -0
  159. package/es/Transfer/style/index.css +6 -0
  160. package/es/Tree/style/index.css +6 -0
  161. package/es/TreeSelect/style/index.css +6 -0
  162. package/es/Typography/style/index.css +6 -0
  163. package/es/Upload/style/index.css +6 -0
  164. package/es/index.d.ts +1 -0
  165. package/es/index.js +1 -0
  166. package/es/message/style/index.css +6 -0
  167. package/es/notification/style/index.css +6 -0
  168. package/es/styles/main.css +6 -0
  169. package/es/styles/resetAntd.css +3 -0
  170. package/lib/Affix/style/index.css +6 -0
  171. package/lib/Alert/style/index.css +6 -0
  172. package/lib/Approval/index.js +4 -4
  173. package/lib/Approval/style/index.css +18 -4
  174. package/lib/AutoComplete/style/index.css +6 -0
  175. package/lib/Avatar/style/index.css +6 -0
  176. package/lib/Breadcrumb/style/index.css +6 -0
  177. package/lib/ButtonTags/style/index.css +6 -0
  178. package/lib/Calendar/style/index.css +6 -0
  179. package/lib/Card/style/index.css +6 -0
  180. package/lib/CardTable/fns/index.js +5 -8
  181. package/lib/CardTable/table/TableRoot.js +2 -1
  182. package/lib/Carousel/style/index.css +6 -0
  183. package/lib/Cascader/style/index.css +6 -0
  184. package/lib/CkFilter/complexFilter/drawer.js +1 -4
  185. package/lib/CkFilter/complexFilter/saveModal.js +5 -7
  186. package/lib/CkFilter/components/CustomModal.js +2 -3
  187. package/lib/CkFilter/components/filterTypes.js +1 -3
  188. package/lib/CkFilter/components/modal.js +2 -5
  189. package/lib/CkFilter/components/modalBack.js +2 -3
  190. package/lib/CkFilter/customFilter/drawer.js +6 -11
  191. package/lib/CkFilter/style/index.css +6 -0
  192. package/lib/Col/style/index.css +6 -0
  193. package/lib/Collapse/style/index.css +6 -0
  194. package/lib/Comment/style/index.css +6 -0
  195. package/lib/CustomTableOption/style/index.css +6 -0
  196. package/lib/CustomerService/style/index.css +6 -0
  197. package/lib/DatePicker/style/index.css +6 -0
  198. package/lib/Descriptions/style/index.css +6 -0
  199. package/lib/Drawer/style/index.css +6 -0
  200. package/lib/Dropdown/style/index.css +6 -0
  201. package/lib/EditTable/style/index.css +6 -0
  202. package/lib/Empty/style/index.css +6 -0
  203. package/lib/Filter/baseFilter/Popover.js +0 -1
  204. package/lib/Filter/baseFilter/ToggleFilter.js +0 -1
  205. package/lib/Filter/edit/editFilter.js +2 -6
  206. package/lib/Filter/remember.js +0 -1
  207. package/lib/Filter/style/index.css +6 -0
  208. package/lib/Form/style/index.css +6 -0
  209. package/lib/Grid/style/index.css +6 -0
  210. package/lib/Icon/style/index.css +6 -0
  211. package/lib/IconFont/font/iconfont.js +1 -1
  212. package/lib/Image/style/index.css +6 -0
  213. package/lib/ImageViewer/LmImageViewer.d.ts +5 -0
  214. package/lib/ImageViewer/LmImageViewer.js +40 -0
  215. package/lib/ImageViewer/index.d.ts +2 -0
  216. package/lib/ImageViewer/index.js +13 -0
  217. package/lib/ImageViewer/style/index.css +211 -0
  218. package/lib/ImageViewer/style/index.js +3 -0
  219. package/lib/ImageViewer/wrapeer/Root.d.ts +3 -0
  220. package/lib/ImageViewer/wrapeer/Root.js +23 -0
  221. package/lib/Input/style/index.css +6 -0
  222. package/lib/InputNumber/style/index.css +6 -0
  223. package/lib/Layout/style/index.css +6 -0
  224. package/lib/LeftTable/style/index.css +6 -0
  225. package/lib/List/style/index.css +6 -0
  226. package/lib/LmEditTable/style/index.css +6 -0
  227. package/lib/LmFilter/complexFilter/drawer.js +2 -7
  228. package/lib/LmFilter/complexFilter/valueDrawer.js +2 -5
  229. package/lib/LmFilter/components/CascaderFilter.js +3 -2
  230. package/lib/LmFilter/components/CheckboxFilter.js +3 -3
  231. package/lib/LmFilter/components/DropdownFIlter.js +71 -65
  232. package/lib/LmFilter/components/InputFilter.js +1 -2
  233. package/lib/LmFilter/components/SelectFilter.js +2 -2
  234. package/lib/LmFilter/components/index.js +7 -5
  235. package/lib/LmFilter/customFilter/drawer.js +7 -25
  236. package/lib/LmFilter/customFilter/saveModal.js +2 -3
  237. package/lib/LmFilter/customFilter/valueDrawer.js +2 -5
  238. package/lib/LmFilter/filterFns/index.js +4 -6
  239. package/lib/LmFilter/localization.d.ts +1 -0
  240. package/lib/LmFilter/localization.js +4 -2
  241. package/lib/LmFilter/utils.js +41 -22
  242. package/lib/LmFilter/wrapper/FilterRoot.js +0 -2
  243. package/lib/LmSelect/style/index.css +6 -0
  244. package/lib/LmSelect/useCheckboxOptions.d.ts +1 -0
  245. package/lib/LmSelect/useCheckboxOptions.js +7 -5
  246. package/lib/LmTable/Table.js +0 -1
  247. package/lib/LmTable/autosize.js +0 -3
  248. package/lib/LmTable/style/index.css +6 -0
  249. package/lib/LmUpload/LmUpload.d.ts +2 -0
  250. package/lib/LmUpload/LmUpload.js +53 -22
  251. package/lib/LmUpload/UploadList/ItemPicture.d.ts +2 -1
  252. package/lib/LmUpload/UploadList/ItemPicture.js +26 -8
  253. package/lib/LmUpload/UploadList/ItemPictureCard.js +18 -9
  254. package/lib/LmUpload/UploadList/ItemText.d.ts +2 -1
  255. package/lib/LmUpload/UploadList/ItemText.js +16 -7
  256. package/lib/LmUpload/UploadList/RenderItem.d.ts +1 -5
  257. package/lib/LmUpload/UploadList/RenderItem.js +3 -3
  258. package/lib/LmUpload/UploadList/index.d.ts +4 -3
  259. package/lib/LmUpload/UploadList/index.js +15 -10
  260. package/lib/LmUpload/body/Progress.js +2 -2
  261. package/lib/LmUpload/body/UploadCore.js +10 -9
  262. package/lib/LmUpload/body/UploadPicture.js +4 -4
  263. package/lib/LmUpload/fns/index.d.ts +5 -0
  264. package/lib/LmUpload/fns/index.js +138 -42
  265. package/lib/LmUpload/style/index.css +6 -0
  266. package/lib/LmUpload/utils.d.ts +1 -0
  267. package/lib/LmUpload/utils.js +16 -1
  268. package/lib/LmUpload/view/index.js +2 -2
  269. package/lib/LmUpload/wrapper/UploadContainer.d.ts +4 -3
  270. package/lib/LmUpload/wrapper/UploadContainer.js +21 -3
  271. package/lib/LmUpload/wrapper/UploadRoot.js +9 -1
  272. package/lib/LmUpload/wrapper/UploadWrapper.js +5 -12
  273. package/lib/LmUpload/wrapper/reducer.js +2 -1
  274. package/lib/Mentions/style/index.css +6 -0
  275. package/lib/Menu/style/index.css +6 -0
  276. package/lib/Modal/style/index.css +6 -0
  277. package/lib/PageHeader/style/index.css +6 -0
  278. package/lib/Pagination/style/index.css +6 -0
  279. package/lib/PopTable/style/index.css +6 -0
  280. package/lib/Popconfirm/style/index.css +6 -0
  281. package/lib/Popover/style/index.css +6 -0
  282. package/lib/ProTable/Table.js +0 -1
  283. package/lib/ProTable/autosize.js +0 -3
  284. package/lib/ProTable/style/index.css +6 -0
  285. package/lib/Progress/style/index.css +6 -0
  286. package/lib/QuickMenu/style/index.css +6 -0
  287. package/lib/Rate/style/index.css +6 -0
  288. package/lib/Row/style/index.css +6 -0
  289. package/lib/Segmented/style/index.css +6 -0
  290. package/lib/Select/style/index.css +6 -0
  291. package/lib/Slider/style/index.css +6 -0
  292. package/lib/Space/style/index.css +6 -0
  293. package/lib/Spin/style/index.css +6 -0
  294. package/lib/Statistic/style/index.css +6 -0
  295. package/lib/Steps/style/index.css +6 -0
  296. package/lib/Switch/style/index.css +6 -0
  297. package/lib/Table/style/index.css +6 -0
  298. package/lib/Tabs/style/index.css +6 -0
  299. package/lib/Tag/style/index.css +6 -0
  300. package/lib/TimePicker/style/index.css +6 -0
  301. package/lib/Timeline/style/index.css +6 -0
  302. package/lib/Tooltip/style/index.css +6 -0
  303. package/lib/Transfer/style/index.css +6 -0
  304. package/lib/Tree/style/index.css +6 -0
  305. package/lib/TreeSelect/style/index.css +6 -0
  306. package/lib/Typography/style/index.css +6 -0
  307. package/lib/Upload/style/index.css +6 -0
  308. package/lib/index.d.ts +1 -0
  309. package/lib/index.js +8 -0
  310. package/lib/message/style/index.css +6 -0
  311. package/lib/notification/style/index.css +6 -0
  312. package/lib/styles/main.css +6 -0
  313. package/lib/styles/resetAntd.css +3 -0
  314. package/package.json +2 -1
@@ -41,13 +41,30 @@ var useCoreOptions = function useCoreOptions(_ref) {
41
41
  var state = _ref.state,
42
42
  dispatch = _ref.dispatch,
43
43
  props = _ref.props;
44
- var onChange = props.onChange,
44
+ var uid = props.uid,
45
+ onChange = props.onChange,
45
46
  type = props.type,
46
47
  fileSize = props.fileSize,
47
- ossConfig = props.ossConfig; // 上传完成
48
+ enabledOss = props.enabledOss,
49
+ ossConfig = props.ossConfig; // 获取当前的文件列表
48
50
 
49
- var uploadOnChange = useCallback(function (file) {
50
- var fileList = [file].concat(_toConsumableArray(state.fileList));
51
+ var getFileList = useCallback(function () {
52
+ return props.fileList || state.fileList;
53
+ }, [props.fileList, state.fileList]); // 获取上传状态
54
+
55
+ var getUploadStatus = useCallback(function () {
56
+ var uploading = typeof state.percent === 'number';
57
+ return {
58
+ uploading: uploading
59
+ };
60
+ }, [state.percent]); // 获取是否达到最大上传数量
61
+
62
+ var getIsMaxCount = useCallback(function () {
63
+ return typeof props.maxCount === 'number' && !(getFileList().length < props.maxCount);
64
+ }, [getFileList, props.maxCount]); // 上传完成
65
+
66
+ var uploadDone = useCallback(function (file) {
67
+ var fileList = [file].concat(_toConsumableArray(getFileList()));
51
68
  dispatch({
52
69
  type: 'changeFileList',
53
70
  fileList: fileList
@@ -61,17 +78,38 @@ var useCoreOptions = function useCoreOptions(_ref) {
61
78
  file: file,
62
79
  fileList: fileList
63
80
  });
64
- }, [state.fileList]); // 上传至ali-oss
81
+ }, [getFileList]); // 上传进度事件
82
+
83
+ var uploadProgress = useCallback(function (file, _ref2) {
84
+ var progress = _ref2.progress,
85
+ checkPoint = _ref2.checkPoint,
86
+ result = _ref2.result;
87
+ onChange({
88
+ file: file,
89
+ fileList: getFileList(),
90
+ event: {
91
+ progress: progress,
92
+ checkPoint: checkPoint,
93
+ result: result,
94
+ status: typeof progress !== 'number' ? 'done' : 'uploading'
95
+ }
96
+ });
97
+ dispatch({
98
+ type: 'changePercent',
99
+ percent: Number((progress * 100).toFixed(2))
100
+ });
101
+ }, [getFileList]); // 上传至ali-oss
65
102
 
66
103
  var uploadOss = useCallback(function (file) {
67
104
  return __awaiter(void 0, void 0, void 0, /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
68
- var _a, dir, shortlink, region, accessKeyId, accessKeySecret, stsToken, bucket, client, fileName, pathName, url, result, seq, params;
105
+ var _a, _ossConfig, _ossConfig$dir, dir, shortlink, _ossConfig$region, region, accessKeyId, accessKeySecret, stsToken, _ossConfig$bucket, bucket, client, timestamp, fileName, pathName, url, seq, params;
69
106
 
70
107
  return _regeneratorRuntime.wrap(function _callee$(_context) {
71
108
  while (1) {
72
109
  switch (_context.prev = _context.next) {
73
110
  case 0:
74
- dir = ossConfig.dir, shortlink = ossConfig.shortlink, region = ossConfig.region, accessKeyId = ossConfig.accessKeyId, accessKeySecret = ossConfig.accessKeySecret, stsToken = ossConfig.stsToken, bucket = ossConfig.bucket;
111
+ _context.prev = 0;
112
+ _ossConfig = ossConfig(), _ossConfig$dir = _ossConfig.dir, dir = _ossConfig$dir === void 0 ? '/BizFile/4595/Supplier/' : _ossConfig$dir, shortlink = _ossConfig.shortlink, _ossConfig$region = _ossConfig.region, region = _ossConfig$region === void 0 ? 'oss-cn-hangzhou' : _ossConfig$region, accessKeyId = _ossConfig.accessKeyId, accessKeySecret = _ossConfig.accessKeySecret, stsToken = _ossConfig.stsToken, _ossConfig$bucket = _ossConfig.bucket, bucket = _ossConfig$bucket === void 0 ? 'linkmore-scm-test' : _ossConfig$bucket;
75
113
  client = new OSS({
76
114
  region: region,
77
115
  accessKeyId: accessKeyId,
@@ -79,24 +117,18 @@ var useCoreOptions = function useCoreOptions(_ref) {
79
117
  stsToken: stsToken,
80
118
  bucket: bucket
81
119
  });
82
- _context.prev = 2;
83
- fileName = "".concat(Date.now(), "-").concat(file.name);
120
+ timestamp = Date.now();
121
+ fileName = "".concat(timestamp, "-").concat(file.name);
84
122
  pathName = dir.slice(-1) === '/' ? "".concat(dir).concat(fileName) : "".concat(dir, "/").concat(fileName);
85
123
  url = "".concat(shortlink).concat(pathName) || '';
86
- _context.next = 8;
124
+ _context.next = 9;
87
125
  return client.multipartUpload(pathName, file, {
88
126
  // 获取分片上传进度、断点和返回值。
89
- progress: function progress(p, cpt, res) {
90
- onChange({
91
- event: {
92
- progress: p,
93
- checkPoint: cpt,
94
- result: res
95
- }
96
- });
97
- dispatch({
98
- type: 'changePercent',
99
- percent: Number((p * 100).toFixed(2))
127
+ progress: function progress(_progress, checkPoint, result) {
128
+ return uploadProgress(file, {
129
+ progress: _progress,
130
+ checkPoint: checkPoint,
131
+ result: result
100
132
  });
101
133
  },
102
134
  parallel: 4,
@@ -104,10 +136,10 @@ var useCoreOptions = function useCoreOptions(_ref) {
104
136
 
105
137
  });
106
138
 
107
- case 8:
108
- result = _context.sent;
139
+ case 9:
109
140
  seq = (((_a = state.fileList) === null || _a === void 0 ? void 0 : _a.length) || 0) + 1;
110
141
  params = {
142
+ uid: timestamp,
111
143
  fileTypeCode: file.type,
112
144
  fileTypeName: file.type,
113
145
  fileName: fileName,
@@ -119,24 +151,39 @@ var useCoreOptions = function useCoreOptions(_ref) {
119
151
  seq: seq,
120
152
  url: url
121
153
  };
122
- uploadOnChange(params);
123
- console.log('result', result);
154
+ uploadDone(params);
124
155
  _context.next = 18;
125
156
  break;
126
157
 
127
- case 15:
128
- _context.prev = 15;
129
- _context.t0 = _context["catch"](2);
130
- console.log('error:', _context.t0);
158
+ case 14:
159
+ _context.prev = 14;
160
+ _context.t0 = _context["catch"](0);
161
+ console.log('上传报错:', _context.t0);
162
+ onChange === null || onChange === void 0 ? void 0 : onChange({
163
+ file: file,
164
+ fileList: getFileList(),
165
+ event: {
166
+ status: 'error'
167
+ }
168
+ });
131
169
 
132
170
  case 18:
133
171
  case "end":
134
172
  return _context.stop();
135
173
  }
136
174
  }
137
- }, _callee, null, [[2, 15]]);
175
+ }, _callee, null, [[0, 14]]);
138
176
  }));
139
- }, [ossConfig, uploadOnChange]); // 上传前的检测
177
+ }, [ossConfig, uploadDone, uploadProgress, getFileList]);
178
+ var customUpload = useCallback(function (file) {
179
+ var _a;
180
+
181
+ (_a = props.fileUpload) === null || _a === void 0 ? void 0 : _a.call(props, {
182
+ file: file,
183
+ value: getFileList(),
184
+ onChange: uploadDone
185
+ });
186
+ }, [props.fileUpload, getFileList, uploadDone]); // 上传前的检测
140
187
 
141
188
  var beforeUpload = useCallback(function (e) {
142
189
  var files = e.target.files; // 循环文件检查是否存在不符合要求的文件
@@ -153,27 +200,76 @@ var useCoreOptions = function useCoreOptions(_ref) {
153
200
  return message.warning("\u6587\u4EF6\u4E0A\u4F20\u5931\u8D25\uFF01\u9644\u4EF6\u5927\u5C0F\u4E0D\u80FD\u8D85\u8FC7".concat(fileSize, "M\uFF01"), 1.5);
154
201
  }
155
202
 
156
- uploadOss(item); // 单个文件上传
157
- // fileUpload?.({ file: item, size, value, onChange: uploadOnChange, isImg: true });
203
+ enabledOss && uploadOss(item); // 单个文件上传
204
+
205
+ customUpload(item);
158
206
  }
159
207
 
160
208
  return false;
161
- }, [type, fileSize, uploadOss]); // 获取上传状态
209
+ }, [type, fileSize, uploadOss, customUpload]); // 删除事件
162
210
 
163
- var getUploadStatus = useCallback(function () {
164
- var uploading = typeof state.percent === 'number';
165
- return {
166
- uploading: uploading
167
- };
168
- }, [state.percent]);
211
+ var remove = useCallback(function (file) {
212
+ return __awaiter(void 0, void 0, void 0, /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
213
+ var _b, _c, res, fileList;
214
+
215
+ return _regeneratorRuntime.wrap(function _callee2$(_context2) {
216
+ while (1) {
217
+ switch (_context2.prev = _context2.next) {
218
+ case 0:
219
+ _context2.next = 2;
220
+ return (_b = props.onRemove) === null || _b === void 0 ? void 0 : _b.call(props, file);
221
+
222
+ case 2:
223
+ res = _context2.sent;
224
+
225
+ if (res) {
226
+ fileList = (_c = getFileList()) === null || _c === void 0 ? void 0 : _c.filter(function (v) {
227
+ return v[uid] !== file[uid];
228
+ });
229
+ dispatch({
230
+ type: 'changeFileList',
231
+ fileList: fileList
232
+ });
233
+ onChange === null || onChange === void 0 ? void 0 : onChange({
234
+ file: file,
235
+ fileList: fileList
236
+ });
237
+ }
238
+
239
+ case 4:
240
+ case "end":
241
+ return _context2.stop();
242
+ }
243
+ }
244
+ }, _callee2);
245
+ }));
246
+ }, [props.onRemove, getFileList, uid]); // 点击文件链接或预览图标时的回调
247
+
248
+ var preview = useCallback(function (file) {
249
+ var _a;
250
+
251
+ (_a = props.onPreview) === null || _a === void 0 ? void 0 : _a.call(props, file);
252
+ }, []); // 点击下载文件时的回调
253
+
254
+ var download = useCallback(function (file) {
255
+ var _a;
256
+
257
+ (_a = props.onDownload) === null || _a === void 0 ? void 0 : _a.call(props, file);
258
+ }, []);
169
259
  var CoreMethods = {
260
+ getIsMaxCount: getIsMaxCount,
170
261
  beforeUpload: beforeUpload,
171
- getUploadStatus: getUploadStatus
262
+ getUploadStatus: getUploadStatus,
263
+ remove: remove,
264
+ preview: preview,
265
+ download: download
172
266
  };
173
267
  var RefMethods = {
174
268
  getState: function getState() {
175
269
  return state;
176
- }
270
+ },
271
+ getFileList: getFileList // 获取文件列表
272
+
177
273
  };
178
274
  return {
179
275
  CoreMethods: CoreMethods,
@@ -96,6 +96,9 @@
96
96
  .lm_upload_wrapper .lm_upload_item.lm_upload_item_text .text_right .action_delete:hover {
97
97
  color: var(--primary-color);
98
98
  }
99
+ .lm_upload_wrapper .lm_upload_item.lm_upload_item_text.error {
100
+ color: var(--error-color);
101
+ }
99
102
  .lm_upload_wrapper .lm_upload_item.lm_upload_item_card {
100
103
  position: relative;
101
104
  display: inline-flex;
@@ -203,3 +206,6 @@
203
206
  .lm_upload_wrapper .lm_upload_item.lm_upload_item_picture .picture_right .action_delete:hover {
204
207
  color: var(--primary-color);
205
208
  }
209
+ .lm_upload_wrapper .lm_upload_item.lm_upload_item_picture.error {
210
+ color: var(--error-color);
211
+ }
@@ -1,3 +1,4 @@
1
+ export declare function getIsHas(val: any): boolean;
1
2
  export declare function isClassComponent(component: any): any;
2
3
  export declare function isExoticComponent(component: any): boolean;
3
4
  export declare function isReactComponent(component: any): any;
@@ -1,5 +1,18 @@
1
1
  import _typeof from "@babel/runtime/helpers/esm/typeof";
2
- import React from "react"; // 检查是否类组件
2
+ import React from 'react'; // 检查是否存在内容
3
+
4
+ export function getIsHas(val) {
5
+ var _a; // 检查是否数字类型, 是否布尔类型
6
+
7
+
8
+ var flag = !!val || typeof val === 'number' || typeof val === 'boolean'; // 检查空对象和空数组
9
+
10
+ if (!!val && _typeof(val) === 'object') {
11
+ flag = Array.isArray(val) ? !!val.length : !!((_a = Object.keys(val)) === null || _a === void 0 ? void 0 : _a.length);
12
+ }
13
+
14
+ return flag;
15
+ } // 检查是否类组件
3
16
 
4
17
  export function isClassComponent(component) {
5
18
  return typeof component === 'function' && function () {
@@ -3,8 +3,8 @@ import * as React from 'react';
3
3
  var LmUploadView = function LmUploadView(_ref) {
4
4
  var instance = _ref.instance;
5
5
  return /*#__PURE__*/React.createElement("div", {
6
- className: 'lm_upload_view'
7
- }, "view");
6
+ className: "lm_upload_view"
7
+ });
8
8
  };
9
9
 
10
10
  export default LmUploadView;
@@ -1,4 +1,5 @@
1
- declare const LmUploadContainer: ({ instance }: {
1
+ import * as React from 'react';
2
+ declare const _default: React.MemoExoticComponent<({ instance }: {
2
3
  instance: any;
3
- }) => JSX.Element;
4
- export default LmUploadContainer;
4
+ }) => any>;
5
+ export default _default;
@@ -1,12 +1,28 @@
1
1
  // 上传组件主体区域
2
2
  import * as React from 'react';
3
3
  import LmUpload from './Upload';
4
+ import LmUploadList from '../UploadList';
4
5
 
5
6
  var LmUploadContainer = function LmUploadContainer(_ref) {
6
7
  var instance = _ref.instance;
7
- return /*#__PURE__*/React.createElement(LmUpload, {
8
- instance: instance
8
+ var wrapper = instance.components.wrapper;
9
+
10
+ if (!wrapper) {
11
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(LmUpload, {
12
+ instance: instance
13
+ }), /*#__PURE__*/React.createElement(LmUploadList, {
14
+ instance: instance
15
+ }));
16
+ }
17
+
18
+ return wrapper === null || wrapper === void 0 ? void 0 : wrapper({
19
+ uploadDom: /*#__PURE__*/React.createElement(LmUpload, {
20
+ instance: instance
21
+ }),
22
+ fileListDom: /*#__PURE__*/React.createElement(LmUploadList, {
23
+ instance: instance
24
+ })
9
25
  });
10
26
  };
11
27
 
12
- export default LmUploadContainer;
28
+ export default /*#__PURE__*/React.memo(LmUploadContainer);
@@ -13,7 +13,15 @@ var LmUploadRoot = function LmUploadRoot(props, ref) {
13
13
  var _useReducer = useReducer(reducer, initialState),
14
14
  _useReducer2 = _slicedToArray(_useReducer, 2),
15
15
  state = _useReducer2[0],
16
- dispatch = _useReducer2[1]; // 获取核心Methods
16
+ dispatch = _useReducer2[1]; // 格式化接收参数值
17
+ // const configProps = useMemo(() => {
18
+ // const { ...resetProps } = props
19
+ // // 受控/非受控时的数据收集
20
+ // return {
21
+ // ...resetProps,
22
+ // }
23
+ // }, [props])
24
+ // 获取核心Methods
17
25
 
18
26
 
19
27
  var _useCoreOptions = useCoreOptions({
@@ -1,19 +1,15 @@
1
1
  // 包裹上传组件区域: 拓展其他结构
2
- import * as React from 'react';
2
+ import React from 'react';
3
3
  import LmUploadContainer from './UploadContainer';
4
- import LmUploadList from '../UploadList';
5
4
  import LmUploadView from '../view';
6
5
 
7
6
  var LmUploadWrapper = function LmUploadWrapper(_ref) {
8
7
  var instance = _ref.instance;
9
- var wrapper = instance.components.wrapper;
10
8
  return /*#__PURE__*/React.createElement("div", {
11
- className: 'lm_upload_wrapper'
12
- }, wrapper === null || wrapper === void 0 ? void 0 : wrapper( /*#__PURE__*/React.createElement(LmUploadContainer, {
9
+ className: "lm_upload_wrapper"
10
+ }, /*#__PURE__*/React.createElement(LmUploadContainer, {
13
11
  instance: instance
14
- }), /*#__PURE__*/React.createElement(LmUploadList, {
15
- instance: instance
16
- })), /*#__PURE__*/React.createElement(LmUploadView, {
12
+ }), /*#__PURE__*/React.createElement(LmUploadView, {
17
13
  instance: instance
18
14
  }));
19
15
  };
@@ -26,7 +26,8 @@ export var initialState = function initialState(props) {
26
26
  upload: upload,
27
27
  process: 0,
28
28
  status: 'done',
29
- fileList: defaultFileList
29
+ fileList: defaultFileList // 用于非受控模式时的数据收集
30
+
30
31
  };
31
32
  };
32
33
  export default reducer;
@@ -81,6 +81,9 @@
81
81
  .ant-notification-notice .ant-notification-notice-description {
82
82
  font-size: 12px;
83
83
  }
84
+ .ant-collapse {
85
+ font-size: 12px;
86
+ }
84
87
  @font-face {
85
88
  font-family: 'iconfont';
86
89
  /* Project id 2966019 */
@@ -503,3 +506,6 @@ html {
503
506
  .card_cell_content:hover .card_cell_body .card_cell_checkbox {
504
507
  opacity: 1;
505
508
  }
509
+ p {
510
+ margin-bottom: 0;
511
+ }
@@ -81,6 +81,9 @@
81
81
  .ant-notification-notice .ant-notification-notice-description {
82
82
  font-size: 12px;
83
83
  }
84
+ .ant-collapse {
85
+ font-size: 12px;
86
+ }
84
87
  @font-face {
85
88
  font-family: 'iconfont';
86
89
  /* Project id 2966019 */
@@ -503,3 +506,6 @@ html {
503
506
  .card_cell_content:hover .card_cell_body .card_cell_checkbox {
504
507
  opacity: 1;
505
508
  }
509
+ p {
510
+ margin-bottom: 0;
511
+ }
@@ -81,6 +81,9 @@
81
81
  .ant-notification-notice .ant-notification-notice-description {
82
82
  font-size: 12px;
83
83
  }
84
+ .ant-collapse {
85
+ font-size: 12px;
86
+ }
84
87
  @font-face {
85
88
  font-family: 'iconfont';
86
89
  /* Project id 2966019 */
@@ -503,6 +506,9 @@ html {
503
506
  .card_cell_content:hover .card_cell_body .card_cell_checkbox {
504
507
  opacity: 1;
505
508
  }
509
+ p {
510
+ margin-bottom: 0;
511
+ }
506
512
  .lm_modal.ant-modal-wrap .ant-modal-header > .ant-modal-title {
507
513
  font-weight: normal;
508
514
  font-size: 14px;
@@ -81,6 +81,9 @@
81
81
  .ant-notification-notice .ant-notification-notice-description {
82
82
  font-size: 12px;
83
83
  }
84
+ .ant-collapse {
85
+ font-size: 12px;
86
+ }
84
87
  @font-face {
85
88
  font-family: 'iconfont';
86
89
  /* Project id 2966019 */
@@ -503,3 +506,6 @@ html {
503
506
  .card_cell_content:hover .card_cell_body .card_cell_checkbox {
504
507
  opacity: 1;
505
508
  }
509
+ p {
510
+ margin-bottom: 0;
511
+ }
@@ -81,6 +81,9 @@
81
81
  .ant-notification-notice .ant-notification-notice-description {
82
82
  font-size: 12px;
83
83
  }
84
+ .ant-collapse {
85
+ font-size: 12px;
86
+ }
84
87
  @font-face {
85
88
  font-family: 'iconfont';
86
89
  /* Project id 2966019 */
@@ -503,6 +506,9 @@ html {
503
506
  .card_cell_content:hover .card_cell_body .card_cell_checkbox {
504
507
  opacity: 1;
505
508
  }
509
+ p {
510
+ margin-bottom: 0;
511
+ }
506
512
  .lm_pagination.ant-pagination li {
507
513
  font-size: 12px;
508
514
  line-height: 24px !important;
@@ -81,6 +81,9 @@
81
81
  .ant-notification-notice .ant-notification-notice-description {
82
82
  font-size: 12px;
83
83
  }
84
+ .ant-collapse {
85
+ font-size: 12px;
86
+ }
84
87
  @font-face {
85
88
  font-family: 'iconfont';
86
89
  /* Project id 2966019 */
@@ -503,6 +506,9 @@ html {
503
506
  .card_cell_content:hover .card_cell_body .card_cell_checkbox {
504
507
  opacity: 1;
505
508
  }
509
+ p {
510
+ margin-bottom: 0;
511
+ }
506
512
  .lm_popover_table .btn-dashed {
507
513
  font-size: 12px;
508
514
  color: #ccc;
@@ -81,6 +81,9 @@
81
81
  .ant-notification-notice .ant-notification-notice-description {
82
82
  font-size: 12px;
83
83
  }
84
+ .ant-collapse {
85
+ font-size: 12px;
86
+ }
84
87
  @font-face {
85
88
  font-family: 'iconfont';
86
89
  /* Project id 2966019 */
@@ -503,3 +506,6 @@ html {
503
506
  .card_cell_content:hover .card_cell_body .card_cell_checkbox {
504
507
  opacity: 1;
505
508
  }
509
+ p {
510
+ margin-bottom: 0;
511
+ }
@@ -81,6 +81,9 @@
81
81
  .ant-notification-notice .ant-notification-notice-description {
82
82
  font-size: 12px;
83
83
  }
84
+ .ant-collapse {
85
+ font-size: 12px;
86
+ }
84
87
  @font-face {
85
88
  font-family: 'iconfont';
86
89
  /* Project id 2966019 */
@@ -503,3 +506,6 @@ html {
503
506
  .card_cell_content:hover .card_cell_body .card_cell_checkbox {
504
507
  opacity: 1;
505
508
  }
509
+ p {
510
+ margin-bottom: 0;
511
+ }
@@ -297,7 +297,6 @@ var ResizeSize = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
297
297
  var throttleSize = (0, _lodash.throttle)(function (_ref) {
298
298
  var height = _ref.height,
299
299
  width = _ref.width;
300
- console.log(height, width, 444);
301
300
 
302
301
  var resetHeight = function resetHeight() {
303
302
  var h = height - 48;
@@ -48,7 +48,6 @@ var AutoSizer = /*#__PURE__*/function (_React$Component) {
48
48
  _this._detectElementResize = void 0;
49
49
 
50
50
  _this._onResize = function () {
51
- console.log(11);
52
51
  var _this$props = _this.props,
53
52
  disableHeight = _this$props.disableHeight,
54
53
  disableWidth = _this$props.disableWidth,
@@ -109,8 +108,6 @@ var AutoSizer = /*#__PURE__*/function (_React$Component) {
109
108
 
110
109
  this._detectElementResize.addResizeListener(this._parentNode, this.handleResize);
111
110
 
112
- console.log(3);
113
-
114
111
  this._onResize();
115
112
  }
116
113
  }
@@ -81,6 +81,9 @@
81
81
  .ant-notification-notice .ant-notification-notice-description {
82
82
  font-size: 12px;
83
83
  }
84
+ .ant-collapse {
85
+ font-size: 12px;
86
+ }
84
87
  @font-face {
85
88
  font-family: 'iconfont';
86
89
  /* Project id 2966019 */
@@ -503,6 +506,9 @@ html {
503
506
  .card_cell_content:hover .card_cell_body .card_cell_checkbox {
504
507
  opacity: 1;
505
508
  }
509
+ p {
510
+ margin-bottom: 0;
511
+ }
506
512
  .z_container {
507
513
  position: relative;
508
514
  display: flex;
@@ -81,6 +81,9 @@
81
81
  .ant-notification-notice .ant-notification-notice-description {
82
82
  font-size: 12px;
83
83
  }
84
+ .ant-collapse {
85
+ font-size: 12px;
86
+ }
84
87
  @font-face {
85
88
  font-family: 'iconfont';
86
89
  /* Project id 2966019 */
@@ -503,3 +506,6 @@ html {
503
506
  .card_cell_content:hover .card_cell_body .card_cell_checkbox {
504
507
  opacity: 1;
505
508
  }
509
+ p {
510
+ margin-bottom: 0;
511
+ }
@@ -81,6 +81,9 @@
81
81
  .ant-notification-notice .ant-notification-notice-description {
82
82
  font-size: 12px;
83
83
  }
84
+ .ant-collapse {
85
+ font-size: 12px;
86
+ }
84
87
  @font-face {
85
88
  font-family: 'iconfont';
86
89
  /* Project id 2966019 */
@@ -503,6 +506,9 @@ html {
503
506
  .card_cell_content:hover .card_cell_body .card_cell_checkbox {
504
507
  opacity: 1;
505
508
  }
509
+ p {
510
+ margin-bottom: 0;
511
+ }
506
512
  .lm_quick_menu {
507
513
  position: fixed;
508
514
  right: 16px;
@@ -81,6 +81,9 @@
81
81
  .ant-notification-notice .ant-notification-notice-description {
82
82
  font-size: 12px;
83
83
  }
84
+ .ant-collapse {
85
+ font-size: 12px;
86
+ }
84
87
  @font-face {
85
88
  font-family: 'iconfont';
86
89
  /* Project id 2966019 */
@@ -503,3 +506,6 @@ html {
503
506
  .card_cell_content:hover .card_cell_body .card_cell_checkbox {
504
507
  opacity: 1;
505
508
  }
509
+ p {
510
+ margin-bottom: 0;
511
+ }