componentes-sinco 1.1.18 → 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 +48 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +47 -5
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
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
|
-
|
|
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
|
};
|
|
@@ -5697,11 +5733,17 @@ var SCDatePicker = ({ label, required, disabled, background, state, setState, wi
|
|
|
5697
5733
|
minDate: (0, import_dayjs11.default)("2015-01-01"),
|
|
5698
5734
|
maxDate: (0, import_dayjs11.default)().add(3, "month"),
|
|
5699
5735
|
sx: {
|
|
5700
|
-
minWidth:
|
|
5736
|
+
minWidth: 120,
|
|
5701
5737
|
width: width || "100%",
|
|
5702
5738
|
background: background || "transparent",
|
|
5703
5739
|
"& .MuiPickersInputBase-sectionsContainer": {
|
|
5704
5740
|
padding: "6px 0px"
|
|
5741
|
+
},
|
|
5742
|
+
"& .MuiPickersOutlinedInput-root": {
|
|
5743
|
+
padding: "0px 10px !important"
|
|
5744
|
+
},
|
|
5745
|
+
"& .MuiIconButton-root": {
|
|
5746
|
+
padding: "0px 8px 0px 0px !important"
|
|
5705
5747
|
}
|
|
5706
5748
|
},
|
|
5707
5749
|
slotProps: {
|
|
@@ -7502,6 +7544,7 @@ var ADCSincoTheme = (0, import_styles3.createTheme)(__spreadValues({}, ADCTheme)
|
|
|
7502
7544
|
SCTime,
|
|
7503
7545
|
SCToastNotification,
|
|
7504
7546
|
SincoTheme,
|
|
7547
|
+
StopEvent,
|
|
7505
7548
|
ToastProgress,
|
|
7506
7549
|
capitalize,
|
|
7507
7550
|
clampEventToVisibleRange,
|