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