Skip to content

Commit

Permalink
fix(RUP):Se agrega required a ValorNumerico
Browse files Browse the repository at this point in the history
  • Loading branch information
waltergarrido committed Sep 2, 2020
1 parent 3aeb16f commit a92700a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { RupElement } from '.';
})
@RupElement('ValorNumericoComponent')
export class ValorNumericoComponent extends RUPComponent implements OnInit {
public esRequerido: boolean;
ngOnInit() {
if (!this.registro.valor) {
this.registro.valor = 0;
Expand Down Expand Up @@ -38,5 +39,10 @@ export class ValorNumericoComponent extends RUPComponent implements OnInit {
});
}
}
if (this.params) {
this.esRequerido = this.params.required;
} else {
this.esRequerido = false;
}
}
}
12 changes: 8 additions & 4 deletions src/app/modules/rup/components/elementos/valorNumerico.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@
<div class="row flex-column">
<div class="col-12">
<ng-container *ngIf="!soloValores; else showSoloValores">
<plex-int [label]="params.title ? params.title : registro.concepto.term" name="intValue" *ngIf="params.numericType === 'integer'"
[(ngModel)]="registro.valor" [suffix]="params.unit ? params.unit : '' " [min]="params.min" [max]="params.max" (change)="emitChange($event)"></plex-int>
<plex-float [label]="params.title ? params.title : registro.concepto.term" name="floatValue" *ngIf="params.numericType === 'float'"
[(ngModel)]="registro.valor" [suffix]="params.unit ? params.unit : ''" [min]="params.min" [max]="params.max" (change)="emitChange($event)"></plex-float>
<plex-int [label]="params.title ? params.title : registro.concepto.term" name="intValue"
*ngIf="params.numericType === 'integer'" [(ngModel)]="registro.valor"
[suffix]="params.unit ? params.unit : '' " [min]="params.min" [max]="params.max"
(change)="emitChange($event)" [required]="esRequerido"></plex-int>
<plex-float [label]="params.title ? params.title : registro.concepto.term" name="floatValue"
*ngIf="params.numericType === 'float'" [(ngModel)]="registro.valor"
[suffix]="params.unit ? params.unit : ''" [min]="params.min" [max]="params.max"
(change)="emitChange($event)" [required]="esRequerido"></plex-float>
</ng-container>
<ng-template #showSoloValores>
<div *ngIf="params?.title; else showTerm">
Expand Down

0 comments on commit a92700a

Please sign in to comment.