@applica-software-guru/react-admin 1.5.254 → 1.5.256

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
@@ -115,5 +115,5 @@
115
115
  "type": "module",
116
116
  "types": "dist/index.d.ts",
117
117
  "typings": "dist/index.d.ts",
118
- "version": "1.5.254"
118
+ "version": "1.5.256"
119
119
  }
@@ -1,7 +1,7 @@
1
1
  import { Button as RaButton } from './Button';
2
2
  import { Toolbar } from '@/components/ra-forms';
3
3
  import { PlusCircleOutlined } from '@ant-design/icons';
4
- import { Breakpoint, Button, Dialog } from '@mui/material';
4
+ import { Breakpoint, Button, Dialog, DialogContent } from '@mui/material';
5
5
  import { CreateBase, UseCreateMutateParams, useResourceContext, useTranslate } from 'ra-core';
6
6
  import { ButtonProps, CreateButton, CreateButtonProps, CreateProps, SaveButton } from 'ra-ui-materialui';
7
7
  import React, { Children, PropsWithChildren, useCallback, useState } from 'react';
@@ -158,24 +158,26 @@ function CreateInDialogButton(props: CreateInDialogButtonProps) {
158
158
  fullWidth={fullWidth}
159
159
  fullScreen={fullScreen}
160
160
  >
161
- {React.isValidElement(Child)
162
- ? React.cloneElement(Child, {
163
- ...Child.props,
164
- modal: true,
165
- toolbar: (
166
- <Toolbar>
167
- <Button variant="text" size="medium" onClick={handleClose}>
168
- {translate('ra.action.cancel')}
169
- </Button>
170
- {onSubmit ? (
171
- <SubmitButton onSubmit={onSubmit!} closeDialog={handleClose} />
172
- ) : (
173
- <SaveButton type="button" />
174
- )}
175
- </Toolbar>
176
- )
177
- })
178
- : null}
161
+ <DialogContent sx={{ m: 0, p: 0 }}>
162
+ {React.isValidElement(Child)
163
+ ? React.cloneElement(Child, {
164
+ ...Child.props,
165
+ modal: true,
166
+ toolbar: (
167
+ <Toolbar>
168
+ <Button variant="text" size="medium" onClick={handleClose}>
169
+ {translate('ra.action.cancel')}
170
+ </Button>
171
+ {onSubmit ? (
172
+ <SubmitButton onSubmit={onSubmit!} closeDialog={handleClose} />
173
+ ) : (
174
+ <SaveButton type="button" />
175
+ )}
176
+ </Toolbar>
177
+ )
178
+ })
179
+ : null}
180
+ </DialogContent>
179
181
  </Dialog>
180
182
  </CreateBase>
181
183
  </>
@@ -1,6 +1,6 @@
1
1
  import { Button } from './Button';
2
2
  import { Toolbar } from '@/components/ra-forms';
3
- import { Breakpoint, Dialog } from '@mui/material';
3
+ import { Breakpoint, Dialog, DialogContent } from '@mui/material';
4
4
  import { EditBase, UseUpdateMutateParams, useRecordContext } from 'ra-core';
5
5
  import { EditButton, EditProps, SaveButton } from 'ra-ui-materialui';
6
6
  import React, { Children, PropsWithChildren, useCallback, useState } from 'react';
@@ -76,7 +76,16 @@ type EditInDialogButtonProps = PropsWithChildren &
76
76
  onSubmit?: SubmitFunction;
77
77
  };
