componentes-sinco 1.0.30 → 1.0.31
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 +24 -18
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -3
- package/dist/index.d.ts +5 -3
- package/dist/index.js +24 -18
- package/dist/index.js.map +1 -1
- package/package.json +4 -1
package/dist/index.cjs
CHANGED
|
@@ -3130,7 +3130,7 @@ var import_material20 = require("@mui/material");
|
|
|
3130
3130
|
var import_Grid6 = __toESM(require("@mui/material/Grid"), 1);
|
|
3131
3131
|
var import_Close2 = __toESM(require("@mui/icons-material/Close"), 1);
|
|
3132
3132
|
var Muicon5 = __toESM(require("@mui/icons-material"), 1);
|
|
3133
|
-
var SCDialog = ({ title, iconTitle, subtitle, content, actions, buttonDialog, disableClose, dividers, widthContent, heightContent, background, setShow, show }) => {
|
|
3133
|
+
var SCDialog = ({ title, iconTitle, subtitle, content, actions, buttonDialog, disableClose, dividers, widthContent, heightContent, background, typeView = "web", setShow, show }) => {
|
|
3134
3134
|
let i = 0;
|
|
3135
3135
|
let iconTitleValidation = "";
|
|
3136
3136
|
let IconTitle;
|
|
@@ -3150,22 +3150,24 @@ var SCDialog = ({ title, iconTitle, subtitle, content, actions, buttonDialog, di
|
|
|
3150
3150
|
ButtonIcon = Muicon5[buttonDialog == null ? void 0 : buttonDialog.icon];
|
|
3151
3151
|
}
|
|
3152
3152
|
}
|
|
3153
|
-
|
|
3154
|
-
|
|
3155
|
-
if (
|
|
3156
|
-
|
|
3157
|
-
|
|
3158
|
-
|
|
3153
|
+
if (Array.isArray(actions)) {
|
|
3154
|
+
actions.map(function(option, index, array) {
|
|
3155
|
+
if (option == null ? void 0 : option.icon) {
|
|
3156
|
+
if ((option == null ? void 0 : option.icon.type) == void 0) {
|
|
3157
|
+
option.icon = Muicon5[option == null ? void 0 : option.icon];
|
|
3158
|
+
} else {
|
|
3159
|
+
option;
|
|
3160
|
+
}
|
|
3159
3161
|
}
|
|
3160
|
-
}
|
|
3161
|
-
}
|
|
3162
|
+
});
|
|
3163
|
+
}
|
|
3162
3164
|
if (iconTitle) {
|
|
3163
3165
|
if (Muicon5[iconTitle] == void 0) {
|
|
3164
|
-
if (iconTitle
|
|
3165
|
-
iconTitleValidation = "image";
|
|
3166
|
-
IconTitle = iconTitle;
|
|
3167
|
-
} else {
|
|
3166
|
+
if (Muicon5[iconTitle]) {
|
|
3168
3167
|
iconTitleValidation = "icon";
|
|
3168
|
+
IconTitle = Muicon5[iconTitle];
|
|
3169
|
+
} else {
|
|
3170
|
+
iconTitleValidation = "image";
|
|
3169
3171
|
IconTitle = iconTitle;
|
|
3170
3172
|
}
|
|
3171
3173
|
} else {
|
|
@@ -3185,11 +3187,12 @@ var SCDialog = ({ title, iconTitle, subtitle, content, actions, buttonDialog, di
|
|
|
3185
3187
|
setShow(false);
|
|
3186
3188
|
}
|
|
3187
3189
|
};
|
|
3188
|
-
const dialogActions = actions !=
|
|
3190
|
+
const dialogActions = actions == false ? false : actions != void 0 ? actions : [{ text: "Cerrar", fn: handleClose }];
|
|
3189
3191
|
content = content != null ? content : { component: /* @__PURE__ */ import_react33.default.createElement(import_material20.Box, null, " Aqui va el contenido ") };
|
|
3190
3192
|
return /* @__PURE__ */ import_react33.default.createElement("div", null, buttonDialog ? /* @__PURE__ */ import_react33.default.createElement(import_react33.default.Fragment, null, buttonDialog.text != void 0 ? /* @__PURE__ */ import_react33.default.createElement(import_material20.Tooltip, { placement: "bottom-start", title: buttonDialog.tooltip != void 0 ? buttonDialog.tooltip : "", slotProps: { popper: { modifiers: [{ name: "offset", options: { offset: [0, -14] } }] } } }, /* @__PURE__ */ import_react33.default.createElement(import_material20.Button, { size: "small", color: buttonDialog.color != void 0 ? buttonDialog.color : "primary", variant: (buttonDialog == null ? void 0 : buttonDialog.variant) != void 0 ? buttonDialog == null ? void 0 : buttonDialog.variant : "text", startIcon: (buttonDialog == null ? void 0 : buttonDialog.iconPosition) != void 0 ? (buttonDialog == null ? void 0 : buttonDialog.iconPosition) == "left" ? /* @__PURE__ */ import_react33.default.createElement(ButtonIcon, null) : "" : "", endIcon: (buttonDialog == null ? void 0 : buttonDialog.iconPosition) != void 0 ? (buttonDialog == null ? void 0 : buttonDialog.iconPosition) == "right" ? /* @__PURE__ */ import_react33.default.createElement(ButtonIcon, null) : "" : "", onClick: handleOpen }, " ", (buttonDialog == null ? void 0 : buttonDialog.text) != void 0 ? buttonDialog.text : "", " ")) : /* @__PURE__ */ import_react33.default.createElement(import_material20.IconButton, { style: { cursor: "pointer" }, onClick: handleOpen }, /* @__PURE__ */ import_react33.default.createElement(import_material20.SvgIcon, { fontSize: "small", color: (buttonDialog == null ? void 0 : buttonDialog.color) != void 0 ? buttonDialog == null ? void 0 : buttonDialog.color : "action", component: ButtonIcon }))) : "", /* @__PURE__ */ import_react33.default.createElement(import_material20.Modal, { open: open || false, onClose: handleClose }, /* @__PURE__ */ import_react33.default.createElement(
|
|
3191
3193
|
import_material20.Dialog,
|
|
3192
3194
|
{
|
|
3195
|
+
fullScreen: typeView === "mobile" ? true : false,
|
|
3193
3196
|
"data-testid": "dialog-element",
|
|
3194
3197
|
open: open || false,
|
|
3195
3198
|
onClose: disableClose ? void 0 : handleClose,
|
|
@@ -3201,7 +3204,7 @@ var SCDialog = ({ title, iconTitle, subtitle, content, actions, buttonDialog, di
|
|
|
3201
3204
|
}
|
|
3202
3205
|
}
|
|
3203
3206
|
},
|
|
3204
|
-
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, null, /* @__PURE__ */ import_react33.default.createElement(import_material20.Typography, { color: "text.primary", variant: "h6", gutterBottom: true }, title ? title : ""), /* @__PURE__ */ import_react33.default.createElement(import_material20.Typography, { color: "text.secondary", variant: "body2", gutterBottom: true }, 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,
|
|
3207
|
+
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, null, /* @__PURE__ */ import_react33.default.createElement(import_material20.Typography, { color: "text.primary", variant: "h6", gutterBottom: true }, title ? title : ""), /* @__PURE__ */ import_react33.default.createElement(import_material20.Typography, { color: "text.secondary", variant: "body2", gutterBottom: true }, 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" })) : "")),
|
|
3205
3208
|
/* @__PURE__ */ import_react33.default.createElement(
|
|
3206
3209
|
import_material20.DialogContent,
|
|
3207
3210
|
{
|
|
@@ -3240,7 +3243,7 @@ var SCDialog = ({ title, iconTitle, subtitle, content, actions, buttonDialog, di
|
|
|
3240
3243
|
}
|
|
3241
3244
|
) : content.component
|
|
3242
3245
|
),
|
|
3243
|
-
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(
|
|
3246
|
+
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(
|
|
3244
3247
|
import_material20.Button,
|
|
3245
3248
|
{
|
|
3246
3249
|
variant: "text",
|
|
@@ -3279,7 +3282,7 @@ var SCDialog = ({ title, iconTitle, subtitle, content, actions, buttonDialog, di
|
|
|
3279
3282
|
},
|
|
3280
3283
|
boton.text
|
|
3281
3284
|
);
|
|
3282
|
-
})) : ""
|
|
3285
|
+
})) : "" : ""
|
|
3283
3286
|
)));
|
|
3284
3287
|
};
|
|
3285
3288
|
|
|
@@ -3860,7 +3863,7 @@ var CALENDAR_CONSTANTS = {
|
|
|
3860
3863
|
GRID_TEMPLATE: "repeat(7, minmax(150px, 1fr))",
|
|
3861
3864
|
DAY_HEIGHT: 60,
|
|
3862
3865
|
SIDEBAR_WIDTH: 47,
|
|
3863
|
-
MIN_CELL_HEIGHT:
|
|
3866
|
+
MIN_CELL_HEIGHT: 99,
|
|
3864
3867
|
DEFAULT_START_HOUR: 0,
|
|
3865
3868
|
DEFAULT_END_HOUR: 23,
|
|
3866
3869
|
DRAWER_WIDTH: "350px",
|
|
@@ -3924,6 +3927,7 @@ var MonthView = ({ events, isLoading, onDayClick, onMoreClick, currentDate, onEv
|
|
|
3924
3927
|
return /* @__PURE__ */ import_react43.default.createElement(import_material28.Box, { width: "100%", sx: { overflowX: "auto" } }, /* @__PURE__ */ import_react43.default.createElement(import_material28.Box, { minWidth: CALENDAR_CONSTANTS.MIN_WIDTH }, /* @__PURE__ */ import_react43.default.createElement(import_material28.Box, { display: "grid", gridTemplateColumns: CALENDAR_CONSTANTS.GRID_TEMPLATE, gap: 0.5, mb: 1 }, weekDays.map((day) => /* @__PURE__ */ import_react43.default.createElement(import_material28.Box, { key: day.day(), textAlign: "center", py: 0.5 }, /* @__PURE__ */ import_react43.default.createElement(import_material28.Typography, { variant: "caption", color: "text.secondary" }, day.format("dddd"))))), isLoading ? /* @__PURE__ */ import_react43.default.createElement(import_material28.Box, { display: "flex", alignItems: "center", justifyContent: "center", width: "100%", height: CALENDAR_CONSTANTS.LOADING_CONTAINER_HEIGHT }, /* @__PURE__ */ import_react43.default.createElement(import_material28.CircularProgress, { sx: { width: CALENDAR_CONSTANTS.LOADING_SPINNER_SIZE, height: CALENDAR_CONSTANTS.LOADING_SPINNER_SIZE }, variant: "indeterminate" })) : !isLoading && noEvents ? /* @__PURE__ */ import_react43.default.createElement(
|
|
3925
3928
|
EmptyState,
|
|
3926
3929
|
{
|
|
3930
|
+
containerHeight: "480px",
|
|
3927
3931
|
title: "Inicia la gesti\xF3n de las actividades",
|
|
3928
3932
|
subtitle: "Selecciona un mec\xE1nico y as\xEDgnale las actividades a realizar.",
|
|
3929
3933
|
icon: /* @__PURE__ */ import_react43.default.createElement(LogoCalendario, null)
|
|
@@ -4090,6 +4094,7 @@ var WeekView = ({
|
|
|
4090
4094
|
})), isLoading ? /* @__PURE__ */ import_react44.default.createElement(import_material29.Box, { display: "flex", alignItems: "center", justifyContent: "center", width: "100%", height: "450px" }, /* @__PURE__ */ import_react44.default.createElement(import_material29.CircularProgress, { sx: { width: "60px", height: "60px" }, variant: "indeterminate" })) : !isLoading && noEvents ? /* @__PURE__ */ import_react44.default.createElement(
|
|
4091
4095
|
EmptyState,
|
|
4092
4096
|
{
|
|
4097
|
+
containerHeight: "480px",
|
|
4093
4098
|
title: "Inicia la gesti\xF3n de las actividades",
|
|
4094
4099
|
subtitle: "Selecciona un mec\xE1nico y as\xEDgnale las actividades a realizar.",
|
|
4095
4100
|
icon: /* @__PURE__ */ import_react44.default.createElement(LogoCalendario, null)
|
|
@@ -4186,6 +4191,7 @@ var DayView = ({
|
|
|
4186
4191
|
return /* @__PURE__ */ import_react45.default.createElement(import_material30.Box, { display: "flex", flexDirection: "column", height: "100%" }, /* @__PURE__ */ import_react45.default.createElement(import_material30.Box, { display: "flex", borderBottom: "1px solid", borderColor: "primary.main", bgcolor: "background.paper" }, /* @__PURE__ */ import_react45.default.createElement(import_material30.Box, { width: CALENDAR_CONSTANTS.SIDEBAR_WIDTH, bgcolor: "background.default", borderBottom: "1px solid", borderColor: "transparent" }), /* @__PURE__ */ import_react45.default.createElement(import_material30.Box, { flex: 1, display: "flex", flexDirection: "column", textAlign: "start", gap: 0.5, py: 1, bgcolor: "primary.50" }, /* @__PURE__ */ import_react45.default.createElement(import_material30.Typography, { variant: "h6", color: "text.secondary" }, currentDate.format("D")), /* @__PURE__ */ import_react45.default.createElement(import_material30.Typography, { variant: "caption", color: "text.secondary" }, currentDate.format("dddd")))), isLoading ? /* @__PURE__ */ import_react45.default.createElement(import_material30.Box, { display: "flex", alignItems: "center", justifyContent: "center", width: "100%", height: CALENDAR_CONSTANTS.LOADING_CONTAINER_HEIGHT }, /* @__PURE__ */ import_react45.default.createElement(import_material30.CircularProgress, { sx: { width: CALENDAR_CONSTANTS.LOADING_SPINNER_SIZE, height: CALENDAR_CONSTANTS.LOADING_SPINNER_SIZE }, variant: "indeterminate" })) : noEvents ? /* @__PURE__ */ import_react45.default.createElement(
|
|
4187
4192
|
EmptyState,
|
|
4188
4193
|
{
|
|
4194
|
+
containerHeight: "480px",
|
|
4189
4195
|
title: "Inicia la gesti\xF3n de las actividades",
|
|
4190
4196
|
subtitle: "Selecciona un mec\xE1nico y as\xEDgnale las actividades a realizar.",
|
|
4191
4197
|
icon: /* @__PURE__ */ import_react45.default.createElement(LogoCalendario, null)
|