@applica-software-guru/react-admin 1.1.90 → 1.1.91

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applica-software-guru/react-admin",
3
- "version": "1.1.90",
3
+ "version": "1.1.91",
4
4
  "private": false,
5
5
  "repository": {
6
6
  "type": "git",
@@ -24,7 +24,7 @@ import { TableFormIteratorContext } from './TableFormIteratorContext';
24
24
  import { TableFormIteratorItem } from './TableFormIteratorItem';
25
25
  import { UseFieldArrayReturn } from 'react-hook-form';
26
26
  import get from 'lodash/get';
27
- import { styled } from '@mui/material/styles';
27
+ import { styled, useTheme } from '@mui/material/styles';
28
28
 
29
29
  /**
30
30
  *
@@ -48,6 +48,7 @@ const TableFormIterator = (props: TableFormIteratorProps) => {
48
48
  const { children, resource, source, label, disableActions = false, disableAdd = false, disableRemove = false, className } = props;
49
49
  const [confirmIsOpen, setConfirmIsOpen] = useState<boolean>(false);
50
50
  const { fields, remove, replace } = useArrayInput(props);
51
+ const theme = useTheme()
51
52
  const translate = useTranslate();
52
53
  const record = useRecordContext(props);
53
54
  const initialDefaultValue = useRef({});
@@ -82,7 +83,7 @@ const TableFormIterator = (props: TableFormIteratorProps) => {
82
83
  [fields.length, removeField, source]
83
84
  );
84
85
 
85
- const tableBorderColor = '#F0F0F0';
86
+ const tableBorderColor = theme.palette.mode === 'dark' ? theme.palette.grey.A400 : theme.palette.grey.A800;
86
87
 
87
88
  return fields ? (
88
89
  // @ts-ignore
@@ -171,13 +172,16 @@ const TableFormIterator = (props: TableFormIteratorProps) => {
171
172
  const AddTableRow = (props: any) => {
172
173
  const { label, disableAdd } = props;
173
174
  const { append } = useArrayInput(props);
175
+ const theme = useTheme();
176
+ const tableBorderColor = theme.palette.mode === 'dark' ? theme.palette.grey.A400 : theme.palette.grey.A800;
177
+ const iconColor = theme.palette.mode === 'light' ? '#000000' : '#FFFFFF';
174
178
 
175
179
  return (
176
180
  <Stack justifyContent={'space-between'} alignItems={'center'} flexDirection={'row'}>
177
181
  <Typography>{label}</Typography>
178
182
  {!disableAdd && (
179
- <IconButton size="small" color="secondary" sx={{ border: '1px solid #D9D9D9' }} onClick={() => append({})}>
180
- <PlusCircleOutlined style={{ color: '#000000' }} />
183
+ <IconButton size="small" color="secondary" sx={{ border: `1px solid ${tableBorderColor}` }} onClick={() => append({})}>
184
+ <PlusCircleOutlined style={{ color: iconColor }} />
181
185
  </IconButton>
182
186
  )}
183
187
  </Stack>
@@ -34,10 +34,10 @@ const UserForm = ({ configuredRoles }) => {
34
34
  </Grid>
35
35
  <Grid item lg={12} xs={12}>
36
36
  <ArrayInput source="items" label={false}>
37
- <TableFormIterator label="Ciao">
38
- <TextInput source="name" label="Giovaaaa" sx={{ minWidth: 200 }} />
39
- <TextInput source="surname" label="Weee" sx={{ minWidth: 150 }} />
40
- <SelectArrayInput source="roles" choices={configuredRoles} />
37
+ <TableFormIterator label="Informazioni utente">
38
+ <TextInput source="name" label="Name" sx={{ minWidth: 200 }} />
39
+ <TextInput source="surname" label="Surname" sx={{ minWidth: 150 }} />
40
+ <SelectArrayInput source="roles" label="Ruoli" choices={configuredRoles} />
41
41
  </TableFormIterator>
42
42
  </ArrayInput>
43
43
  </Grid>