import { __BaseInputProps, __InputStylesNames, BoxProps, ClearSectionMode, CloseButtonProps, DataAttributes, ElementProps, Factory, InputVariant, PopoverProps, StylesApiProps } from '@mantine/core'; import { DateStringValue, DateTimeStringValue } from '../../types'; import { CalendarBaseProps, CalendarStylesNames } from '../Calendar'; import { DecadeLevelSettings } from '../DecadeLevel'; import { MonthLevelSettings } from '../MonthLevel'; import { YearLevelSettings } from '../YearLevel'; export type MaskedDateInputStylesNames = 'fieldsRoot' | 'fieldsGroup' | 'field' | 'dateSeparator' | 'timeSeparator' | 'dropdown' | CalendarStylesNames | __InputStylesNames; export interface MaskedDateInputProps extends BoxProps, Omit<__BaseInputProps, 'size'>, CalendarBaseProps, DecadeLevelSettings, YearLevelSettings, MonthLevelSettings, StylesApiProps, ElementProps<'div', 'onChange' | 'defaultValue' | 'size'> { /** Controlled component value. YYYY-MM-DD format when withTime=false, YYYY-MM-DD HH:mm:ss when withTime=true. */ value?: DateStringValue | DateTimeStringValue | null; /** Uncontrolled component default value */ defaultValue?: DateStringValue | DateTimeStringValue | null; /** Called when value changes. Value is null when fields are incomplete. Format depends on withTime prop. */ onChange?: (value: DateStringValue | DateTimeStringValue | null) => void; /** Order of date fields @default ['day', 'month', 'year'] */ fieldsOrder?: ('day' | 'month' | 'year')[]; /** Separator displayed between date fields @default '/' */ dateSeparator?: string; /** Separator displayed between time fields @default ':' */ timeSeparator?: string; /** Determines whether time fields (hours, minutes) are displayed @default false */ withTime?: boolean; /** Determines whether seconds field is displayed (requires withTime) @default false */ withSeconds?: boolean; /** Time format, 24h or 12h @default '24h' */ format?: '24h' | '12h'; /** Labels used for am/pm values @default { am: 'AM', pm: 'PM' } */ amPmLabels?: { am: string; pm: string; }; /** Number by which hours are incremented/decremented @default 1 */ hoursStep?: number; /** Number by which minutes are incremented/decremented @default 1 */ minutesStep?: number; /** Number by which seconds are incremented/decremented @default 1 */ secondsStep?: number; /** Determines whether the calendar dropdown is displayed when input is focused @default true */ withDropdown?: boolean; /** Props passed down to Popover component */ popoverProps?: PopoverProps; /** Determines whether the clear button should be displayed @default false */ clearable?: boolean; /** Determines how the clear button and rightSection are rendered @default 'both' */ clearSectionMode?: ClearSectionMode; /** If set, the value can be deselected by clicking the selected date in the calendar dropdown */ allowDeselect?: boolean; /** If set, the value cannot be updated */ readOnly?: boolean; /** If set, the component becomes disabled */ disabled?: boolean; /** `name` prop passed down to the hidden input */ name?: string; /** `form` prop passed down to the hidden input */ form?: string; /** `aria-label` of day input @default 'Day' */ dayInputLabel?: string; /** `aria-label` of month input @default 'Month' */ monthInputLabel?: string; /** `aria-label` of year input @default 'Year' */ yearInputLabel?: string; /** `aria-label` of hours input @default 'Hours' */ hoursInputLabel?: string; /** `aria-label` of minutes input @default 'Minutes' */ minutesInputLabel?: string; /** `aria-label` of seconds input @default 'Seconds' */ secondsInputLabel?: string; /** `aria-label` of am/pm input @default 'AM/PM' */ amPmInputLabel?: string; /** Props passed to day input */ dayInputProps?: React.ComponentProps<'input'> & DataAttributes; /** Props passed to month input */ monthInputProps?: React.ComponentProps<'input'> & DataAttributes; /** Props passed to year input */ yearInputProps?: React.ComponentProps<'input'> & DataAttributes; /** Props passed to hours input */ hoursInputProps?: React.ComponentProps<'input'> & DataAttributes; /** Props passed to minutes input */ minutesInputProps?: React.ComponentProps<'input'> & DataAttributes; /** Props passed to seconds input */ secondsInputProps?: React.ComponentProps<'input'> & DataAttributes; /** Props passed to am/pm select */ amPmSelectProps?: React.ComponentProps<'select'> & DataAttributes; /** Props passed to clear button */ clearButtonProps?: CloseButtonProps & ElementProps<'button'> & DataAttributes; /** Props passed to hidden input */ hiddenInputProps?: React.ComponentProps<'input'> & DataAttributes; /** Day input placeholder @default '--' */ dayPlaceholder?: string; /** Month input placeholder @default '--' */ monthPlaceholder?: string; /** Year input placeholder @default '----' */ yearPlaceholder?: string; /** Hours input placeholder @default '--' */ hoursPlaceholder?: string; /** Minutes input placeholder @default '--' */ minutesPlaceholder?: string; /** Seconds input placeholder @default '--' */ secondsPlaceholder?: string; /** Ref to day input element */ dayRef?: React.Ref; /** Ref to month input element */ monthRef?: React.Ref; /** Ref to year input element */ yearRef?: React.Ref; /** Ref to hours input element */ hoursRef?: React.Ref; /** Ref to minutes input element */ minutesRef?: React.Ref; /** Ref to seconds input element */ secondsRef?: React.Ref; /** Ref to am/pm select element */ amPmRef?: React.Ref; /** Called once when one of the inputs is focused */ onFocus?: (event: React.FocusEvent) => void; /** Called once when focus leaves all inputs */ onBlur?: (event: React.FocusEvent) => void; /** A function to transform pasted values */ pasteSplit?: (value: string) => { day: number | null; month: number | null; year: number | null; hours?: number | null; minutes?: number | null; seconds?: number | null; }; } export type MaskedDateInputFactory = Factory<{ props: MaskedDateInputProps; ref: HTMLDivElement; stylesNames: MaskedDateInputStylesNames; variant: InputVariant; }>; export declare const MaskedDateInput: import("@mantine/core").MantineComponent<{ props: MaskedDateInputProps; ref: HTMLDivElement; stylesNames: MaskedDateInputStylesNames; variant: InputVariant; }>; export declare namespace MaskedDateInput { type Props = MaskedDateInputProps; type StylesNames = MaskedDateInputStylesNames; type Factory = MaskedDateInputFactory; }