Fix scrollbar for "traffic" card

This commit is contained in:
eugene-sinitsyn 2020-03-11 13:20:11 +03:00 committed by Sergey Andrievskiy
parent d6d6ebcd1f
commit 8ddbd32a34
6 changed files with 38 additions and 39 deletions

View file

@ -1,6 +1,5 @@
<nb-card-body> <ngx-traffic-bar-chart
<ngx-traffic-bar-chart [data]="trafficBarData.data" [data]="trafficBarData.data"
[labels]="trafficBarData.labels" [labels]="trafficBarData.labels"
[formatter]="trafficBarData.formatter"> [formatter]="trafficBarData.formatter"
</ngx-traffic-bar-chart> ></ngx-traffic-bar-chart>
</nb-card-body>

View file

@ -1,16 +1,10 @@
@import '../../../../@theme/styles/themes'; @import '../../../../@theme/styles/themes';
@include nb-install-component() { @include nb-install-component() {
display: flex; display: block;
flex-direction: column; height: 100%;
flex: 1; overflow: hidden;
position: relative;
nb-card-body {
overflow: hidden;
position: relative;
display: flex;
flex-direction: column;
}
ngx-traffic-bar-chart { ngx-traffic-bar-chart {
flex: 1; flex: 1;

View file

@ -1,6 +1,4 @@
<nb-card-header> <span>Traffic</span>
<span>Traffic</span> <nb-select matRipple [selected]="type" (selectedChange)="changePeriod($event)">
<nb-select matRipple [selected]="type" (selectedChange)="changePeriod($event)"> <nb-option matRipple *ngFor="let period of types" [value]="period">{{ period }}</nb-option>
<nb-option matRipple *ngFor="let period of types" [value]="period">{{ period }}</nb-option> </nb-select>
</nb-select>
</nb-card-header>

View file

@ -1,14 +1,5 @@
@import '../../../../@theme/styles/themes'; :host {
display: flex;
@include nb-install-component() { align-items: center;
nb-card-header { justify-content: space-between;
display: flex;
align-items: center;
justify-content: space-between;
padding-top: nb-theme(card-header-with-select-padding-top);
padding-bottom: nb-theme(card-header-with-select-padding-bottom);
@include nb-ltr(padding-right, 4rem);
@include nb-rtl(padding-left, 4rem);
}
} }

View file

@ -1,15 +1,25 @@
<nb-reveal-card [showToggleButton]="false" [revealed]="revealed"> <nb-reveal-card [showToggleButton]="false" [revealed]="revealed">
<nb-card-front> <nb-card-front>
<nb-card size="small"> <nb-card size="small">
<ngx-traffic-cards-header [type]="period" (periodChange)="setPeriodAngGetData($event)"></ngx-traffic-cards-header> <nb-card-header>
<ngx-traffic-front-card [frontCardData]="trafficListData"></ngx-traffic-front-card> <ngx-traffic-cards-header [type]="period" (periodChange)="setPeriodAngGetData($event)">
</ngx-traffic-cards-header>
</nb-card-header>
<nb-card-body>
<ngx-traffic-front-card [frontCardData]="trafficListData"></ngx-traffic-front-card>
</nb-card-body>
<nb-icon class="toggle-icon" icon="chevron-up-outline" pack="eva" (click)="toggleView()"></nb-icon> <nb-icon class="toggle-icon" icon="chevron-up-outline" pack="eva" (click)="toggleView()"></nb-icon>
</nb-card> </nb-card>
</nb-card-front> </nb-card-front>
<nb-card-back> <nb-card-back>
<nb-card size="small"> <nb-card size="small">
<ngx-traffic-cards-header [type]="period" (periodChange)="setPeriodAngGetData($event)"></ngx-traffic-cards-header> <nb-card-header>
<ngx-traffic-back-card [trafficBarData]="trafficBarData"></ngx-traffic-back-card> <ngx-traffic-cards-header [type]="period" (periodChange)="setPeriodAngGetData($event)">
</ngx-traffic-cards-header>
</nb-card-header>
<nb-card-body>
<ngx-traffic-back-card [trafficBarData]="trafficBarData"></ngx-traffic-back-card>
</nb-card-body>
<nb-icon class="toggle-icon" icon="chevron-down-outline" pack="eva" (click)="toggleView()"></nb-icon> <nb-icon class="toggle-icon" icon="chevron-down-outline" pack="eva" (click)="toggleView()"></nb-icon>
</nb-card> </nb-card>
</nb-card-back> </nb-card-back>

View file

@ -9,4 +9,11 @@
@include nb-rtl(left, 1.25rem); @include nb-rtl(left, 1.25rem);
cursor: pointer; cursor: pointer;
} }
nb-card-header {
padding-top: nb-theme(card-header-with-select-padding-top);
padding-bottom: nb-theme(card-header-with-select-padding-bottom);
@include nb-ltr(padding-right, 4rem);
@include nb-rtl(padding-left, 4rem);
}
} }