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

100% Statements 13/13
100% Branches 3/3
100% Functions 1/1
100% Lines 13/13

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 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 12393x             93x       2x         2x         2x         2x                   2x         2x         2x         2x                                                 2x         2x                                                                           2x      
import { ComponentRender } from '../zd-component/component-render';
import { IComponentRender } from '../zd-component/interfaces';
import { IFooter } from './interfaces';
 
/**
 * Base class for Footer component.
 */
export class Footer extends ComponentRender implements IFooter {
	/**
	 * Applies position absolute to footer.
	 */
	public absolute = false;
 
	/**
	 * Designates the footer as part of the application layout.
	 */
	public app = false;
 
	/**
	 * Render components on the middle of footer.
	 */
	public centerSlot: IComponentRender[] = [];
 
	/**
	 * Applies specified color to the control. It can be the name of material or css color in hexa.
	 */
	public color = 'primary';
 
	/**
	 * Events registered to the footer.
	 */
	// public events!: IFooterEvents;
 
	/**
	 * Applies position fixed to footer.
	 */
	public fixed = false;
 
	/**
	 * Sets the height for footer.
	 */
	public height: number | string = 'auto';
 
	/**
	 * Positions the footer inside the application content.
	 */
	public inset = false;
 
	/**
	 * Render components on the left of footer.
	 */
	public leftSlot: IComponentRender[] = [];
 
	/**
	 * Sets the maximum height for the footer.
	 */
	public maxHeight?: number | string;
 
	/**
	 * Sets the maximum width for the footer.
	 */
	public maxWidth?: number | string;
 
	/**
	 * Sets the minimum height for the footer.
	 */
	public minHeight?: number | string;
 
	/**
	 * Sets the minimum width for the footer.
	 */
	public minWidth?: number | string;
 
	/**
	 * Remove all padding from the footer.
	 */
	public padless = false;
 
	/**
	 * Render components on the right of footer.
	 */
	public rightSlot: IComponentRender[] = [];
 
	/**
	 * Sets the width for the component.
	 */
	public width?: number | string;
 
	/* istanbul ignore next */
	/**
	 * Creates a new Footer.
	 * @param props Footer properties
	 */
	constructor(props: IFooter) {
		super(props);
		this.absolute = this.getInitValue('absolute', props.absolute, this.absolute);
		this.app = this.getInitValue('app', props.app, this.app);
		this.centerSlot = props.centerSlot || this.centerSlot;
		this.color = this.getInitValue('color', props.color, this.color);
		this.dark = this.getInitValue('dark', props.dark, this.dark);
		this.fixed = this.getInitValue('fixed', props.fixed, this.fixed);
		this.height = this.getInitValue('height', props.height, this.height);
		this.inset = this.getInitValue('inset', props.inset, this.inset);
		this.leftSlot = props.leftSlot || this.leftSlot;
		this.light = this.getInitValue('light', props.light, this.light);
		this.maxHeight = this.getInitValue('maxHeight', props.maxHeight, this.maxHeight);
		this.maxWidth = this.getInitValue('maxWidth', props.maxWidth, this.maxWidth);
		this.minHeight = this.getInitValue('minHeight', props.minHeight, this.minHeight);
		this.minWidth = this.getInitValue('minWidth', props.minWidth, this.minWidth);
		this.padless = this.getInitValue('padless', props.padless, this.padless);
		this.rightSlot = props.rightSlot || this.rightSlot;
		this.width = this.getInitValue('width', props.width, this.width);
		this.createAccessors();
	}
 
	/**
	 * Retrieves named slots visibility
	 */
	get namedSlotsIsVisible() {
		return this.leftSlot.length || this.centerSlot.length || this.rightSlot.length;
	}
}