react-file-upload-ui 0.1.0 → 0.1.2
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.
- package/dist/index.d.mts +42 -4
- package/dist/index.d.ts +42 -4
- package/dist/index.js +833 -10
- package/dist/index.mjs +833 -6
- package/package.json +53 -53
package/dist/index.d.mts
CHANGED
|
@@ -1,9 +1,47 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
|
|
3
|
-
interface
|
|
3
|
+
interface IFileData {
|
|
4
|
+
id: string;
|
|
5
|
+
isDefault: boolean;
|
|
6
|
+
file: File | undefined;
|
|
7
|
+
url?: string;
|
|
8
|
+
name: string;
|
|
9
|
+
}
|
|
10
|
+
interface IReactFileUploaderUIProps {
|
|
4
11
|
accept?: string;
|
|
5
12
|
multiple?: boolean;
|
|
13
|
+
maxSize?: number;
|
|
14
|
+
maxFiles?: number;
|
|
15
|
+
onFilesSelected?: (data: IFileData[]) => void;
|
|
16
|
+
onError?: (error: string) => void;
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
className?: string;
|
|
19
|
+
/**
|
|
20
|
+
* Default files (external URLs) to pre-populate the uploader with.
|
|
21
|
+
* Example: [{ url: 'https://...', name: 'image.jpg' }]
|
|
22
|
+
*/
|
|
23
|
+
defaultFiles?: DefaultFile[];
|
|
24
|
+
}
|
|
25
|
+
interface DefaultFile {
|
|
26
|
+
id?: string;
|
|
27
|
+
name?: string;
|
|
28
|
+
url: string;
|
|
29
|
+
type?: string;
|
|
30
|
+
isDefault?: boolean;
|
|
6
31
|
}
|
|
7
|
-
|
|
32
|
+
interface IFileWithPreview {
|
|
33
|
+
id: string;
|
|
34
|
+
name: string;
|
|
35
|
+
size?: number;
|
|
36
|
+
type?: string;
|
|
37
|
+
preview?: string;
|
|
38
|
+
isDefault?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Original File if the item was uploaded via input; undefined for external URL defaults.
|
|
41
|
+
*/
|
|
42
|
+
rawFile?: File | undefined;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
declare const ReactFileUploaderUI: ({ accept, multiple, maxSize, maxFiles, onFilesSelected, onError, disabled, className, defaultFiles, }: IReactFileUploaderUIProps) => react_jsx_runtime.JSX.Element;
|
|
8
46
|
|
|
9
|
-
export {
|
|
47
|
+
export { type IFileData, type IFileWithPreview, type IReactFileUploaderUIProps, ReactFileUploaderUI as default };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,47 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
|
|
3
|
-
interface
|
|
3
|
+
interface IFileData {
|
|
4
|
+
id: string;
|
|
5
|
+
isDefault: boolean;
|
|
6
|
+
file: File | undefined;
|
|
7
|
+
url?: string;
|
|
8
|
+
name: string;
|
|
9
|
+
}
|
|
10
|
+
interface IReactFileUploaderUIProps {
|
|
4
11
|
accept?: string;
|
|
5
12
|
multiple?: boolean;
|
|
13
|
+
maxSize?: number;
|
|
14
|
+
maxFiles?: number;
|
|
15
|
+
onFilesSelected?: (data: IFileData[]) => void;
|
|
16
|
+
onError?: (error: string) => void;
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
className?: string;
|
|
19
|
+
/**
|
|
20
|
+
* Default files (external URLs) to pre-populate the uploader with.
|
|
21
|
+
* Example: [{ url: 'https://...', name: 'image.jpg' }]
|
|
22
|
+
*/
|
|
23
|
+
defaultFiles?: DefaultFile[];
|
|
24
|
+
}
|
|
25
|
+
interface DefaultFile {
|
|
26
|
+
id?: string;
|
|
27
|
+
name?: string;
|
|
28
|
+
url: string;
|
|
29
|
+
type?: string;
|
|
30
|
+
isDefault?: boolean;
|
|
6
31
|
}
|
|
7
|
-
|
|
32
|
+
interface IFileWithPreview {
|
|
33
|
+
id: string;
|
|
34
|
+
name: string;
|
|
35
|
+
size?: number;
|
|
36
|
+
type?: string;
|
|
37
|
+
preview?: string;
|
|
38
|
+
isDefault?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Original File if the item was uploaded via input; undefined for external URL defaults.
|
|
41
|
+
*/
|
|
42
|
+
rawFile?: File | undefined;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
declare const ReactFileUploaderUI: ({ accept, multiple, maxSize, maxFiles, onFilesSelected, onError, disabled, className, defaultFiles, }: IReactFileUploaderUIProps) => react_jsx_runtime.JSX.Element;
|
|
8
46
|
|
|
9
|
-
export {
|
|
47
|
+
export { type IFileData, type IFileWithPreview, type IReactFileUploaderUIProps, ReactFileUploaderUI as default };
|