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.js
CHANGED
|
@@ -1704,20 +1704,21 @@ function SCSelect({
|
|
|
1704
1704
|
}
|
|
1705
1705
|
|
|
1706
1706
|
// src/Components/SCAutocomplete.tsx
|
|
1707
|
-
import React11, { useEffect as useEffect10 } from "react";
|
|
1707
|
+
import React11, { useEffect as useEffect10, useMemo as useMemo3 } from "react";
|
|
1708
1708
|
import { Autocomplete, Checkbox, InputAdornment as InputAdornment3, MenuItem as MenuItem2, TextField as TextField3, Typography as Typography7, SvgIcon as SvgIcon4, ListItemIcon as ListItemIcon2, ListItemText as ListItemText2, Divider as Divider3, FormControlLabel as FormControlLabel2, IconButton as IconButton7, Chip as Chip3, Box as Box8, Button as Button6, Grid as Grid3 } from "@mui/material";
|
|
1709
1709
|
import { Search, Clear } from "@mui/icons-material";
|
|
1710
1710
|
import * as Muicon4 from "@mui/icons-material";
|
|
1711
1711
|
var StopEvent = ({ children }) => {
|
|
1712
1712
|
return /* @__PURE__ */ React11.createElement(
|
|
1713
|
-
|
|
1713
|
+
Box8,
|
|
1714
1714
|
{
|
|
1715
1715
|
onMouseDown: (e) => {
|
|
1716
1716
|
e.preventDefault();
|
|
1717
1717
|
e.stopPropagation();
|
|
1718
1718
|
},
|
|
1719
1719
|
onClick: (e) => e.stopPropagation(),
|
|
1720
|
-
|
|
1720
|
+
display: "inline-flex",
|
|
1721
|
+
alignItems: "center"
|
|
1721
1722
|
},
|
|
1722
1723
|
children
|
|
1723
1724
|
);
|
|
@@ -1773,15 +1774,16 @@ function SCAutocomplete({
|
|
|
1773
1774
|
setIsUserTyping(false);
|
|
1774
1775
|
}
|
|
1775
1776
|
}, [inputValue]);
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
if ((option == null ? void 0 : option.icon.type
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1777
|
+
const normalizedData = useMemo3(() => {
|
|
1778
|
+
return data.map((option) => {
|
|
1779
|
+
if ((option == null ? void 0 : option.icon) && option.icon.type === void 0) {
|
|
1780
|
+
return __spreadProps(__spreadValues({}, option), {
|
|
1781
|
+
icon: Muicon4[option.icon]
|
|
1782
|
+
});
|
|
1782
1783
|
}
|
|
1783
|
-
|
|
1784
|
-
|
|
1784
|
+
return option;
|
|
1785
|
+
});
|
|
1786
|
+
}, [data]);
|
|
1785
1787
|
const cleanOptions = (event2) => {
|
|
1786
1788
|
setState({ hiddenValue: "-1", textValue: "" });
|
|
1787
1789
|
setSelectedOptions([]);
|
|
@@ -1827,14 +1829,16 @@ function SCAutocomplete({
|
|
|
1827
1829
|
(item) => getItemValue(item).value === state.hiddenValue
|
|
1828
1830
|
) || null;
|
|
1829
1831
|
const [open, setOpen] = React11.useState(false);
|
|
1830
|
-
const hayOnComponentClickGlobal =
|
|
1831
|
-
return data.some((opt) =>
|
|
1832
|
+
const hayOnComponentClickGlobal = useMemo3(() => {
|
|
1833
|
+
return data.some((opt) => {
|
|
1834
|
+
const item = getItemValue(opt);
|
|
1835
|
+
return Boolean(item.onComponentClick);
|
|
1836
|
+
});
|
|
1832
1837
|
}, [data]);
|
|
1833
1838
|
return /* @__PURE__ */ React11.createElement(React11.Fragment, null, data && /* @__PURE__ */ React11.createElement(
|
|
1834
1839
|
Autocomplete,
|
|
1835
|
-
__spreadProps(__spreadValues(__spreadValues(__spreadValues({}, hayOnComponentClickGlobal ? { open } : {}), hayOnComponentClickGlobal ? { onOpen: () => setOpen(true) } : {}), hayOnComponentClickGlobal ? {
|
|
1840
|
+
__spreadProps(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({}, hayOnComponentClickGlobal ? { disableCloseOnSelect: true } : {}), hayOnComponentClickGlobal ? { blurOnSelect: false } : {}), hayOnComponentClickGlobal ? { open } : {}), hayOnComponentClickGlobal ? { onOpen: () => setOpen(true) } : {}), hayOnComponentClickGlobal ? {
|
|
1836
1841
|
onClose: (event2, reason) => {
|
|
1837
|
-
debugger;
|
|
1838
1842
|
if (reason === "blur") return;
|
|
1839
1843
|
setOpen(false);
|
|
1840
1844
|
}
|
|
@@ -1843,7 +1847,7 @@ function SCAutocomplete({
|
|
|
1843
1847
|
clearOnEscape: true,
|
|
1844
1848
|
noOptionsText: "No se encuentra",
|
|
1845
1849
|
disabled,
|
|
1846
|
-
options:
|
|
1850
|
+
options: normalizedData,
|
|
1847
1851
|
isOptionEqualToValue: (option, value) => getItemValue(option).value === getItemValue(value).value,
|
|
1848
1852
|
onInputChange: (event2, value) => {
|
|
1849
1853
|
setInputValue(value);
|
|
@@ -2566,7 +2570,7 @@ var FooterAction = ({
|
|
|
2566
2570
|
};
|
|
2567
2571
|
|
|
2568
2572
|
// src/Components/MultiSelect/MultiSelect.tsx
|
|
2569
|
-
import React18, { useEffect as useEffect11, useMemo as
|
|
2573
|
+
import React18, { useEffect as useEffect11, useMemo as useMemo5 } from "react";
|
|
2570
2574
|
import { Button as Button9, Checkbox as Checkbox2, FormControl as FormControl3, InputAdornment as InputAdornment5, ListItemIcon as ListItemIcon3, MenuItem as MenuItem3, Popover as Popover3, Stack as Stack7, TextField as TextField4 } from "@mui/material";
|
|
2571
2575
|
import { SearchOutlined } from "@mui/icons-material";
|
|
2572
2576
|
|
|
@@ -2618,15 +2622,15 @@ function getIconMultiSelect(name) {
|
|
|
2618
2622
|
}
|
|
2619
2623
|
|
|
2620
2624
|
// src/Components/MultiSelect/helpers/useFilteredItems.tsx
|
|
2621
|
-
import { useMemo as
|
|
2625
|
+
import { useMemo as useMemo4 } from "react";
|
|
2622
2626
|
function useFilteredItems(items, filterValue, getItemLabel, selectedItems) {
|
|
2623
|
-
const filteredItems =
|
|
2627
|
+
const filteredItems = useMemo4(
|
|
2624
2628
|
() => items.filter(
|
|
2625
2629
|
(item) => getItemLabel(item).toLowerCase().includes(filterValue.toLowerCase())
|
|
2626
2630
|
),
|
|
2627
2631
|
[items, filterValue, getItemLabel]
|
|
2628
2632
|
);
|
|
2629
|
-
const sortedItems =
|
|
2633
|
+
const sortedItems = useMemo4(() => {
|
|
2630
2634
|
return [
|
|
2631
2635
|
...filteredItems.filter((item) => selectedItems.includes(item)),
|
|
2632
2636
|
...filteredItems.filter((item) => !selectedItems.includes(item))
|
|
@@ -2669,7 +2673,7 @@ function MultiSelect({
|
|
|
2669
2673
|
setSelectedItems([]);
|
|
2670
2674
|
}, [items, setSelectedItems]);
|
|
2671
2675
|
const { filteredItems, sortedItems } = useFilteredItems(items, filterValue, getItemLabel, selectedItems);
|
|
2672
|
-
const Icon =
|
|
2676
|
+
const Icon = useMemo5(() => {
|
|
2673
2677
|
var _a2;
|
|
2674
2678
|
return getIconMultiSelect((_a2 = button == null ? void 0 : button.icon) != null ? _a2 : "FilterListOutlined");
|
|
2675
2679
|
}, [button == null ? void 0 : button.icon]);
|
|
@@ -3045,7 +3049,6 @@ function SCDataGridInitial({ data, columns, getRowId, groupColumns, rowsTable, r
|
|
|
3045
3049
|
const [selectionModel, setSelectionModel] = useState13([]);
|
|
3046
3050
|
useEffect13(() => {
|
|
3047
3051
|
var _a;
|
|
3048
|
-
debugger;
|
|
3049
3052
|
if (setSelectedRow) {
|
|
3050
3053
|
setSelectedRow(arrayRows[selectedIndex]);
|
|
3051
3054
|
setSelectionModel(((_a = arrayRows[selectedIndex]) == null ? void 0 : _a.id) ? [arrayRows[selectedIndex].id] : []);
|
|
@@ -3072,7 +3075,6 @@ function SCDataGridInitial({ data, columns, getRowId, groupColumns, rowsTable, r
|
|
|
3072
3075
|
dataConvert = [...dataConvert, newKeys];
|
|
3073
3076
|
});
|
|
3074
3077
|
}
|
|
3075
|
-
debugger;
|
|
3076
3078
|
setArrayRows(dataConvert);
|
|
3077
3079
|
if (arrayRows.length == 0 && (groupDataLenght < 1 && validationTreeData != true)) {
|
|
3078
3080
|
setSelectedRow && setSelectedRow(dataConvert[selectedIndex]);
|
|
@@ -3080,7 +3082,6 @@ function SCDataGridInitial({ data, columns, getRowId, groupColumns, rowsTable, r
|
|
|
3080
3082
|
}
|
|
3081
3083
|
};
|
|
3082
3084
|
const handleSelectionChange = (newSelection) => {
|
|
3083
|
-
debugger;
|
|
3084
3085
|
if (groupDataLenght > 0 && validationTreeData == true) {
|
|
3085
3086
|
let numberGrouped = 0;
|
|
3086
3087
|
let idsRowSelectBefore = [];
|
|
@@ -3101,7 +3102,6 @@ function SCDataGridInitial({ data, columns, getRowId, groupColumns, rowsTable, r
|
|
|
3101
3102
|
}
|
|
3102
3103
|
}
|
|
3103
3104
|
});
|
|
3104
|
-
debugger;
|
|
3105
3105
|
if (idRowSelect !== null) {
|
|
3106
3106
|
const soloEnArr1 = idsRowSelectBefore.filter((elemento) => !idRowSelect.includes(elemento));
|
|
3107
3107
|
const hasCommonElements = idsRowSelectBefore.some((element) => idRowSelect.includes(element));
|
|
@@ -3112,7 +3112,6 @@ function SCDataGridInitial({ data, columns, getRowId, groupColumns, rowsTable, r
|
|
|
3112
3112
|
}
|
|
3113
3113
|
}
|
|
3114
3114
|
} else {
|
|
3115
|
-
debugger;
|
|
3116
3115
|
setSelectionModel([...newSelection]);
|
|
3117
3116
|
const selectedId = newSelection[0];
|
|
3118
3117
|
const index = arrayRows.findIndex((row) => row.id === selectedId);
|
|
@@ -5066,7 +5065,7 @@ import React44, { useEffect as useEffect21, useRef as useRef8, useState as useSt
|
|
|
5066
5065
|
import Webcam from "react-webcam";
|
|
5067
5066
|
|
|
5068
5067
|
// src/Components/Adjuntar/mobile/components/button.tsx
|
|
5069
|
-
import React43, { useMemo as
|
|
5068
|
+
import React43, { useMemo as useMemo6 } from "react";
|
|
5070
5069
|
import { Button as Button18 } from "@mui/material";
|
|
5071
5070
|
|
|
5072
5071
|
// src/Components/Adjuntar/mobile/components/Utils.tsx
|
|
@@ -5092,7 +5091,7 @@ var AttachmentButton = ({ buttonAttachment, open, setOpen }) => {
|
|
|
5092
5091
|
setOpen(!open);
|
|
5093
5092
|
}
|
|
5094
5093
|
};
|
|
5095
|
-
const Icon =
|
|
5094
|
+
const Icon = useMemo6(
|
|
5096
5095
|
() => getAttachmentIcon(buttonAttachment == null ? void 0 : buttonAttachment.icon),
|
|
5097
5096
|
[buttonAttachment == null ? void 0 : buttonAttachment.icon]
|
|
5098
5097
|
);
|