common-ui/src/lib/inputs/round-checkbox/round-checkbox.component.ts
2021-07-30 15:37:34 +03:00

21 lines
716 B
TypeScript

import { ChangeDetectionStrategy, Component, ElementRef, Input, OnInit, ViewChild } from '@angular/core';
@Component({
selector: 'iqser-round-checkbox',
templateUrl: './round-checkbox.component.html',
styleUrls: ['./round-checkbox.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush
})
export class RoundCheckboxComponent implements OnInit {
@Input() size = 20;
@Input() active = false;
@Input() indeterminate = false;
@Input() type: 'default' | 'with-bg' = 'default';
@ViewChild('wrapper', { static: true }) private readonly _wrapper!: ElementRef;
ngOnInit(): void {
this._wrapper.nativeElement.style.setProperty('--size', this.size + 'px');
}
}