componentes-sinco 1.0.36-rc.1 → 1.0.36-rc.3
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 +453 -118
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +44 -15
- package/dist/index.d.ts +44 -15
- package/dist/index.js +479 -145
- package/dist/index.js.map +1 -1
- package/package.json +2 -1
package/dist/index.cjs
CHANGED
|
@@ -82,6 +82,7 @@ __export(index_exports, {
|
|
|
82
82
|
ADCSincoTheme: () => ADCSincoTheme,
|
|
83
83
|
AdproSincoTheme: () => AdproSincoTheme,
|
|
84
84
|
Attachment: () => Attachment,
|
|
85
|
+
AttachmentMobile: () => AttachmentMobile,
|
|
85
86
|
BasicMenu: () => BasicMenu,
|
|
86
87
|
CALENDAR_CONSTANTS: () => CALENDAR_CONSTANTS,
|
|
87
88
|
Calendar: () => Calendar,
|
|
@@ -386,14 +387,6 @@ var SCModal = ({
|
|
|
386
387
|
const handleToggle = (0, import_react4.useCallback)(() => setModalOpen((prev) => !prev), [setModalOpen]);
|
|
387
388
|
const handleClose = (0, import_react4.useCallback)(() => setModalOpen(false), [setModalOpen]);
|
|
388
389
|
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
390
|
const { icon, defaultDescription } = modalStateConfig[state];
|
|
398
391
|
return /* @__PURE__ */ import_react4.default.createElement(import_react4.default.Fragment, null, buttonModal && /* @__PURE__ */ import_react4.default.createElement(
|
|
399
392
|
import_material2.Button,
|
|
@@ -2298,6 +2291,7 @@ var DrawerActions = ({ actions, anchor }) => {
|
|
|
2298
2291
|
padding: "8px 12px",
|
|
2299
2292
|
height: "42px",
|
|
2300
2293
|
alignItems: "center",
|
|
2294
|
+
flexWrap: "nowrap",
|
|
2301
2295
|
justifyContent: actions.length > 1 ? "space-between" : anchor !== "right" ? "flex-end" : "flex-start",
|
|
2302
2296
|
flexDirection: anchor !== "right" ? "row-reverse" : "row"
|
|
2303
2297
|
},
|
|
@@ -2309,7 +2303,8 @@ var DrawerActions = ({ actions, anchor }) => {
|
|
|
2309
2303
|
color: "primary",
|
|
2310
2304
|
onClick: btn.fn,
|
|
2311
2305
|
disabled: btn.disabled || false,
|
|
2312
|
-
size: "small"
|
|
2306
|
+
size: "small",
|
|
2307
|
+
fullWidth: anchor === "bottom" ? true : false
|
|
2313
2308
|
},
|
|
2314
2309
|
btn.text
|
|
2315
2310
|
))
|
|
@@ -2324,14 +2319,16 @@ var import_Close = __toESM(require("@mui/icons-material/Close"), 1);
|
|
|
2324
2319
|
var DrawerHeader = ({
|
|
2325
2320
|
title,
|
|
2326
2321
|
colorTitle,
|
|
2327
|
-
onClose
|
|
2322
|
+
onClose,
|
|
2323
|
+
anchor
|
|
2328
2324
|
}) => {
|
|
2329
2325
|
return /* @__PURE__ */ import_react19.default.createElement(
|
|
2330
2326
|
import_Grid3.default,
|
|
2331
2327
|
{
|
|
2332
2328
|
container: true,
|
|
2333
2329
|
sx: {
|
|
2334
|
-
|
|
2330
|
+
marginTop: anchor == "bottom" ? "16px" : "0px",
|
|
2331
|
+
backgroundColor: anchor == "bottom" ? "white" : "primary.50",
|
|
2335
2332
|
alignItems: "center",
|
|
2336
2333
|
height: "42px",
|
|
2337
2334
|
textAlign: "left",
|
|
@@ -2479,7 +2476,8 @@ function SCDrawer({
|
|
|
2479
2476
|
{
|
|
2480
2477
|
title,
|
|
2481
2478
|
colorTitle,
|
|
2482
|
-
onClose: handleDrawerClose
|
|
2479
|
+
onClose: handleDrawerClose,
|
|
2480
|
+
anchor
|
|
2483
2481
|
}
|
|
2484
2482
|
), /* @__PURE__ */ import_react20.default.createElement(DrawerContent, { arrayElements }), /* @__PURE__ */ import_react20.default.createElement(DrawerActions, { actions: drawerActions, anchor }))
|
|
2485
2483
|
));
|
|
@@ -3291,6 +3289,8 @@ var EmptyState = ({
|
|
|
3291
3289
|
var import_react33 = __toESM(require("react"), 1);
|
|
3292
3290
|
var import_material20 = require("@mui/material");
|
|
3293
3291
|
var import_Grid6 = __toESM(require("@mui/material/Grid"), 1);
|
|
3292
|
+
var import_ToggleButton = __toESM(require("@mui/material/ToggleButton"), 1);
|
|
3293
|
+
var import_ToggleButtonGroup = __toESM(require("@mui/material/ToggleButtonGroup"), 1);
|
|
3294
3294
|
var import_Close2 = __toESM(require("@mui/icons-material/Close"), 1);
|
|
3295
3295
|
var Muicon5 = __toESM(require("@mui/icons-material"), 1);
|
|
3296
3296
|
var SCDialog = ({ title, iconTitle, subtitle, content, actions, buttonDialog, disableClose, dividers, widthContent, heightContent, background, typeView = "web", setShow, show }) => {
|
|
@@ -3367,7 +3367,7 @@ var SCDialog = ({ title, iconTitle, subtitle, content, actions, buttonDialog, di
|
|
|
3367
3367
|
}
|
|
3368
3368
|
}
|
|
3369
3369
|
},
|
|
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,
|
|
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, { 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
3371
|
/* @__PURE__ */ import_react33.default.createElement(
|
|
3372
3372
|
import_material20.DialogContent,
|
|
3373
3373
|
{
|
|
@@ -3391,7 +3391,7 @@ var SCDialog = ({ title, iconTitle, subtitle, content, actions, buttonDialog, di
|
|
|
3391
3391
|
case "extra-large":
|
|
3392
3392
|
return { xs: "84vw", md: "93vw" };
|
|
3393
3393
|
default:
|
|
3394
|
-
return { xs: "
|
|
3394
|
+
return { xs: "100% !important", md: "100% !important" };
|
|
3395
3395
|
}
|
|
3396
3396
|
})
|
|
3397
3397
|
}
|
|
@@ -3406,7 +3406,7 @@ var SCDialog = ({ title, iconTitle, subtitle, content, actions, buttonDialog, di
|
|
|
3406
3406
|
}
|
|
3407
3407
|
) : content.component
|
|
3408
3408
|
),
|
|
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(
|
|
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" } }, 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
3410
|
import_material20.Button,
|
|
3411
3411
|
{
|
|
3412
3412
|
variant: "text",
|
|
@@ -3445,7 +3445,10 @@ var SCDialog = ({ title, iconTitle, subtitle, content, actions, buttonDialog, di
|
|
|
3445
3445
|
},
|
|
3446
3446
|
boton.text
|
|
3447
3447
|
);
|
|
3448
|
-
})) : "" : ""
|
|
3448
|
+
})) : /* @__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) => {
|
|
3449
|
+
var _a;
|
|
3450
|
+
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 }));
|
|
3451
|
+
})))) : "" : ""
|
|
3449
3452
|
)));
|
|
3450
3453
|
};
|
|
3451
3454
|
|
|
@@ -3453,42 +3456,48 @@ var SCDialog = ({ title, iconTitle, subtitle, content, actions, buttonDialog, di
|
|
|
3453
3456
|
var import_react34 = __toESM(require("react"), 1);
|
|
3454
3457
|
var import_material21 = require("@mui/material");
|
|
3455
3458
|
var import_Grid7 = __toESM(require("@mui/material/Grid"), 1);
|
|
3459
|
+
var import_Avatar = __toESM(require("@mui/material/Avatar"), 1);
|
|
3456
3460
|
var Muicon6 = __toESM(require("@mui/icons-material"), 1);
|
|
3457
|
-
var SCListContent = ({ options }) => {
|
|
3461
|
+
var SCListContent = ({ options, iconLeftType = "Icon", iconRightType = "Icon" }) => {
|
|
3458
3462
|
const [selectedIndex, setSelectedIndex] = import_react34.default.useState("1");
|
|
3459
3463
|
const [value, setValue] = import_react34.default.useState("1");
|
|
3460
3464
|
options.map(function(option, index, array) {
|
|
3461
3465
|
if (option == null ? void 0 : option.iconLeft) {
|
|
3462
3466
|
if ((option == null ? void 0 : option.iconLeft.type) == void 0) {
|
|
3463
|
-
|
|
3464
|
-
|
|
3465
|
-
|
|
3467
|
+
const found = Muicon6[option == null ? void 0 : option.iconLeft];
|
|
3468
|
+
if (found != void 0) {
|
|
3469
|
+
option.iconLeft = Muicon6[option == null ? void 0 : option.iconLeft];
|
|
3470
|
+
}
|
|
3466
3471
|
}
|
|
3467
3472
|
}
|
|
3468
3473
|
if (option == null ? void 0 : option.iconRight) {
|
|
3469
3474
|
if ((option == null ? void 0 : option.iconRight.type) == void 0) {
|
|
3470
|
-
|
|
3471
|
-
|
|
3472
|
-
|
|
3475
|
+
const found = Muicon6[option == null ? void 0 : option.iconRight];
|
|
3476
|
+
if (found != void 0) {
|
|
3477
|
+
option.iconRight = Muicon6[option == null ? void 0 : option.iconRight];
|
|
3478
|
+
}
|
|
3473
3479
|
}
|
|
3474
3480
|
}
|
|
3475
3481
|
});
|
|
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,
|
|
3482
|
+
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) => {
|
|
3483
|
+
var _a, _b;
|
|
3484
|
+
return /* @__PURE__ */ import_react34.default.createElement(import_react34.default.Fragment, { key: index }, /* @__PURE__ */ import_react34.default.createElement(
|
|
3485
|
+
import_material21.ListItemButton,
|
|
3485
3486
|
{
|
|
3486
|
-
|
|
3487
|
-
|
|
3488
|
-
}
|
|
3489
|
-
|
|
3490
|
-
|
|
3491
|
-
|
|
3487
|
+
disabled: option.disable,
|
|
3488
|
+
onClick: option.fn
|
|
3489
|
+
},
|
|
3490
|
+
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) : "",
|
|
3491
|
+
/* @__PURE__ */ import_react34.default.createElement(
|
|
3492
|
+
import_material21.ListItemText,
|
|
3493
|
+
{
|
|
3494
|
+
primary: option.title,
|
|
3495
|
+
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))
|
|
3496
|
+
}
|
|
3497
|
+
),
|
|
3498
|
+
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) : ""
|
|
3499
|
+
), option.divider == true ? /* @__PURE__ */ import_react34.default.createElement(import_material21.Divider, null) : "");
|
|
3500
|
+
})));
|
|
3492
3501
|
};
|
|
3493
3502
|
|
|
3494
3503
|
// src/Components/SCMenu.tsx
|
|
@@ -4203,7 +4212,7 @@ var import_dayjs6 = __toESM(require("dayjs"), 1);
|
|
|
4203
4212
|
var import_localeData2 = __toESM(require("dayjs/plugin/localeData"), 1);
|
|
4204
4213
|
import_dayjs6.default.extend(import_localeData2.default);
|
|
4205
4214
|
var WeekView = ({
|
|
4206
|
-
events
|
|
4215
|
+
events,
|
|
4207
4216
|
currentDate,
|
|
4208
4217
|
isLoading,
|
|
4209
4218
|
onDayClick,
|
|
@@ -4212,11 +4221,7 @@ var WeekView = ({
|
|
|
4212
4221
|
startHour = 0,
|
|
4213
4222
|
endHour = 23
|
|
4214
4223
|
}) => {
|
|
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;
|
|
4224
|
+
const noEvents = events.length === 0;
|
|
4220
4225
|
const todayString = (0, import_dayjs6.default)().format("YYYY-MM-DD");
|
|
4221
4226
|
const startOfWeek3 = currentDate.startOf("week");
|
|
4222
4227
|
const days = Array.from({ length: 7 }, (_, i) => startOfWeek3.add(i, "day"));
|
|
@@ -4266,74 +4271,77 @@ var WeekView = ({
|
|
|
4266
4271
|
subtitle: "Selecciona un mec\xE1nico y as\xEDgnale las actividades a realizar.",
|
|
4267
4272
|
icon: /* @__PURE__ */ import_react44.default.createElement(LogoCalendario, null)
|
|
4268
4273
|
}
|
|
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(
|
|
4274
|
+
) : (
|
|
4275
|
+
// Grid de horas y eventos
|
|
4276
|
+
/* @__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
4277
|
import_material29.Box,
|
|
4289
4278
|
{
|
|
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)
|
|
4279
|
+
key: h,
|
|
4280
|
+
height: 60,
|
|
4281
|
+
textAlign: "right",
|
|
4282
|
+
pr: 1,
|
|
4283
|
+
borderColor: "divider"
|
|
4297
4284
|
},
|
|
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`
|
|
4285
|
+
/* @__PURE__ */ import_react44.default.createElement(import_material29.Typography, { variant: "caption", color: "text.secondary" }, (0, import_dayjs6.default)().hour(h).format("h A"))
|
|
4286
|
+
))), days.map((day) => {
|
|
4287
|
+
const dayEvents = events.filter(
|
|
4288
|
+
(event2) => day.isBetween(event2.start.startOf("day"), event2.end.endOf("day"), null, "[]")
|
|
4289
|
+
).filter((event2) => {
|
|
4290
|
+
const startsInRange = event2.start.hour() >= startHour && event2.start.hour() <= endHour;
|
|
4291
|
+
const endsInRange = event2.end.hour() >= startHour && event2.end.hour() <= endHour;
|
|
4292
|
+
return startsInRange || endsInRange;
|
|
4293
|
+
}).sort((a, b) => a.start.valueOf() - b.start.valueOf());
|
|
4294
|
+
return /* @__PURE__ */ import_react44.default.createElement(
|
|
4295
|
+
import_material29.Box,
|
|
4296
|
+
{
|
|
4297
|
+
key: day.toString(),
|
|
4298
|
+
flex: 1,
|
|
4299
|
+
borderLeft: "1px solid",
|
|
4300
|
+
borderColor: "divider",
|
|
4301
|
+
position: "relative",
|
|
4302
|
+
"data-testid": `week-day-column-${day.format("YYYY-MM-DD")}`,
|
|
4303
|
+
onClick: () => onDayClick == null ? void 0 : onDayClick(day)
|
|
4304
|
+
},
|
|
4305
|
+
hours.map((hourIdx) => {
|
|
4306
|
+
const borderType = getCellBorderType2(hourIdx, dayEvents);
|
|
4307
|
+
return /* @__PURE__ */ import_react44.default.createElement(
|
|
4308
|
+
import_material29.Box,
|
|
4309
|
+
{
|
|
4310
|
+
key: hourIdx,
|
|
4311
|
+
height: 60,
|
|
4312
|
+
borderTop: "1px solid",
|
|
4313
|
+
borderColor: borderType === "start" || borderType === "full" || borderType === "none" ? "divider" : "transparent",
|
|
4314
|
+
borderBottom: borderType === "end" || borderType === "full" ? "1px solid divider" : void 0
|
|
4331
4315
|
}
|
|
4332
|
-
|
|
4333
|
-
)
|
|
4334
|
-
|
|
4335
|
-
|
|
4336
|
-
|
|
4316
|
+
);
|
|
4317
|
+
}),
|
|
4318
|
+
dayEvents.map((event2) => {
|
|
4319
|
+
const eventStart = day.isSame(event2.start, "day") ? event2.start : day.startOf("day").hour(startHour).minute(0);
|
|
4320
|
+
const eventEnd = day.isSame(event2.end, "day") ? event2.end : day.endOf("day").hour(endHour).minute(59);
|
|
4321
|
+
const startMinutes = (eventStart.hour() - startHour) * 60 + eventStart.minute();
|
|
4322
|
+
const durationMinutes = eventEnd.diff(eventStart, "minute");
|
|
4323
|
+
return /* @__PURE__ */ import_react44.default.createElement(
|
|
4324
|
+
CalendarEventCard,
|
|
4325
|
+
{
|
|
4326
|
+
key: `${event2.id}-${day.toString()}`,
|
|
4327
|
+
event: event2,
|
|
4328
|
+
color: stateColors[event2.state],
|
|
4329
|
+
onClick: () => onEventClick == null ? void 0 : onEventClick(event2, day),
|
|
4330
|
+
onHover: onEventHover,
|
|
4331
|
+
sx: {
|
|
4332
|
+
position: "absolute",
|
|
4333
|
+
top: `${startMinutes}px`,
|
|
4334
|
+
left: 4,
|
|
4335
|
+
right: 4,
|
|
4336
|
+
cursor: "pointer",
|
|
4337
|
+
height: `${durationMinutes}px`
|
|
4338
|
+
}
|
|
4339
|
+
}
|
|
4340
|
+
);
|
|
4341
|
+
})
|
|
4342
|
+
);
|
|
4343
|
+
}))
|
|
4344
|
+
));
|
|
4337
4345
|
};
|
|
4338
4346
|
|
|
4339
4347
|
// src/Components/Calendario/Views/DayView.tsx
|
|
@@ -4848,7 +4856,7 @@ var SCActivityCalendar = ({
|
|
|
4848
4856
|
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
4857
|
onChange: (newValue) => setFecha(newValue)
|
|
4850
4858
|
}
|
|
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(
|
|
4859
|
+
), /* @__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
4860
|
import_material34.Box,
|
|
4853
4861
|
{
|
|
4854
4862
|
key: dayIndex
|
|
@@ -4874,7 +4882,7 @@ var SCActivityCalendar = ({
|
|
|
4874
4882
|
{
|
|
4875
4883
|
key: idx,
|
|
4876
4884
|
options: [{
|
|
4877
|
-
title: event2.
|
|
4885
|
+
title: event2.activityDescription,
|
|
4878
4886
|
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
4887
|
iconLeftColor: event2.state === "Finalizada" ? "success" : "action",
|
|
4880
4888
|
iconLeft: event2.state === "Finalizada" ? "CheckCircle" : event2.state === "Aplazada" ? "EventBusyOutlined" : event2.state === "En progreso" ? "PendingOutlined" : "RadioButtonUnchecked",
|
|
@@ -4901,12 +4909,338 @@ var SCActivityCalendar = ({
|
|
|
4901
4909
|
))));
|
|
4902
4910
|
};
|
|
4903
4911
|
|
|
4912
|
+
// src/Components/Adjuntar/mobile/AdjuntarMobile.tsx
|
|
4913
|
+
var import_react52 = __toESM(require("react"), 1);
|
|
4914
|
+
|
|
4915
|
+
// src/Components/Adjuntar/mobile/components/button.tsx
|
|
4916
|
+
var import_react51 = __toESM(require("react"), 1);
|
|
4917
|
+
var import_material35 = require("@mui/material");
|
|
4918
|
+
|
|
4919
|
+
// src/Components/Adjuntar/mobile/components/Utils.tsx
|
|
4920
|
+
var MuiIcons4 = __toESM(require("@mui/icons-material"), 1);
|
|
4921
|
+
var import_icons_material12 = require("@mui/icons-material");
|
|
4922
|
+
var getAttachmentIcon = (iconName) => {
|
|
4923
|
+
return iconName && MuiIcons4[iconName] ? MuiIcons4[iconName] : import_icons_material12.AttachFileOutlined;
|
|
4924
|
+
};
|
|
4925
|
+
var getAttachmentColor = (state) => {
|
|
4926
|
+
const colors = {
|
|
4927
|
+
primary: "primary.50",
|
|
4928
|
+
success: "success.50",
|
|
4929
|
+
warning: "warning.50"
|
|
4930
|
+
};
|
|
4931
|
+
return colors[state];
|
|
4932
|
+
};
|
|
4933
|
+
|
|
4934
|
+
// src/Components/Adjuntar/mobile/components/button.tsx
|
|
4935
|
+
var AttachmentButton = ({ buttonAttachment, open, setOpen }) => {
|
|
4936
|
+
var _a, _b, _c, _d;
|
|
4937
|
+
const handleToggle = () => {
|
|
4938
|
+
if (setOpen) {
|
|
4939
|
+
setOpen(!open);
|
|
4940
|
+
}
|
|
4941
|
+
};
|
|
4942
|
+
const Icon = (0, import_react51.useMemo)(
|
|
4943
|
+
() => getAttachmentIcon(buttonAttachment == null ? void 0 : buttonAttachment.icon),
|
|
4944
|
+
[buttonAttachment == null ? void 0 : buttonAttachment.icon]
|
|
4945
|
+
);
|
|
4946
|
+
if (!buttonAttachment) return null;
|
|
4947
|
+
return /* @__PURE__ */ import_react51.default.createElement(import_react51.default.Fragment, null, buttonAttachment && /* @__PURE__ */ import_react51.default.createElement(
|
|
4948
|
+
import_material35.Button,
|
|
4949
|
+
{
|
|
4950
|
+
"data-testid": "test-buttonModal",
|
|
4951
|
+
color: (_a = buttonAttachment == null ? void 0 : buttonAttachment.color) != null ? _a : "primary",
|
|
4952
|
+
onClick: handleToggle,
|
|
4953
|
+
variant: (_b = buttonAttachment == null ? void 0 : buttonAttachment.variant) != null ? _b : "text",
|
|
4954
|
+
size: (_c = buttonAttachment == null ? void 0 : buttonAttachment.size) != null ? _c : "small",
|
|
4955
|
+
startIcon: (buttonAttachment == null ? void 0 : buttonAttachment.iconPosition) === "left" && /* @__PURE__ */ import_react51.default.createElement(Icon, null),
|
|
4956
|
+
endIcon: (buttonAttachment == null ? void 0 : buttonAttachment.iconPosition) === "right" && /* @__PURE__ */ import_react51.default.createElement(Icon, null)
|
|
4957
|
+
},
|
|
4958
|
+
capitalize((_d = buttonAttachment == null ? void 0 : buttonAttachment.text) != null ? _d : "Adjuntar")
|
|
4959
|
+
));
|
|
4960
|
+
};
|
|
4961
|
+
|
|
4962
|
+
// src/Components/Adjuntar/mobile/AdjuntarMobile.tsx
|
|
4963
|
+
var import_material36 = require("@mui/material");
|
|
4964
|
+
var import_CssBaseline = __toESM(require("@mui/material/CssBaseline"), 1);
|
|
4965
|
+
var import_system = require("@mui/system");
|
|
4966
|
+
var import_icons_material13 = require("@mui/icons-material");
|
|
4967
|
+
var AttachmentMobile = ({
|
|
4968
|
+
buttonAttachment,
|
|
4969
|
+
maxSize = 400,
|
|
4970
|
+
fileAccepted = "",
|
|
4971
|
+
initialFiles,
|
|
4972
|
+
deleteAction,
|
|
4973
|
+
children,
|
|
4974
|
+
onChange,
|
|
4975
|
+
sx
|
|
4976
|
+
}) => {
|
|
4977
|
+
const [files, setFiles] = (0, import_react52.useState)([]);
|
|
4978
|
+
const [toast, setToast] = (0, import_react52.useState)(null);
|
|
4979
|
+
const [open, setOpen] = import_react52.default.useState(false);
|
|
4980
|
+
const toggleAttachment = (newOpen) => () => {
|
|
4981
|
+
setOpen(newOpen);
|
|
4982
|
+
};
|
|
4983
|
+
const inputRef = (0, import_react52.useRef)(null);
|
|
4984
|
+
const handleUpload = (event2) => {
|
|
4985
|
+
const newFiles = event2.target.files;
|
|
4986
|
+
if (!newFiles) return;
|
|
4987
|
+
const nuevosArchivos = [];
|
|
4988
|
+
const archivosValidos = [];
|
|
4989
|
+
Array.from(newFiles).forEach((file) => {
|
|
4990
|
+
const isDuplicateFile = files.some(
|
|
4991
|
+
(existingFile) => existingFile.name === file.name && existingFile.size === file.size
|
|
4992
|
+
);
|
|
4993
|
+
const sizeMB = file.size / (1024 * 1024);
|
|
4994
|
+
if (isDuplicateFile) {
|
|
4995
|
+
setToast({
|
|
4996
|
+
type: "error",
|
|
4997
|
+
title: "Archivo duplicado",
|
|
4998
|
+
listITems: [`El archivo "${file.name}" ya existe.`],
|
|
4999
|
+
seeMore: true,
|
|
5000
|
+
time: 5
|
|
5001
|
+
});
|
|
5002
|
+
return;
|
|
5003
|
+
}
|
|
5004
|
+
if (sizeMB > maxSize) {
|
|
5005
|
+
nuevosArchivos.push({
|
|
5006
|
+
name: file.name,
|
|
5007
|
+
size: file.size,
|
|
5008
|
+
type: file.type,
|
|
5009
|
+
progress: 0,
|
|
5010
|
+
uploadError: true
|
|
5011
|
+
});
|
|
5012
|
+
setToast({
|
|
5013
|
+
type: "error",
|
|
5014
|
+
title: "Carga fallida",
|
|
5015
|
+
seeMore: true,
|
|
5016
|
+
listITems: [`El archivo "${file.name}" supera el l\xEDmite de ${maxSize}MB.`],
|
|
5017
|
+
time: 5
|
|
5018
|
+
});
|
|
5019
|
+
return;
|
|
5020
|
+
}
|
|
5021
|
+
if (fileAccepted && !file.name.match(
|
|
5022
|
+
new RegExp(
|
|
5023
|
+
`(${fileAccepted.replace(/\./g, "\\.").replace(/,/g, "|")})$`,
|
|
5024
|
+
"i"
|
|
5025
|
+
)
|
|
5026
|
+
)) {
|
|
5027
|
+
setToast({
|
|
5028
|
+
type: "error",
|
|
5029
|
+
title: "Tipo de archivo no permitido",
|
|
5030
|
+
listITems: [`El archivo "${file.name}" no es un tipo permitido.`],
|
|
5031
|
+
seeMore: true,
|
|
5032
|
+
time: 5
|
|
5033
|
+
});
|
|
5034
|
+
return;
|
|
5035
|
+
}
|
|
5036
|
+
nuevosArchivos.push({
|
|
5037
|
+
name: file.name,
|
|
5038
|
+
size: file.size,
|
|
5039
|
+
type: file.type,
|
|
5040
|
+
progress: 0,
|
|
5041
|
+
uploadError: false
|
|
5042
|
+
});
|
|
5043
|
+
archivosValidos.push(file);
|
|
5044
|
+
});
|
|
5045
|
+
if (nuevosArchivos.length > 0) {
|
|
5046
|
+
setFiles((prevFiles) => {
|
|
5047
|
+
const updatedFiles = [...prevFiles, ...nuevosArchivos];
|
|
5048
|
+
if (archivosValidos.length > 0) {
|
|
5049
|
+
onChange == null ? void 0 : onChange([
|
|
5050
|
+
...archivosValidos,
|
|
5051
|
+
...prevFiles.map((f) => new File([], f.name, { type: f.type }))
|
|
5052
|
+
]);
|
|
5053
|
+
}
|
|
5054
|
+
return updatedFiles;
|
|
5055
|
+
});
|
|
5056
|
+
}
|
|
5057
|
+
setOpen(false);
|
|
5058
|
+
event2.target.value = "";
|
|
5059
|
+
};
|
|
5060
|
+
const handleDeleteFile = (fileToRemove) => __async(null, null, function* () {
|
|
5061
|
+
try {
|
|
5062
|
+
if (deleteAction) {
|
|
5063
|
+
yield deleteAction(fileToRemove.name);
|
|
5064
|
+
}
|
|
5065
|
+
const updatedFiles = files.filter(
|
|
5066
|
+
(file) => !(file.name === fileToRemove.name && file.size === fileToRemove.size)
|
|
5067
|
+
);
|
|
5068
|
+
setFiles(updatedFiles);
|
|
5069
|
+
if (onChange) {
|
|
5070
|
+
const remainingValidFiles = updatedFiles.filter((f) => !f.uploadError).map((f) => new File([], f.name, { type: f.type }));
|
|
5071
|
+
onChange(remainingValidFiles);
|
|
5072
|
+
}
|
|
5073
|
+
setToast({
|
|
5074
|
+
type: "success",
|
|
5075
|
+
title: "Archivo eliminado",
|
|
5076
|
+
listITems: [`El archivo "${fileToRemove.name}" ha sido eliminado exitosamente.`],
|
|
5077
|
+
seeMore: true,
|
|
5078
|
+
time: 3
|
|
5079
|
+
});
|
|
5080
|
+
} catch (error) {
|
|
5081
|
+
setToast({
|
|
5082
|
+
type: "error",
|
|
5083
|
+
title: "Error al eliminar",
|
|
5084
|
+
listITems: [`No se pudo eliminar el archivo "${fileToRemove.name}".`],
|
|
5085
|
+
seeMore: true,
|
|
5086
|
+
time: 5
|
|
5087
|
+
});
|
|
5088
|
+
}
|
|
5089
|
+
});
|
|
5090
|
+
const AttachtmentActions = [
|
|
5091
|
+
{ icon: /* @__PURE__ */ import_react52.default.createElement(import_icons_material13.FolderOpenOutlined, { type: "file", color: "primary" }), color: "primary", label: "Galer\xEDa", onClick: () => alert("diste click en Galeria") },
|
|
5092
|
+
{ icon: /* @__PURE__ */ import_react52.default.createElement(import_icons_material13.PhotoCameraOutlined, { type: "file", color: "success" }), color: "success", label: "C\xE1mara", onClick: () => alert("diste click en Camara") },
|
|
5093
|
+
{ icon: /* @__PURE__ */ import_react52.default.createElement(import_icons_material13.FolderOpenOutlined, { type: "file", color: "warning" }), color: "warning", label: "Archivos", onClick: () => {
|
|
5094
|
+
var _a;
|
|
5095
|
+
return (_a = inputRef.current) == null ? void 0 : _a.click();
|
|
5096
|
+
} }
|
|
5097
|
+
];
|
|
5098
|
+
(0, import_react52.useEffect)(() => {
|
|
5099
|
+
if (initialFiles && initialFiles.length > 0) {
|
|
5100
|
+
setFiles(initialFiles);
|
|
5101
|
+
}
|
|
5102
|
+
}, []);
|
|
5103
|
+
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(
|
|
5104
|
+
AttachmentButton,
|
|
5105
|
+
{
|
|
5106
|
+
buttonAttachment,
|
|
5107
|
+
open,
|
|
5108
|
+
setOpen
|
|
5109
|
+
}
|
|
5110
|
+
)), /* @__PURE__ */ import_react52.default.createElement(import_CssBaseline.default, null), /* @__PURE__ */ import_react52.default.createElement(
|
|
5111
|
+
import_material36.SwipeableDrawer,
|
|
5112
|
+
{
|
|
5113
|
+
ModalProps: {
|
|
5114
|
+
sx: {
|
|
5115
|
+
"& .MuiPaper-root": {
|
|
5116
|
+
borderRadius: "16px 16px 0 0"
|
|
5117
|
+
}
|
|
5118
|
+
}
|
|
5119
|
+
},
|
|
5120
|
+
anchor: "bottom",
|
|
5121
|
+
swipeAreaWidth: 56,
|
|
5122
|
+
open,
|
|
5123
|
+
onClose: toggleAttachment(false),
|
|
5124
|
+
onOpen: toggleAttachment(true)
|
|
5125
|
+
},
|
|
5126
|
+
toast && /* @__PURE__ */ import_react52.default.createElement(SCToastNotification, __spreadValues({}, toast)),
|
|
5127
|
+
/* @__PURE__ */ import_react52.default.createElement(import_system.Box, { display: "flex", flexDirection: "column", alignItems: "center", p: 2, gap: 2 }, /* @__PURE__ */ import_react52.default.createElement(import_system.Box, { display: "flex", width: "100%", justifyContent: "space-between", alignItems: "center", gap: 1, p: 1 }, /* @__PURE__ */ import_react52.default.createElement(import_material36.Typography, { variant: "h6", color: "text.primary" }, "Agregar adjuntos"), /* @__PURE__ */ import_react52.default.createElement(import_material36.IconButton, { size: "medium", onClick: toggleAttachment(false) }, /* @__PURE__ */ import_react52.default.createElement(import_icons_material13.CloseOutlined, { color: "action" }))), /* @__PURE__ */ import_react52.default.createElement(
|
|
5128
|
+
"input",
|
|
5129
|
+
{
|
|
5130
|
+
type: "file",
|
|
5131
|
+
multiple: true,
|
|
5132
|
+
hidden: true,
|
|
5133
|
+
ref: inputRef,
|
|
5134
|
+
onChange: handleUpload
|
|
5135
|
+
}
|
|
5136
|
+
), /* @__PURE__ */ import_react52.default.createElement(import_system.Box, { display: "flex", justifyContent: "space-around", alignItems: "center", width: "100%", gap: 2 }, AttachtmentActions.map((option, index) => /* @__PURE__ */ import_react52.default.createElement(
|
|
5137
|
+
import_system.Box,
|
|
5138
|
+
{
|
|
5139
|
+
display: "flex",
|
|
5140
|
+
flexDirection: "column",
|
|
5141
|
+
alignItems: "center",
|
|
5142
|
+
width: 100,
|
|
5143
|
+
height: 80,
|
|
5144
|
+
borderRadius: 1,
|
|
5145
|
+
bgcolor: "grey.100",
|
|
5146
|
+
border: "1px solid",
|
|
5147
|
+
borderColor: "grey.50",
|
|
5148
|
+
boxShadow: 1,
|
|
5149
|
+
justifyContent: "center",
|
|
5150
|
+
p: 1,
|
|
5151
|
+
gap: 1,
|
|
5152
|
+
onClick: option.onClick,
|
|
5153
|
+
sx: {
|
|
5154
|
+
cursor: "pointer"
|
|
5155
|
+
}
|
|
5156
|
+
},
|
|
5157
|
+
/* @__PURE__ */ import_react52.default.createElement(
|
|
5158
|
+
import_material36.IconButton,
|
|
5159
|
+
{
|
|
5160
|
+
sx: {
|
|
5161
|
+
bgcolor: getAttachmentColor(option.color)
|
|
5162
|
+
},
|
|
5163
|
+
size: "large"
|
|
5164
|
+
},
|
|
5165
|
+
option.icon
|
|
5166
|
+
),
|
|
5167
|
+
/* @__PURE__ */ import_react52.default.createElement(import_material36.Typography, { variant: "body2", color: "text.primary" }, option.label)
|
|
5168
|
+
))))
|
|
5169
|
+
), files.length > 0 && /* @__PURE__ */ import_react52.default.createElement(
|
|
5170
|
+
import_material36.Stack,
|
|
5171
|
+
{
|
|
5172
|
+
"data-testid": "ContenedorArchivosAdjuntos",
|
|
5173
|
+
id: "ContenedorArchivosAdjuntos",
|
|
5174
|
+
width: "100%",
|
|
5175
|
+
sx: __spreadValues({
|
|
5176
|
+
overflowY: "auto"
|
|
5177
|
+
}, files.length > 5 && {
|
|
5178
|
+
maxHeight: 250
|
|
5179
|
+
}),
|
|
5180
|
+
spacing: 1
|
|
5181
|
+
},
|
|
5182
|
+
files.map((file) => /* @__PURE__ */ import_react52.default.createElement(
|
|
5183
|
+
import_material36.Stack,
|
|
5184
|
+
{
|
|
5185
|
+
height: 46,
|
|
5186
|
+
key: file.name + (file.uploadError ? "_error" : ""),
|
|
5187
|
+
direction: "row",
|
|
5188
|
+
alignItems: "center",
|
|
5189
|
+
justifyContent: "space-between",
|
|
5190
|
+
gap: 2,
|
|
5191
|
+
padding: 1,
|
|
5192
|
+
borderRadius: 1,
|
|
5193
|
+
sx: {
|
|
5194
|
+
backgroundColor: file.uploadError ? "error.50" : "transparent",
|
|
5195
|
+
":hover": {
|
|
5196
|
+
backgroundColor: file.uploadError ? "error.100" : "primary.50"
|
|
5197
|
+
}
|
|
5198
|
+
}
|
|
5199
|
+
},
|
|
5200
|
+
/* @__PURE__ */ import_react52.default.createElement(import_material36.Stack, { direction: "row", alignItems: "center", gap: 1, width: "100%" }, /* @__PURE__ */ import_react52.default.createElement(
|
|
5201
|
+
import_icons_material13.UploadFileOutlined,
|
|
5202
|
+
{
|
|
5203
|
+
color: file.uploadError ? "error" : "primary",
|
|
5204
|
+
fontSize: "small"
|
|
5205
|
+
}
|
|
5206
|
+
), /* @__PURE__ */ import_react52.default.createElement(import_material36.Stack, { width: "100%" }, /* @__PURE__ */ import_react52.default.createElement(
|
|
5207
|
+
import_material36.Typography,
|
|
5208
|
+
{
|
|
5209
|
+
variant: "body2",
|
|
5210
|
+
color: "text.primary",
|
|
5211
|
+
whiteSpace: "nowrap",
|
|
5212
|
+
overflow: "hidden",
|
|
5213
|
+
textOverflow: "ellipsis",
|
|
5214
|
+
maxWidth: "310px"
|
|
5215
|
+
},
|
|
5216
|
+
file.name
|
|
5217
|
+
), /* @__PURE__ */ import_react52.default.createElement(
|
|
5218
|
+
import_material36.Typography,
|
|
5219
|
+
{
|
|
5220
|
+
variant: "caption",
|
|
5221
|
+
color: file.uploadError ? "error" : "text.secondary"
|
|
5222
|
+
},
|
|
5223
|
+
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}`
|
|
5224
|
+
))),
|
|
5225
|
+
/* @__PURE__ */ import_react52.default.createElement(import_material36.Tooltip, { title: "Eliminar" }, /* @__PURE__ */ import_react52.default.createElement(
|
|
5226
|
+
import_material36.IconButton,
|
|
5227
|
+
{
|
|
5228
|
+
size: "small",
|
|
5229
|
+
onClick: () => handleDeleteFile(file),
|
|
5230
|
+
"aria-label": `Eliminar ${file.name}`
|
|
5231
|
+
},
|
|
5232
|
+
/* @__PURE__ */ import_react52.default.createElement(import_icons_material13.DeleteOutline, { fontSize: "small", color: "action" })
|
|
5233
|
+
))
|
|
5234
|
+
))
|
|
5235
|
+
));
|
|
5236
|
+
};
|
|
5237
|
+
|
|
4904
5238
|
// src/Theme/index.ts
|
|
4905
5239
|
var import_styles3 = require("@mui/material/styles");
|
|
4906
5240
|
|
|
4907
5241
|
// src/Theme/components.ts
|
|
4908
|
-
var
|
|
4909
|
-
var
|
|
5242
|
+
var import_react53 = __toESM(require("react"), 1);
|
|
5243
|
+
var import_icons_material14 = require("@mui/icons-material");
|
|
4910
5244
|
var components = {
|
|
4911
5245
|
MuiSelect: {
|
|
4912
5246
|
styleOverrides: {
|
|
@@ -5603,10 +5937,10 @@ var components = {
|
|
|
5603
5937
|
MuiAlert: {
|
|
5604
5938
|
defaultProps: {
|
|
5605
5939
|
iconMapping: {
|
|
5606
|
-
success:
|
|
5607
|
-
error:
|
|
5608
|
-
warning:
|
|
5609
|
-
info:
|
|
5940
|
+
success: import_react53.default.createElement(import_icons_material14.CheckCircleRounded),
|
|
5941
|
+
error: import_react53.default.createElement(import_icons_material14.ErrorRounded),
|
|
5942
|
+
warning: import_react53.default.createElement(import_icons_material14.WarningRounded),
|
|
5943
|
+
info: import_react53.default.createElement(import_icons_material14.InfoRounded)
|
|
5610
5944
|
}
|
|
5611
5945
|
},
|
|
5612
5946
|
variants: [
|
|
@@ -6444,8 +6778,8 @@ var paletteADC = __spreadValues({
|
|
|
6444
6778
|
}, BasicPalette);
|
|
6445
6779
|
|
|
6446
6780
|
// src/Theme/breakpoints.ts
|
|
6447
|
-
var
|
|
6448
|
-
var breakpoints = (0,
|
|
6781
|
+
var import_system2 = require("@mui/system");
|
|
6782
|
+
var breakpoints = (0, import_system2.createBreakpoints)({
|
|
6449
6783
|
values: {
|
|
6450
6784
|
xs: 0,
|
|
6451
6785
|
sm: 600,
|
|
@@ -6649,6 +6983,7 @@ var ADCSincoTheme = (0, import_styles3.createTheme)(__spreadValues({}, ADCTheme)
|
|
|
6649
6983
|
ADCSincoTheme,
|
|
6650
6984
|
AdproSincoTheme,
|
|
6651
6985
|
Attachment,
|
|
6986
|
+
AttachmentMobile,
|
|
6652
6987
|
BasicMenu,
|
|
6653
6988
|
CALENDAR_CONSTANTS,
|
|
6654
6989
|
Calendar,
|