componentes-sinco 1.0.31 → 1.0.33

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
@@ -3863,7 +3879,7 @@ var CALENDAR_CONSTANTS = {
3863
3879
  GRID_TEMPLATE: "repeat(7, minmax(150px, 1fr))",
3864
3880
  DAY_HEIGHT: 60,
3865
3881
  SIDEBAR_WIDTH: 47,
3866
- MIN_CELL_HEIGHT: 99,
3882
+ MIN_CELL_HEIGHT: 90,
3867
3883
  DEFAULT_START_HOUR: 0,
3868
3884
  DEFAULT_END_HOUR: 23,
3869
3885
  DRAWER_WIDTH: "350px",