All files / src/components/zd-iterable iterable-pagination.ts

100% Statements 5/5
100% Branches 0/0
100% Functions 0/0
100% Lines 5/5

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42  93x         93x       2x         2x         2x                                          
import { IIterablePagination } from './interfaces';
import { IterablePageComponent } from './iterable-page-component';
 
/**
 * Base class for Iterable Pagination component
 */
export class IterablePagination extends IterablePageComponent implements IIterablePagination {
	/**
	 * Previous button icon
	 */
	public prevIcon = 'prev';
 
	/**
	 * Next button icon
	 */
	public nextIcon = 'next';
 
	/**
	 * Show buttons as circles
	 */
	public circle = false;
 
	/**
	 * Delimits the maximum number of page buttons. Undefined means automatic
	 */
	public maxButtons?: number;
 
	/* istanbul ignore next */
	/**
	 * Creates a new Iterable Pagination.
	 * @param props Iterable pagination properties
	 */
	constructor(props: IIterablePagination) {
		super(props);
		this.circle = this.getInitValue('circle', props.circle, this.circle);
		this.prevIcon = this.getInitValue('prevIcon', props.prevIcon, this.prevIcon);
		this.nextIcon = this.getInitValue('nextIcon', props.nextIcon, this.nextIcon);
		this.maxButtons = this.getInitValue('maxButtons', props.maxButtons, this.maxButtons);
		this.createAccessors();
	}
}