import * as i2 from "igniteui-angular/core"; import { DatePart, DatePartDeltas, IBaseEventArgs, ITimePickerResourceStrings, IgxPickerActionsDirective, IgxPickerClearComponent, IgxPickerToggleComponent, OverlaySettings, PickerInteractionMode } from "igniteui-angular/core"; import * as i0 from "@angular/core"; import { AfterViewInit, ElementRef, EventEmitter, InjectionToken, OnDestroy, OnInit, PipeTransform } from "@angular/core"; import { AbstractControl, ControlValueAccessor, ValidationErrors, Validator } from "@angular/forms"; import * as i3 from "igniteui-angular/input-group"; import { IgxHintDirective, IgxLabelDirective, IgxPrefixDirective, IgxSuffixDirective } from "igniteui-angular/input-group"; import { PickerBaseDirective } from "igniteui-angular/date-picker"; /** @hidden */ declare const IGX_TIME_PICKER_COMPONENT: InjectionToken; /** @hidden */ type IgxTimePickerListType = 'hourList' | 'minuteList' | 'secondsList' | 'ampmList'; /** * @hidden * Returns the last value of a minutes/seconds list starting from 0 and generated with the given delta. */ declare function getLastListValue(delta: number): number; /** @hidden */ interface IgxTimePickerBase { hourList: ElementRef; minuteList: ElementRef; secondsList: ElementRef; ampmList: ElementRef; itemsDelta: Pick; selectedDate: Date; maxDropdownValue: Date; minDropdownValue: Date; isTwelveHourFormat: boolean; showAmPmList: boolean; /** @hidden @internal */ appliedFormat: string; nextHour(delta: number): void; nextMinute(delta: number): void; nextSeconds(delta: number): void; nextAmPm(delta: number): void; cancelButtonClick(): void; okButtonClick(): void; onItemClick(item: string, dateType: IgxTimePickerListType): void; getPartValue(value: Date, type: DatePart): string; } export interface IgxTimePickerValidationFailedEventArgs extends IBaseEventArgs { previousValue: Date | string; currentValue: Date | string; } export declare class IgxTimePickerComponent extends PickerBaseDirective implements IgxTimePickerBase, ControlValueAccessor, OnInit, OnDestroy, AfterViewInit, Validator { private _injector; private platform; private cdr; private readonly _keyBindings; /** * Sets the value of the `id` attribute. * ```html * * ``` */ id: string; /** * The format used when editable input is not focused. Defaults to the `inputFormat` if not set. * * @remarks * Uses Angular's `DatePipe`. * * @example * ```html * * ``` * */ set displayFormat(value: string); get displayFormat(): string; /** * The expected user input format and placeholder. * * @remarks * Default is `hh:mm tt` * * @example * ```html * * ``` */ set inputFormat(value: string); get inputFormat(): string; /** * Gets/Sets the interaction mode - dialog or drop down. * * @example * ```html * * ``` */ mode: PickerInteractionMode; /** * The minimum value the picker will accept. * * @remarks * If a `string` value is passed in, it must be in ISO format. * * @example * ```html * * ``` */ set minValue(value: Date | string); get minValue(): Date | string; /** * Gets if the dropdown/dialog is collapsed * * ```typescript * let isCollapsed = this.timePicker.collapsed; * ``` */ get collapsed(): boolean; /** * The maximum value the picker will accept. * * @remarks * If a `string` value is passed in, it must be in ISO format. * * @example * ```html * * ``` */ set maxValue(value: Date | string); get maxValue(): Date | string; /** * Sets whether the seconds, minutes and hour spinning will loop back around when end value is reached. * By default it's set to true. * ```html * * ``` */ spinLoop: boolean; /** * Gets/Sets a custom formatter function on the selected or passed date. * * @example * ```html * * ``` */ formatter?: (val: Date) => string; /** @hidden @internal */ readOnly: boolean; /** * Emitted after a selection has been done. * * @example * ```html * * ``` */ selected: EventEmitter; /** * Emitted when the picker's value changes. * * @remarks * Used for `two-way` bindings. * * @example * ```html * * ``` */ valueChange: EventEmitter; /** * Emitted when the user types/spins invalid time in the time-picker editor. * * @example * ```html * * ``` */ validationFailed: EventEmitter; /** @hidden */ hourList: ElementRef; /** @hidden */ minuteList: ElementRef; /** @hidden */ secondsList: ElementRef; /** @hidden */ ampmList: ElementRef; /** @hidden @internal */ label?: IgxLabelDirective; /** @hidden @internal */ timePickerActionsDirective: IgxPickerActionsDirective; private inputDirective; private _inputGroup; private dateTimeEditor; private toggleRef; /** @hidden */ get showClearButton(): boolean; /** @hidden */ get showHoursList(): boolean; /** @hidden */ get showMinutesList(): boolean; /** @hidden */ get showSecondsList(): boolean; /** @hidden */ get showAmPmList(): boolean; /** @hidden */ get isTwelveHourFormat(): boolean; /** @hidden @internal */ get isVertical(): boolean; /** @hidden @internal */ get selectedDate(): Date; /** @hidden @internal */ get minDateValue(): Date; /** @hidden @internal */ get maxDateValue(): Date; /** @hidden @internal */ get appliedFormat(): string; protected get toggleContainer(): HTMLElement | undefined; private get required(); private get dialogOverlaySettings(); private get dropDownOverlaySettings(); private get inputGroupElement(); /** @hidden @internal */ displayValue: PipeTransform; /** @hidden @internal */ minDropdownValue: Date; /** @hidden @internal */ maxDropdownValue: Date; private _value; private _dateValue; private _dateMinValue; private _dateMaxValue; private _selectedDate; /** The time the selection was derived from, before rounding and clamping to the dropdown range */ private _selectionSource; private _resourceStrings; private _customResourceStrings; private _defaultResourceStrings; private _okButtonLabel; private _cancelButtonLabel; private _itemsDelta; private _statusChanges$; private _control; private _onChangeCallback; private _onTouchedCallback; private _onValidatorChange; private _defaultDialogOverlaySettings; private _defaultDropDownOverlaySettings; /** * The currently selected value / time from the drop-down/dialog * * @remarks * The current value is of type `Date` * * @example * ```typescript * const newValue: Date = new Date(2000, 2, 2, 10, 15, 15); * this.timePicker.value = newValue; * ``` */ get value(): Date | string; /** * An accessor that allows you to set a time using the `value` input. * ```html * public date: Date = new Date(Date.now()); * //... * * ``` */ set value(value: Date | string); /** * An accessor that sets the resource strings. * By default it uses EN resources. */ set resourceStrings(value: ITimePickerResourceStrings); /** * An accessor that returns the resource strings. */ get resourceStrings(): ITimePickerResourceStrings; /** * Overrides the default text of the **OK** button. * * @remarks * Defaults to the value from resource strings, `"OK"` for the built-in EN. * * ```html * * ``` */ set okButtonLabel(value: string); /** * An accessor that returns the label of ok button. */ get okButtonLabel(): string; /** * Overrides the default text of the **Cancel** button. * @remarks * Defaults to the value from resource strings, `"Cancel"` for the built-in EN. * ```html * * ``` */ set cancelButtonLabel(value: string); /** * An accessor that returns the label of cancel button. */ get cancelButtonLabel(): string; /** * Delta values used to increment or decrement each editor date part on spin actions and * to display time portions in the dropdown/dialog. * By default `itemsDelta` is set to `{hour: 1, minute: 1, second: 1}` * ```html * * ``` */ set itemsDelta(value: Pick); get itemsDelta(): Pick; constructor(); /** @hidden @internal */ getPartValue(value: Date, type: DatePart): string; /** @hidden @internal */ toISOString(value: Date): string; /** @hidden @internal */ writeValue(value: Date | string): void; /** @hidden @internal */ registerOnChange(fn: (_: Date | string) => void): void; /** @hidden @internal */ registerOnTouched(fn: () => void): void; /** @hidden @internal */ registerOnValidatorChange(fn: any): void; /** @hidden @internal */ validate(control: AbstractControl): ValidationErrors | null; /** @hidden @internal */ setDisabledState(isDisabled: boolean): void; /** @hidden */ ngOnInit(): void; /** @hidden */ ngAfterViewInit(): void; /** @hidden */ ngOnDestroy(): void; /** @hidden */ getEditElement(): HTMLInputElement; /** * Opens the picker's dialog UI. * * @param settings OverlaySettings - the overlay settings to use for positioning the drop down or dialog container according to * ```html * * * ``` */ open(settings?: OverlaySettings): void; /** * Closes the dropdown/dialog. * ```html * * ``` * ```typescript * @ViewChild('timePicker', { read: IgxTimePickerComponent }) picker: IgxTimePickerComponent; * picker.close(); * ``` */ close(): void; toggle(settings?: OverlaySettings): void; /** * Clears the time picker value if it is a `string` or resets the time to `00:00:00` if the value is a Date object. * * @example * ```typescript * this.timePicker.clear(); * ``` */ clear(): void; /** * Selects time from the igxTimePicker. * * @example * ```typescript * this.timePicker.select(date); * * @param date Date object containing the time to be selected. */ select(date: Date | string): void; /** * Increment a specified `DatePart`. * * @param datePart The optional DatePart to increment. Defaults to Hour. * @param delta The optional delta to increment by. Overrides `itemsDelta`. * @example * ```typescript * this.timePicker.increment(DatePart.Hours); * ``` */ increment(datePart?: DatePart, delta?: number): void; /** * Decrement a specified `DatePart` * * @param datePart The optional DatePart to decrement. Defaults to Hour. * @param delta The optional delta to decrement by. Overrides `itemsDelta`. * @example * ```typescript * this.timePicker.decrement(DatePart.Seconds); * ``` */ decrement(datePart?: DatePart, delta?: number): void; /** @hidden @internal */ cancelButtonClick(): void; /** @hidden @internal */ okButtonClick(): void; /** @hidden @internal */ onItemClick(item: string, dateType: IgxTimePickerListType): void; /** @hidden @internal */ nextHour(delta: number): void; /** @hidden @internal */ nextMinute(delta: number): void; /** @hidden @internal */ nextSeconds(delta: number): void; /** @hidden @internal */ nextAmPm(delta?: number): void; /** @hidden @internal */ setSelectedValue(value: Date): void; protected onStatusChanged(): void; protected updateResources(): void; private updateDropdownRange; /** Rounds the min value up to the first available list item */ private getMinDropdownValue; /** Rounds the max value down to the last available list item */ private getMaxDropdownValue; /** * Returns a new date with its time rounded up to the closest multiples of the given deltas. * Overflowing seconds/minutes are carried to the next minute/hour, which may move the date to the next day. */ private roundUpToItemsDelta; private roundUpToDelta; private toTodayTime; private applyValue; /** Returns the next list value in the direction of delta, looping between min and max when spinLoop is enabled */ private nextItemValue; private updateSelectedDate; private initializeContainer; private validateDropdownValue; private emitValueChange; private emitValidationFailedEvent; private updateValidityOnBlur; private parseToDate; private toTwentyFourHourFormat; private updateValue; private updateEditorValue; private subscribeToDateEditorEvents; private subscribeToToggleDirectiveEvents; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; static ngAcceptInputType_spinLoop: unknown; static ngAcceptInputType_readOnly: unknown; } /** @hidden */ export declare class IgxItemListDirective implements OnInit, OnDestroy { timePicker: IgxTimePickerBase; private elementRef; private readonly _keyBindings; private _gestures; tabindex: number; type: IgxTimePickerListType; isActive: boolean; private readonly SCROLL_THRESHOLD; private readonly PAN_THRESHOLD; /** * accumulates wheel scrolls and triggers a change action above SCROLL_THRESHOLD */ private scrollAccumulator; get defaultCSS(): boolean; get hourCSS(): boolean; get minuteCSS(): boolean; get secondsCSS(): boolean; get ampmCSS(): boolean; constructor(); onFocus(): void; onBlur(): void; /** * @hidden */ onKeydownArrowRight(): void; /** * @hidden */ onKeydownArrowLeft(): void; /** * @hidden */ onHover(): void; /** * @hidden */ onScroll(event: WheelEvent): void; /** * @hidden @internal */ ngOnInit(): void; /** * @hidden @internal */ ngOnDestroy(): void; /** Focuses the closest rendered list in the given direction, if any */ private focusSiblingList; private nextItem; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } /** * @hidden */ export declare class IgxTimeItemDirective { timePicker: IgxTimePickerBase; private itemList; value: string; get defaultCSS(): boolean; get selectedCSS(): boolean; get activeCSS(): boolean; get isSelectedTime(): boolean; get minValue(): string; get maxValue(): string; get hourValue(): string; onClick(item: string): void; private getHourPart; private isSameMinute; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } export declare const IGX_TIME_PICKER_DIRECTIVES: readonly [typeof IgxTimePickerComponent, typeof IgxPickerActionsDirective, typeof IgxPickerToggleComponent, typeof IgxPickerClearComponent, typeof IgxLabelDirective, typeof IgxPrefixDirective, typeof IgxSuffixDirective, typeof IgxHintDirective]; /** * @hidden * IMPORTANT: The following is NgModule exported for backwards-compatibility before standalone components */ export declare class IgxTimePickerModule { static ɵfac: i0.ɵɵFactoryDeclaration; static ɵmod: i0.ɵɵNgModuleDeclaration; static ɵinj: i0.ɵɵInjectorDeclaration; } export {};