@@ -8,7 +8,7 @@ import { PickersLayoutProps } from './PickersLayout.types';
8
8
import { pickersLayoutClasses , getPickersLayoutUtilityClass } from './pickersLayoutClasses' ;
9
9
import usePickerLayout from './usePickerLayout' ;
10
10
import { DateOrTimeViewWithMeridiem } from '../internals/models' ;
11
- import { PickerValidDate } from '../models' ;
11
+ import { FieldValueType , PickerValidDate } from '../models' ;
12
12
13
13
const useUtilityClasses = ( ownerState : PickersLayoutProps < any , any , any > ) => {
14
14
const { isLandscape, classes } = ownerState ;
@@ -73,11 +73,19 @@ export const PickersLayoutContentWrapper = styled('div', {
73
73
name : 'MuiPickersLayout' ,
74
74
slot : 'ContentWrapper' ,
75
75
overridesResolver : ( props , styles ) => styles . contentWrapper ,
76
- } ) ( {
76
+ } ) < { ownerState ?: { valueType : FieldValueType } } > ( {
77
77
gridColumn : 2 ,
78
78
gridRow : 2 ,
79
79
display : 'flex' ,
80
80
flexDirection : 'column' ,
81
+ variants : [
82
+ {
83
+ props : { valueType : 'time' } ,
84
+ style : {
85
+ gridColumn : '1/4' ,
86
+ } ,
87
+ } ,
88
+ ] ,
81
89
} ) ;
82
90
83
91
type PickersLayoutComponent = ( <
@@ -105,7 +113,7 @@ const PickersLayout = React.forwardRef(function PickersLayout<
105
113
const props = useThemeProps ( { props : inProps , name : 'MuiPickersLayout' } ) ;
106
114
107
115
const { toolbar, content, tabs, actionBar, shortcuts } = usePickerLayout ( props ) ;
108
- const { sx, className, isLandscape, wrapperVariant } = props ;
116
+ const { sx, className, isLandscape, wrapperVariant, valueType } = props ;
109
117
110
118
const classes = useUtilityClasses ( props ) ;
111
119
@@ -118,7 +126,7 @@ const PickersLayout = React.forwardRef(function PickersLayout<
118
126
>
119
127
{ isLandscape ? shortcuts : toolbar }
120
128
{ isLandscape ? toolbar : shortcuts }
121
- < PickersLayoutContentWrapper className = { classes . contentWrapper } >
129
+ < PickersLayoutContentWrapper ownerState = { { valueType } } className = { classes . contentWrapper } >
122
130
{ wrapperVariant === 'desktop' ? (
123
131
< React . Fragment >
124
132
{ content }
@@ -188,6 +196,7 @@ PickersLayout.propTypes = {
188
196
PropTypes . object ,
189
197
] ) ,
190
198
value : PropTypes . any ,
199
+ valueType : PropTypes . oneOf ( [ 'date-time' , 'date' , 'time' ] ) . isRequired ,
191
200
view : PropTypes . oneOf ( [ 'day' , 'hours' , 'meridiem' , 'minutes' , 'month' , 'seconds' , 'year' ] ) ,
192
201
views : PropTypes . arrayOf (
193
202
PropTypes . oneOf ( [ 'day' , 'hours' , 'meridiem' , 'minutes' , 'month' , 'seconds' , 'year' ] ) . isRequired ,
0 commit comments