Set autosize and min two rows in textarea controls (#1604)
Co-authored-by: Jose Alberto Hernandez <alberto@MacBook-Pro.local>
This commit is contained in:
co-authored by
Jose Alberto Hernandez
parent
7bbab6423e
commit
475059a974
+6
-6
@@ -4,18 +4,18 @@
|
||||
|
||||
<div fxLayout="row" fxLayoutAlign="flex-end" class="m-b-20">
|
||||
<button mat-raised-button color="primary" (click)="addAddress()">
|
||||
<fa-icon icon="plus"></fa-icon> Add
|
||||
<fa-icon icon="plus" class="m-r-10"></fa-icon>Add
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<mat-accordion>
|
||||
<mat-accordion *ngIf="clientAddressData.length > 0">
|
||||
|
||||
<mat-expansion-panel *ngFor="let address of clientAddressData; index as i" class="address">
|
||||
|
||||
<mat-expansion-panel-header>
|
||||
|
||||
<mat-panel-title>
|
||||
{{ getSelectedValue('addressTypeIdOptions',address.addressTypeId)?.name }}
|
||||
{{ getSelectedValue('addressTypeIdOptions', address.addressTypeId)?.name }}
|
||||
</mat-panel-title>
|
||||
|
||||
<mat-panel-description>
|
||||
@@ -57,12 +57,12 @@
|
||||
|
||||
<div fxLayout="row" class="margin-t" fxLayout.xs="column" fxLayoutAlign="center" fxLayoutGap="2%">
|
||||
<button mat-raised-button matStepperPrevious>
|
||||
<fa-icon icon="arrow-left"></fa-icon>
|
||||
<fa-icon icon="arrow-left" class="m-r-10"></fa-icon>
|
||||
Previous
|
||||
</button>
|
||||
<button mat-raised-button matStepperNext>
|
||||
Next
|
||||
<fa-icon icon="arrow-right"></fa-icon>
|
||||
Next
|
||||
<fa-icon icon="arrow-right" class="m-l-10"></fa-icon>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -32,7 +32,9 @@ export class ClientAddressStepComponent {
|
||||
/**
|
||||
* @param {MatDialog} dialog Mat Dialog
|
||||
*/
|
||||
constructor(private dialog: MatDialog) { }
|
||||
constructor(private dialog: MatDialog) {
|
||||
this.clientAddressData = [];
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a client address
|
||||
@@ -42,7 +44,7 @@ export class ClientAddressStepComponent {
|
||||
title: 'Add Client Address',
|
||||
formfields: this.getAddressFormFields()
|
||||
};
|
||||
const addAddressDialogRef = this.dialog.open(FormDialogComponent, { data });
|
||||
const addAddressDialogRef = this.dialog.open(FormDialogComponent, { data, width: '50rem' });
|
||||
addAddressDialogRef.afterClosed().subscribe((response: any) => {
|
||||
if (response.data) {
|
||||
const addressData = response.data.value;
|
||||
@@ -68,7 +70,7 @@ export class ClientAddressStepComponent {
|
||||
formfields: this.getAddressFormFields(address),
|
||||
layout: { addButtonText: 'Edit' }
|
||||
};
|
||||
const editAddressDialogRef = this.dialog.open(FormDialogComponent, { data });
|
||||
const editAddressDialogRef = this.dialog.open(FormDialogComponent, { data, width: '50rem' });
|
||||
editAddressDialogRef.afterClosed().subscribe((response: any) => {
|
||||
if (response.data) {
|
||||
const addressData = response.data.value;
|
||||
@@ -216,7 +218,7 @@ export class ClientAddressStepComponent {
|
||||
* Returns the array of client addresses
|
||||
*/
|
||||
get address() {
|
||||
return { address: this.clientAddressData };
|
||||
return { address: this.clientAddressData ? this.clientAddressData : [] };
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+1
-2
@@ -1,6 +1,5 @@
|
||||
/** Angular Imports */
|
||||
import { Component, OnInit, Input } from '@angular/core';
|
||||
import { Router, ActivatedRoute } from '@angular/router';
|
||||
import { Component, Input } from '@angular/core';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
|
||||
/** Custom Components */
|
||||
|
||||
+1
-1
@@ -120,7 +120,7 @@
|
||||
|
||||
<mat-form-field fxFlex="98%">
|
||||
<mat-label>Remarks</mat-label>
|
||||
<textarea matInput formControlName="remarks"></textarea>
|
||||
<textarea matInput formControlName="remarks" cdkTextareaAutosize cdkAutosizeMinRows="2"></textarea>
|
||||
</mat-form-field>
|
||||
|
||||
</div>
|
||||
|
||||
+3
-3
@@ -162,7 +162,7 @@
|
||||
|
||||
</div>
|
||||
|
||||
<div fxFlexFill *ngIf="clientTemplate.isAddressEnabled && client.address.length" fxLayout="row wrap" fxLayout.lt-md="column">
|
||||
<div fxFlexFill *ngIf="clientTemplate.isAddressEnabled && client.address && client.address.length" fxLayout="row wrap" fxLayout.lt-md="column">
|
||||
|
||||
<h3 class="mat-h3" fxFlexFill>Address</h3>
|
||||
|
||||
@@ -175,7 +175,7 @@
|
||||
<mat-expansion-panel-header>
|
||||
|
||||
<mat-panel-title>
|
||||
{{ getSelectedValue('addressTypeIdOptions',address.addressTypeId)?.name }}
|
||||
{{ getSelectedValue('addressTypeIdOptions', address.addressTypeId)?.name }}
|
||||
</mat-panel-title>
|
||||
|
||||
<mat-panel-description>
|
||||
@@ -211,7 +211,7 @@
|
||||
|
||||
<div fxLayout="row" class="margin-t" fxLayout.xs="column" fxLayoutAlign="center" fxLayoutGap="2%">
|
||||
<button mat-raised-button matStepperPrevious>
|
||||
<fa-icon icon="arrow-left"></fa-icon>
|
||||
<fa-icon icon="arrow-left" class="m-r-10"></fa-icon>
|
||||
Previous
|
||||
</button>
|
||||
<button mat-raised-button [routerLink]="['../']">
|
||||
|
||||
Reference in New Issue
Block a user