componentes-sinco 1.0.39 → 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,16 +658,28 @@ 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;
669
+
670
+ interface SCSnackBarProps {
671
+ type?: 'success' | 'error' | 'warning' | 'info';
672
+ close?: boolean;
673
+ openState: boolean;
674
+ setOpenState: any;
675
+ mensaje: string;
676
+ duration?: number;
677
+ position?: 'Center' | 'Left-Up' | 'Left-Down' | 'Right-Up' | 'Right-Down';
678
+ }
679
+ declare const SCSnackBar: ({ type, close, openState, setOpenState, mensaje, duration, position }: SCSnackBarProps) => React__default.JSX.Element;
668
680
 
669
681
  declare const SincoTheme: _mui_material_styles.Theme;
670
682
  declare let AdproSincoTheme: _mui_material_styles.Theme;
671
683
  declare let ADCSincoTheme: _mui_material_styles.Theme;
672
684
 
673
- export { ADCSincoTheme, AdproSincoTheme, Attachment, AttachmentMobile, BasicMenu, type BasicMenuProps, CALENDAR_CONSTANTS, Calendar, type CalendarEvent, type CalendarProps, type CalendarView, type CellBorderType, DayEventsList, EmptyState, type EmptyStateProperties, type EmptyStateSize, type EmptyStateStates, type EventState, FooterAction, type FooterActionsProperties, type ModalProps, type ModalStates, MultiSelect, type MultiSelectProps, type NavigationAction, PageHeader, type PageheaderProperties, type ReplyButtonVariants, type ReplyPalette$1 as ReplyPalette, type ReplyTextPalette, type ReplyVariants, type RepplyAnchorPositions, type RepplySizeVariants, SCActivityCalendar, SCAutocomplete, SCCalendarSwipeable, SCCard, SCDataGrid, SCDataGridInitial, SCDateRange, SCDialog, SCDrawer, SCListContent, SCMenu, SCModal, SCSelect, SCTabs, SCTextArea, type SCTextAreaProps, SCTextField, type SCTextFieldProps, SCTime, SCToastNotification, SincoTheme, type ToastBaseProperties, ToastProgress, type ToastType, capitalize, clampEventToVisibleRange, filterEventsForDay, getButtonColor, getCellBorderType, getIcon, getIconComponent, getIconMultiSelect, getModalColor, modalStateConfig, useCalendarNavigation, useFilteredItems, useMultiSelectHandlers, useProgress };
685
+ export { ADCSincoTheme, AdproSincoTheme, Attachment, AttachmentMobile, BasicMenu, type BasicMenuProps, CALENDAR_CONSTANTS, Calendar, type CalendarEvent, type CalendarProps, type CalendarView, type CellBorderType, DayEventsList, EmptyState, type EmptyStateProperties, type EmptyStateSize, type EmptyStateStates, type EventState, FooterAction, type FooterActionsProperties, type ModalProps, type ModalStates, MultiSelect, type MultiSelectProps, type NavigationAction, PageHeader, type PageheaderProperties, type ReplyButtonVariants, type ReplyPalette$1 as ReplyPalette, type ReplyTextPalette, type ReplyVariants, type RepplyAnchorPositions, type RepplySizeVariants, SCActivityCalendar, SCAutocomplete, SCCalendarSwipeable, SCCard, SCDataGrid, SCDataGridInitial, SCDateRange, SCDialog, SCDrawer, SCListContent, SCMenu, SCModal, SCSelect, SCSnackBar, SCTabs, SCTextArea, type SCTextAreaProps, SCTextField, type SCTextFieldProps, SCTime, SCToastNotification, SincoTheme, type ToastBaseProperties, ToastProgress, type ToastType, capitalize, clampEventToVisibleRange, filterEventsForDay, getButtonColor, getCellBorderType, getIcon, getIconComponent, getIconMultiSelect, getModalColor, modalStateConfig, useCalendarNavigation, useFilteredItems, useMultiSelectHandlers, useProgress };
package/dist/index.d.ts CHANGED
@@ -658,16 +658,28 @@ 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;
669
+
670
+ interface SCSnackBarProps {
671
+ type?: 'success' | 'error' | 'warning' | 'info';
672
+ close?: boolean;
673
+ openState: boolean;
674
+ setOpenState: any;
675
+ mensaje: string;
676
+ duration?: number;
677
+ position?: 'Center' | 'Left-Up' | 'Left-Down' | 'Right-Up' | 'Right-Down';
678
+ }
679
+ declare const SCSnackBar: ({ type, close, openState, setOpenState, mensaje, duration, position }: SCSnackBarProps) => React__default.JSX.Element;
668
680
 
669
681
  declare const SincoTheme: _mui_material_styles.Theme;
670
682
  declare let AdproSincoTheme: _mui_material_styles.Theme;
671
683
  declare let ADCSincoTheme: _mui_material_styles.Theme;
672
684
 
