import {Component, Input} from "@angular/core";
import {animate, state, style, transition, trigger} from "@angular/animations";
@Component({
selector:'wp-panel',
template:`
`,
styles:[`
.rnCarret{
transition: transform ease-in-out 300ms;
}
.rnCarret.open{
transform:rotate(180deg);
}
.rnPanelContainer.ng-animating{
overflow: hidden;
}
`],
animations:[
trigger('AnimationOpen',[
state('true',style({
height:'*'
})),
state('false',style({
height:0,
display:'none'
})),
transition('*=>*',[
animate('0.3s ease-in-out')
])
])
]
})
export class WpPanel {
@Input() public Title:string;
@Input() public Icon:string;
@Input() public IsOpen:boolean=true;
@Input() public TitleBackgroundColor:string='white';
Toggle() {
this.IsOpen=!this.IsOpen;
}
}