componentes-sinco 1.0.18 → 1.0.19
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 +8 -16
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +10 -32
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -463,24 +463,16 @@ var Attachment = ({
|
|
|
463
463
|
const inputRef = (0, import_react5.useRef)(null);
|
|
464
464
|
(0, import_react5.useEffect)(() => {
|
|
465
465
|
if (initialFiles.length > 0) {
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
setFiles((prevFiles) => {
|
|
472
|
-
let updated = false;
|
|
473
|
-
const nuevosArchivos = prevFiles.map((file) => {
|
|
474
|
-
if (!file.uploadError && file.progress < 100) {
|
|
475
|
-
updated = true;
|
|
476
|
-
return __spreadProps(__spreadValues({}, file), { progress: Math.min(file.progress + 15, 100) });
|
|
477
|
-
}
|
|
478
|
-
return file;
|
|
466
|
+
const initials = initialFiles.map((f) => {
|
|
467
|
+
var _a, _b;
|
|
468
|
+
return __spreadProps(__spreadValues({}, f), {
|
|
469
|
+
progress: (_a = f.progress) != null ? _a : 100,
|
|
470
|
+
uploadError: (_b = f.uploadError) != null ? _b : false
|
|
479
471
|
});
|
|
480
|
-
return updated ? nuevosArchivos : prevFiles;
|
|
481
472
|
});
|
|
482
|
-
|
|
483
|
-
|
|
473
|
+
setFiles(initials);
|
|
474
|
+
onChange == null ? void 0 : onChange(initials.map((f) => new File([], f.name, { type: f.type })));
|
|
475
|
+
}
|
|
484
476
|
}, []);
|
|
485
477
|
const handleDrop = (event2) => {
|
|
486
478
|
event2.preventDefault();
|