673
- export { ADCSincoTheme, AdproSincoTheme, Attachment, AttachmentMobile, BasicMenu, type BasicMenuProps, CALENDAR_CONSTANTS, Calendar, type CalendarEvent, type CalendarProps, type CalendarView, type CellBorderType, DayEventsList, EmptyState, type EmptyStateProperties, type EmptyStateSize, type EmptyStateStates, type EventState, FooterAction, type FooterActionsProperties, type ModalProps, type ModalStates, MultiSelect, type MultiSelectProps, type NavigationAction, PageHeader, type PageheaderProperties, type ReplyButtonVariants, type ReplyPalette$1 as ReplyPalette, type ReplyTextPalette, type ReplyVariants, type RepplyAnchorPositions, type RepplySizeVariants, SCActivityCalendar, SCAutocomplete, SCCalendarSwipeable, SCCard, SCDataGrid, SCDataGridInitial, SCDateRange, SCDialog, SCDrawer, SCListContent, SCMenu, SCModal, SCSelect, SCTabs, SCTextArea, type SCTextAreaProps, SCTextField, type SCTextFieldProps, SCTime, SCToastNotification, SincoTheme, type ToastBaseProperties, ToastProgress, type ToastType, capitalize, clampEventToVisibleRange, filterEventsForDay, getButtonColor, getCellBorderType, getIcon, getIconComponent, getIconMultiSelect, getModalColor, modalStateConfig, useCalendarNavigation, useFilteredItems, useMultiSelectHandlers, useProgress };
685
+ export { ADCSincoTheme, AdproSincoTheme, Attachment, AttachmentMobile, BasicMenu, type BasicMenuProps, CALENDAR_CONSTANTS, Calendar, type CalendarEvent, type CalendarProps, type CalendarView, type CellBorderType, DayEventsList, EmptyState, type EmptyStateProperties, type EmptyStateSize, type EmptyStateStates, type EventState, FooterAction, type FooterActionsProperties, type ModalProps, type ModalStates, MultiSelect, type MultiSelectProps, type NavigationAction, PageHeader, type PageheaderProperties, type ReplyButtonVariants, type ReplyPalette$1 as ReplyPalette, type ReplyTextPalette, type ReplyVariants, type RepplyAnchorPositions, type RepplySizeVariants, SCActivityCalendar, SCAutocomplete, SCCalendarSwipeable, SCCard, SCDataGrid, SCDataGridInitial, SCDateRange, SCDialog, SCDrawer, SCListContent, SCMenu, SCModal, SCSelect, SCSnackBar, SCTabs, SCTextArea, type SCTextAreaProps, SCTextField, type SCTextFieldProps, SCTime, SCToastNotification, SincoTheme, type ToastBaseProperties, ToastProgress, type ToastType, capitalize, clampEventToVisibleRange, filterEventsForDay, getButtonColor, getCellBorderType, getIcon, getIconComponent, getIconMultiSelect, getModalColor, modalStateConfig, useCalendarNavigation, useFilteredItems, useMultiSelectHandlers, useProgress };
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(
@@ -5268,11 +5273,51 @@ var AttachmentMobile = ({
5268
5273
  ));
5269
5274
  };
5270
5275
 
5276
+ // src/Components/SCSnackbar.tsx
5277
+ import React45 from "react";
5278
+ import MuiAlert from "@mui/material/Alert";
5279
+ import "dayjs/locale/es";
5280
+ import Snackbar from "@mui/material/Snackbar";
5281
+ var SCSnackBar = ({
5282
+ type = "success",
5283
+ close = true,
5284
+ openState,
5285
+ setOpenState,
5286
+ mensaje,
5287
+ duration = 3e3,
5288
+ position = "Center"
5289
+ }) => {
5290
+ const posicionVertical = position == "Center" ? "bottom" : position.split("-")[1] == "Up" ? "top" : "bottom";
5291
+ const posicionHorizontal = position == "Center" ? "center" : position.split("-")[0] == "Left" ? "left" : "right";
5292
+ const handleClose = (event2, reason) => {
5293
+ if (reason === "clickaway") {
5294
+ return;
5295
+ }
5296
+ setOpenState(false);
5297
+ };
5298
+ return /* @__PURE__ */ React45.createElement(React45.Fragment, null, /* @__PURE__ */ React45.createElement(
5299
+ Snackbar,
5300
+ __spreadValues({
5301
+ anchorOrigin: { vertical: posicionVertical, horizontal: posicionHorizontal },
5302
+ open: openState,
5303
+ autoHideDuration: duration
5304
+ }, close ? { onClose: handleClose } : {}),
5305
+ /* @__PURE__ */ React45.createElement(
5306
+ MuiAlert,
5307
+ __spreadProps(__spreadValues({}, close ? { onClose: handleClose } : {}), {
5308
+ severity: type,
5309
+ sx: { backgroundColor: type == "success" ? "success.50" : type == "error" ? "#F9E8E8" : type == "warning" ? "#FFF0E0" : "#E6F3F8" }
5310
+ }),
5311
+ mensaje
5312
+ )
5313
+ ));
5314
+ };
5315
+
5271
5316
  // src/Theme/index.ts
5272
5317
  import { createTheme } from "@mui/material/styles";
5273
5318
 
5274
5319
  // src/Theme/components.ts
5275
- import React45 from "react";
5320
+ import React46 from "react";
5276
5321
  import {
5277
5322
  InfoRounded as InfoRounded2,
5278
5323
  CheckCircleRounded as CheckCircleRounded2,
@@ -5975,10 +6020,10 @@ var components = {
5975
6020
  MuiAlert: {
5976
6021
  defaultProps: {
5977
6022
  iconMapping: {
5978
- success: React45.createElement(CheckCircleRounded2),
5979
- error: React45.createElement(ErrorRounded2),
5980
- warning: React45.createElement(WarningRounded2),
5981
- info: React45.createElement(InfoRounded2)
6023
+ success: React46.createElement(CheckCircleRounded2),
6024
+ error: React46.createElement(ErrorRounded2),
6025
+ warning: React46.createElement(WarningRounded2),
6026
+ info: React46.createElement(InfoRounded2)
5982
6027
  }
5983
6028
  },
5984
6029
  variants: [
@@ -7042,6 +7087,7 @@ export {
7042
7087
  SCMenu,
7043
7088
  SCModal,
7044
7089
  SCSelect,
7090
+ SCSnackBar,
7045
7091
  SCTabs,
7046
7092
  SCTextArea,
7047
7093
  SCTextField,