componentes-sinco 1.0.22 → 1.0.24
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.cjs +14 -13
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +14 -13
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -483,21 +483,22 @@ var Attachment = ({
|
|
|
483
483
|
const [isDragFile, setIsDragFile] = (0, import_react5.useState)(false);
|
|
484
484
|
const inputRef = (0, import_react5.useRef)(null);
|
|
485
485
|
(0, import_react5.useEffect)(() => {
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
const nuevosArchivos = prevFiles.map((file) => {
|
|
490
|
-
if (!file.uploadError && file.progress < 100) {
|
|
491
|
-
updated = true;
|
|
492
|
-
return __spreadProps(__spreadValues({}, file), { progress: Math.min(file.progress + 15, 100) });
|
|
493
|
-
}
|
|
486
|
+
if (initialFiles && initialFiles.length > 0) {
|
|
487
|
+
const mapped = initialFiles.map((file) => {
|
|
488
|
+
if ("progress" in file) {
|
|
494
489
|
return file;
|
|
495
|
-
}
|
|
496
|
-
return
|
|
490
|
+
}
|
|
491
|
+
return {
|
|
492
|
+
name: file.name,
|
|
493
|
+
size: file.size,
|
|
494
|
+
type: file.type,
|
|
495
|
+
progress: 100,
|
|
496
|
+
uploadError: false
|
|
497
|
+
};
|
|
497
498
|
});
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
}, [
|
|
499
|
+
setFiles(mapped);
|
|
500
|
+
}
|
|
501
|
+
}, [initialFiles]);
|
|
501
502
|
const handleDrop = (event2) => {
|
|
502
503
|
event2.preventDefault();
|
|
503
504
|
setIsDragFile(false);
|