Skip to content

Commit

Permalink
Update material-ui to version 4 (#1394)
Browse files Browse the repository at this point in the history
* Update material-ui to version 4

* Fix test for Material array layout, ExpansionPanelSummary is wrapped in
a higher order component for styling so instead we find an ancestor
  • Loading branch information
Lily authored and eneufeld committed Jun 6, 2019
1 parent 9cfdab7 commit 7d5b69a
Show file tree
Hide file tree
Showing 7 changed files with 734 additions and 575 deletions.
1,283 changes: 721 additions & 562 deletions package-lock.json

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions packages/material/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@
},
"dependencies": {
"@date-io/moment": "1.1.0",
"@material-ui/core": "^3.3.1",
"@material-ui/icons": "^3.0.1",
"@material-ui/lab": "^3.0.0-alpha.21",
"@material-ui/core": "^4.0.1",
"@material-ui/icons": "^4.0.1",
"@material-ui/lab": "^4.0.0-alpha.15",
"material-ui-pickers": "^2.2.4",
"moment": "^2.20.1"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export const MaterialListWithDetailRenderer =
addItem={addItem}
createDefault={handleCreateDefaultValue}
/>
<Grid container direction='row' spacing={16}>
<Grid container direction='row' spacing={2}>
<Grid item xs={3}>
<List>
{data > 0 ?
Expand Down
2 changes: 1 addition & 1 deletion packages/material/src/complex/TableToolbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const TableToolbar = React.memo((
container
justify={'flex-start'}
alignItems={'center'}
spacing={16}
spacing={2}
>
<Grid item>
<Typography variant={'h6'}>{label}</Typography>
Expand Down
2 changes: 1 addition & 1 deletion packages/material/src/controls/MaterialSliderControl.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export class MaterialSliderControl extends Control<ControlProps, ControlState> {
min={schema.minimum}
max={schema.maximum}
value={Number(data || schema.default)}
onChange={(_ev, value) => {
onChange={(_ev: any, value: any) => {
handleChange(path, Number(value));
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/material/src/util/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export const MaterialLayoutRenderer = ({
<Grid
container
direction={direction}
spacing={direction === 'row' ? 16 : 0}
spacing={direction === 'row' ? 2 : 0}
>
{renderLayoutElements(elements, schema, path, renderers)}
</Grid>
Expand Down
12 changes: 6 additions & 6 deletions packages/material/test/renderers/MaterialArrayLayout.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -320,15 +320,15 @@ describe('Material array layout', () => {
// up button
expect(
wrapper
.find('ExpansionPanelSummary')
.find('ExpandPanelRenderer')
.at(0)
.find('button')
.find({ 'aria-label': 'Move up' }).length
).toBe(1);
// down button
expect(
wrapper
.find('ExpansionPanelSummary')
.find('ExpandPanelRenderer')
.at(0)
.find('button')
.find({ 'aria-label': 'Move down' }).length
Expand All @@ -349,7 +349,7 @@ describe('Material array layout', () => {
);
// getting up button of second item in expension panel;
const upButton = wrapper
.find('ExpansionPanelSummary')
.find('ExpandPanelRenderer')
.at(1)
.find('button')
.find({ 'aria-label': 'Move up' });
Expand Down Expand Up @@ -379,7 +379,7 @@ describe('Material array layout', () => {
);
// getting up button of second item in expension panel;
const upButton = wrapper
.find('ExpansionPanelSummary')
.find('ExpandPanelRenderer')
.at(0)
.find('button')
.find({ 'aria-label': 'Move down' });
Expand Down Expand Up @@ -409,7 +409,7 @@ describe('Material array layout', () => {
);
// getting up button of second item in expension panel;
const upButton = wrapper
.find('ExpansionPanelSummary')
.find('ExpandPanelRenderer')
.at(0)
.find('button')
.find({ 'aria-label': 'Move up' });
Expand All @@ -430,7 +430,7 @@ describe('Material array layout', () => {
);
// getting up button of second item in expension panel;
const downButton = wrapper
.find('ExpansionPanelSummary')
.find('ExpandPanelRenderer')
.at(1)
.find('button')
.find({ 'aria-label': 'Move down' });
Expand Down

0 comments on commit 7d5b69a

Please sign in to comment.