UNPKG

@mui/x-date-pickers

Version:

The community edition of the Date and Time Picker components (MUI X).

31 lines (29 loc) 751 B
import _extends from "@babel/runtime/helpers/esm/extends"; import { useIsLandscape } from '../useIsLandscape'; /** * Props used to create the layout of the views. * Those props are exposed on all the pickers. */ /** * Prepare the props for the view layout (managed by `PickersLayout`) */ export const usePickerLayoutProps = ({ props, propsFromPickerValue, propsFromPickerViews, wrapperVariant }) => { const { orientation } = props; const isLandscape = useIsLandscape(propsFromPickerViews.views, orientation); const layoutProps = _extends({}, propsFromPickerViews, propsFromPickerValue, { isLandscape, wrapperVariant, disabled: props.disabled, readOnly: props.readOnly }); return { layoutProps }; };