[sdc] update code of sdc
[sdc.git] / catalog-ui / src / app / ng2 / shared / checkbox / checkbox.component.ts
1 import { Component, Input, Output, EventEmitter, ViewEncapsulation } from '@angular/core';
2 //import { trigger, state, style, transition, animate, keyframes } from '@angular/core';
3
4 @Component({
5     selector: 'checkbox',
6     templateUrl: './checkbox.component.html',
7     styleUrls: ['./checkbox.component.less'],
8     encapsulation: ViewEncapsulation.None
9     // animations: [
10     //     trigger('checkEffect', [
11     //         state('true', style({ position: 'absolute', left: '2px', top: '5px', width: '10px', height: '10px', display: 'none', opacity: '.5' })),
12     //         state('false', style({ left: '-18px', top: '-15px', height: '50px', width: '50px', opacity: '0' })),
13     //         transition('1 => 0', animate('150ms ease-out')),
14     //         transition('0 => 1', animate('150ms ease-in'))
15     //     ])
16     // ]
17 })
18 export class CheckboxComponent  {
19     
20     @Input() checkboxStyle: string;
21     @Input() label: string;
22     @Input() checked: boolean;
23     @Input() disabled: boolean;
24     @Output() checkedChange: EventEmitter<any> = new EventEmitter<any>();
25
26     toggleState(newValue:boolean) {
27         this.checkedChange.emit(newValue);
28     }
29 }
30