@applica-software-guru/react-admin 1.0.35 → 1.0.36

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.
@@ -1,4 +1,4 @@
1
- export default function Autocomplete(): {
1
+ export default function Autocomplete(theme: any): {
2
2
  MuiAutocomplete: {
3
3
  styleOverrides: {
4
4
  root: {
@@ -10,6 +10,9 @@ export default function Autocomplete(): {
10
10
  width: string;
11
11
  height: string;
12
12
  };
13
+ popper: {
14
+ border: string;
15
+ };
13
16
  clearIndicator: {
14
17
  width: string;
15
18
  height: string;
@@ -1 +1 @@
1
- {"version":3,"file":"Autocomplete.d.ts","sourceRoot":"","sources":["../../../../src/themes/overrides/Autocomplete.jsx"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;EAoBC"}
1
+ {"version":3,"file":"Autocomplete.d.ts","sourceRoot":"","sources":["../../../../src/themes/overrides/Autocomplete.jsx"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;EAuBC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applica-software-guru/react-admin",
3
- "version": "1.0.35",
3
+ "version": "1.0.36",
4
4
  "private": false,
5
5
  "repository": {
6
6
  "type": "git",
@@ -1,5 +1,3 @@
1
- import * as React from 'react'
2
-
3
1
  import { CoreAdminContext } from 'react-admin'
4
2
  import PropTypes from 'prop-types'
5
3
  import { ScrollTop } from './components'
@@ -13,14 +11,14 @@ const AdminContext = ({ children, theme, ...props }) => (
13
11
  </CoreAdminContext>
14
12
  )
15
13
 
16
- AdminContext.displayName = 'AdminContext'
14
+ AdminContext.displayName = 'ApplicaAdminContext'
17
15
  AdminContext.defaultProps = {
18
- ...CoreAdminContext.defaultProps,
16
+ ...CoreAdminContext.defaultProps
19
17
  }
20
18
  AdminContext.propTypes = {
21
19
  ...CoreAdminContext.propTypes,
22
20
  children: PropTypes.node.isRequired,
23
- theme: PropTypes.oneOfType([PropTypes.object, PropTypes.func]),
21
+ theme: PropTypes.oneOfType([PropTypes.object, PropTypes.func])
24
22
  }
25
23
 
26
24
  export default AdminContext
@@ -0,0 +1,14 @@
1
+ import { SimpleFormIterator as RaSimpleFormIterator } from 'ra-ui-materialui'
2
+ import { styled } from '@mui/material/styles'
3
+
4
+ export const SimpleFormIterator = styled(RaSimpleFormIterator, {
5
+ name: 'ApplicaSimpleFormIterator',
6
+ root: 'root'
7
+ })(({ theme }) => ({
8
+ '& .RaSimpleFormIterator-line': {
9
+ paddingTop: theme.spacing(1),
10
+ paddingBottom: theme.spacing(0.5),
11
+ }
12
+ }))
13
+
14
+ export default SimpleFormIterator
@@ -3,6 +3,7 @@ import Edit from './Edit'
3
3
  import FormHeader from './FormHeader'
4
4
  import LongForm from './LongForm'
5
5
  import SimpleForm from './SimpleForm'
6
+ import SimpleFormIterator from './SimpleFormIterator'
6
7
  import TabbedForm from './TabbedForm'
7
8
  import Toolbar from './Toolbar'
8
- export { CardForm, Edit, FormHeader, LongForm, SimpleForm, TabbedForm, Toolbar }
9
+ export { CardForm, Edit, FormHeader, LongForm, SimpleForm, SimpleFormIterator, TabbedForm, Toolbar }
@@ -11,11 +11,16 @@ const StyledAutocompleteInput = styled(RaAutocompleteInput, {
11
11
  }
12
12
  }))
13
13
 
14
- const AutocompleteInput = ({ ...props }) => (
15
- <LabeledInput {...props}>
16
- <StyledAutocompleteInput />
17
- </LabeledInput>
18
- )
14
+ const AutocompleteInput = (props) => {
15
+ // Sanitize props removing "perPage":
16
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
17
+ const { perPage, ...rest } = props
18
+ return (
19
+ <LabeledInput {...rest}>
20
+ <StyledAutocompleteInput />
21
+ </LabeledInput>
22
+ )
23
+ }
19
24
  AutocompleteInput.propTypes = {
20
25
  ...RaAutocompleteInput.propTypes,
21
26
  ...LabeledInput.propTypes
package/src/index.jsx CHANGED
@@ -40,7 +40,6 @@ export {
40
40
  Resource,
41
41
  ResourceContextProvider,
42
42
  SaveButton,
43
- SimpleFormIterator,
44
43
  SimpleFormIteratorContext,
45
44
  SimpleList,
46
45
  SingleFieldList,
@@ -1,6 +1,6 @@
1
1
  // ==============================|| OVERRIDES - AUTOCOMPLETE ||============================== //
2
2
 
3
- export default function Autocomplete() {
3
+ export default function Autocomplete(theme) {
4
4
  return {
5
5
  MuiAutocomplete: {
6
6
  styleOverrides: {
@@ -13,6 +13,9 @@ export default function Autocomplete() {
13
13
  width: 'auto',
14
14
  height: 'auto',
15
15
  },
16
+ popper: {
17
+ border: `1px solid ${theme.palette.mode === 'dark' ? theme.palette.dark.main : theme.palette.grey[100]}`,
18
+ },
16
19
  clearIndicator: {
17
20
  width: 'auto',
18
21
  height: 'auto',
@@ -55,7 +55,7 @@ export default function ComponentsOverrides(theme) {
55
55
  AccordionSummary(theme),
56
56
  Alert(theme),
57
57
  AlertTitle(),
58
- Autocomplete(),
58
+ Autocomplete(theme),
59
59
  Badge(theme),
60
60
  Button(theme),
61
61
  ButtonBase(),