mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-11 12:03:03 +00:00
added TypeDoc
This commit is contained in:
@@ -15,21 +15,55 @@ import { CollectionElementLinkType } from './collection-element-link.type';
|
||||
import { PaginatedList } from '../../core/data/paginated-list';
|
||||
import { Context } from '../../core/shared/context.model';
|
||||
|
||||
/**
|
||||
* Component that can render a list of listable objects in different view modes
|
||||
*/
|
||||
@Component({
|
||||
selector: 'ds-viewable-collection',
|
||||
styleUrls: ['./object-collection.component.scss'],
|
||||
templateUrl: './object-collection.component.html',
|
||||
})
|
||||
export class ObjectCollectionComponent implements OnInit {
|
||||
|
||||
/**
|
||||
* The list of listable objects to render in this component
|
||||
*/
|
||||
@Input() objects: RemoteData<PaginatedList<ListableObject>>;
|
||||
|
||||
/**
|
||||
* The current pagination configuration
|
||||
*/
|
||||
@Input() config?: PaginationComponentOptions;
|
||||
|
||||
/**
|
||||
* The current sorting configuration
|
||||
*/
|
||||
@Input() sortConfig: SortOptions;
|
||||
|
||||
/**
|
||||
* Whether or not the list elements have a border or not
|
||||
*/
|
||||
@Input() hasBorder = false;
|
||||
|
||||
/**
|
||||
* Whether or not to hide the gear to change the sort and pagination configuration
|
||||
*/
|
||||
@Input() hideGear = false;
|
||||
|
||||
/**
|
||||
* The link type of the rendered list elements
|
||||
*/
|
||||
@Input() linkType: CollectionElementLinkType;
|
||||
|
||||
/**
|
||||
* The context of the rendered list elements
|
||||
*/
|
||||
@Input() context: Context;
|
||||
|
||||
/**
|
||||
* the page info of the list
|
||||
*/
|
||||
pageInfo: Observable<PageInfo>;
|
||||
|
||||
/**
|
||||
* An event fired when the page is changed.
|
||||
* Event's payload equals to the newly selected page.
|
||||
@@ -48,6 +82,9 @@ export class ObjectCollectionComponent implements OnInit {
|
||||
*/
|
||||
@Output() sortDirectionChange: EventEmitter<SortDirection> = new EventEmitter<SortDirection>();
|
||||
|
||||
/**
|
||||
* An event fired one of the pagination parameters is changed
|
||||
*/
|
||||
@Output() paginationChange: EventEmitter<SortDirection> = new EventEmitter<any>();
|
||||
|
||||
/**
|
||||
@@ -55,8 +92,15 @@ export class ObjectCollectionComponent implements OnInit {
|
||||
* Event's payload equals to the newly selected sort field.
|
||||
*/
|
||||
@Output() sortFieldChange: EventEmitter<string> = new EventEmitter<string>();
|
||||
data: any = {};
|
||||
|
||||
/**
|
||||
* Emits the current view mode
|
||||
*/
|
||||
currentMode$: Observable<ViewMode>;
|
||||
|
||||
/**
|
||||
* The available view modes
|
||||
*/
|
||||
viewModeEnum = ViewMode;
|
||||
|
||||
ngOnInit(): void {
|
||||
@@ -83,22 +127,39 @@ export class ObjectCollectionComponent implements OnInit {
|
||||
private router: Router) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates the page
|
||||
* @param event The new page number
|
||||
*/
|
||||
onPageChange(event) {
|
||||
this.pageChange.emit(event);
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates the page size
|
||||
* @param event The new page size
|
||||
*/
|
||||
onPageSizeChange(event) {
|
||||
this.pageSizeChange.emit(event);
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates the sort direction
|
||||
* @param event The new sort direction
|
||||
*/
|
||||
onSortDirectionChange(event) {
|
||||
this.sortDirectionChange.emit(event);
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates the sort field
|
||||
* @param event The new sort field
|
||||
*/
|
||||
onSortFieldChange(event) {
|
||||
this.sortFieldChange.emit(event);
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates the pagination
|
||||
* @param event The new pagination
|
||||
*/
|
||||
onPaginationChange(event) {
|
||||
this.paginationChange.emit(event);
|
||||
}
|
||||
|
Reference in New Issue
Block a user