dtable-ui-component 7.0.14 → 7.0.16

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 (280) hide show
  1. package/lib/ActionSheet/index.js +16 -14
  2. package/lib/ActivityIndicator/index.js +8 -7
  3. package/lib/AsyncUserSelect/index.js +18 -44
  4. package/lib/AsyncUserSelect/user-item.js +6 -5
  5. package/lib/AutoNumberFormatter/index.js +4 -3
  6. package/lib/Badge/index.js +11 -9
  7. package/lib/ButtonFormatter/index.js +8 -6
  8. package/lib/CTimeFormatter/index.js +4 -3
  9. package/lib/CheckboxEditor/index.js +3 -1
  10. package/lib/CheckboxEditor/mb-editor.js +20 -9
  11. package/lib/CheckboxEditor/pc-editor.js +24 -12
  12. package/lib/CheckboxFormatter/index.js +5 -4
  13. package/lib/CollaboratorEditor/index.js +4 -2
  14. package/lib/CollaboratorEditor/mb-editor/index.js +19 -11
  15. package/lib/CollaboratorEditor/pc-editor/index.js +34 -25
  16. package/lib/CollaboratorFormatter/index.js +10 -8
  17. package/lib/CollaboratorItem/index.js +5 -4
  18. package/lib/CollapsibleSettingLayout/index.js +7 -9
  19. package/lib/Comment/body/comment.js +18 -10
  20. package/lib/Comment/body/index.js +4 -2
  21. package/lib/Comment/footer/btns/index.js +7 -4
  22. package/lib/Comment/footer/index.js +20 -9
  23. package/lib/Comment/footer/input/index.js +50 -29
  24. package/lib/Comment/footer/input/participant/index.js +5 -4
  25. package/lib/Comment/footer/participants/index.js +5 -4
  26. package/lib/Comment/footer/participants/participant/index.js +3 -1
  27. package/lib/Comment/footer/participants/participant-select/index.js +24 -8
  28. package/lib/Comment/index.js +57 -39
  29. package/lib/Comment/utils/utilities.js +21 -15
  30. package/lib/CreatorFormatter/index.js +8 -6
  31. package/lib/DTableColorPicker/ColorPickerPortal/index.js +18 -22
  32. package/lib/DTableColorPicker/index.js +40 -55
  33. package/lib/DTableColorPicker/utils.js +6 -4
  34. package/lib/DTableColumnIcon/index.js +7 -6
  35. package/lib/DTableCommonAddTool/index.js +8 -6
  36. package/lib/DTableCustomFooter/index.js +3 -1
  37. package/lib/DTableCustomizeSearchInput/index.js +25 -19
  38. package/lib/DTableCustomizeSelect/index.js +24 -19
  39. package/lib/DTableDropdownItem/index.js +18 -16
  40. package/lib/DTableDropdownMenu/index.js +10 -8
  41. package/lib/DTableEmptyTip/index.js +5 -4
  42. package/lib/DTableFiltersPopover/index.js +41 -26
  43. package/lib/DTableFiltersPopover/utils/filter-item-utils.js +3 -1
  44. package/lib/DTableFiltersPopover/utils/index.js +113 -63
  45. package/lib/DTableFiltersPopover/widgets/collaborator-filter/index.js +9 -8
  46. package/lib/DTableFiltersPopover/widgets/department-select-filter/department-multiple-select-filter.js +13 -16
  47. package/lib/DTableFiltersPopover/widgets/department-select-filter/department-single-select-filter.js +15 -18
  48. package/lib/DTableFiltersPopover/widgets/filter-calendar.js +14 -8
  49. package/lib/DTableFiltersPopover/widgets/filter-group.js +55 -34
  50. package/lib/DTableFiltersPopover/widgets/filter-item.js +164 -105
  51. package/lib/DTableFiltersPopover/widgets/filter-list/index.js +161 -136
  52. package/lib/DTableFiltersPopover/widgets/rate-item.js +20 -15
  53. package/lib/DTableIcon/index.js +7 -6
  54. package/lib/DTableIcon/svg-icon.js +7 -5
  55. package/lib/DTableModalHeader/index.js +3 -1
  56. package/lib/DTablePopover/index.js +15 -11
  57. package/lib/DTableRadio/index.js +9 -10
  58. package/lib/DTableRadioGroup/index.js +17 -8
  59. package/lib/DTableSearchInput/index.js +29 -19
  60. package/lib/DTableSelect/dtable-select-label.js +5 -6
  61. package/lib/DTableSelect/index.js +22 -21
  62. package/lib/DTableSelect/select-dropdown-indicator/index.js +3 -1
  63. package/lib/DTableSelect/utils.js +20 -8
  64. package/lib/DTableSubDropdownMenu/index.js +10 -8
  65. package/lib/DTableSubDropdownToggle/index.js +12 -12
  66. package/lib/DTableSwitch/index.js +11 -12
  67. package/lib/DTableToolTip/index.js +8 -7
  68. package/lib/DateEditor/index.js +15 -20
  69. package/lib/DateEditor/mb-editor/index.js +31 -18
  70. package/lib/DateEditor/pc-editor.js +45 -26
  71. package/lib/DateFormatter/index.js +5 -4
  72. package/lib/DatePicker/index.js +15 -9
  73. package/lib/DatePicker/utils.js +3 -1
  74. package/lib/DeleteTip/index.js +6 -5
  75. package/lib/DepartmentMultipleSelectEditor/index.js +23 -25
  76. package/lib/DepartmentSelectFilter/index.js +8 -6
  77. package/lib/DepartmentSingleSelectEditor/index.js +3 -1
  78. package/lib/DepartmentSingleSelectEditor/mb-editor/index.js +47 -48
  79. package/lib/DepartmentSingleSelectEditor/pc-editor/department-single-select.js +58 -36
  80. package/lib/DepartmentSingleSelectEditor/pc-editor/index.js +19 -13
  81. package/lib/DepartmentSingleSelectFormatter/index.js +6 -4
  82. package/lib/DigitalSignEditor/index.js +3 -1
  83. package/lib/DigitalSignEditor/mb-editor/index.js +20 -12
  84. package/lib/DigitalSignEditor/pc-editor/index.js +24 -17
  85. package/lib/DigitalSignEditor/service.js +4 -2
  86. package/lib/DigitalSignEditor/signature-board/index.js +8 -5
  87. package/lib/DigitalSignEditor/utils.js +4 -2
  88. package/lib/DigitalSignFormatter/index.js +15 -12
  89. package/lib/DigitalSignFormatter/utils.js +5 -4
  90. package/lib/DurationEditor/index.js +31 -21
  91. package/lib/DurationFormatter/index.js +5 -4
  92. package/lib/EditEditorButton/index.js +3 -1
  93. package/lib/EmailFormatter/index.js +4 -3
  94. package/lib/FieldDisplaySetting/field-item.js +12 -12
  95. package/lib/FieldDisplaySetting/index.js +9 -11
  96. package/lib/FileEditor/files-previewer/index.js +3 -1
  97. package/lib/FileEditor/files-previewer/mb-previewer/file-previewer/index.js +18 -10
  98. package/lib/FileEditor/files-previewer/mb-previewer/index.js +8 -7
  99. package/lib/FileEditor/files-previewer/pc-previewer/file-previewer/dropdown-menu.js +4 -3
  100. package/lib/FileEditor/files-previewer/pc-previewer/file-previewer/file-name-editor/index.js +6 -5
  101. package/lib/FileEditor/files-previewer/pc-previewer/file-previewer/index.js +21 -14
  102. package/lib/FileEditor/files-previewer/pc-previewer/index.js +57 -29
  103. package/lib/FileEditor/index.js +3 -1
  104. package/lib/FileEditor/mb-editor/index.js +20 -28
  105. package/lib/FileEditor/pc-editor/addition-previewer/index.js +3 -1
  106. package/lib/FileEditor/pc-editor/addition-previewer/local-file-addition/index.js +25 -11
  107. package/lib/FileEditor/pc-editor/index.js +27 -19
  108. package/lib/FileFormatter/index.js +19 -26
  109. package/lib/FileItemFormatter/index.js +9 -6
  110. package/lib/FileUploader/index.js +45 -28
  111. package/lib/FormulaFormatter/index.js +29 -15
  112. package/lib/GeolocationEditor/index.js +12 -11
  113. package/lib/GeolocationEditor/map-editor-utils.js +15 -17
  114. package/lib/GeolocationEditor/mb-editor/country-editor.js +14 -17
  115. package/lib/GeolocationEditor/mb-editor/index.js +6 -4
  116. package/lib/GeolocationEditor/mb-editor/location-editor.js +15 -18
  117. package/lib/GeolocationEditor/mb-editor/map-editor/index.js +68 -41
  118. package/lib/GeolocationEditor/mb-editor/map-selection-editor/index.js +89 -50
  119. package/lib/GeolocationEditor/mb-editor/province-city-editor.js +14 -17
  120. package/lib/GeolocationEditor/mb-editor/province-editor.js +14 -17
  121. package/lib/GeolocationEditor/pc-editor/country-editor.js +23 -10
  122. package/lib/GeolocationEditor/pc-editor/index.js +20 -12
  123. package/lib/GeolocationEditor/pc-editor/location-editor.js +31 -26
  124. package/lib/GeolocationEditor/pc-editor/map-editor/index.js +54 -34
  125. package/lib/GeolocationEditor/pc-editor/map-editor/large-editor/index.js +60 -36
  126. package/lib/GeolocationEditor/pc-editor/map-selection-editor/index.js +62 -35
  127. package/lib/GeolocationEditor/pc-editor/map-selection-editor/large-editor/index.js +65 -36
  128. package/lib/GeolocationEditor/pc-editor/province-city-editor.js +25 -19
  129. package/lib/GeolocationEditor/pc-editor/province-editor.js +13 -6
  130. package/lib/GeolocationEditor/pc-editor/selector-header-item.js +6 -5
  131. package/lib/GeolocationEditor/pc-editor/selector-list.js +7 -6
  132. package/lib/GeolocationFormatter/index.js +5 -4
  133. package/lib/HtmlLongTextFormatter/index.js +12 -4
  134. package/lib/Icon/index.js +5 -3
  135. package/lib/IconButton/index.js +6 -4
  136. package/lib/ImageEditor/images-previewer/image-preview/index.js +21 -12
  137. package/lib/ImageEditor/images-previewer/index.js +9 -3
  138. package/lib/ImageEditor/index.js +3 -1
  139. package/lib/ImageEditor/mb-editor/index.js +20 -28
  140. package/lib/ImageEditor/pc-editor/addition-previewer/image-link/index.js +6 -2
  141. package/lib/ImageEditor/pc-editor/addition-previewer/index.js +3 -1
  142. package/lib/ImageEditor/pc-editor/addition-previewer/local-image-addition/index.js +21 -7
  143. package/lib/ImageEditor/pc-editor/images-previewer/index.js +9 -3
  144. package/lib/ImageEditor/pc-editor/index.js +16 -11
  145. package/lib/ImageFormatter/images-lazy-load.js +11 -19
  146. package/lib/ImageFormatter/index.js +13 -11
  147. package/lib/ImagePreviewerLightbox/index.js +15 -19
  148. package/lib/ImageThumbnail/index.js +13 -10
  149. package/lib/InputItem/custom-input.js +46 -26
  150. package/lib/InputItem/custom-keyboard.js +18 -15
  151. package/lib/InputItem/index.js +50 -34
  152. package/lib/InputItem/input.js +4 -2
  153. package/lib/LastModifierFormatter/index.js +8 -6
  154. package/lib/LinkEditor/index.js +53 -33
  155. package/lib/LinkEditor/link-editor-option.js +4 -3
  156. package/lib/LinkEditor/mb-popover/index.js +22 -9
  157. package/lib/LinkEditor/pc-popover/index.js +10 -5
  158. package/lib/LinkFormatter/index.js +37 -21
  159. package/lib/List/index.js +8 -6
  160. package/lib/List/list-item.js +28 -22
  161. package/lib/LongTextFormatter/index.js +5 -4
  162. package/lib/MBEditorHeader/index.js +8 -7
  163. package/lib/MTimeFormatter/index.js +4 -3
  164. package/lib/MobileFullScreenPage/body/index.js +5 -3
  165. package/lib/MobileFullScreenPage/header/index.js +6 -4
  166. package/lib/MobileFullScreenPage/index.js +11 -13
  167. package/lib/MobileModal/index.js +3 -1
  168. package/lib/MobileOperationSheet/index.js +8 -7
  169. package/lib/MobileSelector/empty/index.js +3 -1
  170. package/lib/MobileSelector/index.js +7 -5
  171. package/lib/MobileSelector/option/index.js +5 -3
  172. package/lib/MobileSelector/options/index.css +0 -4
  173. package/lib/MobileSelector/options/index.js +3 -1
  174. package/lib/MobileSelector/search/index.js +5 -3
  175. package/lib/MobileUpload/index.js +5 -4
  176. package/lib/Modal/modal.js +15 -14
  177. package/lib/Modal/prompt.js +4 -4
  178. package/lib/MultipleSelectEditor/index.js +3 -1
  179. package/lib/MultipleSelectFormatter/index.js +8 -6
  180. package/lib/NotificationPopover/index.js +5 -4
  181. package/lib/NumberEditor/index.js +21 -12
  182. package/lib/NumberFormatter/index.js +5 -4
  183. package/lib/PhoneNumberLink/index.js +4 -2
  184. package/lib/Picker/AbstractPicker.js +27 -23
  185. package/lib/Popover/index.js +4 -3
  186. package/lib/Popover/item.js +9 -7
  187. package/lib/Progress/index.js +8 -9
  188. package/lib/Radio/Radio.js +8 -4
  189. package/lib/Radio/RadioItem.js +12 -8
  190. package/lib/RateFormatter/index.js +13 -13
  191. package/lib/RoleStatusEditor/index.js +17 -18
  192. package/lib/RowExpandDialog/body/index.js +49 -32
  193. package/lib/RowExpandDialog/column-content/index.js +9 -5
  194. package/lib/RowExpandDialog/header/index.js +8 -6
  195. package/lib/RowExpandDialog/index.js +34 -49
  196. package/lib/RowExpandEditor/checkbox-editor/mb-editor/index.js +5 -4
  197. package/lib/RowExpandEditor/checkbox-editor/pc-editor.js +10 -8
  198. package/lib/RowExpandEditor/collaborator-editor/mb-editor/index.js +33 -22
  199. package/lib/RowExpandEditor/collaborator-editor/pc-editor/index.js +40 -26
  200. package/lib/RowExpandEditor/date-editor/mb-editor.js +18 -12
  201. package/lib/RowExpandEditor/date-editor/pc-editor.js +20 -15
  202. package/lib/RowExpandEditor/department-editor/mb-editor.js +11 -16
  203. package/lib/RowExpandEditor/department-editor/pc-editor.js +14 -19
  204. package/lib/RowExpandEditor/digital-sign-editor/mb-editor/index.js +34 -20
  205. package/lib/RowExpandEditor/digital-sign-editor/pc-editor/index.js +35 -21
  206. package/lib/RowExpandEditor/duration-editor/mb-editor.js +17 -10
  207. package/lib/RowExpandEditor/duration-editor/pc-editor.js +19 -13
  208. package/lib/RowExpandEditor/email-editor/mb-editor/index.js +19 -9
  209. package/lib/RowExpandEditor/email-editor/pc-editor/index.js +24 -13
  210. package/lib/RowExpandEditor/file-editor/mb-editor/index.js +31 -18
  211. package/lib/RowExpandEditor/file-editor/pc-editor/index.js +23 -16
  212. package/lib/RowExpandEditor/geolocation-editor/mb-editor/index.js +29 -17
  213. package/lib/RowExpandEditor/geolocation-editor/pc-editor/index.js +26 -13
  214. package/lib/RowExpandEditor/image-editor/mb-editor/index.js +25 -15
  215. package/lib/RowExpandEditor/image-editor/pc-editor/index.js +23 -13
  216. package/lib/RowExpandEditor/index.js +8 -4
  217. package/lib/RowExpandEditor/long-text-editor/mb-editor/editor/index.js +18 -17
  218. package/lib/RowExpandEditor/long-text-editor/mb-editor/index.js +16 -10
  219. package/lib/RowExpandEditor/long-text-editor/pc-editor/index.js +23 -16
  220. package/lib/RowExpandEditor/multiple-select-editor/mb-editor/index.js +19 -11
  221. package/lib/RowExpandEditor/multiple-select-editor/pc-editor/index.js +33 -22
  222. package/lib/RowExpandEditor/number-editor/mb-editor/index.js +14 -8
  223. package/lib/RowExpandEditor/number-editor/pc-editor.js +20 -13
  224. package/lib/RowExpandEditor/rate-editor/mb-editor.js +25 -12
  225. package/lib/RowExpandEditor/rate-editor/pc-editor.js +36 -20
  226. package/lib/RowExpandEditor/single-select-editor/mb-editor/index.js +28 -17
  227. package/lib/RowExpandEditor/single-select-editor/pc-editor/index.js +34 -22
  228. package/lib/RowExpandEditor/text-editor/mb-editor/index.js +5 -4
  229. package/lib/RowExpandEditor/text-editor/pc-editor/index.js +26 -15
  230. package/lib/RowExpandEditor/url-editor/mb-editor/index.js +13 -5
  231. package/lib/RowExpandEditor/url-editor/pc-editor/index.js +18 -9
  232. package/lib/RowExpandFormatter/department-formatter/mb-formatter.js +4 -2
  233. package/lib/RowExpandFormatter/department-formatter/pc-formatter.js +4 -2
  234. package/lib/RowExpandFormatter/email-formatter/index.js +7 -4
  235. package/lib/RowExpandFormatter/file-formatter/index.js +9 -8
  236. package/lib/RowExpandFormatter/file-formatter/row-expand-file-item-formatter.js +12 -10
  237. package/lib/RowExpandFormatter/formula-formatter/index.js +34 -19
  238. package/lib/RowExpandFormatter/image-formatter/index.js +11 -9
  239. package/lib/RowExpandFormatter/image-formatter/row-expand-image-item-formatter.js +8 -7
  240. package/lib/RowExpandFormatter/index.js +41 -27
  241. package/lib/RowExpandFormatter/link-formatter/collaborator-item-formatter.js +14 -8
  242. package/lib/RowExpandFormatter/link-formatter/index.js +19 -11
  243. package/lib/RowExpandFormatter/link-formatter/value-display-utils.js +5 -3
  244. package/lib/RowExpandFormatter/rate-formatter/index.js +12 -11
  245. package/lib/RowExpandFormatter/text/index.js +5 -4
  246. package/lib/RowExpandFormatter/url-formatter/index.js +7 -4
  247. package/lib/RowExpandView/body/index.js +35 -22
  248. package/lib/RowExpandView/column-content/index.js +7 -3
  249. package/lib/RowExpandView/index.js +30 -42
  250. package/lib/SelectItem/index.js +7 -5
  251. package/lib/SelectOptionGroup/index.js +40 -30
  252. package/lib/SelectedDepartments/index.js +9 -7
  253. package/lib/SimpleLongTextFormatter/index.js +16 -10
  254. package/lib/SimpleLongTextFormatter/normalize-long-text-value.js +4 -3
  255. package/lib/SimpleLongTextFormatter/widgets/LongTextPreview.js +21 -12
  256. package/lib/SimpleLongTextFormatter/widgets/dtable-markdown-viewer.js +4 -3
  257. package/lib/SingleSelectEditor/index.js +3 -1
  258. package/lib/SingleSelectFormatter/index.js +9 -8
  259. package/lib/TabBar/Tab.js +16 -14
  260. package/lib/TabBar/index.js +21 -18
  261. package/lib/Tabs/index.js +3 -1
  262. package/lib/TextEditor/index.js +23 -14
  263. package/lib/TextFormatter/index.js +4 -3
  264. package/lib/TextareaItem/index.js +26 -19
  265. package/lib/Toast/index.js +4 -3
  266. package/lib/UrlFormatter/index.js +4 -3
  267. package/lib/common/editor-base.js +12 -7
  268. package/lib/hooks/common-hooks.js +4 -2
  269. package/lib/select-editor/index.js +3 -1
  270. package/lib/select-editor/mb-editor/index.js +28 -17
  271. package/lib/select-editor/pc-editor/index.js +42 -27
  272. package/lib/toaster/alert.js +7 -6
  273. package/lib/toaster/toast.js +3 -2
  274. package/lib/toaster/toastManager.js +4 -2
  275. package/lib/utils/cell.js +11 -8
  276. package/lib/utils/column-utils.js +14 -8
  277. package/lib/utils/departments.js +3 -1
  278. package/lib/utils/url.js +25 -18
  279. package/lib/utils/utils.js +6 -2
  280. package/package.json +2 -2
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.default = void 0;
8
- var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
9
8
  var _react = _interopRequireDefault(require("react"));
