@douyinfe/semi-ui 2.12.1-alpha.1 → 2.13.0

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 (221) hide show
  1. package/autoComplete/_story/autoComplete.stories.js +0 -1
  2. package/autoComplete/index.tsx +1 -1
  3. package/avatar/index.tsx +2 -2
  4. package/backtop/index.tsx +7 -11
  5. package/badge/index.tsx +1 -1
  6. package/banner/index.tsx +5 -5
  7. package/breadcrumb/index.tsx +3 -5
  8. package/button/Button.tsx +8 -10
  9. package/card/index.tsx +41 -43
  10. package/carousel/CarouselArrow.tsx +0 -2
  11. package/carousel/index.tsx +0 -1
  12. package/cascader/index.tsx +126 -102
  13. package/cascader/item.tsx +1 -1
  14. package/checkbox/checkbox.tsx +28 -20
  15. package/checkbox/checkboxInner.tsx +11 -1
  16. package/collapsible/index.tsx +1 -8
  17. package/datePicker/dateInput.tsx +0 -1
  18. package/datePicker/datePicker.tsx +5 -13
  19. package/dist/css/semi.css +31 -1
  20. package/dist/css/semi.min.css +1 -1
  21. package/dist/umd/semi-ui.js +5321 -3696
  22. package/dist/umd/semi-ui.js.map +1 -1
  23. package/dist/umd/semi-ui.min.js +1 -1
  24. package/dist/umd/semi-ui.min.js.map +1 -1
  25. package/divider/index.tsx +4 -8
  26. package/dropdown/index.tsx +1 -1
  27. package/empty/index.tsx +5 -13
  28. package/form/hoc/withField.tsx +1 -1
  29. package/form/label.tsx +1 -1
  30. package/grid/col.tsx +1 -1
  31. package/grid/row.tsx +1 -1
  32. package/gulpfile.js +5 -5
  33. package/iconButton/index.tsx +1 -2
  34. package/input/index.tsx +11 -38
  35. package/inputNumber/__test__/inputNumber.test.js +2 -3
  36. package/inputNumber/_story/inputNumber.stories.js +53 -0
  37. package/inputNumber/index.tsx +0 -4
  38. package/lib/cjs/_base/base.css +22 -0
  39. package/lib/cjs/autoComplete/index.js +1 -1
  40. package/lib/cjs/avatar/index.js +2 -4
  41. package/lib/cjs/backtop/index.js +1 -2
  42. package/lib/cjs/badge/index.js +1 -2
  43. package/lib/cjs/banner/index.js +4 -9
  44. package/lib/cjs/breadcrumb/index.js +3 -4
  45. package/lib/cjs/button/Button.js +3 -13
  46. package/lib/cjs/card/index.js +5 -10
  47. package/lib/cjs/carousel/CarouselArrow.js +2 -6
  48. package/lib/cjs/carousel/CarouselIndicator.d.ts +1 -1
  49. package/lib/cjs/carousel/index.d.ts +1 -1
  50. package/lib/cjs/carousel/index.js +1 -2
  51. package/lib/cjs/cascader/index.js +10 -11
  52. package/lib/cjs/cascader/item.js +1 -2
  53. package/lib/cjs/checkbox/checkbox.d.ts +3 -2
  54. package/lib/cjs/checkbox/checkbox.js +33 -15
  55. package/lib/cjs/checkbox/checkboxInner.d.ts +6 -0
  56. package/lib/cjs/checkbox/checkboxInner.js +14 -4
  57. package/lib/cjs/collapsible/index.js +1 -2
  58. package/lib/cjs/datePicker/dateInput.d.ts +1 -1
  59. package/lib/cjs/datePicker/dateInput.js +1 -2
  60. package/lib/cjs/datePicker/datePicker.d.ts +1 -1
  61. package/lib/cjs/datePicker/datePicker.js +2 -4
  62. package/lib/cjs/datePicker/monthsGrid.d.ts +1 -1
  63. package/lib/cjs/divider/index.js +1 -2
  64. package/lib/cjs/dropdown/index.js +1 -2
  65. package/lib/cjs/empty/index.js +4 -8
  66. package/lib/cjs/form/baseForm.d.ts +1 -1
  67. package/lib/cjs/form/field.d.ts +1 -1
  68. package/lib/cjs/form/hoc/withField.js +1 -2
  69. package/lib/cjs/form/label.js +1 -2
  70. package/lib/cjs/grid/col.js +1 -2
  71. package/lib/cjs/grid/row.js +1 -2
  72. package/lib/cjs/iconButton/index.js +1 -3
  73. package/lib/cjs/input/index.js +5 -9
  74. package/lib/cjs/inputNumber/index.js +0 -4
  75. package/lib/cjs/list/index.js +3 -6
  76. package/lib/cjs/modal/ConfirmModal.js +1 -2
  77. package/lib/cjs/modal/Modal.js +2 -6
  78. package/lib/cjs/modal/ModalContent.js +6 -13
  79. package/lib/cjs/notification/notice.js +3 -6
  80. package/lib/cjs/pagination/index.js +2 -4
  81. package/lib/cjs/popconfirm/index.js +3 -6
  82. package/lib/cjs/popover/index.d.ts +1 -0
  83. package/lib/cjs/radio/radio.d.ts +1 -1
  84. package/lib/cjs/radio/radio.js +2 -4
  85. package/lib/cjs/radio/radioGroup.d.ts +1 -1
  86. package/lib/cjs/rating/item.js +1 -2
  87. package/lib/cjs/scrollList/index.js +3 -6
  88. package/lib/cjs/select/index.js +4 -8
  89. package/lib/cjs/select/option.js +1 -2
  90. package/lib/cjs/sideSheet/SideSheetContent.js +3 -6
  91. package/lib/cjs/skeleton/index.js +1 -3
  92. package/lib/cjs/space/index.js +1 -2
  93. package/lib/cjs/spin/index.js +3 -7
  94. package/lib/cjs/switch/index.js +4 -6
  95. package/lib/cjs/table/Table.js +3 -6
  96. package/lib/cjs/tabs/TabBar.js +1 -2
  97. package/lib/cjs/tabs/TabPane.js +2 -5
  98. package/lib/cjs/tagInput/index.d.ts +6 -1
  99. package/lib/cjs/tagInput/index.js +50 -17
  100. package/lib/cjs/timePicker/Combobox.js +1 -3
  101. package/lib/cjs/timePicker/TimePicker.d.ts +2 -2
  102. package/lib/cjs/timePicker/TimeShape.d.ts +1 -1
  103. package/lib/cjs/timePicker/index.d.ts +2 -2
  104. package/lib/cjs/toast/toast.js +3 -6
  105. package/lib/cjs/transfer/index.js +1 -2
  106. package/lib/cjs/tree/treeNode.js +1 -2
  107. package/lib/cjs/treeSelect/index.js +3 -6
  108. package/lib/cjs/typography/base.js +1 -2
  109. package/lib/cjs/typography/title.d.ts +1 -1
  110. package/lib/cjs/upload/index.d.ts +2 -2
  111. package/lib/cjs/upload/index.js +6 -13
  112. package/lib/es/_base/base.css +22 -0
  113. package/lib/es/autoComplete/index.js +1 -1
  114. package/lib/es/avatar/index.js +2 -4
  115. package/lib/es/backtop/index.js +1 -2
  116. package/lib/es/badge/index.js +1 -2
  117. package/lib/es/banner/index.js +4 -9
  118. package/lib/es/breadcrumb/index.js +3 -4
  119. package/lib/es/button/Button.js +3 -11
  120. package/lib/es/card/index.js +5 -10
  121. package/lib/es/carousel/CarouselArrow.js +2 -6
  122. package/lib/es/carousel/CarouselIndicator.d.ts +1 -1
  123. package/lib/es/carousel/index.d.ts +1 -1
  124. package/lib/es/carousel/index.js +1 -2
  125. package/lib/es/cascader/index.js +10 -11
  126. package/lib/es/cascader/item.js +1 -2
  127. package/lib/es/checkbox/checkbox.d.ts +3 -2
  128. package/lib/es/checkbox/checkbox.js +33 -15
  129. package/lib/es/checkbox/checkboxInner.d.ts +6 -0
  130. package/lib/es/checkbox/checkboxInner.js +14 -4
  131. package/lib/es/collapsible/index.js +1 -2
  132. package/lib/es/datePicker/dateInput.d.ts +1 -1
  133. package/lib/es/datePicker/dateInput.js +1 -2
  134. package/lib/es/datePicker/datePicker.d.ts +1 -1
  135. package/lib/es/datePicker/datePicker.js +2 -4
  136. package/lib/es/datePicker/monthsGrid.d.ts +1 -1
  137. package/lib/es/divider/index.js +1 -2
  138. package/lib/es/dropdown/index.js +1 -2
  139. package/lib/es/empty/index.js +4 -8
  140. package/lib/es/form/baseForm.d.ts +1 -1
  141. package/lib/es/form/field.d.ts +1 -1
  142. package/lib/es/form/hoc/withField.js +1 -2
  143. package/lib/es/form/label.js +1 -2
  144. package/lib/es/grid/col.js +1 -2
  145. package/lib/es/grid/row.js +1 -2
  146. package/lib/es/iconButton/index.js +1 -3
  147. package/lib/es/input/index.js +5 -9
  148. package/lib/es/inputNumber/index.js +0 -4
  149. package/lib/es/list/index.js +3 -6
  150. package/lib/es/modal/ConfirmModal.js +1 -2
  151. package/lib/es/modal/Modal.js +2 -6
  152. package/lib/es/modal/ModalContent.js +6 -13
  153. package/lib/es/notification/notice.js +3 -6
  154. package/lib/es/pagination/index.js +2 -4
  155. package/lib/es/popconfirm/index.js +3 -6
  156. package/lib/es/popover/index.d.ts +1 -0
  157. package/lib/es/radio/radio.d.ts +1 -1
  158. package/lib/es/radio/radio.js +2 -4
  159. package/lib/es/radio/radioGroup.d.ts +1 -1
  160. package/lib/es/rating/item.js +1 -2
  161. package/lib/es/scrollList/index.js +3 -6
  162. package/lib/es/select/index.js +4 -8
  163. package/lib/es/select/option.js +1 -2
  164. package/lib/es/sideSheet/SideSheetContent.js +3 -6
  165. package/lib/es/skeleton/index.js +1 -3
  166. package/lib/es/space/index.js +1 -2
  167. package/lib/es/spin/index.js +3 -7
  168. package/lib/es/switch/index.js +4 -6
  169. package/lib/es/table/Table.js +3 -6
  170. package/lib/es/tabs/TabBar.js +1 -2
  171. package/lib/es/tabs/TabPane.js +2 -5
  172. package/lib/es/tagInput/index.d.ts +6 -1
  173. package/lib/es/tagInput/index.js +47 -17
  174. package/lib/es/timePicker/Combobox.js +1 -3
  175. package/lib/es/timePicker/TimePicker.d.ts +2 -2
  176. package/lib/es/timePicker/TimeShape.d.ts +1 -1
  177. package/lib/es/timePicker/index.d.ts +2 -2
  178. package/lib/es/toast/toast.js +3 -6
  179. package/lib/es/transfer/index.js +1 -2
  180. package/lib/es/tree/treeNode.js +1 -2
  181. package/lib/es/treeSelect/index.js +3 -6
  182. package/lib/es/typography/base.js +1 -2
  183. package/lib/es/typography/title.d.ts +1 -1
  184. package/lib/es/upload/index.d.ts +2 -2
  185. package/lib/es/upload/index.js +6 -13
  186. package/list/index.tsx +4 -16
  187. package/modal/ConfirmModal.tsx +1 -1
  188. package/modal/Modal.tsx +0 -2
  189. package/modal/ModalContent.tsx +14 -27
  190. package/notification/notice.tsx +4 -16
  191. package/package.json +9 -9
  192. package/pagination/index.tsx +2 -16
  193. package/popconfirm/index.tsx +3 -11
  194. package/popover/index.tsx +1 -1
  195. package/radio/radio.tsx +2 -10
  196. package/rating/item.tsx +1 -1
  197. package/scrollList/index.tsx +3 -19
  198. package/select/_story/select.stories.js +11 -0
  199. package/select/index.tsx +4 -12
  200. package/select/option.tsx +1 -5
  201. package/sideSheet/SideSheetContent.tsx +3 -3
  202. package/skeleton/index.tsx +1 -1
  203. package/space/index.tsx +1 -1
  204. package/spin/index.tsx +9 -15
  205. package/switch/index.tsx +14 -9
  206. package/table/Table.tsx +3 -5
  207. package/table/_story/v2/FixedOnHeaderRow/index.jsx +3 -0
  208. package/tabs/TabBar.tsx +1 -1
  209. package/tabs/TabPane.tsx +4 -9
  210. package/tabs/_story/tabs.stories.js +36 -0
  211. package/tag/_story/tag.stories.js +1 -1
  212. package/tagInput/index.tsx +47 -22
  213. package/timePicker/Combobox.tsx +1 -6
  214. package/toast/toast.tsx +3 -3
  215. package/transfer/index.tsx +0 -1
  216. package/tree/treeNode.tsx +1 -1
  217. package/treeSelect/index.tsx +3 -15
  218. package/typography/base.tsx +1 -1
  219. package/upload/_story/upload.stories.js +152 -0
  220. package/upload/index.tsx +38 -107
  221. package/yarn-error.log +0 -26235
