@applica-software-guru/react-admin 1.0.38 → 1.0.39

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.
Files changed (29) hide show
  1. package/dist/components/ra-inputs/BooleanInput.d.ts +2 -0
  2. package/dist/components/ra-inputs/BooleanInput.d.ts.map +1 -1
  3. package/dist/components/ra-inputs/DateInput.d.ts +1 -0
  4. package/dist/components/ra-inputs/LabeledInput.d.ts +5 -1
  5. package/dist/components/ra-inputs/LabeledInput.d.ts.map +1 -1
  6. package/dist/components/ra-inputs/NumberInput.d.ts +2 -0
  7. package/dist/components/ra-inputs/SelectArrayInput.d.ts +1 -0
  8. package/dist/components/ra-inputs/SelectInput.d.ts +1 -0
  9. package/dist/components/ra-inputs/SmartTextInput.d.ts +1 -0
  10. package/dist/components/ra-inputs/SmartTextInput.d.ts.map +1 -1
  11. package/dist/components/ra-inputs/TextInput.d.ts +1 -0
  12. package/dist/components/ra-inputs/TimeInput.d.ts +1 -0
  13. package/dist/components/ra-lists/Datagrid.d.ts.map +1 -1
  14. package/dist/index.d.ts +1 -1
  15. package/dist/react-admin.cjs.js +43 -43
  16. package/dist/react-admin.es.js +380 -353
  17. package/dist/react-admin.umd.js +44 -44
  18. package/package.json +1 -1
  19. package/playground/src/menu.js +0 -7
  20. package/playground/src/theme.js +3 -5
  21. package/src/components/ra-forms/Edit.jsx +1 -1
  22. package/src/components/ra-forms/SimpleFormIterator.tsx +30 -0
  23. package/src/components/ra-inputs/ArrayInput.jsx +13 -13
  24. package/src/components/ra-inputs/LabeledInput.jsx +14 -5
  25. package/src/components/ra-lists/Datagrid.jsx +7 -8
  26. package/src/index.jsx +0 -1
  27. package/dist/components/ra-forms/SimpleFormIterator.d.ts +0 -5
  28. package/dist/components/ra-forms/SimpleFormIterator.d.ts.map +0 -1
  29. package/src/components/ra-forms/SimpleFormIterator.jsx +0 -14
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applica-software-guru/react-admin",
3
- "version": "1.0.38",
3
+ "version": "1.0.39",
4
4
  "private": false,
5
5
  "repository": {
6
6
  "type": "git",
@@ -66,13 +66,6 @@ const config = [
66
66
  type: 'item',
67
67
  url: '/entities/device',
68
68
  icon: TableOutlined
69
- },
70
- {
71
- id: 'entities/work-cycle',
72
- title: 'ra.menu.item.entities/work-cycle',
73
- type: 'item',
74
- url: '/entities/work-cycle',
75
- icon: TableOutlined
76
69
  }
77
70
  ]
78
71
  }
@@ -1,11 +1,9 @@
1
1
  const theme = (theme) => ({
2
2
  components: {
3
3
  MuiPaper: {
4
- styleOverrides: {
5
- backgroundColor: 'yellow'
6
- }
4
+ styleOverrides: {}
7
5
  }
8
6
  }
9
- })
7
+ });
10
8
 
