@acvl/frontend-components 0.0.7 → 0.0.9

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 CHANGED
@@ -25668,7 +25668,7 @@ const typeSwitch = ({ base_object, base_key, response, submitData, useLabel, dat
25668
25668
  return;
25669
25669
  const altered_key = lodash.invoke(props, `${base_key}.alter_key`, base_key);
25670
25670
  const key = altered_key || base_key;
25671
- const altered_obj = lodash.invoke(props, `${base_key}.alter_value`, base_object, get(submitData, 'base_key'));
25671
+ const altered_obj = lodash.invoke(props, `${base_key}.alter_value`, base_object, submitData);
25672
25672
  const object = altered_obj || base_object;
25673
25673
  switch (typeof object) {
25674
25674
  case "string":
@@ -25857,8 +25857,7 @@ const LoadingComponent = (props) => {
25857
25857
  };
25858
25858
 
25859
25859
  const _HistorialDrawer = (props) => {
25860
- // const {pathname} = useLocation();
25861
- const pathname = 'temp';
25860
+ const { pathname } = reactRouterDom.useLocation();
25862
25861
  const api = useAPI();
25863
25862
  const [getHistorial, { data, isLoading, isFetching }] = api.useLazyGetHistorialQuery();
25864
25863
  React.useEffect(() => {
@@ -26597,12 +26596,10 @@ const DeleteButton = (props) => {
26597
26596
  };
26598
26597
 
26599
26598
  const SaveCancelButton = (props) => {
26600
- // const nav = useNavigation();
26601
- const handleCancel = React.useCallback(() => {
26602
- // nav.useNavigate(-1);
26603
- }, [
26604
- //useNavigate
26605
- ]);
26599
+ const navigate = reactRouterDom.useNavigate();
26600
+ const handleCancel = () => {
26601
+ navigate(-1);
26602
+ };
26606
26603
  // ===== || KEYDOWN || ===== //
26607
26604
  const handleKeyPress = React.useCallback((event) => {
26608
26605
  if (event.key === 'Escape') {
@@ -30707,7 +30704,7 @@ const editColumn = (props) => {
30707
30704
  width: 80,
30708
30705
  cellClassName: 'actions',
30709
30706
  getActions: ({ id, row }) => {
30710
- const canEdit = get(row, 'obj_permissions.can_edit');
30707
+ const canEdit = get(row, 'obj_permissions.edit');
30711
30708
  const isInEditMode = props.rowModesModel[id]?.mode === xDataGrid.GridRowModes.Edit;
30712
30709
  if (isInEditMode) {
30713
30710
  return [
@@ -30716,7 +30713,7 @@ const editColumn = (props) => {
30716
30713
  ];
30717
30714
  }
30718
30715
  return [
30719
- jsxRuntime.jsx(xDataGrid.GridActionsCellItem, { icon: jsxRuntime.jsx(EditIcon, { sx: { color: 'black' } }), label: 'Editar', className: 'textPrimary', onClick: handleEditClick(id), disabled: !canEdit }, 'edit'),
30716
+ jsxRuntime.jsx(xDataGrid.GridActionsCellItem, { icon: jsxRuntime.jsx(EditIcon, { sx: { color: canEdit ? 'black' : 'inherit' } }), label: 'Editar', className: 'textPrimary', onClick: handleEditClick(id), disabled: !canEdit }, 'edit'),
30720
30717
  ];
30721
30718
  }
30722
30719
  }];
@@ -30871,6 +30868,7 @@ const Base = (props) => {
30871
30868
  const navigate = reactRouterDom.useNavigate();
30872
30869
  React.useImperativeHandle(props.ref, () => ({
30873
30870
  getApi: () => apiRef.current,
30871
+ setFilterModel: setFilterModel,
30874
30872
  }));
30875
30873
  // ========================= || PAGINADO || ========================= //
30876
30874
  const [paginationModel, setPaginationModel] = React.useState({ page: 0, pageSize: 50 });
@@ -31647,7 +31645,7 @@ function DetailPage(props) {
31647
31645
  return (jsxRuntime.jsx(SaveCancelButton, { slotProps: {
31648
31646
  saveBtn: {
31649
31647
  loading: mutationIsLoading,
31650
- disabled: form.formState.isDirty,
31648
+ disabled: !form.formState.isDirty,
31651
31649
  ...(props.slotProps?.button?.save?.type == 'onClick' ? {
31652
31650
  type: 'button',
31653
31651
  onClick: onSubmitHandler,