Skip to content

Commit

Permalink
feat(input): Criar e Implementar propriedade [readonly]
Browse files Browse the repository at this point in the history
  • Loading branch information
WilliamAguera committed May 22, 2017
1 parent 950abff commit 56e2bc7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/input/input.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
[(ngModel)]="value" type="text"
(ngModelChange)="onInputChange($event)"
(blur)="onBlur()"
[ngClass]="{'read-only' : readonly}"
[attr.readonly]="readonly ? true : null"
[attr.placeholder]="placeholder">

<span (click)="clearInput()" class="input-group-addon clear-button" *ngIf="clearButton && value">X</span>
Expand Down
4 changes: 4 additions & 0 deletions src/input/input.scss
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ $background: #FFFFFF;
border-radius: 2px 0 0 2px;
}

.read-only {
cursor: not-allowed;
}

.input-group-addon i {
color: #6E6E6E;
}
Expand Down
1 change: 1 addition & 0 deletions src/input/input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export class TlInput implements ControlValueAccessor {
@Input() placeholder: string = '';
@Input() clearButton: boolean;
@Input() toUpperCase: boolean;
@Input() readonly : boolean = null;

@ViewChild('input') input;

Expand Down

0 comments on commit 56e2bc7

Please sign in to comment.