11
- export default theme
9
+ export default theme;
@@ -8,7 +8,7 @@ const StyledEdit = styled(RaEdit, {
8
8
  '& .RaEdi-card, & > div > div > form': {
9
9
  backgroundColor: theme.palette.background.default
10
10
  },
11
- '& .RaEdit-main>.MuiPaper-root:first-child': {
11
+ '& .RaEdit-main>.MuiPaper-root:first-of-type': {
12
12
  // Ci ho messo 4 ore per scrivere questa riga di codice e risolvere un problema con react-sticky-box ed i Long Form.
13
13
  // L'overflow è di default 'hidden', a noi serve visibile per consentire a react-sticky-box di funzionare e gestire la visiblità con ancore
14
14
  // di tutti gli elementi presenti all'interno della pagina.
@@ -0,0 +1,30 @@
1
+ import { SimpleFormIterator as RaSimpleFormIterator } from 'ra-ui-materialui';
2
+ import { styled } from '@mui/material/styles';
3
+
4
+ // @ts-ignore
5
+ export const SimpleFormIterator = styled(RaSimpleFormIterator, {
6
+ name: 'ApplicaSimpleFormIterator',
7
+ root: 'root'
8
+ })(({ theme }) => ({
9
+ '& .RaSimpleFormIterator-line': {
10
+ paddingTop: theme.spacing(1),
11
+ paddingBottom: theme.spacing(0.5)
12
+ },
13
+ '& .RaSimpleFormIterator-action': {
14
+ display: 'flex',
15
+ flexDirection: 'row',
16
+ alignItems: 'center',
17
+ mb: 1.5
18
+ },
19
+ '& section': {
20
+ width: '100%',
21
+ '& label': {
22
+ position: 'relative',
23
+ overflow: 'visible',
24
+ transform: 'none',
25
+ ml: 0
26
+ }
27
+ }
28
+ }));
29
+
30
+ export default SimpleFormIterator;
@@ -1,29 +1,29 @@
1
- import LabeledInput from './LabeledInput'
2
- import { ArrayInput as RaArrayInput } from 'react-admin'
3
- import { styled } from '@mui/material/styles'
1
+ import LabeledInput from './LabeledInput';
2
+ import { ArrayInput as RaArrayInput } from 'react-admin';
3
+ import { styled } from '@mui/material/styles';
4
4
 
5
5
  const StyledArrayInput = styled(RaArrayInput, {
6
6
  name: 'RaApplicaArrayInput',
7
- slot: 'root',
7
+ slot: 'root'
8
8
  })(({ theme }) => ({
9
9
  marginTop: '0 !important',
10
10
  '& .RaSimpleFormIterator-line > .RaSimpleFormIterator-form': {
11
11
  paddingBottom: theme.spacing(0.5),
12
12
  '& > div': {
13
- width: '100%',
14
- },
15
- },
16
- }))
13
+ width: '100%'
14
+ }
15
+ }
16
+ }));
17
17
 
18
18
  const ArrayInput = (props) => (
19
- <LabeledInput {...props}>
19
+ <LabeledInput {...props} divider>
20
20
  <StyledArrayInput {...props} />
21
21
  </LabeledInput>
22
- )
22
+ );
23
23
 
24
24
  ArrayInput.propTypes = {
25
25
  ...RaArrayInput.propTypes,
26
- ...LabeledInput.propTypes,
27
- }
26
+ ...LabeledInput.propTypes
27
+ };
28
28
 
29
- export default ArrayInput
29
+ export default ArrayInput;
@@ -6,7 +6,7 @@ import React from 'react';
6
6
  import { useAppConfig } from '../../hooks';
7
7
  import { useTheme } from '@emotion/react';
8
8
 
