-
0" class="col-auto pagination-info">
+
0 && showPaginator" class="col-auto pagination-info">
{{ 'pagination.showing.label' | translate }}
{{ 'pagination.showing.detail' | translate:(getShowingDetails(collectionSize)|async)}}
@@ -20,16 +20,31 @@
-
diff --git a/src/app/shared/pagination/pagination.component.ts b/src/app/shared/pagination/pagination.component.ts
index 8f1c6bf26f..21f495956d 100644
--- a/src/app/shared/pagination/pagination.component.ts
+++ b/src/app/shared/pagination/pagination.component.ts
@@ -20,6 +20,10 @@ import { hasValue } from '../empty.util';
import { PageInfo } from '../../core/shared/page-info.model';
import { PaginationService } from '../../core/pagination/pagination.service';
import { map } from 'rxjs/operators';
+import { RemoteData } from 'src/app/core/data/remote-data';
+import { PaginatedList } from 'src/app/core/data/paginated-list.model';
+import { ListableObject } from '../object-collection/shared/listable-object.model';
+import { ViewMode } from 'src/app/core/shared/view-mode.model';
/**
* The default pagination controls component.
@@ -33,6 +37,11 @@ import { map } from 'rxjs/operators';
encapsulation: ViewEncapsulation.Emulated
})
export class PaginationComponent implements OnDestroy, OnInit {
+ /**
+ * ViewMode that should be passed to {@link ListableObjectComponentLoaderComponent}.
+ */
+ viewMode: ViewMode = ViewMode.ListElement;
+
/**
* Number of items in collection.
*/
@@ -53,6 +62,26 @@ export class PaginationComponent implements OnDestroy, OnInit {
*/
@Input() sortOptions: SortOptions;
+ /**
+ * Whether or not the pagination should be rendered as simple previous and next buttons instead of the normal pagination
+ */
+ @Input() showPaginator = true;
+
+ /**
+ * The current pagination configuration
+ */
+ @Input() config?: PaginationComponentOptions;
+
+ /**
+ * The list of listable objects to render in this component
+ */
+ @Input() objects: RemoteData
>;
+
+ /**
+ * The current sorting configuration
+ */
+ @Input() sortConfig: SortOptions;
+
/**
* An event fired when the page is changed.
* Event's payload equals to the newly selected page.
@@ -163,6 +192,15 @@ export class PaginationComponent implements OnDestroy, OnInit {
*/
private subs: Subscription[] = [];
+ /**
+ * If showPaginator is set to true, emit when the previous button is clicked
+ */
+ @Output() prev = new EventEmitter();
+
+ /**
+ * If showPaginator is set to true, emit when the next button is clicked
+ */
+ @Output() next = new EventEmitter();
/**
* Method provided by Angular. Invoked after the constructor.
*/
@@ -347,4 +385,19 @@ export class PaginationComponent implements OnDestroy, OnInit {
map((hasMultiplePages) => hasMultiplePages || !this.hidePagerWhenSinglePage)
);
}
+
+ /**
+ * Go to the previous page
+ */
+ goPrev() {
+ this.prev.emit(true);
+ }
+
+ /**
+ * Go to the next page
+ */
+ goNext() {
+ this.next.emit(true);
+ }
+
}