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

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

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 3293x           93x       2x         2x                                
import { ComponentRender } from '../zd-component/component-render';
import { IDivider } from './interfaces';
 
/**
 * Base class for Divider component.
 */
export class Divider extends ComponentRender implements IDivider {
	/**
	 * Adds indentation (72px) for normal dividers, reduces max height for vertical.
	 */
	public inset = false;
 
	/**
	 * Displays dividers vertically.
	 */
	public vertical = false;
 
	/* istanbul ignore next */
	/**
	 * Creates a new Divider.
	 * @param props Divider properties
	 */
	constructor(props: IDivider) {
		super(props);
		this.dark = this.getInitValue('dark', props.dark, this.dark);
		this.inset = this.getInitValue('inset', props.inset, this.inset);
		this.light = this.getInitValue('light', props.light, this.light);
		this.vertical = this.getInitValue('vertical', props.vertical, this.vertical);
		this.createAccessors();
	}
}