import * as _eui_base from '@eui/base'; import * as i0 from '@angular/core'; import { OnInit, OnDestroy, OnChanges, DoCheck, EventEmitter, SimpleChanges, Injector } from '@angular/core'; import { FormControl, ControlValueAccessor, NgControl, ValidatorFn } from '@angular/forms'; import { MatDatepickerInputEvent } from '@angular/material/datepicker'; import { DateAdapter } from '@angular/material/core'; import { TranslateService } from '@ngx-translate/core'; import { LocaleService } from '@eui/core'; /** * Represents a date range with start and end boundaries. * Used by the date range selector component to encapsulate selected date intervals. * Supports flexible date types including Date objects, ISO strings, or custom date representations. */ interface EuiDateRangeSelectorDates { /** * The starting boundary of the date range. * Accepts Date objects, ISO date strings, or framework-specific date types (e.g., Luxon DateTime, Day.js). */ startRange: any; /** * The ending boundary of the date range. * Accepts Date objects, ISO date strings, or framework-specific date types (e.g., Luxon DateTime, Day.js). * Must represent a date equal to or after startRange for a valid range. */ endRange: any; } /** * Provides a dual time picker interface for selecting start and end times within a time range. * Typically used within date range selection workflows where time precision is required. * Receives configuration via DYNAMIC_COMPONENT_CONFIG injection token and invokes a callback * whenever either time value changes. * * @usageNotes * ### Basic Usage (Internal Component) * This component is typically used internally by `eui-date-range-selector` when `isTimeRange` is enabled. * It's dynamically created and configured via the portal system. * * ```typescript * // Configuration passed to component * const config: EuiTimeRangePickerConfig = { * hours: 9, * mins: 0, * secs: 0, * endHours: 17, * endMins: 30, * endSecs: 0, * hasSeconds: false, * stepHours: 1, * stepMinutes: 15, * stepSeconds: 1, * callback: (h, m, s, eh, em, es) => { * console.log('Time range changed'); * } * }; * ``` * * ### Accessibility * - Each time picker has accessible labels for start and end times * - Keyboard navigation supported through underlying timepicker components * - Time values announced to screen readers on change * - Step increments help users select valid time values * * ### Notes * - Automatically created by `eui-date-range-selector` when time selection enabled * - Displays two timepickers side-by-side for start and end times * - Callback invoked on any time value change * - Supports hours, minutes, and optional seconds * - Step values control increment/decrement behavior * - Labels automatically translated via TranslateService */ declare class EuiTimeRangepickerComponent implements OnInit, OnDestroy { /** Current hour value for the start time (0-23) */ hours: number; /** Current minute value for the start time (0-59) */ mins: number; /** Current second value for the start time (0-59) */ secs: number; /** Current hour value for the end time (0-23) */ endHours: number; /** Current minute value for the end time (0-59) */ endMins: number; /** Current second value for the end time (0-59) */ endSecs: number; /** Increment step for hour selection in the time picker */ stepHours: number; /** Increment step for minute selection in the time picker */ stepMinutes: number; /** Increment step for second selection in the time picker */ stepSeconds: number; /** Determines whether seconds selection is displayed in the time pickers */ hasSeconds: boolean; /** Translated label for the start time picker */ startDateLabel: string; /** Translated label for the end time picker */ endDateLabel: string; /** Form control managing the start time picker value */ startTimeFormControl: FormControl; /** Form control managing the end time picker value */ endTimeFormControl: FormControl; get class(): string; e2eAttr: string; protected translateService: TranslateService; private destroy$; constructor(); ngOnInit(): void; ngOnDestroy(): void; private callback; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } /** * A date range selector component that allows users to select start and end dates with optional time selection. * Provides a dual-input interface with calendar picker integration and supports form validation. * Commonly used for filtering data by date ranges, booking systems, and reporting interfaces. * Implements ControlValueAccessor for seamless integration with Angular reactive forms. * * @usageNotes * ### Basic Usage * ```html * * * ``` * * ### With Form Control * ```typescript * // Component * dateRange = new FormControl({ startRange: null, endRange: null }); * * // Template * * * ``` * * ### With Time Selection * ```html * * * ``` * * ### Accessibility * - Provides `firstInputAriaLabel` and `secondInputAriaLabel` for screen readers * - Automatically announces date format to assistive technologies * - Supports keyboard navigation through calendar and time pickers * - Clear buttons are keyboard accessible when `isClearable` is enabled * - Required state is properly communicated via `aria-required` attribute * * ### Notes * - Model must be `EuiDateRangeSelectorDates` with `startRange` and `endRange` properties * - Use `islongDateFormat` for extended date display with time * - `isResponsive` enables mobile-friendly stacked layout * - Comparison ranges can be visualized with `comparisonStart` and `comparisonEnd` * - Time picker appears in calendar overlay when `isTimeRange` is true */ declare class EuiDateRangeSelectorComponent implements OnInit, OnDestroy, OnChanges, ControlValueAccessor, DoCheck { selectedDates: EuiDateRangeSelectorDates; isInvalid: boolean; isTouched: boolean; startRangeFormControl: FormControl; endRangeFormControl: FormControl; /** * Emitted when the start date is selected or changed. Payload contains the selected date value. */ firstSelectedDate: EventEmitter; /** * Emitted when the end date is selected or changed. Payload contains the selected date value. */ secondSelectedDate: EventEmitter; get class(): string; /** * Data attribute for end-to-end testing identification. * @default 'eui-date-range-selector' */ e2eAttr: string; /** * Minimum selectable date. Dates before this value will be disabled in the calendar picker. */ minDate: any; /** * Maximum selectable date. Dates after this value will be disabled in the calendar picker. */ maxDate: any; /** * SVG icon name displayed on the calendar toggle button. * @default 'eui-calendar' */ togglerIconSvg: string; /** * Accessible label text for the calendar toggle button. Used for screen readers. */ togglerLabel: string; /** * Placeholder text displayed in the start date input field when empty. */ firstInputPlaceholder: string; /** * Placeholder text displayed in the end date input field when empty. */ secondInputPlaceholder: string; /** * ARIA label for the start date input field. Provides accessible description for screen readers. */ firstInputAriaLabel: string; /** * ARIA label for the end date input field. Provides accessible description for screen readers. */ secondInputAriaLabel: string; /** * Initial value for the start date input field. Pre-populates the field on component initialization. */ startDateDefaultValue: any; /** * Initial value for the end date input field. Pre-populates the field on component initialization. */ endDateDefaultValue: any; /** * Start date for comparison range visualization. Displays as a secondary range in the calendar picker. */ comparisonStart: any; /** * End date for comparison range visualization. Displays as a secondary range in the calendar picker. */ comparisonEnd: any; /** * Initial calendar view when the picker opens. Determines the granularity of date selection. * @default 'month' */ startView: 'month' | 'year' | 'multi-year'; /** * Unique identifier for the start date input field. Used for form association and accessibility. * @default 'start-date-' */ startDateId: string; /** * Hour increment step for the time picker. Controls the granularity of hour selection. * @default 1 */ stepHours: number; /** * Minute increment step for the time picker. Controls the granularity of minute selection. * @default 1 */ stepMinutes: number; /** * Second increment step for the time picker. Controls the granularity of second selection. * @default 1 */ stepSeconds: number; /** * Enables extended date format display with additional date information. Affects input field width and layout. * @default false */ islongDateFormat: boolean; /** * Shows clear buttons in the input fields allowing users to reset selected dates. * @default false */ isClearable: boolean; /** * Makes the input fields read-only. Users can view but cannot modify the selected dates. * @default false */ isReadOnly: boolean; /** * Disables the entire component. Prevents user interaction and applies disabled styling. * @default false */ isDisabled: boolean; /** * Enables responsive layout behavior. Adjusts component layout for different screen sizes. * @default false */ isResponsive: boolean; /** * Enables time selection in addition to date selection. Adds time picker controls to the interface. * @default false */ isTimeRange: boolean; /** * Shows seconds selection in the time picker. Only effective when isTimeRange is enabled. * @default false */ hasSeconds: boolean; protected hasAriaRequiredAttribute: boolean; private destroy$; private portalHost; private portal; protected timeRangeInstance: EuiTimeRangepickerComponent; protected translateService: TranslateService; protected localeService: LocaleService<_eui_base.LocaleState>; protected adapter: DateAdapter; protected control: NgControl; private injector; private appRef; constructor(); ngOnInit(): void; ngDoCheck(): void; ngOnChanges(changes: SimpleChanges): void; ngOnDestroy(): void; /** * Method fired when the first date field changes. * @param e Event emitted when the first date changes. */ onFirstDateChange(e: MatDatepickerInputEvent): void; /** * Method fired when the second date field changes. * @param e Event emitted when the second date changes. */ onSecondDateChange(e: MatDatepickerInputEvent): void; /** * Method fired when the first date field is cleared. */ onFirstDateClear(): void; /** * Method fired when the second date field is cleared. */ onSecondDateClear(): void; writeValue(values: EuiDateRangeSelectorDates): void; /** * Sets the disabled state of the component based on the boolean value passed. * @param isDisabled - The boolean value indicating whether the component should be disabled or not. */ setDisabledState?(isDisabled: boolean): void; registerOnChange(fn: any): void; registerOnTouched(fn: any): void; /** * Creates an injector for the timepicker component. * @param data - The data to be passed to the timepicker component. * @return {Injector} - The created injector. * @protected */ protected createInjector(data: any): Injector; /** * Fires when the picker opens. * @protected */ protected onOpened(): void; /** * Fires then the time of the first date field changes. * @param e The event emitted when the time changes. * @protected */ protected onStartTimeChange(e: string | Event): void; /** * Fires then the time of the second date field changes. * @param e The event emitted when the time changes. * @protected */ protected onEndTimeChange(e: string | Event): void; /** * Extracts the time from the date input field. * @param e The event or string containing the time. * @return {hours: number, mins: number, secs: number} The extracted time. * @protected */ protected extractTime(e: string | Event): { hours: number; mins: number; secs: number; }; /** * Updates the start date time based on the provided hours, minutes, and seconds. * @param hours The hours to set. * @param mins The minutes to set. * @param secs The seconds to set. * @protected */ protected updateStartDateTime(hours: number, mins: number, secs: number): void; /** * Updates the end date time based on the provided hours, minutes, and seconds. * @param hours The hours to set. * @param mins The minutes to set. * @param secs The seconds to set. * @protected */ protected updateEndDateTime(hours: number, mins: number, secs: number): void; /** * Returns the class for the container based on the time range and hasSeconds conditions. * @return {string} The class for the container. * @protected */ protected adaptContainerClasses(): string; private propagateChange; private propagateTouched; /** * Updates the `aria-required` attribute on the input element. * @param control The NgControl instance to check for required validators. * @private */ private updateInputAriaRequiredAttribute; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; static ngAcceptInputType_islongDateFormat: unknown; static ngAcceptInputType_isClearable: unknown; static ngAcceptInputType_isReadOnly: unknown; static ngAcceptInputType_isDisabled: unknown; static ngAcceptInputType_isResponsive: unknown; static ngAcceptInputType_isTimeRange: unknown; static ngAcceptInputType_hasSeconds: unknown; } /** * Configuration interface for the time range picker component, defining start and end time values, * display options, step increments, and change callbacks for time range selection. */ interface EuiTimeRangePickerConfig { /** Start time hours value (0-23) */ hours: number; /** Start time minutes value (0-59) */ mins: number; /** Start time seconds value (0-59). Optional, only used when hasSeconds is true */ secs?: number; /** End time hours value (0-23). Optional, defines the upper bound of the time range */ endHours?: number; /** End time minutes value (0-59). Optional, defines the upper bound of the time range */ endMins?: number; /** End time seconds value (0-59). Optional, only used when hasSeconds is true */ endSecs?: number; /** Controls whether seconds fields are displayed and editable. Default is false */ hasSeconds?: boolean; /** Increment step for hours spinner. Default is 1 */ stepHours?: number; /** Increment step for minutes spinner. Default is 1 */ stepMinutes?: number; /** Increment step for seconds spinner. Default is 1 */ stepSeconds?: number; /** Callback function invoked when time values change, receiving all current time values as parameters */ callback?: (hours: number, mins: number, secs?: number, endHours?: number, endMins?: number, endSecs?: number) => void; } /** * @description * Validator that checks that the start date isn't after the end date. * * @usageNotes * If the user types a value in the input field that is not aligned with the provided format the component propagates a null value that * can be used to validate the input field. * * @returns An error map with the * `euiDateRangeInvalid` if the validation check fails, otherwise `null`. */ declare const euiStartEndDateValidator: (adapter: DateAdapter) => ValidatorFn; declare const EUI_DATE_RANGE_SELECTOR: readonly [typeof EuiTimeRangepickerComponent, typeof EuiDateRangeSelectorComponent]; export { EUI_DATE_RANGE_SELECTOR, EuiDateRangeSelectorComponent, EuiTimeRangepickerComponent, euiStartEndDateValidator }; export type { EuiDateRangeSelectorDates, EuiTimeRangePickerConfig }; //# sourceMappingURL=eui-components-eui-date-range-selector.d.ts.map