componentes-sinco 1.0.36-rc.1 → 1.0.36-rc.2
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 +117 -110
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +13 -13
- package/dist/index.d.ts +13 -13
- package/dist/index.js +147 -140
- package/dist/index.js.map +1 -1
- package/package.json +2 -1
package/dist/index.cjs
CHANGED
|
@@ -386,14 +386,6 @@ var SCModal = ({
|
|
|
386
386
|
const handleToggle = (0, import_react4.useCallback)(() => setModalOpen((prev) => !prev), [setModalOpen]);
|
|
387
387
|
const handleClose = (0, import_react4.useCallback)(() => setModalOpen(false), [setModalOpen]);
|
|
388
388
|
const Icon = (0, import_react4.useMemo)(() => getIconComponent(buttonModal == null ? void 0 : buttonModal.icon), [buttonModal == null ? void 0 : buttonModal.icon]);
|
|
389
|
-
const prevAction = (0, import_react4.useMemo)(
|
|
390
|
-
() => action != null ? action : [
|
|
391
|
-
{ text: "Cancelar", fn: handleClose },
|
|
392
|
-
{ text: "Consultar", fn: () => {
|
|
393
|
-
} }
|
|
394
|
-
],
|
|
395
|
-
[action, handleClose]
|
|
396
|
-
);
|
|
397
389
|
const { icon, defaultDescription } = modalStateConfig[state];
|
|
398
390
|
return /* @__PURE__ */ import_react4.default.createElement(import_react4.default.Fragment, null, buttonModal && /* @__PURE__ */ import_react4.default.createElement(
|
|
399
391
|
import_material2.Button,
|
|
@@ -2298,6 +2290,7 @@ var DrawerActions = ({ actions, anchor }) => {
|
|
|
2298
2290
|
padding: "8px 12px",
|
|
2299
2291
|
height: "42px",
|
|
2300
2292
|
alignItems: "center",
|
|
2293
|
+
flexWrap: "nowrap",
|
|
2301
2294
|
justifyContent: actions.length > 1 ? "space-between" : anchor !== "right" ? "flex-end" : "flex-start",
|
|
2302
2295
|
flexDirection: anchor !== "right" ? "row-reverse" : "row"
|
|
2303
2296
|
},
|
|
@@ -2309,7 +2302,8 @@ var DrawerActions = ({ actions, anchor }) => {
|
|
|
2309
2302
|
color: "primary",
|
|
2310
2303
|
onClick: btn.fn,
|
|
2311
2304
|
disabled: btn.disabled || false,
|
|
2312
|
-
size: "small"
|
|
2305
|
+
size: "small",
|
|
2306
|
+
fullWidth: anchor === "bottom" ? true : false
|
|
2313
2307
|
},
|
|
2314
2308
|
btn.text
|
|
2315
2309
|
))
|
|
@@ -2324,14 +2318,16 @@ var import_Close = __toESM(require("@mui/icons-material/Close"), 1);
|
|
|
2324
2318
|
var DrawerHeader = ({
|
|
2325
2319
|
title,
|
|
2326
2320
|
colorTitle,
|
|
2327
|
-
onClose
|
|
2321
|
+
onClose,
|
|
2322
|
+
anchor
|
|
2328
2323
|
}) => {
|
|
2329
2324
|
return /* @__PURE__ */ import_react19.default.createElement(
|
|
2330
2325
|
import_Grid3.default,
|
|
2331
2326
|
{
|
|
2332
2327
|
container: true,
|
|
2333
2328
|
sx: {
|
|
2334
|
-
|
|
2329
|
+
marginTop: anchor == "bottom" ? "16px" : "0px",
|
|
2330
|
+
backgroundColor: anchor == "bottom" ? "white" : "primary.50",
|
|
2335
2331
|
alignItems: "center",
|
|
2336
2332
|
height: "42px",
|
|
2337
2333
|
textAlign: "left",
|
|
@@ -2479,7 +2475,8 @@ function SCDrawer({
|
|
|
2479
2475
|
{
|
|
2480
2476
|
title,
|
|
2481
2477
|
colorTitle,
|
|
2482
|
-
onClose: handleDrawerClose
|
|
2478
|
+
onClose: handleDrawerClose,
|
|
2479
|
+
anchor
|
|
2483
2480
|
}
|
|
2484
2481
|
), /* @__PURE__ */ import_react20.default.createElement(DrawerContent, { arrayElements }), /* @__PURE__ */ import_react20.default.createElement(DrawerActions, { actions: drawerActions, anchor }))
|
|
2485
2482
|
));
|
|
@@ -3291,6 +3288,8 @@ var EmptyState = ({
|
|
|
3291
3288
|
var import_react33 = __toESM(require("react"), 1);
|
|
3292
3289
|
var import_material20 = require("@mui/material");
|
|
3293
3290
|
var import_Grid6 = __toESM(require("@mui/material/Grid"), 1);
|
|
3291
|
+
var import_ToggleButton = __toESM(require("@mui/material/ToggleButton"), 1);
|
|
3292
|
+
var import_ToggleButtonGroup = __toESM(require("@mui/material/ToggleButtonGroup"), 1);
|
|
3294
3293
|
var import_Close2 = __toESM(require("@mui/icons-material/Close"), 1);
|
|
3295
3294
|
var Muicon5 = __toESM(require("@mui/icons-material"), 1);
|
|
3296
3295
|
var SCDialog = ({ title, iconTitle, subtitle, content, actions, buttonDialog, disableClose, dividers, widthContent, heightContent, background, typeView = "web", setShow, show }) => {
|
|
@@ -3367,7 +3366,7 @@ var SCDialog = ({ title, iconTitle, subtitle, content, actions, buttonDialog, di
|
|
|
3367
3366
|
}
|
|
3368
3367
|
}
|
|
3369
3368
|
},
|
|
3370
|
-
title && /* @__PURE__ */ import_react33.default.createElement(import_material20.DialogTitle, { sx: { m: 0, padding: "8px 16px 8px 16px" }, "data-testid": "dialog-icon-title" }, /* @__PURE__ */ import_react33.default.createElement(import_Grid6.default, { container: true, size: 12, sx: { justifyContent: "space-between", flexWrap: "nowrap" } }, /* @__PURE__ */ import_react33.default.createElement(import_Grid6.default, { container: true, size: 11, sx: { alignItems: "center" } }, iconTitle ? iconTitleValidation == "image" ? /* @__PURE__ */ import_react33.default.createElement(import_material20.Box, { sx: { marginRight: "16px", width: "44px", height: "44px", borderRadius: "1px" } }, /* @__PURE__ */ import_react33.default.createElement("img", { src: IconTitle, width: "44px", height: "44px" })) : /* @__PURE__ */ import_react33.default.createElement(import_material20.SvgIcon, { color: "action", fontSize: "small", component: IconTitle, sx: { marginRight: "16px" } }) : "", /* @__PURE__ */ import_react33.default.createElement(import_Grid6.default,
|
|
3369
|
+
title && /* @__PURE__ */ import_react33.default.createElement(import_material20.DialogTitle, { sx: { m: 0, padding: "8px 16px 8px 16px" }, "data-testid": "dialog-icon-title" }, /* @__PURE__ */ import_react33.default.createElement(import_Grid6.default, { container: true, size: 12, sx: { justifyContent: "space-between", flexWrap: "nowrap" } }, /* @__PURE__ */ import_react33.default.createElement(import_Grid6.default, { container: true, size: 11, sx: { alignItems: "center" } }, iconTitle ? iconTitleValidation == "image" ? /* @__PURE__ */ import_react33.default.createElement(import_material20.Box, { sx: { marginRight: "16px", width: "44px", height: "44px", borderRadius: "1px" } }, /* @__PURE__ */ import_react33.default.createElement("img", { src: IconTitle, width: "44px", height: "44px" })) : /* @__PURE__ */ import_react33.default.createElement(import_material20.SvgIcon, { color: "action", fontSize: "small", component: IconTitle, sx: { marginRight: "16px" } }) : "", /* @__PURE__ */ import_react33.default.createElement(import_Grid6.default, { sx: { width: "98%" } }, /* @__PURE__ */ import_react33.default.createElement(import_material20.Typography, { color: "text.primary", variant: "h6", gutterBottom: true }, title ? title : ""), subtitle ? subtitle : "")), disableClose != true ? /* @__PURE__ */ import_react33.default.createElement(import_material20.IconButton, { "data-testid": "close-dialog-button", onClick: handleClose, size: "small", color: "default", sx: { height: 22, width: 22 } }, /* @__PURE__ */ import_react33.default.createElement(import_Close2.default, { color: "action" })) : "")),
|
|
3371
3370
|
/* @__PURE__ */ import_react33.default.createElement(
|
|
3372
3371
|
import_material20.DialogContent,
|
|
3373
3372
|
{
|
|
@@ -3391,7 +3390,7 @@ var SCDialog = ({ title, iconTitle, subtitle, content, actions, buttonDialog, di
|
|
|
3391
3390
|
case "extra-large":
|
|
3392
3391
|
return { xs: "84vw", md: "93vw" };
|
|
3393
3392
|
default:
|
|
3394
|
-
return { xs: "
|
|
3393
|
+
return { xs: "100% !important", md: "100% !important" };
|
|
3395
3394
|
}
|
|
3396
3395
|
})
|
|
3397
3396
|
}
|
|
@@ -3406,7 +3405,7 @@ var SCDialog = ({ title, iconTitle, subtitle, content, actions, buttonDialog, di
|
|
|
3406
3405
|
}
|
|
3407
3406
|
) : content.component
|
|
3408
3407
|
),
|
|
3409
|
-
dialogActions != void 0 && dialogActions != false ? Array.isArray(dialogActions) && (dialogActions == null ? void 0 : dialogActions.length) > 0 ? /* @__PURE__ */ import_react33.default.createElement(import_material20.DialogActions, { sx: { gap: 1, m: 0, padding: "12px 16px 12px 16px", justifyContent: dialogActions.length >= 3 ? "space-between" : "flex-end" } }, dialogActions.length >= 3 ? /* @__PURE__ */ import_react33.default.createElement(import_react33.default.Fragment, null, /* @__PURE__ */ import_react33.default.createElement(
|
|
3408
|
+
dialogActions != void 0 && dialogActions != false ? Array.isArray(dialogActions) && (dialogActions == null ? void 0 : dialogActions.length) > 0 ? /* @__PURE__ */ import_react33.default.createElement(import_material20.DialogActions, { sx: { gap: 1, m: 0, padding: "12px 16px 12px 16px", justifyContent: dialogActions.length >= 3 ? "space-between" : "flex-end" } }, typeView !== "mobile" ? /* @__PURE__ */ import_react33.default.createElement(import_react33.default.Fragment, null, dialogActions.length >= 3 ? /* @__PURE__ */ import_react33.default.createElement(import_react33.default.Fragment, null, /* @__PURE__ */ import_react33.default.createElement(
|
|
3410
3409
|
import_material20.Button,
|
|
3411
3410
|
{
|
|
3412
3411
|
variant: "text",
|
|
@@ -3445,7 +3444,10 @@ var SCDialog = ({ title, iconTitle, subtitle, content, actions, buttonDialog, di
|
|
|
3445
3444
|
},
|
|
3446
3445
|
boton.text
|
|
3447
3446
|
);
|
|
3448
|
-
})) : "" : ""
|
|
3447
|
+
})) : /* @__PURE__ */ import_react33.default.createElement(import_material20.Box, { sx: { width: "100%", display: "flex", flexDirection: "row", justifyContent: "center" } }, /* @__PURE__ */ import_react33.default.createElement(import_ToggleButtonGroup.default, { size: "large", fullWidth: true }, dialogActions.map((boton, index) => {
|
|
3448
|
+
var _a;
|
|
3449
|
+
return /* @__PURE__ */ import_react33.default.createElement(import_ToggleButton.default, { fullWidth: boton.text ? true : false, size: "medium", value: "text", onClick: boton.fn }, (_a = boton.text) != null ? _a : /* @__PURE__ */ import_react33.default.createElement(import_material20.SvgIcon, { fontSize: "small", component: boton.icon }));
|
|
3450
|
+
})))) : "" : ""
|
|
3449
3451
|
)));
|
|
3450
3452
|
};
|
|
3451
3453
|
|
|
@@ -3453,42 +3455,48 @@ var SCDialog = ({ title, iconTitle, subtitle, content, actions, buttonDialog, di
|
|
|
3453
3455
|
var import_react34 = __toESM(require("react"), 1);
|
|
3454
3456
|
var import_material21 = require("@mui/material");
|
|
3455
3457
|
var import_Grid7 = __toESM(require("@mui/material/Grid"), 1);
|
|
3458
|
+
var import_Avatar = __toESM(require("@mui/material/Avatar"), 1);
|
|
3456
3459
|
var Muicon6 = __toESM(require("@mui/icons-material"), 1);
|
|
3457
|
-
var SCListContent = ({ options }) => {
|
|
3460
|
+
var SCListContent = ({ options, iconLeftType = "Icon", iconRightType = "Icon" }) => {
|
|
3458
3461
|
const [selectedIndex, setSelectedIndex] = import_react34.default.useState("1");
|
|
3459
3462
|
const [value, setValue] = import_react34.default.useState("1");
|
|
3460
3463
|
options.map(function(option, index, array) {
|
|
3461
3464
|
if (option == null ? void 0 : option.iconLeft) {
|
|
3462
3465
|
if ((option == null ? void 0 : option.iconLeft.type) == void 0) {
|
|
3463
|
-
|
|
3464
|
-
|
|
3465
|
-
|
|
3466
|
+
const found = Muicon6[option == null ? void 0 : option.iconLeft];
|
|
3467
|
+
if (found != void 0) {
|
|
3468
|
+
option.iconLeft = Muicon6[option == null ? void 0 : option.iconLeft];
|
|
3469
|
+
}
|
|
3466
3470
|
}
|
|
3467
3471
|
}
|
|
3468
3472
|
if (option == null ? void 0 : option.iconRight) {
|
|
3469
3473
|
if ((option == null ? void 0 : option.iconRight.type) == void 0) {
|
|
3470
|
-
|
|
3471
|
-
|
|
3472
|
-
|
|
3474
|
+
const found = Muicon6[option == null ? void 0 : option.iconRight];
|
|
3475
|
+
if (found != void 0) {
|
|
3476
|
+
option.iconRight = Muicon6[option == null ? void 0 : option.iconRight];
|
|
3477
|
+
}
|
|
3473
3478
|
}
|
|
3474
3479
|
}
|
|
3475
3480
|
});
|
|
3476
|
-
return /* @__PURE__ */ import_react34.default.createElement(import_react34.default.Fragment, null, /* @__PURE__ */ import_react34.default.createElement(import_material21.List, { sx: { width: "100%", maxWidth: 360, bgcolor: "background.paper", padding: "0px !important" } }, options.map((option, index) =>
|
|
3477
|
-
|
|
3478
|
-
{
|
|
3479
|
-
|
|
3480
|
-
onClick: option.fn
|
|
3481
|
-
},
|
|
3482
|
-
option.iconLeft ? /* @__PURE__ */ import_react34.default.createElement(import_material21.ListItemIcon, { sx: { minWidth: "30px !important" } }, /* @__PURE__ */ import_react34.default.createElement(import_material21.SvgIcon, { fontSize: "small", color: option.iconLeftColor || "action", component: option.iconLeft })) : "",
|
|
3483
|
-
/* @__PURE__ */ import_react34.default.createElement(
|
|
3484
|
-
import_material21.ListItemText,
|
|
3481
|
+
return /* @__PURE__ */ import_react34.default.createElement(import_react34.default.Fragment, null, /* @__PURE__ */ import_react34.default.createElement(import_material21.List, { sx: { width: "100%", maxWidth: 360, bgcolor: "background.paper", padding: "0px !important" } }, options.map((option, index) => {
|
|
3482
|
+
var _a, _b;
|
|
3483
|
+
return /* @__PURE__ */ import_react34.default.createElement(import_react34.default.Fragment, { key: index }, /* @__PURE__ */ import_react34.default.createElement(
|
|
3484
|
+
import_material21.ListItemButton,
|
|
3485
3485
|
{
|
|
3486
|
-
|
|
3487
|
-
|
|
3488
|
-
}
|
|
3489
|
-
|
|
3490
|
-
|
|
3491
|
-
|
|
3486
|
+
disabled: option.disable,
|
|
3487
|
+
onClick: option.fn
|
|
3488
|
+
},
|
|
3489
|
+
option.iconLeft ? iconLeftType == "Icon" ? /* @__PURE__ */ import_react34.default.createElement(import_material21.ListItemIcon, { sx: { minWidth: "0px !important", marginRight: "8px" } }, /* @__PURE__ */ import_react34.default.createElement(import_material21.SvgIcon, { fontSize: "small", color: option.iconLeftColor || "action", component: option.iconLeft })) : /* @__PURE__ */ import_react34.default.createElement(import_Avatar.default, null, ((_a = option.iconLeft) == null ? void 0 : _a.type) != void 0 ? /* @__PURE__ */ import_react34.default.createElement(import_material21.SvgIcon, { fontSize: "small", color: option.iconLeftColor || "action", component: option.iconLeft }) : option.iconLeft) : "",
|
|
3490
|
+
/* @__PURE__ */ import_react34.default.createElement(
|
|
3491
|
+
import_material21.ListItemText,
|
|
3492
|
+
{
|
|
3493
|
+
primary: option.title,
|
|
3494
|
+
secondary: /* @__PURE__ */ import_react34.default.createElement(import_Grid7.default, { gap: 0.5 }, /* @__PURE__ */ import_react34.default.createElement(import_Grid7.default, { container: true, gap: 0.5 }, option.subtitle), /* @__PURE__ */ import_react34.default.createElement(import_Grid7.default, { container: true, gap: 0.5 }, option.description))
|
|
3495
|
+
}
|
|
3496
|
+
),
|
|
3497
|
+
option.iconRight ? iconRightType == "Icon" ? /* @__PURE__ */ import_react34.default.createElement(import_material21.ListItemIcon, { sx: { minWidth: "0px !important", marginRight: "8px" } }, /* @__PURE__ */ import_react34.default.createElement(import_material21.SvgIcon, { fontSize: "small", color: option.iconRightColor || "action", component: option.iconRight })) : /* @__PURE__ */ import_react34.default.createElement(import_Avatar.default, null, ((_b = option.iconRight) == null ? void 0 : _b.type) != void 0 ? /* @__PURE__ */ import_react34.default.createElement(import_material21.SvgIcon, { fontSize: "small", color: option.iconRightColor || "action", component: option.iconRight }) : option.iconRight) : ""
|
|
3498
|
+
), option.divider == true ? /* @__PURE__ */ import_react34.default.createElement(import_material21.Divider, null) : "");
|
|
3499
|
+
})));
|
|
3492
3500
|
};
|
|
3493
3501
|
|
|
3494
3502
|
// src/Components/SCMenu.tsx
|
|
@@ -4203,7 +4211,7 @@ var import_dayjs6 = __toESM(require("dayjs"), 1);
|
|
|
4203
4211
|
var import_localeData2 = __toESM(require("dayjs/plugin/localeData"), 1);
|
|
4204
4212
|
import_dayjs6.default.extend(import_localeData2.default);
|
|
4205
4213
|
var WeekView = ({
|
|
4206
|
-
events
|
|
4214
|
+
events,
|
|
4207
4215
|
currentDate,
|
|
4208
4216
|
isLoading,
|
|
4209
4217
|
onDayClick,
|
|
@@ -4212,11 +4220,7 @@ var WeekView = ({
|
|
|
4212
4220
|
startHour = 0,
|
|
4213
4221
|
endHour = 23
|
|
4214
4222
|
}) => {
|
|
4215
|
-
const
|
|
4216
|
-
start: (0, import_dayjs6.default)(e.start),
|
|
4217
|
-
end: (0, import_dayjs6.default)(e.end)
|
|
4218
|
-
}));
|
|
4219
|
-
const noEvents = normalizedEvents.length === 0;
|
|
4223
|
+
const noEvents = events.length === 0;
|
|
4220
4224
|
const todayString = (0, import_dayjs6.default)().format("YYYY-MM-DD");
|
|
4221
4225
|
const startOfWeek3 = currentDate.startOf("week");
|
|
4222
4226
|
const days = Array.from({ length: 7 }, (_, i) => startOfWeek3.add(i, "day"));
|
|
@@ -4266,74 +4270,77 @@ var WeekView = ({
|
|
|
4266
4270
|
subtitle: "Selecciona un mec\xE1nico y as\xEDgnale las actividades a realizar.",
|
|
4267
4271
|
icon: /* @__PURE__ */ import_react44.default.createElement(LogoCalendario, null)
|
|
4268
4272
|
}
|
|
4269
|
-
) :
|
|
4270
|
-
|
|
4271
|
-
{
|
|
4272
|
-
key: h,
|
|
4273
|
-
height: 60,
|
|
4274
|
-
textAlign: "right",
|
|
4275
|
-
pr: 1,
|
|
4276
|
-
borderColor: "divider"
|
|
4277
|
-
},
|
|
4278
|
-
/* @__PURE__ */ import_react44.default.createElement(import_material29.Typography, { variant: "caption", color: "text.secondary" }, (0, import_dayjs6.default)().hour(h).format("h A"))
|
|
4279
|
-
))), days.map((day) => {
|
|
4280
|
-
const dayEvents = normalizedEvents.filter(
|
|
4281
|
-
(event2) => day.isBetween(event2.start.startOf("day"), event2.end.endOf("day"), null, "[]")
|
|
4282
|
-
).filter((event2) => {
|
|
4283
|
-
const startsInRange = event2.start.hour() >= startHour && event2.start.hour() <= endHour;
|
|
4284
|
-
const endsInRange = event2.end.hour() >= startHour && event2.end.hour() <= endHour;
|
|
4285
|
-
return startsInRange || endsInRange;
|
|
4286
|
-
}).sort((a, b) => a.start.valueOf() - b.start.valueOf());
|
|
4287
|
-
return /* @__PURE__ */ import_react44.default.createElement(
|
|
4273
|
+
) : (
|
|
4274
|
+
// Grid de horas y eventos
|
|
4275
|
+
/* @__PURE__ */ import_react44.default.createElement(import_material29.Box, { display: "flex", flex: 1 }, /* @__PURE__ */ import_react44.default.createElement(import_material29.Box, { width: 45, bgcolor: "transparent" }, hours.map((h) => /* @__PURE__ */ import_react44.default.createElement(
|
|
4288
4276
|
import_material29.Box,
|
|
4289
4277
|
{
|
|
4290
|
-
key:
|
|
4291
|
-
|
|
4292
|
-
|
|
4293
|
-
|
|
4294
|
-
|
|
4295
|
-
"data-testid": `week-day-column-${day.format("YYYY-MM-DD")}`,
|
|
4296
|
-
onClick: () => onDayClick == null ? void 0 : onDayClick(day)
|
|
4278
|
+
key: h,
|
|
4279
|
+
height: 60,
|
|
4280
|
+
textAlign: "right",
|
|
4281
|
+
pr: 1,
|
|
4282
|
+
borderColor: "divider"
|
|
4297
4283
|
},
|
|
4298
|
-
|
|
4299
|
-
|
|
4300
|
-
|
|
4301
|
-
|
|
4302
|
-
|
|
4303
|
-
|
|
4304
|
-
|
|
4305
|
-
|
|
4306
|
-
|
|
4307
|
-
|
|
4308
|
-
|
|
4309
|
-
|
|
4310
|
-
|
|
4311
|
-
|
|
4312
|
-
|
|
4313
|
-
|
|
4314
|
-
|
|
4315
|
-
|
|
4316
|
-
|
|
4317
|
-
|
|
4318
|
-
|
|
4319
|
-
|
|
4320
|
-
|
|
4321
|
-
|
|
4322
|
-
|
|
4323
|
-
|
|
4324
|
-
|
|
4325
|
-
|
|
4326
|
-
|
|
4327
|
-
|
|
4328
|
-
right: 4,
|
|
4329
|
-
cursor: "pointer",
|
|
4330
|
-
height: `${durationMinutes}px`
|
|
4284
|
+
/* @__PURE__ */ import_react44.default.createElement(import_material29.Typography, { variant: "caption", color: "text.secondary" }, (0, import_dayjs6.default)().hour(h).format("h A"))
|
|
4285
|
+
))), days.map((day) => {
|
|
4286
|
+
const dayEvents = events.filter(
|
|
4287
|
+
(event2) => day.isBetween(event2.start.startOf("day"), event2.end.endOf("day"), null, "[]")
|
|
4288
|
+
).filter((event2) => {
|
|
4289
|
+
const startsInRange = event2.start.hour() >= startHour && event2.start.hour() <= endHour;
|
|
4290
|
+
const endsInRange = event2.end.hour() >= startHour && event2.end.hour() <= endHour;
|
|
4291
|
+
return startsInRange || endsInRange;
|
|
4292
|
+
}).sort((a, b) => a.start.valueOf() - b.start.valueOf());
|
|
4293
|
+
return /* @__PURE__ */ import_react44.default.createElement(
|
|
4294
|
+
import_material29.Box,
|
|
4295
|
+
{
|
|
4296
|
+
key: day.toString(),
|
|
4297
|
+
flex: 1,
|
|
4298
|
+
borderLeft: "1px solid",
|
|
4299
|
+
borderColor: "divider",
|
|
4300
|
+
position: "relative",
|
|
4301
|
+
"data-testid": `week-day-column-${day.format("YYYY-MM-DD")}`,
|
|
4302
|
+
onClick: () => onDayClick == null ? void 0 : onDayClick(day)
|
|
4303
|
+
},
|
|
4304
|
+
hours.map((hourIdx) => {
|
|
4305
|
+
const borderType = getCellBorderType2(hourIdx, dayEvents);
|
|
4306
|
+
return /* @__PURE__ */ import_react44.default.createElement(
|
|
4307
|
+
import_material29.Box,
|
|
4308
|
+
{
|
|
4309
|
+
key: hourIdx,
|
|
4310
|
+
height: 60,
|
|
4311
|
+
borderTop: "1px solid",
|
|
4312
|
+
borderColor: borderType === "start" || borderType === "full" || borderType === "none" ? "divider" : "transparent",
|
|
4313
|
+
borderBottom: borderType === "end" || borderType === "full" ? "1px solid divider" : void 0
|
|
4331
4314
|
}
|
|
4332
|
-
|
|
4333
|
-
)
|
|
4334
|
-
|
|
4335
|
-
|
|
4336
|
-
|
|
4315
|
+
);
|
|
4316
|
+
}),
|
|
4317
|
+
dayEvents.map((event2) => {
|
|
4318
|
+
const eventStart = day.isSame(event2.start, "day") ? event2.start : day.startOf("day").hour(startHour).minute(0);
|
|
4319
|
+
const eventEnd = day.isSame(event2.end, "day") ? event2.end : day.endOf("day").hour(endHour).minute(59);
|
|
4320
|
+
const startMinutes = (eventStart.hour() - startHour) * 60 + eventStart.minute();
|
|
4321
|
+
const durationMinutes = eventEnd.diff(eventStart, "minute");
|
|
4322
|
+
return /* @__PURE__ */ import_react44.default.createElement(
|
|
4323
|
+
CalendarEventCard,
|
|
4324
|
+
{
|
|
4325
|
+
key: `${event2.id}-${day.toString()}`,
|
|
4326
|
+
event: event2,
|
|
4327
|
+
color: stateColors[event2.state],
|
|
4328
|
+
onClick: () => onEventClick == null ? void 0 : onEventClick(event2, day),
|
|
4329
|
+
onHover: onEventHover,
|
|
4330
|
+
sx: {
|
|
4331
|
+
position: "absolute",
|
|
4332
|
+
top: `${startMinutes}px`,
|
|
4333
|
+
left: 4,
|
|
4334
|
+
right: 4,
|
|
4335
|
+
cursor: "pointer",
|
|
4336
|
+
height: `${durationMinutes}px`
|
|
4337
|
+
}
|
|
4338
|
+
}
|
|
4339
|
+
);
|
|
4340
|
+
})
|
|
4341
|
+
);
|
|
4342
|
+
}))
|
|
4343
|
+
));
|
|
4337
4344
|
};
|
|
4338
4345
|
|
|
4339
4346
|
// src/Components/Calendario/Views/DayView.tsx
|
|
@@ -4848,7 +4855,7 @@ var SCActivityCalendar = ({
|
|
|
4848
4855
|
sx: { fontSize: "12px !important", height: "300px !important", background: background ? background : "white", "& .MuiDayCalendar-header": { justifyContent: "space-between" }, "& .MuiDayCalendar-weekContainer": { justifyContent: "space-between" }, "& .MuiPickersCalendarHeader-root": { paddingLeft: "0px", paddingRight: "0px", color: "#10184099" }, "& .MuiPickersDay-root": { fontSize: "12px !important" }, "& .MuiDayCalendar-weekDayLabel": { fontSize: "12px !important" } },
|
|
4849
4856
|
onChange: (newValue) => setFecha(newValue)
|
|
4850
4857
|
}
|
|
4851
|
-
), /* @__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.Box, { sx: { width: "100%", height: openCalendar ? "calc(91% - 300px)" : "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(
|
|
4858
|
+
), /* @__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.Box, { sx: { padding: "0px 16px", width: "100%", height: openCalendar ? "calc(91% - 300px)" : "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(
|
|
4852
4859
|
import_material34.Box,
|
|
4853
4860
|
{
|
|
4854
4861
|
key: dayIndex
|
|
@@ -4874,7 +4881,7 @@ var SCActivityCalendar = ({
|
|
|
4874
4881
|
{
|
|
4875
4882
|
key: idx,
|
|
4876
4883
|
options: [{
|
|
4877
|
-
title: event2.
|
|
4884
|
+
title: event2.activityDescription,
|
|
4878
4885
|
subtitle: /* @__PURE__ */ import_react50.default.createElement(import_react50.default.Fragment, null, configRangeHour && new Date(event2.date.replace("00:00:00", event2.startTime)).getHours() === new Date(event2.date.replace("00:00:00", configRangeHour.split("-")[0])).getHours() && new Date(event2.date.replace("00:00:00", event2.finalTime)).getHours() === new Date(event2.date.replace("00:00:00", configRangeHour.split("-")[1])).getHours() && new Date(event2.date.replace("00:00:00", event2.startTime)).getMinutes() === new Date(event2.date.replace("00:00:00", configRangeHour.split("-")[0])).getMinutes() && new Date(event2.date.replace("00:00:00", event2.finalTime)).getMinutes() === new Date(event2.date.replace("00:00:00", configRangeHour.split("-")[1])).getMinutes() ? /* @__PURE__ */ import_react50.default.createElement(import_react50.default.Fragment, null, /* @__PURE__ */ import_react50.default.createElement(import_material34.Typography, null, "Todo el dia"), /* @__PURE__ */ import_react50.default.createElement(import_LightModeOutlined.default, { fontSize: "small" })) : /* @__PURE__ */ import_react50.default.createElement(import_react50.default.Fragment, null, /* @__PURE__ */ import_react50.default.createElement(import_material34.Typography, null, new Date(event2.date.replace("00:00:00", event2.startTime)).toLocaleTimeString([], { hour: "2-digit", minute: "2-digit", hour12: true })), /* @__PURE__ */ import_react50.default.createElement(import_ArrowForward.default, { fontSize: "small" }), /* @__PURE__ */ import_react50.default.createElement(import_material34.Typography, null, new Date(event2.date.replace("00:00:00", event2.finalTime)).toLocaleTimeString([], { hour: "2-digit", minute: "2-digit", hour12: true })))),
|
|
4879
4886
|
iconLeftColor: event2.state === "Finalizada" ? "success" : "action",
|
|
4880
4887
|
iconLeft: event2.state === "Finalizada" ? "CheckCircle" : event2.state === "Aplazada" ? "EventBusyOutlined" : event2.state === "En progreso" ? "PendingOutlined" : "RadioButtonUnchecked",
|