blob: 16f069a6855210b43b0bbc6932da7619004d908a (
plain)
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
|
/**
* Created by rc2122 on 4/20/2017.
*/
import {Component, Input, Output, EventEmitter} from "@angular/core";
import { DerivedFEProperty, DerivedPropertyType} from "app/models";
import {PropertiesService} from "../../../services/properties.service";
@Component({
selector: 'derived-property',
templateUrl: './derived-property.component.html',
styleUrls: ['./derived-property.component.less']
})
export class DerivedPropertyComponent {
derivedPropertyTypes = DerivedPropertyType; //http://stackoverflow.com/questions/35835984/how-to-use-a-typescript-enum-value-in-an-angular2-ngswitch-statement
@Input() propertyObj: DerivedFEProperty;
@Input() propertyNameSearchText: string;
@Input() expanded: boolean;
@Output() valueChanged: EventEmitter<any> = new EventEmitter<any>();
@Output() expandChild: EventEmitter<string> = new EventEmitter<string>();
@Output() selectProperty: EventEmitter<boolean> = new EventEmitter<boolean>();
constructor ( private propertiesService:PropertiesService){
}
propValueChanged = () => {
this.valueChanged.emit(this.propertyObj);
};
expandChildById = (id: string) => {
this.expandChild.emit(id);
}
checkedChange = (isChecked:boolean) => {
this.selectProperty.emit(isChecked);
}
addRows = (flatProperty: DerivedFEProperty): void => {
console.log("ADDING A ROW OF TYPE " + flatProperty.type);
console.log(flatProperty);
}
}
|