@tecsinapse/cortex-react 2.2.2-beta.2 → 2.2.2-beta.205.3
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/cjs/components/Uploader/Manager.js +2 -2
- package/dist/cjs/components/Uploader/Upload.js +2 -2
- package/dist/cjs/hooks/useFileUpload.js +3 -3
- package/dist/esm/components/Uploader/Manager.js +2 -2
- package/dist/esm/components/Uploader/Upload.js +2 -2
- package/dist/esm/hooks/useFileUpload.js +3 -3
- package/dist/types/components/Uploader/Manager.d.ts +1 -1
- package/dist/types/components/Uploader/index.d.ts +1 -1
- package/dist/types/components/Uploader/types.d.ts +1 -1
- package/dist/types/hooks/useFileUpload.d.ts +2 -2
- package/package.json +2 -2
|
@@ -15,7 +15,7 @@ const Manager = ({
|
|
|
15
15
|
files,
|
|
16
16
|
onDelete,
|
|
17
17
|
uploadProgressText = "Upload(s) in progress",
|
|
18
|
-
|
|
18
|
+
uploadResultText = "Upload(s) completed",
|
|
19
19
|
onClose
|
|
20
20
|
}) => {
|
|
21
21
|
const {
|
|
@@ -47,7 +47,7 @@ const Manager = ({
|
|
|
47
47
|
children: min ? /* @__PURE__ */ jsxRuntime.jsx(io5.IoChevronUp, {}) : /* @__PURE__ */ jsxRuntime.jsx(io5.IoChevronDown, {})
|
|
48
48
|
}
|
|
49
49
|
),
|
|
50
|
-
/* @__PURE__ */ jsxRuntime.jsx("h3", { "data-testid": "upload-progress", children: isLoading ? uploadProgressText :
|
|
50
|
+
/* @__PURE__ */ jsxRuntime.jsx("h3", { "data-testid": "upload-progress", children: isLoading ? uploadProgressText : uploadResultText }),
|
|
51
51
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
52
52
|
Button.Button,
|
|
53
53
|
{
|
|
@@ -105,8 +105,8 @@ const Folder = ({ name, subItems }) => {
|
|
|
105
105
|
);
|
|
106
106
|
const intent = React.useMemo(() => {
|
|
107
107
|
if (loading) return "info";
|
|
108
|
-
if ((subItems ?? []).some((item) => item.status === "error")
|
|
109
|
-
return "
|
|
108
|
+
if ((subItems ?? []).some((item) => item.status === "error")) {
|
|
109
|
+
return "error";
|
|
110
110
|
}
|
|
111
111
|
return "success";
|
|
112
112
|
}, [subItems]);
|
|
@@ -30,7 +30,7 @@ const useFileUpload = ({
|
|
|
30
30
|
noClick = false,
|
|
31
31
|
ignoreRejections = false,
|
|
32
32
|
uploadProgressText,
|
|
33
|
-
|
|
33
|
+
uploadResultText
|
|
34
34
|
}) => {
|
|
35
35
|
const {
|
|
36
36
|
showManager,
|
|
@@ -100,10 +100,10 @@ const useFileUpload = ({
|
|
|
100
100
|
onClose: closeManager,
|
|
101
101
|
onDelete: handleRemoveFile,
|
|
102
102
|
uploadProgressText,
|
|
103
|
-
|
|
103
|
+
uploadResultText
|
|
104
104
|
});
|
|
105
105
|
}
|
|
106
|
-
}, [handleRemoveFile, closeManager]);
|
|
106
|
+
}, [handleRemoveFile, closeManager, uploadResultText]);
|
|
107
107
|
const addMimeTypes = (key, acc) => {
|
|
108
108
|
types.AcceptSpecificMap[key].forEach((mimeType) => {
|
|
109
109
|
acc[mimeType] = [];
|
|
@@ -13,7 +13,7 @@ const Manager = ({
|
|
|
13
13
|
files,
|
|
14
14
|
onDelete,
|
|
15
15
|
uploadProgressText = "Upload(s) in progress",
|
|
16
|
-
|
|
16
|
+
uploadResultText = "Upload(s) completed",
|
|
17
17
|
onClose
|
|
18
18
|
}) => {
|
|
19
19
|
const {
|
|
@@ -45,7 +45,7 @@ const Manager = ({
|
|
|
45
45
|
children: min ? /* @__PURE__ */ jsx(IoChevronUp, {}) : /* @__PURE__ */ jsx(IoChevronDown, {})
|
|
46
46
|
}
|
|
47
47
|
),
|
|
48
|
-
/* @__PURE__ */ jsx("h3", { "data-testid": "upload-progress", children: isLoading ? uploadProgressText :
|
|
48
|
+
/* @__PURE__ */ jsx("h3", { "data-testid": "upload-progress", children: isLoading ? uploadProgressText : uploadResultText }),
|
|
49
49
|
/* @__PURE__ */ jsx(
|
|
50
50
|
Button,
|
|
51
51
|
{
|
|
@@ -103,8 +103,8 @@ const Folder = ({ name, subItems }) => {
|
|
|
103
103
|
);
|
|
104
104
|
const intent = useMemo(() => {
|
|
105
105
|
if (loading) return "info";
|
|
106
|
-
if ((subItems ?? []).some((item) => item.status === "error")
|
|
107
|
-
return "
|
|
106
|
+
if ((subItems ?? []).some((item) => item.status === "error")) {
|
|
107
|
+
return "error";
|
|
108
108
|
}
|
|
109
109
|
return "success";
|
|
110
110
|
}, [subItems]);
|
|
@@ -28,7 +28,7 @@ const useFileUpload = ({
|
|
|
28
28
|
noClick = false,
|
|
29
29
|
ignoreRejections = false,
|
|
30
30
|
uploadProgressText,
|
|
31
|
-
|
|
31
|
+
uploadResultText
|
|
32
32
|
}) => {
|
|
33
33
|
const {
|
|
34
34
|
showManager,
|
|
@@ -98,10 +98,10 @@ const useFileUpload = ({
|
|
|
98
98
|
onClose: closeManager,
|
|
99
99
|
onDelete: handleRemoveFile,
|
|
100
100
|
uploadProgressText,
|
|
101
|
-
|
|
101
|
+
uploadResultText
|
|
102
102
|
});
|
|
103
103
|
}
|
|
104
|
-
}, [handleRemoveFile, closeManager]);
|
|
104
|
+
}, [handleRemoveFile, closeManager, uploadResultText]);
|
|
105
105
|
const addMimeTypes = (key, acc) => {
|
|
106
106
|
AcceptSpecificMap[key].forEach((mimeType) => {
|
|
107
107
|
acc[mimeType] = [];
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { ManagerProps } from './types';
|
|
2
|
-
export declare const Manager: <T>({ open, files, onDelete, uploadProgressText,
|
|
2
|
+
export declare const Manager: <T>({ open, files, onDelete, uploadProgressText, uploadResultText, onClose, }: ManagerProps<T>) => any;
|
|
@@ -5,5 +5,5 @@ export declare const Uploader: {
|
|
|
5
5
|
Files: <T>({ files, onDelete, uploadProgressText, }: import("./types").FilesProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
Modal: ({ open, onClose, children, title, }: import("./types").ModalProps) => any;
|
|
7
7
|
Root: <T>({ open, onClose, dropzoneProps, selectFileText, dropText, buttonText, titleModal, onDelete, uploadProgressText, files, }: import("./types").RootUploaderProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
-
Manager: <T>({ open, files, onDelete, uploadProgressText,
|
|
8
|
+
Manager: <T>({ open, files, onDelete, uploadProgressText, uploadResultText, onClose, }: import("./types").ManagerProps<T>) => any;
|
|
9
9
|
};
|
|
@@ -87,7 +87,7 @@ export interface ManagerProps<T> {
|
|
|
87
87
|
files?: FileUpload<T>[];
|
|
88
88
|
onDelete?: (index: number) => void;
|
|
89
89
|
uploadProgressText?: string;
|
|
90
|
-
|
|
90
|
+
uploadResultText?: string;
|
|
91
91
|
onClose?: () => void;
|
|
92
92
|
}
|
|
93
93
|
export declare const AcceptSpecificMap: {
|
|
@@ -18,11 +18,11 @@ interface UseFileUploadOptions<T> {
|
|
|
18
18
|
hasManager?: boolean;
|
|
19
19
|
isFolder?: boolean;
|
|
20
20
|
uploadProgressText?: string;
|
|
21
|
-
|
|
21
|
+
uploadResultText?: string;
|
|
22
22
|
noClick?: boolean;
|
|
23
23
|
ignoreRejections?: boolean;
|
|
24
24
|
}
|
|
25
|
-
export declare const useFileUpload: <T>({ accept, onAccept, onOpenManager, onFileRejected, maxSize, allowMultiple, preventDuplicates, onDuplicate, hasManager, isFolder, noClick, ignoreRejections, uploadProgressText,
|
|
25
|
+
export declare const useFileUpload: <T>({ accept, onAccept, onOpenManager, onFileRejected, maxSize, allowMultiple, preventDuplicates, onDuplicate, hasManager, isFolder, noClick, ignoreRejections, uploadProgressText, uploadResultText, }: UseFileUploadOptions<T>) => {
|
|
26
26
|
onOpen: () => void;
|
|
27
27
|
onClose: () => void;
|
|
28
28
|
onDelete: (index: number) => void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tecsinapse/cortex-react",
|
|
3
|
-
"version": "2.2.2-beta.
|
|
3
|
+
"version": "2.2.2-beta.205.3+3e233d42",
|
|
4
4
|
"description": "React components based in @tecsinapse/cortex-core",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/esm/index.js",
|
|
@@ -50,5 +50,5 @@
|
|
|
50
50
|
"react-icons": ">=5.2.0",
|
|
51
51
|
"tailwindcss": "^4.1.16"
|
|
52
52
|
},
|
|
53
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "3e233d42338d5a0492666e094001fa533f1ece2b"
|
|
54
54
|
}
|