import { Component, Input, Output, EventEmitter, OnChanges } from '@angular/core'; import { Grid } from '../../../lib/grid'; import { Row } from '../../../lib/data-set/row'; @Component({ selector: '[ng2-st-thead-form-row]', template: ` `, }) export class TheadFormRowComponent implements OnChanges { @Input() grid: Grid; @Input() row: Row; @Input() createConfirm: EventEmitter; @Output() create = new EventEmitter(); isMultiSelectVisible: boolean; showActionColumnLeft: boolean; showActionColumnRight: boolean; addInputClass: string; onCreate(event: any) { event.stopPropagation(); this.grid.create(this.grid.getNewRow(), this.createConfirm); } ngOnChanges(){ this.isMultiSelectVisible = this.grid.isMultiSelectVisible(); this.showActionColumnLeft = this.grid.showActionColumn('left'); this.showActionColumnRight = this.grid.showActionColumn('right'); this.addInputClass = this.grid.getSetting('add.inputClass'); } }