Files
cbsnexora/src/app/clients/clients-view/family-members-tab/add-family-member/add-family-member.component.html
T

108 lines
4.3 KiB
HTML

<div class="add-family-member-container">
<form [formGroup]="addFamilyMemberForm" (ngSubmit)="submit()">
<div fxLayout="row wrap" fxLayout.lt-md="column" fxLayoutAlign="start center">
<mat-form-field fxFlex="calc(50% - 25px)">
<mat-label>First Name</mat-label>
<input formControlName="firstName" required matInput />
<mat-error *ngIf="addFamilyMemberForm.controls.firstName.hasError('required')">
First Name is <strong>required</strong>
</mat-error>
</mat-form-field>
<mat-form-field fxFlex="calc(50% - 25px)">
<mat-label>Middle Name</mat-label>
<input formControlName="middleName" matInput />
</mat-form-field>
<mat-form-field fxFlex="calc(50% - 25px)">
<mat-label>Last Name</mat-label>
<input formControlName="lastName" required matInput />
<mat-error *ngIf="addFamilyMemberForm.controls.lastName.hasError('required')">
Last Name is <strong>required</strong>
</mat-error>
</mat-form-field>
<mat-form-field fxFlex="calc(50% - 25px)">
<mat-label>Qualification</mat-label>
<input formControlName="qualification" matInput />
</mat-form-field>
<mat-form-field fxFlex="calc(50% - 25px)">
<mat-label>Age</mat-label>
<input type="number" formControlName="age" required matInput />
<mat-error *ngIf="addFamilyMemberForm.controls.age.hasError('required')">
Age is <strong>required</strong>
</mat-error>
</mat-form-field>
<mat-checkbox formControlName="isDependent" labelPosition="before" fxFlex="calc(50% - 25px)">Is Dependent?
</mat-checkbox>
<mat-form-field fxFlex="calc(50% - 25px)">
<mat-label>Relationship</mat-label>
<mat-select formControlName="relationshipId" required>
<mat-option *ngFor="let relation of addFamilyMemberTemplate.relationshipIdOptions" [value]="relation.id">
{{ relation.name }}
</mat-option>
</mat-select>
<mat-error *ngIf="addFamilyMemberForm.controls.relationshipId.hasError('required')">
Relationship is <strong>required</strong>
</mat-error>
</mat-form-field>
<mat-form-field fxFlex="calc(50% - 25px)">
<mat-label>Gender</mat-label>
<mat-select formControlName="genderId" required>
<mat-option *ngFor="let gender of addFamilyMemberTemplate.genderIdOptions" [value]="gender.id">
{{ gender.name }}
</mat-option>
</mat-select>
<mat-error *ngIf="addFamilyMemberForm.controls.genderId.hasError('required')">
Gender is <strong>required</strong>
</mat-error>
</mat-form-field>
<mat-form-field fxFlex="calc(50% - 25px)">
<mat-label>Profession</mat-label>
<mat-select formControlName="professionId">
<mat-option *ngFor="let profession of addFamilyMemberTemplate.professionIdOptions" [value]="profession.id">
{{ profession.name }}
</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field fxFlex="calc(50% - 25px)">
<mat-label>Marital Status</mat-label>
<mat-select formControlName="maritalStatusId">
<mat-option *ngFor="let maritalStatus of addFamilyMemberTemplate.maritalStatusIdOptions"
[value]="maritalStatus.id">
{{ maritalStatus.name }}
</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field fxFlex>
<mat-label>Date Of Birth</mat-label>
<input formControlName="dateOfBirth" matInput [min]="minDate" [max]="maxDate" [matDatepicker]="dueDatePicker"
required>
<mat-datepicker-toggle matSuffix [for]="dueDatePicker"></mat-datepicker-toggle>
<mat-datepicker #dueDatePicker></mat-datepicker>
<mat-error *ngIf="addFamilyMemberForm.controls.dateOfBirth.hasError('required')">
Date of birth
is <strong>required</strong>
</mat-error>
</mat-form-field>
</div>
<div fxLayout="row" fxLayoutGap="32px" fxLayoutAlign="center">
<button type="button" mat-raised-button [routerLink]="['../']">Cancel</button>
<button type="submit" mat-raised-button color="primary" [disabled]="!addFamilyMemberForm.valid">Submit</button>
</div>
</form>
</div>