@acvl/frontend-components 0.0.3 → 0.0.6

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.
@@ -1,2 +1,2 @@
1
- export { default as editColumn } from './editColumn';
2
- export { default as deleteColumn } from './deleteColumn';
1
+ export { default as editColumn, EditGridColumnsProps } from './editColumn';
2
+ export { default as deleteColumn, DeleteGridColumnsProps } from './deleteColumn';
@@ -1,3 +1,4 @@
1
1
  export { default as Base } from './Base';
2
2
  export * from './cells';
3
3
  export * from './columns';
4
+ export { GridColDefPropsOverrides } from './types';
@@ -1,7 +1,7 @@
1
1
  import { JSX } from "react";
2
2
  import { GridColDefPropsOverrides } from "../types";
3
3
  import { BaseGridProps } from "../Base";
4
- import { EditGridColumnsProps } from "../columns/editColumn";
4
+ import { EditGridColumnsProps } from "../columns";
5
5
  export interface EditGridAPIProps {
6
6
  mutation: any;
7
7
  disabled?: boolean;
@@ -13,6 +13,8 @@ export interface EditGridAPIProps {
13
13
  [key: string]: {
14
14
  ignore?: boolean;
15
15
  format?: string;
16
+ extra_validation?: (value: string) => boolean;
17
+ alter_key?: (key: string) => string;
16
18
  };
17
19
  };
18
20
  dnd?: {
@@ -21,6 +23,7 @@ export interface EditGridAPIProps {
21
23
  [key: string]: any;
22
24
  };
23
25
  };
26
+ postAction?: (result: any) => void;
24
27
  }
25
28
  export interface EditGridWrapperProps extends Pick<BaseGridProps, 'dataGridProps'>, EditGridAPIProps {
26
29
  permission: boolean;
@@ -9,4 +9,5 @@ export * from './lib';
9
9
  export * from './menus';
10
10
  export * from './snacks';
11
11
  export * from './drawers';
12
+ export * from './types';
12
13
  export { default as theme } from './theme';
@@ -1 +1,4 @@
1
- export declare const useNavigation: () => any;
1
+ export declare const useNavigation: () => {
2
+ push: any;
3
+ back: any;
4
+ };
package/dist/esm/index.js CHANGED
@@ -1,3 +1,4 @@
1
+ 'use client';
1
2
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
3
  import { useTheme, useMediaQuery, Tooltip, IconButton, Button, Grid, FormGroup, FormHelperText as FormHelperText$1, Drawer, Box, Stack, CircularProgress, Typography as Typography$1, List as List$1, ListItem as ListItem$1, ListSubheader, styled as styled$1, LinearProgress, Autocomplete, Checkbox, Slider, Switch, InputAdornment as InputAdornment$1, ToggleButtonGroup, ToggleButton, Dialog, DialogTitle, DialogContent as DialogContent$1, DialogContentText, DialogActions as DialogActions$1, ButtonGroup, Menu, alpha as alpha$1, Link, Card, CardHeader, Avatar, CardContent, Divider as Divider$1, Popper, Grow as Grow$1, Paper, ClickAwayListener, Badge, TablePagination, NoSsr, tooltipClasses, Collapse, Fade as Fade$1, Slide, Zoom, Snackbar, lighten, createTheme as createTheme$1, responsiveFontSizes } from '@mui/material';
3
4
  import EditIcon from '@mui/icons-material/Edit';
@@ -22684,7 +22685,7 @@ const ControlledDate = (props) => {
22684
22685
 
22685
22686
  const useHasPermission = (path) => {
22686
22687
  const session = useSession();
22687
- return !!get(session, `user.permissions.${path}`);
22688
+ return !!get(session, `extraUserInfo.permissions.${path}`);
22688
22689
  };
22689
22690
 
22690
22691
  const APIContext = createContext(null);
@@ -22710,7 +22711,20 @@ const useNavigation = () => {
22710
22711
  if (!context) {
22711
22712
  throw new Error('useNavigation debe ser utilizado dentro de un NavigationContextProvider');
22712
22713
  }
22713
- return context.hook;
22714
+ const navigate = context.hook();
22715
+ const response = {
22716
+ push: undefined,
22717
+ back: undefined,
22718
+ };
22719
+ if (typeof navigate === 'function') {
22720
+ response.push = navigate;
22721
+ response.back = navigate(-1);
22722
+ }
22723
+ else {
22724
+ response.push = navigate.push;
22725
+ response.back = navigate.back();
22726
+ }
22727
+ return response;
22714
22728
  };
22715
22729
  // // Inside your shared library
22716
22730
  // export const MyCustomLink = ({ href, children, component: Component = 'a', ...props }) => {
@@ -27696,6 +27710,8 @@ const EditGridWrapper = (props) => {
27696
27710
  setErrors(prevState => produce(prevState, draft => {
27697
27711
  delete draft[newRow.id];
27698
27712
  }));
27713
+ if (props?.postAction)
27714
+ props.postAction(result);
27699
27715
  notifications.show(`Información actualizada!`, { severity: 'success' });
27700
27716
  return result.list;
27701
27717
  }