-
Notifications
You must be signed in to change notification settings - Fork 134
/
spec-picker.component.html
116 lines (100 loc) · 5.32 KB
/
spec-picker.component.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
<div id="spec-picker-container" *ngIf="specManager && specManager.selectedSpecGroup">
<div id="spec-picker-shield" *ngIf="isUpdating || shieldEnabled" [class.spec-picker-shield-menu]="isOpenedFromMenu"></div>
<!-- TODO(michinoy): Switch to using GroupTabs control (WI #3158544)-->
<nav id="spec-group-tabs" role="tablist" #specGroupTabs>
<div *ngFor="let specGroup of specManager.specGroups"
(click)="selectGroup(specGroup)"
class="clickable spec-group"
[class.selected-spec-group]="specGroup === specManager.selectedSpecGroup"
[tabindex]="specGroup === specManager.selectedSpecGroup ? 0 : -1"
(keydown)="onGroupTabKeyPress($event)"
role="tab"
[id]="'spec-group-tab-' + specGroup.id"
[attr.aria-controls]="'spec-group-tab-' + specGroup.id"
[attr.aria-selected]="specGroup === specManager.selectedSpecGroup"
[attr.aria-label]="specGroup.title"
aria-describedBy="subGroupDescriptionId">
<div [load-image]="specGroup.iconUrl" class="icon-medium"></div>
<h3>{{specGroup.title}}</h3>
<h4 id="subGroupDescriptionId">{{specGroup.description}}</h4>
</div>
</nav>
<section role="tabpanel"
[id]="'spec-group-tab-' + specManager.selectedSpecGroup.id"
[attr.aria-label]="specManager.selectedSpecGroup.title">
<section>
<info-box *ngIf="specManager.selectedSpecGroup.bannerMessage"
[infoText]="specManager.selectedSpecGroup.bannerMessage.message"
[typeClass]="specManager.selectedSpecGroup.bannerMessage.level"
[infoLink]="specManager.selectedSpecGroup.bannerMessage.infoLink"></info-box>
</section>
<section *ngIf="isEmpty" class="empty-group">
<div [load-image]="specManager.selectedSpecGroup.iconUrl" class="icon-large"></div>
<article [id]="specManager.selectedSpecGroup.id + 'empty'">
<div>{{specManager.selectedSpecGroup.emptyMessage}}</div>
<a [href]="specManager.selectedSpecGroup.emptyInfoLink"
target="_blank"
[attr.aria-describedby]="specManager.selectedSpecGroup.id + 'empty'">{{'clickToLearnMore' | translate}}</a>
</article>
</section>
<section class="centered">
<ng-container *ngIf="specManager.selectedSpecGroup.recommendedSpecs.length > 0">
<h2 class="tiers-header" tabindex="0" >{{'pricing_recommendedTiers' | translate}}</h2>
<spec-list [specGroup]="specManager.selectedSpecGroup"
[isRecommendedList]="true"
(onSelectedSpec)="selectSpec($event)"></spec-list>
</ng-container>
<div class="spec-expander" *ngIf="showExpander">
<span (click)="specManager.selectedSpecGroup.isExpanded = !specManager.selectedSpecGroup.isExpanded"
(keydown)="onExpandKeyPress($event)"
role="button"
tabindex="0"
[attr.aria-expanded]="specManager.selectedSpecGroup.isExpanded"
[attr.aria-controls]="specManager.selectedSpecGroup.id + specManager.selectedSpecGroup.selectedSpec?.skuCode">
<span [load-image]="!specManager.selectedSpecGroup.isExpanded ? 'image/caret-down.svg' : 'image/caret-up.svg'" class="expand-icon"></span>
<a>{{ (!specManager.selectedSpecGroup.isExpanded ? 'seeAllOptions' : 'seeRecommendedOptions') | translate}}</a>
</span>
</div>
<ng-container *ngIf="showAllSpecs">
<h2 class="tiers-header" tabindex="0">{{'pricing_additionalTiers' | translate}}</h2>
<spec-list [specGroup]="specManager.selectedSpecGroup"
[isRecommendedList]="false"
(onSelectedSpec)="selectSpec($event)"></spec-list>
</ng-container>
</section>
<section *ngIf="specManager.selectedSpecGroup.selectedSpec" class="feature-lists-container centered">
<article class="feature-list">
<spec-feature-list
[title]="'pricing_includedFeatures' | translate"
[description]="'pricing_includedFeaturesDesc' | translate"
[featureItems]="specManager.selectedSpecGroup.selectedSpec.featureItems"></spec-feature-list>
</article>
<article class="feature-list">
<spec-feature-list
[title]="'pricing_includedHardware' | translate"
[description]="'pricing_includedHardwareDesc' | translate"
[featureItems]="specManager.selectedSpecGroup.selectedSpec.hardwareItems"></spec-feature-list>
</article>
</section>
</section> <!-- End tabpanel -->
<footer>
<div id="spec-picker-footer">
<button class="custom-button"
[disabled]="!applyButtonEnabled"
(click)="clickApply()"
[attr.aria-label]="'pricing_applyButtonLabel' | translate">
<span *ngIf="!isUpdating">{{'apply' | translate}}</span>
<span *ngIf="isUpdating" load-image="image/loader.svg" class="icon-medium fa-spin"></span>
</button>
<span class="message-icon icon-medium"
*ngIf="statusMessage && statusMessage.message"
[load-image]="statusMessageImage"></span>
<span class="message-text"
[class.message-error]="statusMessage?.level === 'error'"
[class.message-success]="statusMessage?.level === 'success'">
{{statusMessage?.message}}
</span>
<a *ngIf="statusMessage?.infoLink" class="message-text" [href]="statusMessage?.infoLink" target="_blank">{{'topBar_learnMore' | translate}}</a>
</div>
</footer>
</div>