All files / src/components/zd-breadcrumbs breadcrumbs.ts

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

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 43 44 45 46 47 4893x           93x       2x         2x         2x         2x         2x                                  
import { ComponentRender } from '../zd-component/component-render';
import { IBreadcrumbs, IBreadcrumbsItem } from './interfaces';
 
/**
 * Base class for Breadcrumbs component.
 */
export class Breadcrumbs extends ComponentRender implements IBreadcrumbs {
	/**
	 * Specifies the dividing string between items.
	 */
	public divider = '/';
 
	/**
	 * Array of objects for each breadcrumb.
	 */
	public items: IBreadcrumbsItem[] = [];
 
	/**
	 * Defines the divider icon name.
	 */
	public iconName = '';
 
	/**
	 * Increase the font-size of the breadcrumb item text to 16px.
	 */
	public large = false;
 
	/**
	 * Decrease the font-size of the breadcrumb item text to 12px.
	 */
	public small = false;
 
	/* istanbul ignore next */
	/**
	 * Create a new Breadcrumbs
	 * @param props Breadcrumbs definition
	 */
	constructor(props: IBreadcrumbs) {
		super(props);
		this.divider = this.getInitValue('divider', props.divider, this.divider);
		this.items = this.getInitValue('items', props.items, this.items);
		this.large = this.getInitValue('large', props.large, this.large);
		this.iconName = this.getInitValue('iconName', props.iconName, this.iconName);
		this.small = this.getInitValue('small', props.small, this.small);
		this.createAccessors();
	}
}