10
9
  var _url = require("../../../utils/url");
11
10
  var _utils = require("../../../utils/utils");
@@ -24,20 +23,26 @@ class PCFilesPreviewer extends _react.default.Component {
24
23
  });
25
24
  };
26
25
  this.showLargeImage = itemUrl => {
27
- let fileImageUrlList = this.state.fileImageUrlList;
26
+ let {
27
+ fileImageUrlList
28
+ } = this.state;
28
29
  this.setState({
29
30
  isShowLargeImage: true,
30
31
  largeImageIndex: fileImageUrlList.indexOf(itemUrl)
31
32
  });
32
33
  };
33
34
  this.moveNext = () => {
34
- let fileImageUrlList = this.state.fileImageUrlList;
35
+ let {
36
+ fileImageUrlList
37
+ } = this.state;
35
38
  this.setState(prevState => ({
36
39
  largeImageIndex: (prevState.largeImageIndex + 1) % fileImageUrlList.length
37
40
  }));
38
41
  };
39
42
  this.movePrev = () => {
40
- let fileImageUrlList = this.state.fileImageUrlList;
43
+ let {
44
+ fileImageUrlList
45
+ } = this.state;
41
46
  this.setState(prevState => ({
42
47
  largeImageIndex: (prevState.largeImageIndex + fileImageUrlList.length - 1) % fileImageUrlList.length
43
48
  }));
@@ -49,23 +54,30 @@ class PCFilesPreviewer extends _react.default.Component {
49
54
  });
