linkmore-design 1.0.68 → 1.0.69

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 (276) hide show
  1. package/README.md +11 -7
  2. package/dist/Approval/demos/basic.d.ts +1 -0
  3. package/dist/LmFilter/components/InputFilter.d.ts +2 -2
  4. package/dist/LmFilter/filterFns/index.d.ts +1 -1
  5. package/dist/LmFilter/localization.d.ts +1 -0
  6. package/dist/LmFilter/utils.d.ts +1 -1
  7. package/dist/LmSelect/useCheckboxOptions.d.ts +1 -0
  8. package/dist/LmUpload/UploadList/ItemPicture.d.ts +2 -1
  9. package/dist/LmUpload/UploadList/ItemText.d.ts +2 -1
  10. package/dist/LmUpload/UploadList/RenderItem.d.ts +1 -5
  11. package/dist/LmUpload/demos/card.d.ts +2 -0
  12. package/dist/LmUpload/demos/picture.d.ts +2 -0
  13. package/dist/LmUpload/fns/index.d.ts +2 -0
  14. package/dist/LmUpload/utils.d.ts +1 -0
  15. package/dist/LmUpload/wrapper/UploadContainer.d.ts +4 -3
  16. package/dist/index.umd.js +1 -1
  17. package/dist/index.umd.min.js +1 -1
  18. package/es/Affix/style/index.css +6 -0
  19. package/es/Alert/style/index.css +6 -0
  20. package/es/Approval/index.js +4 -4
  21. package/es/Approval/style/index.css +18 -4
  22. package/es/AutoComplete/style/index.css +6 -0
  23. package/es/Avatar/style/index.css +6 -0
  24. package/es/Breadcrumb/style/index.css +6 -0
  25. package/es/ButtonTags/style/index.css +6 -0
  26. package/es/Calendar/style/index.css +6 -0
  27. package/es/Card/style/index.css +6 -0
  28. package/es/CardTable/fns/index.js +5 -8
  29. package/es/CardTable/table/TableRoot.js +2 -1
  30. package/es/Carousel/style/index.css +6 -0
  31. package/es/Cascader/style/index.css +6 -0
  32. package/es/CkFilter/complexFilter/drawer.js +1 -4
  33. package/es/CkFilter/complexFilter/saveModal.js +5 -7
  34. package/es/CkFilter/components/CustomModal.js +2 -3
  35. package/es/CkFilter/components/filterTypes.js +1 -3
  36. package/es/CkFilter/components/modal.js +2 -5
  37. package/es/CkFilter/components/modalBack.js +2 -3
  38. package/es/CkFilter/customFilter/drawer.js +6 -11
  39. package/es/CkFilter/style/index.css +6 -0
  40. package/es/Col/style/index.css +6 -0
  41. package/es/Collapse/style/index.css +6 -0
  42. package/es/Comment/style/index.css +6 -0
  43. package/es/CustomTableOption/style/index.css +6 -0
  44. package/es/CustomerService/style/index.css +6 -0
  45. package/es/DatePicker/style/index.css +6 -0
  46. package/es/Descriptions/style/index.css +6 -0
  47. package/es/Drawer/style/index.css +6 -0
  48. package/es/Dropdown/style/index.css +6 -0
  49. package/es/EditTable/style/index.css +6 -0
  50. package/es/Empty/style/index.css +6 -0
  51. package/es/Filter/baseFilter/Popover.js +0 -1
  52. package/es/Filter/baseFilter/ToggleFilter.js +0 -1
  53. package/es/Filter/edit/editFilter.js +2 -6
  54. package/es/Filter/remember.js +0 -1
  55. package/es/Filter/style/index.css +6 -0
  56. package/es/Form/style/index.css +6 -0
  57. package/es/Grid/style/index.css +6 -0
  58. package/es/Icon/style/index.css +6 -0
  59. package/es/IconFont/font/iconfont.js +1 -1
  60. package/es/Image/style/index.css +6 -0
  61. package/es/Input/style/index.css +6 -0
  62. package/es/InputNumber/style/index.css +6 -0
  63. package/es/Layout/style/index.css +6 -0
  64. package/es/LeftTable/style/index.css +6 -0
  65. package/es/List/style/index.css +6 -0
  66. package/es/LmEditTable/style/index.css +6 -0
  67. package/es/LmFilter/complexFilter/drawer.js +2 -7
  68. package/es/LmFilter/complexFilter/valueDrawer.js +2 -5
  69. package/es/LmFilter/components/CascaderFilter.js +0 -1
  70. package/es/LmFilter/components/DropdownFIlter.js +17 -19
  71. package/es/LmFilter/components/InputFilter.js +1 -2
  72. package/es/LmFilter/components/SelectFilter.js +2 -2
  73. package/es/LmFilter/components/index.js +1 -1
  74. package/es/LmFilter/customFilter/drawer.js +7 -25
  75. package/es/LmFilter/customFilter/saveModal.js +2 -3
  76. package/es/LmFilter/customFilter/valueDrawer.js +2 -5
  77. package/es/LmFilter/filterFns/index.js +3 -5
  78. package/es/LmFilter/localization.d.ts +1 -0
  79. package/es/LmFilter/localization.js +2 -1
  80. package/es/LmFilter/utils.js +39 -22
  81. package/es/LmFilter/wrapper/FilterRoot.js +0 -2
  82. package/es/LmSelect/style/index.css +6 -0
  83. package/es/LmSelect/useCheckboxOptions.d.ts +1 -0
  84. package/es/LmSelect/useCheckboxOptions.js +4 -3
  85. package/es/LmTable/Table.js +0 -1
  86. package/es/LmTable/autosize.js +0 -3
  87. package/es/LmTable/style/index.css +6 -0
  88. package/es/LmUpload/LmUpload.js +44 -21
  89. package/es/LmUpload/UploadList/ItemPicture.d.ts +2 -1
  90. package/es/LmUpload/UploadList/ItemPicture.js +14 -8
  91. package/es/LmUpload/UploadList/ItemPictureCard.js +18 -9
  92. package/es/LmUpload/UploadList/ItemText.d.ts +2 -1
  93. package/es/LmUpload/UploadList/ItemText.js +12 -7
  94. package/es/LmUpload/UploadList/RenderItem.d.ts +1 -5
  95. package/es/LmUpload/UploadList/RenderItem.js +3 -3
  96. package/es/LmUpload/UploadList/index.js +9 -4
  97. package/es/LmUpload/body/Progress.js +2 -2
  98. package/es/LmUpload/body/UploadCore.js +10 -5
  99. package/es/LmUpload/body/UploadPicture.js +4 -4
  100. package/es/LmUpload/fns/index.d.ts +2 -0
  101. package/es/LmUpload/fns/index.js +61 -16
  102. package/es/LmUpload/utils.d.ts +1 -0
  103. package/es/LmUpload/utils.js +14 -1
  104. package/es/LmUpload/wrapper/UploadContainer.d.ts +4 -3
  105. package/es/LmUpload/wrapper/UploadContainer.js +19 -3
  106. package/es/LmUpload/wrapper/UploadRoot.js +30 -3
  107. package/es/LmUpload/wrapper/UploadWrapper.js +4 -8
  108. package/es/LmUpload/wrapper/reducer.js +2 -1
  109. package/es/Mentions/style/index.css +6 -0
  110. package/es/Menu/style/index.css +6 -0
  111. package/es/Modal/style/index.css +6 -0
  112. package/es/PageHeader/style/index.css +6 -0
  113. package/es/Pagination/style/index.css +6 -0
  114. package/es/PopTable/style/index.css +6 -0
  115. package/es/Popconfirm/style/index.css +6 -0
  116. package/es/Popover/style/index.css +6 -0
  117. package/es/ProTable/Table.js +0 -1
  118. package/es/ProTable/autosize.js +0 -3
  119. package/es/ProTable/style/index.css +6 -0
  120. package/es/Progress/style/index.css +6 -0
  121. package/es/QuickMenu/style/index.css +6 -0
  122. package/es/Rate/style/index.css +6 -0
  123. package/es/Row/style/index.css +6 -0
  124. package/es/Segmented/style/index.css +6 -0
  125. package/es/Select/style/index.css +6 -0
  126. package/es/Slider/style/index.css +6 -0
  127. package/es/Space/style/index.css +6 -0
  128. package/es/Spin/style/index.css +6 -0
  129. package/es/Statistic/style/index.css +6 -0
  130. package/es/Steps/style/index.css +6 -0
  131. package/es/Switch/style/index.css +6 -0
  132. package/es/Table/style/index.css +6 -0
  133. package/es/Tabs/style/index.css +6 -0
  134. package/es/Tag/style/index.css +6 -0
  135. package/es/TimePicker/style/index.css +6 -0
  136. package/es/Timeline/style/index.css +6 -0
  137. package/es/Tooltip/style/index.css +6 -0
  138. package/es/Transfer/style/index.css +6 -0
  139. package/es/Tree/style/index.css +6 -0
  140. package/es/TreeSelect/style/index.css +6 -0
  141. package/es/Typography/style/index.css +6 -0
  142. package/es/Upload/style/index.css +6 -0
  143. package/es/message/style/index.css +6 -0
  144. package/es/notification/style/index.css +6 -0
  145. package/es/styles/main.css +6 -0
  146. package/es/styles/resetAntd.css +3 -0
  147. package/lib/Affix/style/index.css +6 -0
  148. package/lib/Alert/style/index.css +6 -0
  149. package/lib/Approval/index.js +4 -4
  150. package/lib/Approval/style/index.css +18 -4
  151. package/lib/AutoComplete/style/index.css +6 -0
  152. package/lib/Avatar/style/index.css +6 -0
  153. package/lib/Breadcrumb/style/index.css +6 -0
  154. package/lib/ButtonTags/style/index.css +6 -0
  155. package/lib/Calendar/style/index.css +6 -0
  156. package/lib/Card/style/index.css +6 -0
  157. package/lib/CardTable/fns/index.js +5 -8
  158. package/lib/CardTable/table/TableRoot.js +2 -1
  159. package/lib/Carousel/style/index.css +6 -0
  160. package/lib/Cascader/style/index.css +6 -0
  161. package/lib/CkFilter/complexFilter/drawer.js +1 -4
  162. package/lib/CkFilter/complexFilter/saveModal.js +5 -7
  163. package/lib/CkFilter/components/CustomModal.js +2 -3
  164. package/lib/CkFilter/components/filterTypes.js +1 -3
  165. package/lib/CkFilter/components/modal.js +2 -5
  166. package/lib/CkFilter/components/modalBack.js +2 -3
  167. package/lib/CkFilter/customFilter/drawer.js +6 -11
  168. package/lib/CkFilter/style/index.css +6 -0
  169. package/lib/Col/style/index.css +6 -0
  170. package/lib/Collapse/style/index.css +6 -0
  171. package/lib/Comment/style/index.css +6 -0
  172. package/lib/CustomTableOption/style/index.css +6 -0
  173. package/lib/CustomerService/style/index.css +6 -0
  174. package/lib/DatePicker/style/index.css +6 -0
  175. package/lib/Descriptions/style/index.css +6 -0
  176. package/lib/Drawer/style/index.css +6 -0
  177. package/lib/Dropdown/style/index.css +6 -0
  178. package/lib/EditTable/style/index.css +6 -0
  179. package/lib/Empty/style/index.css +6 -0
  180. package/lib/Filter/baseFilter/Popover.js +0 -1
  181. package/lib/Filter/baseFilter/ToggleFilter.js +0 -1
  182. package/lib/Filter/edit/editFilter.js +2 -6
  183. package/lib/Filter/remember.js +0 -1
  184. package/lib/Filter/style/index.css +6 -0
  185. package/lib/Form/style/index.css +6 -0
  186. package/lib/Grid/style/index.css +6 -0
  187. package/lib/Icon/style/index.css +6 -0
  188. package/lib/IconFont/font/iconfont.js +1 -1
  189. package/lib/Image/style/index.css +6 -0
  190. package/lib/Input/style/index.css +6 -0
  191. package/lib/InputNumber/style/index.css +6 -0
  192. package/lib/Layout/style/index.css +6 -0
  193. package/lib/LeftTable/style/index.css +6 -0
  194. package/lib/List/style/index.css +6 -0
  195. package/lib/LmEditTable/style/index.css +6 -0
  196. package/lib/LmFilter/complexFilter/drawer.js +2 -7
  197. package/lib/LmFilter/complexFilter/valueDrawer.js +2 -5
  198. package/lib/LmFilter/components/CascaderFilter.js +0 -1
  199. package/lib/LmFilter/components/DropdownFIlter.js +17 -19
  200. package/lib/LmFilter/components/InputFilter.js +1 -2
  201. package/lib/LmFilter/components/SelectFilter.js +2 -2
  202. package/lib/LmFilter/components/index.js +1 -1
  203. package/lib/LmFilter/customFilter/drawer.js +7 -25
  204. package/lib/LmFilter/customFilter/saveModal.js +2 -3
  205. package/lib/LmFilter/customFilter/valueDrawer.js +2 -5
  206. package/lib/LmFilter/filterFns/index.js +3 -5
  207. package/lib/LmFilter/localization.d.ts +1 -0
  208. package/lib/LmFilter/localization.js +4 -2
  209. package/lib/LmFilter/utils.js +39 -22
  210. package/lib/LmFilter/wrapper/FilterRoot.js +0 -2
  211. package/lib/LmSelect/style/index.css +6 -0
  212. package/lib/LmSelect/useCheckboxOptions.d.ts +1 -0
  213. package/lib/LmSelect/useCheckboxOptions.js +7 -5
  214. package/lib/LmTable/Table.js +0 -1
  215. package/lib/LmTable/autosize.js +0 -3
  216. package/lib/LmTable/style/index.css +6 -0
  217. package/lib/LmUpload/LmUpload.js +43 -21
  218. package/lib/LmUpload/UploadList/ItemPicture.d.ts +2 -1
  219. package/lib/LmUpload/UploadList/ItemPicture.js +14 -8
  220. package/lib/LmUpload/UploadList/ItemPictureCard.js +18 -9
  221. package/lib/LmUpload/UploadList/ItemText.d.ts +2 -1
  222. package/lib/LmUpload/UploadList/ItemText.js +12 -7
  223. package/lib/LmUpload/UploadList/RenderItem.d.ts +1 -5
  224. package/lib/LmUpload/UploadList/RenderItem.js +3 -3
  225. package/lib/LmUpload/UploadList/index.js +9 -4
  226. package/lib/LmUpload/body/Progress.js +2 -2
  227. package/lib/LmUpload/body/UploadCore.js +15 -8
  228. package/lib/LmUpload/body/UploadPicture.js +4 -4
  229. package/lib/LmUpload/fns/index.d.ts +2 -0
  230. package/lib/LmUpload/fns/index.js +61 -16
  231. package/lib/LmUpload/utils.d.ts +1 -0
  232. package/lib/LmUpload/utils.js +16 -1
  233. package/lib/LmUpload/wrapper/UploadContainer.d.ts +4 -3
  234. package/lib/LmUpload/wrapper/UploadContainer.js +21 -3
  235. package/lib/LmUpload/wrapper/UploadRoot.js +30 -3
  236. package/lib/LmUpload/wrapper/UploadWrapper.js +5 -12
  237. package/lib/LmUpload/wrapper/reducer.js +2 -1
  238. package/lib/Mentions/style/index.css +6 -0
  239. package/lib/Menu/style/index.css +6 -0
  240. package/lib/Modal/style/index.css +6 -0
  241. package/lib/PageHeader/style/index.css +6 -0
  242. package/lib/Pagination/style/index.css +6 -0
  243. package/lib/PopTable/style/index.css +6 -0
  244. package/lib/Popconfirm/style/index.css +6 -0
  245. package/lib/Popover/style/index.css +6 -0
  246. package/lib/ProTable/Table.js +0 -1
  247. package/lib/ProTable/autosize.js +0 -3
  248. package/lib/ProTable/style/index.css +6 -0
  249. package/lib/Progress/style/index.css +6 -0
  250. package/lib/QuickMenu/style/index.css +6 -0
  251. package/lib/Rate/style/index.css +6 -0
  252. package/lib/Row/style/index.css +6 -0
  253. package/lib/Segmented/style/index.css +6 -0
  254. package/lib/Select/style/index.css +6 -0
  255. package/lib/Slider/style/index.css +6 -0
  256. package/lib/Space/style/index.css +6 -0
  257. package/lib/Spin/style/index.css +6 -0
  258. package/lib/Statistic/style/index.css +6 -0
  259. package/lib/Steps/style/index.css +6 -0
  260. package/lib/Switch/style/index.css +6 -0
  261. package/lib/Table/style/index.css +6 -0
  262. package/lib/Tabs/style/index.css +6 -0
  263. package/lib/Tag/style/index.css +6 -0
  264. package/lib/TimePicker/style/index.css +6 -0
  265. package/lib/Timeline/style/index.css +6 -0
  266. package/lib/Tooltip/style/index.css +6 -0
  267. package/lib/Transfer/style/index.css +6 -0
  268. package/lib/Tree/style/index.css +6 -0
  269. package/lib/TreeSelect/style/index.css +6 -0
  270. package/lib/Typography/style/index.css +6 -0
  271. package/lib/Upload/style/index.css +6 -0
  272. package/lib/message/style/index.css +6 -0
  273. package/lib/notification/style/index.css +6 -0
  274. package/lib/styles/main.css +6 -0
  275. package/lib/styles/resetAntd.css +3 -0
  276. package/package.json +2 -1
