@material-ui/lab
Version:
Material-UI Lab - Incubator for Material-UI React components.
90 lines (89 loc) • 8.83 kB
TypeScript
import React from 'react';
import { ParsableDate } from '../internal/pickers/constants/prop-types';
import { ExportedClockPickerProps } from '../ClockPicker/ClockPicker';
import { MuiPickersAdapter } from '../internal/pickers/hooks/useUtils';
import { TimeValidationError } from '../internal/pickers/time-utils';
import { WithViewsProps, AllSharedPickerProps } from '../internal/pickers/Picker/SharedPickerProps';
import { ValidationProps } from '../internal/pickers/hooks/useValidation';
import { OverrideParsableDateProps } from '../internal/pickers/hooks/date-helpers-hooks';
import { SomeWrapper } from '../internal/pickers/wrappers/Wrapper';
import { SharedPickerProps } from '../internal/pickers/Picker/makePickerWithState';
export interface BaseTimePickerProps<TDate = unknown> extends ValidationProps<TimeValidationError, ParsableDate<TDate>>, WithViewsProps<'hours' | 'minutes' | 'seconds'>, OverrideParsableDateProps<TDate, ExportedClockPickerProps<TDate>, 'minTime' | 'maxTime'> {
}
export declare function getTextFieldAriaText(value: ParsableDate, utils: MuiPickersAdapter): string;
declare function useInterceptProps({ ampm, inputFormat, maxTime: __maxTime, minTime: __minTime, openTo, views, ...other }: BaseTimePickerProps & AllSharedPickerProps): {
onError?: ((reason: "invalidDate" | "minTime" | "maxTime" | "shouldDisableTime-hours" | "shouldDisableTime-minutes" | "shouldDisableTime-seconds" | null, value: unknown) => void) | undefined;
shouldDisableTime?: ((timeValue: number, clockType: import("../internal/pickers/constants/ClockType").ClockViewType) => boolean) | undefined;
disableIgnoringDatePartForTimeValidation?: boolean | undefined;
allowKeyboardControl?: boolean | undefined;
ampmInClock?: boolean | undefined;
getClockLabelText?: ((view: import("../internal/pickers/constants/ClockType").ClockViewType, time: unknown, adapter: import("../LocalizationProvider").MuiPickersAdapter<unknown>) => string) | undefined;
minutesStep?: number | undefined;
value: any;
onChange: (date: any, keyboardInputValue?: string | undefined) => void;
disableCloseOnSelect?: boolean | undefined;
disabled?: boolean | undefined;
readOnly?: boolean | undefined;
onAccept?: ((date: any) => void) | undefined;
onOpen?: (() => void) | undefined;
onClose?: (() => void) | undefined;
open?: boolean | undefined;
showToolbar?: boolean | undefined;
orientation?: "portrait" | "landscape" | undefined;
ToolbarComponent?: React.ComponentClass<import("../internal/pickers/typings/BasePicker").ToolbarComponentProps<unknown, import("../internal/pickers/typings/Views").AllAvailableViews>, any> | React.FunctionComponent<import("../internal/pickers/typings/BasePicker").ToolbarComponentProps<unknown, import("../internal/pickers/typings/Views").AllAvailableViews>> | undefined;
toolbarTitle?: React.ReactNode;
toolbarPlaceholder?: React.ReactNode;
toolbarFormat?: string | undefined;
className?: string | undefined;
label?: React.ReactNode;
mask: string;
InputProps?: Partial<import("../../../material-ui/src").InputProps> | Partial<import("../../../material-ui/src").FilledInputProps> | Partial<import("../../../material-ui/src").OutlinedInputProps> | undefined;
ignoreInvalidInputs?: boolean | undefined;
renderInput: (props: import("../../../material-ui/src").TextFieldProps) => React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)> | null) | (new (props: any) => React.Component<any, any, any>)>;
openPickerIcon: string | number | boolean | {} | React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)> | null) | (new (props: any) => React.Component<any, any, any>)> | React.ReactNodeArray | React.ReactPortal | JSX.Element | null;
acceptRegex: RegExp;
InputAdornmentProps?: Partial<import("../../../material-ui/src/OverridableComponent").OverrideProps<import("../../../material-ui/src").InputAdornmentTypeMap<{}, "div">, "div">> | undefined;
OpenPickerButtonProps?: Partial<import("../../../material-ui/src/OverridableComponent").OverrideProps<import("../../../material-ui/src").IconButtonTypeMap<{}, "button">, "button">> | undefined;
rifmFormatter?: ((str: string) => string) | undefined;
disableOpenPicker?: boolean | undefined;
disableMaskedInput: boolean;
getOpenDialogAriaText: ((value: unknown, utils: import("../LocalizationProvider").MuiPickersAdapter<unknown>) => string) | typeof getTextFieldAriaText;
dateAdapter?: import("../LocalizationProvider").MuiPickersAdapter<any> | undefined;
views: import("../internal/pickers/constants/ClockType").ClockViewType[];
openTo: import("../internal/pickers/constants/ClockType").ClockViewType;
minTime: unknown;
maxTime: unknown;
ampm: boolean;
inputFormat: string;
};
export declare const timePickerConfig: {
useInterceptProps: typeof useInterceptProps;
useValidation: (value: unknown, props: BaseTimePickerProps<unknown>) => "invalidDate" | "minTime" | "maxTime" | "shouldDisableTime-hours" | "shouldDisableTime-minutes" | "shouldDisableTime-seconds" | null;
DefaultToolbarComponent: React.ComponentType<Pick<React.PropsWithChildren<Pick<import("../DayPicker/DayPicker").DayPickerProps<unknown, import("../internal/pickers/typings/Views").DatePickerView>, "loading" | "onViewChange" | "minDate" | "maxDate" | "disablePast" | "disableFuture" | "onMonthChange" | "reduceAnimations" | "shouldDisableDate" | "defaultCalendarMonth" | "disableHighlightToday" | "showDaysOutsideCurrentMonth" | "allowSameDateSelection" | "leftArrowIcon" | "rightArrowIcon" | "leftArrowButtonProps" | "rightArrowButtonProps" | "leftArrowButtonText" | "rightArrowButtonText" | "getViewSwitchingButtonText" | "renderDay" | "allowKeyboardControl" | "renderLoading" | "onYearChange" | "shouldDisableYear"> & ExportedClockPickerProps<unknown> & {
ampmInClock?: boolean | undefined;
date: unknown;
dateRangeIcon?: React.ReactNode;
getMobileKeyboardInputViewButtonText?: (() => string) | undefined;
hideTabs?: boolean | undefined;
isLandscape: boolean;
isMobileKeyboardViewOpen: boolean;
onChange: import("../internal/pickers/hooks/useViews").PickerOnChangeFn<unknown>;
openView: import("../internal/pickers/typings/Views").AllAvailableViews;
setOpenView: (view: import("../internal/pickers/typings/Views").AllAvailableViews) => void;
timeIcon?: React.ReactNode;
toggleMobileKeyboardView: () => void;
toolbarFormat?: string | undefined;
toolbarPlaceholder?: React.ReactNode;
toolbarTitle?: React.ReactNode;
views: import("../internal/pickers/typings/Views").AllAvailableViews[];
} & {
classes: Record<"separator" | "hourMinuteLabel" | "hourMinuteLabelLandscape" | "hourMinuteLabelReverse" | "ampmSelection" | "ampmLandscape" | "ampmLabel" | "penIconLandscape", string>;
}>, "children" | "onChange" | "date" | "minTime" | "maxTime" | "shouldDisableTime" | "disableIgnoringDatePartForTimeValidation" | "loading" | "views" | "onViewChange" | "openView" | "setOpenView" | "minDate" | "maxDate" | "disablePast" | "disableFuture" | "onMonthChange" | "reduceAnimations" | "shouldDisableDate" | "toolbarTitle" | "toolbarPlaceholder" | "toolbarFormat" | "defaultCalendarMonth" | "disableHighlightToday" | "showDaysOutsideCurrentMonth" | "allowSameDateSelection" | "leftArrowIcon" | "rightArrowIcon" | "leftArrowButtonProps" | "rightArrowButtonProps" | "leftArrowButtonText" | "rightArrowButtonText" | "getViewSwitchingButtonText" | "renderDay" | "allowKeyboardControl" | "renderLoading" | "onYearChange" | "shouldDisableYear" | "ampm" | "ampmInClock" | "getClockLabelText" | "minutesStep" | "isMobileKeyboardViewOpen" | "getMobileKeyboardInputViewButtonText" | "toggleMobileKeyboardView" | "dateRangeIcon" | "hideTabs" | "isLandscape" | "timeIcon"> & import("../../../material-ui-styles/src").StyledComponentProps<"separator" | "hourMinuteLabel" | "hourMinuteLabelLandscape" | "hourMinuteLabelReverse" | "ampmSelection" | "ampmLandscape" | "ampmLabel" | "penIconLandscape">>;
};
export declare type TimePickerGenericComponent<TWrapper extends SomeWrapper> = <TDate>(props: BaseTimePickerProps<TDate> & SharedPickerProps<TDate, TWrapper>) => JSX.Element;
/**
* @ignore - do not document.
*/
declare const TimePicker: TimePickerGenericComponent<React.FC<import("../internal/pickers/wrappers/ResponsiveWrapper").ResponsiveWrapperProps & import("../internal/pickers/wrappers/WrapperProps").PrivateWrapperProps>>;
export declare type TimePickerProps = React.ComponentProps<typeof TimePicker>;
export default TimePicker;