import { Component , EventEmitter , Input , Output } from '@angular/core' ; import { CmdbMode } from '../../../modes.enum' ; import { FormGroup } from '@angular/forms' ; import { RenderResult } from '../../../models/cmdb-render' ; import { CmdbType } from '../../../models/cmdb-type' ; @ Component ( { selector : 'cmdb-object-bulk-change-editor' , templateUrl : './object-bulk-change-editor.component.html' , styleUrls : [ './object-bulk-change-editor.component.scss' ] } ) export class ObjectBulkChangeEditorComponent { /**
     * Form render mode.
     */ public readonly mode : CmdbMode = CmdbMode . Bulk ; /**
     * Form control
     */ @ Input ( ) public changeForm : FormGroup = new FormGroup ( { } ) ; @ Input ( ) public renderForm : FormGroup = new FormGroup ( { } ) ; /**
     * Bulk deactivation.
     */ public activeState : boolean = true ; @ Output ( ) activeChange : EventEmitter < boolean > = new EventEmitter < boolean > ( ) ; /**
     * Type instance of the bulk change element.
     */ @ Input ( ) public type : CmdbType ; param name public getFieldByName ( name ) { return this . type . fields . find ( field => field . name === name ) ; } public onActiveChange ( value ) { if ( value === undefined ) { this . renderForm . markAsPristine ( ) ; } else { this . renderForm . markAsDirty ( ) ; } this . activeState = value ; this . activeChange . emit ( this . activeState ) ; } }