Files
pixel.horse/src/ts/components/shared/check-box/check-box.ts
T
2026-08-05 07:46:07 +02:00

24 lines
627 B
TypeScript

import { Component, Input, Output, EventEmitter, ChangeDetectionStrategy } from '@angular/core';
import { faCheck } from '../../../client/icons';
@Component({
standalone: false,
selector: 'check-box',
templateUrl: 'check-box.pug',
styleUrls: ['check-box.scss'],
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class CheckBox {
@Input() icon = faCheck;
@Input() label?: string;
@Input() disabled = false;
@Input() checked = false;
@Output() checkedChange = new EventEmitter<boolean>();
toggle() {
if (!this.disabled) {
this.checked = !this.checked;
this.checkedChange.emit(this.checked);
}
}
}