@material-ui/lab
Version:
Material-UI Lab - Incubator for Material-UI React components.
39 lines (38 loc) • 2.77 kB
TypeScript
import * as React from 'react';
import { Theme } from '@material-ui/core/styles';
import { RangeInput, DateRange, CurrentlySelectingRangeEndProps } from './RangeTypes';
import { DateRangeValidationError } from '../internal/pickers/date-utils';
import { DateInputProps, MuiTextFieldProps } from '../internal/pickers/PureDateInput';
export declare const styles: (theme: Theme) => Record<"root" | "toLabelDelimiter", import("../../../material-ui-styles/src").CSSProperties | import("../../../material-ui-styles/src").CreateCSSProperties<{}> | import("../../../material-ui-styles/src").PropsFunc<{}, import("../../../material-ui-styles/src").CreateCSSProperties<{}>>>;
export interface ExportedDateRangePickerInputProps {
/**
* The `renderInput` prop allows you to customize the rendered input.
* The `startProps` and `endProps` arguments of this render prop contains props of [TextField](https://material-ui.com/api/text-field/#textfield-api),
* that you need to forward to the range start/end inputs respectively.
* Pay specific attention to the `ref` and `inputProps` keys.
* @example
* ```jsx
* <DateRangePicker
* renderInput={(startProps, endProps) => (
* <React.Fragment>
* <TextField {...startProps} />
* <DateRangeDelimiter> to <DateRangeDelimiter>
* <TextField {...endProps} />
* </React.Fragment>;
* )}
* />
* ````
*/
renderInput: (startProps: MuiTextFieldProps, endProps: MuiTextFieldProps) => React.ReactElement;
}
export interface DateRangeInputProps extends ExportedDateRangePickerInputProps, CurrentlySelectingRangeEndProps, Omit<DateInputProps<RangeInput<any>, DateRange<any>>, 'validationError' | 'renderInput' | 'forwardedRef'> {
startText: React.ReactNode;
endText: React.ReactNode;
forwardedRef?: React.Ref<HTMLDivElement>;
containerRef?: React.Ref<HTMLDivElement>;
validationError: DateRangeValidationError;
}
declare const _default: React.ComponentType<Pick<React.PropsWithChildren<DateRangeInputProps & {
classes: Record<"root" | "toLabelDelimiter", string>;
}>, "label" | "mask" | "open" | "disabled" | "readOnly" | "children" | "onBlur" | "onChange" | "InputProps" | "openPicker" | "inputFormat" | "validationError" | "rawValue" | "forwardedRef" | "TextFieldProps" | "ignoreInvalidInputs" | "renderInput" | "openPickerIcon" | "acceptRegex" | "InputAdornmentProps" | "OpenPickerButtonProps" | "rifmFormatter" | "disableOpenPicker" | "disableMaskedInput" | "getOpenDialogAriaText" | "containerRef" | "currentlySelectingRangeEnd" | "endText" | "setCurrentlySelectingRangeEnd" | "startText"> & import("../../../material-ui/src/styles").StyledComponentProps<"root" | "toLabelDelimiter">>;
export default _default;