componentes-sinco 1.0.30 → 1.0.32

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 CHANGED
@@ -1945,7 +1945,7 @@ function SCAutocomplete({
1945
1945
  __spreadProps(__spreadValues({}, optionProps), {
1946
1946
  disabled: isDisabled,
1947
1947
  style: {
1948
- background: typeFormat != "multiselect" ? state.hiddenValue == getItemValue(option).value ? "#dfe6ec" : "white" : "white",
1948
+ //background: typeFormat != "multiselect" ? state.hiddenValue == getItemValue(option).value ? "#be308fff" : 'white' : 'white',
1949
1949
  padding: "7px 16px",
1950
1950
  opacity: isDisabled ? 0.5 : 1
1951
1951
  }
@@ -2014,7 +2014,8 @@ function SCAutocomplete({
2014
2014
  onClick: (event2) => {
2015
2015
  event2.stopPropagation();
2016
2016
  cleanOptions(event2);
2017
- }
2017
+ },
2018
+ disabled: state.hiddenValue.toString() == "-1" || state.hiddenValue.toString() == "" ? true : false
2018
2019
  },
2019
2020
  "Limpiar"
2020
2021
  ) : "",
@@ -2063,14 +2064,29 @@ var SCDateRange = ({
2063
2064
  const isStartEmpty = required && !state[0];
2064
2065
  const isEndEmpty = required && !state[1];
2065
2066
  const hasError = isStartEmpty || isEndEmpty;
2067
+ const minDate = new Date(2013, 0, 1);
2068
+ const [notification, setNotification] = import_react16.default.useState(false);
2066
2069
  const handleDateChange = (newValue) => {
2070
+ const minDateDayjs = (0, import_dayjs.default)("2013-01-01");
2067
2071
  const convertedValue = [
2068
2072
  newValue[0] ? (0, import_dayjs.default)(newValue[0]) : null,
2069
2073
  newValue[1] ? (0, import_dayjs.default)(newValue[1]) : null
2070
2074
  ];
2075
+ if (convertedValue[0] != null) {
2076
+ if ((!convertedValue[0].isValid() || !convertedValue[0].isAfter(minDateDayjs)) == true) {
2077
+ setNotification(true);
2078
+ return;
2079
+ }
2080
+ }
2081
+ if (convertedValue[1] != null) {
2082
+ if ((!convertedValue[1].isValid() || !convertedValue[1].isAfter(minDateDayjs)) == true) {
2083
+ setNotification(true);
2084
+ return;
2085
+ }
2086
+ }
2071
2087
  setState(convertedValue);
2072
2088
  };
2073
- return /* @__PURE__ */ import_react16.default.createElement(import_LocalizationProvider.LocalizationProvider, { dateAdapter: import_AdapterDayjs.AdapterDayjs, adapterLocale: "es" }, /* @__PURE__ */ import_react16.default.createElement(import_material10.Box, { sx: { width: "100%" } }, /* @__PURE__ */ import_react16.default.createElement(
2089
+ return /* @__PURE__ */ import_react16.default.createElement(import_react16.default.Fragment, null, /* @__PURE__ */ import_react16.default.createElement(import_LocalizationProvider.LocalizationProvider, { dateAdapter: import_AdapterDayjs.AdapterDayjs, adapterLocale: "es" }, /* @__PURE__ */ import_react16.default.createElement(import_material10.Box, { sx: { width: "100%" } }, /* @__PURE__ */ import_react16.default.createElement(
2074
2090
  import_DateRangePicker.DateRangePicker,
2075
2091
  {
2076
2092
  value: state,
@@ -2117,7 +2133,7 @@ var SCDateRange = ({
2117
2133
  width: "100%"
2118
2134
  }
2119
2135
  }
2120
- )));
2136
+ ))), notification && /* @__PURE__ */ import_react16.default.createElement(SCToastNotification, { title: "El Formato de la fecha no es v\xE1lido", type: "error" }));
2121
2137
  };
2122
2138
 
2123
2139
  // src/Components/Drawer/components/DrawerContent.tsx
@@ -3130,7 +3146,7 @@ var import_material20 = require("@mui/material");
3130
3146
  var import_Grid6 = __toESM(require("@mui/material/Grid"), 1);
3131
3147
  var import_Close2 = __toESM(require("@mui/icons-material/Close"), 1);
3132
3148
  var Muicon5 = __toESM(require("@mui/icons-material"), 1);
3133
- var SCDialog = ({ title, iconTitle, subtitle, content, actions, buttonDialog, disableClose, dividers, widthContent, heightContent, background, setShow, show }) => {
3149
+ var SCDialog = ({ title, iconTitle, subtitle, content, actions, buttonDialog, disableClose, dividers, widthContent, heightContent, background, typeView = "web", setShow, show }) => {
3134
3150
  let i = 0;
3135
3151
  let iconTitleValidation = "";
3136
3152
  let IconTitle;
@@ -3150,22 +3166,24 @@ var SCDialog = ({ title, iconTitle, subtitle, content, actions, buttonDialog, di
3150
3166
  ButtonIcon = Muicon5[buttonDialog == null ? void 0 : buttonDialog.icon];
3151
3167
  }
3152
3168
  }
3153
- actions == null ? void 0 : actions.map(function(option, index, array) {
3154
- if (option == null ? void 0 : option.icon) {
3155
- if ((option == null ? void 0 : option.icon.type) == void 0) {
3156
- option.icon = Muicon5[option == null ? void 0 : option.icon];
3157
- } else {
3158
- option;
3169
+ if (Array.isArray(actions)) {
3170
+ actions.map(function(option, index, array) {
3171
+ if (option == null ? void 0 : option.icon) {
3172
+ if ((option == null ? void 0 : option.icon.type) == void 0) {
3173
+ option.icon = Muicon5[option == null ? void 0 : option.icon];
3174
+ } else {
3175
+ option;
3176
+ }
3159
3177
  }
3160
- }
3161
- });
3178
+ });
3179
+ }
3162
3180
  if (iconTitle) {
3163
3181
  if (Muicon5[iconTitle] == void 0) {
3164
- if (iconTitle && import_react33.default.isValidElement(iconTitle) && iconTitle.type == void 0) {
3165
- iconTitleValidation = "image";
3166
- IconTitle = iconTitle;
3167
- } else {
3182
+ if (Muicon5[iconTitle]) {
3168
3183
  iconTitleValidation = "icon";
3184
+ IconTitle = Muicon5[iconTitle];
3185
+ } else {
3186
+ iconTitleValidation = "image";
3169
3187
  IconTitle = iconTitle;
3170
3188
  }
3171
3189
  } else {
@@ -3185,11 +3203,12 @@ var SCDialog = ({ title, iconTitle, subtitle, content, actions, buttonDialog, di
3185
3203
  setShow(false);
3186
3204
  }
3187
3205
  };
3188
- const dialogActions = actions != null ? actions : [{ text: "Cerrar", fn: handleClose }];
3206
+ const dialogActions = actions == false ? false : actions != void 0 ? actions : [{ text: "Cerrar", fn: handleClose }];
3189
3207
  content = content != null ? content : { component: /* @__PURE__ */ import_react33.default.createElement(import_material20.Box, null, " Aqui va el contenido ") };
3190
3208
  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
3209
  import_material20.Dialog,
3192
3210
  {
3211
+ fullScreen: typeView === "mobile" ? true : false,
3193
3212
  "data-testid": "dialog-element",
3194
3213
  open: open || false,
3195
3214
  onClose: disableClose ? void 0 : handleClose,
@@ -3201,7 +3220,7 @@ var SCDialog = ({ title, iconTitle, subtitle, content, actions, buttonDialog, di
3201
3220
  }
3202
3221
  }
3203
3222
  },
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, null)) : "")),
3223
+ 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
3224
  /* @__PURE__ */ import_react33.default.createElement(
3206
3225
  import_material20.DialogContent,
3207
3226
  {
@@ -3240,7 +3259,7 @@ var SCDialog = ({ title, iconTitle, subtitle, content, actions, buttonDialog, di
3240
3259
  }
3241
3260
  ) : content.component
3242
3261
  ),
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(
3262
+ 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
3263
  import_material20.Button,
3245
3264
  {
3246
3265
  variant: "text",
@@ -3279,7 +3298,7 @@ var SCDialog = ({ title, iconTitle, subtitle, content, actions, buttonDialog, di
3279
3298
  },
3280
3299
  boton.text
3281
3300
  );
3282
- })) : ""
3301
+ })) : "" : ""
3283
3302
  )));
3284
3303
  };
