@rjsf/mui 6.0.0-beta.7 → 6.0.0-beta.9

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,11 +1,11 @@
1
1
  {
2
2
  "name": "@rjsf/mui",
3
- "version": "6.0.0-beta.7",
3
+ "version": "6.0.0-beta.9",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./lib/index.js",
6
6
  "types": "./lib/index.d.ts",
7
7
  "type": "module",
8
- "description": "Material UI 5 theme, fields and widgets for react-jsonschema-form",
8
+ "description": "Material UI 7 theme, fields and widgets for react-jsonschema-form",
9
9
  "exports": {
10
10
  ".": {
11
11
  "types": "./lib/index.d.ts",
@@ -63,8 +63,8 @@
63
63
  "peerDependencies": {
64
64
  "@emotion/react": "^11.7.0",
65
65
  "@emotion/styled": "^11.6.0",
66
- "@mui/icons-material": "^6.0.0",
67
- "@mui/material": "^6.0.0",
66
+ "@mui/icons-material": "^7.0.0",
67
+ "@mui/material": "^7.0.0",
68
68
  "@rjsf/core": "^6.0.0-beta",
69
69
  "@rjsf/utils": "^6.0.0-beta",
70
70
  "react": ">=18"
@@ -73,12 +73,12 @@
73
73
  "@emotion/jest": "^11.11.0",
74
74
  "@emotion/react": "^11.11.3",
75
75
  "@emotion/styled": "^11.11.0",
76
- "@mui/icons-material": "^6.4.11",
77
- "@mui/material": "^6.4.11",
78
- "@rjsf/core": "^6.0.0-beta.7",
79
- "@rjsf/snapshot-tests": "^6.0.0-beta.7",
80
- "@rjsf/utils": "^6.0.0-beta.7",
81
- "@rjsf/validator-ajv8": "^6.0.0-beta.7",
76
+ "@mui/icons-material": "^7.1.0",
77
+ "@mui/material": "^7.1.0",
78
+ "@rjsf/core": "^6.0.0-beta.9",
79
+ "@rjsf/snapshot-tests": "^6.0.0-beta.9",
80
+ "@rjsf/utils": "^6.0.0-beta.9",
81
+ "@rjsf/validator-ajv8": "^6.0.0-beta.9",
82
82
  "eslint": "^8.56.0"
83
83
  },
84
84
  "publishConfig": {
@@ -1,6 +1,6 @@
1
1
  import { CSSProperties } from 'react';
2
2
  import Box from '@mui/material/Box';
3
- import Grid2 from '@mui/material/Grid2';
3
+ import Grid from '@mui/material/Grid';
4
4
  import Paper from '@mui/material/Paper';
5
5
  import {
6
6
  ArrayFieldItemTemplateType,
@@ -35,19 +35,19 @@ export default function ArrayFieldItemTemplate<
35
35
  minWidth: 0,
36
36
  };
37
37
  return (
38
- <Grid2 container={true} alignItems='center'>
39
- <Grid2 size='auto' style={{ overflow: 'auto' }}>
38
+ <Grid container={true} alignItems='center'>
39
+ <Grid size='auto' style={{ overflow: 'auto' }}>
40
40
  <Box mb={2}>
41
41
  <Paper elevation={2}>
42
42
  <Box p={2}>{children}</Box>
43
43
  </Paper>
44
44
  </Box>
45
- </Grid2>
45
+ </Grid>
46
46
  {hasToolbar && (
47
- <Grid2>
47
+ <Grid>
48
48
  <ArrayFieldItemButtonsTemplate {...buttonsProps} style={btnStyle} />
49
- </Grid2>
49
+ </Grid>
50
50
  )}
51
- </Grid2>
51
+ </Grid>
52
52
  );
53
53
  }
@@ -1,5 +1,5 @@
1
1
  import Box from '@mui/material/Box';
2
- import Grid2 from '@mui/material/Grid2';
2
+ import Grid from '@mui/material/Grid';
3
3
  import Paper from '@mui/material/Paper';
4
4
  import {
5
5
  getTemplate,
@@ -66,8 +66,8 @@ export default function ArrayFieldTemplate<
66
66
  <ArrayFieldItemTemplate key={key} {...itemProps} />
67
67
  ))}
68
68
  {canAdd && (
69
- <Grid2 container justifyContent='flex-end'>
70
- <Grid2>
69
+ <Grid container justifyContent='flex-end'>
70
+ <Grid>
71
71
  <Box mt={2}>
72
72
  <AddButton
73
73
  id={buttonId<T>(idSchema, 'add')}
@@ -78,8 +78,8 @@ export default function ArrayFieldTemplate<
78
78
  registry={registry}
79
79
  />
80
80
  </Box>
81
- </Grid2>
82
- </Grid2>
81
+ </Grid>
82
+ </Grid>
83
83
  )}
84
84
  </Box>
85
85
  </Paper>
@@ -76,14 +76,13 @@ export default function BaseInputTemplate<
76
76
  autoFocus={autofocus}
77
77
  required={required}
78
78
  disabled={disabled || readonly}
79
- inputProps={htmlInputProps}
79
+ slotProps={{ htmlInput: htmlInputProps, inputLabel: DisplayInputLabelProps }}
80
80
  {...rest}
81
81
  value={value || value === 0 ? value : ''}
82
82
  error={rawErrors.length > 0}
83
83
  onChange={onChangeOverride || _onChange}
84
84
  onBlur={_onBlur}
85
85
  onFocus={_onFocus}
86
- InputLabelProps={DisplayInputLabelProps}
87
86
  {...(textFieldProps as TextFieldProps)}
88
87
  aria-describedby={ariaDescribedByIds<T>(id, !!schema.examples)}
89
88
  />
@@ -1,16 +1,16 @@
1
- import Grid2 from '@mui/material/Grid2';
1
+ import Grid from '@mui/material/Grid';
2
2
  import { GridTemplateProps } from '@rjsf/utils';
3
3
 
4
4
  /** Renders a `GridTemplate` for mui, which is expecting the column sizing information coming in via the
5
- * extra props provided by the caller, which are spread directly on the `Grid2`.
5
+ * extra props provided by the caller, which are spread directly on the `Grid`.
6
6
  *
7
7
  * @param props - The GridTemplateProps, including the extra props containing the mui grid positioning details
8
8
  */
9
9
  export default function GridTemplate(props: GridTemplateProps) {
10
10
  const { children, column, ...rest } = props;
11
11
  return (
12
- <Grid2 container={!column} {...rest}>
12
+ <Grid container={!column} {...rest}>
13
13
  {children}
14
- </Grid2>
14
+ </Grid>
15
15
  );
16
16
  }
@@ -1,4 +1,4 @@
1
- import Grid2 from '@mui/material/Grid2';
1
+ import Grid from '@mui/material/Grid';
2
2
  import {
3
3
  FormContextType,
4
4
  ObjectFieldTemplateProps,
@@ -69,21 +69,21 @@ export default function ObjectFieldTemplate<
69
69
  registry={registry}
70
70
  />
71
71
  )}
