export interface MdsInputOtpInterface { length?: number; autosubmit?: boolean; value?: string; disabled?: boolean; } /** * @category forms */ export declare class MdsInputOtp { private element; internals: ElementInternals; private loadValue; digits: string[]; private formDisabled; private t; /** * The accessible name of the code: each digit is announced as a position inside it, the * fields being separate controls a screen reader reaches one at a time. */ readonly accessibleName?: string; /** * Number of digits in the OTP code */ readonly length: number; /** * Automatically submits the form when the OTP code is complete */ readonly autosubmit: boolean; /** * Disables every cell of the code, like a disabled native input: the code cannot be changed and * is left out of the form. A disabled `
` around the component does the same. */ readonly disabled?: boolean; /** * The current value of the OTP code: a value set in the markup or by code fills the cells from * the first one */ value?: string; protected valueChanged(newValue?: string): void; formDisabledCallback(disabled: boolean): void; private isDisabled; /** Like a native input, a form reset brings back the code of load. */ formResetCallback(): void; componentWillLoad(): void; /** Puts a code in the cells, from the first one, as many digits as there are cells. */ private fillCells; /** Joins the cells into value, the code the form submits. */ private updateValue; private cellIndex; private setOtpDigit; private submit; /** * A cell holds one digit and the keyboard moves between them: a digit fills the cell and goes * to the next one, Backspace empties the cell (or the previous one, from an empty cell), * Delete empties it, the arrows move. Every other key that writes a character is ignored; * Tab, the shortcuts (paste among them, with Ctrl or Cmd) and the keys that write nothing * keep what the browser does with them, so the field is never a keyboard trap. */ private handleKeyDown; private handlePaste; private digitName; render(): any; }