78
78
  function EditInDialogButton(props: EditInDialogButtonProps): JSX.Element {
79
- const { children, maxWidth = 'md', fullWidth = true, fullScreen, mutationOptions, onSubmit, scroll, ...rest } = props;
79
+ const {
80
+ children,
81
+ maxWidth = 'md',
82
+ fullWidth = true,
83
+ fullScreen,
84
+ mutationOptions,
85
+ onSubmit,
86
+ scroll = 'paper',
87
+ ...rest
88
+ } = props;
80
89
  const [open, setOpen] = useState(false);
81
90
  const Child = Children.only(children);
82
91
  const handleOpen = useCallback(() => setOpen(true), []);
@@ -110,28 +119,30 @@ function EditInDialogButton(props: EditInDialogButtonProps): JSX.Element {
110
119
  fullScreen={fullScreen}
111
120
  keepMounted={false}
112
121
  >
113
- {React.isValidElement(Child)
114
- ? React.cloneElement(Child, {
115
- ...Child.props,
116
- modal: true,
117
- toolbar: (
118
- <Toolbar>
119
- <Button
120
- disableIconOnly
121
- variant="text"
122
- size="medium"
123
- onClick={handleClose}
124
- label="ra.action.cancel"
125
- />
126
- {onSubmit ? (
127
- <SubmitButton onSubmit={onSubmit!} closeDialog={handleClose} />
128
- ) : (
129
- <SaveButton type="button" />
130
- )}
131
- </Toolbar>
132
- )
133
- })
134
- : null}
122
+ <DialogContent sx={{ m: 0, p: 0 }}>
123
+ {React.isValidElement(Child)
124
+ ? React.cloneElement(Child, {
125
+ ...Child.props,
126
+ modal: true,
127
+ toolbar: (
128
+ <Toolbar>
129
+ <Button
130
+ disableIconOnly
131
+ variant="text"
132
+ size="medium"
133
+ onClick={handleClose}
134
+ label="ra.action.cancel"
135
+ />
136
+ {onSubmit ? (
137
+ <SubmitButton onSubmit={onSubmit!} closeDialog={handleClose} />
138
+ ) : (
139
+ <SaveButton type="button" />
140
+ )}
141
+ </Toolbar>
142
+ )
143
+ })
144
+ : null}
145
+ </DialogContent>
135
146
  </Dialog>
136
147
  </EditBase>
137
148
  </>
@@ -1,4 +1,5 @@
1
1
  import { ImageField } from '@/components/ra-fields/ImageField';
2
+ import { SxProps } from '@mui/material';
2
3
  import { useMemo } from 'react';
3
4
  import { FieldProps, useRecordContext } from 'react-admin';
4
5
 
@@ -7,6 +8,7 @@ type CoverFieldProps = {
7
8
  height?: number | string;
8
9
  circle?: boolean;
9
10
  justify?: 'flex-start' | 'center' | 'flex-end';
11
+ sx?: SxProps;
10
12
  } & FieldProps;
11
13
 
12
14
  /**
@@ -30,15 +32,17 @@ function CoverField({
30
32
  circle: defaultCircle = false,
31
33
  justify: defaultJustify = 'flex-start',
32
34
  record: _propRecord,
35
+ sx: _sx,
33
36
  ...props
34
37
  }: CoverFieldProps): JSX.Element {
35
38
  const sx = useMemo(
36
39
  () => ({
37
40
  width: typeof defaultWidth === 'number' ? `${defaultWidth}px !important` : `${defaultWidth} !important`,
38
41
  height: typeof defaultHeight === 'number' ? `${defaultHeight}px !important` : `${defaultHeight} !important`,
39
- borderRadius: defaultCircle ? '50%' : 1.5
42
+ borderRadius: defaultCircle ? '50%' : 1.5,
43
+ ..._sx
40
44
  }),
41
- [defaultWidth, defaultHeight, defaultCircle]
45
+ [defaultWidth, defaultHeight, defaultCircle, _sx]
42
46
  );
43
47
  const _recordContext = useRecordContext();
44
48
  const record = _propRecord || _recordContext;
@@ -1,4 +1,5 @@
1
1
  import { BooleanInput, LocalizedTextInput, SimpleForm, required } from '@/';
2
+ import { ArrayInput, SimpleFormIterator } from 'ra-ui-materialui';
2
3
 
3
4
  function requiredAtLeastOneTranslation(message = 'ra.validation.at_least_one_translation') {
4
5
  return (value, values) => {