componentes-sinco 1.1.11 → 1.1.12

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
@@ -319,12 +319,6 @@ declare const SCCalendarSwipeable: ({ background, setState, state, }: SCCalendar
319
319
  interface SCDataGridInitialProps<T> {
320
320
  data: T[];
321
321
  columns: any;
322
- getRowId?: (row: T) => string | number;
323
- rowsTable?: number;
324
- checkboxSelection?: boolean;
325
- width?: string | number;
326
- maxHeight?: number;
327
- density?: "compact" | "standard" | "comfortable";
328
322
  groupColumns?: (item: any) => {
329
323
  textGroup1?: string;
330
324
  valueGroup1?: string;
@@ -333,6 +327,12 @@ interface SCDataGridInitialProps<T> {
333
327
  headerNameFirstColumn?: string;
334
328
  fieldFirstColumn?: string;
335
329
  };
330
+ getRowId?: (row: T) => string | number;
331
+ rowsTable?: number;
332
+ checkboxSelection?: boolean;
333
+ width?: string | number;
334
+ maxHeight?: number;
335
+ density?: "compact" | "standard" | "comfortable";
336
336
  }
337
337
  declare function SCDataGridInitial<T>({ data, columns, getRowId, groupColumns, rowsTable, checkboxSelection, width, maxHeight, density }: SCDataGridInitialProps<T>): React__default.JSX.Element;
338
338
  declare const SCDataGrid: React__default.MemoExoticComponent<typeof SCDataGridInitial>;
@@ -664,9 +664,11 @@ interface AttachmentMobileProps<T> {
664
664
  fileAccepted?: string;
665
665
  onChange?: (archivos: File[]) => void;
666
666
  deleteAction?: (name: string) => Promise<void> | void;
667
+ downloadAction?: (file: UploadedFile) => Promise<void> | void;
668
+ view?: 'file' | 'button';
667
669
  }
668
670
 
669
- declare const AttachmentMobile: ({ buttonAttachment, maxSize, fileAccepted, initialFiles, deleteAction, children, onChange, sx }: AttachmentMobileProps<any>) => React__default.JSX.Element;
671
+ declare const AttachmentMobile: ({ buttonAttachment, maxSize, fileAccepted, initialFiles, deleteAction, downloadAction, onChange, children, sx, view, }: AttachmentMobileProps<any>) => React__default.JSX.Element;
670
672
 
671
673
  interface SCSnackBarProps {
672
674
  type?: 'success' | 'error' | 'warning' | 'info';
package/dist/index.d.ts CHANGED
@@ -319,12 +319,6 @@ declare const SCCalendarSwipeable: ({ background, setState, state, }: SCCalendar
319
319
  interface SCDataGridInitialProps<T> {
320
320
  data: T[];
321
321
  columns: any;
322
- getRowId?: (row: T) => string | number;
323
- rowsTable?: number;
324
- checkboxSelection?: boolean;
325
- width?: string | number;
326
- maxHeight?: number;
327
- density?: "compact" | "standard" | "comfortable";
328
322
  groupColumns?: (item: any) => {
329
323
  textGroup1?: string;
330
324
  valueGroup1?: string;
@@ -333,6 +327,12 @@ interface SCDataGridInitialProps<T> {
333
327
  headerNameFirstColumn?: string;
334
328
  fieldFirstColumn?: string;
335
329
  };
330
+ getRowId?: (row: T) => string | number;
331
+ rowsTable?: number;
332
+ checkboxSelection?: boolean;
333
+ width?: string | number;
334
+ maxHeight?: number;
335
+ density?: "compact" | "standard" | "comfortable";
336
336
  }
337
337
  declare function SCDataGridInitial<T>({ data, columns, getRowId, groupColumns, rowsTable, checkboxSelection, width, maxHeight, density }: SCDataGridInitialProps<T>): React__default.JSX.Element;
338
338
  declare const SCDataGrid: React__default.MemoExoticComponent<typeof SCDataGridInitial>;
@@ -664,9 +664,11 @@ interface AttachmentMobileProps<T> {
664
664
  fileAccepted?: string;
665
665
  onChange?: (archivos: File[]) => void;
666
666
  deleteAction?: (name: string) => Promise<void> | void;
667
+ downloadAction?: (file: UploadedFile) => Promise<void> | void;
668
+ view?: 'file' | 'button';
667
669
  }
668
670
 
669
- declare const AttachmentMobile: ({ buttonAttachment, maxSize, fileAccepted, initialFiles, deleteAction, children, onChange, sx }: AttachmentMobileProps<any>) => React__default.JSX.Element;
671
+ declare const AttachmentMobile: ({ buttonAttachment, maxSize, fileAccepted, initialFiles, deleteAction, downloadAction, onChange, children, sx, view, }: AttachmentMobileProps<any>) => React__default.JSX.Element;
670
672
 
671
673
  interface SCSnackBarProps {
672
674
  type?: 'success' | 'error' | 'warning' | 'info';
package/dist/index.js CHANGED
@@ -4781,7 +4781,7 @@ var SCCard = ({ width, title, image, iconTitle, actionsTitle, subtitle, content,
4781
4781
 
4782
4782
  // src/Components/SCActivityCalendar.tsx
4783
4783
  import React42, { useState as useState23 } from "react";
4784
- import { Typography as Typography25, IconButton as IconButton15, Box as Box27, Badge as Badge2 } from "@mui/material";
4784
+ import { Typography as Typography25, IconButton as IconButton15, Box as Box27, Badge as Badge2, Menu as Menu3, MenuItem as MenuItem8, ListItemIcon as ListItemIcon6, Popover as Popover7 } from "@mui/material";
4785
4785
  import Grid11 from "@mui/material/Grid";
4786
4786
  import { AdapterDateFns as AdapterDateFns2 } from "@mui/x-date-pickers/AdapterDateFns";
4787
4787
  import { LocalizationProvider as LocalizationProvider4 } from "@mui/x-date-pickers/LocalizationProvider";
@@ -4792,6 +4792,11 @@ import KeyboardDoubleArrowDownIcon2 from "@mui/icons-material/KeyboardDoubleArro
4792
4792
  import KeyboardDoubleArrowUpIcon2 from "@mui/icons-material/KeyboardDoubleArrowUp";
4793
4793
  import ArrowForwardIcon from "@mui/icons-material/ArrowForward";
4794
4794
  import LightModeOutlinedIcon from "@mui/icons-material/LightModeOutlined";
4795
+ import FilterListIcon from "@mui/icons-material/FilterList";
4796
+ import CalendarMonthOutlinedIcon from "@mui/icons-material/CalendarMonthOutlined";
4797
+ import CheckCircleOutlineOutlinedIcon from "@mui/icons-material/CheckCircleOutlineOutlined";
4798
+ import EventBusyOutlinedIcon from "@mui/icons-material/EventBusyOutlined";
4799
+ import PendingOutlinedIcon from "@mui/icons-material/PendingOutlined";
4795
4800
  var SCActivityCalendar = ({
4796
4801
  //informativas
4797
4802
  //apariencia
@@ -4808,6 +4813,9 @@ var SCActivityCalendar = ({
4808
4813
  const [fechaSeleccionada, setFechaSeleccionada] = useState23();
4809
4814
  const [stateVal, setstateVal] = React42.useState(/* @__PURE__ */ new Date());
4810
4815
  const [openCalendar, setOpenCalendar] = React42.useState(false);
4816
+ const [anchorPopoverFiltro, setAnchorPopoverFiltro] = useState23(null);
4817
+ const [datosEventos, setDatosEventos] = React42.useState(events);
4818
+ const openPopoverFiltro = Boolean(anchorPopoverFiltro);
4811
4819
  const hoy = /* @__PURE__ */ new Date();
4812
4820
  const inicioSemana = startOfWeek2(fecha, { weekStartsOn: 0 });
4813
4821
  const diasSemana = Array.from({ length: 7 }, (_, i) => addDays2(inicioSemana, i));
@@ -4835,7 +4843,23 @@ var SCActivityCalendar = ({
4835
4843
  // 0 = domingo, 1 = lunes
4836
4844
  })
4837
4845
  });
4838
- return /* @__PURE__ */ React42.createElement(React42.Fragment, null, /* @__PURE__ */ React42.createElement(LocalizationProvider4, { dateAdapter: AdapterDateFns2, adapterLocale: locale }, openCalendar == false ? /* @__PURE__ */ React42.createElement(Box27, { "data-testid": "calendar-mobile", sx: { width: "100%", background: background ? background : "white", display: "flex", flexDirection: "column", alignItems: "center" } }, /* @__PURE__ */ React42.createElement(Box27, { sx: { width: "100%", padding: "0px 16px", background: "transparent" } }, /* @__PURE__ */ React42.createElement(Grid11, { container: true, gap: 0.5, sx: { justifyContent: "space-between", padding: "12px 0px", background: "transparent" } }, diasSemana.map((dia) => /* @__PURE__ */ React42.createElement(Grid11, { sx: { width: "36px" }, key: dia.toString() }, /* @__PURE__ */ React42.createElement(Box27, { sx: { width: "36px", height: "40px", display: "flex", alignItems: "center", justifyContent: "center" } }, /* @__PURE__ */ React42.createElement(Typography25, { sx: { fontSize: "12px !important", color: "#10184099" } }, format2(dia, "EEEE", { locale: es2 }).charAt(0).toUpperCase())), /* @__PURE__ */ React42.createElement(
4846
+ const handleClickPopoverFiltro = (event2) => {
4847
+ setAnchorPopoverFiltro(event2.currentTarget);
4848
+ };
4849
+ const handleClosePopoverFiltro = () => {
4850
+ setAnchorPopoverFiltro(null);
4851
+ };
4852
+ const filtrarActividad = (event2, filtro) => {
4853
+ if (filtro === "Todo") {
4854
+ setDatosEventos(events);
4855
+ } else {
4856
+ const resultado = events.filter(
4857
+ (item) => item.state === filtro
4858
+ );
4859
+ setDatosEventos(resultado);
4860
+ }
4861
+ };
4862
+ return /* @__PURE__ */ React42.createElement(React42.Fragment, null, /* @__PURE__ */ React42.createElement(LocalizationProvider4, { dateAdapter: AdapterDateFns2, adapterLocale: locale }, openCalendar == false ? /* @__PURE__ */ React42.createElement(Box27, { "data-testid": "calendar-mobile", sx: { width: "100%", background: background ? background : "white", display: "flex", flexDirection: "column", alignItems: "center" } }, /* @__PURE__ */ React42.createElement(Box27, { sx: { width: "100%", padding: "0px", background: "transparent" } }, /* @__PURE__ */ React42.createElement(Grid11, { container: true, gap: 0.5, sx: { justifyContent: "space-between", padding: "12px 16px", background: "transparent" } }, diasSemana.map((dia) => /* @__PURE__ */ React42.createElement(Grid11, { sx: { width: "36px" }, key: dia.toString() }, /* @__PURE__ */ React42.createElement(Box27, { sx: { width: "36px", height: "40px", display: "flex", alignItems: "center", justifyContent: "center" } }, /* @__PURE__ */ React42.createElement(Typography25, { sx: { fontSize: "12px !important", color: "#10184099" } }, format2(dia, "EEEE", { locale: es2 }).charAt(0).toUpperCase())), /* @__PURE__ */ React42.createElement(
4839
4863
  Box27,
4840
4864
  {
4841
4865
  onClick: () => setFecha(dia),
@@ -4858,7 +4882,7 @@ var SCActivityCalendar = ({
4858
4882
  slotProps: { toolbar: { hidden: true }, actionBar: { actions: [] } },
4859
4883
  sx: {
4860
4884
  "& .MuiDateCalendar-root": {
4861
- width: "100%",
4885
+ width: "97.5%",
4862
4886
  maxWidth: "unset",
4863
4887
  margin: 0,
4864
4888
  padding: "0px 16px"
@@ -4874,7 +4898,36 @@ var SCActivityCalendar = ({
4874
4898
  },
4875
4899
  onChange: (newValue) => setFecha(newValue)
4876
4900
  }
4877
- ), /* @__PURE__ */ React42.createElement(Grid11, { container: true, justifyContent: "center" }, /* @__PURE__ */ React42.createElement(IconButton15, { "data-testid": "close-calendar-button", onClick: toggleCalendar(false) }, /* @__PURE__ */ React42.createElement(KeyboardDoubleArrowUpIcon2, { color: "action" }))))), /* @__PURE__ */ React42.createElement(Box27, { sx: { boxSizing: "border-box", padding: "0px 16px", width: "100%", height: openCalendar ? "calc(91% - 260px)" : "calc(91% - 100px)", background: "white", display: "flex", flexDirection: "column", overflowY: "auto", gap: "8px", scrollSnapType: "x mandatory", paddingBottom: "10px" } }, diasSemana.map((day, dayIndex) => /* @__PURE__ */ React42.createElement(
4901
+ ), /* @__PURE__ */ React42.createElement(Grid11, { container: true, justifyContent: "center" }, /* @__PURE__ */ React42.createElement(IconButton15, { "data-testid": "close-calendar-button", onClick: toggleCalendar(false) }, /* @__PURE__ */ React42.createElement(KeyboardDoubleArrowUpIcon2, { color: "action" }))))), /* @__PURE__ */ React42.createElement(IconButton15, { onClick: handleClickPopoverFiltro, sx: { position: "fixed", right: "calc(100% - 96%)", top: openCalendar == false ? "197px" : "357px" } }, /* @__PURE__ */ React42.createElement(FilterListIcon, { color: "action" })), /* @__PURE__ */ React42.createElement(
4902
+ Popover7,
4903
+ {
4904
+ open: openPopoverFiltro,
4905
+ anchorEl: anchorPopoverFiltro,
4906
+ onClose: handleClosePopoverFiltro,
4907
+ anchorOrigin: {
4908
+ vertical: "bottom",
4909
+ horizontal: "right"
4910
+ }
4911
+ },
4912
+ /* @__PURE__ */ React42.createElement(
4913
+ Menu3,
4914
+ {
4915
+ id: "basic-menu",
4916
+ anchorEl: anchorPopoverFiltro,
4917
+ open: openPopoverFiltro,
4918
+ onClose: handleClosePopoverFiltro,
4919
+ slotProps: {
4920
+ list: {
4921
+ "aria-labelledby": "basic-button"
4922
+ }
4923
+ }
4924
+ },
4925
+ /* @__PURE__ */ React42.createElement(MenuItem8, { onClick: (event2) => filtrarActividad(event2, "Todo") }, /* @__PURE__ */ React42.createElement(ListItemIcon6, null, /* @__PURE__ */ React42.createElement(CalendarMonthOutlinedIcon, { fontSize: "small" })), /* @__PURE__ */ React42.createElement(Typography25, { variant: "inherit" }, "Ver todo")),
4926
+ /* @__PURE__ */ React42.createElement(MenuItem8, { onClick: (event2) => filtrarActividad(event2, "Finalizada") }, /* @__PURE__ */ React42.createElement(ListItemIcon6, null, /* @__PURE__ */ React42.createElement(CheckCircleOutlineOutlinedIcon, { fontSize: "small" })), /* @__PURE__ */ React42.createElement(Typography25, { variant: "inherit" }, "Ver finalizadas")),
4927
+ /* @__PURE__ */ React42.createElement(MenuItem8, { onClick: (event2) => filtrarActividad(event2, "Aplazada") }, /* @__PURE__ */ React42.createElement(ListItemIcon6, null, /* @__PURE__ */ React42.createElement(EventBusyOutlinedIcon, { fontSize: "small" })), /* @__PURE__ */ React42.createElement(Typography25, { variant: "inherit" }, "Ver aplazadas")),
4928
+ /* @__PURE__ */ React42.createElement(MenuItem8, { onClick: (event2) => filtrarActividad(event2, "En progreso") }, /* @__PURE__ */ React42.createElement(ListItemIcon6, null, /* @__PURE__ */ React42.createElement(PendingOutlinedIcon, { fontSize: "small" })), /* @__PURE__ */ React42.createElement(Typography25, { variant: "inherit" }, "Ver en progreso"))
4929
+ )
4930
+ ), /* @__PURE__ */ React42.createElement(Box27, { sx: { boxSizing: "border-box", padding: "0px 16px", width: "100%", height: openCalendar ? "calc(91% - 260px)" : "calc(91% - 100px)", background: "white", display: "flex", flexDirection: "column", overflowY: "auto", gap: "8px", scrollSnapType: "x mandatory", paddingBottom: "10px" } }, diasSemana.map((day, dayIndex) => /* @__PURE__ */ React42.createElement(
4878
4931
  Box27,
4879
4932
  {
4880
4933
  key: dayIndex
@@ -4891,7 +4944,7 @@ var SCActivityCalendar = ({
4891
4944
  flexDirection: "column"
4892
4945
  } }, (() => {
4893
4946
  const esDomingo = day.getDay() === 0;
4894
- const eventosDelDia = events.filter(
4947
+ const eventosDelDia = datosEventos.filter(
4895
4948
  (event2) => new Date(event2.date).toDateString() === day.toDateString()
4896
4949
  );
4897
4950
  if (eventosDelDia.length > 0) {
@@ -4986,15 +5039,18 @@ import { CloseOutlined, DeleteOutline as DeleteOutline2, FolderOpenOutlined, Pho
4986
5039
  import PhotoCameraIcon from "@mui/icons-material/PhotoCamera";
4987
5040
  import CancelOutlinedIcon from "@mui/icons-material/CancelOutlined";
4988
5041
  import ImageOutlinedIcon from "@mui/icons-material/ImageOutlined";
5042
+ import FileDownloadOutlinedIcon from "@mui/icons-material/FileDownloadOutlined";
4989
5043
  var AttachmentMobile = ({
4990
5044
  buttonAttachment,
4991
5045
  maxSize = 400,
4992
5046
  fileAccepted = "",
4993
5047
  initialFiles,
4994
5048
  deleteAction,
4995
- children,
5049
+ downloadAction,
4996
5050
  onChange,
4997
- sx
5051
+ children,
5052
+ sx,
5053
+ view = "button"
4998
5054
  }) => {
4999
5055
  const webcamRef = useRef8(null);
5000
5056
  const [abrirCamara, setAbrirCamara] = useState24(false);
@@ -5166,14 +5222,14 @@ var AttachmentMobile = ({
5166
5222
  setFiles(initialFiles);
5167
5223
  }
5168
5224
  }, []);
5169
- 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(
5225
+ return /* @__PURE__ */ React44.createElement(Box28, { display: "flex", flexDirection: "column", gap: 1 }, view == "button" ? /* @__PURE__ */ React44.createElement(Box28, { display: "flex", width: "100%", justifyContent: "space-between", alignItems: "center", sx }, children, /* @__PURE__ */ React44.createElement(
5170
5226
  AttachmentButton,
5171
5227
  {
5172
5228
  buttonAttachment,
5173
5229
  open,
5174
5230
  setOpen
5175
5231
  }
5176
- )), /* @__PURE__ */ React44.createElement(CssBaseline, null), /* @__PURE__ */ React44.createElement(
5232
+ )) : "", /* @__PURE__ */ React44.createElement(CssBaseline, null), /* @__PURE__ */ React44.createElement(
5177
5233
  SwipeableDrawer2,
5178
5234
  {
5179
5235
  slotProps: {
@@ -5338,7 +5394,17 @@ var AttachmentMobile = ({
5338
5394
  },
5339
5395
  file.uploadError && file.size / (1024 * 1024) > maxSize ? "Archivo super\xF3 el l\xEDmite \u2022 Carga fallida" : file.uploadError ? "Archivo duplicado o inv\xE1lido \u2022 Carga fallida" : `${(file.size / (1024 * 1024)).toFixed(2)}MB \u2022 ${file.type}`
5340
5396
  ))),
5341
- /* @__PURE__ */ React44.createElement(Tooltip8, { title: "Eliminar" }, /* @__PURE__ */ React44.createElement(
5397
+ view == "file" ? /* @__PURE__ */ React44.createElement(Tooltip8, { title: "Descargar" }, /* @__PURE__ */ React44.createElement(
5398
+ IconButton16,
5399
+ {
5400
+ size: "small",
5401
+ onClick: () => downloadAction == null ? void 0 : downloadAction(file),
5402
+ disabled: file.uploadError,
5403
+ "aria-label": `Descargar ${file.name}`
5404
+ },
5405
+ /* @__PURE__ */ React44.createElement(FileDownloadOutlinedIcon, { fontSize: "small", color: "action" })
5406
+ )) : "",
5407
+ view == "button" ? /* @__PURE__ */ React44.createElement(Tooltip8, { title: "Eliminar" }, /* @__PURE__ */ React44.createElement(
5342
5408
  IconButton16,
5343
5409
  {
5344
5410
  size: "small",
@@ -5346,7 +5412,7 @@ var AttachmentMobile = ({
5346
5412
  "aria-label": `Eliminar ${file.name}`
5347
5413
  },
5348
5414
  /* @__PURE__ */ React44.createElement(DeleteOutline2, { fontSize: "small", color: "action" })
5349
- ))
5415
+ )) : ""
5350
5416
  ))
5351
5417
  ));
5352
5418
  };
@@ -5395,7 +5461,7 @@ var SCSnackBar = ({
5395
5461
 
5396
5462
  // src/Components/SCAppBar.tsx
5397
5463
  import React46, { useState as useState26, useEffect as useEffect22 } from "react";
5398
- import { Menu as Menu3, Box as Box29, Typography as Typography27, MenuItem as MenuItem8, IconButton as IconButton17, Badge as Badge3 } from "@mui/material";
5464
+ import { Menu as Menu4, Box as Box29, Typography as Typography27, MenuItem as MenuItem9, IconButton as IconButton17, Badge as Badge3 } from "@mui/material";
5399
5465
  import Grid12 from "@mui/material/Grid";
5400
5466
  import "dayjs/locale/es";
5401
5467
  import MenuIcon from "@mui/icons-material/Menu";
@@ -5451,7 +5517,7 @@ var SCAppBar = ({
5451
5517
  color: isOnline ? "success" : "error"
5452
5518
  }
5453
5519
  ), /* @__PURE__ */ React46.createElement(Typography27, { variant: "caption", color: "text.secondary" }, isOnline ? "Online" : "Offline")), visibleMenu && /* @__PURE__ */ React46.createElement(React46.Fragment, null, /* @__PURE__ */ React46.createElement(IconButton17, { size: "medium", onClick: handleMenuClick }, /* @__PURE__ */ React46.createElement(MenuIcon, { color: "action" })), /* @__PURE__ */ React46.createElement(
5454
- Menu3,
5520
+ Menu4,
5455
5521
  {
5456
5522
  anchorEl,
5457
5523
  open: openMenu,
@@ -5466,7 +5532,7 @@ var SCAppBar = ({
5466
5532
  },
5467
5533
  sx: { zIndex: "2000" }
5468
5534
  },
5469
- options.map((option, index) => /* @__PURE__ */ React46.createElement(MenuItem8, { onClick: option.fn, disabled: option.disabled, key: index }, /* @__PURE__ */ React46.createElement(Typography27, { variant: "body2" }, option.name)))
5535
+ options.map((option, index) => /* @__PURE__ */ React46.createElement(MenuItem9, { onClick: option.fn, disabled: option.disabled, key: index }, /* @__PURE__ */ React46.createElement(Typography27, { variant: "body2" }, option.name)))
5470
5536
  )))), /* @__PURE__ */ React46.createElement(Box29, { sx: { padding: "8px 16px 0px 16px" } }, contenidoExtra)));
5471
5537
  };
5472
5538