componentes-sinco 1.1.19 → 1.1.20
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 +19 -20
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +27 -28
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1792,14 +1792,15 @@ var import_icons_material8 = require("@mui/icons-material");
|
|
|
1792
1792
|
var Muicon4 = __toESM(require("@mui/icons-material"), 1);
|
|
1793
1793
|
var StopEvent = ({ children }) => {
|
|
1794
1794
|
return /* @__PURE__ */ import_react15.default.createElement(
|
|
1795
|
-
|
|
1795
|
+
import_material9.Box,
|
|
1796
1796
|
{
|
|
1797
1797
|
onMouseDown: (e) => {
|
|
1798
1798
|
e.preventDefault();
|
|
1799
1799
|
e.stopPropagation();
|
|
1800
1800
|
},
|
|
1801
1801
|
onClick: (e) => e.stopPropagation(),
|
|
1802
|
-
|
|
1802
|
+
display: "inline-flex",
|
|
1803
|
+
alignItems: "center"
|
|
1803
1804
|
},
|
|
1804
1805
|
children
|
|
1805
1806
|
);
|
|
@@ -1855,15 +1856,16 @@ function SCAutocomplete({
|
|
|
1855
1856
|
setIsUserTyping(false);
|
|
1856
1857
|
}
|
|
1857
1858
|
}, [inputValue]);
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
if ((option == null ? void 0 : option.icon.type
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1859
|
+
const normalizedData = (0, import_react15.useMemo)(() => {
|
|
1860
|
+
return data.map((option) => {
|
|
1861
|
+
if ((option == null ? void 0 : option.icon) && option.icon.type === void 0) {
|
|
1862
|
+
return __spreadProps(__spreadValues({}, option), {
|
|
1863
|
+
icon: Muicon4[option.icon]
|
|
1864
|
+
});
|
|
1864
1865
|
}
|
|
1865
|
-
|
|
1866
|
-
|
|
1866
|
+
return option;
|
|
1867
|
+
});
|
|
1868
|
+
}, [data]);
|
|
1867
1869
|
const cleanOptions = (event2) => {
|
|
1868
1870
|
setState({ hiddenValue: "-1", textValue: "" });
|
|
1869
1871
|
setSelectedOptions([]);
|
|
@@ -1909,14 +1911,16 @@ function SCAutocomplete({
|
|
|
1909
1911
|
(item) => getItemValue(item).value === state.hiddenValue
|
|
1910
1912
|
) || null;
|
|
1911
1913
|
const [open, setOpen] = import_react15.default.useState(false);
|
|
1912
|
-
const hayOnComponentClickGlobal = import_react15.
|
|
1913
|
-
return data.some((opt) =>
|
|
1914
|
+
const hayOnComponentClickGlobal = (0, import_react15.useMemo)(() => {
|
|
1915
|
+
return data.some((opt) => {
|
|
1916
|
+
const item = getItemValue(opt);
|
|
1917
|
+
return Boolean(item.onComponentClick);
|
|
1918
|
+
});
|
|
1914
1919
|
}, [data]);
|
|
1915
1920
|
return /* @__PURE__ */ import_react15.default.createElement(import_react15.default.Fragment, null, data && /* @__PURE__ */ import_react15.default.createElement(
|
|
1916
1921
|
import_material9.Autocomplete,
|
|
1917
|
-
__spreadProps(__spreadValues(__spreadValues(__spreadValues({}, hayOnComponentClickGlobal ? { open } : {}), hayOnComponentClickGlobal ? { onOpen: () => setOpen(true) } : {}), hayOnComponentClickGlobal ? {
|
|
1922
|
+
__spreadProps(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({}, hayOnComponentClickGlobal ? { disableCloseOnSelect: true } : {}), hayOnComponentClickGlobal ? { blurOnSelect: false } : {}), hayOnComponentClickGlobal ? { open } : {}), hayOnComponentClickGlobal ? { onOpen: () => setOpen(true) } : {}), hayOnComponentClickGlobal ? {
|
|
1918
1923
|
onClose: (event2, reason) => {
|
|
1919
|
-
debugger;
|
|
1920
1924
|
if (reason === "blur") return;
|
|
1921
1925
|
setOpen(false);
|
|
1922
1926
|
}
|
|
@@ -1925,7 +1929,7 @@ function SCAutocomplete({
|
|
|
1925
1929
|
clearOnEscape: true,
|
|
1926
1930
|
noOptionsText: "No se encuentra",
|
|
1927
1931
|
disabled,
|
|
1928
|
-
options:
|
|
1932
|
+
options: normalizedData,
|
|
1929
1933
|
isOptionEqualToValue: (option, value) => getItemValue(option).value === getItemValue(value).value,
|
|
1930
1934
|
onInputChange: (event2, value) => {
|
|
1931
1935
|
setInputValue(value);
|
|
@@ -3127,7 +3131,6 @@ function SCDataGridInitial({ data, columns, getRowId, groupColumns, rowsTable, r
|
|
|
3127
3131
|
const [selectionModel, setSelectionModel] = (0, import_react27.useState)([]);
|
|
3128
3132
|
(0, import_react27.useEffect)(() => {
|
|
3129
3133
|
var _a;
|
|
3130
|
-
debugger;
|
|
3131
3134
|
if (setSelectedRow) {
|
|
3132
3135
|
setSelectedRow(arrayRows[selectedIndex]);
|
|
3133
3136
|
setSelectionModel(((_a = arrayRows[selectedIndex]) == null ? void 0 : _a.id) ? [arrayRows[selectedIndex].id] : []);
|
|
@@ -3154,7 +3157,6 @@ function SCDataGridInitial({ data, columns, getRowId, groupColumns, rowsTable, r
|
|
|
3154
3157
|
dataConvert = [...dataConvert, newKeys];
|
|
3155
3158
|
});
|
|
3156
3159
|
}
|
|
3157
|
-
debugger;
|
|
3158
3160
|
setArrayRows(dataConvert);
|
|
3159
3161
|
if (arrayRows.length == 0 && (groupDataLenght < 1 && validationTreeData != true)) {
|
|
3160
3162
|
setSelectedRow && setSelectedRow(dataConvert[selectedIndex]);
|
|
@@ -3162,7 +3164,6 @@ function SCDataGridInitial({ data, columns, getRowId, groupColumns, rowsTable, r
|
|
|
3162
3164
|
}
|
|
3163
3165
|
};
|
|
3164
3166
|
const handleSelectionChange = (newSelection) => {
|
|
3165
|
-
debugger;
|
|
3166
3167
|
if (groupDataLenght > 0 && validationTreeData == true) {
|
|
3167
3168
|
let numberGrouped = 0;
|
|
3168
3169
|
let idsRowSelectBefore = [];
|
|
@@ -3183,7 +3184,6 @@ function SCDataGridInitial({ data, columns, getRowId, groupColumns, rowsTable, r
|
|
|
3183
3184
|
}
|
|
3184
3185
|
}
|
|
3185
3186
|
});
|
|
3186
|
-
debugger;
|
|
3187
3187
|
if (idRowSelect !== null) {
|
|
3188
3188
|
const soloEnArr1 = idsRowSelectBefore.filter((elemento) => !idRowSelect.includes(elemento));
|
|
3189
3189
|
const hasCommonElements = idsRowSelectBefore.some((element) => idRowSelect.includes(element));
|
|
@@ -3194,7 +3194,6 @@ function SCDataGridInitial({ data, columns, getRowId, groupColumns, rowsTable, r
|
|
|
3194
3194
|
}
|
|
3195
3195
|
}
|
|
3196
3196
|
} else {
|
|
3197
|
-
debugger;
|
|
3198
3197
|
setSelectionModel([...newSelection]);
|
|
3199
3198
|
const selectedId = newSelection[0];
|
|
3200
3199
|
const index = arrayRows.findIndex((row) => row.id === selectedId);
|