@redkhat/timepicker
Version:
This project contains a series of time selection components. The timepicker allows users to select a time from a clock-like interface. The timepicker is built using **Angular 19+** and **Angular Material 19+**.
52 lines (51 loc) • 2.59 kB
TypeScript
import { InputSignal, InputSignalWithTransform, ModelSignal, Signal } from '@angular/core';
import { AbstractControl, ControlValueAccessor, ValidationErrors, Validator } from '@angular/forms';
import { RkTimepicker } from './timepicker';
import * as i0 from "@angular/core";
export declare class RkTimepickerInput implements ControlValueAccessor, Validator {
private _elementRef;
private _renderer;
/** Necessary for ControlValueAccessor implementation */
private _onChange;
private _onTouched;
private _accessorDisabled;
private _validatorOnChange;
/** Current value of the input. */
readonly value: ModelSignal<Date | null>;
private _tempDateSafe;
/** Timepicker that the input is associated with. */
readonly timepicker: InputSignal<RkTimepicker>;
/** Whether the input is disabled. */
readonly disabled: Signal<boolean>;
/**
* Whether the input should be disabled through the template.
*/
readonly disabledInput: InputSignalWithTransform<boolean, unknown>;
constructor();
private _updateModelValue;
private _validateTimeOrNull;
private _updateInputValue;
/** Handles the `input` event. */
protected _handleInput(value: string): void;
/** Handles the `keydown` event. */
protected _handleKeydown(event: KeyboardEvent): void;
simulateEnter(): void;
/** Handles the `blur` event. */
protected _handleBlur(): void;
/** Focuses the input. */
focus(): void;
/** Implemented as a part of ControlValueAccessor. */
writeValue(value: any): void;
/** Implemented as a part of ControlValueAccessor. */
registerOnChange(fn: (value: any) => void): void;
/** Implemented as a part of ControlValueAccessor. */
registerOnTouched(fn: () => void): void;
/** Implemented as a part of ControlValueAccessor. */
setDisabledState(isDisabled: any): void;
validate(control: AbstractControl): ValidationErrors | null;
registerOnValidatorChange(fn: () => void): void;
/** Sets up the logic that registers the input with the timepicker. */
private _registerTimepicker;
static ɵfac: i0.ɵɵFactoryDeclaration<RkTimepickerInput, never>;
static ɵdir: i0.ɵɵDirectiveDeclaration<RkTimepickerInput, "input[rkTimepicker]", ["rkTimepickerInput"], { "value": { "alias": "value"; "required": false; "isSignal": true; }; "timepicker": { "alias": "rkTimepicker"; "required": true; "isSignal": true; }; "disabledInput": { "alias": "disabled"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; }, never, never, true, never>;
}