Skip to content

Commit 59fbc30

Browse files
committed
Implemented #28 - Disabled state
1 parent f5fc1cd commit 59fbc30

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

angular-code-input/src/lib/code-input.component.config.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ export interface CodeInputComponentConfig {
1111
isPrevFocusableAfterClearing?: boolean;
1212
isFocusingOnLastByClickIfFilled?: boolean;
1313
code?: string | number;
14+
disabled?: boolean;
1415
}
1516

1617
export const defaultComponentConfig: CodeInputComponentConfig = {
@@ -21,5 +22,6 @@ export const defaultComponentConfig: CodeInputComponentConfig = {
2122
isCodeHidden: false,
2223
isPrevFocusableAfterClearing: true,
2324
isFocusingOnLastByClickIfFilled: false,
24-
code: undefined
25+
code: undefined,
26+
disabled: false
2527
};

angular-code-input/src/lib/code-input.component.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@
55
(paste)="onPaste($event, i)"
66
(input)="onInput($event, i)"
77
(keydown)="onKeydown($event, i)"
8-
[type]="inputType"/>
8+
[type]="inputType"
9+
[disabled]="disabled"/>
910
</span>

angular-code-input/src/lib/code-input.component.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ export class CodeInputComponent implements AfterViewInit, OnInit, OnChanges, Aft
4545
@Input() isPrevFocusableAfterClearing !: boolean;
4646
@Input() isFocusingOnLastByClickIfFilled !: boolean;
4747
@Input() code ?: string | number;
48+
@Input() disabled !: boolean;
4849

4950
@Output() readonly codeChanged = new EventEmitter<string>();
5051
@Output() readonly codeCompleted = new EventEmitter<string>();

0 commit comments

Comments
 (0)