File
Implements
Metadata
selector |
div[technical-specification] |
styleUrls |
./technical-specification.component.scss |
templateUrl |
./technical-specification.component.html |
Index
Properties
|
|
Methods
|
|
Inputs
|
|
technicalData
|
Type : []
|
Default value : []
|
|
technicalSpecLabel
|
Type : string
|
|
import { Component, Input, SimpleChanges, OnChanges, OnInit } from '@angular/core';
import { UtilService } from 'src/app/core/services/util-service/util.service';
import { LabelService } from 'src/app/core/services/label-service/label-service.service';
import { ConstantsService } from 'src/app/shared/constants/constants.service';
@Component ({
selector: 'div[technical-specification]',
templateUrl: './technical-specification.component.html',
styleUrls: ['./technical-specification.component.scss']
})
export class TechnicalSpecificationComponent implements OnInit, OnChanges {
@Input() data;
technicalData = [];
sortData;
technicalSpecLabel: string;
calcButtonLabel: string;
calcButtonUrl: string;
compId: string;
constructor(
private util: UtilService,
private labelService: LabelService,
private constants: ConstantsService
) {}
ngOnInit(): void {
this.labelService.getLabel('technicalSpecificationOnPDPs').then(res => this.technicalSpecLabel = res);
this.labelService.getLabel('pimPDPcalculateButton').then(res => this.calcButtonLabel = res);
this.calcButtonUrl = this.constants.CALCULATE_BEARING_URL;
this.compId = `${this.constants.COMPONENT_ID_PREFIX}-spec`;
}
ngOnChanges(changes: SimpleChanges): void {
if (changes && this.data) {
this.technicalData = this.util.extract(this.data, 'documentList', 'documents', [0], 'technical_data');
this.sortData = {
systems: this.data['systems'],
sortOptions: null,
tableData: null
};
}
}
}
<div class="tech-spec" [id]="compId">
<div class="container">
<h2 class="headline">
{{technicalSpecLabel}}
</h2>
<div class="toolbelt" *ngIf="sortData">
<sort-options [data]="sortData" [useFilters]="false"></sort-options>
</div>
<content-block class="pdf-content" [data]="data" *ngFor="let data of technicalData"></content-block>
<div class="calculate">
<a class="btn btn-green" [href]="calcButtonUrl">{{calcButtonLabel}}</a>
</div>
</div>
</div>
@import "src/app/styles/helpers";
.tech-spec {
background-color: $off-white;
padding: 50px 0;
min-height: 100vh;
.headline {
color: $dark-blue;
}
.toolbelt {
display: flex;
width: 100%;
justify-content: flex-end;
}
.calculate {
display: flex;
flex-direction: row;
justify-content: flex-end;
.btn {
padding-left: calc-rem(30);
padding-right: calc-rem(30);
}
}
}
Legend
Html element with directive