package/upload/index.tsx CHANGED
@@ -3,54 +3,25 @@ import React, { ReactNode, CSSProperties, RefObject, ChangeEvent, DragEvent } fr
3
3
  import cls from 'classnames';
4
4
  import PropTypes from 'prop-types';
5
5
  import { noop, pick } from 'lodash';
6
- import UploadFoundation, {
7
- CustomFile,
8
- UploadAdapter,
9
- BeforeUploadObjectResult,
10
- AfterUploadResult,
11
- } from '@douyinfe/semi-foundation/upload/foundation';
6
+ import UploadFoundation, { CustomFile, UploadAdapter, BeforeUploadObjectResult, AfterUploadResult } from '@douyinfe/semi-foundation/upload/foundation';
12
7
  import { strings, cssClasses } from '@douyinfe/semi-foundation/upload/constants';
13
8
  import FileCard from './fileCard';
14
9
  import BaseComponent, { ValidateStatus } from '../_base/baseComponent';
15
10
  import LocaleConsumer from '../locale/localeConsumer';
16
11
  import { IconUpload } from '@douyinfe/semi-icons';
17
- import {
18
- FileItem,
19
- RenderFileItemProps,
20
- UploadListType,
21
- PromptPositionType,
22
- BeforeUploadProps,
23
- AfterUploadProps,
24
- OnChangeProps,
25
- customRequestArgs,
26
- CustomError,
27
- } from './interface';
12
+ import { FileItem, RenderFileItemProps, UploadListType, PromptPositionType, BeforeUploadProps, AfterUploadProps, OnChangeProps, customRequestArgs, CustomError } from './interface';
28
13
  import { Locale } from '../locale/interface';