@@ -1,4 +1,4 @@
1
- import * as React from 'react';
1
+ import React, { useMemo } from 'react';
2
2
  import UploadPicture from './UploadPicture'; // 上传核心
3
3
  // 渲染上传区域样式, 仅用于触发上传事件
4
4
  // type: 'card' 图片 | 'drag' 拖拽
@@ -6,10 +6,15 @@ import UploadPicture from './UploadPicture'; // 上传核心
6
6
  var UploadCore = function UploadCore(_ref) {
7
7
  var instance = _ref.instance;
8
8
  var inputRef = React.useRef(null);
9
- var accept = instance.accept,
9
+ var fileList = instance.fileList,
10
+ accept = instance.accept,
11
+ maxCount = instance.maxCount,
10
12
  children = instance.children,
11
13
  beforeUpload = instance.beforeUpload,
12
- getUploadStatus = instance.getUploadStatus; // 点击事件触发文件上传
14
+ getUploadStatus = instance.getUploadStatus;
15
+ var isMaxCount = useMemo(function () {
16
+ return !(fileList.length < maxCount);
17
+ }, []); // 点击事件触发文件上传
13
18
 
14
19
  var handleClick = function handleClick() {
15
20
  var _a;
@@ -31,7 +36,7 @@ var UploadCore = function UploadCore(_ref) {
31
36
  };
32
37
 
33
38
  var inputConfig = {
34
- type: "file",
39
+ type: 'file',
35
40
  accept: accept,
36
41
  title: '',
37
42
  onChange: uploadChange,
@@ -39,7 +44,7 @@ var UploadCore = function UploadCore(_ref) {
39
44
  display: 'none'
40
45
  }
41
46
  };
42
- return /*#__PURE__*/React.createElement("div", {
47
+ return isMaxCount && /*#__PURE__*/React.createElement("div", {
43
48
  onClick: handleClick,
44
49
  className: "lm_upload_core"
45
50
  }, children || /*#__PURE__*/React.createElement(UploadPicture, {
@@ -11,22 +11,22 @@ var uploadPicture = function uploadPicture(_ref) {
11
11
  return getUploadStatus().uploading;
12
12
  }, [getUploadStatus]);
13
13
  return /*#__PURE__*/React.createElement("div", {
14
- className: 'lm_upload_core_picture',
14
+ className: "lm_upload_core_picture",
15
15
  style: {
16
16
  height: size,
17
17
  width: size
18
18
  }
19
19
  }, /*#__PURE__*/React.createElement("div", {
20
- className: 'lm_upload_core_picture_action'
20
+ className: "lm_upload_core_picture_action"
21
21
  }, !isUploading && /*#__PURE__*/React.createElement("div", {
22
- className: 'action_plus'
22
+ className: "action_plus"
23
23
  }, /*#__PURE__*/React.createElement(IconFont, {
24
24
  type: "lmweb-plus",
25
25
  style: {
26
26
  fontSize: size > 48 ? 16 : 12
27
27
  }
28
28
  })), /*#__PURE__*/React.createElement("div", {
29
- className: 'tip'
29
+ className: "tip"
30
30
  }, "\u4E0A\u4F20"), isUploading && /*#__PURE__*/React.createElement(Progress, {
31
31
  instance: instance
32
32
  })));
@@ -8,6 +8,8 @@ declare const useCoreOptions: ({ state, dispatch, props }: {
8
8
  getUploadStatus: () => {
9
9
  uploading: boolean;
10
10
  };
11
+ remove: (file: any) => Promise<void>;
12
+ preview: (file: any) => void;
11
13
  };
12
14
  RefMethods: {
13
15
  getState: () => any;
@@ -41,13 +41,16 @@ 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
+ value = props.fileList,
46
+ onChange = props.onChange,
45
47
  type = props.type,
46
48
  fileSize = props.fileSize,
49
+ enabledOss = props.enabledOss,
47
50
  ossConfig = props.ossConfig; // 上传完成
48
51
 
49
52
  var uploadOnChange = useCallback(function (file) {
50
- var fileList = [file].concat(_toConsumableArray(state.fileList));
53
+ var fileList = [file].concat(_toConsumableArray(value));
51
54
  dispatch({
52
55
  type: 'changeFileList',
53
56
  fileList: fileList
@@ -61,17 +64,17 @@ var useCoreOptions = function useCoreOptions(_ref) {
61
64
  file: file,
62
65
  fileList: fileList
63
66
  });
64
- }, [state.fileList]); // 上传至ali-oss
67
+ }, [value]); // 上传至ali-oss
65
68
 
66
69
  var uploadOss = useCallback(function (file) {
67
70
  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;
71
+ var _a, _ossConfig, _ossConfig$dir, dir, shortlink, _ossConfig$region, region, accessKeyId, accessKeySecret, stsToken, _ossConfig$bucket, bucket, client, fileName, pathName, url, seq, params;
69
72
 
70
73
  return _regeneratorRuntime.wrap(function _callee$(_context) {
71
74
  while (1) {
72
75
  switch (_context.prev = _context.next) {
73
76
  case 0:
74
- dir = ossConfig.dir, shortlink = ossConfig.shortlink, region = ossConfig.region, accessKeyId = ossConfig.accessKeyId, accessKeySecret = ossConfig.accessKeySecret, stsToken = ossConfig.stsToken, bucket = ossConfig.bucket;
77
+ _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
78
  client = new OSS({
76
79
  region: region,
77
80
  accessKeyId: accessKeyId,
@@ -88,6 +91,8 @@ var useCoreOptions = function useCoreOptions(_ref) {
88
91
  // 获取分片上传进度、断点和返回值。
89
92
  progress: function progress(p, cpt, res) {
90
93
  onChange({
94
+ file: file,
95
+ fileList: value,
91
96
  event: {
92
97
  progress: p,
93
98
  checkPoint: cpt,
@@ -105,9 +110,9 @@ var useCoreOptions = function useCoreOptions(_ref) {
105
110
  });
106
111
 
107
112
  case 8:
108
- result = _context.sent;
109
113
  seq = (((_a = state.fileList) === null || _a === void 0 ? void 0 : _a.length) || 0) + 1;
110
114
  params = {
115
+ uid: seq,
111
116
  fileTypeCode: file.type,
112
117
  fileTypeName: file.type,
113
118
  fileName: fileName,
@@ -120,23 +125,22 @@ var useCoreOptions = function useCoreOptions(_ref) {
120
125
  url: url
121
126
  };
122
127
  uploadOnChange(params);
123
- console.log('result', result);
124
- _context.next = 18;
128
+ _context.next = 16;
125
129
  break;
126
130
 
127
- case 15:
128
- _context.prev = 15;
131
+ case 13:
132
+ _context.prev = 13;
129
133
  _context.t0 = _context["catch"](2);
130
134
  console.log('error:', _context.t0);
131
135
 
132
- case 18:
136
+ case 16:
133
137
  case "end":
134
138
  return _context.stop();
135
139
  }
136
140
  }
137
- }, _callee, null, [[2, 15]]);
141
+ }, _callee, null, [[2, 13]]);
138
142
  }));
139
- }, [ossConfig, uploadOnChange]); // 上传前的检测
143
+ }, [ossConfig, uploadOnChange, value]); // 上传前的检测
140
144
 
141
145
  var beforeUpload = useCallback(function (e) {
142
146
  var files = e.target.files; // 循环文件检查是否存在不符合要求的文件
@@ -153,12 +157,51 @@ var useCoreOptions = function useCoreOptions(_ref) {
153
157
  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
158
  }
155
159
 
156
- uploadOss(item); // 单个文件上传
160
+ enabledOss && uploadOss(item); // 单个文件上传
157
161
  // fileUpload?.({ file: item, size, value, onChange: uploadOnChange, isImg: true });
158
162
  }
159
163
 
160
164
  return false;
161
- }, [type, fileSize, uploadOss]); // 获取上传状态
165
+ }, [type, fileSize, uploadOss]); // 删除事件
166
+
167
+ var remove = useCallback(function (file) {
168
+ return __awaiter(void 0, void 0, void 0, /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
169
+ var _b, res, fileList;
170
+
171
+ return _regeneratorRuntime.wrap(function _callee2$(_context2) {
172
+ while (1) {
173
+ switch (_context2.prev = _context2.next) {
174
+ case 0:
175
+ _context2.next = 2;
176
+ return (_b = props.onRemove) === null || _b === void 0 ? void 0 : _b.call(props, file);
177
+
178
+ case 2:
179
+ res = _context2.sent;
180
+
181
+ if (res) {
182
+ fileList = value.filter(function (v) {
183
+ return v[uid] !== file[uid];
184
+ });
185
+ dispatch({
186
+ type: 'changeFileList',
187
+ fileList: fileList
188
+ });
189
+ }
190
+
191
+ case 4:
192
+ case "end":
193
+ return _context2.stop();
194
+ }
195
+ }
196
+ }, _callee2);
197
+ }));
198
+ }, [props.onRemove, state.fileList, uid]); // 点击文件链接或预览图标时的回调
199
+
200
+ var preview = useCallback(function (file) {
201
+ var _a;
202
+
203
+ (_a = props.onPreview) === null || _a === void 0 ? void 0 : _a.call(props, file);
204
+ }, []); // 获取上传状态
162
205
 
163
206
  var getUploadStatus = useCallback(function () {
164
207
  var uploading = typeof state.percent === 'number';
@@ -168,7 +211,9 @@ var useCoreOptions = function useCoreOptions(_ref) {
168
211
  }, [state.percent]);
169
212
  var CoreMethods = {
170
213
  beforeUpload: beforeUpload,
171
- getUploadStatus: getUploadStatus
214
+ getUploadStatus: getUploadStatus,
215
+ remove: remove,
216
+ preview: preview
172
217
  };
173
218
  var RefMethods = {
174
219
  getState: function getState() {
@@ -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 () {
@@ -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
+ upload: /*#__PURE__*/React.createElement(LmUpload, {
20
+ instance: instance
21
+ }),
22
+ fileList: /*#__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);
@@ -1,9 +1,24 @@
1
1
  import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
2
- // 根文件 => 参数聚合
2
+
3
+ var __rest = this && this.__rest || function (s, e) {
4
+ var t = {};
5
+
6
+ for (var p in s) {
7
+ if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
8
+ }
9
+
10
+ if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
11
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
12
+ }
13
+ return t;
14
+ }; // 根文件 => 参数聚合
15
+
16
+
3
17
  import React, { useMemo, useReducer, forwardRef, useImperativeHandle } from 'react';
4
18
  import reducer, { initialState as initReducerState } from './reducer';
5
19
  import useCoreOptions from '../fns';
6
20
  import LmUploadWrapper from './UploadWrapper';
21
+ import { getIsHas } from '../utils';
7
22
 
8
23
  var LmUploadRoot = function LmUploadRoot(props, ref) {
9
24
  var initialState = useMemo(function () {
@@ -13,8 +28,20 @@ var LmUploadRoot = function LmUploadRoot(props, ref) {
13
28
  var _useReducer = useReducer(reducer, initialState),
14
29
  _useReducer2 = _slicedToArray(_useReducer, 2),
15
30
  state = _useReducer2[0],
16
- dispatch = _useReducer2[1]; // 获取核心Methods
31
+ dispatch = _useReducer2[1]; // 格式化接收参数值
32
+
33
+
34
+ var configProps = useMemo(function () {
35
+ var fileList = props.fileList,
36
+ resetProps = __rest(props // 受控/非受控时的数据收集
37
+ , ["fileList"]); // 受控/非受控时的数据收集
38
+
17
39
 
40
+ var aliveValue = getIsHas(fileList) ? fileList : state.fileList;
41
+ return Object.assign(Object.assign({}, resetProps), {
42
+ fileList: aliveValue
43
+ });
44
+ }, [props, state.fileList]); // 获取核心Methods
18
45
 
19
46
  var _useCoreOptions = useCoreOptions({
20
47
  state: state,
@@ -25,7 +52,7 @@ var LmUploadRoot = function LmUploadRoot(props, ref) {
25
52
  RefMethods = _useCoreOptions.RefMethods; // 组件实例
26
53
 
27
54
 
28
- var instance = Object.assign(Object.assign(Object.assign(Object.assign({}, props), CoreMethods), RefMethods), {
55
+ var instance = Object.assign(Object.assign(Object.assign(Object.assign({}, configProps), CoreMethods), RefMethods), {
29
56
  state: state,
30
57
  dispatch: dispatch
31
58
  }); // 向外暴露出的方法
@@ -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
+ }
@@ -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
+ }