componentes-sinco 1.1.17 → 1.1.19

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
@@ -113,6 +113,7 @@ __export(index_exports, {
113
113
  SCTime: () => SCTime,
114
114
  SCToastNotification: () => SCToastNotification,
115
115
  SincoTheme: () => SincoTheme,
116
+ StopEvent: () => StopEvent,
116
117
  ToastProgress: () => ToastProgress,
117
118
  capitalize: () => capitalize,
118
119
  clampEventToVisibleRange: () => clampEventToVisibleRange,
@@ -1789,6 +1790,20 @@ var import_react15 = __toESM(require("react"), 1);
1789
1790
  var import_material9 = require("@mui/material");
1790
1791
  var import_icons_material8 = require("@mui/icons-material");
1791
1792
  var Muicon4 = __toESM(require("@mui/icons-material"), 1);
1793
+ var StopEvent = ({ children }) => {
1794
+ return /* @__PURE__ */ import_react15.default.createElement(
1795
+ "span",
1796
+ {
1797
+ onMouseDown: (e) => {
1798
+ e.preventDefault();
1799
+ e.stopPropagation();
1800
+ },
1801
+ onClick: (e) => e.stopPropagation(),
1802
+ style: { display: "inline-flex", alignItems: "center" }
1803
+ },
1804
+ children
1805
+ );
1806
+ };
1792
1807
  function SCAutocomplete({
1793
1808
  label = "",
1794
1809
  data,
@@ -1893,9 +1908,19 @@ function SCAutocomplete({
1893
1908
  const selectedValue = typeFormat === "multiselect" ? selectedOptions : originalData.find(
1894
1909
  (item) => getItemValue(item).value === state.hiddenValue
1895
1910
  ) || null;
1911
+ const [open, setOpen] = import_react15.default.useState(false);
1912
+ const hayOnComponentClickGlobal = import_react15.default.useMemo(() => {
1913
+ return data.some((opt) => Boolean(getItemValue(opt).onComponentClick));
1914
+ }, [data]);
1896
1915
  return /* @__PURE__ */ import_react15.default.createElement(import_react15.default.Fragment, null, data && /* @__PURE__ */ import_react15.default.createElement(
1897
1916
  import_material9.Autocomplete,
1898
- {
1917
+ __spreadProps(__spreadValues(__spreadValues(__spreadValues({}, hayOnComponentClickGlobal ? { open } : {}), hayOnComponentClickGlobal ? { onOpen: () => setOpen(true) } : {}), hayOnComponentClickGlobal ? {
1918
+ onClose: (event2, reason) => {
1919
+ debugger;
1920
+ if (reason === "blur") return;
1921
+ setOpen(false);
1922
+ }
1923
+ } : {}), {
1899
1924
  multiple: typeFormat === "multiselect",
1900
1925
  clearOnEscape: true,
1901
1926
  noOptionsText: "No se encuentra",
@@ -1952,9 +1977,11 @@ function SCAutocomplete({
1952
1977
  isValid = group == option[columnGroup];
1953
1978
  group = option[columnGroup];
1954
1979
  }
1980
+ const item = getItemValue(option);
1955
1981
  return /* @__PURE__ */ import_react15.default.createElement(import_react15.default.Fragment, null, /* @__PURE__ */ import_react15.default.createElement(import_react15.default.Fragment, { key }, columnGroup ? !isValid ? /* @__PURE__ */ import_react15.default.createElement(import_material9.Typography, { color: "text.secondary", sx: { margin: "7px 16px !important", fontSize: "13px !important" } }, option[columnGroup]) : "" : "", /* @__PURE__ */ import_react15.default.createElement(
1956
1982
  import_material9.MenuItem,
1957
1983
  __spreadProps(__spreadValues({}, optionProps), {
1984
+ component: "li",
1958
1985
  disabled: isDisabled,
1959
1986
  style: {
1960
1987
  //background: typeFormat != "multiselect" ? state.hiddenValue == getItemValue(option).value ? "#be308fff" : 'white' : 'white',
@@ -1973,7 +2000,16 @@ function SCAutocomplete({
1973
2000
  }
1974
2001
  ) : "",
1975
2002
  /* @__PURE__ */ import_react15.default.createElement(import_material9.ListItemText, { primary: getItemValue(option).text, color: "text.primary" }),
1976
- getItemValue(option).component != void 0 ? getItemValue(option).component : ""
2003
+ item.component != null ? /* @__PURE__ */ import_react15.default.createElement(StopEvent, null, /* @__PURE__ */ import_react15.default.createElement(
2004
+ "span",
2005
+ {
2006
+ onClick: (e) => {
2007
+ var _a2;
2008
+ (_a2 = item.onComponentClick) == null ? void 0 : _a2.call(item, e, option);
2009
+ }
2010
+ },
2011
+ item.component
2012
+ )) : null
1977
2013
  )));
1978
2014
  },
1979
2015
  renderInput: (params) => /* @__PURE__ */ import_react15.default.createElement(import_react15.default.Fragment, null, /* @__PURE__ */ import_react15.default.createElement(
@@ -2052,7 +2088,7 @@ function SCAutocomplete({
2052
2088
  })
2053
2089
  }
2054
2090
  }
2055
- }
2091
+ })
2056
2092
  ));
2057
2093
  }
2058
2094
 
@@ -2371,7 +2407,7 @@ var DrawerHeader = ({
2371
2407
  alignContent: "center"
2372
2408
  }
2373
2409
  },
2374
- /* @__PURE__ */ import_react19.default.createElement(import_material13.Typography, { variant: "h6", color: colorTitle || "text.primary" }, title != null ? title : "Personaliza tu b\xFAsqueda"),
2410
+ /* @__PURE__ */ import_react19.default.createElement(import_material13.Typography, { variant: filterSideCard ? "body2" : "h6", color: colorTitle || "text.primary" }, title != null ? title : "Personaliza tu b\xFAsqueda"),
2375
2411
  filterSideCard ? /* @__PURE__ */ import_react19.default.createElement(import_react19.default.Fragment, null, filterSideCard) : /* @__PURE__ */ import_react19.default.createElement(import_material13.IconButton, { onClick: onClose }, /* @__PURE__ */ import_react19.default.createElement(import_Close.default, { "data-testid": "test-button-close", sx: { color: "text.primary" } }))
2376
2412
  );
2377
2413
  };
@@ -2389,8 +2425,7 @@ function SCDrawer({
2389
2425
  setOpen,
2390
2426
  chipFilters,
2391
2427
  heightDrawer = 456,
2392
- filterSideCard,
2393
- ref
2428
+ filterSideCard
2394
2429
  }) {
2395
2430
  const drawerBleeding = heightDrawer;
2396
2431
  const { drawerOpen, handleDrawerClose, toggleDrawer } = useDrawerState({ open, setOpen });
@@ -2417,7 +2452,6 @@ function SCDrawer({
2417
2452
  );
2418
2453
  }
2419
2454
  };
2420
- const containerRef = import_react20.default.useRef(null);
2421
2455
  const handleCleanFilters = () => {
2422
2456
  cleanAllFilters(arrayElements, setTextFilters);
2423
2457
  };
@@ -2474,8 +2508,8 @@ function SCDrawer({
2474
2508
  }
2475
2509
  },
2476
2510
  ModalProps: {
2477
- container: ref == null ? void 0 : ref.current,
2478
2511
  keepMounted: true,
2512
+ disablePortal: filterSideCard ? true : false,
2479
2513
  slotProps: {
2480
2514
  root: {
2481
2515
  style: {
@@ -3267,7 +3301,7 @@ function SCDataGridInitial({ data, columns, getRowId, groupColumns, rowsTable, r
3267
3301
  "maxHeight": "0px !important"
3268
3302
  },
3269
3303
  "& .MuiDataGrid-cell": {
3270
- padding: "0 !important",
3304
+ //padding: '0 !important', //padding de cada celda
3271
3305
  background: "white"
3272
3306
  },
3273
3307
  // Fila seleccionada (cuando selectionModel selecciona filas)
@@ -5699,11 +5733,17 @@ var SCDatePicker = ({ label, required, disabled, background, state, setState, wi
5699
5733
  minDate: (0, import_dayjs11.default)("2015-01-01"),
5700
5734
  maxDate: (0, import_dayjs11.default)().add(3, "month"),
5701
5735
  sx: {
5702
- minWidth: 140,
5736
+ minWidth: 120,
5703
5737
  width: width || "100%",
5704
5738
  background: background || "transparent",
5705
5739
  "& .MuiPickersInputBase-sectionsContainer": {
5706
5740
  padding: "6px 0px"
5741
+ },
5742
+ "& .MuiPickersOutlinedInput-root": {
5743
+ padding: "0px 10px !important"
5744
+ },
5745
+ "& .MuiIconButton-root": {
5746
+ padding: "0px 8px 0px 0px !important"
5707
5747
  }
5708
5748
  },
5709
5749
  slotProps: {
@@ -7504,6 +7544,7 @@ var ADCSincoTheme = (0, import_styles3.createTheme)(__spreadValues({}, ADCTheme)
7504
7544
  SCTime,
7505
7545
  SCToastNotification,
7506
7546
  SincoTheme,
7547
+ StopEvent,
7507
7548
  ToastProgress,
7508
7549
  capitalize,
7509
7550
  clampEventToVisibleRange,