import { Component, OnInit, Input, ElementRef, Output, EventEmitter } from '@angular/core';
import { CfCoreComponent } from '../core/core.component';
import { IconModel } from '../../models/icon/icon.model';
@Component({
selector: 'cf-titlebar',
template: "
{{title}}
",
styles: [".wholeComponent { font-family: 'Avenir', Helvetica, sans-serif; } md-toolbar { height: 10px; } .title { margin-left: 10px; } /deep/ .icons { border-radius: 100%; } cf-icon:hover { cursor: pointer; } "]
})
export class CfTitlebar extends CfCoreComponent implements OnInit {
@Input()
title:string;
expandValue: boolean = true;
@Input()
get expand() {
return this.expandValue;
}
@Output()
expandChange = new EventEmitter();
set expand(val) {
this.expandValue = val;
this.expandChange.emit(this.expandValue);
}
closeIcon = new IconModel ({
name: "clear",
type: "mi",
size: "12px",
color: {
foreground: "black",
background: "#d14643"
}
});
minimizeIcon = new IconModel ({
name: "remove",
type: "mi",
size: "12px",
color: {
foreground: "black",
background: "#f0c141"
}
});
maximizeIcon = new IconModel ({
name: "gamepad",
type: "mi",
size: "12px",
color: {
foreground: "black",
background: "#39a139"
}
});
constructor(public elementRef: ElementRef) {
super(elementRef);
}
ngOnInit() {
super.ngOnInit();
}
changeExpand()
{
this.expand = !this.expand;
}
}