componentes-sinco 1.0.40 → 1.0.41

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.cts CHANGED
@@ -658,13 +658,14 @@ interface AttachmentMobileProps<T> {
658
658
  maxSize?: number;
659
659
  sx?: SxProps;
660
660
  files?: T[];
661
+ setAttachedFiles?: any;
661
662
  initialFiles?: UploadedFile[];
662
663
  fileAccepted?: string;
663
664
  onChange?: (archivos: File[]) => void;
664
665
  deleteAction?: (name: string) => Promise<void> | void;
665
666
  }
666
667
 
667
- declare const AttachmentMobile: ({ buttonAttachment, maxSize, fileAccepted, initialFiles, deleteAction, children, onChange, sx }: AttachmentMobileProps<any>) => React__default.JSX.Element;
668
+ declare const AttachmentMobile: ({ buttonAttachment, maxSize, fileAccepted, initialFiles, setAttachedFiles, deleteAction, children, onChange, sx }: AttachmentMobileProps<any>) => React__default.JSX.Element;
668
669
 
669
670
  interface SCSnackBarProps {
670
671
  type?: 'success' | 'error' | 'warning' | 'info';
package/dist/index.d.ts CHANGED
@@ -658,13 +658,14 @@ interface AttachmentMobileProps<T> {
658
658
  maxSize?: number;
659
659
  sx?: SxProps;
660
660
  files?: T[];
661
+ setAttachedFiles?: any;
661
662
  initialFiles?: UploadedFile[];
662
663
  fileAccepted?: string;
663
664
  onChange?: (archivos: File[]) => void;
664
665
  deleteAction?: (name: string) => Promise<void> | void;
665
666
  }
666
667
 
667
- declare const AttachmentMobile: ({ buttonAttachment, maxSize, fileAccepted, initialFiles, deleteAction, children, onChange, sx }: AttachmentMobileProps<any>) => React__default.JSX.Element;
668
+ declare const AttachmentMobile: ({ buttonAttachment, maxSize, fileAccepted, initialFiles, setAttachedFiles, deleteAction, children, onChange, sx }: AttachmentMobileProps<any>) => React__default.JSX.Element;
668
669
 
669
670
  interface SCSnackBarProps {
670
671
  type?: 'success' | 'error' | 'warning' | 'info';
package/dist/index.js CHANGED
@@ -2046,7 +2046,6 @@ var SCDateRange = ({
2046
2046
  popper: {
2047
2047
  sx: {
2048
2048
  zIndex: 1400
2049
- // muy alto para que quede encima
2050
2049
  }
2051
2050
  },
2052
2051
  textField: ({ position }) => {
@@ -4917,6 +4916,7 @@ var AttachmentMobile = ({
4917
4916
  maxSize = 400,
4918
4917
  fileAccepted = "",
4919
4918
  initialFiles,
4919
+ setAttachedFiles,
4920
4920
  deleteAction,
4921
4921
  children,
4922
4922
  onChange,
@@ -4966,9 +4966,11 @@ var AttachmentMobile = ({
4966
4966
  u8arr[n] = bstr.charCodeAt(n);
4967
4967
  }
4968
4968
  const fechaActual = new Date(Date.now());
4969
- const fechaConFormato = fechaActual.getFullYear() + "" + (fechaActual.getMonth() + 1) + fechaActual.getDate();
4969
+ const fechaConFormato = fechaActual.getFullYear() + "" + (fechaActual.getMonth() + 1) + fechaActual.getDate() + fechaActual.getHours() + fechaActual.getMinutes() + fechaActual.getSeconds();
4970
4970
  const capturedFile = new File([u8arr], `photo_${fechaConFormato}.jpg`, { type: mime });
4971
4971
  newFiles = [capturedFile];
4972
+ setCapturedImage(null);
4973
+ capturedImage2 = null;
4972
4974
  }
4973
4975
  if (!newFiles) return;
4974
4976
  const nuevosArchivos = [];
@@ -5032,6 +5034,7 @@ var AttachmentMobile = ({
5032
5034
  if (nuevosArchivos.length > 0) {
5033
5035
  setFiles((prevFiles) => {
5034
5036
  const updatedFiles = [...prevFiles, ...nuevosArchivos];
5037
+ setAttachedFiles(updatedFiles);
5035
5038
  if (archivosValidos.length > 0) {
5036
5039
  onChange == null ? void 0 : onChange([
5037
5040
  ...archivosValidos,
@@ -5053,6 +5056,7 @@ var AttachmentMobile = ({
5053
5056
  (file) => !(file.name === fileToRemove.name && file.size === fileToRemove.size)
5054
5057
  );
5055
5058
  setFiles(updatedFiles);
5059
+ setAttachedFiles(updatedFiles);
5056
5060
  if (onChange) {
5057
5061
  const remainingValidFiles = updatedFiles.filter((f) => !f.uploadError).map((f) => new File([], f.name, { type: f.type }));
5058
5062
  onChange(remainingValidFiles);
@@ -5088,6 +5092,7 @@ var AttachmentMobile = ({
5088
5092
  useEffect21(() => {
5089
5093
  if (initialFiles && initialFiles.length > 0) {
5090
5094
  setFiles(initialFiles);
5095
+ setAttachedFiles(initialFiles);
5091
5096
  }
5092
5097
  }, []);
5093
5098
  return /* @__PURE__ */ React44.createElement(Box28, { display: "flex", flexDirection: "column", gap: 1 }, /* @__PURE__ */ React44.createElement(Box28, { display: "flex", width: "100%", justifyContent: "space-between", alignItems: "center", sx }, children, /* @__PURE__ */ React44.createElement(
@@ -5272,7 +5277,6 @@ var AttachmentMobile = ({
5272
5277
  import React45 from "react";
5273
5278
  import MuiAlert from "@mui/material/Alert";
5274
5279
  import "dayjs/locale/es";
5275
- import Button18 from "@mui/material/Button";
5276
5280
  import Snackbar from "@mui/material/Snackbar";
5277
5281
  var SCSnackBar = ({
5278
5282
  type = "success",
@@ -5285,16 +5289,13 @@ var SCSnackBar = ({
5285
5289
  }) => {
5286
5290
  const posicionVertical = position == "Center" ? "bottom" : position.split("-")[1] == "Up" ? "top" : "bottom";
5287
5291
  const posicionHorizontal = position == "Center" ? "center" : position.split("-")[0] == "Left" ? "left" : "right";
5288
- const handleClick = () => {
5289
- setOpenState(true);
5290
- };
5291
5292
  const handleClose = (event2, reason) => {
5292
5293
  if (reason === "clickaway") {
5293
5294
  return;
5294
5295
  }
5295
5296
  setOpenState(false);
5296
5297
  };
5297
- return /* @__PURE__ */ React45.createElement(React45.Fragment, null, /* @__PURE__ */ React45.createElement(Button18, { onClick: handleClick }, "Open Snackbar"), /* @__PURE__ */ React45.createElement(
5298
+ return /* @__PURE__ */ React45.createElement(React45.Fragment, null, /* @__PURE__ */ React45.createElement(
5298
5299
  Snackbar,
5299
5300
  __spreadValues({
5300
5301
  anchorOrigin: { vertical: posicionVertical, horizontal: posicionHorizontal },