import { BooleanInput } from '@angular/cdk/coercion'; import * as i0 from '@angular/core'; import { DoCheck, ChangeDetectorRef, ElementRef } from '@angular/core'; import * as i2 from '@angular/forms'; import { ControlValueAccessor, NgControl, NgForm, FormGroupDirective } from '@angular/forms'; import { NxErrorComponent } from '@aposin/ng-aquila/base'; import { ErrorStateMatcher } from '@aposin/ng-aquila/utils'; import { Subject } from 'rxjs'; import * as i1 from '@angular/common'; declare class NxCodeInputIntl { /** * Stream that emits whenever the labels here are changed. Use this to notify * components if the labels have changed after initialization. */ readonly changes: Subject; /** Label that should replace the 'Enter key' of the aria-label. */ inputFieldAriaLabel: string; /** Label that should replace the 'of' of the aria-label. */ ofLabel?: string; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } type NxConversionTypes = 'lower' | 'upper'; declare class NxCodeInputComponent implements ControlValueAccessor, DoCheck { private readonly _cdr; private readonly _el; readonly _control: NgControl | null; readonly _intl: NxCodeInputIntl; private readonly _errorStateMatcher; private readonly _parentForm; private readonly _parentFormGroup; error: NxErrorComponent; /** Whether the current input of the component has an error. */ errorState: boolean; /** The length of the code input. Default: 6. */ set codeLength(value: number); get codeLength(): number; private _codeLength; /** The type of HTML input */ set type(value: string); get type(): string; private _type; /** Sets the tabindex of the contained input elements. */ set tabindex(value: number); get tabindex(): number; private _tabindex; /** Whether the form should auto capitalize or lowercase (optional). */ set convertTo(value: NxConversionTypes); get convertTo(): NxConversionTypes; private _convertTo?; /** The user input in array form */ _keyCode: string[]; private _focused; /** Whether the code input uses the negative set of styling. */ set negative(value: BooleanInput); get negative(): BooleanInput; private _negative; /** Whether the code input is disabled. */ set disabled(value: BooleanInput); get disabled(): BooleanInput; private _disabled; private _isUpDown; constructor(_cdr: ChangeDetectorRef, _el: ElementRef, _control: NgControl | null, _intl: NxCodeInputIntl, _errorStateMatcher: ErrorStateMatcher, _parentForm: NgForm | null, _parentFormGroup: FormGroupDirective | null); ngDoCheck(): void; /** Sets the length of the input fields. */ setInputLength(): void; /** Converts to upper or lowercase when enabled. */ _convertLetterSize(value: any): string; /** Reacts to keydown event. */ _keydownAction(event: KeyboardEvent): boolean; /** Selects the value on click of an input field. */ _selectText(event: Event): void; /** Automatically focuses and selects the next input on key input. */ _handleInput(event: Event): void; private _setKeyCodes; /** Focus the next input depending on the the currently focused index and the length of the value that gets added. */ private moveFocus; /** Returns the index of the code input, which is currently focused. */ private _getFocusedInputIndex; /** Removes all characters from the input except for numbers [0-9]. */ private _filterNumbers; /** Triggers when an input field is blurred. */ _onBlur(): void; /** Sets _focused state and makes valid. */ _setFocusState(): void; /** * Disables the code input. Part of the ControlValueAccessor interface required * to integrate with Angular's core forms API. * @param isDisabled Sets whether the component is disabled. */ setDisabledState(isDisabled: boolean): void; /** Sets initial value, used by ControlValueAccessor. */ writeValue(value: string): void; _trackByKeyCode(index: number, item: string): number; /** Adds a gap to input fields when appropriate. */ _inputGap(index: number): string; /** @docs-private */ propagateChange: (_: any) => void; /** @docs-private */ propagateTouch: (_: any) => void; registerOnChange(fn: any): void; registerOnTouched(fn: any): void; /** @docs-private */ updateErrorState(): void; getAriaLabel(keyIndex: number): string; /** * Workaround preventing the selection error because the `setSelectionRange` is not supported on input['type=number'] * @docs-private */ selectInput(input: HTMLInputElement): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare class NxCodeInputModule { static ɵfac: i0.ɵɵFactoryDeclaration; static ɵmod: i0.ɵɵNgModuleDeclaration; static ɵinj: i0.ɵɵInjectorDeclaration; } export { NxCodeInputComponent, NxCodeInputIntl, NxCodeInputModule }; export type { NxConversionTypes };