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.d.cts CHANGED
@@ -106,6 +106,7 @@ interface DrawerProps<T> {
106
106
  open?: boolean;
107
107
  setOpen?: any;
108
108
  chipFilters?: any[];
109
+ typeView?: 'web' | 'mobile';
109
110
  }
110
111
 
111
112
  type ToastType = 'success' | 'error' | 'warning' | 'info';
@@ -410,7 +411,7 @@ interface SCDialogProps {
410
411
  iconTitle?: React__default.ReactNode | React__default.ReactElement | keyof typeof Muicon;
411
412
  subtitle?: string;
412
413
  content?: any;
413
- actions?: Action[];
414
+ actions?: Action[] | boolean;
414
415
  buttonDialog?: {
415
416
  icon?: string;
416
417
  text?: string;
@@ -424,10 +425,11 @@ interface SCDialogProps {
424
425
  widthContent?: 'extra-small' | 'small' | 'medium' | 'large' | 'extra-large';
425
426
  heightContent?: string;
426
427
  background?: string;
428
+ typeView?: 'web' | 'mobile';
427
429
  setShow?: React__default.Dispatch<React__default.SetStateAction<boolean>>;
428
430
  show?: boolean | any;
429
431
  }
430
- declare const SCDialog: ({ title, iconTitle, subtitle, content, actions, buttonDialog, disableClose, dividers, widthContent, heightContent, background, setShow, show }: SCDialogProps) => React__default.JSX.Element;
432
+ declare const SCDialog: ({ title, iconTitle, subtitle, content, actions, buttonDialog, disableClose, dividers, widthContent, heightContent, background, typeView, setShow, show }: SCDialogProps) => React__default.JSX.Element;
431
433
 
432
434
  interface Option$2 {
433
435
  title?: string;
@@ -555,7 +557,7 @@ declare const CALENDAR_CONSTANTS: {
555
557
  readonly GRID_TEMPLATE: "repeat(7, minmax(150px, 1fr))";
556
558
  readonly DAY_HEIGHT: 60;
557
559
  readonly SIDEBAR_WIDTH: 47;
558
- readonly MIN_CELL_HEIGHT: 120;
560
+ readonly MIN_CELL_HEIGHT: 90;
559
561
  readonly DEFAULT_START_HOUR: 0;
560
562
  readonly DEFAULT_END_HOUR: 23;
561
563
  readonly DRAWER_WIDTH: "350px";
package/dist/index.d.ts CHANGED
@@ -106,6 +106,7 @@ interface DrawerProps<T> {
106
106
  open?: boolean;
107
107
  setOpen?: any;
108
108
  chipFilters?: any[];
109
+ typeView?: 'web' | 'mobile';
109
110
  }
110
111
 
111
112
  type ToastType = 'success' | 'error' | 'warning' | 'info';
@@ -410,7 +411,7 @@ interface SCDialogProps {
410
411
  iconTitle?: React__default.ReactNode | React__default.ReactElement | keyof typeof Muicon;
411
412
  subtitle?: string;
412
413
  content?: any;
413
- actions?: Action[];
414
+ actions?: Action[] | boolean;
414
415
  buttonDialog?: {
415
416
  icon?: string;
416
417
  text?: string;
@@ -424,10 +425,11 @@ interface SCDialogProps {
424
425
  widthContent?: 'extra-small' | 'small' | 'medium' | 'large' | 'extra-large';
425
426
  heightContent?: string;
426
427
  background?: string;
428
+ typeView?: 'web' | 'mobile';
427
429
  setShow?: React__default.Dispatch<React__default.SetStateAction<boolean>>;
428
430
  show?: boolean | any;
429
431
  }
430
- declare const SCDialog: ({ title, iconTitle, subtitle, content, actions, buttonDialog, disableClose, dividers, widthContent, heightContent, background, setShow, show }: SCDialogProps) => React__default.JSX.Element;
432
+ declare const SCDialog: ({ title, iconTitle, subtitle, content, actions, buttonDialog, disableClose, dividers, widthContent, heightContent, background, typeView, setShow, show }: SCDialogProps) => React__default.JSX.Element;
431
433
 
432
434
  interface Option$2 {
433
435
  title?: string;
@@ -555,7 +557,7 @@ declare const CALENDAR_CONSTANTS: {
555
557
  readonly GRID_TEMPLATE: "repeat(7, minmax(150px, 1fr))";
556
558
  readonly DAY_HEIGHT: 60;
557
559
  readonly SIDEBAR_WIDTH: 47;
558
- readonly MIN_CELL_HEIGHT: 120;
560
+ readonly MIN_CELL_HEIGHT: 90;
559
561
  readonly DEFAULT_START_HOUR: 0;
560
562
  readonly DEFAULT_END_HOUR: 23;
561
563
  readonly DRAWER_WIDTH: "350px";
package/dist/index.js CHANGED
@@ -1868,7 +1868,7 @@ function SCAutocomplete({
1868
1868
  __spreadProps(__spreadValues({}, optionProps), {
1869
1869
  disabled: isDisabled,
1870
1870
  style: {
1871
- background: typeFormat != "multiselect" ? state.hiddenValue == getItemValue(option).value ? "#dfe6ec" : "white" : "white",
1871
+ //background: typeFormat != "multiselect" ? state.hiddenValue == getItemValue(option).value ? "#be308fff" : 'white' : 'white',
1872
1872
  padding: "7px 16px",
1873
1873
  opacity: isDisabled ? 0.5 : 1
1874
1874
  }
@@ -1937,7 +1937,8 @@ function SCAutocomplete({
1937
1937
  onClick: (event2) => {
1938
1938
  event2.stopPropagation();
1939
1939
  cleanOptions(event2);
1940
- }
1940
+ },
1941
+ disabled: state.hiddenValue.toString() == "-1" || state.hiddenValue.toString() == "" ? true : false
1941
1942
  },
1942
1943
  "Limpiar"
1943
1944
  ) : "",
@@ -1986,14 +1987,29 @@ var SCDateRange = ({
1986
1987
  const isStartEmpty = required && !state[0];
1987
1988
  const isEndEmpty = required && !state[1];
1988
1989
  const hasError = isStartEmpty || isEndEmpty;
1990
+ const minDate = new Date(2013, 0, 1);
1991
+ const [notification, setNotification] = React12.useState(false);
1989
1992
  const handleDateChange = (newValue) => {
1993
+ const minDateDayjs = dayjs("2013-01-01");
1990
1994
  const convertedValue = [
1991
1995
  newValue[0] ? dayjs(newValue[0]) : null,
1992
1996
  newValue[1] ? dayjs(newValue[1]) : null
1993
1997
  ];
1998
+ if (convertedValue[0] != null) {
1999
+ if ((!convertedValue[0].isValid() || !convertedValue[0].isAfter(minDateDayjs)) == true) {
2000
+ setNotification(true);
2001
+ return;
2002
+ }
2003
+ }
2004
+ if (convertedValue[1] != null) {
2005
+ if ((!convertedValue[1].isValid() || !convertedValue[1].isAfter(minDateDayjs)) == true) {
2006
+ setNotification(true);
2007
+ return;
2008
+ }
2009
+ }
1994
2010
  setState(convertedValue);
1995
2011
  };
1996
- return /* @__PURE__ */ React12.createElement(LocalizationProvider, { dateAdapter: AdapterDayjs, adapterLocale: "es" }, /* @__PURE__ */ React12.createElement(Box9, { sx: { width: "100%" } }, /* @__PURE__ */ React12.createElement(
2012
+ return /* @__PURE__ */ React12.createElement(React12.Fragment, null, /* @__PURE__ */ React12.createElement(LocalizationProvider, { dateAdapter: AdapterDayjs, adapterLocale: "es" }, /* @__PURE__ */ React12.createElement(Box9, { sx: { width: "100%" } }, /* @__PURE__ */ React12.createElement(
1997
2013
  DateRangePicker,
1998
2014
  {
1999
2015
  value: state,
@@ -2040,7 +2056,7 @@ var SCDateRange = ({
2040
2056
  width: "100%"
2041
2057
  }
2042
2058
  }
2043
- )));
2059
+ ))), notification && /* @__PURE__ */ React12.createElement(SCToastNotification, { title: "El Formato de la fecha no es v\xE1lido", type: "error" }));
2044
2060
  };
2045
2061
 
2046
2062
  // src/Components/Drawer/components/DrawerContent.tsx
@@ -3053,7 +3069,7 @@ import { Button as Button11, Typography as Typography14, Modal as Modal2, Dialog
3053
3069
  import Grid8 from "@mui/material/Grid";
3054
3070
  import CloseIcon2 from "@mui/icons-material/Close";
3055
3071
  import * as Muicon5 from "@mui/icons-material";
3056
- var SCDialog = ({ title, iconTitle, subtitle, content, actions, buttonDialog, disableClose, dividers, widthContent, heightContent, background, setShow, show }) => {
3072
+ var SCDialog = ({ title, iconTitle, subtitle, content, actions, buttonDialog, disableClose, dividers, widthContent, heightContent, background, typeView = "web", setShow, show }) => {
3057
3073
  let i = 0;
3058
3074
  let iconTitleValidation = "";
3059
3075
  let IconTitle;
@@ -3073,22 +3089,24 @@ var SCDialog = ({ title, iconTitle, subtitle, content, actions, buttonDialog, di
3073
3089
  ButtonIcon = Muicon5[buttonDialog == null ? void 0 : buttonDialog.icon];
3074
3090
  }
3075
3091
  }
3076
- actions == null ? void 0 : actions.map(function(option, index, array) {
3077
- if (option == null ? void 0 : option.icon) {
3078
- if ((option == null ? void 0 : option.icon.type) == void 0) {
3079
- option.icon = Muicon5[option == null ? void 0 : option.icon];
3080
- } else {
3081
- option;
3092
+ if (Array.isArray(actions)) {
3093
+ actions.map(function(option, index, array) {
3094
+ if (option == null ? void 0 : option.icon) {
3095
+ if ((option == null ? void 0 : option.icon.type) == void 0) {
3096
+ option.icon = Muicon5[option == null ? void 0 : option.icon];
3097
+ } else {
3098
+ option;
3099
+ }
3082
3100
  }
3083
- }
3084
- });
3101
+ });
3102
+ }
3085
3103
  if (iconTitle) {
3086
3104
  if (Muicon5[iconTitle] == void 0) {
3087
- if (iconTitle && React27.isValidElement(iconTitle) && iconTitle.type == void 0) {
3088
- iconTitleValidation = "image";
3089
- IconTitle = iconTitle;
3090
- } else {
3105
+ if (Muicon5[iconTitle]) {
3091
3106
  iconTitleValidation = "icon";
3107
+ IconTitle = Muicon5[iconTitle];
3108
+ } else {
3109
+ iconTitleValidation = "image";
3092
3110
  IconTitle = iconTitle;
3093
3111
  }
3094
3112
  } else {
@@ -3108,11 +3126,12 @@ var SCDialog = ({ title, iconTitle, subtitle, content, actions, buttonDialog, di
3108
3126
  setShow(false);
3109
3127
  }
3110
3128
  };
3111
- const dialogActions = actions != null ? actions : [{ text: "Cerrar", fn: handleClose }];
3129
+ const dialogActions = actions == false ? false : actions != void 0 ? actions : [{ text: "Cerrar", fn: handleClose }];
3112
3130
  content = content != null ? content : { component: /* @__PURE__ */ React27.createElement(Box13, null, " Aqui va el contenido ") };
3113
3131
  return /* @__PURE__ */ React27.createElement("div", null, buttonDialog ? /* @__PURE__ */ React27.createElement(React27.Fragment, null, buttonDialog.text != void 0 ? /* @__PURE__ */ React27.createElement(Tooltip4, { placement: "bottom-start", title: buttonDialog.tooltip != void 0 ? buttonDialog.tooltip : "", slotProps: { popper: { modifiers: [{ name: "offset", options: { offset: [0, -14] } }] } } }, /* @__PURE__ */ React27.createElement(Button11, { 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__ */ React27.createElement(ButtonIcon, null) : "" : "", endIcon: (buttonDialog == null ? void 0 : buttonDialog.iconPosition) != void 0 ? (buttonDialog == null ? void 0 : buttonDialog.iconPosition) == "right" ? /* @__PURE__ */ React27.createElement(ButtonIcon, null) : "" : "", onClick: handleOpen }, " ", (buttonDialog == null ? void 0 : buttonDialog.text) != void 0 ? buttonDialog.text : "", " ")) : /* @__PURE__ */ React27.createElement(IconButton10, { style: { cursor: "pointer" }, onClick: handleOpen }, /* @__PURE__ */ React27.createElement(SvgIcon5, { fontSize: "small", color: (buttonDialog == null ? void 0 : buttonDialog.color) != void 0 ? buttonDialog == null ? void 0 : buttonDialog.color : "action", component: ButtonIcon }))) : "", /* @__PURE__ */ React27.createElement(Modal2, { open: open || false, onClose: handleClose }, /* @__PURE__ */ React27.createElement(
3114
3132
  Dialog,
3115
3133
  {
3134
+ fullScreen: typeView === "mobile" ? true : false,
3116
3135
  "data-testid": "dialog-element",
3117
3136
  open: open || false,
3118
3137
  onClose: disableClose ? void 0 : handleClose,
@@ -3124,7 +3143,7 @@ var SCDialog = ({ title, iconTitle, subtitle, content, actions, buttonDialog, di
3124
3143
  }
3125
3144
  }
3126
3145
  },
3127
- title && /* @__PURE__ */ React27.createElement(DialogTitle, { sx: { m: 0, padding: "8px 16px 8px 16px" }, "data-testid": "dialog-icon-title" }, /* @__PURE__ */ React27.createElement(Grid8, { container: true, size: 12, sx: { justifyContent: "space-between", flexWrap: "nowrap" } }, /* @__PURE__ */ React27.createElement(Grid8, { container: true, size: 11, sx: { alignItems: "center" } }, iconTitle ? iconTitleValidation == "image" ? /* @__PURE__ */ React27.createElement(Box13, { sx: { marginRight: "16px", width: "44px", height: "44px", borderRadius: "1px" } }, /* @__PURE__ */ React27.createElement("img", { src: IconTitle, width: "44px", height: "44px" })) : /* @__PURE__ */ React27.createElement(SvgIcon5, { color: "action", fontSize: "small", component: IconTitle, sx: { marginRight: "16px" } }) : "", /* @__PURE__ */ React27.createElement(Grid8, null, /* @__PURE__ */ React27.createElement(Typography14, { color: "text.primary", variant: "h6", gutterBottom: true }, title ? title : ""), /* @__PURE__ */ React27.createElement(Typography14, { color: "text.secondary", variant: "body2", gutterBottom: true }, subtitle ? subtitle : ""))), disableClose != true ? /* @__PURE__ */ React27.createElement(IconButton10, { "data-testid": "close-dialog-button", onClick: handleClose, size: "small", color: "default", sx: { height: 22, width: 22 } }, /* @__PURE__ */ React27.createElement(CloseIcon2, null)) : "")),
3146
+ title && /* @__PURE__ */ React27.createElement(DialogTitle, { sx: { m: 0, padding: "8px 16px 8px 16px" }, "data-testid": "dialog-icon-title" }, /* @__PURE__ */ React27.createElement(Grid8, { container: true, size: 12, sx: { justifyContent: "space-between", flexWrap: "nowrap" } }, /* @__PURE__ */ React27.createElement(Grid8, { container: true, size: 11, sx: { alignItems: "center" } }, iconTitle ? iconTitleValidation == "image" ? /* @__PURE__ */ React27.createElement(Box13, { sx: { marginRight: "16px", width: "44px", height: "44px", borderRadius: "1px" } }, /* @__PURE__ */ React27.createElement("img", { src: IconTitle, width: "44px", height: "44px" })) : /* @__PURE__ */ React27.createElement(SvgIcon5, { color: "action", fontSize: "small", component: IconTitle, sx: { marginRight: "16px" } }) : "", /* @__PURE__ */ React27.createElement(Grid8, null, /* @__PURE__ */ React27.createElement(Typography14, { color: "text.primary", variant: "h6", gutterBottom: true }, title ? title : ""), /* @__PURE__ */ React27.createElement(Typography14, { color: "text.secondary", variant: "body2", gutterBottom: true }, subtitle ? subtitle : ""))), disableClose != true ? /* @__PURE__ */ React27.createElement(IconButton10, { "data-testid": "close-dialog-button", onClick: handleClose, size: "small", color: "default", sx: { height: 22, width: 22 } }, /* @__PURE__ */ React27.createElement(CloseIcon2, { color: "action" })) : "")),
3128
3147
  /* @__PURE__ */ React27.createElement(
3129
3148
  DialogContent,
3130
3149
  {
@@ -3163,7 +3182,7 @@ var SCDialog = ({ title, iconTitle, subtitle, content, actions, buttonDialog, di
3163
3182
  }
3164
3183
  ) : content.component
3165
3184
  ),
3166
- dialogActions.length > 0 ? /* @__PURE__ */ React27.createElement(DialogActions, { sx: { gap: 1, m: 0, padding: "12px 16px 12px 16px", justifyContent: dialogActions.length >= 3 ? "space-between" : "flex-end" } }, dialogActions.length >= 3 ? /* @__PURE__ */ React27.createElement(React27.Fragment, null, /* @__PURE__ */ React27.createElement(
3185
+ dialogActions != void 0 && dialogActions != false ? Array.isArray(dialogActions) && (dialogActions == null ? void 0 : dialogActions.length) > 0 ? /* @__PURE__ */ React27.createElement(DialogActions, { sx: { gap: 1, m: 0, padding: "12px 16px 12px 16px", justifyContent: dialogActions.length >= 3 ? "space-between" : "flex-end" } }, dialogActions.length >= 3 ? /* @__PURE__ */ React27.createElement(React27.Fragment, null, /* @__PURE__ */ React27.createElement(
3167
3186
  Button11,
3168
3187
  {
3169
3188
  variant: "text",
@@ -3202,7 +3221,7 @@ var SCDialog = ({ title, iconTitle, subtitle, content, actions, buttonDialog, di
3202
3221
  },
3203
3222
  boton.text
3204
3223
  );
3205
- })) : ""
3224
+ })) : "" : ""
3206
3225
  )));
3207
3226
  };
3208
3227
 
@@ -3783,7 +3802,7 @@ var CALENDAR_CONSTANTS = {
3783
3802
  GRID_TEMPLATE: "repeat(7, minmax(150px, 1fr))",
3784
3803
  DAY_HEIGHT: 60,
3785
3804
  SIDEBAR_WIDTH: 47,
3786
- MIN_CELL_HEIGHT: 120,
3805
+ MIN_CELL_HEIGHT: 90,
3787
3806
  DEFAULT_START_HOUR: 0,
3788
3807
  DEFAULT_END_HOUR: 23,
3789
3808
  DRAWER_WIDTH: "350px",
@@ -3847,6 +3866,7 @@ var MonthView = ({ events, isLoading, onDayClick, onMoreClick, currentDate, onEv
3847
3866
  return /* @__PURE__ */ React36.createElement(Box20, { width: "100%", sx: { overflowX: "auto" } }, /* @__PURE__ */ React36.createElement(Box20, { minWidth: CALENDAR_CONSTANTS.MIN_WIDTH }, /* @__PURE__ */ React36.createElement(Box20, { display: "grid", gridTemplateColumns: CALENDAR_CONSTANTS.GRID_TEMPLATE, gap: 0.5, mb: 1 }, weekDays.map((day) => /* @__PURE__ */ React36.createElement(Box20, { key: day.day(), textAlign: "center", py: 0.5 }, /* @__PURE__ */ React36.createElement(Typography21, { variant: "caption", color: "text.secondary" }, day.format("dddd"))))), isLoading ? /* @__PURE__ */ React36.createElement(Box20, { display: "flex", alignItems: "center", justifyContent: "center", width: "100%", height: CALENDAR_CONSTANTS.LOADING_CONTAINER_HEIGHT }, /* @__PURE__ */ React36.createElement(CircularProgress2, { sx: { width: CALENDAR_CONSTANTS.LOADING_SPINNER_SIZE, height: CALENDAR_CONSTANTS.LOADING_SPINNER_SIZE }, variant: "indeterminate" })) : !isLoading && noEvents ? /* @__PURE__ */ React36.createElement(
3848
3867
  EmptyState,
3849
3868
  {
3869
+ containerHeight: "480px",
3850
3870
  title: "Inicia la gesti\xF3n de las actividades",
3851
3871
  subtitle: "Selecciona un mec\xE1nico y as\xEDgnale las actividades a realizar.",
3852
3872
  icon: /* @__PURE__ */ React36.createElement(LogoCalendario, null)
@@ -4013,6 +4033,7 @@ var WeekView = ({
4013
4033
  })), isLoading ? /* @__PURE__ */ React37.createElement(Box21, { display: "flex", alignItems: "center", justifyContent: "center", width: "100%", height: "450px" }, /* @__PURE__ */ React37.createElement(CircularProgress3, { sx: { width: "60px", height: "60px" }, variant: "indeterminate" })) : !isLoading && noEvents ? /* @__PURE__ */ React37.createElement(
4014
4034
  EmptyState,
4015
4035
  {
4036
+ containerHeight: "480px",
4016
4037
  title: "Inicia la gesti\xF3n de las actividades",
4017
4038
  subtitle: "Selecciona un mec\xE1nico y as\xEDgnale las actividades a realizar.",
4018
4039
  icon: /* @__PURE__ */ React37.createElement(LogoCalendario, null)
@@ -4109,6 +4130,7 @@ var DayView = ({
4109
4130
  return /* @__PURE__ */ React38.createElement(Box22, { display: "flex", flexDirection: "column", height: "100%" }, /* @__PURE__ */ React38.createElement(Box22, { display: "flex", borderBottom: "1px solid", borderColor: "primary.main", bgcolor: "background.paper" }, /* @__PURE__ */ React38.createElement(Box22, { width: CALENDAR_CONSTANTS.SIDEBAR_WIDTH, bgcolor: "background.default", borderBottom: "1px solid", borderColor: "transparent" }), /* @__PURE__ */ React38.createElement(Box22, { flex: 1, display: "flex", flexDirection: "column", textAlign: "start", gap: 0.5, py: 1, bgcolor: "primary.50" }, /* @__PURE__ */ React38.createElement(Typography23, { variant: "h6", color: "text.secondary" }, currentDate.format("D")), /* @__PURE__ */ React38.createElement(Typography23, { variant: "caption", color: "text.secondary" }, currentDate.format("dddd")))), isLoading ? /* @__PURE__ */ React38.createElement(Box22, { display: "flex", alignItems: "center", justifyContent: "center", width: "100%", height: CALENDAR_CONSTANTS.LOADING_CONTAINER_HEIGHT }, /* @__PURE__ */ React38.createElement(CircularProgress4, { sx: { width: CALENDAR_CONSTANTS.LOADING_SPINNER_SIZE, height: CALENDAR_CONSTANTS.LOADING_SPINNER_SIZE }, variant: "indeterminate" })) : noEvents ? /* @__PURE__ */ React38.createElement(
4110
4131
  EmptyState,
4111
4132
  {
4133
+ containerHeight: "480px",
4112
4134
  title: "Inicia la gesti\xF3n de las actividades",
4113
4135
  subtitle: "Selecciona un mec\xE1nico y as\xEDgnale las actividades a realizar.",
4114
4136
  icon: /* @__PURE__ */ React38.createElement(LogoCalendario, null)