@rjsf/mui 6.0.0-beta.8 → 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/README.md +12 -12
- package/dist/index.js +19 -20
- package/dist/index.js.map +3 -3
- package/dist/mui.esm.js +19 -20
- package/dist/mui.esm.js.map +3 -3
- package/dist/mui.umd.js +18 -19
- package/lib/ArrayFieldItemTemplate/ArrayFieldItemTemplate.js +2 -2
- package/lib/ArrayFieldItemTemplate/ArrayFieldItemTemplate.js.map +1 -1
- package/lib/ArrayFieldTemplate/ArrayFieldTemplate.js +2 -2
- package/lib/ArrayFieldTemplate/ArrayFieldTemplate.js.map +1 -1
- package/lib/BaseInputTemplate/BaseInputTemplate.js +1 -1
- package/lib/BaseInputTemplate/BaseInputTemplate.js.map +1 -1
- package/lib/GridTemplate/GridTemplate.d.ts +1 -1
- package/lib/GridTemplate/GridTemplate.js +3 -3
- package/lib/GridTemplate/GridTemplate.js.map +1 -1
- package/lib/ObjectFieldTemplate/ObjectFieldTemplate.js +4 -4
- package/lib/ObjectFieldTemplate/ObjectFieldTemplate.js.map +1 -1
- package/lib/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.js +2 -2
- package/lib/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +10 -10
- package/src/ArrayFieldItemTemplate/ArrayFieldItemTemplate.tsx +7 -7
- package/src/ArrayFieldTemplate/ArrayFieldTemplate.tsx +5 -5
- package/src/BaseInputTemplate/BaseInputTemplate.tsx +1 -2
- package/src/GridTemplate/GridTemplate.tsx +4 -4
- package/src/ObjectFieldTemplate/ObjectFieldTemplate.tsx +10 -10
- package/src/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.tsx +8 -8
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rjsf/mui",
|
|
3
|
-
"version": "6.0.0-beta.
|
|
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
|
|
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": "^
|
|
67
|
-
"@mui/material": "^
|
|
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": "^
|
|
77
|
-
"@mui/material": "^
|
|
78
|
-
"@rjsf/core": "^6.0.0-beta.
|
|
79
|
-
"@rjsf/snapshot-tests": "^6.0.0-beta.
|
|
80
|
-
"@rjsf/utils": "^6.0.0-beta.
|
|
81
|
-
"@rjsf/validator-ajv8": "^6.0.0-beta.
|
|
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
|
|
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
|
-
<
|
|
39
|
-
<
|
|
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
|
-
</
|
|
45
|
+
</Grid>
|
|
46
46
|
{hasToolbar && (
|
|
47
|
-
<
|
|
47
|
+
<Grid>
|
|
48
48
|
<ArrayFieldItemButtonsTemplate {...buttonsProps} style={btnStyle} />
|
|
49
|
-
</
|
|
49
|
+
</Grid>
|
|
50
50
|
)}
|
|
51
|
-
</
|
|
51
|
+
</Grid>
|
|
52
52
|
);
|
|
53
53
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Box from '@mui/material/Box';
|
|
2
|
-
import
|
|
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
|
-
<
|
|
70
|
-
<
|
|
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
|
-
</
|
|
82
|
-
</
|
|
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
|
-
|
|
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
|
|
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 `
|
|
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
|
-
<
|
|
12
|
+
<Grid container={!column} {...rest}>
|
|
13
13
|
{children}
|
|
14
|
-
</
|
|
14
|
+
</Grid>
|
|
15
15
|
);
|
|
16
16
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
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
|
-
<
|
|
72
|
+
<Grid container={true} spacing={2} style={{ marginTop: '10px' }}>
|
|
73
73
|
{properties.map((element, index) =>
|
|
74
|
-
// Remove the <
|
|
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
|
-
<
|
|
79
|
+
<Grid size={{ xs: 12 }} key={index} style={{ marginBottom: '10px' }}>
|
|
80
80
|
{element.content}
|
|
81
|
-
</
|
|
81
|
+
</Grid>
|
|
82
82
|
),
|
|
83
83
|
)}
|
|
84
84
|
{canExpand<T, S, F>(schema, uiSchema, formData) && (
|
|
85
|
-
<
|
|
86
|
-
<
|
|
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
|
-
</
|
|
96
|
-
</
|
|
95
|
+
</Grid>
|
|
96
|
+
</Grid>
|
|
97
97
|
)}
|
|
98
|
-
</
|
|
98
|
+
</Grid>
|
|
99
99
|
</>
|
|
100
100
|
);
|
|
101
101
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CSSProperties, FocusEvent } from 'react';
|
|
2
|
-
import
|
|
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
|
-
<
|
|
63
|
-
<
|
|
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
|
-
</
|
|
76
|
-
<
|
|
77
|
-
<
|
|
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
|
-
</
|
|
89
|
-
</
|
|
88
|
+
</Grid>
|
|
89
|
+
</Grid>
|
|
90
90
|
);
|
|
91
91
|
}
|