Skip to content

Commit 93f1373

Browse files
authored
Update React Material UI to v5
Updates the React Material renderer set to Material UI v5 which is a major update. Also upgrades React to v17 and adjusts the tests.
1 parent 6bcdbb1 commit 93f1373

File tree

108 files changed

+2965
-861
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

108 files changed

+2965
-861
lines changed

package-lock.json

Lines changed: 2589 additions & 512 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/example/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
"@jsonforms/core": "^3.0.0-alpha.2",
77
"@jsonforms/examples": "^3.0.0-alpha.2",
88
"@jsonforms/react": "^3.0.0-alpha.2",
9-
"@material-ui/core": "^4.7.0",
9+
"@mui/material": "^5.2.2",
1010
"lodash": "^4.17.15",
11-
"react": "^16.12.0",
12-
"react-dom": "^16.12.0",
11+
"react": "^17.0.2",
12+
"react-dom": "^17.0.2",
1313
"redux": "^4.0.4"
1414
},
1515
"scripts": {

packages/material/example/CustomAutocomplete.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ import { ExtendedUnwrapped } from '../src/extended';
1111
import { materialAutocompleteOneOfEnumControlTester } from '../src/extended/MaterialAutocompleteOneOfEnumControl';
1212
import { withJsonFormsOneOfEnumProps } from '@jsonforms/react';
1313
import React from 'react';
14-
import Typography from '@material-ui/core/Typography';
14+
import { Typography } from '@mui/material';
1515
const MyAutocompleteControl = (props: ControlProps & OwnPropsOfEnum) => {
1616
return (
1717
<ExtendedUnwrapped.MaterialAutocompleteOneOfEnumControl
1818
{...props}
19-
renderOption={option => (<Typography>{`${option?.value}\t-\t${option?.label}`}</Typography>)}
19+
renderOption={({}, option) => (<Typography>{`${option?.value}\t-\t${option?.label}`}</Typography>)}
2020
filterOptions={(options, state) => options.filter(o => o.label.includes(state.inputValue) || o.value.includes(state.inputValue))}
2121
/>
2222
);

packages/material/package.json

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -71,32 +71,29 @@
7171
"peerDependencies": {
7272
"@jsonforms/core": "^3.0.0-alpha.0",
7373
"@jsonforms/react": "^3.0.0-alpha.0",
74-
"@material-ui/core": "^4.7.0",
75-
"@material-ui/icons": "^4.5.1",
76-
"@material-ui/pickers": "^3.3.10"
77-
},
78-
"optionalPeerDependencies": {
79-
"@material-ui/lab": "^4.0.0-alpha.56"
74+
"@mui/icons-material": "^5.0.0",
75+
"@mui/lab": "^5.0.0-alpha.54",
76+
"@mui/material": "^5.0.0"
8077
},
8178
"devDependencies": {
79+
"@emotion/react": "^11.5.0",
80+
"@emotion/styled": "^11.3.0",
8281
"@jsonforms/core": "^3.0.0-alpha.2",
8382
"@jsonforms/react": "^3.0.0-alpha.2",
84-
"@material-ui/core": "^4.7.0",
85-
"@material-ui/icons": "^4.5.1",
86-
"@material-ui/lab": "^4.0.0-alpha.56",
87-
"@material-ui/pickers": "^3.2.8",
83+
"@mui/icons-material": "^5.2.0",
84+
"@mui/lab": "^5.0.0-alpha.58",
85+
"@mui/material": "^5.2.2",
8886
"@types/enzyme": "^3.10.3",
89-
"@types/enzyme-adapter-react-16": "^1.0.5",
90-
"@types/react-dom": "^16.8.0",
87+
"@types/react-dom": "^17.0.9",
88+
"@wojtekmaj/enzyme-adapter-react-17": "^0.6.3",
9189
"copy-webpack-plugin": "^5.0.5",
9290
"enzyme": "^3.10.0",
93-
"enzyme-adapter-react-16": "^1.15.1",
94-
"jest": "^24.9.0",
91+
"jest": "^26.6.3",
9592
"nyc": "^14.1.1",
96-
"react-dom": "^16.12.0",
93+
"react-dom": "^17.0.2",
9794
"rimraf": "^3.0.2",
9895
"source-map-loader": "^0.2.4",
99-
"ts-jest": "^24.2.0",
96+
"ts-jest": "^26.4.4",
10097
"ts-loader": "^6.2.1",
10198
"tslint": "^5.20.1",
10299
"tslint-loader": "^3.5.4",

packages/material/src/additional/ListWithDetailMasterItem.tsx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ import {
3131
ListItemAvatar,
3232
ListItemSecondaryAction,
3333
ListItemText,
34-
} from '@material-ui/core';
35-
import DeleteIcon from '@material-ui/icons/Delete';
34+
} from '@mui/material';
35+
import DeleteIcon from '@mui/icons-material/Delete';
3636
import React from 'react';
3737

3838
const ListWithDetailMasterItem = ({ index, childLabel, selected, handleSelect, removeItem, path }: StatePropsOfMasterItem) => {
@@ -47,10 +47,7 @@ const ListWithDetailMasterItem = ({ index, childLabel, selected, handleSelect, r
4747
</ListItemAvatar>
4848
<ListItemText primary={childLabel} />
4949
<ListItemSecondaryAction>
50-
<IconButton
51-
aria-label='Delete'
52-
onClick={removeItem(path, index)}
53-
>
50+
<IconButton aria-label='Delete' onClick={removeItem(path, index)} size='large'>
5451
<DeleteIcon />
5552
</IconButton>
5653
</ListItemSecondaryAction>

packages/material/src/additional/MaterialLabelRenderer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ import { withJsonFormsLayoutProps } from '@jsonforms/react';
3434
import {
3535
Hidden,
3636
Typography
37-
} from '@material-ui/core';
37+
} from '@mui/material';
3838

3939
/**
4040
* Default tester for a label.

packages/material/src/additional/MaterialListWithDetailRenderer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ import {
3838
JsonFormsDispatch,
3939
withJsonFormsArrayLayoutProps
4040
} from '@jsonforms/react';
41-
import { Grid, Hidden, List, Typography } from '@material-ui/core';
41+
import { Grid, Hidden, List, Typography } from '@mui/material';
4242
import map from 'lodash/map';
4343
import range from 'lodash/range';
4444
import React, { useCallback, useMemo, useState } from 'react';

packages/material/src/cells/MaterialDateCell.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import {
3131
WithClassname
3232
} from '@jsonforms/core';
3333
import { withJsonFormsCellProps } from '@jsonforms/react';
34-
import Input from '@material-ui/core/Input';
34+
import Input from '@mui/material/Input';
3535
import merge from 'lodash/merge';
3636

3737
export const MaterialDateCell = (props: CellProps & WithClassname) => {

packages/material/src/complex/DeleteDialog.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@
2323
THE SOFTWARE.
2424
*/
2525
import React from 'react';
26-
import Button from '@material-ui/core/Button';
2726
import {
27+
Button,
2828
Dialog,
2929
DialogActions,
3030
DialogContent,
3131
DialogContentText,
3232
DialogTitle,
33-
} from '@material-ui/core';
33+
} from '@mui/material';
3434

3535
export interface DeleteDialogProps {
3636
open: boolean;

packages/material/src/complex/MaterialAllOfRenderer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
THE SOFTWARE.
2424
*/
2525
import React from 'react';
26-
import { Hidden } from '@material-ui/core';
26+
import { Hidden } from '@mui/material';
2727

2828
import {
2929
createCombinatorRenderInfos,

0 commit comments

Comments
 (0)