import { FormControlController } from '../shared/form-control.js'; import { type DateFormat, type Era } from '../../core/date.js'; import type { UiDateField } from './date-field.js'; import { UiElement } from '../shared/element.js'; export type Field = 'start' | 'end'; /** `container.contains(node)` across shadow boundaries (focus relatedTargets come un-retargeted in event detail). */ export declare function isWithin(node: Node | null, container: Node | null | undefined): boolean; interface FieldError { flags: ValidityStateFlags; message: string; } /** * ``'s fields and validation: its properties and state, the form API, each box's text and value, and * what makes a box invalid. `DatePickerPopup` adds the calendar's popover and sheet, `UiDatePicker` typing, picking and render. */ export declare class DatePickerFields extends UiElement { /** Visible label text; the `label` slot replaces it when markup is needed. */ label: string; /** Keep the label for screen readers but don't show it. */ hideLabel: boolean; /** Helper text under the field, shown while there is no error or warning. */ helperText: string; /** Error text shown while `invalid` or while the field fails validation. */ invalidText: string; /** Forces the error state, e.g. after server-side validation. */ invalid: boolean; /** Non-blocking warning; shown when there is no error. */ warn: boolean; /** Text of the warning shown while `warn`. */ warnText: string; /** ISO yyyy-mm-dd (the start date in `range` mode). */ value: string; /** Reflected: form-associated elements submit under the `name` attribute. */ name: string; /** Two fields sharing one calendar (Carbon `datePickerType="range"`). */ range: boolean; /** Range mode: the end date, ISO yyyy-mm-dd. */ endValue: string; /** Range mode: form entry name of the end date. Without it the range submits as one `name` entry `start/end`. */ endName: string; /** Range mode: label of the end field. */ endLabel: string; /** Earliest selectable date, ISO yyyy-mm-dd. */ min: string; /** Latest selectable date, ISO yyyy-mm-dd. */ max: string; format: DateFormat; /** * Locale for names, labels and messages. Defaults to the nearest `lang`: the element's own, an * ancestor's, then ``'s, else the browser language. */ locale: string; /** Year era shown and typed: `be` (พ.ศ.) or `ce` (ค.ศ.). Defaults to `be` for Thai locales. */ era: Era | ''; /** 0 = Sunday … 6 = Saturday. */ firstDay: number; /** Disables the control; a disabled `
` ancestor does the same. */ disabled: boolean; /** Blocks form submission while the field is empty. */ required: boolean; /** Shows and submits the value but blocks changes. */ readonly: boolean; /** Carbon `FluidDatePicker`: each date box is a 64px box with its label inside. `` sets it for every field inside. */ fluid: boolean; /** * Which picker opens: `auto` (default) = our calendar, in a bottom sheet on a phone; `custom` = our calendar as a * popover on every device; `sheet` = in a bottom sheet on every device; `native` = the OS date picker. */ picker: 'auto' | 'custom' | 'sheet' | 'native'; /** Shows a clear button inside the field while it has text. */ clearable: boolean; /** Adds a "Today" button under the calendar. */ showToday: boolean; /** Months to show side by side in the calendar, 1 to 12 (default 1, e.g. 2 for range picking). */ months: number; /** With more than one month, ‹ › turn a whole page (`months`) or one month (`single`): the calendar's `page-by`. */ pageBy: 'months' | 'single'; /** Show the days of the months before and after (by default they are blank): the calendar's `show-outside-days`. */ showOutsideDays: boolean; /** Extra `part` names for a calendar day, e.g. `holiday`: the calendar's `getDayParts`; the picker exports each name it returns, so `ui-date-picker::part(holiday)` styles those days. */ getDayParts?: (date: Date) => string; /** A column of ISO week numbers in the calendar: its `show-week-numbers`. */ showWeekNumbers: boolean; /** Weekday headings `narrow` or `short`: the calendar's `weekday-format`. */ weekdayFormat: 'narrow' | 'short' | ''; /** The day the calendar marks as today, ISO (default the real today). */ today: string; /** Field height, same scale as ui-text-input. */ size: 'sm' | 'md' | 'lg'; /** * Property only. Return `true` for days that can't be chosen (weekends, holidays…), or a string * to show that reason instead of the generic message. */ isDateDisabled?: (date: Date) => boolean | string; protected text: string; private endText; /** Disabled, reset defaults, validation on submit and the name given from outside (shared by the form fields). */ protected readonly formControl: FormControlController; protected open: boolean; /** Day that holds the calendar's roving focus. */ protected focusDate: Date; protected touched: boolean; /** Range mode: the field the calendar is currently picking for. */ protected activeField: Field; /** The text box that last had focus: Tab / Shift+Tab / Esc in the calendar act relative to it (Carbon `_lastFocusInput`). */ protected lastField: Field; /** Set while the picker itself moves focus back to a text box, so that focus doesn't re-open the calendar. */ protected returningFocus: boolean; protected readonly startField: UiDateField; private readonly endField; protected readonly fieldsEl: HTMLElement; /** Message from `setCustomValidity()`; '' = none. */ protected customValidityMessage: string; /** Like `.setCustomValidity()`: a non-empty message makes the field invalid (and is shown as its error once touched) until cleared with ''. */ setCustomValidity(message: string): void; private readonly localize; private readonly fieldId; protected defaultValue: string; protected defaultEnd: string; private lastSyncedValue; private lastSyncedEnd; /** A field whose typed date is already its value, not yet committed: the value `change` is judged against on commit. */ protected uncommitted: Partial>; /** Move DOM focus with focusDate only when the user is navigating the grid itself. */ protected focusInGrid: boolean; /** Enter in the text box submits the form, like a native input. */ protected readonly onEnterKey: (event: KeyboardEvent) => void; get form(): HTMLFormElement | null; get validationMessage(): string; /** Whether the field takes part in constraint validation (not while disabled), as natively. */ get willValidate(): boolean; /** The `