3285
3304
 
@@ -3860,7 +3879,7 @@ var CALENDAR_CONSTANTS = {
3860
3879
  GRID_TEMPLATE: "repeat(7, minmax(150px, 1fr))",
3861
3880
  DAY_HEIGHT: 60,
3862
3881
  SIDEBAR_WIDTH: 47,
3863
- MIN_CELL_HEIGHT: 120,
3882
+ MIN_CELL_HEIGHT: 90,
3864
3883
  DEFAULT_START_HOUR: 0,
3865
3884
  DEFAULT_END_HOUR: 23,
3866
3885
  DRAWER_WIDTH: "350px",
@@ -3924,6 +3943,7 @@ var MonthView = ({ events, isLoading, onDayClick, onMoreClick, currentDate, onEv
3924
3943
  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
3944
  EmptyState,
3926
3945
  {
3946
+ containerHeight: "480px",
3927
3947
  title: "Inicia la gesti\xF3n de las actividades",
3928
3948
  subtitle: "Selecciona un mec\xE1nico y as\xEDgnale las actividades a realizar.",
3929
3949
  icon: /* @__PURE__ */ import_react43.default.createElement(LogoCalendario, null)
@@ -4090,6 +4110,7 @@ var WeekView = ({
4090
4110
  })), 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
4111
  EmptyState,
4092
4112
  {
4113
+ containerHeight: "480px",
4093
4114
  title: "Inicia la gesti\xF3n de las actividades",
4094
4115
  subtitle: "Selecciona un mec\xE1nico y as\xEDgnale las actividades a realizar.",
4095
4116
  icon: /* @__PURE__ */ import_react44.default.createElement(LogoCalendario, null)
@@ -4186,6 +4207,7 @@ var DayView = ({
4186
4207
  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
4208
  EmptyState,
4188
4209
  {
4210
+ containerHeight: "480px",
4189
4211
  title: "Inicia la gesti\xF3n de las actividades",
4190
4212
  subtitle: "Selecciona un mec\xE1nico y as\xEDgnale las actividades a realizar.",
4191
4213
  icon: /* @__PURE__ */ import_react45.default.createElement(LogoCalendario, null)