72
- <Grid2 container={true} spacing={2} style={{ marginTop: '10px' }}>
72
+ <Grid container={true} spacing={2} style={{ marginTop: '10px' }}>
73
73
  {properties.map((element, index) =>
74
- // Remove the <Grid2> if the inner element is hidden as the <Grid2>
74
+ // Remove the <Grid> if the inner element is hidden as the <Grid>
75
75
  // itself would otherwise still take up space.
76
76
  element.hidden ? (
77
77
  element.content
78
78
  ) : (
79
- <Grid2 size={{ xs: 12 }} key={index} style={{ marginBottom: '10px' }}>
79
+ <Grid size={{ xs: 12 }} key={index} style={{ marginBottom: '10px' }}>
80
80
  {element.content}
81
- </Grid2>
81
+ </Grid>
82
82
  ),
83
83
  )}
84
84
  {canExpand<T, S, F>(schema, uiSchema, formData) && (
85
- <Grid2 container justifyContent='flex-end'>
86
- <Grid2>
85
+ <Grid container justifyContent='flex-end'>
86
+ <Grid>
87
87
  <AddButton
88
88
  id={buttonId<T>(idSchema, 'add')}
89
89
  className='rjsf-object-property-expand'
@@ -92,10 +92,10 @@ export default function ObjectFieldTemplate<
92
92
  uiSchema={uiSchema}
93
93
  registry={registry}
94
94
  />
95
- </Grid2>
96
- </Grid2>
95
+ </Grid>
96
+ </Grid>
97
97
  )}
98
- </Grid2>
98
+ </Grid>
99
99
  </>
100
100
  );
101
101
  }
@@ -1,5 +1,5 @@
1
1
  import { CSSProperties, FocusEvent } from 'react';
2
- import Grid2 from '@mui/material/Grid2';
2
+ import Grid from '@mui/material/Grid';
3
3
  import TextField from '@mui/material/TextField';
4
4
  import {
5
5
  ADDITIONAL_PROPERTY_FLAG,
@@ -59,8 +59,8 @@ export default function WrapIfAdditionalTemplate<
59
59
  const handleBlur = ({ target }: FocusEvent<HTMLInputElement>) => onKeyChange(target && target.value);
60
60
 
61
61
  return (
62
- <Grid2 container key={`${id}-key`} alignItems='center' spacing={2} className={classNames} style={style}>
63
- <Grid2 size='auto'>
62
+ <Grid container key={`${id}-key`} alignItems='center' spacing={2} className={classNames} style={style}>
63
+ <Grid size='auto'>
64
64
  <TextField
65
65
  fullWidth={true}
66
66
  required={required}
@@ -72,9 +72,9 @@ export default function WrapIfAdditionalTemplate<
72
72
  onBlur={!readonly ? handleBlur : undefined}
73
73
  type='text'
74
74
  />
75
- </Grid2>
76
- <Grid2 size='auto'>{children}</Grid2>
77
- <Grid2>
75
+ </Grid>
76
+ <Grid size='auto'>{children}</Grid>
77
+ <Grid>
78
78
  <RemoveButton
79
79
  id={buttonId<T>(id, 'remove')}
80
80
  className='rjsf-object-property-remove'
@@ -85,7 +85,7 @@ export default function WrapIfAdditionalTemplate<
85
85
  uiSchema={uiSchema}
86
86
  registry={registry}
87
87
  />
88
- </Grid2>
89
- </Grid2>
88
+ </Grid>
89
+ </Grid>
90
90
  );
91
91
  }