// Angular // import { Component, OnInit, Input } from '@angular/core'; import * as _ from 'underscore'; // Components // // import * as _ from 'underscore'; // Interfaces // // Services // // Directives // // Other classes // import { FbFormBase } from '../fbFormBase'; import * as statics from '@fb/statics'; const styles: any[] = [require('./fb-form-checkbox.component.less')]; /** * Visar en checkbox * * Syntax: * * * @param model Modell * @param label Label att visa. Visas inte om tight eller noLabel är satt * @param disabled Disabled om satt till true * @param disableReason Används som tooltip vid disabled * @param noLabel Sätt till true för att dölja label * @param name Ange om man vill att name-attributet ska sättas * @param infoTooltip Ange text för att visa texten i ett info-tooltip * @param infoTooltipArrowPosition Arrow-position för tooltip-text ovan * @param displayInline Om true så visas den som inline-block */ @Component({ selector: 'fb-form-checkbox', templateUrl: './fb-form-checkbox.component.html', styles: styles }) export class FbFormCheckboxComponent extends FbFormBase implements OnInit { @Input() name: string; @Input() infoTooltip: string; @Input() infoTooltipArrowPosition: string; @Input() displayInline: boolean = false; showInfoTooltip: boolean; constructor() { super(); } ngOnInit(): void { super.ngOnInit(); if (!this.name) { this.name = statics.Guid.new(); } this.showInfoTooltip = false; if (!_.isUndefined(this.infoTooltip) && this.infoTooltip !== '') { this.showInfoTooltip = true; } } }