import {Component, Input, OnInit} from '@angular/core'; import { GLOBAL_UI_CONSTANTS } from '../../constants/ui.constants'; @Component({ selector: 'tooltip', templateUrl: './tooltip.component.html' }) export class TooltipComponent implements OnInit { @Input() tooltipText: string; @Input() uniqueId: string; @Input() assistiveText: string; @Input() defaultIcon = true; GLOBAL_ICONS_SVG_PATH = GLOBAL_UI_CONSTANTS.GLOBAL_ICONS_SVG_PATH; ngOnInit(): void { const rndNumber = this.getRandomNumber(100); this.uniqueId = (this.uniqueId) ? this.uniqueId : rndNumber.toString(); this.assistiveText = (this.assistiveText) ? this.assistiveText : '-'; } getRandomNumber(max): number { return Math.floor(Math.random() * Math.floor(max)); } }