Skip to content

Commit

Permalink
Install @mui/core & apply v6 migration
Browse files Browse the repository at this point in the history
@mui/core is a peer dependency of @mui/x-date-pickers
  • Loading branch information
kennethnym committed Aug 18, 2023
1 parent 17de85b commit 5ea31f8
Show file tree
Hide file tree
Showing 8 changed files with 250 additions and 40 deletions.
168 changes: 160 additions & 8 deletions .pnp.cjs

Large diffs are not rendered by default.

Binary file not shown.
Binary file not shown.
Binary file not shown.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"@emotion/cache": "11.11.0",
"@emotion/react": "11.11.1",
"@emotion/styled": "11.11.0",
"@mui/base": "5.0.0-beta.11",
"@mui/icons-material": "5.11.0",
"@mui/material": "5.11.0",
"@mui/system": "5.11.0",
Expand Down
34 changes: 18 additions & 16 deletions src/plotting/plotSettings/xAxisTab.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -174,21 +174,14 @@ const XAxisTab = (props: XAxisTabProps) => {
{XAxisScale === 'time' ? (
<LocalizationProvider dateAdapter={AdapterDateFns}>
<DateTimePicker
inputFormat="yyyy-MM-dd HH:mm"
format="yyyy-MM-dd HH:mm"
mask="____-__-__ __:__"
value={fromDate}
maxDateTime={toDate || new Date('2100-01-01 00:00:00')}
componentsProps={{
actionBar: { actions: ['clear', 'cancel', 'accept'] },
}}
onChange={(date) => {
setFromDate(date);
}}
views={['year', 'month', 'day', 'hours', 'minutes']}
OpenPickerButtonProps={{
size: 'small',
'aria-label': 'from, date-time picker',
}}
renderInput={(renderProps) => {
const error =
// eslint-disable-next-line react/prop-types
Expand Down Expand Up @@ -217,6 +210,14 @@ const XAxisTab = (props: XAxisTabProps) => {
/>
);
}}
componentsProps={{
actionBar: { actions: ['clear', 'cancel', 'accept'] },

openPickerButton: {
size: 'small',
'aria-label': 'from, date-time picker',
},
}}
/>
</LocalizationProvider>
) : (
Expand All @@ -240,21 +241,14 @@ const XAxisTab = (props: XAxisTabProps) => {
{XAxisScale === 'time' ? (
<LocalizationProvider dateAdapter={AdapterDateFns}>
<DateTimePicker
inputFormat="yyyy-MM-dd HH:mm"
format="yyyy-MM-dd HH:mm"
mask="____-__-__ __:__"
value={toDate}
minDateTime={fromDate || new Date('1984-01-01 00:00:00')}
componentsProps={{
actionBar: { actions: ['clear', 'cancel', 'accept'] },
}}
onChange={(date) => {
setToDate(date);
}}
views={['year', 'month', 'day', 'hours', 'minutes']}
OpenPickerButtonProps={{
size: 'small',
'aria-label': 'to, date-time picker',
}}
renderInput={(renderProps) => {
const error =
// eslint-disable-next-line react/prop-types
Expand Down Expand Up @@ -283,6 +277,14 @@ const XAxisTab = (props: XAxisTabProps) => {
/>
);
}}
componentsProps={{
actionBar: { actions: ['clear', 'cancel', 'accept'] },

openPickerButton: {
size: 'small',
'aria-label': 'to, date-time picker',
},
}}
/>
</LocalizationProvider>
) : (
Expand Down
34 changes: 18 additions & 16 deletions src/search/components/dateTime.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -239,13 +239,10 @@ const DateTimeSearch = (props: DateTimeSearchProps): React.ReactElement => {
</Grid>
<Grid item>
<DateTimePicker
inputFormat="yyyy-MM-dd HH:mm"
format="yyyy-MM-dd HH:mm"
mask="____-__-__ __:__"
value={datePickerFromDate}
maxDateTime={datePickerToDate || new Date('2100-01-01 00:00:00')}
componentsProps={{
actionBar: { actions: ['clear'] },
}}
onChange={(date) => {
setDatePickerFromDate(date);
resetTimeframe();
Expand Down Expand Up @@ -295,10 +292,6 @@ const DateTimeSearch = (props: DateTimeSearchProps): React.ReactElement => {
onClose={() => setPopupOpen(false)}
onError={(error) => setDatePickerFromDateError(!!error)}
views={['year', 'month', 'day', 'hours', 'minutes']}
OpenPickerButtonProps={{
size: 'small',
'aria-label': 'from, date-time picker',
}}
renderDay={(date, selectedDates, pickersDayProps) =>
renderExperimentPickerDay(
datePickerToDate,
Expand Down Expand Up @@ -335,6 +328,14 @@ const DateTimeSearch = (props: DateTimeSearchProps): React.ReactElement => {
/>
);
}}
componentsProps={{
actionBar: { actions: ['clear'] },

openPickerButton: {
size: 'small',
'aria-label': 'from, date-time picker',
},
}}
/>
</Grid>
</Grid>
Expand All @@ -349,15 +350,12 @@ const DateTimeSearch = (props: DateTimeSearchProps): React.ReactElement => {
</Grid>
<Grid item>
<DateTimePicker
inputFormat="yyyy-MM-dd HH:mm"
format="yyyy-MM-dd HH:mm"
mask="____-__-__ __:__"
value={datePickerToDate}
minDateTime={
datePickerFromDate || new Date('1984-01-01 00:00:00')
}
componentsProps={{
actionBar: { actions: ['clear', 'today'] },
}}
onChange={(date) => {
setDatePickerToDate(date as Date);
resetTimeframe();
Expand Down Expand Up @@ -404,10 +402,6 @@ const DateTimeSearch = (props: DateTimeSearchProps): React.ReactElement => {
onClose={() => setPopupOpen(false)}
onError={(error) => setDatePickerToDateError(!!error)}
views={['year', 'month', 'day', 'hours', 'minutes']}
OpenPickerButtonProps={{
size: 'small',
'aria-label': 'to, date-time picker',
}}
renderDay={(date, selectedDates, pickersDayProps) =>
renderExperimentPickerDay(
datePickerFromDate,
Expand Down Expand Up @@ -444,6 +438,14 @@ const DateTimeSearch = (props: DateTimeSearchProps): React.ReactElement => {
/>
);
}}
componentsProps={{
actionBar: { actions: ['clear', 'today'] },

openPickerButton: {
size: 'small',
'aria-label': 'to, date-time picker',
},
}}
/>
</Grid>
</Grid>
Expand Down
53 changes: 53 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2469,6 +2469,29 @@ __metadata:
languageName: node
linkType: hard

"@mui/base@npm:5.0.0-beta.11":
version: 5.0.0-beta.11
resolution: "@mui/base@npm:5.0.0-beta.11"
dependencies:
"@babel/runtime": ^7.22.6
"@emotion/is-prop-valid": ^1.2.1
"@mui/types": ^7.2.4
"@mui/utils": ^5.14.5
"@popperjs/core": ^2.11.8
clsx: ^2.0.0
prop-types: ^15.8.1
react-is: ^18.2.0
peerDependencies:
"@types/react": ^17.0.0 || ^18.0.0
react: ^17.0.0 || ^18.0.0
react-dom: ^17.0.0 || ^18.0.0
peerDependenciesMeta:
"@types/react":
optional: true
checksum: 7a60421c427f3561d3e58abfa223a08ba6fc00e5587ff13c2ebbad52c3ea6bb45bdfa6e8a5cf673be4e90af0aef96b3253ec9098446ba94f5a414eb81e0c3d1a
languageName: node
linkType: hard

"@mui/core-downloads-tracker@npm:^5.11.0":
version: 5.12.3
resolution: "@mui/core-downloads-tracker@npm:5.12.3"
Expand Down Expand Up @@ -2646,6 +2669,21 @@ __metadata:
languageName: node
linkType: hard

"@mui/utils@npm:^5.14.5":
version: 5.14.5
resolution: "@mui/utils@npm:5.14.5"
dependencies:
"@babel/runtime": ^7.22.6
"@types/prop-types": ^15.7.5
"@types/react-is": ^18.2.1
prop-types: ^15.8.1
react-is: ^18.2.0
peerDependencies:
react: ^17.0.0 || ^18.0.0
checksum: 7044d73ae41bdfd9c7c6287a3c1391ec4c5395c8f0092eac3ca4f1fd5359068fad29366f39d8072f68493eb5225399463935bbca266c879d630f8ebaa3db96d7
languageName: node
linkType: hard

"@mui/x-date-pickers@npm:6.11.1":
version: 6.11.1
resolution: "@mui/x-date-pickers@npm:6.11.1"
Expand Down Expand Up @@ -2819,6 +2857,20 @@ __metadata:
languageName: node
linkType: hard

"@popperjs/core@npm:^2.11.8":
version: 2.11.8
resolution: "@popperjs/core@npm:2.11.8"
checksum: e5c69fdebf52a4012f6a1f14817ca8e9599cb1be73dd1387e1785e2ed5e5f0862ff817f420a87c7fc532add1f88a12e25aeb010ffcbdc98eace3d55ce2139cf0
languageName: node
linkType: hard

"@popperjs/core@npm:^2.11.8":
version: 2.11.8
resolution: "@popperjs/core@npm:2.11.8"
checksum: e5c69fdebf52a4012f6a1f14817ca8e9599cb1be73dd1387e1785e2ed5e5f0862ff817f420a87c7fc532add1f88a12e25aeb010ffcbdc98eace3d55ce2139cf0
languageName: node
linkType: hard

"@reduxjs/toolkit@npm:1.9.0":
version: 1.9.0
resolution: "@reduxjs/toolkit@npm:1.9.0"
Expand Down Expand Up @@ -12109,6 +12161,7 @@ __metadata:
"@emotion/cache": 11.11.0
"@emotion/react": 11.11.1
"@emotion/styled": 11.11.0
"@mui/base": 5.0.0-beta.11
"@mui/icons-material": 5.11.0
"@mui/material": 5.11.0
"@mui/system": 5.11.0
Expand Down

0 comments on commit 5ea31f8

Please sign in to comment.