Skip to content
Snippets Groups Projects
recipient-input.component.html 7.13 KiB
Newer Older
  • Learn to ignore specific revisions
  • <mat-form-field *ngIf="this.control.status !== 'DISABLED'" appearance='outline' class="smallInput">
    
        <button mat-button matSuffix [matMenuTriggerFor]="menuDep" (click)="$event.stopPropagation();"
            [title]="this.translate.instant('lang.targetDepartment')">
            {{addressBANCurrentDepartment}}&nbsp;<i class="fa fa-chevron-down"></i>
        </button>
        <mat-menu #menuDep="matMenu">
            <button mat-menu-item *ngFor="let dep of departmentList"
                (click)="addressBANCurrentDepartment = dep">{{dep}}</button>
        </mat-menu>
        <mat-icon color="primary" class="fa fa-search" matPrefix style="font-size: 15px;">
        </mat-icon>
        <input type="text" #autoCompleteInput [placeholder]="this.translate.instant('lang.searchAddressBan')" matInput
            [formControl]="addressBANControl" [matAutocomplete]="auto" (click)="$event.stopPropagation()"
            (focus)="resetAutocompleteAddressBan()" maxlength="128">
        <mat-autocomplete #auto="matAutocomplete" (optionSelected)="selectAddressBan($event)">
            <ng-container *ngIf="addressBANResult.length > 0 && !addressBANLoading">
    
                <mat-option *ngFor="let addressBANResult of addressBANFilteredResult | async" [value]="addressBANResult"
                    [title]="addressBANResult.address">
    
                    {{addressBANResult.address}}
                </mat-option>
            </ng-container>
            <mat-option class="autoCompleteInfoResult smallInputInfo"
                *ngIf="addressBANResult.length === 0 && !addressBANLoading" disabled [innerHTML]="addressBANInfo">
            </mat-option>
            <mat-option *ngIf="addressBANLoading" disabled>
                <mat-spinner diameter="20"></mat-spinner>
            </mat-option>
        </mat-autocomplete>
    </mat-form-field>
    
    <a *ngIf="!manualAddress && emptyAddress()" (click)="manualAddress=!manualAddress" style="cursor: pointer;">{{'lang.switchManualAddress' | translate}}</a>
    <mat-card color="primary" *ngIf="manualAddress">
    
    Alex ORLUC's avatar
    Alex ORLUC committed
        <button mat-icon-button class="address-icon" (click)="manualAddress=!manualAddress"
            [title]="'lang.showAddress' | translate">
    
            <mat-icon class="fa fa-eye"></mat-icon>
        </button>
    
    Alex ORLUC's avatar
    Alex ORLUC committed
        <mat-form-field floatLabel="always">
            <mat-label>{{'lang.contactsParameters_company' | translate}}</mat-label>
            <input matInput name="company" [(ngModel)]="this.control.value.company"
                (ngModelChange)="toUpperCase('company', $event)" [required]="functions.empty(control.value.lastname)">
        </mat-form-field>
        <mat-form-field floatLabel="always">
            <mat-label>{{'lang.contactsParameters_civility' | translate}}</mat-label>
            <mat-select name="civility" [(ngModel)]="this.control.value.civility">
                <mat-option *ngFor="let civ of civilities | sortBy: 'label'" [value]="civ.label">
                    {{civ.label}}
                </mat-option>
            </mat-select>
        </mat-form-field>
        <mat-form-field floatLabel="always">
            <mat-label>{{'lang.contactsParameters_firstname' | translate}}</mat-label>
            <input matInput name="firstname" [(ngModel)]="this.control.value.firstname"
                (ngModelChange)="toUpperCase('firstname', $event)" [required]="functions.empty(control.value.company)">
        </mat-form-field>
        <mat-form-field floatLabel="always">
            <mat-label>{{'lang.contactsParameters_lastname' | translate}}</mat-label>
            <input matInput name="lastname" [(ngModel)]="this.control.value.lastname"
                (ngModelChange)="toUpperCase('lastname', $event)" [required]="functions.empty(control.value.company)">
        </mat-form-field>
        <mat-form-field floatLabel="always">
            <mat-label>{{'lang.contactsParameters_addressAdditional1' | translate}}</mat-label>
            <input matInput name="addressAdditional1" [(ngModel)]="this.control.value.addressAdditional1"
                (ngModelChange)="toUpperCase('addressAdditional1', $event)">
        </mat-form-field>
        <mat-form-field floatLabel="always">
            <mat-label>{{'lang.contactsParameters_addressNumber' | translate}}</mat-label>
            <input matInput name="addressNumber" [(ngModel)]="this.control.value.addressNumber"
                (ngModelChange)="toUpperCase('addressNumber', $event)" required>
        </mat-form-field>
        <mat-form-field floatLabel="always">
            <mat-label>{{'lang.contactsParameters_addressStreet' | translate}}</mat-label>
            <input matInput name="addressStreet" [(ngModel)]="this.control.value.addressStreet"
                (ngModelChange)="toUpperCase('addressStreet', $event)" required>
        </mat-form-field>
        <mat-form-field floatLabel="always">
            <mat-label>{{'lang.contactsParameters_addressAdditional2' | translate}}</mat-label>
            <input matInput name="addressAdditional2" [(ngModel)]="this.control.value.addressAdditional2"
                (ngModelChange)="toUpperCase('addressAdditional2', $event)">
        </mat-form-field>
        <mat-form-field floatLabel="always">
            <mat-label>{{'lang.contactsParameters_addressPostcode' | translate}}</mat-label>
            <input matInput name="addressPostcode" [(ngModel)]="this.control.value.addressPostcode"
                (ngModelChange)="toUpperCase('addressPostcode', $event)" required>
        </mat-form-field>
        <mat-form-field floatLabel="always">
            <mat-label>{{'lang.contactsParameters_addressTown' | translate}}</mat-label>
            <input matInput name="addressTown" [(ngModel)]="this.control.value.addressTown"
                (ngModelChange)="toUpperCase('addressTown', $event)" required>
        </mat-form-field>
        <mat-form-field floatLabel="always">
            <mat-label>{{'lang.contactsParameters_addressCountry' | translate}}</mat-label>
    
            <input matInput #autoCompleteInput [(ngModel)]="this.control.value.addressCountry" [matAutocomplete]="matAutocompleteCountries"
                [formControl]="countryControl" [required]="registeredMailType === 'RW'">
            <mat-autocomplete #matAutocompleteCountries="matAutocomplete" isOpen="true" (optionSelected)="this.control.value.addressCountry = $event.option.value">
                <mat-option *ngFor="let country of countriesFilteredResult | async" [value]="country">
                    {{country}}
                </mat-option>
            </mat-autocomplete>
    
    Alex ORLUC's avatar
    Alex ORLUC committed
        </mat-form-field>
    
    <mat-card color="primary" *ngIf="!manualAddress && !emptyAddress()" style="min-height: 60px">
    
    Alex ORLUC's avatar
    Alex ORLUC committed
        <button *ngIf="this.control.status !== 'DISABLED'" mat-icon-button class="address-icon"
            (click)="manualAddress=!manualAddress" [title]="'lang.update' | translate">
    
            <mat-icon class="fa fa-edit"></mat-icon>
        </button>
        <div>
    
            {{control.value.civility}} {{control.value.firstname}} {{control.value.lastname}}
    
            {{control.value.addressNumber}} {{control.value.addressStreet}}
    
            {{control.value.addressPostcode}} {{control.value.addressTown}}
    
        <button mat-icon-button class="map-icon" (click)="goTo()" [title]="'lang.openMap' | translate">
            <mat-icon class="fa fas fa-map-marked-alt"></mat-icon>
        </button>