componentes-sinco 1.1.11 → 1.1.13
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 +79 -12
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +10 -8
- package/dist/index.d.ts +10 -8
- package/dist/index.js +83 -16
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -4691,7 +4691,7 @@ var SCTime = ({
|
|
|
4691
4691
|
setIsOpenPopover(false);
|
|
4692
4692
|
setAnchorEl(null);
|
|
4693
4693
|
};
|
|
4694
|
-
return /* @__PURE__ */ import_react48.default.createElement(import_LocalizationProvider3.LocalizationProvider, { dateAdapter: import_AdapterDayjs2.AdapterDayjs }, /* @__PURE__ */ import_react48.default.createElement(import_material32.Box, { sx: { position: "relative", width: width
|
|
4694
|
+
return /* @__PURE__ */ import_react48.default.createElement(import_LocalizationProvider3.LocalizationProvider, { dateAdapter: import_AdapterDayjs2.AdapterDayjs }, /* @__PURE__ */ import_react48.default.createElement(import_material32.Box, { sx: { position: "relative", width: width ? `${width}%` : "99%" } }, /* @__PURE__ */ import_react48.default.createElement(
|
|
4695
4695
|
import_TimeField.TimeField,
|
|
4696
4696
|
{
|
|
4697
4697
|
label,
|
|
@@ -4757,7 +4757,7 @@ var SCTime = ({
|
|
|
4757
4757
|
border: "1px solid #e0e0e0",
|
|
4758
4758
|
maxHeight: "300px",
|
|
4759
4759
|
overflow: "visible",
|
|
4760
|
-
width: width
|
|
4760
|
+
width: width ? `calc(${width}% - 15px)` : "97%"
|
|
4761
4761
|
}
|
|
4762
4762
|
}
|
|
4763
4763
|
}
|
|
@@ -4774,6 +4774,7 @@ var SCTime = ({
|
|
|
4774
4774
|
overflow: "auto"
|
|
4775
4775
|
},
|
|
4776
4776
|
"& .MuiMenuItem-root": {
|
|
4777
|
+
minHeight: 24,
|
|
4777
4778
|
fontSize: "0.875rem",
|
|
4778
4779
|
py: 0.5
|
|
4779
4780
|
}
|
|
@@ -4873,6 +4874,11 @@ var import_KeyboardDoubleArrowDown2 = __toESM(require("@mui/icons-material/Keybo
|
|
|
4873
4874
|
var import_KeyboardDoubleArrowUp2 = __toESM(require("@mui/icons-material/KeyboardDoubleArrowUp"), 1);
|
|
4874
4875
|
var import_ArrowForward = __toESM(require("@mui/icons-material/ArrowForward"), 1);
|
|
4875
4876
|
var import_LightModeOutlined = __toESM(require("@mui/icons-material/LightModeOutlined"), 1);
|
|
4877
|
+
var import_FilterList = __toESM(require("@mui/icons-material/FilterList"), 1);
|
|
4878
|
+
var import_CalendarMonthOutlined = __toESM(require("@mui/icons-material/CalendarMonthOutlined"), 1);
|
|
4879
|
+
var import_CheckCircleOutlineOutlined = __toESM(require("@mui/icons-material/CheckCircleOutlineOutlined"), 1);
|
|
4880
|
+
var import_EventBusyOutlined = __toESM(require("@mui/icons-material/EventBusyOutlined"), 1);
|
|
4881
|
+
var import_PendingOutlined = __toESM(require("@mui/icons-material/PendingOutlined"), 1);
|
|
4876
4882
|
var SCActivityCalendar = ({
|
|
4877
4883
|
//informativas
|
|
4878
4884
|
//apariencia
|
|
@@ -4889,6 +4895,9 @@ var SCActivityCalendar = ({
|
|
|
4889
4895
|
const [fechaSeleccionada, setFechaSeleccionada] = (0, import_react50.useState)();
|
|
4890
4896
|
const [stateVal, setstateVal] = import_react50.default.useState(/* @__PURE__ */ new Date());
|
|
4891
4897
|
const [openCalendar, setOpenCalendar] = import_react50.default.useState(false);
|
|
4898
|
+
const [anchorPopoverFiltro, setAnchorPopoverFiltro] = (0, import_react50.useState)(null);
|
|
4899
|
+
const [datosEventos, setDatosEventos] = import_react50.default.useState(events);
|
|
4900
|
+
const openPopoverFiltro = Boolean(anchorPopoverFiltro);
|
|
4892
4901
|
const hoy = /* @__PURE__ */ new Date();
|
|
4893
4902
|
const inicioSemana = (0, import_date_fns2.startOfWeek)(fecha, { weekStartsOn: 0 });
|
|
4894
4903
|
const diasSemana = Array.from({ length: 7 }, (_, i) => (0, import_date_fns2.addDays)(inicioSemana, i));
|
|
@@ -4916,7 +4925,23 @@ var SCActivityCalendar = ({
|
|
|
4916
4925
|
// 0 = domingo, 1 = lunes
|
|
4917
4926
|
})
|
|
4918
4927
|
});
|
|
4919
|
-
|
|
4928
|
+
const handleClickPopoverFiltro = (event2) => {
|
|
4929
|
+
setAnchorPopoverFiltro(event2.currentTarget);
|
|
4930
|
+
};
|
|
4931
|
+
const handleClosePopoverFiltro = () => {
|
|
4932
|
+
setAnchorPopoverFiltro(null);
|
|
4933
|
+
};
|
|
4934
|
+
const filtrarActividad = (event2, filtro) => {
|
|
4935
|
+
if (filtro === "Todo") {
|
|
4936
|
+
setDatosEventos(events);
|
|
4937
|
+
} else {
|
|
4938
|
+
const resultado = events.filter(
|
|
4939
|
+
(item) => item.state === filtro
|
|
4940
|
+
);
|
|
4941
|
+
setDatosEventos(resultado);
|
|
4942
|
+
}
|
|
4943
|
+
};
|
|
4944
|
+
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
4945
|
import_material34.Box,
|
|
4921
4946
|
{
|
|
4922
4947
|
onClick: () => setFecha(dia),
|
|
@@ -4939,7 +4964,7 @@ var SCActivityCalendar = ({
|
|
|
4939
4964
|
slotProps: { toolbar: { hidden: true }, actionBar: { actions: [] } },
|
|
4940
4965
|
sx: {
|
|
4941
4966
|
"& .MuiDateCalendar-root": {
|
|
4942
|
-
width: "
|
|
4967
|
+
width: "97.5%",
|
|
4943
4968
|
maxWidth: "unset",
|
|
4944
4969
|
margin: 0,
|
|
4945
4970
|
padding: "0px 16px"
|
|
@@ -4955,7 +4980,36 @@ var SCActivityCalendar = ({
|
|
|
4955
4980
|
},
|
|
4956
4981
|
onChange: (newValue) => setFecha(newValue)
|
|
4957
4982
|
}
|
|
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.
|
|
4983
|
+
), /* @__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 ? "220px" : "380px" } }, /* @__PURE__ */ import_react50.default.createElement(import_FilterList.default, { color: "action" })), /* @__PURE__ */ import_react50.default.createElement(
|
|
4984
|
+
import_material34.Popover,
|
|
4985
|
+
{
|
|
4986
|
+
open: openPopoverFiltro,
|
|
4987
|
+
anchorEl: anchorPopoverFiltro,
|
|
4988
|
+
onClose: handleClosePopoverFiltro,
|
|
4989
|
+
anchorOrigin: {
|
|
4990
|
+
vertical: "bottom",
|
|
4991
|
+
horizontal: "right"
|
|
4992
|
+
}
|
|
4993
|
+
},
|
|
4994
|
+
/* @__PURE__ */ import_react50.default.createElement(
|
|
4995
|
+
import_material34.Menu,
|
|
4996
|
+
{
|
|
4997
|
+
id: "basic-menu",
|
|
4998
|
+
anchorEl: anchorPopoverFiltro,
|
|
4999
|
+
open: openPopoverFiltro,
|
|
5000
|
+
onClose: handleClosePopoverFiltro,
|
|
5001
|
+
slotProps: {
|
|
5002
|
+
list: {
|
|
5003
|
+
"aria-labelledby": "basic-button"
|
|
5004
|
+
}
|
|
5005
|
+
}
|
|
5006
|
+
},
|
|
5007
|
+
/* @__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")),
|
|
5008
|
+
/* @__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")),
|
|
5009
|
+
/* @__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")),
|
|
5010
|
+
/* @__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"))
|
|
5011
|
+
)
|
|
5012
|
+
), /* @__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
5013
|
import_material34.Box,
|
|
4960
5014
|
{
|
|
4961
5015
|
key: dayIndex
|
|
@@ -4972,7 +5026,7 @@ var SCActivityCalendar = ({
|
|
|
4972
5026
|
flexDirection: "column"
|
|
4973
5027
|
} }, (() => {
|
|
4974
5028
|
const esDomingo = day.getDay() === 0;
|
|
4975
|
-
const eventosDelDia =
|
|
5029
|
+
const eventosDelDia = datosEventos.filter(
|
|
4976
5030
|
(event2) => new Date(event2.date).toDateString() === day.toDateString()
|
|
4977
5031
|
);
|
|
4978
5032
|
if (eventosDelDia.length > 0) {
|
|
@@ -5067,15 +5121,18 @@ var import_icons_material13 = require("@mui/icons-material");
|
|
|
5067
5121
|
var import_PhotoCamera = __toESM(require("@mui/icons-material/PhotoCamera"), 1);
|
|
5068
5122
|
var import_CancelOutlined = __toESM(require("@mui/icons-material/CancelOutlined"), 1);
|
|
5069
5123
|
var import_ImageOutlined = __toESM(require("@mui/icons-material/ImageOutlined"), 1);
|
|
5124
|
+
var import_FileDownloadOutlined = __toESM(require("@mui/icons-material/FileDownloadOutlined"), 1);
|
|
5070
5125
|
var AttachmentMobile = ({
|
|
5071
5126
|
buttonAttachment,
|
|
5072
5127
|
maxSize = 400,
|
|
5073
5128
|
fileAccepted = "",
|
|
5074
5129
|
initialFiles,
|
|
5075
5130
|
deleteAction,
|
|
5076
|
-
|
|
5131
|
+
downloadAction,
|
|
5077
5132
|
onChange,
|
|
5078
|
-
|
|
5133
|
+
children,
|
|
5134
|
+
sx,
|
|
5135
|
+
view = "button"
|
|
5079
5136
|
}) => {
|
|
5080
5137
|
const webcamRef = (0, import_react52.useRef)(null);
|
|
5081
5138
|
const [abrirCamara, setAbrirCamara] = (0, import_react52.useState)(false);
|
|
@@ -5247,14 +5304,14 @@ var AttachmentMobile = ({
|
|
|
5247
5304
|
setFiles(initialFiles);
|
|
5248
5305
|
}
|
|
5249
5306
|
}, []);
|
|
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(
|
|
5307
|
+
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
5308
|
AttachmentButton,
|
|
5252
5309
|
{
|
|
5253
5310
|
buttonAttachment,
|
|
5254
5311
|
open,
|
|
5255
5312
|
setOpen
|
|
5256
5313
|
}
|
|
5257
|
-
)), /* @__PURE__ */ import_react52.default.createElement(import_CssBaseline.default, null), /* @__PURE__ */ import_react52.default.createElement(
|
|
5314
|
+
)) : "", /* @__PURE__ */ import_react52.default.createElement(import_CssBaseline.default, null), /* @__PURE__ */ import_react52.default.createElement(
|
|
5258
5315
|
import_material36.SwipeableDrawer,
|
|
5259
5316
|
{
|
|
5260
5317
|
slotProps: {
|
|
@@ -5419,7 +5476,17 @@ var AttachmentMobile = ({
|
|
|
5419
5476
|
},
|
|
5420
5477
|
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
5478
|
))),
|
|
5422
|
-
/* @__PURE__ */ import_react52.default.createElement(import_material36.Tooltip, { title: "
|
|
5479
|
+
view == "file" ? /* @__PURE__ */ import_react52.default.createElement(import_material36.Tooltip, { title: "Descargar" }, /* @__PURE__ */ import_react52.default.createElement(
|
|
5480
|
+
import_material36.IconButton,
|
|
5481
|
+
{
|
|
5482
|
+
size: "small",
|
|
5483
|
+
onClick: () => downloadAction == null ? void 0 : downloadAction(file),
|
|
5484
|
+
disabled: file.uploadError,
|
|
5485
|
+
"aria-label": `Descargar ${file.name}`
|
|
5486
|
+
},
|
|
5487
|
+
/* @__PURE__ */ import_react52.default.createElement(import_FileDownloadOutlined.default, { fontSize: "small", color: "action" })
|
|
5488
|
+
)) : "",
|
|
5489
|
+
view == "button" ? /* @__PURE__ */ import_react52.default.createElement(import_material36.Tooltip, { title: "Eliminar" }, /* @__PURE__ */ import_react52.default.createElement(
|
|
5423
5490
|
import_material36.IconButton,
|
|
5424
5491
|
{
|
|
5425
5492
|
size: "small",
|
|
@@ -5427,7 +5494,7 @@ var AttachmentMobile = ({
|
|
|
5427
5494
|
"aria-label": `Eliminar ${file.name}`
|
|
5428
5495
|
},
|
|
5429
5496
|
/* @__PURE__ */ import_react52.default.createElement(import_icons_material13.DeleteOutline, { fontSize: "small", color: "action" })
|
|
5430
|
-
))
|
|
5497
|
+
)) : ""
|
|
5431
5498
|
))
|
|
5432
5499
|
));
|
|
5433
5500
|
};
|