import * as React from 'react'; import { TextFieldProps } from '@mui/material/TextField'; import { IconButtonProps } from '@mui/material/IconButton'; import { InputAdornmentProps } from '@mui/material/InputAdornment'; import { SvgIconProps } from '@mui/material/SvgIcon'; import { MakeOptional, SlotComponentPropsFromProps } from '@mui/x-internals/types'; import { FieldOwnerState } from "../../models/index.js"; import { UseFieldOwnerStateParameters } from "../hooks/useFieldOwnerState.js"; import type { UseFieldReturnValue, UseFieldProps } from "../hooks/useField/index.js"; import { PickersTextFieldProps } from "../../PickersTextField/index.js"; export declare const cleanFieldResponse: , "onClear" | "clearable">>({ enableAccessibleFieldDOMStructure, ...fieldResponse }: TFieldResponse) => ExportedPickerFieldUIProps & { openPickerAriaLabel: string; textFieldProps: TextFieldProps | PickersTextFieldProps; }; export declare const PickerFieldUIContext: React.Context; /** * Adds the button to open the Picker and the button to clear the value of the field. * @ignore - internal component. */ export declare function PickerFieldUI>(props: PickerFieldUIProps): React.JSX.Element; export interface ExportedPickerFieldUIProps { /** * If `true`, a clear button will be shown in the field allowing value clearing. * @default false */ clearable?: boolean; /** * Callback fired when the clear button is clicked. */ onClear?: React.MouseEventHandler; /** * The position at which the clear button is placed. * If the field is not clearable, the button is not rendered. * @default 'end' */ clearButtonPosition?: 'start' | 'end'; /** * The position at which the opening button is placed. * If there is no Picker to open, the button is not rendered * @default 'end' */ openPickerButtonPosition?: 'start' | 'end'; } export interface PickerFieldUIProps> { /** * Overridable component slots. * @default {} */ slots?: PickerFieldUISlots; /** * The props used for each component slot. * @default {} */ slotProps?: PickerFieldUISlotProps; /** * Object returned by the `useField` hook or one of its wrapper (for example `useDateField`). */ fieldResponse: UseFieldReturnValue; /** * The component to use to render the Picker opening icon if none is provided in the Picker's slots. */ defaultOpenPickerIcon: React.ElementType; } export interface PickerFieldUISlots { /** * Form control with an input to render the value. * @default , or from '@mui/material' if `enableAccessibleFieldDOMStructure` is `false`. */ textField?: React.ElementType; /** * Component displayed on the start or end input adornment used to open the Picker. * @default InputAdornment */ inputAdornment?: React.ElementType; /** * Button to clear the value. * @default IconButton */ clearButton?: React.ElementType; /** * Icon to display in the button used to clean the value. * @default ClearIcon */ clearIcon?: React.ElementType; } export interface PickerFieldUISlotsFromContext extends PickerFieldUISlots { /** * Button to open the Picker. * @default IconButton */ openPickerButton?: React.ElementType; /** * Icon to display in the button used to open the Picker. */ openPickerIcon?: React.ElementType; } export interface PickerFieldUISlotProps { textField?: SlotComponentPropsFromProps | PickersTextFieldProps, {}, FieldOwnerState>; inputAdornment?: SlotComponentPropsFromProps; clearIcon?: SlotComponentPropsFromProps; clearButton?: SlotComponentPropsFromProps; } export interface PickerFieldUISlotPropsFromContext extends PickerFieldUISlotProps { openPickerButton?: SlotComponentPropsFromProps; openPickerIcon?: SlotComponentPropsFromProps; } interface FieldInputAdornmentOwnerState extends FieldOwnerState { position: 'start' | 'end'; } interface PickerFieldUIContextValue { inputRef: React.Ref | undefined; slots: PickerFieldUISlotsFromContext; slotProps: PickerFieldUISlotPropsFromContext; } export declare function mergeSlotProps(slotPropsA: SlotComponentPropsFromProps | undefined, slotPropsB: SlotComponentPropsFromProps | undefined): Partial | ((ownerState: TOwnerState) => {}) | undefined; /** * The `textField` slot props cannot be handled inside `PickerFieldUI` because it would be a breaking change to not pass the enriched props to `useField`. * Once the non-accessible DOM structure will be removed, we will be able to remove the `textField` slot and clean this logic. */ export declare function useFieldTextFieldProps(parameters: UseFieldTextFieldPropsParameters): TProps; interface UseFieldTextFieldPropsParameters { slotProps: { textField?: SlotComponentPropsFromProps | PickersTextFieldProps, {}, FieldOwnerState>; } | undefined; ref: React.Ref; externalForwardedProps: any; } export declare function PickerFieldUIContextProvider(props: PickerFieldUIContextProviderProps): React.JSX.Element; interface PickerFieldUIContextProviderProps { children: React.ReactNode; inputRef: React.Ref | undefined; slots: PickerFieldUISlotsFromContext | undefined; slotProps: PickerFieldUISlotPropsFromContext | undefined; } export {};