import { EventEmitter } from "../../stencil-public-runtime"; import { StzhCalendarDateDisabledPredicate, StzhDatepickerChangeEvent, StzhLocaleAdapter } from "../../index"; import { StzhDatepickerLocalizedText } from "./stzh-datepicker.localization"; type StzhDatepickerSection = "day" | "month" | "year"; type StzhDatepickerSections = Record; /** * @slot action - Slot for action below calendar (stzh-link element) */ export declare class StzhDatepicker { /** * Minimum date allowed to be picked. Must be in IS0-8601 format: YYYY-MM-DD. * This setting can be used alone or together with the max property. */ calendarMin: string; /** * Maximum date allowed to be picked. Must be in IS0-8601 format: YYYY-MM-DD. * This setting can be used alone or together with the min property. */ calendarMax: string; /** * Controls which days are disabled and therefore disallowed. * For example, this can be used to disallow selection of weekends. */ calendarIsDateDisabled: StzhCalendarDateDisabledPredicate; /** Name of the hidden date picker input. */ name: string; /** Value of the hidden date picker input. If a date can be parsed (via picker always), the value is in ISO format. */ value: string; calendarValue: string; sections: StzhDatepickerSections; activeSection: StzhDatepickerSection; isSectionSelectionFresh: boolean; /** Default value (used by reset) */ defaultValue: string; /** Label for input field and popover */ label: string; /** Whether label is visually hidden. */ labelHidden: boolean; /** Whether the element is readonly or not */ readonly: boolean; /** Whether the element is disabled or not */ disabled: boolean; /** Description message (use description slot as alternative) */ description: string; /** Long description message appearing in a popover (use description-long slot as alternative) */ descriptionLong: string; /** One or multiple error message (use error slot as alternative) */ error: string | string[]; private _error; /** Invalid status */ invalid: boolean; /** Required status */ required: boolean; /** Hide `(optional)` label (or use `required` inside form to hide it) */ hideOptional: boolean; /** Size variant */ size: "default" | "small"; /** Show calendar inline */ inline: boolean; /** Whether to open the calendar popover when the date input receives focus. Dates close to today are easier to enter using the calendar, and it is less suitable for dates far in the past or future (e.g. date of birth). */ openCalendarOnFocus: boolean; /** * Date adapter for internal date passed to backend, for custom parsing/formatting. Can be `"iso"` (default, date in ISO format) or `StzhLocaleAdapter` (must be object with a `parse` function which accepts a `string` and returns a `Date`, and a `format` function which accepts a `Date` and returns a `string`.) */ internalDateAdapter: "iso" | StzhLocaleAdapter; private _internalDateAdapter; private _dateAdapter; /** Translation strings. */ localization: StzhDatepickerLocalizedText; buttonLabel: string; private isUpdatingValue; resetListener(event: Event): void; onSectionsBeforeInput(event: InputEvent): void; createDateFormatters(): void; /** Update calendar and input when value prop has changed */ valueWatcher(newValue: string): void; private createDateAdapter; internalDateAdapterWatcher(newValue: "iso" | StzhLocaleAdapter): void; /** Set value by a JS Date object */ setDate(date: Date): Promise; /** Return internal popover element */ getPopover(): Promise; stzhChange: EventEmitter; errorWatcher(newValue: string | string[]): void; element: HTMLStzhDatepickerElement; /** * To format dates exclusively for the benefit of screen readers. * * We prefer DateTimeFormat over date.toLocaleDateString, as the former has * better performance when formatting large number of dates. See: * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleDateString#Performance */ private dateFormatLong; private fieldWrapperEl; private calendarButtonEl; private popoverEl; private readonly uid; private get _isInteractive(); private isWithinDatepickerFocusBoundary; private setValue; private applyCanonicalDate; private applyDate; private clearCanonicalDate; private clearSections; private applySectionsFromDate; private getSectionDisplayValue; private getCompleteDisplayValue; private getDateFromSections; private setSectionDigit; private canAutoAdvanceFromSection; private clearSectionDigit; private focusSection; private selectSectionText; private syncCanonicalDateFromSections; private applyUserDate; private emitChange; private handleReset; private onLabelClick; private onInputClick; onCalendarButtonClick(event: MouseEvent): void; private onFieldWrapperFocusIn; private onFieldWrapperFocusOut; private onSectionsKeydown; private onSectionsPaste; private onSectionClick; private onSectionFocus; private onCalendarChange; private updateButtonAccessibleLabel; connectedCallback(): void; componentWillLoad(): Promise; render(): any; } export {};