9
- const LabeledInput = ({ label, children, display, helperText, sx, addLabel, ...props }) => {
9
+ const LabeledInput = ({ label, children, display, helperText, sx, addLabel, divider, ...props }) => {
10
10
  const theme = useTheme();
11
11
  const { getCurrentDialog } = useAppConfig();
12
12
  const { source, resource, isRequired } = props;
@@ -31,7 +31,14 @@ const LabeledInput = ({ label, children, display, helperText, sx, addLabel, ...p
31
31
  }}
32
32
  >
33
33
  {display === 'label' && label !== false && addLabel !== false && (
34
- <InputLabel error={invalid === true}>
34
+ <InputLabel
35
+ error={invalid === true}
36
+ sx={{
37
+ borderBottom: divider ? `1px solid ${theme.palette.divider}` : 'none',
38
+ pb: divider ? 1 : 0,
39
+ mt: divider ? 1 : 0
40
+ }}
41
+ >
35
42
  <FieldTitle label={label} source={source} resource={dialogResource || resource} isRequired={isRequired} />
36
43
  </InputLabel>
37
44
  )}
@@ -43,7 +50,7 @@ const LabeledInput = ({ label, children, display, helperText, sx, addLabel, ...p
43
50
  {display === 'label' && helperText && (
44
51
  <FormHelperText
45
52
  sx={{
46
- pl: 2,
53
+ pl: 1.8,
47
54
  pb: 2,
48
55
  marginTop: '0 !important'
49
56
  }}
@@ -65,11 +72,13 @@ LabeledInput.propTypes = {
65
72
  isRequired: PropTypes.bool,
66
73
  source: PropTypes.string,
67
74
  display: PropTypes.oneOf(['legend', 'label']),
68
- helperText: PropTypes.oneOfType([PropTypes.string, PropTypes.bool])
75
+ helperText: PropTypes.oneOfType([PropTypes.string, PropTypes.bool]),
76
+ divider: PropTypes.bool
69
77
  };
70
78
 
71
79
  LabeledInput.defaultProps = {
72
- display: 'label'
80
+ display: 'label',
81
+ divider: false
73
82
  };
74
83
 
75
84
  export default LabeledInput;
@@ -1,5 +1,5 @@
1
- import { Datagrid as RaDatagrid } from 'react-admin'
2
- import { styled } from '@mui/material/styles'
1
+ import { Datagrid as RaDatagrid } from 'react-admin';
2
+ import { styled } from '@mui/material/styles';
3
3
 
4
4
  const ApplicaStyledDatagrid = styled(RaDatagrid, {
5
5
  name: 'RaApplicaDatagrid',
@@ -23,20 +23,19 @@ const ApplicaStyledDatagrid = styled(RaDatagrid, {
23
23
  left: -1
24
24
  },
25
25
  '& th': {
26
- backgroundColor: 'yellow',
27
26
  textOverflow: 'ellipsis',
28
27
  overflow: 'hidden',
29
28
  whiteSpace: 'nowrap'
30
29
  }
31
- }))
30
+ }));
32
31
 
33
- const Datagrid = (props) => <ApplicaStyledDatagrid {...props} />
32
+ const Datagrid = (props) => <ApplicaStyledDatagrid {...props} />;
34
33
 
35
34
  Datagrid.propTypes = {
36
35
  ...RaDatagrid.propTypes
37
- }
36
+ };
38
37
  Datagrid.defaultProps = {
39
38
  ...RaDatagrid.defaultProps
40
- }
39
+ };
41
40
 
42
- export default Datagrid
41
+ export default Datagrid;
package/src/index.jsx CHANGED
@@ -7,7 +7,6 @@ export * from './contexts';
7
7
  export * from './utils';
8
8
 
9
9
  export {
10
- ArrayInput,
11
10
  ArrayInputContext,
12
11
  BooleanField,
13
12
  BulkDeleteWithConfirmButton,
@@ -1,5 +0,0 @@
1
- export const SimpleFormIterator: import("@emotion/styled").StyledComponent<Pick<import("ra-ui-materialui").SimpleFormIteratorProps, keyof import("ra-ui-materialui").SimpleFormIteratorProps> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {
2
- ref?: import("react").Ref<import("react").Component<import("ra-ui-materialui").SimpleFormIteratorProps, any, any>> | undefined;
3
- }>;
4
- export default SimpleFormIterator;
5
- //# sourceMappingURL=SimpleFormIterator.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SimpleFormIterator.d.ts","sourceRoot":"","sources":["../../../../src/components/ra-forms/SimpleFormIterator.jsx"],"names":[],"mappings":"AAGA;;GAQG"}
@@ -1,14 +0,0 @@
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