@applica-software-guru/react-admin 1.4.188 → 1.4.191

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.188",
3
+ "version": "1.4.191",
4
4
  "private": false,
5
5
  "repository": {
6
6
  "type": "git",
@@ -17,7 +17,7 @@ const StyledMenuPopover = styled(MenuPopover, {
17
17
  '& .MuiMenuItem-root': {
18
18
  padding: 0,
19
19
  margin: 0,
20
- backgroundColor: theme.palette.background.paper,
20
+ // backgroundColor: theme.palette.background.paper,
21
21
  '& .MuiButton-startIcon': {
22
22
  marginRight: theme.spacing(0)
23
23
  }
@@ -74,6 +74,8 @@ export function ActionsMenu({ horizontal = false, children }: ActionsMenuProps):
74
74
  }
75
75
  }, []);
76
76
 
77
+ const btnAdditionalStyles = { width: '100%', justifyContent: 'flex-start' };
78
+
77
79
  return (
78
80
  <StyledRoot>
79
81
  <IconButton aria-label="more" aria-haspopup="true" onClick={handleClick} color={open ? 'inherit' : 'default'}>
@@ -82,12 +84,12 @@ export function ActionsMenu({ horizontal = false, children }: ActionsMenuProps):
82
84
  <StyledMenuPopover open={open} onClose={handleClose} arrow="right-top">
83
85
  {Children.map(
84
86
  children,
85
- (action, index) =>
86
- React.isValidElement(action) && (
87
- <MenuItem onClick={handleOnClick} key={index}>
88
- {React.cloneElement(action)}
89
- </MenuItem>
90
- )
87
+ (action, index) => React.isValidElement(action) && <MenuItem onClick={handleOnClick} key={index}>
88
+ {React.cloneElement(action,
89
+ { // @ts-ignore
90
+ style: { ...btnAdditionalStyles }
91
+ })}
92
+ </MenuItem>
91
93
  )}
92
94
  </StyledMenuPopover>
93
95
  </StyledRoot>
@@ -154,6 +154,10 @@ export type CreateInDialogButtonProps = {
154
154
  className?: string;
155
155
  sx?: SxProps;
156
156
  children: React.ReactElement;
157
+ /**
158
+ * If set to false, the button will always render as a regular button, regardless of the screen size.
159
+ */
160
+ fab: boolean;
157
161
  onSubmit?: (record: any, close: () => void) => void;
158
162
  onSuccess?: (data: any) => void;
159
163
  onError?: (error: any) => void;
@@ -171,6 +175,7 @@ export function CreateInDialogButton({
171
175
  scrollToTop = true,
172
176
  className,
173
177
  sx,
178
+ fab = true,
174
179
  onSubmit,
175
180
  onSuccess,
176
181
  onError,
@@ -183,7 +188,7 @@ export function CreateInDialogButton({
183
188
 
184
189
  const handleOpen = useCallback(() => openDialog(resource, () => setOpen(true)), [openDialog, resource]);
185
190
  const handleClose = useCallback(() => closeDialog(resource, () => setOpen(false)), [closeDialog, resource]);
186
- const isSmall = useMediaQuery((theme: Theme) => theme.breakpoints.down('md'));
191
+ const isSmall = fab && useMediaQuery((theme: Theme) => theme.breakpoints.down('md'));
187
192
  return (
188
193
  <>
189
194
  {isSmall ? (
package/src/index.jsx CHANGED
@@ -25,6 +25,7 @@ export {
25
25
  EditContextProvider,
26
26
  email,
27
27
  FieldTitle,
28
+ FilterButton,
28
29
  Form,
29
30
  FormDataConsumer,
30
31
  HttpError,