@acvl/frontend-components 0.0.26 → 0.0.27
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/cjs/index.js +19 -14
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +19 -14
- package/dist/esm/index.js.map +1 -1
- package/package.json +1 -1
package/dist/esm/index.js
CHANGED
|
@@ -107,8 +107,10 @@ import { useDispatch, useSelector } from 'react-redux';
|
|
|
107
107
|
const NormalOrIcon = (props) => {
|
|
108
108
|
const theme = useTheme();
|
|
109
109
|
const belowLG = useMediaQuery(theme.breakpoints.down("lg"));
|
|
110
|
-
if ((belowLG && !(props.type == "button")) || props.type == "icon")
|
|
111
|
-
|
|
110
|
+
if ((belowLG && !(props.type == "button")) || props.type == "icon") {
|
|
111
|
+
const { startIcon, ...others } = props.buttonProps;
|
|
112
|
+
return (jsx(Tooltip, { title: props.buttonProps.children, children: jsx(IconButton, { ...others, children: startIcon }) }));
|
|
113
|
+
}
|
|
112
114
|
return jsx(Button, { ...props.buttonProps });
|
|
113
115
|
};
|
|
114
116
|
|
|
@@ -27345,11 +27347,12 @@ const EditGridWrapper = (props) => {
|
|
|
27345
27347
|
}
|
|
27346
27348
|
catch (e) {
|
|
27347
27349
|
setErrors((prevState) => produce(prevState, (draft) => {
|
|
27348
|
-
draft[newRow.id] = get(e, "data");
|
|
27350
|
+
draft[newRow.id] = get(e, "data.invalid_params");
|
|
27349
27351
|
}));
|
|
27350
27352
|
notifications.show("Error actualizando información!", { severity: "error" });
|
|
27351
27353
|
}
|
|
27352
27354
|
};
|
|
27355
|
+
const handleProcessRowUpdateError = () => { };
|
|
27353
27356
|
// ===== || KEYDOWN || ===== //
|
|
27354
27357
|
const handleKeyPress = useCallback((event) => {
|
|
27355
27358
|
if (props.permission) {
|
|
@@ -27430,6 +27433,7 @@ const EditGridWrapper = (props) => {
|
|
|
27430
27433
|
rowModesModel: rowModesModel,
|
|
27431
27434
|
onRowModesModelChange: setRowModesModel,
|
|
27432
27435
|
processRowUpdate: processRowUpdate,
|
|
27436
|
+
onProcessRowUpdateError: handleProcessRowUpdateError,
|
|
27433
27437
|
loadingParams: [loadingMutation],
|
|
27434
27438
|
}, props.dataGridProps);
|
|
27435
27439
|
const renderEditGrid = () => (jsx(DndContext, { sensors: sensors, collisionDetection: closestCenter, onDragEnd: handleDragEnd, modifiers: [restrictToVerticalAxis, restrictToWindowEdges, restrictToParentElement], autoScroll: false, children: jsx(SortableContext, { items: rows ? rows.map((row) => row.id.toString()) : [], strategy: verticalListSortingStrategy, children: props.renderFunction({
|
|
@@ -27920,7 +27924,7 @@ const MyGridEditSingleSelect = (props) => {
|
|
|
27920
27924
|
} }));
|
|
27921
27925
|
};
|
|
27922
27926
|
|
|
27923
|
-
const StyledTooltip = styled$1(({ className, ...props }) => (jsx(Tooltip, { ...props, placement:
|
|
27927
|
+
const StyledTooltip = styled$1(({ className, ...props }) => (jsx(Tooltip, { ...props, placement: "top", classes: { popper: className } })))(({ theme }) => ({
|
|
27924
27928
|
[`& .${tooltipClasses.tooltip}`]: {
|
|
27925
27929
|
backgroundColor: theme.palette.error.main,
|
|
27926
27930
|
color: theme.palette.error.contrastText,
|
|
@@ -27930,27 +27934,29 @@ const EditCellWithErrorTooltip = (props) => {
|
|
|
27930
27934
|
const { error } = props;
|
|
27931
27935
|
const renderCell = () => {
|
|
27932
27936
|
switch (props.colDef.type) {
|
|
27933
|
-
case
|
|
27937
|
+
case "boolean":
|
|
27934
27938
|
return jsx(GridEditBooleanCell, { ...props });
|
|
27935
|
-
case
|
|
27939
|
+
case "singleSelect":
|
|
27936
27940
|
return jsx(MyGridEditSingleSelect, { ...props });
|
|
27937
27941
|
default:
|
|
27938
|
-
return jsx(GridEditInputCell, { ...props, slotProps: {
|
|
27942
|
+
return (jsx(GridEditInputCell, { ...props, slotProps: {
|
|
27939
27943
|
root: {
|
|
27940
27944
|
onFocus: (e) => {
|
|
27941
|
-
if (props.field ==
|
|
27945
|
+
if (props.field == "cotizacion__total")
|
|
27942
27946
|
return e.target.select();
|
|
27943
27947
|
},
|
|
27944
|
-
}
|
|
27945
|
-
} });
|
|
27948
|
+
},
|
|
27949
|
+
} }));
|
|
27946
27950
|
}
|
|
27947
27951
|
};
|
|
27948
|
-
return (jsx(StyledTooltip, { open: !!error, title: error, children: renderCell() }));
|
|
27952
|
+
return (jsx(StyledTooltip, { open: !!error, title: error?.reason.join(", "), children: jsx("div", { style: { display: "flex" }, children: renderCell() }) }));
|
|
27949
27953
|
};
|
|
27950
27954
|
|
|
27951
27955
|
function renderEditCellWithErrorTooltip(params, mutationErrors, path) {
|
|
27952
|
-
const
|
|
27953
|
-
|
|
27956
|
+
const error = find(get(mutationErrors, params.id), function (e) {
|
|
27957
|
+
return e.name == (path || params.field);
|
|
27958
|
+
});
|
|
27959
|
+
return jsx(EditCellWithErrorTooltip, { ...params, error: error });
|
|
27954
27960
|
}
|
|
27955
27961
|
|
|
27956
27962
|
const CoverPage = (props) => {
|
|
@@ -28482,7 +28488,6 @@ function SlideTransition(props) {
|
|
|
28482
28488
|
return jsx(Slide, { ...props, direction: "left" });
|
|
28483
28489
|
}
|
|
28484
28490
|
const BaseProgressSnack = (props) => {
|
|
28485
|
-
console.log(props);
|
|
28486
28491
|
const dispatch = useDispatch();
|
|
28487
28492
|
const handleClose = (e) => {
|
|
28488
28493
|
if (e?.defaultMuiPrevented)
|