mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-26 17:24:56 +00:00
special CSS class if pagination is empty (#2780)
This commit is contained in:
parent
b3fb51e06d
commit
6b80969c37
@ -91,6 +91,11 @@ describe('PaginationComponent', () => {
|
|||||||
});
|
});
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
it('should have an "empty" class if no items present', () => {
|
||||||
|
fixture.detectChanges();
|
||||||
|
expect(fixture.nativeElement.classList.contains('adf-pagination__empty')).toBeTruthy();
|
||||||
|
});
|
||||||
|
|
||||||
describe('Single page', () => {
|
describe('Single page', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
component.pagination = new FakePaginationInput(1, 1, 10);
|
component.pagination = new FakePaginationInput(1, 1, 10);
|
||||||
|
@ -24,7 +24,8 @@ import {
|
|||||||
Output,
|
Output,
|
||||||
ViewEncapsulation,
|
ViewEncapsulation,
|
||||||
ChangeDetectorRef,
|
ChangeDetectorRef,
|
||||||
OnDestroy
|
OnDestroy,
|
||||||
|
HostBinding
|
||||||
} from '@angular/core';
|
} from '@angular/core';
|
||||||
|
|
||||||
import { Pagination } from 'alfresco-js-api';
|
import { Pagination } from 'alfresco-js-api';
|
||||||
@ -134,6 +135,11 @@ export class PaginationComponent implements OnInit, OnDestroy {
|
|||||||
return this.pagination && this.pagination.count > 0;
|
return this.pagination && this.pagination.count > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@HostBinding('class.adf-pagination__empty')
|
||||||
|
get isEmpty(): boolean {
|
||||||
|
return !this.hasItems;
|
||||||
|
}
|
||||||
|
|
||||||
get range(): number[] {
|
get range(): number[] {
|
||||||
const { skipCount, maxItems, totalItems } = this.pagination;
|
const { skipCount, maxItems, totalItems } = this.pagination;
|
||||||
const { isLastPage } = this;
|
const { isLastPage } = this;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user