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.cjs +76 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +9 -7
- package/dist/index.d.ts +9 -7
- package/dist/index.js +80 -14
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -4873,6 +4873,11 @@ var import_KeyboardDoubleArrowDown2 = __toESM(require("@mui/icons-material/Keybo
|
|
|
4873
4873
|
var import_KeyboardDoubleArrowUp2 = __toESM(require("@mui/icons-material/KeyboardDoubleArrowUp"), 1);
|
|
4874
4874
|
var import_ArrowForward = __toESM(require("@mui/icons-material/ArrowForward"), 1);
|
|
4875
4875
|
var import_LightModeOutlined = __toESM(require("@mui/icons-material/LightModeOutlined"), 1);
|
|
4876
|
+
var import_FilterList = __toESM(require("@mui/icons-material/FilterList"), 1);
|
|
4877
|
+
var import_CalendarMonthOutlined = __toESM(require("@mui/icons-material/CalendarMonthOutlined"), 1);
|
|
4878
|
+
var import_CheckCircleOutlineOutlined = __toESM(require("@mui/icons-material/CheckCircleOutlineOutlined"), 1);
|
|
4879
|
+
var import_EventBusyOutlined = __toESM(require("@mui/icons-material/EventBusyOutlined"), 1);
|
|
4880
|
+
var import_PendingOutlined = __toESM(require("@mui/icons-material/PendingOutlined"), 1);
|
|
4876
4881
|
var SCActivityCalendar = ({
|
|
4877
4882
|
//informativas
|
|
4878
4883
|
//apariencia
|
|
@@ -4889,6 +4894,9 @@ var SCActivityCalendar = ({
|
|
|
4889
4894
|
const [fechaSeleccionada, setFechaSeleccionada] = (0, import_react50.useState)();
|
|
4890
4895
|
const [stateVal, setstateVal] = import_react50.default.useState(/* @__PURE__ */ new Date());
|
|
4891
4896
|
const [openCalendar, setOpenCalendar] = import_react50.default.useState(false);
|
|
4897
|
+
const [anchorPopoverFiltro, setAnchorPopoverFiltro] = (0, import_react50.useState)(null);
|
|
4898
|
+
const [datosEventos, setDatosEventos] = import_react50.default.useState(events);
|
|
4899
|
+
const openPopoverFiltro = Boolean(anchorPopoverFiltro);
|
|
4892
4900
|
const hoy = /* @__PURE__ */ new Date();
|
|
4893
4901
|
const inicioSemana = (0, import_date_fns2.startOfWeek)(fecha, { weekStartsOn: 0 });
|
|
4894
4902
|
const diasSemana = Array.from({ length: 7 }, (_, i) => (0, import_date_fns2.addDays)(inicioSemana, i));
|
|
@@ -4916,7 +4924,23 @@ var SCActivityCalendar = ({
|
|
|
4916
4924
|
// 0 = domingo, 1 = lunes
|
|
4917
4925
|
})
|
|
4918
4926
|
});
|
|
4919
|
-
|
|
4927
|
+
const handleClickPopoverFiltro = (event2) => {
|
|
4928
|
+
setAnchorPopoverFiltro(event2.currentTarget);
|
|
4929
|
+
};
|
|
4930
|
+
const handleClosePopoverFiltro = () => {
|
|
4931
|
+
setAnchorPopoverFiltro(null);
|
|
4932
|
+
};
|
|
4933
|
+
const filtrarActividad = (event2, filtro) => {
|
|
4934
|
+
if (filtro === "Todo") {
|
|
4935
|
+
setDatosEventos(events);
|
|
4936
|
+
} else {
|
|
4937
|
+
const resultado = events.filter(
|
|
4938
|
+
(item) => item.state === filtro
|
|
4939
|
+
);
|
|
4940
|
+
setDatosEventos(resultado);
|
|
4941
|
+
}
|
|
4942
|
+
};
|
|
4943
|
+
return /* @__PURE__ */ import_react50.default.createElement(import_react50.default.Fragment, null, /* @__PURE__ */ import_react50.default.createElement(import_LocalizationProvider4.LocalizationProvider, { dateAdapter: import_AdapterDateFns2.AdapterDateFns, adapterLocale: locale }, openCalendar == false ? /* @__PURE__ */ import_react50.default.createElement(import_material34.Box, { "data-testid": "calendar-mobile", sx: { width: "100%", background: background ? background : "white", display: "flex", flexDirection: "column", alignItems: "center" } }, /* @__PURE__ */ import_react50.default.createElement(import_material34.Box, { sx: { width: "100%", padding: "0px", background: "transparent" } }, /* @__PURE__ */ import_react50.default.createElement(import_Grid9.default, { container: true, gap: 0.5, sx: { justifyContent: "space-between", padding: "12px 16px", background: "transparent" } }, diasSemana.map((dia) => /* @__PURE__ */ import_react50.default.createElement(import_Grid9.default, { sx: { width: "36px" }, key: dia.toString() }, /* @__PURE__ */ import_react50.default.createElement(import_material34.Box, { sx: { width: "36px", height: "40px", display: "flex", alignItems: "center", justifyContent: "center" } }, /* @__PURE__ */ import_react50.default.createElement(import_material34.Typography, { sx: { fontSize: "12px !important", color: "#10184099" } }, (0, import_date_fns2.format)(dia, "EEEE", { locale: import_locale2.es }).charAt(0).toUpperCase())), /* @__PURE__ */ import_react50.default.createElement(
|
|
4920
4944
|
import_material34.Box,
|
|
4921
4945
|
{
|
|
4922
4946
|
onClick: () => setFecha(dia),
|
|
@@ -4939,7 +4963,7 @@ var SCActivityCalendar = ({
|
|
|
4939
4963
|
slotProps: { toolbar: { hidden: true }, actionBar: { actions: [] } },
|
|
4940
4964
|
sx: {
|
|
4941
4965
|
"& .MuiDateCalendar-root": {
|
|
4942
|
-
width: "
|
|
4966
|
+
width: "97.5%",
|
|
4943
4967
|
maxWidth: "unset",
|
|
4944
4968
|
margin: 0,
|
|
4945
4969
|
padding: "0px 16px"
|
|
@@ -4955,7 +4979,36 @@ var SCActivityCalendar = ({
|
|
|
4955
4979
|
},
|
|
4956
4980
|
onChange: (newValue) => setFecha(newValue)
|
|
4957
4981
|
}
|
|
4958
|
-
), /* @__PURE__ */ import_react50.default.createElement(import_Grid9.default, { container: true, justifyContent: "center" }, /* @__PURE__ */ import_react50.default.createElement(import_material34.IconButton, { "data-testid": "close-calendar-button", onClick: toggleCalendar(false) }, /* @__PURE__ */ import_react50.default.createElement(import_KeyboardDoubleArrowUp2.default, { color: "action" }))))), /* @__PURE__ */ import_react50.default.createElement(import_material34.
|
|
4982
|
+
), /* @__PURE__ */ import_react50.default.createElement(import_Grid9.default, { container: true, justifyContent: "center" }, /* @__PURE__ */ import_react50.default.createElement(import_material34.IconButton, { "data-testid": "close-calendar-button", onClick: toggleCalendar(false) }, /* @__PURE__ */ import_react50.default.createElement(import_KeyboardDoubleArrowUp2.default, { color: "action" }))))), /* @__PURE__ */ import_react50.default.createElement(import_material34.IconButton, { onClick: handleClickPopoverFiltro, sx: { position: "fixed", right: "calc(100% - 96%)", top: openCalendar == false ? "197px" : "357px" } }, /* @__PURE__ */ import_react50.default.createElement(import_FilterList.default, { color: "action" })), /* @__PURE__ */ import_react50.default.createElement(
|
|
4983
|
+
import_material34.Popover,
|
|
4984
|
+
{
|
|
4985
|
+
open: openPopoverFiltro,
|
|
4986
|
+
anchorEl: anchorPopoverFiltro,
|
|
4987
|
+
onClose: handleClosePopoverFiltro,
|
|
4988
|
+
anchorOrigin: {
|
|
4989
|
+
vertical: "bottom",
|
|
4990
|
+
horizontal: "right"
|
|
4991
|
+
}
|
|
4992
|
+
},
|
|
4993
|
+
/* @__PURE__ */ import_react50.default.createElement(
|
|
4994
|
+
import_material34.Menu,
|
|
4995
|
+
{
|
|
4996
|
+
id: "basic-menu",
|
|
4997
|
+
anchorEl: anchorPopoverFiltro,
|
|
4998
|
+
open: openPopoverFiltro,
|
|
4999
|
+
onClose: handleClosePopoverFiltro,
|
|
5000
|
+
slotProps: {
|
|
5001
|
+
list: {
|
|
5002
|
+
"aria-labelledby": "basic-button"
|
|
5003
|
+
}
|
|
5004
|
+
}
|
|
5005
|
+
},
|
|
5006
|
+
/* @__PURE__ */ import_react50.default.createElement(import_material34.MenuItem, { onClick: (event2) => filtrarActividad(event2, "Todo") }, /* @__PURE__ */ import_react50.default.createElement(import_material34.ListItemIcon, null, /* @__PURE__ */ import_react50.default.createElement(import_CalendarMonthOutlined.default, { fontSize: "small" })), /* @__PURE__ */ import_react50.default.createElement(import_material34.Typography, { variant: "inherit" }, "Ver todo")),
|
|
5007
|
+
/* @__PURE__ */ import_react50.default.createElement(import_material34.MenuItem, { onClick: (event2) => filtrarActividad(event2, "Finalizada") }, /* @__PURE__ */ import_react50.default.createElement(import_material34.ListItemIcon, null, /* @__PURE__ */ import_react50.default.createElement(import_CheckCircleOutlineOutlined.default, { fontSize: "small" })), /* @__PURE__ */ import_react50.default.createElement(import_material34.Typography, { variant: "inherit" }, "Ver finalizadas")),
|
|
5008
|
+
/* @__PURE__ */ import_react50.default.createElement(import_material34.MenuItem, { onClick: (event2) => filtrarActividad(event2, "Aplazada") }, /* @__PURE__ */ import_react50.default.createElement(import_material34.ListItemIcon, null, /* @__PURE__ */ import_react50.default.createElement(import_EventBusyOutlined.default, { fontSize: "small" })), /* @__PURE__ */ import_react50.default.createElement(import_material34.Typography, { variant: "inherit" }, "Ver aplazadas")),
|
|
5009
|
+
/* @__PURE__ */ import_react50.default.createElement(import_material34.MenuItem, { onClick: (event2) => filtrarActividad(event2, "En progreso") }, /* @__PURE__ */ import_react50.default.createElement(import_material34.ListItemIcon, null, /* @__PURE__ */ import_react50.default.createElement(import_PendingOutlined.default, { fontSize: "small" })), /* @__PURE__ */ import_react50.default.createElement(import_material34.Typography, { variant: "inherit" }, "Ver en progreso"))
|
|
5010
|
+
)
|
|
5011
|
+
), /* @__PURE__ */ import_react50.default.createElement(import_material34.Box, { 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__ */ import_react50.default.createElement(
|
|
4959
5012
|
import_material34.Box,
|
|
4960
5013
|
{
|
|
4961
5014
|
key: dayIndex
|
|
@@ -4972,7 +5025,7 @@ var SCActivityCalendar = ({
|
|
|
4972
5025
|
flexDirection: "column"
|
|
4973
5026
|
} }, (() => {
|
|
4974
5027
|
const esDomingo = day.getDay() === 0;
|
|
4975
|
-
const eventosDelDia =
|
|
5028
|
+
const eventosDelDia = datosEventos.filter(
|
|
4976
5029
|
(event2) => new Date(event2.date).toDateString() === day.toDateString()
|
|
4977
5030
|
);
|
|
4978
5031
|
if (eventosDelDia.length > 0) {
|
|
@@ -5067,15 +5120,18 @@ var import_icons_material13 = require("@mui/icons-material");
|
|
|
5067
5120
|
var import_PhotoCamera = __toESM(require("@mui/icons-material/PhotoCamera"), 1);
|
|
5068
5121
|
var import_CancelOutlined = __toESM(require("@mui/icons-material/CancelOutlined"), 1);
|
|
5069
5122
|
var import_ImageOutlined = __toESM(require("@mui/icons-material/ImageOutlined"), 1);
|
|
5123
|
+
var import_FileDownloadOutlined = __toESM(require("@mui/icons-material/FileDownloadOutlined"), 1);
|
|
5070
5124
|
var AttachmentMobile = ({
|
|
5071
5125
|
buttonAttachment,
|
|
5072
5126
|
maxSize = 400,
|
|
5073
5127
|
fileAccepted = "",
|
|
5074
5128
|
initialFiles,
|
|
5075
5129
|
deleteAction,
|
|
5076
|
-
|
|
5130
|
+
downloadAction,
|
|
5077
5131
|
onChange,
|
|
5078
|
-
|
|
5132
|
+
children,
|
|
5133
|
+
sx,
|
|
5134
|
+
view = "button"
|
|
5079
5135
|
}) => {
|
|
5080
5136
|
const webcamRef = (0, import_react52.useRef)(null);
|
|
5081
5137
|
const [abrirCamara, setAbrirCamara] = (0, import_react52.useState)(false);
|
|
@@ -5247,14 +5303,14 @@ var AttachmentMobile = ({
|
|
|
5247
5303
|
setFiles(initialFiles);
|
|
5248
5304
|
}
|
|
5249
5305
|
}, []);
|
|
5250
|
-
return /* @__PURE__ */ import_react52.default.createElement(import_system.Box, { display: "flex", flexDirection: "column", gap: 1 }, /* @__PURE__ */ import_react52.default.createElement(import_system.Box, { display: "flex", width: "100%", justifyContent: "space-between", alignItems: "center", sx }, children, /* @__PURE__ */ import_react52.default.createElement(
|
|
5306
|
+
return /* @__PURE__ */ import_react52.default.createElement(import_system.Box, { display: "flex", flexDirection: "column", gap: 1 }, view == "button" ? /* @__PURE__ */ import_react52.default.createElement(import_system.Box, { display: "flex", width: "100%", justifyContent: "space-between", alignItems: "center", sx }, children, /* @__PURE__ */ import_react52.default.createElement(
|
|
5251
5307
|
AttachmentButton,
|
|
5252
5308
|
{
|
|
5253
5309
|
buttonAttachment,
|
|
5254
5310
|
open,
|
|
5255
5311
|
setOpen
|
|
5256
5312
|
}
|
|
5257
|
-
)), /* @__PURE__ */ import_react52.default.createElement(import_CssBaseline.default, null), /* @__PURE__ */ import_react52.default.createElement(
|
|
5313
|
+
)) : "", /* @__PURE__ */ import_react52.default.createElement(import_CssBaseline.default, null), /* @__PURE__ */ import_react52.default.createElement(
|
|
5258
5314
|
import_material36.SwipeableDrawer,
|
|
5259
5315
|
{
|
|
5260
5316
|
slotProps: {
|
|
@@ -5419,7 +5475,17 @@ var AttachmentMobile = ({
|
|
|
5419
5475
|
},
|
|
5420
5476
|
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}`
|
|
5421
5477
|
))),
|
|
5422
|
-
/* @__PURE__ */ import_react52.default.createElement(import_material36.Tooltip, { title: "
|
|
5478
|
+
view == "file" ? /* @__PURE__ */ import_react52.default.createElement(import_material36.Tooltip, { title: "Descargar" }, /* @__PURE__ */ import_react52.default.createElement(
|
|
5479
|
+
import_material36.IconButton,
|
|
5480
|
+
{
|
|
5481
|
+
size: "small",
|
|
5482
|
+
onClick: () => downloadAction == null ? void 0 : downloadAction(file),
|
|
5483
|
+
disabled: file.uploadError,
|
|
5484
|
+
"aria-label": `Descargar ${file.name}`
|
|
5485
|
+
},
|
|
5486
|
+
/* @__PURE__ */ import_react52.default.createElement(import_FileDownloadOutlined.default, { fontSize: "small", color: "action" })
|
|
5487
|
+
)) : "",
|
|
5488
|
+
view == "button" ? /* @__PURE__ */ import_react52.default.createElement(import_material36.Tooltip, { title: "Eliminar" }, /* @__PURE__ */ import_react52.default.createElement(
|
|
5423
5489
|
import_material36.IconButton,
|
|
5424
5490
|
{
|
|
5425
5491
|
size: "small",
|
|
@@ -5427,7 +5493,7 @@ var AttachmentMobile = ({
|
|
|
5427
5493
|
"aria-label": `Eliminar ${file.name}`
|
|
5428
5494
|
},
|
|
5429
5495
|
/* @__PURE__ */ import_react52.default.createElement(import_icons_material13.DeleteOutline, { fontSize: "small", color: "action" })
|
|
5430
|
-
))
|
|
5496
|
+
)) : ""
|
|
5431
5497
|
))
|
|
5432
5498
|
));
|
|
5433
5499
|
};
|