otp-angular
Version:
**Otp Angular** is a lightweight, highly customizable, and dependency-free OTP (One-Time Password) input component built for Angular 20+ applications. It offers seamless integration, flexible configuration, and a polished user experience for OTP or verifi
1 lines • 25.5 kB
Source Map (JSON)
{"version":3,"file":"otp-angular.mjs","sources":["../../../projects/otp-angular/src/lib/alpha-numeric.ts","../../../projects/otp-angular/src/lib/default.ts","../../../projects/otp-angular/src/lib/disabled.ts","../../../projects/otp-angular/src/lib/otp-angular.ts","../../../projects/otp-angular/src/lib/otp-angular.html","../../../projects/otp-angular/src/public-api.ts","../../../projects/otp-angular/src/otp-angular.ts"],"sourcesContent":["import { Directive, HostListener, inject } from '@angular/core';\nimport { NgControl } from '@angular/forms';\n\n@Directive({\n selector: '[AlphaNumeric]'\n})\nexport class AlphaNumeric {\n private control = inject(NgControl);\n\n @HostListener('input', ['$event'])\n onInputChange(event: Event): void {\n const input = event.target as HTMLInputElement;\n const cleanValue = input.value.replace(/[^a-zA-Z0-9]/g, '');\n if (input.value !== cleanValue) {\n input.value = cleanValue;\n this.control.control?.setValue(cleanValue); // Keep form state in sync\n }\n }\n\n}\n","import { OtpAngularType } from \"./type\";\n\nexport class DefaultOptions implements OtpAngularType {\n\n length: number = 4;\n numbersOnly: boolean = false;\n autoFocus: boolean = false;\n isPassword: boolean = false;\n showError: boolean = false;\n showCaps: boolean = false;\n containerClass: string | Array<string> = '';\n containerStyles: Object = {};\n inputClass: string | Array<string> = ''\n inputStyles: Object = {};\n placeholder: string = '';\n separator: string = '';\n resend: number = 0;\n resendLabel: string = 'RESEND VERIFICATION CODE';\n resendContainerClass: string = '';\n resendLabelClass: string = '';\n resendTimerClass: string = '';\n theme: \"light-theme\" | \"dark-theme\" = 'light-theme';\n\n constructor(data?: any) {\n if (!data) return;\n Object.keys(data).forEach((key: string) => {\n typeof (data[key] !== undefined) && typeof (data[key] !== null) && ((this as any)[key] = data[key]);\n })\n }\n}","import { Directive, DOCUMENT, ElementRef, inject, Input } from '@angular/core';\n\n@Directive({\n selector: '[otpDisabled]'\n})\nexport class Disabled {\n @Input('otpDisabled') otpDisabled: boolean = false;\n private el = inject(ElementRef);\n private document = inject(DOCUMENT);\n\n constructor() {\n this.document.addEventListener(\"mousemove\", (e) => {\n this.otpDisabledInit(this.otpDisabled);\n });\n }\n\n private otpDisabledInit(otpDisabled: boolean): void {\n if (this.el.nativeElement.nodeName !== 'INPUT') {\n if (otpDisabled) {\n this.el.nativeElement?.classList.add('disabled');\n this.el.nativeElement?.setAttribute('disabled', true);\n this.el.nativeElement.style.pointerEvents = 'none';\n this.el.nativeElement.setAttribute('disabled', true);\n } else {\n this.el.nativeElement?.classList.remove('disabled');\n this.el.nativeElement.style.pointerEvents = 'auto';\n this.el.nativeElement?.removeAttribute('disabled');\n this.el.nativeElement.removeAttribute('disabled');\n }\n } else {\n if (otpDisabled) {\n this.el.nativeElement.setAttribute('readonly', true);\n this.el.nativeElement.setAttribute('disabled', true);\n } else {\n this.el.nativeElement.removeAttribute('readonly');\n this.el.nativeElement.removeAttribute('disabled');\n }\n }\n }\n\n}\n","import { afterNextRender, Component, computed, DOCUMENT, effect, forwardRef, inject, input, linkedSignal, model, output, signal, untracked } from '@angular/core';\nimport { AlphaNumeric } from './alpha-numeric';\nimport { ControlValueAccessor, FormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { OtpAngularType } from './type';\nimport { DefaultOptions } from './default';\nimport { Disabled } from './disabled';\n\n@Component({\n selector: 'otp-angular',\n imports: [FormsModule, AlphaNumeric, Disabled],\n templateUrl: './otp-angular.html',\n styleUrl: './otp-angular.scss',\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => OtpAngular),\n multi: true\n }\n ]\n})\nexport class OtpAngular implements ControlValueAccessor {\n\n private readonly document = inject(DOCUMENT);\n\n\n //START: user can call this variables \n config = model.required<OtpAngularType>();\n disabled = signal<boolean>(false);\n onInputChange = output<string | number | null>();\n onResendAvailable = output<boolean>();\n //END: user can call this variables\n\n protected defaultConfig = computed(() => {\n return {\n ...new DefaultOptions(),\n ...this.config()\n }\n })\n\n protected myValue = signal<Array<number | string>>([]);\n protected inputStyleArray = computed(() => {\n const _config = this.config();\n if (Array.isArray(_config?.inputStyles)) {\n return _config?.inputStyles\n } else {\n return [{ ..._config?.inputStyles }]\n }\n })\n\n // Resend\n protected countdown = linkedSignal(() => {\n return Number(this.defaultConfig()?.resend)\n })\n protected isResendAllowed = signal<boolean>(false);\n private timer: any;\n\n\n // FORMS-CONTROL & REACTIVE FORMS\n private value: string = '';\n private onChange: any = () => { };\n private onTouched: any = () => { };\n\n\n constructor() {\n effect(() => {\n const _countdown = this.countdown();\n if (_countdown <= 0) {\n clearInterval(this.timer)\n this.isResendAllowed.set(true)\n }\n })\n\n effect(() => {\n const _isResendAllowed = this.isResendAllowed();\n if (!_isResendAllowed) {\n untracked(() => {\n this.timer = setInterval(() => {\n this.countdown.update(value => value - 1)\n }, 1000);\n })\n }\n })\n\n afterNextRender(() => {\n const _config = this.defaultConfig();\n if (_config.autoFocus) {\n const _firstID = this.document.getElementById('otp-input-1') as HTMLInputElement;\n _firstID.focus();\n }\n })\n }\n\n //START: user can call this functions \n setValue(value: string | number): void {\n this.myValue.set(value.toString().split(''));\n const _config = this.defaultConfig();\n\n const _output = _config.numbersOnly ? Number(value) : value.toString().trim();\n if (_output.toString().trim() === '') {\n this.updateValue(null)\n } else {\n this.updateValue(_output)\n }\n }\n\n reset(): void {\n const _config = this.defaultConfig();\n if (_config && _config.resend) {\n this.countdown.set(_config.resend);\n this.isResendAllowed.set(false)\n }\n }\n //END: user can call this functions\n\n\n protected keydown(e: KeyboardEvent, index: number): void {\n const _config = this.defaultConfig();\n const prev = this.document.getElementById(`otp-input-${index}`) as HTMLInputElement;\n const current = this.document.getElementById(`otp-input-${index + 1}`) as HTMLInputElement;\n const next = this.document.getElementById(`otp-input-${index + 2}`) as HTMLInputElement;\n\n\n if (e.key === 'Backspace') {\n if (current.value.trim() === '') {\n index !== 0 && prev.focus(), setTimeout(() => prev.select(), 0);\n } else {\n current.value = '';\n }\n return\n }\n if (e.key === 'ArrowLeft' && index !== 0) {\n prev.focus();\n setTimeout(() => prev.select(), 0);\n return\n }\n if (e.key === 'ArrowRight' && index !== _config.length - 1) {\n next.focus();\n setTimeout(() => next.select(), 0);\n return\n }\n\n const input = e.target as HTMLInputElement;\n\n if (e.key.length === 1) {\n const isAlphanumeric = /^[a-zA-Z0-9]*$/.test(e.key);\n isAlphanumeric && (input.value = '');\n }\n }\n\n protected onPaste(e: ClipboardEvent, index: number): void {\n e.preventDefault();\n const _config = this.defaultConfig();\n const pasted = this.sanitize(\n (e.clipboardData ?? (window as any).clipboardData).getData('text'),\n _config.numbersOnly ? 'numeric' : 'text'\n );\n\n if (!pasted) { return; }\n\n if (pasted.length >= _config.length) {\n Array.from(pasted.slice(0, _config.length)).forEach((ch, i) => {\n const char = _config.showCaps ? ch.toUpperCase() : ch;\n this.setBoxValue(i, char);\n });\n\n const last = this.document.getElementById(\n `otp-input-${Math.min(pasted.length, _config.length)}`\n ) as HTMLInputElement;\n last?.focus();\n } else {\n Array.from(pasted.slice(0, _config.length)).forEach((ch, i) => {\n const char = _config.showCaps ? ch.toUpperCase() : ch;\n this.setBoxValue(index + i, char);\n });\n\n const last = this.document.getElementById(\n `otp-input-${Math.min(pasted.length + index, _config.length)}`\n ) as HTMLInputElement;\n last?.focus();\n } \n\n this.emit();\n\n }\n\n private setBoxValue(i: number, ch: string): void {\n const el = this.document.getElementById(`otp-input-${i + 1}`) as HTMLInputElement;\n if (el) { el.value = ch; }\n }\n\n private sanitize(raw: string, type: 'numeric' | 'text'): string {\n switch (type) {\n case 'numeric': return raw.replace(/[^0-9]/g, '');\n case 'text': return raw.replace(/[^A-Za-z0-9]/g, '');\n }\n }\n\n protected onInput(e: Event, index: number): void {\n const _config = this.defaultConfig();\n const input = e.target as HTMLInputElement;\n\n // keep only allowed chars, 1 char max\n input.value = this.sanitize(input.value, _config.numbersOnly ? 'numeric' : 'text').slice(0, 1);\n if (_config.showCaps) { input.value = input.value.toUpperCase(); }\n\n if (!input.value) { return; }\n\n // move focus\n const next = this.document.getElementById(`otp-input-${index + 2}`) as HTMLInputElement;\n if (next) { next.focus(); } else { input.blur(); }\n\n this.emit();\n }\n\n protected blur(e: FocusEvent, index: number): void {\n const _config = this.defaultConfig();\n if (_config.showError) {\n const input = e.target as HTMLInputElement;\n if (input.value.trim() === '') {\n input.classList.add('error')\n } else {\n input.classList.remove('error')\n }\n }\n }\n\n private emit(): void {\n const _config = this.defaultConfig();\n let output: string = '';\n\n for (let index = 0; index < _config.length; index++) {\n const input = this.document.getElementById(`otp-input-${index + 1}`) as HTMLInputElement;\n output += input.value;\n }\n\n const _output = _config.numbersOnly ? Number(output) : output.trim();\n if (_output.toString().trim() === '') {\n this.updateValue(null)\n } else {\n this.updateValue(_output)\n }\n }\n\n\n // Resend\n protected resend(): void {\n this.onResendAvailable.emit(true);\n }\n\n\n // FORMS-CONTROL & REACTIVE FORMS\n writeValue(obj: any): void {\n this.value = obj;\n }\n\n registerOnChange(fn: any): void {\n this.onChange = fn;\n }\n\n registerOnTouched(fn: any): void {\n this.onTouched = fn;\n }\n\n // Call this method whenever the input changes\n private updateValue(newValue: any) {\n this.value = newValue;\n this.onChange(this.value);\n this.onInputChange.emit(this.value);\n }\n\n\n}\n","@let _config = defaultConfig();\n@let _theme = _config.theme;\n@let _myValue = myValue();\n@let _disabled = disabled();\n\n@if(_config) {\n@let _containerClass = _config.containerClass;\n@let containerClass = typeof _containerClass === 'string' ? _containerClass.split(' ')[0] : _containerClass.join(' ');\n@let _inputClass = _config.inputClass;\n@let inputClass = typeof _inputClass === 'string' ? _inputClass.split(' ')[0] : _inputClass;\n@let _containerStyles = _config.containerStyles;\n\n@let _inputStyles = inputStyleArray();\n\n@let _resend = _config.resend;\n@let _resendLabel = _config.resendLabel;\n@let _resendContainerClass = _config.resendContainerClass;\n@let _resendLabelClass = _config.resendLabelClass;\n@let _resendTimerClass = _config.resendTimerClass; \n\n<div class=\"__otpContainer {{_theme}} {{containerClass}}\" [style]=\"_containerStyles\">\n @for (item of [].constructor(_config.length); track $index) {\n <div class=\"otp-input-wrapper\">\n <input [id]=\"`otp-input-${$index+1}`\" [max]=\"1\" AlphaNumeric autocomplete=\"off\" name=\"dummy\"\n [placeholder]=\"_config.placeholder\"\n [otpDisabled]=\"_disabled\" [class]=\"inputClass[$index]\" [style]=\"_inputStyles[$index]\"\n [attr.inputmode]=\"_config.numbersOnly ? 'numeric' : null\" [attr.pattern]=\"_config.numbersOnly ? '[0-9]*' : null\"\n [type]=\"_config.isPassword ? `password` : `text`\"\n (keydown)=\"keydown($event, $index)\" (blur)=\"blur($event, $index)\" (input)=\"onInput($event, $index)\"\n (paste)=\"onPaste($event, $index)\"\n [(ngModel)]=\"_myValue[$index]\" />\n @if (_config.separator && $index < _config.length - 1) {\n <span class=\"otp-separator\">{{_config.separator.toString().split('')[0]}}</span>\n }\n </div>\n }\n @if(_resend && _resend > 0) {\n <div class=\"otp-resend {{_resendContainerClass}}\">\n @if (isResendAllowed()) {\n <div aria-label=\"resend\" type=\"button\" class=\"resendTxt {{_resendLabelClass}}\" (click)=\"resend()\">{{_resendLabel}}</div>\n } @else {\n <div class=\"resendTxt {{_resendTimerClass}}\" >{{_resendLabel}} IN {{countdown()}}s</div>\n }\n </div>\n }\n</div>\n}","/*\n * Public API Surface of otp-angular\n */\n\nexport * from './lib/otp-angular';\nexport type { OtpAngularType } from './lib/type'\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;MAMa,YAAY,CAAA;AACf,IAAA,OAAO,GAAG,MAAM,CAAC,SAAS,CAAC;AAGnC,IAAA,aAAa,CAAC,KAAY,EAAA;AACxB,QAAA,MAAM,KAAK,GAAG,KAAK,CAAC,MAA0B;AAC9C,QAAA,MAAM,UAAU,GAAG,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,eAAe,EAAE,EAAE,CAAC;AAC3D,Q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