@applica-software-guru/react-admin 1.4.192 → 1.4.196

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.4.192",
3
+ "version": "1.4.196",
4
4
  "private": false,
5
5
  "repository": {
6
6
  "type": "git",
@@ -11,7 +11,7 @@ import {
11
11
  useResourceContext,
12
12
  useTranslate
13
13
  } from 'react-admin';
14
- import { Dialog, Fab, useMediaQuery } from '@mui/material';
14
+ import { Dialog, Fab, useMediaQuery, useTheme } from '@mui/material';
15
15
  import React, { useCallback, useState } from 'react';
16
16
  import { SxProps, Theme, styled } from '@mui/material/styles';
17
17
  import { PlusCircleOutlined } from '@ant-design/icons';
@@ -187,6 +187,7 @@ export function CreateInDialogButton({
187
187
  const translate = useTranslate();
188
188
  const resource = useResourceContext();
189
189
  const { openDialog, closeDialog } = useAppConfig();
190
+ const theme = useTheme();
190
191
 
191
192
  const handleOpen = useCallback(() => openDialog(resource, () => setOpen(true)), [openDialog, resource]);
192
193
  const handleClose = useCallback(() => closeDialog(resource, () => setOpen(false)), [closeDialog, resource]);
@@ -215,10 +216,9 @@ export function CreateInDialogButton({
215
216
  scroll="body"
216
217
  sx={{
217
218
  '& .MuiToolbar-root': {
219
+ borderTop: `1px solid ${theme.palette.divider}`,
218
220
  position: 'initial',
219
- paddingLeft: 2.5,
220
- paddingRight: 2.5,
221
- paddingBottom: 2.5,
221
+ padding: 2.5
222
222
  }
223
223
  }}
224
224
  onClose={handleClose}
@@ -11,7 +11,7 @@ import {
11
11
  } from 'react-admin';
12
12
  import React, { useCallback, useState } from 'react';
13
13
 
14
- import { Breakpoint, Dialog } from '@mui/material';
14
+ import { Breakpoint, Dialog, useTheme } from '@mui/material';
15
15
  import { Edit } from '@mui/icons-material';
16
16
  import { Toolbar } from '../ra-forms';
17
17
  import { useAppConfig } from '../../hooks';
@@ -87,6 +87,7 @@ export function EditInDialogButton({
87
87
  const resource = useResourceContext();
88
88
  const handleOpen = useCallback(() => openDialog(resource, () => setOpen(true)), [openDialog, resource]);
89
89
  const handleClose = useCallback(() => closeDialog(resource, () => setOpen(false)), [closeDialog, resource]);
90
+ const theme = useTheme();
90
91
 
91
92
  return (
92
93
  <>
@@ -98,10 +99,9 @@ export function EditInDialogButton({
98
99
  scroll="body"
99
100
  sx={{
100
101
  '& .MuiToolbar-root': {
102
+ borderTop: `1px solid ${theme.palette.divider}`,
101
103
  position: 'initial',
102
- paddingLeft: 2.5,
103
- paddingRight: 2.5,
104
- paddingBottom: 2.5,
104
+ padding: 2.5
105
105
  }
106
106
  }}
107
107
  onClose={handleClose}
@@ -66,8 +66,15 @@ type StyledFormProps = {
66
66
  const StyledForm = styled(Form, { slot: 'root' })(({ theme, spacing }: StyledFormProps) => ({
67
67
  backgroundColor: 'transparent',
68
68
  '& .RaToolbar-desktopToolbar': {
69
- marginTop: theme.spacing((spacing as number) * 2),
70
- padding: 0
69
+ marginTop: theme.spacing((spacing as number) * 1.25),
70
+ padding: 0,
71
+ minHeight: 'unset'
72
+ },
73
+ '& .RaToolbar-mobileToolbar': {
74
+ paddingTop: '20px !important',
75
+ paddingRight: '0 !important',
76
+ paddingLeft: '0 !important',
77
+ paddingBottom: 0,
71
78
  }
72
79
  }));
73
80
 
@@ -81,6 +81,12 @@ export const Create = styled(CreateWithDefaults, { slot: 'root' })(({ theme }) =
81
81
  '& .RaCreate-main>.MuiPaper-root:first-of-type': {
82
82
  backgroundColor: theme.palette.background.default
83
83
  },
84
+ '& .RaToolbar-mobileToolbar': {
85
+ position: 'initial !important',
86
+ paddingLeft: '20px !important',
87
+ paddingRight: '20px !important',
88
+ paddingTop: '0 !important',
89
+ },
84
90
  // Ci ho messo 4 ore per scrivere questa riga di codice e risolvere un problema con react-sticky-box ed i Long Form.
85
91
  // L'overflow è di default 'hidden', a noi serve visibile per consentire a react-sticky-box di funzionare e gestire la visiblità con ancore
86
92
  // di tutti gli elementi presenti all'interno della pagina.
@@ -15,7 +15,10 @@ const StyledEdit = styled(RaEdit, { slot: 'root' })(({ theme }) => ({
15
15
  },
16
16
 
17
17
  '& .RaToolbar-mobileToolbar': {
18
- borderTop: `1px solid ${theme.palette.divider}`
18
+ position: 'initial !important',
19
+ paddingLeft: '20px !important',
20
+ paddingRight: '20px !important',
21
+ paddingTop: '0 !important'
19
22
  },
20
23
  '& .RaEdit-main': {
21
24
  marginTop: 0
@@ -16,11 +16,11 @@ const StyledGrid = styled(Grid, {
16
16
  // Other toolbars must be handled outside this rule.
17
17
  '& .MuiToolbar-root.RaToolbar-desktopToolbar': {
18
18
  position: 'initial',
19
- marginTop: theme.spacing(2.5),
19
+ // marginTop: theme.spacing(2.5),
20
20
  marginLeft: `-${theme.spacing(3)}`,
21
21
  marginRight: `-${theme.spacing(3)}`,
22
22
  marginBottom: `-${theme.spacing(2)}`,
23
- borderTop: `1px solid ${theme.palette.divider}`,
23
+ // borderTop: `1px solid ${theme.palette.divider}`,
24
24
  paddingTop: theme.spacing(2.5),
25
25
  paddingBottom: theme.spacing(2.5),
26
26
  [theme.breakpoints.down('sm')]: {
@@ -29,6 +29,13 @@ const StyledGrid = styled(Grid, {
29
29
  marginRight: 0
30
30
  }
31
31
  },
32
+ '& .RaToolbar-mobileToolbar': {
33
+ position: 'initial !important',
34
+ paddingTop: '20px !important',
35
+ paddingLeft: '0 !important',
36
+ paddingRight: '0 !important',
37
+ paddingBottom: '0 !important',
38
+ },
32
39
  '& form > .MuiToolbar-root': {
33
40
  // This is really important: this rule is used to insert forms inside other forms, avoiding
34
41
  // the toolbar of the inner form to receive the styles of the previous rule (which generates a strange padding).
@@ -15,9 +15,9 @@ const StyledSimpleForm = styled(RaSimpleForm, { slot: 'Root' })(({ theme, modal
15
15
  '& .MuiGrid-root.MuiGrid-container': {
16
16
  paddingBottom: theme.spacing(modal ? 0 : 2.5)
17
17
  } as any,
18
- [theme.breakpoints.down('sm')]: {
19
- paddingBottom: 0
20
- }
18
+ // [theme.breakpoints.down('sm')]: {
19
+ paddingBottom: '0 !important',
20
+ // }
21
21
  }));
22
22
 
23
23
  export type SimpleFormProps = RaSimpleFormProps & {
@@ -80,7 +80,10 @@ export function TabbedForm(props: TabbedFormProps): JSX.Element {
80
80
  ml: 2.5,
81
81
  mr: 2.5
82
82
  },
83
-
83
+ '& .MuiToolbar-root.RaToolbar-desktopToolbar': {
84
+ position: 'initial',
85
+ paddingTop: 0
86
+ },
84
87
  '& .MuiToolbar-root': {
85
88
  padding: 2.5
86
89
  }
@@ -161,8 +161,8 @@ export function RawTableFormIterator(props: TableFormIteratorProps): ReactElemen
161
161
  sx={
162
162
  inset === true
163
163
  ? {
164
- borderRadius: 0
165
- }
164
+ borderRadius: 0
165
+ }
166
166
  : { mt: 2, border: `1px solid ${tableBorderColor}` }
167
167
  }
168
168
  >
@@ -277,8 +277,9 @@ function AddTableRow(props: any): JSX.Element {
277
277
  export const TableFormIterator = styled(RawTableFormIterator, { slot: 'Root' })(({ theme }) => ({
278
278
  '& > div.MuiPaper-root': {
279
279
  overflowX: 'auto',
280
+ // this decision has been made with Roberto in order to avoid Marco gets angry
280
281
  [theme.breakpoints.down('sm')]: {
281
- width: `calc(100vw - ${theme.spacing(8)})`
282
+ width: `calc(100vw - ${theme.spacing(8.25)})`
282
283
  }
283
284
  },
284
285
  [theme.breakpoints.down('sm')]: {