demio-ui 2.5.56 → 2.5.57

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.
@@ -44,5 +44,29 @@ export interface UploadProps {
44
44
  previewImageTitle?: string;
45
45
  uploadPercent?: number;
46
46
  }
47
+ /**
48
+ The component has 3 states: **default**, **progress** and **preview** states.
49
+
50
+ - **Default** state is visible when **uploadPercent** prop is **undefined**.
51
+ - When the **uploadPercent** prop becomes a **number** and it is **less than 100** the **Upload** automatically switches to a **progress** state.
52
+ - When the **uploadPercent** prop is **equal to 100** the **Upload** automatically switches to a **preview** mode.
53
+
54
+ One more useful thing is related to a **UploadRef** interface. It consists of all the methods that need to be accessed through the **ref**. For example:
55
+
56
+ ````
57
+ const uploadRef = useRef<UploadRef>(null);
58
+
59
+ const handleReset = () => {
60
+ uploadRef.current?.cancelUpload();
61
+ };
62
+
63
+ return (
64
+ <>
65
+ <Upload ref={uploadRef} />
66
+ <button onClick={handleReset}>Reset Upload</button>
67
+ </>
68
+ );
69
+ ````
70
+ **/
47
71
  declare const Upload: FC<UploadProps>;
48
72
  export default Upload;
@@ -0,0 +1,12 @@
1
+ import { FC } from 'react';
2
+ import { UploadMenuItem } from '../UploadMenu/UploadMenu';
3
+ export interface UploadPreviewProps {
4
+ className?: string;
5
+ fileName?: string;
6
+ fileInfo?: string;
7
+ imageSrc?: string;
8
+ imageTitle?: string;
9
+ menu?: UploadMenuItem[];
10
+ }
11
+ declare const UploadPreview: FC<UploadPreviewProps>;
12
+ export default UploadPreview;
@@ -0,0 +1 @@
1
+ export { default } from './UploadPreview';