50
55
  };
51
56
  this.downloadImage = imageItemUrl => {
52
- const value = this.props.value;
57
+ const {
58
+ value
59
+ } = this.props;
53
60
  const file = value.find(v => v.url === imageItemUrl);
54
61
  if (!file) return;
55
62
  this.props.getDownLoadFiles([file], _ref => {
56
- let _ref2 = (0, _slicedToArray2.default)(_ref, 1),
57
- dFile = _ref2[0];
63
+ let [dFile] = _ref;
58
64
  dFile && (0, _utils.downloadFile)(dFile);
59
65
  });
60
66
  };
61
67
  this.onRotateImage = (imageIndex, degree) => {
62
- let fileImageUrlList = this.state.fileImageUrlList;
68
+ let {
69
+ fileImageUrlList
70
+ } = this.state;
63
71
  const imageUrl = fileImageUrlList[imageIndex];
64
72
  this.props.onRotateImage && this.props.onRotateImage(imageUrl, degree);
65
73
  };
66
74
  this.deleteImage = (index, type) => {
67
- const value = this.props.value;
68
- let fileImageUrlList = this.state.fileImageUrlList;
75
+ const {
76
+ value
77
+ } = this.props;
78
+ let {
79
+ fileImageUrlList
80
+ } = this.state;
69
81
  const imageUrl = fileImageUrlList[index];
70
82
  let fileItemIndex = value.findIndex(fileItem => fileItem.url === imageUrl);
71
83
  this.props.deleteFile(fileItemIndex, type);
@@ -94,7 +106,9 @@ class PCFilesPreviewer extends _react.default.Component {
94
106
  });
