import { ElementRef, EventEmitter, OnChanges, OnInit, SimpleChanges } from '@angular/core'; import { ConnectedPosition } from '@angular/cdk/overlay'; import { ControlValueAccessor } from '@angular/forms'; import { DatePeriod, DatePreset, DatePresetId } from './date-presets'; import { VerbenDateFormat } from './date-utils'; import { DatePickerSelectionMode, DatePickerVariant, DateRange, DateSelection } from './date-picker.types'; import * as i0 from "@angular/core"; export declare class DatePickerComponent implements ControlValueAccessor, OnChanges, OnInit { /** How much UI around the calendar: 'default' (just the calendar), 'simple' or 'advanced' */ variant: DatePickerVariant; /** What a click picks. Use [(selectionMode)] when the user can switch (simple / advanced) */ selectionMode: DatePickerSelectionMode; /** advanced: the tabs to offer, in order. Unset = all three */ modes: DatePickerSelectionMode[] | null; /** advanced: rename the tabs, e.g. { preset: 'Reports' } */ modeLabels: Partial>; /** * Presets: built-in ids and/or your own DatePreset objects. * Unset = a short list for the Periods tab, every built-in one for the search. */ presets: (DatePresetId | DatePreset)[] | null; /** Periods tab: which period tabs to show, in order */ periods: DatePeriod[]; /** Periods tab: offer the "Several months" checkbox to pick a span of periods */ allowSeveral: boolean; /** simple: show the "Range" checkbox */ allowRange: boolean; /** simple: understand typed presets that aren't listed ("last 5 months", "q2 2025") */ allowTypedPresets: boolean; searchPlaceholder: string; /** One day: also pick hours and minutes */ showTime: boolean; /** One day, two-way: [(date)] */ date: Date | string | null; /** A range, two-way: [(range)] */ range: DateRange | null; /** Pick today when there is no value yet (one-day mode) */ useDefaultDate: boolean; minDate: Date | string | null | undefined; maxDate: Date | string | null | undefined; placeholder: string; format: VerbenDateFormat | (string & {}); weekStartsOn: 0 | 1; /** Range: one or two months side by side (always one on phones) */ monthsShown: 1 | 2; clearable: boolean; disabled: boolean; /** Override "today" (presets are relative to it). Mainly for demos and tests */ today: Date | null; /** Field background, e.g. "var(--vbn-color-surface-alt)" */ bgColor: string | null; /** Field border, e.g. "1px solid var(--vbn-color-primary)" */ border: string | null; /** Popup width in px. Unset = fits its content */ overlayWidth: number | null; /** Popup width as CSS, e.g. "400px". Unset = fits its content */ datePickerWidth: string | null; /** @deprecated Kept so old templates compile: month and year are picked by clicking the caption */ useDropdowns: boolean; /** @deprecated See useDropdowns */ yearPlaceholder: string; /** @deprecated See useDropdowns */ monthPlaceholder: string; /** Full details of what was picked (null when cleared) */ selectionChange: EventEmitter; /** The user switched mode (simple checkbox / advanced tabs). Enables [(selectionMode)] */ selectionModeChange: EventEmitter; /** One day picked or cleared. Enables [(date)] */ dateChange: EventEmitter; /** Range or period picked or cleared. Enables [(range)] */ rangeChange: EventEmitter; trigger?: ElementRef; readonly positions: ConnectedPosition[]; readonly hourOptions: string[]; readonly minuteOptions: string[]; open: boolean; selection: DateSelection | null; /** First month on screen */ viewMonth: Date; /** Range: first click, waiting for the second */ draftStart: Date | null; hoverDate: Date | null; /** A preset being hovered (Periods tab) or highlighted (preset search) */ hoverPreset: DatePreset | null; /** Periods: active tab ('day', 'week', …) as reported by the panel */ periodTab: string; /** Periods: "Several …" checkbox, pick a span of periods */ multi: boolean; /** Periods: first period of a span in progress */ periodDraft: DatePreset | null; /** showTime: the time given to the picked day */ hour: number; minute: number; modeList: DatePickerSelectionMode[]; presetList: DatePreset[]; min: Date | null; max: Date | null; todayDate: Date; /** Where the period panel's steppers start */ panelFocus: Date; /** Days can be clicked: everywhere except the Periods tabs other than Daily */ calendarInteractive: boolean; /** Periods: the calendar shows next to the grid (hidden on phones except Daily) */ showPeriodCalendar: boolean; calendarCount: 1 | 2; /** Hour and minute selects are shown */ timeOn: boolean; /** Label of the "Several …" checkbox for the current tab ('' = hidden) */ severalLabel: string; highlightStart: Date | null; highlightEnd: Date | null; displayText: string; hint: string; summary: string; private onChange; private onTouched; constructor(); ngOnChanges(changes: SimpleChanges): void; ngOnInit(): void; labelFor(mode: DatePickerSelectionMode): string; toggle(): void; /** Classic name for toggle() */ toggleCalendar(): void; openPopup(): void; close(): void; onOverlayKeydown(event: KeyboardEvent): void; setMode(mode: DatePickerSelectionMode): void; /** simple: the "Range" checkbox */ toggleRange(): void; onDayPick(day: Date): void; onDayHover(day: Date | null): void; /** A preset is hovered (Periods tab) or highlighted (preset search): show it */ onPresetPreview(preset: DatePreset | null): void; onPresetChoose(preset: DatePreset): void; onPeriodTab(tab: string): void; onSpanStart(preset: DatePreset | null): void; toggleMulti(): void; /** One day: picks today (now, with showTime). Otherwise: shows today's month */ goToToday(): void; clear(): void; /** Classic name for clear() */ clearDate(): void; setTime(hour: number, minute: number, endOfMinute?: boolean): void; writeValue(value: unknown): void; registerOnChange(fn: (value: unknown) => void): void; registerOnTouched(fn: () => void): void; setDisabledState(isDisabled: boolean): void; private commit; /** showTime: the day at the chosen hour and minute ("End of day" adds :59.999) */ private commitTime; /** Tells every listener: ngModel / formControl, (selectionChange), and [(date)] or [(range)] */ private emit; private setSelection; private startDraft; /** * Accepts everything the picker emits, plus a DateSelection object and a * preset id ('last-month', 'q3-2026'), which is resolved against today so a * saved "Last month" stays relative. An array that exactly matches a preset * shows that preset's name. */ private fromModel; /** One day; with showTime it keeps its time */ private daySelection; private presetSelection; private matchPreset; private spanFor; private resetDraft; private toDay; private clampToBounds; private isNarrowScreen; private fmt; private fmtShort; private isFixedPreset; /** Footer text: what is hovered, else what to do next */ private buildHint; /** * Recomputes everything the template shows. Called after every state * change, so the template only reads plain fields. */ private refresh; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; static ngAcceptInputType_allowSeveral: unknown; static ngAcceptInputType_allowRange: unknown; static ngAcceptInputType_allowTypedPresets: unknown; static ngAcceptInputType_showTime: unknown; static ngAcceptInputType_useDefaultDate: unknown; static ngAcceptInputType_clearable: unknown; static ngAcceptInputType_disabled: unknown; }