Restructure; use DaisyUI

This commit is contained in:
Geomitron
2023-11-28 19:50:45 -06:00
parent 49c3f38f99
commit 2eef4d0bee
727 changed files with 1283 additions and 298840 deletions

View File

@@ -1,34 +1,35 @@
import { AfterViewInit, Directive, ElementRef, EventEmitter, Output } from '@angular/core'
import { Directive, ElementRef, EventEmitter, Output } from '@angular/core'
@Directive({
selector: '[appCheckbox]',
})
export class CheckboxDirective implements AfterViewInit {
export class CheckboxDirective {
@Output() checked = new EventEmitter<boolean>()
_isChecked = false
constructor(private checkbox: ElementRef) { }
ngAfterViewInit() {
$(this.checkbox.nativeElement).checkbox({
onChecked: () => {
this.checked.emit(true)
this._isChecked = true
},
onUnchecked: () => {
this.checked.emit(false)
this._isChecked = false
},
})
}
// ngAfterViewInit() {
// TODO
// $(this.checkbox.nativeElement).checkbox({
// onChecked: () => {
// this.checked.emit(true)
// this._isChecked = true
// },
// onUnchecked: () => {
// this.checked.emit(false)
// this._isChecked = false
// },
// })
// }
check(isChecked: boolean) {
this._isChecked = isChecked
if (isChecked) {
$(this.checkbox.nativeElement).checkbox('check')
this.checkbox.nativeElement.checked = true
} else {
$(this.checkbox.nativeElement).checkbox('uncheck')
this.checkbox.nativeElement.checked = false
}
}