import { RadiantElement } from '@ecopages/radiant'; import type { EventEmitter } from '@ecopages/radiant/tools/event-emitter'; import type { DateDisplayStyle } from '@/lib/intl-date'; export type RuiDateFieldProps = { value?: string; min?: string; max?: string; disabled?: boolean; readOnly?: boolean; label?: string; name?: string; placeholder?: string; /** BCP 47 locale tag, or comma-separated fallback list (e.g. `en-US,en`). */ locale?: string; /** How the committed value is shown when the field is not being edited. */ dateStyle?: DateDisplayStyle; /** * When true (default), digits are guided by a locale mask while typing (`08/21/2002`). * When false, free text is accepted (`Aug 21, 2002`, `2022/08/22`, …) and parsed on blur. */ masked?: boolean; /** Month grids shown in the calendar popover. @default 1 */ visibleMonths?: number; }; export type RuiDateFieldChangeDetail = { value: string; }; type RuiDateFieldBindings = { value: string; disabled: boolean; readOnly: boolean; label: string; name: string; placeholder: string; displayValue: string; open: boolean; }; /** * `` — a locale-aware date text field powered by `Intl`. * * While typing, optional digit masking follows the locale pattern from `formatToParts()`. * On blur, values are parsed flexibly (numeric, masked, or month names like "Aug 21, 2002") * and displayed with `dateStyle`. Canonical `value` is ISO `YYYY-MM-DD`. * * Compose the input, toggle, popover, and calendar with the `RuiDateField*` * view helpers. `RuiDateField` supplies that composition when it has no children. * * @see https://react-aria.adobe.com/DatePicker * * @element rui-date-field * * @attr {string} value - Canonical ISO `YYYY-MM-DD` value. Default: `''`. * @attr {string} min - Earliest selectable ISO date. Default: `''`. * @attr {string} max - Latest selectable ISO date. Default: `''`. * @attr {boolean} disabled - Disable the field and calendar. Default: `false`. * @attr {boolean} read-only - Disable editing while keeping the value visible. Default: `false`. * @attr {string} label - Accessible name when there is no associated label. Default: `''`. * @attr {string} name - Native `name` for the underlying input. Default: `''`. * @attr {string} placeholder - Overrides the locale-derived placeholder. Default: `''`. * @attr {string} locale - BCP 47 locale tag, or comma-separated fallback list. Default: `''`. * @attr {string} date-style - How the committed value is displayed when not editing. Default: `medium`. * @attr {boolean} masked - Guide digits with a locale mask while typing. Default: `true`. * @attr {number} visible-months - Month grids shown in the calendar popover. Default: `1`. * * @fires rui-change - Emitted when a valid date is committed (typing or calendar pick). * * @cssclass rui-date-field - Root surface. * @cssclass rui-date-field__group - Bordered control-height row wrapping input and toggle. * @cssclass rui-date-field__input - The masked / formatted text input. * @cssclass rui-date-field__popover - Calendar popup shell (`rui-popover` / `rui-floating`). */ export declare class RuiDateField extends RadiantElement { value: string; min: string; max: string; disabled: boolean; readOnly: boolean; label: string; name: string; placeholder: string; locale: string; dateStyle: DateDisplayStyle; masked: boolean; visibleMonths: number; changeEvent: EventEmitter; displayValue: string; editing: boolean; open: boolean; private readonly uid; private popoverController; private suppressPopoverDismiss; popoverTarget: HTMLElement; private get isoValue(); private get resolvedLocale(); private get inputId(); private get resolvedPlaceholder(); private getInput; private getToggle; private getCalendar; private syncLabel; private syncInput; private syncToggle; private syncCalendar; private formatForDisplay; private formatForEditing; private syncDisplayValue; private isIsoAllowed; private commitValue; private parseAndCommit; private handleMaskedInput; private initialize; private setOpen; /** Focus the calendar's roving day, falling back to its first available day. */ private focusCalendarDay; private ensurePopoverController; private syncPopoverPosition; protected onConnected(): void; disconnectedCallback(): void; onPropsUpdated(): void; onOpenUpdated(): void; onInputFocus(): void; onInput(event: Event): void; onInputChange(): void; onInputKeydown(event: KeyboardEvent): void; onRootFocusOut(event: FocusEvent): void; onTriggerPointerDown(): void; onTriggerClick(): void; onPopoverMouseDown(event: Event): void; onCalendarChange(event: Event): void; onRootKeydown(event: KeyboardEvent): void; } export {};