ng-otp-box 0.0.2 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/ng-package.json +7 -0
- package/package.json +43 -21
- package/src/lib/ng-otp-box.component.spec.ts +23 -0
- package/src/lib/ng-otp-box.component.ts +15 -0
- package/src/lib/ng-otp-box.module.ts +19 -0
- package/src/lib/ng-otp-box.service.spec.ts +16 -0
- package/src/lib/ng-otp-box.service.ts +9 -0
- package/src/lib/otp-box/otp-box.component.css +26 -0
- package/src/lib/otp-box/otp-box.component.html +21 -0
- package/src/lib/otp-box/otp-box.component.spec.ts +23 -0
- package/src/lib/otp-box/otp-box.component.ts +172 -0
- package/{public-api.d.ts → src/public-api.ts} +8 -4
- package/tsconfig.lib.json +11 -0
- package/tsconfig.lib.prod.json +10 -0
- package/tsconfig.spec.json +14 -0
- package/esm2020/lib/ng-otp-box.component.mjs +0 -19
- package/esm2020/lib/ng-otp-box.module.mjs +0 -31
- package/esm2020/lib/ng-otp-box.service.mjs +0 -14
- package/esm2020/lib/otp-box/otp-box.component.mjs +0 -148
- package/esm2020/ng-otp-box.mjs +0 -5
- package/esm2020/public-api.mjs +0 -8
- package/fesm2015/ng-otp-box.mjs +0 -215
- package/fesm2015/ng-otp-box.mjs.map +0 -1
- package/fesm2020/ng-otp-box.mjs +0 -214
- package/fesm2020/ng-otp-box.mjs.map +0 -1
- package/index.d.ts +0 -5
- package/lib/ng-otp-box.component.d.ts +0 -5
- package/lib/ng-otp-box.module.d.ts +0 -10
- package/lib/ng-otp-box.service.d.ts +0 -6
- package/lib/otp-box/otp-box.component.d.ts +0 -33
package/README.md
CHANGED
|
@@ -70,5 +70,5 @@ Name | Type | Required | Default | Description
|
|
|
70
70
|
|
|
71
71
|
## Contributing
|
|
72
72
|
|
|
73
|
-
Show your support by starring the repo!
|
|
73
|
+
Show your support by starring the repo! Feel free to open [issues](https://github.com/Toheed123/ng-otp-box/issues/new) or contribute via [pull requests](https://github.com/Toheed123/ng-otp-box/compare).
|
|
74
74
|
|
package/ng-package.json
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,47 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ng-otp-box",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.4",
|
|
4
|
+
"description": "Reusable OTP input component for Angular with support for numeric, text, mixed, and masked OTP types.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"angular",
|
|
7
|
+
"angular-otp",
|
|
8
|
+
"otp",
|
|
9
|
+
"otp-input",
|
|
10
|
+
"angular-otp-input",
|
|
11
|
+
"ng-otp",
|
|
12
|
+
"ngx-otp",
|
|
13
|
+
"ng-otp-input",
|
|
14
|
+
"ngx-otp-input",
|
|
15
|
+
"one-time-password",
|
|
16
|
+
"password-input",
|
|
17
|
+
"two-factor-auth",
|
|
18
|
+
"2fa",
|
|
19
|
+
"angular-component",
|
|
20
|
+
"input-component",
|
|
21
|
+
"angular-forms",
|
|
22
|
+
"reactive-forms",
|
|
23
|
+
"angular-otp-field",
|
|
24
|
+
"custom-input",
|
|
25
|
+
"ng-input",
|
|
26
|
+
"otp-field",
|
|
27
|
+
"auth",
|
|
28
|
+
"angular-ui",
|
|
29
|
+
"frontend",
|
|
30
|
+
"otp-verification",
|
|
31
|
+
"otp-angular",
|
|
32
|
+
"otp input angular",
|
|
33
|
+
"angular otp password box",
|
|
34
|
+
"angular otp verification",
|
|
35
|
+
"otp box",
|
|
36
|
+
"masked-input",
|
|
37
|
+
"auto-focus",
|
|
38
|
+
"paste-support",
|
|
39
|
+
"material-design",
|
|
40
|
+
"angular-library",
|
|
41
|
+
"reusable-component",
|
|
42
|
+
"form-validation",
|
|
43
|
+
"form-control"
|
|
44
|
+
],
|
|
4
45
|
"peerDependencies": {
|
|
5
46
|
"@angular/common": "^15.1.0",
|
|
6
47
|
"@angular/core": "^15.1.0",
|
|
@@ -10,24 +51,5 @@
|
|
|
10
51
|
"dependencies": {
|
|
11
52
|
"tslib": "^2.3.0"
|
|
12
53
|
},
|
|
13
|
-
"sideEffects": false
|
|
14
|
-
"module": "fesm2015/ng-otp-box.mjs",
|
|
15
|
-
"es2020": "fesm2020/ng-otp-box.mjs",
|
|
16
|
-
"esm2020": "esm2020/ng-otp-box.mjs",
|
|
17
|
-
"fesm2020": "fesm2020/ng-otp-box.mjs",
|
|
18
|
-
"fesm2015": "fesm2015/ng-otp-box.mjs",
|
|
19
|
-
"typings": "index.d.ts",
|
|
20
|
-
"exports": {
|
|
21
|
-
"./package.json": {
|
|
22
|
-
"default": "./package.json"
|
|
23
|
-
},
|
|
24
|
-
".": {
|
|
25
|
-
"types": "./index.d.ts",
|
|
26
|
-
"esm2020": "./esm2020/ng-otp-box.mjs",
|
|
27
|
-
"es2020": "./fesm2020/ng-otp-box.mjs",
|
|
28
|
-
"es2015": "./fesm2015/ng-otp-box.mjs",
|
|
29
|
-
"node": "./fesm2015/ng-otp-box.mjs",
|
|
30
|
-
"default": "./fesm2020/ng-otp-box.mjs"
|
|
31
|
-
}
|
|
32
|
-
}
|
|
54
|
+
"sideEffects": false
|
|
33
55
|
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
+
|
|
3
|
+
import { NgOtpBoxComponent } from './ng-otp-box.component';
|
|
4
|
+
|
|
5
|
+
describe('NgOtpBoxComponent', () => {
|
|
6
|
+
let component: NgOtpBoxComponent;
|
|
7
|
+
let fixture: ComponentFixture<NgOtpBoxComponent>;
|
|
8
|
+
|
|
9
|
+
beforeEach(async () => {
|
|
10
|
+
await TestBed.configureTestingModule({
|
|
11
|
+
declarations: [ NgOtpBoxComponent ]
|
|
12
|
+
})
|
|
13
|
+
.compileComponents();
|
|
14
|
+
|
|
15
|
+
fixture = TestBed.createComponent(NgOtpBoxComponent);
|
|
16
|
+
component = fixture.componentInstance;
|
|
17
|
+
fixture.detectChanges();
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
it('should create', () => {
|
|
21
|
+
expect(component).toBeTruthy();
|
|
22
|
+
});
|
|
23
|
+
});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { NgModule } from '@angular/core';
|
|
2
|
+
import { CommonModule } from '@angular/common';
|
|
3
|
+
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
4
|
+
|
|
5
|
+
import { MatInputModule } from '@angular/material/input';
|
|
6
|
+
|
|
7
|
+
import { OtpBoxComponent } from './otp-box/otp-box.component';
|
|
8
|
+
|
|
9
|
+
@NgModule({
|
|
10
|
+
declarations: [OtpBoxComponent],
|
|
11
|
+
imports: [
|
|
12
|
+
CommonModule,
|
|
13
|
+
ReactiveFormsModule,
|
|
14
|
+
FormsModule,
|
|
15
|
+
MatInputModule,
|
|
16
|
+
],
|
|
17
|
+
exports: [OtpBoxComponent],
|
|
18
|
+
})
|
|
19
|
+
export class NgOtpBoxModule {}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { TestBed } from '@angular/core/testing';
|
|
2
|
+
|
|
3
|
+
import { NgOtpBoxService } from './ng-otp-box.service';
|
|
4
|
+
|
|
5
|
+
describe('NgOtpBoxService', () => {
|
|
6
|
+
let service: NgOtpBoxService;
|
|
7
|
+
|
|
8
|
+
beforeEach(() => {
|
|
9
|
+
TestBed.configureTestingModule({});
|
|
10
|
+
service = TestBed.inject(NgOtpBoxService);
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
it('should be created', () => {
|
|
14
|
+
expect(service).toBeTruthy();
|
|
15
|
+
});
|
|
16
|
+
});
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
.otp-container {
|
|
2
|
+
display: flex;
|
|
3
|
+
gap: 10px;
|
|
4
|
+
align-items: center;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.otp-mat-field {
|
|
8
|
+
width: 46px;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.otp-mat-field input {
|
|
12
|
+
text-align: center;
|
|
13
|
+
font-size: 18px;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.otp-mat-field.mat-form-field-appearance-fill
|
|
17
|
+
.mat-form-field-flex {
|
|
18
|
+
background-color: #f2f2f2;
|
|
19
|
+
border-radius: 6px;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/* Keep red error state visible */
|
|
23
|
+
.otp-mat-field.mat-form-field-invalid
|
|
24
|
+
.mat-form-field-flex {
|
|
25
|
+
background-color: #fdecea;
|
|
26
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<div>
|
|
2
|
+
<form [formGroup]="otpForm" (paste)="onPaste($event)">
|
|
3
|
+
|
|
4
|
+
<div class="otp-container" formArrayName="otp">
|
|
5
|
+
<ng-container *ngFor="let ctrl of otpArray.controls; let i = index">
|
|
6
|
+
<mat-form-field appearance="outline" class="otp-mat-field" [class.mat-form-field-invalid]="
|
|
7
|
+
otpForm.invalid && (otpForm.touched || otpForm.dirty)">
|
|
8
|
+
<input matInput [type]="inputType === 'masked' ? 'password' : 'text'" maxlength="1"
|
|
9
|
+
#otpInput cdkFocusInitial [formControlName]="i" (input)="onInput($event, i)"
|
|
10
|
+
(keydown)="onKeyDown($event, i)" />
|
|
11
|
+
</mat-form-field>
|
|
12
|
+
</ng-container>
|
|
13
|
+
</div>
|
|
14
|
+
<!-- <div class="otp-password-toggle" *ngIf="inputType === 'password' && showUnMaskCheckBoxYN">
|
|
15
|
+
<mat-checkbox [checked]="unmaskPassword" (change)="togglePasswordVisibility()">
|
|
16
|
+
Show password
|
|
17
|
+
</mat-checkbox>
|
|
18
|
+
</div> -->
|
|
19
|
+
|
|
20
|
+
</form>
|
|
21
|
+
</div>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
+
|
|
3
|
+
import { OtpBoxComponent } from './otp-box.component';
|
|
4
|
+
|
|
5
|
+
describe('OtpBoxComponent', () => {
|
|
6
|
+
let component: OtpBoxComponent;
|
|
7
|
+
let fixture: ComponentFixture<OtpBoxComponent>;
|
|
8
|
+
|
|
9
|
+
beforeEach(async () => {
|
|
10
|
+
await TestBed.configureTestingModule({
|
|
11
|
+
declarations: [ OtpBoxComponent ]
|
|
12
|
+
})
|
|
13
|
+
.compileComponents();
|
|
14
|
+
|
|
15
|
+
fixture = TestBed.createComponent(OtpBoxComponent);
|
|
16
|
+
component = fixture.componentInstance;
|
|
17
|
+
fixture.detectChanges();
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
it('should create', () => {
|
|
21
|
+
expect(component).toBeTruthy();
|
|
22
|
+
});
|
|
23
|
+
});
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import { Input, OnInit, Output, ViewChildren } from '@angular/core';
|
|
2
|
+
import { Component, ElementRef, EventEmitter, QueryList } from '@angular/core';
|
|
3
|
+
import { FormGroup, FormBuilder, FormArray, Validators } from '@angular/forms';
|
|
4
|
+
|
|
5
|
+
export interface otpModel {
|
|
6
|
+
isValid: boolean;
|
|
7
|
+
value: number;
|
|
8
|
+
message? : string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
@Component({
|
|
12
|
+
selector: 'lib-otp-box',
|
|
13
|
+
templateUrl: './otp-box.component.html',
|
|
14
|
+
styleUrls: ['./otp-box.component.css']
|
|
15
|
+
})
|
|
16
|
+
export class OtpBoxComponent implements OnInit {
|
|
17
|
+
@Output() otpChange = new EventEmitter<any>();
|
|
18
|
+
@Input() otpLength = 6;
|
|
19
|
+
@Input() inputType: 'text' | 'number' | 'mixed' | 'masked' = 'number';
|
|
20
|
+
// @Input() allowUppercase: boolean = true;
|
|
21
|
+
// @Input() showUnMaskCheckBoxYN : boolean = false;
|
|
22
|
+
unmaskPassword: boolean = false;
|
|
23
|
+
|
|
24
|
+
otpForm!: FormGroup;
|
|
25
|
+
|
|
26
|
+
@ViewChildren('otpInput') inputs!: QueryList<ElementRef>;
|
|
27
|
+
|
|
28
|
+
constructor(private fb: FormBuilder) {}
|
|
29
|
+
|
|
30
|
+
ngOnInit(): void {
|
|
31
|
+
this.otpForm = this.fb.group({
|
|
32
|
+
otp: this.fb.array([]),
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
ngAfterViewInit(): void {
|
|
37
|
+
this.buildOtpControls();
|
|
38
|
+
|
|
39
|
+
// this.otpForm.valueChanges.subscribe((val) => {
|
|
40
|
+
// this.emitOtp();
|
|
41
|
+
// });
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
get otpArray(): FormArray {
|
|
45
|
+
return this.otpForm.get('otp') as FormArray;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
private getInputPattern(): RegExp {
|
|
49
|
+
const alpha = 'a-zA-Z';
|
|
50
|
+
const alphanumeric = 'a-zA-Z0-9';
|
|
51
|
+
switch (this.inputType) {
|
|
52
|
+
case 'text':
|
|
53
|
+
return new RegExp(`^[${alpha}]$`);
|
|
54
|
+
|
|
55
|
+
case 'number':
|
|
56
|
+
return /^[0-9+]$/;
|
|
57
|
+
|
|
58
|
+
case 'mixed':
|
|
59
|
+
return /^[a-zA-Z0-9]$/;
|
|
60
|
+
|
|
61
|
+
case 'masked':
|
|
62
|
+
return new RegExp(`^[${alphanumeric}]$`);
|
|
63
|
+
|
|
64
|
+
default:
|
|
65
|
+
return /^[0-9]$/;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
private buildOtpControls(): void {
|
|
70
|
+
this.otpArray.clear();
|
|
71
|
+
const pattern = this.getInputPattern();
|
|
72
|
+
|
|
73
|
+
for (let i = 0; i < this.otpLength; i++) {
|
|
74
|
+
this.otpArray.push(
|
|
75
|
+
this.fb.control('', [Validators.required, Validators.pattern(pattern)])
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
togglePasswordVisibility(): void {
|
|
81
|
+
this.unmaskPassword = !this.unmaskPassword;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
focusFirstInput() {
|
|
85
|
+
if (this.inputs && this.inputs.length > 0) {
|
|
86
|
+
this.inputs.first.nativeElement.focus();
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
onInput(event: Event, index: number): void {
|
|
91
|
+
const input = event.target as HTMLInputElement;
|
|
92
|
+
const { value, message } = this.sanitizeWithMessage(input.value);
|
|
93
|
+
this.emitChange(message);
|
|
94
|
+
this.otpArray.at(index).setValue(value, { emitEvent: false });
|
|
95
|
+
|
|
96
|
+
if (value && index < this.otpLength - 1) {
|
|
97
|
+
this.inputs.toArray()[index + 1].nativeElement.focus();
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
private sanitizeWithMessage(rawValue: string): { value: string; message?: string } {
|
|
102
|
+
switch (this.inputType) {
|
|
103
|
+
case 'number':
|
|
104
|
+
if (/[^0-9]/.test(rawValue)) {
|
|
105
|
+
return {
|
|
106
|
+
value: rawValue.replace(/\D/g, ''),
|
|
107
|
+
message: 'Only numbers are allowed'
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
return { value: rawValue };
|
|
111
|
+
|
|
112
|
+
case 'text':
|
|
113
|
+
if (/[^a-zA-Z]/.test(rawValue)) {
|
|
114
|
+
return {
|
|
115
|
+
value: rawValue.replace(/[^a-zA-Z]/g, ''),
|
|
116
|
+
message: 'Only letters are allowed'
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
return { value: rawValue, message: 'success' };
|
|
120
|
+
|
|
121
|
+
case 'mixed':
|
|
122
|
+
case 'masked':
|
|
123
|
+
if (/[^a-zA-Z0-9]/.test(rawValue)) {
|
|
124
|
+
return {
|
|
125
|
+
value: rawValue.replace(/[^a-zA-Z0-9]/g, ''),
|
|
126
|
+
message: 'Only letters and numbers are allowed'
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
return { value: rawValue, message: 'success' };
|
|
130
|
+
|
|
131
|
+
default:
|
|
132
|
+
return { value: rawValue, message: 'success' };
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
onKeyDown(event: KeyboardEvent, index: number): void {
|
|
137
|
+
if (
|
|
138
|
+
event.key === 'Backspace' &&
|
|
139
|
+
!this.otpArray.at(index).value &&
|
|
140
|
+
index > 0
|
|
141
|
+
) {
|
|
142
|
+
this.inputs.toArray()[index - 1].nativeElement.focus();
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
onPaste(event: ClipboardEvent): void {
|
|
147
|
+
event.preventDefault();
|
|
148
|
+
|
|
149
|
+
const pasteData = event.clipboardData?.getData('text') ?? '';
|
|
150
|
+
const { value, message } = this.sanitizeWithMessage(pasteData);
|
|
151
|
+
|
|
152
|
+
if (value.length !== this.otpLength) {
|
|
153
|
+
this.emitChange('Invalid OTP length');
|
|
154
|
+
return;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
value.split('').forEach((char, i) => {
|
|
158
|
+
this.otpArray.at(i).setValue(char, { emitEvent: false });
|
|
159
|
+
});
|
|
160
|
+
|
|
161
|
+
this.emitChange(message);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
private emitChange(message: any): void {
|
|
165
|
+
const otp = this.otpArray.value.join('');
|
|
166
|
+
this.otpChange.emit({
|
|
167
|
+
value: otp,
|
|
168
|
+
isValid: this.otpForm.valid,
|
|
169
|
+
message: message
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
}
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
/*
|
|
2
|
+
* Public API Surface of ng-otp-box
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
export * from './lib/ng-otp-box.service';
|
|
6
|
+
export * from './lib/ng-otp-box.component';
|
|
7
|
+
export * from './lib/ng-otp-box.module';
|
|
8
|
+
export * from './lib/otp-box/otp-box.component';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/* To learn more about this file see: https://angular.io/config/tsconfig. */
|
|
2
|
+
{
|
|
3
|
+
"extends": "../../tsconfig.json",
|
|
4
|
+
"compilerOptions": {
|
|
5
|
+
"outDir": "../../out-tsc/lib",
|
|
6
|
+
"declaration": true,
|
|
7
|
+
"declarationMap": true,
|
|
8
|
+
"inlineSources": true
|
|
9
|
+
},
|
|
10
|
+
"exclude": ["**/*.spec.ts"]
|
|
11
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/* To learn more about this file see: https://angular.io/config/tsconfig. */
|
|
2
|
+
{
|
|
3
|
+
"extends": "../../tsconfig.json",
|
|
4
|
+
"compilerOptions": {
|
|
5
|
+
"outDir": "../../out-tsc/spec",
|
|
6
|
+
"types": [
|
|
7
|
+
"jasmine"
|
|
8
|
+
]
|
|
9
|
+
},
|
|
10
|
+
"include": [
|
|
11
|
+
"**/*.spec.ts",
|
|
12
|
+
"**/*.d.ts"
|
|
13
|
+
]
|
|
14
|
+
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { Component } from '@angular/core';
|
|
2
|
-
import * as i0 from "@angular/core";
|
|
3
|
-
export class NgOtpBoxComponent {
|
|
4
|
-
}
|
|
5
|
-
NgOtpBoxComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: NgOtpBoxComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
6
|
-
NgOtpBoxComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: NgOtpBoxComponent, selector: "lib-ng-otp-box", ngImport: i0, template: `
|
|
7
|
-
<p>
|
|
8
|
-
ng-otp-box works!
|
|
9
|
-
</p>
|
|
10
|
-
`, isInline: true });
|
|
11
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: NgOtpBoxComponent, decorators: [{
|
|
12
|
-
type: Component,
|
|
13
|
-
args: [{ selector: 'lib-ng-otp-box', template: `
|
|
14
|
-
<p>
|
|
15
|
-
ng-otp-box works!
|
|
16
|
-
</p>
|
|
17
|
-
` }]
|
|
18
|
-
}] });
|
|
19
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibmctb3RwLWJveC5jb21wb25lbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9wcm9qZWN0cy9uZy1vdHAtYm94L3NyYy9saWIvbmctb3RwLWJveC5jb21wb25lbnQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFNBQVMsRUFBRSxNQUFNLGVBQWUsQ0FBQzs7QUFZMUMsTUFBTSxPQUFPLGlCQUFpQjs7K0dBQWpCLGlCQUFpQjttR0FBakIsaUJBQWlCLHNEQVJsQjs7OztHQUlUOzRGQUlVLGlCQUFpQjtrQkFWN0IsU0FBUzsrQkFDRSxnQkFBZ0IsWUFDaEI7Ozs7R0FJVCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IENvbXBvbmVudCB9IGZyb20gJ0Bhbmd1bGFyL2NvcmUnO1xuXG5AQ29tcG9uZW50KHtcbiAgc2VsZWN0b3I6ICdsaWItbmctb3RwLWJveCcsXG4gIHRlbXBsYXRlOiBgXG4gICAgPHA+XG4gICAgICBuZy1vdHAtYm94IHdvcmtzIVxuICAgIDwvcD5cbiAgYCxcbiAgc3R5bGVzOiBbXG4gIF1cbn0pXG5leHBvcnQgY2xhc3MgTmdPdHBCb3hDb21wb25lbnQge1xuXG59XG4iXX0=
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { NgModule } from '@angular/core';
|
|
2
|
-
import { CommonModule } from '@angular/common';
|
|
3
|
-
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
4
|
-
import { MatInputModule } from '@angular/material/input';
|
|
5
|
-
import { OtpBoxComponent } from './otp-box/otp-box.component';
|
|
6
|
-
import * as i0 from "@angular/core";
|
|
7
|
-
export class NgOtpBoxModule {
|
|
8
|
-
}
|
|
9
|
-
NgOtpBoxModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: NgOtpBoxModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
10
|
-
NgOtpBoxModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: NgOtpBoxModule, declarations: [OtpBoxComponent], imports: [CommonModule,
|
|
11
|
-
ReactiveFormsModule,
|
|
12
|
-
FormsModule,
|
|
13
|
-
MatInputModule], exports: [OtpBoxComponent] });
|
|
14
|
-
NgOtpBoxModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: NgOtpBoxModule, imports: [CommonModule,
|
|
15
|
-
ReactiveFormsModule,
|
|
16
|
-
FormsModule,
|
|
17
|
-
MatInputModule] });
|
|
18
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: NgOtpBoxModule, decorators: [{
|
|
19
|
-
type: NgModule,
|
|
20
|
-
args: [{
|
|
21
|
-
declarations: [OtpBoxComponent],
|
|
22
|
-
imports: [
|
|
23
|
-
CommonModule,
|
|
24
|
-
ReactiveFormsModule,
|
|
25
|
-
FormsModule,
|
|
26
|
-
MatInputModule,
|
|
27
|
-
],
|
|
28
|
-
exports: [OtpBoxComponent],
|
|
29
|
-
}]
|
|
30
|
-
}] });
|
|
31
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibmctb3RwLWJveC5tb2R1bGUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9wcm9qZWN0cy9uZy1vdHAtYm94L3NyYy9saWIvbmctb3RwLWJveC5tb2R1bGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFFBQVEsRUFBRSxNQUFNLGVBQWUsQ0FBQztBQUN6QyxPQUFPLEVBQUUsWUFBWSxFQUFFLE1BQU0saUJBQWlCLENBQUM7QUFDL0MsT0FBTyxFQUFFLFdBQVcsRUFBRSxtQkFBbUIsRUFBRSxNQUFNLGdCQUFnQixDQUFDO0FBRWxFLE9BQU8sRUFBRSxjQUFjLEVBQUUsTUFBTSx5QkFBeUIsQ0FBQztBQUV6RCxPQUFPLEVBQUUsZUFBZSxFQUFFLE1BQU0sNkJBQTZCLENBQUM7O0FBWTlELE1BQU0sT0FBTyxjQUFjOzs0R0FBZCxjQUFjOzZHQUFkLGNBQWMsaUJBVFYsZUFBZSxhQUU1QixZQUFZO1FBQ1osbUJBQW1CO1FBQ25CLFdBQVc7UUFDWCxjQUFjLGFBRU4sZUFBZTs2R0FFZCxjQUFjLFlBUHZCLFlBQVk7UUFDWixtQkFBbUI7UUFDbkIsV0FBVztRQUNYLGNBQWM7NEZBSUwsY0FBYztrQkFWMUIsUUFBUTttQkFBQztvQkFDUixZQUFZLEVBQUUsQ0FBQyxlQUFlLENBQUM7b0JBQy9CLE9BQU8sRUFBRTt3QkFDUCxZQUFZO3dCQUNaLG1CQUFtQjt3QkFDbkIsV0FBVzt3QkFDWCxjQUFjO3FCQUNmO29CQUNELE9BQU8sRUFBRSxDQUFDLGVBQWUsQ0FBQztpQkFDM0IiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBOZ01vZHVsZSB9IGZyb20gJ0Bhbmd1bGFyL2NvcmUnO1xuaW1wb3J0IHsgQ29tbW9uTW9kdWxlIH0gZnJvbSAnQGFuZ3VsYXIvY29tbW9uJztcbmltcG9ydCB7IEZvcm1zTW9kdWxlLCBSZWFjdGl2ZUZvcm1zTW9kdWxlIH0gZnJvbSAnQGFuZ3VsYXIvZm9ybXMnO1xuXG5pbXBvcnQgeyBNYXRJbnB1dE1vZHVsZSB9IGZyb20gJ0Bhbmd1bGFyL21hdGVyaWFsL2lucHV0JztcblxuaW1wb3J0IHsgT3RwQm94Q29tcG9uZW50IH0gZnJvbSAnLi9vdHAtYm94L290cC1ib3guY29tcG9uZW50JztcblxuQE5nTW9kdWxlKHtcbiAgZGVjbGFyYXRpb25zOiBbT3RwQm94Q29tcG9uZW50XSxcbiAgaW1wb3J0czogW1xuICAgIENvbW1vbk1vZHVsZSxcbiAgICBSZWFjdGl2ZUZvcm1zTW9kdWxlLFxuICAgIEZvcm1zTW9kdWxlLFxuICAgIE1hdElucHV0TW9kdWxlLFxuICBdLFxuICBleHBvcnRzOiBbT3RwQm94Q29tcG9uZW50XSxcbn0pXG5leHBvcnQgY2xhc3MgTmdPdHBCb3hNb2R1bGUge31cbiJdfQ==
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { Injectable } from '@angular/core';
|
|
2
|
-
import * as i0 from "@angular/core";
|
|
3
|
-
export class NgOtpBoxService {
|
|
4
|
-
constructor() { }
|
|
5
|
-
}
|
|
6
|
-
NgOtpBoxService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: NgOtpBoxService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
7
|
-
NgOtpBoxService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: NgOtpBoxService, providedIn: 'root' });
|
|
8
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: NgOtpBoxService, decorators: [{
|
|
9
|
-
type: Injectable,
|
|
10
|
-
args: [{
|
|
11
|
-
providedIn: 'root'
|
|
12
|
-
}]
|
|
13
|
-
}], ctorParameters: function () { return []; } });
|
|
14
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibmctb3RwLWJveC5zZXJ2aWNlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vcHJvamVjdHMvbmctb3RwLWJveC9zcmMvbGliL25nLW90cC1ib3guc2VydmljZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsVUFBVSxFQUFFLE1BQU0sZUFBZSxDQUFDOztBQUszQyxNQUFNLE9BQU8sZUFBZTtJQUUxQixnQkFBZ0IsQ0FBQzs7NkdBRk4sZUFBZTtpSEFBZixlQUFlLGNBRmQsTUFBTTs0RkFFUCxlQUFlO2tCQUgzQixVQUFVO21CQUFDO29CQUNWLFVBQVUsRUFBRSxNQUFNO2lCQUNuQiIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IEluamVjdGFibGUgfSBmcm9tICdAYW5ndWxhci9jb3JlJztcblxuQEluamVjdGFibGUoe1xuICBwcm92aWRlZEluOiAncm9vdCdcbn0pXG5leHBvcnQgY2xhc3MgTmdPdHBCb3hTZXJ2aWNlIHtcblxuICBjb25zdHJ1Y3RvcigpIHsgfVxufVxuIl19
|