@tecsinapse/cortex-react 1.15.0-beta.21 → 1.15.0-beta.22
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.
|
@@ -27,6 +27,8 @@ const useFileUpload = ({
|
|
|
27
27
|
onDuplicate,
|
|
28
28
|
hasManager = true,
|
|
29
29
|
isFolder = false,
|
|
30
|
+
noClick = false,
|
|
31
|
+
ignoreRejections = false,
|
|
30
32
|
uploadProgressText
|
|
31
33
|
}) => {
|
|
32
34
|
const {
|
|
@@ -64,7 +66,7 @@ const useFileUpload = ({
|
|
|
64
66
|
[]
|
|
65
67
|
);
|
|
66
68
|
const onDrop = async (acceptedFiles, fileRejections) => {
|
|
67
|
-
if (fileRejections.length > 0) return;
|
|
69
|
+
if (fileRejections.length > 0 && !ignoreRejections) return;
|
|
68
70
|
if (hasManager) {
|
|
69
71
|
openManager();
|
|
70
72
|
onClose();
|
|
@@ -121,7 +123,8 @@ const useFileUpload = ({
|
|
|
121
123
|
accept: mappedAccept,
|
|
122
124
|
multiple: allowMultiple,
|
|
123
125
|
maxSize,
|
|
124
|
-
onDropRejected: onFileRejected
|
|
126
|
+
onDropRejected: onFileRejected,
|
|
127
|
+
noClick
|
|
125
128
|
});
|
|
126
129
|
const isFileLimitReached = !allowMultiple && files.length > 0;
|
|
127
130
|
return {
|
|
@@ -25,6 +25,8 @@ const useFileUpload = ({
|
|
|
25
25
|
onDuplicate,
|
|
26
26
|
hasManager = true,
|
|
27
27
|
isFolder = false,
|
|
28
|
+
noClick = false,
|
|
29
|
+
ignoreRejections = false,
|
|
28
30
|
uploadProgressText
|
|
29
31
|
}) => {
|
|
30
32
|
const {
|
|
@@ -62,7 +64,7 @@ const useFileUpload = ({
|
|
|
62
64
|
[]
|
|
63
65
|
);
|
|
64
66
|
const onDrop = async (acceptedFiles, fileRejections) => {
|
|
65
|
-
if (fileRejections.length > 0) return;
|
|
67
|
+
if (fileRejections.length > 0 && !ignoreRejections) return;
|
|
66
68
|
if (hasManager) {
|
|
67
69
|
openManager();
|
|
68
70
|
onClose();
|
|
@@ -119,7 +121,8 @@ const useFileUpload = ({
|
|
|
119
121
|
accept: mappedAccept,
|
|
120
122
|
multiple: allowMultiple,
|
|
121
123
|
maxSize,
|
|
122
|
-
onDropRejected: onFileRejected
|
|
124
|
+
onDropRejected: onFileRejected,
|
|
125
|
+
noClick
|
|
123
126
|
});
|
|
124
127
|
const isFileLimitReached = !allowMultiple && files.length > 0;
|
|
125
128
|
return {
|
|
@@ -18,8 +18,10 @@ interface UseFileUploadOptions {
|
|
|
18
18
|
hasManager?: boolean;
|
|
19
19
|
isFolder?: boolean;
|
|
20
20
|
uploadProgressText?: string;
|
|
21
|
+
noClick?: boolean;
|
|
22
|
+
ignoreRejections?: boolean;
|
|
21
23
|
}
|
|
22
|
-
export declare const useFileUpload: <T>({ accept, onAccept, onOpenManager, onFileRejected, maxSize, allowMultiple, preventDuplicates, onDuplicate, hasManager, isFolder, uploadProgressText, }: UseFileUploadOptions) => {
|
|
24
|
+
export declare const useFileUpload: <T>({ accept, onAccept, onOpenManager, onFileRejected, maxSize, allowMultiple, preventDuplicates, onDuplicate, hasManager, isFolder, noClick, ignoreRejections, uploadProgressText, }: UseFileUploadOptions) => {
|
|
23
25
|
onOpen: () => void;
|
|
24
26
|
onClose: () => void;
|
|
25
27
|
onDelete: (index: number) => void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tecsinapse/cortex-react",
|
|
3
|
-
"version": "1.15.0-beta.
|
|
3
|
+
"version": "1.15.0-beta.22",
|
|
4
4
|
"description": "React components based in @tecsinapse/cortex-core",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/esm/index.js",
|
|
@@ -48,5 +48,5 @@
|
|
|
48
48
|
"react-icons": ">=5.2.0",
|
|
49
49
|
"tailwind": ">=3.3.0"
|
|
50
50
|
},
|
|
51
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "58b0314be0bad4ed1f27d33d00c97390665a3cf8"
|
|
52
52
|
}
|