29
14
  import '@douyinfe/semi-foundation/upload/upload.scss';
30
15
 
31
16
  const prefixCls = cssClasses.PREFIX;
32
17
 
33
- export {
34
- FileItem,
35
- RenderFileItemProps,
36
- UploadListType,
37
- PromptPositionType,
38
- BeforeUploadProps,
39
- AfterUploadProps,
40
- OnChangeProps,
41
- customRequestArgs,
42
- CustomError,
43
- BeforeUploadObjectResult,
44
- AfterUploadResult,
45
- };
18
+ export { FileItem, RenderFileItemProps, UploadListType, PromptPositionType, BeforeUploadProps, AfterUploadProps, OnChangeProps, customRequestArgs, CustomError, BeforeUploadObjectResult, AfterUploadResult };
46
19
 
47
20
  export interface UploadProps {
48
21
  accept?: string;
49
22
  action: string;
50
23
  afterUpload?: (object: AfterUploadProps) => AfterUploadResult;
51
- beforeUpload?: (
52
- object: BeforeUploadProps
53
- ) => BeforeUploadObjectResult | Promise<BeforeUploadObjectResult> | boolean;
24
+ beforeUpload?: (object: BeforeUploadProps) => BeforeUploadObjectResult | Promise<BeforeUploadObjectResult> | boolean;
54
25
  beforeClear?: (fileList: Array<FileItem>) => boolean | Promise<boolean>;
55
26
  beforeRemove?: (file: FileItem, fileList: Array<FileItem>) => boolean | Promise<boolean>;
56
27
  capture?: boolean | 'user' | 'environment' | undefined;
@@ -143,7 +114,7 @@ class Upload extends BaseComponent<UploadProps, UploadState> {
143
114
  fileList: PropTypes.array, // files had been uploaded
144
115
  fileName: PropTypes.string, // same as name, to avoid props conflict in Form.Upload
145
116
  headers: PropTypes.oneOfType([PropTypes.object, PropTypes.func]),
146
- hotSpotLocation: PropTypes.oneOf(['start', 'end']),
117
+ hotSpotLocation: PropTypes.oneOf(['start','end']),
147
118
  itemStyle: PropTypes.object,
148
119
  limit: PropTypes.number, // 最大允许上传文件个数
149
120
  listType: PropTypes.oneOf<UploadProps['listType']>(strings.LIST_TYPE),
@@ -247,7 +218,7 @@ class Upload extends BaseComponent<UploadProps, UploadState> {
247
218
  const { fileList } = props;
248
219
  if ('fileList' in props) {
249
220
  return {
250
- fileList: fileList || [],
221
+ fileList: fileList || []
251
222
  };
252
223
  }
253
224
  return null;
@@ -257,8 +228,7 @@ class Upload extends BaseComponent<UploadProps, UploadState> {
257
228
  return {
258
229
  ...super.adapter,
259
230
  notifyFileSelect: (files): void => this.props.onFileChange(files),
260
- notifyError: (error, fileInstance, fileList, xhr): void =>
261
- this.props.onError(error, fileInstance, fileList, xhr),
231
+ notifyError: (error, fileInstance, fileList, xhr): void => this.props.onError(error, fileInstance, fileList, xhr),
262
232
  notifySuccess: (responseBody, file, fileList): void => this.props.onSuccess(responseBody, file, fileList),
263
233
  notifyProgress: (percent, file, fileList): void => this.props.onProgress(percent, file, fileList),
264
234
  notifyRemove: (file, fileList, fileItem): void => this.props.onRemove(file, fileList, fileItem),
@@ -271,25 +241,19 @@ class Upload extends BaseComponent<UploadProps, UploadState> {
271
241
  this.setState({ fileList });
272
242
  }
273
243
  },
274
- notifyBeforeUpload: ({
275
- file,
276
- fileList,
277
- }): boolean | BeforeUploadObjectResult | Promise<BeforeUploadObjectResult> =>
278
- this.props.beforeUpload({ file, fileList }),
279
- notifyAfterUpload: ({ response, file, fileList }): AfterUploadResult =>
280
- this.props.afterUpload({ response, file, fileList }),
244
+ notifyBeforeUpload: ({ file, fileList }): boolean | BeforeUploadObjectResult | Promise<BeforeUploadObjectResult> => this.props.beforeUpload({ file, fileList }),
245
+ notifyAfterUpload: ({ response, file, fileList }): AfterUploadResult => this.props.afterUpload({ response, file, fileList }),
281
246
  resetInput: (): void => {
282
247
  this.setState(prevState => ({
283
- inputKey: Math.random(),
248
+ inputKey: Math.random()
284
249
  }));
285
250
  },
286
251
  resetReplaceInput: (): void => {
287
252
  this.setState(prevState => ({
288
- replaceInputKey: Math.random(),
253
+ replaceInputKey: Math.random()
289
254
  }));
290
255
  },
291
- updateDragAreaStatus: (dragAreaStatus: string): void =>
292
- this.setState({ dragAreaStatus } as { dragAreaStatus: 'default' | 'legal' | 'illegal' }),
256
+ updateDragAreaStatus: (dragAreaStatus: string): void => this.setState({ dragAreaStatus } as { dragAreaStatus: 'default' | 'legal' | 'illegal' }),
293
257
  notifyChange: ({ currentFile, fileList }): void => this.props.onChange({ currentFile, fileList }),
294
258
  updateLocalUrls: (urls): void => this.setState({ localUrls: urls }),
295
259
  notifyClear: (): void => this.props.onClear(),
@@ -331,6 +295,7 @@ class Upload extends BaseComponent<UploadProps, UploadState> {
331
295
  this.setState({ replaceIdx: index }, () => {
332
296
  this.replaceInputRef.current.click();
333
297
  });
298
+
334
299
  };
335
300
 
336
301
  onReplaceChange = (e: ChangeEvent<HTMLInputElement>): void => {
@@ -351,11 +316,11 @@ class Upload extends BaseComponent<UploadProps, UploadState> {
351
316
  * insert files at index
352
317
  * @param files Array<CustomFile>
353
318
  * @param index number
354
- * @returns
319
+ * @returns
355
320
  */
356
321
  insert = (files: Array<CustomFile>, index: number): void => {
357
322
  return this.foundation.insertFileToList(files, index);
358
- };
323
+ }
359
324
 
360
325
  /**
361
326
  * ref method
@@ -368,19 +333,7 @@ class Upload extends BaseComponent<UploadProps, UploadState> {
368
333
 
369
334
  renderFile = (file: FileItem, index: number, locale: Locale['Upload']): ReactNode => {
370
335
  const { name, status, validateMessage, _sizeInvalid, uid } = file;
371
- const {
372
- previewFile,
373
- listType,
374
- itemStyle,
375
- showPicInfo,
376
- renderPicInfo,
377
- renderPicPreviewIcon,
378
- renderFileOperation,
379
- renderFileItem,
380
- renderThumbnail,
381
- disabled,
382
- onPreviewClick,
383
- } = this.props;
336
+ const { previewFile, listType, itemStyle, showPicInfo, renderPicInfo, renderPicPreviewIcon, renderFileOperation, renderFileItem, renderThumbnail, disabled, onPreviewClick } = this.props;
384
337
  const onRemove = (): void => this.remove(file);
385
338
  const onRetry = (): void => {
386
339
  this.foundation.retry(file);
@@ -405,10 +358,7 @@ class Upload extends BaseComponent<UploadProps, UploadState> {
405
358
  renderFileOperation,
406
359
  renderThumbnail,
407
360
  onReplace,
408
- onPreviewClick:
409
- typeof onPreviewClick !== 'undefined'
410
- ? (): void => this.foundation.handlePreviewClick(file)
411
- : undefined,
361
+ onPreviewClick: typeof onPreviewClick !== 'undefined' ? (): void => this.foundation.handlePreviewClick(file) : undefined,
412
362
  };
413
363
 
414
364
  if (status === strings.FILE_STATUS_UPLOAD_FAIL && !validateMessage) {
@@ -454,7 +404,7 @@ class Upload extends BaseComponent<UploadProps, UploadState> {
454
404
  });
455
405
  const dragAreaCls = cls({
456
406
  [`${dragAreaBaseCls}-legal`]: dragAreaStatus === strings.DRAG_AREA_LEGAL,
457
- [`${dragAreaBaseCls}-illegal`]: dragAreaStatus === strings.DRAG_AREA_ILLEGAL,
407
+ [`${dragAreaBaseCls}-illegal`]: dragAreaStatus === strings.DRAG_AREA_ILLEGAL
458
408
  });
459
409
  const mainCls = `${prefixCls}-file-list-main`;
460
410
  const addContentProps = {
@@ -463,7 +413,7 @@ class Upload extends BaseComponent<UploadProps, UploadState> {
463
413
  onClick: this.onClick,
464
414
  };
465
415
  const containerProps = {
466
- className: fileListCls,
416
+ className: fileListCls
467
417
  };
468
418
  const draggableProps = {
469
419
  onDrop: this.onDrop,
@@ -475,7 +425,7 @@ class Upload extends BaseComponent<UploadProps, UploadState> {
475
425
  Object.assign(addContentProps, draggableProps, { className: cls(uploadAddCls, dragAreaCls) });
476
426
  }
477
427
  const addContent = (
478
- <div {...addContentProps} x-semi-prop="children">
428
+ <div {...addContentProps}>
479
429
  {children}
480
430
  </div>
481
431
  );
@@ -500,7 +450,7 @@ class Upload extends BaseComponent<UploadProps, UploadState> {
500
450
  )}
501
451
  </LocaleConsumer>
502
452
  );
503
- };
453
+ }
504
454
 
505
455
  renderFileListDefault = () => {
506
456
  const { showUploadList, limit, disabled } = this.props;
@@ -512,7 +462,7 @@ class Upload extends BaseComponent<UploadProps, UploadState> {
512
462
  const showTitle = limit !== 1 && fileList.length;
513
463
  const showClear = this.props.showClear && !disabled;
514
464
  const containerProps = {
515
- className: fileListCls,
465
+ className: fileListCls
516
466
  };
517
467
 
518
468
  if (!showUploadList || !fileList.length) {
@@ -527,12 +477,7 @@ class Upload extends BaseComponent<UploadProps, UploadState> {
527
477
  <div className={titleCls}>
528
478
  <span className={`${titleCls}-choosen`}>{locale.selectedFiles}</span>
529
479
  {showClear ? (
530
- <span
531
- role="button"
532
- tabIndex={0}
533
- onClick={this.clear}
534
- className={`${titleCls}-clear`}
535
- >
480
+ <span role="button" tabIndex={0} onClick={this.clear} className={`${titleCls}-clear`}>
536
481
  {locale.clear}
537
482
  </span>
538
483
  ) : null}
@@ -546,7 +491,7 @@ class Upload extends BaseComponent<UploadProps, UploadState> {
546
491
  )}
547
492
  </LocaleConsumer>
548
493
  );
549
- };
494
+ }
550
495
 
551
496
  onDrop = (e: DragEvent<HTMLDivElement>): void => {
552
497
  this.foundation.handleDrop(e);
@@ -579,7 +524,7 @@ class Upload extends BaseComponent<UploadProps, UploadState> {
579
524
  {children}
580
525
  </div>
581
526
  );
582
- };
527
+ }
583
528
 
584
529
  renderDragArea = (): ReactNode => {
585
530
  const { dragAreaStatus } = this.state;
@@ -609,16 +554,14 @@ class Upload extends BaseComponent<UploadProps, UploadState> {
609
554
  children
610
555
  ) : (
611
556
  <>
612
- <div className={`${dragAreaBaseCls}-icon`} x-semi-prop="dragIcon">
557
+ <div className={`${dragAreaBaseCls}-icon`}>
613
558
  {dragIcon || <IconUpload size="extra-large" />}
614
559
  </div>
615
560
  <div className={`${dragAreaBaseCls}-text`}>
616
- <div className={`${dragAreaBaseCls}-main-text`} x-semi-prop="dragMainText">
561
+ <div className={`${dragAreaBaseCls}-main-text`}>
617
562
  {dragMainText || locale.mainText}
618
563
  </div>
619
- <div className={`${dragAreaBaseCls}-sub-text`} x-semi-prop="dragSubText">
620
- {dragSubText}
621
- </div>
564
+ <div className={`${dragAreaBaseCls}-sub-text`}>{dragSubText}</div>
622
565
  <div className={`${dragAreaBaseCls}-tips`}>
623
566
  {dragAreaStatus === strings.DRAG_AREA_LEGAL && (
624
567
  <span className={`${dragAreaBaseCls}-tips-legal`}>{locale.legalTips}</span>
@@ -655,18 +598,14 @@ class Upload extends BaseComponent<UploadProps, UploadState> {
655
598
  validateStatus,
656
599
  directory,
657
600
  } = this.props;
658
- const uploadCls = cls(
659
- prefixCls,
660
- {
661
- [`${prefixCls}-picture`]: listType === strings.FILE_LIST_PIC,
662
- [`${prefixCls}-disabled`]: disabled,
663
- [`${prefixCls}-default`]: validateStatus === 'default',
664
- [`${prefixCls}-error`]: validateStatus === 'error',
665
- [`${prefixCls}-warning`]: validateStatus === 'warning',
666
- [`${prefixCls}-success`]: validateStatus === 'success',
667
- },
668
- className
669
- );
601
+ const uploadCls = cls(prefixCls, {
602
+ [`${prefixCls}-picture`]: listType === strings.FILE_LIST_PIC,
603
+ [`${prefixCls}-disabled`]: disabled,
604
+ [`${prefixCls}-default`]: validateStatus === 'default',
605
+ [`${prefixCls}-error`]: validateStatus === 'error',
606
+ [`${prefixCls}-warning`]: validateStatus === 'warning',
607
+ [`${prefixCls}-success`]: validateStatus === 'success',
608
+ }, className);
670
609
  const inputCls = cls(`${prefixCls}-hidden-input`);
671
610
  const inputReplaceCls = cls(`${prefixCls}-hidden-input-replace`);
672
611
  const promptCls = cls(`${prefixCls}-prompt`);
@@ -701,17 +640,9 @@ class Upload extends BaseComponent<UploadProps, UploadState> {
701
640
  ref={this.replaceInputRef}
702
641
  />
703
642
  {this.renderAddContent()}
704
- {prompt ? (
705
- <div className={promptCls} x-semi-prop="prompt">
706
- {prompt}
707
- </div>
708
- ) : null}
643
+ {prompt ? <div className={promptCls}>{prompt}</div> : null}
709
644
 
710
- {validateMessage ? (
711
- <div className={validateMsgCls} x-semi-prop="validateMessage">
712
- {validateMessage}
713
- </div>
714
- ) : null}
645
+ {validateMessage ? <div className={validateMsgCls}>{validateMessage}</div> : null}
715
646
  {this.renderFileList()}
716
647
  </div>
717
648
  );