Catalog alignment
[sdc.git] / catalog-ui / src / app / ng2 / components / ui / form-components / checkbox / checkbox.component.ts
1 /*-
2  * ============LICENSE_START=======================================================
3  * SDC
4  * ================================================================================
5  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6  * ================================================================================
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  * 
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  * 
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  * ============LICENSE_END=========================================================
19  */
20
21 import { Component, Input, Output, EventEmitter, ViewEncapsulation } from '@angular/core';
22 //import { trigger, state, style, transition, animate, keyframes } from '@angular/animations';
23
24 @Component({
25     selector: 'checkbox',
26     templateUrl: './checkbox.component.html',
27     styleUrls: ['./checkbox.component.less'],
28     encapsulation: ViewEncapsulation.None
29     // animations: [
30     //     trigger('checkEffect', [
31     //         state('true', style({ position: 'absolute', left: '2px', top: '5px', width: '10px', height: '10px', display: 'none', opacity: '.5' })),
32     //         state('false', style({ left: '-18px', top: '-15px', height: '50px', width: '50px', opacity: '0' })),
33     //         transition('1 => 0', animate('150ms ease-out')),
34     //         transition('0 => 1', animate('150ms ease-in'))
35     //     ])
36     // ]
37 })
38 export class CheckboxComponent  {
39     
40     @Input() checkboxStyle: string;
41     @Input() label: string;
42     @Input() checked: boolean;
43     @Input() disabled: boolean;
44     @Output() checkedChange: EventEmitter<any> = new EventEmitter<any>();
45
46     toggleState(newValue:boolean) {
47         this.checkedChange.emit(newValue);
48     }
49 }
50