95
107
  };
96
108
  this.onSelectFiles = name => {
97
- const selectedFilesList = this.state.selectedFilesList;
109
+ const {
110
+ selectedFilesList
111
+ } = this.state;
98
112
  let filesList = selectedFilesList.slice(0);
99
113
  const selectedFileIndex = selectedFilesList.indexOf(name);
100
114
  if (selectedFileIndex > -1) {
@@ -107,8 +121,12 @@ class PCFilesPreviewer extends _react.default.Component {
107
121
  });
108
122
  };
109
123
  this.onSelectAllFiles = () => {
110
- const value = this.props.value;
111
- const selectedFilesList = this.state.selectedFilesList;
124
+ const {
125
+ value
126
+ } = this.props;
127
+ const {
128
+ selectedFilesList
129
+ } = this.state;
112
130
  if (value.length === 0) return;
113
131
  let allFilesList = selectedFilesList.slice(0);
114
132
  value.map(item => {
@@ -128,8 +146,12 @@ class PCFilesPreviewer extends _react.default.Component {
128
146
  });
129
147
  };
130
148
  this.onDownloadAllSelectedFiles = () => {
131
- const config = this.props.config;
132
- const selectedFilesList = this.state.selectedFilesList;
149
+ const {
150
+ config
151
+ } = this.props;
152
+ const {
153
+ selectedFilesList
154
+ } = this.state;
133
155
  if (selectedFilesList.length === 0) return;
134
156
  this.props.getDownLoadFiles(selectedFilesList, downloadFilesUrlList => {
135
157
  if (downloadFilesUrlList.length > 0) {
@@ -139,18 +161,22 @@ class PCFilesPreviewer extends _react.default.Component {
139
161
  });
140
162
  };
141
163
  this.onDeleteAllSelectedFiles = () => {
142
- const selectedFilesList = this.state.selectedFilesList;
164
+ const {
165
+ selectedFilesList
166
+ } = this.state;
143
167
  this.props.deleteFiles(selectedFilesList);
144
168
  this.onChangeSelectMultipleFiles(false);
145
169
  };
146
170
  this.renderFilesOperation = () => {
147
- const _this$props = this.props,
148
- value = _this$props.value,
149
- deleteFiles = _this$props.deleteFiles,
150
- getDownLoadFiles = _this$props.getDownLoadFiles;
151
- const _this$state = this.state,
152
- isSelectMultipleFiles = _this$state.isSelectMultipleFiles,
153
- selectedFilesList = _this$state.selectedFilesList;
171
+ const {
172
+ value,
173
+ deleteFiles,
174
+ getDownLoadFiles
175
+ } = this.props;
176
+ const {
177
+ isSelectMultipleFiles,
178
+ selectedFilesList
179
+ } = this.state;
154
180
  if (value.length === 0) return null;
155
181
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
156
182
  className: "dtable-ui-file-editor-operation-content",
@@ -199,12 +225,14 @@ class PCFilesPreviewer extends _react.default.Component {
199
225
  }
200
226
  }
201
227
  render() {
202
- let _this$props2 = this.props,
203
- value = _this$props2.value,
204
- getDownLoadFiles = _this$props2.getDownLoadFiles;
205
- const _this$state2 = this.state,
206
- isSelectMultipleFiles = _this$state2.isSelectMultipleFiles,
207
- selectedFilesList = _this$state2.selectedFilesList;
228
+ let {
229
+ value,
230
+ getDownLoadFiles
231
+ } = this.props;
232
+ const {
233
+ isSelectMultipleFiles,
234
+ selectedFilesList
235
+ } = this.state;
208
236
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
209
237
  className: "dtable-ui-file-editor-previewer",
210
238
  children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
@@ -16,7 +16,9 @@ require("./index.css");
16
16
  var _jsxRuntime = require("react/jsx-runtime");
17
17
  const _excluded = ["isMobile"];
18
18
  const FileEditor = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
19
- let isMobile = _ref.isMobile,
19
+ let {
20
+ isMobile
21
+ } = _ref,
20
22
  props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
21
23
  if (isMobile === false) return /*#__PURE__*/(0, _jsxRuntime.jsx)(_pcEditor.default, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, props), {}, {
22
24
  ref: ref
@@ -1,12 +1,11 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
4
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+ var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
8
  exports.default = void 0;
9
- var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
10
9
  var _react = _interopRequireWildcard(require("react"));
11
10
  var _ActivityIndicator = _interopRequireDefault(require("../../ActivityIndicator"));
12
11
  var _MobileFullScreenPage = _interopRequireDefault(require("../../MobileFullScreenPage"));
@@ -17,35 +16,28 @@ var _utils = require("../../utils/utils");
17
16
  var _lang = require("../../lang");
18
17
  require("./index.css");
19
18
  var _jsxRuntime = require("react/jsx-runtime");
20
- const Header = _MobileFullScreenPage.default.Header,
21
- Body = _MobileFullScreenPage.default.Body;
19
+ const {
20
+ Header,
21
+ Body
22
+ } = _MobileFullScreenPage.default;
22
23
  const MBFileEditor = _ref => {
23
- let oldValue = _ref.value,
24
- column = _ref.column,
25
- config = _ref.config,
26
- onToggle = _ref.onToggle,
27
- onCommit = _ref.onCommit,
28
- uploadFile = _ref.uploadFile;
29
- const _useState = (0, _react.useState)(oldValue || []),
30
- _useState2 = (0, _slicedToArray2.default)(_useState, 2),
31
- value = _useState2[0],
32
- setValue = _useState2[1];
33
- const _useState3 = (0, _react.useState)(false),
34
- _useState4 = (0, _slicedToArray2.default)(_useState3, 2),
35
- isShowEditor = _useState4[0],
36
- setShowEditor = _useState4[1];
37
- const _useState5 = (0, _react.useState)([]),
38
- _useState6 = (0, _slicedToArray2.default)(_useState5, 2),
39
- uploadLocalFiles = _useState6[0],
40
- setUploadLocalFiles = _useState6[1];
41
- const _useState7 = (0, _react.useState)(false),
42
- _useState8 = (0, _slicedToArray2.default)(_useState7, 2),
43
- isUploading = _useState8[0],
44
- setUploading = _useState8[1];
24
+ let {
25
+ value: oldValue,
26
+ column,
27
+ config,
28
+ onToggle,
29
+ onCommit,
30
+ uploadFile
31
+ } = _ref;
32
+ const [value, setValue] = (0, _react.useState)(oldValue || []);
33
+ const [isShowEditor, setShowEditor] = (0, _react.useState)(false);
34
+ const [uploadLocalFiles, setUploadLocalFiles] = (0, _react.useState)([]);
35
+ const [isUploading, setUploading] = (0, _react.useState)(false);
45
36
  const uploadingFilesCount = (0, _react.useRef)(0);
46
37
  const uploadedFilesCount = (0, _react.useRef)(0);
47
- const _ref2 = config || {},
48
- mediaUrl = _ref2.mediaUrl;
38
+ const {
39
+ mediaUrl
40
+ } = config || {};
49
41
  const resetFileValue = (0, _react.useCallback)(() => {
50
42
  setUploadLocalFiles([]);
51
43
  }, []);
@@ -25,7 +25,9 @@ class AdditionPreviewer extends _react.default.Component {
25
25
  };
26
26
  }
27
27
  render() {
28
- let activeTab = this.state.activeTab;
28
+ let {
29
+ activeTab
30
+ } = this.state;
29
31
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
30
32
  className: "dtable-ui-image-addition-container",
31
33
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
@@ -36,7 +36,9 @@ class LocalFileAddition extends _react.default.Component {
36
36
  };
37
37
  this.onFileUploadSuccess = fileMessage => {
38
38
  this.hideDeleteIcon();
39
- let thumbnailSrcList = this.state.thumbnailSrcList;
39
+ let {
40
+ thumbnailSrcList
41
+ } = this.state;
40
42
  const findUploadFileIndex = this.findUploadFileIndex(fileMessage);
41
43
  thumbnailSrcList.splice(findUploadFileIndex, 1, fileMessage);
42
44
  if (thumbnailSrcList.every(fileItem => !fileItem.isUploading)) {
@@ -47,7 +49,9 @@ class LocalFileAddition extends _react.default.Component {
47
49
  this.props.fileUploadCompleted(fileMessage);
48
50
  };
49
51
  this.onFileUploadProgress = fileMessage => {
50
- let thumbnailSrcList = this.state.thumbnailSrcList;
52
+ let {
53
+ thumbnailSrcList
54
+ } = this.state;
51
55
  const findUploadFileIndex = this.findUploadFileIndex(fileMessage);
52
56
  thumbnailSrcList.splice(findUploadFileIndex, 1, fileMessage);
53
57
  this.setState({
@@ -55,7 +59,9 @@ class LocalFileAddition extends _react.default.Component {
55
59
  });
56
60
  };
57
61
  this.onFileUploadFailed = fileMessage => {
58
- let thumbnailSrcList = this.state.thumbnailSrcList;
62
+ let {
63
+ thumbnailSrcList
64
+ } = this.state;
59
65
  const findUploadFileIndex = this.findUploadFileIndex(fileMessage);
60
66
  thumbnailSrcList.splice(findUploadFileIndex, 1, fileMessage);
61
67
  this.setState({
@@ -63,7 +69,9 @@ class LocalFileAddition extends _react.default.Component {
63
69
  });
64
70
  };
65
71
  this.findUploadFileIndex = uploadFileMessage => {
66
- let thumbnailSrcList = this.state.thumbnailSrcList;
72
+ let {
73
+ thumbnailSrcList
74
+ } = this.state;
67
75
  let uploadFileIndex = thumbnailSrcList.findIndex(item => item.name === uploadFileMessage.file.name);
68
76
  return uploadFileIndex;
69
77
  };
@@ -97,7 +105,9 @@ class LocalFileAddition extends _react.default.Component {
97
105
  });
98
106
  };
99
107
  this.renderMultipleFilesArr = () => {
100
- let thumbnailSrcList = this.state.thumbnailSrcList;
108
+ let {
109
+ thumbnailSrcList
110
+ } = this.state;
101
111
  let fileArr = [];
102
112
  if (Array.isArray(this.props.uploadLocalFileValue)) {
103
113
  let uploadedFileList = this.renderUploadedFile();
@@ -153,13 +163,15 @@ class LocalFileAddition extends _react.default.Component {
153
163
  return fileArr;
154
164
  };
155
165
  this.renderUploadedFile = () => {
156
- const _this$props = this.props,
157
- config = _this$props.config,
158
- uploadLocalFileValue = _this$props.uploadLocalFileValue;
166
+ const {
167
+ config,
168
+ uploadLocalFileValue
169
+ } = this.props;
159
170
  let uploadedFileList = [];
160
171
  uploadedFileList = uploadLocalFileValue.length > 0 && uploadLocalFileValue.map((fileItem, index) => {
161
- let _getFileThumbnailInfo = (0, _url.getFileThumbnailInfo)(fileItem, config),
162
- fileIconUrl = _getFileThumbnailInfo.fileIconUrl;
172
+ let {
173
+ fileIconUrl
174
+ } = (0, _url.getFileThumbnailInfo)(fileItem, config);
163
175
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
164
176
  className: "dtable-ui-image-wrapper",
165
177
  id: "file-content-tip-".concat(index),
@@ -191,7 +203,9 @@ class LocalFileAddition extends _react.default.Component {
191
203
  return uploadedFileList;
192
204
  };
193
205
  this.renderUploadFileWrapper = fileArr => {
194
- let isFileTipShow = this.state.isFileTipShow;
206
+ let {
207
+ isFileTipShow
208
+ } = this.state;
195
209
  let editorContent = fileArr.length === 0 ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_react.Fragment, {
196
210
  children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
197
211
  className: "dtable-ui-image-tip-addition ".concat(isFileTipShow ? 'dtable-ui-image-drop-active' : ''),
@@ -27,9 +27,10 @@ class PCFileEditor extends _react.default.Component {
27
27
  return this.state.value;
28
28
  };
29
29
  this.getEditorView = () => {
30
- const _this$props = this.props,
31
- isInModal = _this$props.isInModal,
32
- value = _this$props.value;
30
+ const {
31
+ isInModal,
32
+ value
33
+ } = this.props;
33
34
  return !value || value.length === 0 || isInModal ? _constants.FILE_EDITOR_STATUS.ADDITION : _constants.FILE_EDITOR_STATUS.PREVIEWER;
34
35
  };
35
36
  this.deleteImage = function (index) {
@@ -59,9 +60,10 @@ class PCFileEditor extends _react.default.Component {
59
60
  e.stopPropagation();
60
61
  if (this.state.isOpen && this.state.isUpdated) {
61
62
  if (this.state.editorView === _constants.FILE_EDITOR_STATUS.ADDITION) {
62
- let _this$state = this.state,
63
- value = _this$state.value,
64
- uploadLocalFileValue = _this$state.uploadLocalFileValue;
63
+ let {
64
+ value,
65
+ uploadLocalFileValue
66
+ } = this.state;
65
67
  let newValue = value.concat(uploadLocalFileValue);
66
68
  this.setState({
67
69
  value: newValue
@@ -111,11 +113,13 @@ class PCFileEditor extends _react.default.Component {
111
113
  };
112
114
  this.addUploadedFile = fileMessageList => {
113
115
  const uploadLocalFileValue = [...this.state.uploadLocalFileValue, ...fileMessageList.map(_ref => {
114
- let name = _ref.name,
115
- size = _ref.size,
116
- type = _ref.type,
117
- url = _ref.url,
118
- mtime = _ref.mtime;
116
+ let {
117
+ name,
118
+ size,
119
+ type,
120
+ url,
121
+ mtime
122
+ } = _ref;
119
123
  return {
120
124
  name,
121
125
  size,
@@ -130,7 +134,9 @@ class PCFileEditor extends _react.default.Component {
130
134
  });
131
135
  };
132
136
  this.renderHeader = () => {
133
- let editorView = this.state.editorView;
137
+ let {
138
+ editorView
139
+ } = this.state;
134
140
  // if (this.props.isInModal) {
135
141
  // return (<span>{getLocale('Add_files')}</span>);
136
142
  // }
@@ -150,10 +156,11 @@ class PCFileEditor extends _react.default.Component {
150
156
  });
151
157
  };
152
158
  this.showImageListPreviewer = () => {
153
- let _this$state2 = this.state,
154
- value = _this$state2.value,
155
- uploadLocalFileValue = _this$state2.uploadLocalFileValue,
156
- imageLinkValue = _this$state2.imageLinkValue;
159
+ let {
160
+ value,
161
+ uploadLocalFileValue,
162
+ imageLinkValue
163
+ } = this.state;
157
164
  let newValue = value.concat(uploadLocalFileValue, imageLinkValue);
158
165
  this.setState({
159
166
  value: newValue
@@ -196,9 +203,10 @@ class PCFileEditor extends _react.default.Component {
196
203
  let fileItem = newValue[index];
197
204
  if (!this.props.renameFile) return;
198
205
  this.props.renameFile(fileItem, newName).then(res => {
199
- const _res$data = res.data,
200
- name = _res$data.name,
201
- url = _res$data.url;
206
+ const {
207
+ name,
208
+ url
209
+ } = res.data;
202
210
  fileItem = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, fileItem), {}, {
203
211
  name,
204
212
  url
@@ -1,12 +1,11 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
4
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+ var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
8
  exports.default = void 0;
9
- var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
10
9
  var _react = _interopRequireWildcard(require("react"));
11
10
  var _classnames = _interopRequireDefault(require("classnames"));
12
11
  var _FileItemFormatter = _interopRequireDefault(require("../FileItemFormatter"));
@@ -15,33 +14,27 @@ var _url = require("../utils/url");
15
14
  require("./index.css");
16
15
  var _jsxRuntime = require("react/jsx-runtime");
17
16
  const FileFormatter = _ref => {
18
- let _ref$isSample = _ref.isSample,
19
- isSample = _ref$isSample === void 0 ? false : _ref$isSample,
20
- _ref$value = _ref.value,
21
- value = _ref$value === void 0 ? [] : _ref$value,
22
- _ref$containerClassNa = _ref.containerClassName,
23
- containerClassName = _ref$containerClassNa === void 0 ? '' : _ref$containerClassNa,
24
- renderItem = _ref.renderItem,
25
- _ref$isSupportOpenFil = _ref.isSupportOpenFile,
26
- isSupportOpenFile = _ref$isSupportOpenFil === void 0 ? false : _ref$isSupportOpenFil,
27
- onOpenFile = _ref.onOpenFile,
28
- server = _ref.server,
29
- workspaceID = _ref.workspaceID,
30
- dtableUuid = _ref.dtableUuid,
31
- downloadImage = _ref.downloadImage;
32
- const _useState = (0, _react.useState)(-1),
33
- _useState2 = (0, _slicedToArray2.default)(_useState, 2),
34
- largeImageIndex = _useState2[0],
35
- setLargeImageIndex = _useState2[1];
36
- const _useState3 = (0, _react.useState)([]),
37
- _useState4 = (0, _slicedToArray2.default)(_useState3, 2),
38
- fileImageUrlList = _useState4[0],
39
- setFileImageUrlList = _useState4[1];
17
+ let {
18
+ isSample = false,
19
+ value = [],
20
+ containerClassName = '',
21
+ renderItem,
22
+ isSupportOpenFile = false,
23
+ onOpenFile,
24
+ server,
25
+ workspaceID,
26
+ dtableUuid,
27
+ downloadImage
28
+ } = _ref;
29
+ const [largeImageIndex, setLargeImageIndex] = (0, _react.useState)(-1);
30
+ const [fileImageUrlList, setFileImageUrlList] = (0, _react.useState)([]);
40
31
  const getFileItemImageUrlList = (0, _react.useCallback)(value => {
41
32
  let newFileImageUrlList = [];
42
33
  value.forEach(fileItem => {
43
- const url = fileItem.url,
44
- name = fileItem.name;
34
+ const {
35
+ url,
36
+ name
37
+ } = fileItem;
45
38
  let assetFileIndex = typeof url === 'string' ? url.indexOf('/asset') : -1;
46
39
  if (assetFileIndex > -1) {
47
40
  const isImage = (0, _url.imageCheck)(name);
@@ -9,12 +9,15 @@ var _react = _interopRequireDefault(require("react"));
9
9
  var _url = require("../utils/url");
10
10
  var _jsxRuntime = require("react/jsx-runtime");
11
11
  const FileItemFormatter = _ref => {
12
- let file = _ref.file,
13
- config = _ref.config,
14
- openFile = _ref.openFile;
15
- const _getFileThumbnailInfo = (0, _url.getFileThumbnailInfo)(file, config),
16
- fileIconUrl = _getFileThumbnailInfo.fileIconUrl,
17
- isImage = _getFileThumbnailInfo.isImage;
12
+ let {
13
+ file,
14
+ config,
15
+ openFile
16
+ } = _ref;
17
+ const {
18
+ fileIconUrl,
19
+ isImage
20
+ } = (0, _url.getFileThumbnailInfo)(file, config);
18
21
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
19
22
  onClick: () => openFile && openFile(file),
20
23
  className: "file-item-icon ".concat(isImage ? 'img' : ''),
@@ -27,9 +27,10 @@ class FileUploader extends _react.default.Component {
27
27
  this.uploadFileRef.click();
28
28
  };
29
29
  this.onDragEnter = e => {
30
- const _this$props = this.props,
31
- isSupportDragDrop = _this$props.isSupportDragDrop,
32
- updateParentTips = _this$props.updateParentTips;
30
+ const {
31
+ isSupportDragDrop,
32
+ updateParentTips
33
+ } = this.props;
33
34
  if (isSupportDragDrop) {
34
35
  e.preventDefault();
35
36
  this.enteredCounter++;
@@ -39,16 +40,19 @@ class FileUploader extends _react.default.Component {
39
40
  }
40
41
  };
41
42
  this.onDragOver = e => {
42
- const isSupportDragDrop = this.props.isSupportDragDrop;
43
+ const {
44
+ isSupportDragDrop
45
+ } = this.props;
43
46
  if (isSupportDragDrop) {
44
47
  e.stopPropagation();
45
48
  e.preventDefault();
46
49
  }
47
50
  };
48
51
  this.onDragLeave = e => {
49
- const _this$props2 = this.props,
50
- isSupportDragDrop = _this$props2.isSupportDragDrop,
51
- updateParentTips = _this$props2.updateParentTips;
52
+ const {
53
+ isSupportDragDrop,
54
+ updateParentTips
55
+ } = this.props;
52
56
  if (isSupportDragDrop) {
53
57
  this.enteredCounter--;
54
58
  if (this.enteredCounter === 0) {
@@ -57,10 +61,11 @@ class FileUploader extends _react.default.Component {
57
61
  }
58
62
  };
59
63
  this.onDrop = event => {
60
- const _this$props3 = this.props,
61
- isSupportDragDrop = _this$props3.isSupportDragDrop,
62
- updateParentTips = _this$props3.updateParentTips,
63
- onCellTipShow = _this$props3.onCellTipShow;
64
+ const {
65
+ isSupportDragDrop,
66
+ updateParentTips,
67
+ onCellTipShow
68
+ } = this.props;
64
69
  if (isSupportDragDrop) {
65
70
  this.enteredCounter = 0;
66
71
  updateParentTips(false);
@@ -74,7 +79,9 @@ class FileUploader extends _react.default.Component {
74
79
  }
75
80
  };
76
81
  this.onPaste = event => {
77
- const isSupportPaste = this.props.isSupportPaste;
82
+ const {
83
+ isSupportPaste
84
+ } = this.props;
78
85
  if (isSupportPaste) {
79
86
  event.stopPropagation();
80
87
  let cliperData = (0, _getEventTransfer.default)(event);
@@ -85,17 +92,19 @@ class FileUploader extends _react.default.Component {
85
92
  }
86
93
  };
87
94
  this.onMouseEnter = () => {
88
- const _this$props4 = this.props,
89
- updateParentTips = _this$props4.updateParentTips,
90
- uploadType = _this$props4.uploadType;
95
+ const {
96
+ updateParentTips,
97
+ uploadType
98
+ } = this.props;
91
99
  if (uploadType === 'image') {
92
100
  if (updateParentTips) updateParentTips(true, uploadType);
93
101
  }
94
102
  };
95
103
  this.onMouseLeave = () => {
96
- const _this$props5 = this.props,
97
- updateParentTips = _this$props5.updateParentTips,
98
- uploadType = _this$props5.uploadType;
104
+ const {
105
+ updateParentTips,
106
+ uploadType
107
+ } = this.props;
99
108
  if (uploadType === 'image') {
100
109
  if (updateParentTips) updateParentTips(false, uploadType);
101
110
  }
@@ -106,10 +115,11 @@ class FileUploader extends _react.default.Component {
106
115
  this.handleFilesChange = function (files) {
107
116
  let isPasteUpload = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
108
117
  const _this = _this2;
109
- const _this2$props = _this2.props,
110
- uploadType = _this2$props.uploadType,
111
- updateUploadFileList = _this2$props.updateUploadFileList,
112
- onCellTipShow = _this2$props.onCellTipShow;
118
+ const {
119
+ uploadType,
120
+ updateUploadFileList,
121
+ onCellTipShow
122
+ } = _this2.props;
113
123
  let uploadFileList = [];
114
124
  let dealFileCnt = 0;
115
125
  let allFileLen = files.length;
@@ -187,7 +197,9 @@ class FileUploader extends _react.default.Component {
187
197
  });
188
198
  };
189
199
  this.handleFileChange = (fileMessage, callback) => {
190
- const onFileUploadFailed = this.props.onFileUploadFailed;
200
+ const {
201
+ onFileUploadFailed
202
+ } = this.props;
191
203
  this.uploadFile(fileMessage).then(res => {
192
204
  const data = res;
193
205
  this.uploadFileMessage({
@@ -208,9 +220,10 @@ class FileUploader extends _react.default.Component {
208
220
  });
209
221
  };
210
222
  this.uploadFileMessage = _ref => {
211
- let _ref$data = _ref.data,
212
- data = _ref$data === void 0 ? {} : _ref$data,
213
- fileMessage = _ref.fileMessage;
223
+ let {
224
+ data = {},
225
+ fileMessage
226
+ } = _ref;
214
227
  fileMessage.name = data.name;
215
228
  fileMessage.isUploading = false;
216
229
  fileMessage.size = data.size;
@@ -226,7 +239,9 @@ class FileUploader extends _react.default.Component {
226
239
  this.handleFileChange(fileMessage);
227
240
  };
228
241
  this.onUploadProgress = (event, fileMessage) => {
229
- const onFileUploadProgress = this.props.onFileUploadProgress;
242
+ const {
243
+ onFileUploadProgress
244
+ } = this.props;
230
245
  let uploadPercent = Math.floor(event.loaded / event.total * 100);
231
246
  fileMessage.percent = uploadPercent;
232
247
  if (onFileUploadProgress) onFileUploadProgress(fileMessage);
@@ -241,7 +256,9 @@ class FileUploader extends _react.default.Component {
241
256
  };
242
257
  }
243
258
  render() {
244
- const uploadType = this.props.uploadType;
259
+ const {
260
+ uploadType
261
+ } = this.props;
245
262
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
246
263
  onDragEnter: this.onDragEnter,
247
264
  onDragOver: this.onDragOver,