Fix scroll for nb-list inside nb-card

This commit is contained in:
eugene-sinitsyn 2020-03-11 14:29:19 +03:00 committed by Maksim Karatkevich
parent 077fdaf0c2
commit 92941ee85d
9 changed files with 110 additions and 40 deletions

View file

@ -9,6 +9,13 @@
}
}
nb-card nb-list {
@include nb-scrollbars(
nb-theme(card-scrollbar-color),
nb-theme(card-scrollbar-background-color),
nb-theme(card-scrollbar-width));
}
.table {
color: nb-theme(text-basic-color) !important;
}

View file

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

View file

@ -1,19 +1,7 @@
@import '../../../../@theme/styles/themes';
@include nb-install-component() {
display: flex;
flex-direction: column;
flex: 1;
nb-card-body {
overflow: hidden;
position: relative;
display: flex;
flex-direction: column;
}
ngx-traffic-bar-chart {
flex: 1;
position: relative;
::ng-deep {

View file

@ -0,0 +1,44 @@
@import '~bootstrap/scss/mixins/breakpoints';
@import '~@nebular/theme/styles/global/breakpoints';
@import '../../../../@theme/styles/themes';
@include nb-install-component() {
overflow: hidden;
nb-list {
height: 100%;
}
.item {
display: flex;
justify-content: space-between;
align-items: center;
> * {
flex: 1;
}
&:first-child {
border-top: none;
}
}
.delta {
display: flex;
align-items: center;
&.down {
color: nb-theme(color-danger-default);
}
&.up {
color: nb-theme(color-success-default);
}
}
@include media-breakpoint-down(is) {
ngx-traffic-bar {
display: none;
}
}
}

View file

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

View file

@ -1,14 +1,5 @@
@import '../../../../@theme/styles/themes';
@include nb-install-component() {
nb-card-header {
:host {
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,23 @@
<nb-reveal-card [showToggleButton]="false" [revealed]="revealed">
<nb-card-front>
<nb-card size="small">
<ngx-traffic-cards-header [type]="period" (periodChange)="setPeriodAngGetData($event)"></ngx-traffic-cards-header>
<nb-card-header>
<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>
<nb-icon class="toggle-icon" icon="chevron-up-outline" pack="eva" (click)="toggleView()"></nb-icon>
</nb-card>
</nb-card-front>
<nb-card-back>
<nb-card size="small">
<ngx-traffic-cards-header [type]="period" (periodChange)="setPeriodAngGetData($event)"></ngx-traffic-cards-header>
<nb-card-header>
<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-card>
</nb-card-back>

View file

@ -9,4 +9,11 @@
@include nb-rtl(left, 1.25rem);
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);
}
}

View file

@ -0,0 +1,28 @@
<div class="lists row">
<div class="col-md-12 col-lg-6 col-xxxl-6">
<nb-card class="list-card">
<nb-card-header>Some Fruits</nb-card-header>
<nb-card-body>
<nb-list>
<nb-list-item *ngFor="let fruit of fruits">
{{ fruit }}
</nb-list-item>
</nb-list>
</nb-card-body>
</nb-card>
</div>
<div class="col-md-12 col-lg-6 col-xxxl-6">
<nb-card class="list-card" size="small">
<nb-card-header>Users</nb-card-header>
<nb-card-body>
<nb-list>
<nb-list-item *ngFor="let user of users">
<nb-user [name]="user.name" [title]="user.title">
</nb-user>
</nb-list-item>
</nb-list>
</nb-card-body>
</nb-card>
</div>
</div>