import * as i0 from '@angular/core'; import { EventEmitter, AfterViewInit, ElementRef } from '@angular/core'; import * as rxjs from 'rxjs'; import { InputControlDirective, CustomFormControl } from '@odx/angular/cdk/custom-form-control'; import { DateFilter } from '@odx/angular/components/calendar'; import { DropdownDirective } from '@odx/angular/components/dropdown'; import { Position } from '@odx/angular/utils'; import * as i1 from '@odx/angular'; import { ReadonlyController } from '@odx/angular'; import * as i2 from 'ngx-mask'; import { NgxMaskDirective } from 'ngx-mask'; import { Validator, AbstractControl, ValidationErrors } from '@angular/forms'; /** * A directive to enhance an input element as part of a datepicker control. It applies date input formatting, * mask handling, and emits focus events. This directive integrates with ngx-mask to handle input masking and * ensures that the input complies with the date format specified in the datepicker configuration. * Extends the `InputControlDirective` to provide input control functionality. * Has host directive `WithTabIndex` to manage the tabindex attribute of the input element. * * @see {InputControlDirective} * @see {WithTabIndex} */ declare class DatepickerInputControlDirective extends InputControlDirective { protected readonly readonlyController: ReadonlyController | null; protected readonly config: { inputDateOrder: string; inputDateSeparator: string; }; readonly ngxMaskDirective: NgxMaskDirective; /** * Emits an event when the input field receives focus or loses focus, indicating the focus state. * * @emits {boolean} - Indicates whether the input field is focused. */ focused: EventEmitter; /** * Gets the current value of the input field as a `Date` object, based on the date format from the datepicker * configuration. * * @returns {Date | null} - The current value of the input field as a `Date` object, or `null` if the value is invalid. */ get valueAsDate(): Date | null; /** * Computes the placeholder text for the input based on the date format from * the datepicker configuration. * * @returns {string} - The placeholder text, typically the date format in uppercase. */ get placeholder(): string; protected handleFocusIn(): void; protected handleFocusOut(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } /** * Represents a datepicker component for selecting a date. * Extends the `CustomFormControl` class and implements the `AfterViewInit` interface. * * @see {CustomFormControl} */ declare class DatepickerComponent extends CustomFormControl implements AfterViewInit { protected readonly takeUntilDestroyed: () => rxjs.MonoTypeOperatorFunction; protected readonly config: { inputDateOrder: string; inputDateSeparator: string; }; readonly element: ElementRef; /** * Gets a value indicating whether the datepicker is currently open. * * @returns {boolean} */ get isOpen(): boolean; /** * Represents the current date. * * @type {Date} */ today: Date; /** * The filter function used to determine if a date should be included or excluded in the datepicker. * If set to `null`, no filtering will be applied. * * @type {DateFilter | null} * @default null * * @example * ```ts * // Excludes mondays from the datepicker. * const filterFn: DateFilter = (date) => date.getDay() !== 1; * ``` */ filterFn: DateFilter | null; /** * The minimum selectable date for the datepicker. * If set to null, there is no minimum date restriction. * * @type {Date | null} * @default null */ minDate: Date | null; /** * The maximum selectable date for the datepicker. * If set to null, there is no maximum date restriction. * * @type {Date | null} * @default null */ maxDate: Date | null; /** * The position of the dropdown relative to the input field. * * @type {Position} * @default Position.BOTTOM */ dropdownPosition: Position; /** * When set to true, the select will display a reset button. * * @type {boolean} * @default false */ clearable: i0.InputSignalWithTransform; /** * Emits the selected date when it changes. * * @emits {Date} */ selectedChange: EventEmitter; /** * The dropdown directive used in the datepicker component. * * @type {DropdownDirective} */ dropdown: DropdownDirective; /** * The dropdown trigger element used in the datepicker component. * * @type {ElementRef} */ dropdownTriggerElement: ElementRef; /** * The date field input control directive used in the datepicker component. * * @type {DatepickerInputControlDirective | undefined} */ dateField?: DatepickerInputControlDirective; constructor(); ngAfterViewInit(): void; /** * Selects a date. * * @param {Date | null} value - The date value to be selected. */ selectDate(value: Date | null): void; /** * Resets the datepicker's value to null. */ reset(): void; /** * @internal * Writes a new value to the element. * Part of the ControlValueAccessor interface. * @param {Date | null} value - The new value. */ writeValue(value: Date | null): void; /** * Opens the datepicker dropdown. * * @param {KeyboardEvent} event */ openDatepicker(event?: Event): void; protected updateInternalValue(value: Date | null): void; protected handleDateFieldChanges(): void; protected handleDateFieldFocus(): void; private updateDateField; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } /** * A validation directive to be used with date picker controls that have minimum and maximum date constraints. */ declare class DatepickerMinMaxValidator implements Validator { private onChange?; minDate: i0.InputSignal; maxDate: i0.InputSignal; constructor(); registerOnValidatorChange(fn: () => void): void; validate(control: AbstractControl): ValidationErrors | null; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } /** * A validation directive to be used with date picker controls that have filtering capabilities. */ declare class DatepickerFilterValidator implements Validator { private onChange?; filterFn: i0.InputSignal; constructor(); registerOnValidatorChange(fn: () => void): void; validate(control: AbstractControl): ValidationErrors | null; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } declare class DatepickerModule { static ɵfac: i0.ɵɵFactoryDeclaration; static ɵmod: i0.ɵɵNgModuleDeclaration; static ɵinj: i0.ɵɵInjectorDeclaration; } export { DatepickerComponent, DatepickerFilterValidator, DatepickerInputControlDirective, DatepickerMinMaxValidator, DatepickerModule };