diff --git a/src/app/components/generic-calculator/calculator.component.html b/src/app/components/generic-calculator/calculator.component.html index 4b518f5ab96f9dc279ed229bb9f4cd42c4c44842..7356b4b5a3b5e4b5e6798fb1653aab89b87797f5 100644 --- a/src/app/components/generic-calculator/calculator.component.html +++ b/src/app/components/generic-calculator/calculator.component.html @@ -28,9 +28,15 @@ <!-- nom du module de calcul --> <calc-name id="calculator-name" [title]="uitextCalculatorName"></calc-name> - <div id="calc-cards-container" class="container" fxLayout="row wrap" fxLayoutAlign="space-around start"> + <div id="calc-cards-container" class="container" + [fxLayout]="isPAB ? 'column' : 'row wrap'" + [fxLayoutAlign]="isPAB ? 'space-around stretch' : 'space-around start'"> + <!-- chapitres --> - <mat-card id="calc-card-field-sets" fxFlex.gt-xs="1 0 400px" fxFlex.lt-sm="1 0 300px"> + <mat-card id="calc-card-field-sets" + [fxFlex.gt-xs]="isPAB ? '1 0 auto' : '1 0 400px'" + [fxFlex.lt-sm]="isPAB ? '1 0 auto' : '1 0 300px'"> + <ng-template ngFor let-fe [ngForOf]="formElements"> <field-set *ngIf="isFieldset(fe)" [style.display]="getFieldsetStyleDisplay(fe.id)" [fieldSet]=fe (radio)=onRadioClick($event) (validChange)=OnFieldsetValid() (inputChange)=onInputChange($event) @@ -52,7 +58,10 @@ </mat-card> <!-- résultats --> - <mat-card id="calc-card-results" fxFlex.gt-xs="1 0 400px" fxFlex.lt-sm="1 0 300px"> + <mat-card id="calc-card-results" + [fxFlex.gt-xs]="isPAB ? '1 0 auto' : '1 0 400px'" + [fxFlex.lt-sm]="isPAB ? '1 0 auto' : '1 0 300px'"> + <div id="fake-results-anchor"></div> <mat-card-header> <mat-card-title> diff --git a/src/app/components/generic-calculator/calculator.component.ts b/src/app/components/generic-calculator/calculator.component.ts index 67b856e1f70cc84e07f725a449ba3d7a440b6ed5..a83ea6303054d252904fe9e013cb68aded671606 100644 --- a/src/app/components/generic-calculator/calculator.component.ts +++ b/src/app/components/generic-calculator/calculator.component.ts @@ -425,6 +425,16 @@ export class GenericCalculatorComponent extends BaseComponent implements OnInit, return false; } + // for "one wide column" layout + public get isPAB() { + return ( + this._formulaire + && this._formulaire.currentNub + && this._formulaire.currentNub.calcType === CalculatorType.Pab + ); + } + + // for "generate PAB" button public get isPABCloisons() { return ( this._formulaire