mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2026-07-09 05:25:10 +00:00
f3edc1ac36
document list dashboard / widget frame stats
40 lines
881 B
TypeScript
40 lines
881 B
TypeScript
import { Directive, OnDestroy, signal } from '@angular/core'
|
|
import { Subject } from 'rxjs'
|
|
import { ComponentWithPermissions } from '../with-permissions/with-permissions.component'
|
|
|
|
@Directive()
|
|
export abstract class LoadingComponentWithPermissions
|
|
extends ComponentWithPermissions
|
|
implements OnDestroy
|
|
{
|
|
private loadingSignal = signal(true)
|
|
private showSignal = signal(false)
|
|
|
|
public get loading(): boolean {
|
|
return this.loadingSignal()
|
|
}
|
|
|
|
public set loading(value: boolean) {
|
|
this.loadingSignal.set(value)
|
|
}
|
|
|
|
public get show(): boolean {
|
|
return this.showSignal()
|
|
}
|
|
|
|
public set show(value: boolean) {
|
|
this.showSignal.set(value)
|
|
}
|
|
|
|
protected unsubscribeNotifier: Subject<any> = new Subject()
|
|
|
|
constructor() {
|
|
super()
|
|
}
|
|
|
|
ngOnDestroy(): void {
|
|
this.unsubscribeNotifier.next(this)
|
|
this.unsubscribeNotifier.complete()
|
|
}
|
|
}
|