primeng
Version:
PrimeNG is a premium UI library for Angular featuring a rich set of 90+ components, a theme designer, various theme alternatives such as Material, Bootstrap, Tailwind, premium templates and professional support. In addition, it integrates with PrimeBlock,
177 lines (172 loc) • 7.16 kB
TypeScript
import * as _angular_core from '@angular/core';
import { Provider, AfterViewChecked, TemplateRef } from '@angular/core';
import { BaseEditableHolder } from 'primeng/baseeditableholder';
import * as i1 from 'primeng/bind';
import { Bind } from 'primeng/bind';
import { InputOtpPassThrough, InputOtpChangeEvent, InputOtpInputTemplateContext } from 'primeng/types/inputotp';
export { InputOtpChangeEvent, InputOtpInputTemplateContext, InputOtpTemplateEvents } from 'primeng/types/inputotp';
import { InputVariant, InputSize } from 'primeng/types/shared';
import { BaseStyle } from 'primeng/base';
import * as i2 from 'primeng/api';
/**
*
* InputOtp is used to enter one time passwords.
*
* [Live Demo](https://www.primeng.org/inputotp/)
*
* @module inputotpstyle
*
*/
declare enum InputOtpClasses {
/**
* Class name of the root element
*/
root = "p-inputotp",
/**
* Class name of the input element
*/
pcInputText = "p-inputotp-input"
}
declare class InputOtpStyle extends BaseStyle {
name: string;
style: string;
classes: {
root: string;
pcInputText: string;
};
static ɵfac: _angular_core.ɵɵFactoryDeclaration<InputOtpStyle, never>;
static ɵprov: _angular_core.ɵɵInjectableDeclaration<InputOtpStyle>;
}
interface InputOtpStyle extends BaseStyle {
}
declare const INPUT_OTP_VALUE_ACCESSOR: Provider;
/**
* Input Otp is used to enter one time passwords.
* @group Components
*/
declare class InputOtp extends BaseEditableHolder<InputOtpPassThrough> implements AfterViewChecked {
componentName: string;
_componentStyle: InputOtpStyle;
$pcInputOtp: InputOtp | undefined;
bindDirectiveInstance: Bind;
onAfterViewChecked(): void;
/**
* When present, it specifies that an input field is read-only.
* @group Props
*/
readonly: _angular_core.InputSignalWithTransform<boolean, unknown>;
/**
* Index of the element in tabbing order.
* @group Props
*/
tabindex: _angular_core.InputSignal<number | null>;
/**
* Number of characters to initiate.
* @group Props
*/
length: _angular_core.InputSignal<number>;
/**
* Style class of the input element.
* @group Props
*/
styleClass: _angular_core.InputSignal<string | undefined>;
/**
* Mask pattern.
* @group Props
*/
mask: _angular_core.InputSignalWithTransform<boolean, unknown>;
/**
* When present, it specifies that an input field is integer-only.
* @group Props
*/
integerOnly: _angular_core.InputSignalWithTransform<boolean, unknown>;
/**
* When present, it specifies that the component should automatically get focus on load.
* @group Props
*/
autofocus: _angular_core.InputSignalWithTransform<boolean, unknown>;
/**
* Specifies the input variant of the component.
* @defaultValue undefined
* @group Props
*/
variant: _angular_core.InputSignal<InputVariant | undefined>;
/**
* Specifies the size of the component.
* @defaultValue undefined
* @group Props
*/
size: _angular_core.InputSignal<InputSize | undefined>;
/**
* Callback to invoke on value change.
* @group Emits
*/
onChange: _angular_core.OutputEmitterRef<InputOtpChangeEvent>;
/**
* Callback to invoke when the component receives focus.
* @param {Event} event - Browser event.
* @group Emits
*/
onFocus: _angular_core.OutputEmitterRef<Event>;
/**
* Callback to invoke when the component loses focus.
* @param {Event} event - Browser event.
* @group Emits
*/
onBlur: _angular_core.OutputEmitterRef<Event>;
/**
* Custom input template.
* @param {InputOtpInputTemplateContext} context - Context of the template
* @see {@link InputOtpInputTemplateContext}
* @group Templates
*/
inputTemplate: _angular_core.Signal<TemplateRef<InputOtpInputTemplateContext> | undefined>;
tokens: string[];
value: _angular_core.WritableSignal<any>;
$variant: _angular_core.Signal<InputVariant | null>;
inputMode: _angular_core.Signal<"numeric" | "text">;
inputType: _angular_core.Signal<"text" | "password">;
attrRequired: _angular_core.Signal<"" | undefined>;
attrReadonly: _angular_core.Signal<"" | undefined>;
attrDisabled: _angular_core.Signal<"" | undefined>;
getToken(index: number): string;
getTemplateContext(i: number): InputOtpInputTemplateContext;
getTemplateEvents(index: number): {
input: (event: Event) => void;
keydown: (event: KeyboardEvent) => void;
focus: (event: FocusEvent) => void;
blur: (event: FocusEvent) => void;
paste: (event: ClipboardEvent) => void;
};
onInput(event: Event, index: number): void;
updateModel(event: Event): void;
updateTokens(): void;
getModelValue(i: number): string;
getAutofocus(i: number): boolean;
moveToPrev(event: Event): void;
moveToNext(event: Event): void;
findNextInput(element: HTMLElement): HTMLInputElement | undefined;
findPrevInput(element: HTMLElement): HTMLInputElement | undefined;
onInputFocus(event: FocusEvent): void;
onInputBlur(event: FocusEvent): void;
onKeyDown(event: KeyboardEvent): void;
onPaste(event: ClipboardEvent): void;
handleOnPaste(paste: string, event: Event): void;
getRange(n: number): number[];
trackByFn(index: number): number;
/**
* @override
*
* @see {@link BaseEditableHolder.writeControlValue}
* Writes the value to the control.
*/
writeControlValue(newValue: any, setModelValue: (value: any) => void): void;
static ɵfac: _angular_core.ɵɵFactoryDeclaration<InputOtp, never>;
static ɵcmp: _angular_core.ɵɵComponentDeclaration<InputOtp, "p-inputotp, p-input-otp", never, { "readonly": { "alias": "readonly"; "required": false; "isSignal": true; }; "tabindex": { "alias": "tabindex"; "required": false; "isSignal": true; }; "length": { "alias": "length"; "required": false; "isSignal": true; }; "styleClass": { "alias": "styleClass"; "required": false; "isSignal": true; }; "mask": { "alias": "mask"; "required": false; "isSignal": true; }; "integerOnly": { "alias": "integerOnly"; "required": false; "isSignal": true; }; "autofocus": { "alias": "autofocus"; "required": false; "isSignal": true; }; "variant": { "alias": "variant"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; }, { "onChange": "onChange"; "onFocus": "onFocus"; "onBlur": "onBlur"; }, ["inputTemplate"], never, true, [{ directive: typeof i1.Bind; inputs: {}; outputs: {}; }]>;
}
declare class InputOtpModule {
static ɵfac: _angular_core.ɵɵFactoryDeclaration<InputOtpModule, never>;
static ɵmod: _angular_core.ɵɵNgModuleDeclaration<InputOtpModule, never, [typeof InputOtp, typeof i2.SharedModule], [typeof InputOtp, typeof i2.SharedModule]>;
static ɵinj: _angular_core.ɵɵInjectorDeclaration<InputOtpModule>;
}
export { INPUT_OTP_VALUE_ACCESSOR, InputOtp, InputOtpClasses, InputOtpModule, InputOtpStyle };