@acvl/frontend-components 0.0.7 → 0.0.8
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 +4 -5
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/src/components/v1/datagrids/wrappers/EditGridWrapper.d.ts +2 -8
- package/dist/esm/index.js +5 -6
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/src/components/v1/datagrids/wrappers/EditGridWrapper.d.ts +2 -8
- package/dist/index.d.ts +33 -40
- package/package.json +1 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { JSX } from "react";
|
|
2
|
+
import { JSONParserProps } from "../../forms";
|
|
2
3
|
import { GridColDefPropsOverrides } from "../types";
|
|
3
4
|
import { BaseGridProps } from "../Base";
|
|
4
5
|
import { EditGridColumnsProps } from "../columns";
|
|
@@ -9,14 +10,7 @@ export interface EditGridAPIProps {
|
|
|
9
10
|
options?: {
|
|
10
11
|
[key: string]: unknown[] | undefined;
|
|
11
12
|
};
|
|
12
|
-
parser?:
|
|
13
|
-
[key: string]: {
|
|
14
|
-
ignore?: boolean;
|
|
15
|
-
format?: string;
|
|
16
|
-
extra_validation?: (value: string) => boolean;
|
|
17
|
-
alter_key?: (key: string) => string;
|
|
18
|
-
};
|
|
19
|
-
};
|
|
13
|
+
parser?: JSONParserProps;
|
|
20
14
|
dnd?: {
|
|
21
15
|
field: string;
|
|
22
16
|
args?: {
|
package/dist/esm/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import { useTheme, useMediaQuery, Tooltip, IconButton, Button, Grid, FormGroup,
|
|
|
4
4
|
import EditIcon from '@mui/icons-material/Edit';
|
|
5
5
|
import * as React from 'react';
|
|
6
6
|
import React__default, { useCallback, useEffect, isValidElement, cloneElement, Children, createContext, useContext, useState, useMemo, useRef, memo, useReducer, useImperativeHandle, useLayoutEffect, Suspense, forwardRef } from 'react';
|
|
7
|
-
import { useNavigate } from 'react-router-dom';
|
|
7
|
+
import { useNavigate, useLocation } from 'react-router-dom';
|
|
8
8
|
import DeleteIcon from '@mui/icons-material/Delete';
|
|
9
9
|
import { Controller, useForm, useWatch, useFieldArray, FormProvider } from 'react-hook-form';
|
|
10
10
|
import { useSession, PageHeader, useNotifications } from '@toolpad/core';
|
|
@@ -25648,7 +25648,7 @@ const typeSwitch = ({ base_object, base_key, response, submitData, useLabel, dat
|
|
|
25648
25648
|
return;
|
|
25649
25649
|
const altered_key = invoke(props, `${base_key}.alter_key`, base_key);
|
|
25650
25650
|
const key = altered_key || base_key;
|
|
25651
|
-
const altered_obj = invoke(props, `${base_key}.alter_value`, base_object,
|
|
25651
|
+
const altered_obj = invoke(props, `${base_key}.alter_value`, base_object, submitData);
|
|
25652
25652
|
const object = altered_obj || base_object;
|
|
25653
25653
|
switch (typeof object) {
|
|
25654
25654
|
case "string":
|
|
@@ -25837,8 +25837,7 @@ const LoadingComponent = (props) => {
|
|
|
25837
25837
|
};
|
|
25838
25838
|
|
|
25839
25839
|
const _HistorialDrawer = (props) => {
|
|
25840
|
-
|
|
25841
|
-
const pathname = 'temp';
|
|
25840
|
+
const { pathname } = useLocation();
|
|
25842
25841
|
const api = useAPI();
|
|
25843
25842
|
const [getHistorial, { data, isLoading, isFetching }] = api.useLazyGetHistorialQuery();
|
|
25844
25843
|
useEffect(() => {
|
|
@@ -30687,7 +30686,7 @@ const editColumn = (props) => {
|
|
|
30687
30686
|
width: 80,
|
|
30688
30687
|
cellClassName: 'actions',
|
|
30689
30688
|
getActions: ({ id, row }) => {
|
|
30690
|
-
const canEdit = get$1(row, 'obj_permissions.
|
|
30689
|
+
const canEdit = get$1(row, 'obj_permissions.edit');
|
|
30691
30690
|
const isInEditMode = props.rowModesModel[id]?.mode === GridRowModes.Edit;
|
|
30692
30691
|
if (isInEditMode) {
|
|
30693
30692
|
return [
|
|
@@ -30696,7 +30695,7 @@ const editColumn = (props) => {
|
|
|
30696
30695
|
];
|
|
30697
30696
|
}
|
|
30698
30697
|
return [
|
|
30699
|
-
jsx(GridActionsCellItem, { icon: jsx(EditIcon, { sx: { color: 'black' } }), label: 'Editar', className: 'textPrimary', onClick: handleEditClick(id), disabled: !canEdit }, 'edit'),
|
|
30698
|
+
jsx(GridActionsCellItem, { icon: jsx(EditIcon, { sx: { color: canEdit ? 'black' : 'inherit' } }), label: 'Editar', className: 'textPrimary', onClick: handleEditClick(id), disabled: !canEdit }, 'edit'),
|
|
30700
30699
|
];
|
|
30701
30700
|
}
|
|
30702
30701
|
}];
|