UNPKG

@mui/x-date-pickers-pro

Version:

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

27 lines (26 loc) 1.06 kB
import * as React from 'react'; import { FieldRef } from '@mui/x-date-pickers/models'; import { RangePosition, RangeFieldSection } from '../../models'; export interface UseRangePositionProps { /** * The position in the currently edited date range. * Used when the component position is controlled. */ rangePosition?: RangePosition; /** * The initial position in the edited date range. * Used when the component is not controlled. * @default 'start' */ defaultRangePosition?: RangePosition; /** * Callback fired when the range position changes. * @param {RangePosition} rangePosition The new range position. */ onRangePositionChange?: (rangePosition: RangePosition) => void; } export interface UseRangePositionResponse { rangePosition: RangePosition; onRangePositionChange: (newPosition: RangePosition) => void; } export declare const useRangePosition: (props: UseRangePositionProps, singleInputFieldRef?: React.RefObject<FieldRef<RangeFieldSection>>) => UseRangePositionResponse;