mirror of
https://github.com/bitwarden/browser
synced 2025-12-16 08:13:42 +00:00
[CL-707] Migrate CL codebase to signals (#15340)
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
// FIXME: Update this file to be type safe and remove this and next line
|
||||
// @ts-strict-ignore
|
||||
import { FocusableOption } from "@angular/cdk/a11y";
|
||||
import { Directive, ElementRef, HostBinding, Input } from "@angular/core";
|
||||
import { Directive, ElementRef, HostBinding, Input, input } from "@angular/core";
|
||||
|
||||
/**
|
||||
* Directive used for styling tab header items for both nav links (anchor tags)
|
||||
@@ -11,7 +11,10 @@ import { Directive, ElementRef, HostBinding, Input } from "@angular/core";
|
||||
selector: "[bitTabListItem]",
|
||||
})
|
||||
export class TabListItemDirective implements FocusableOption {
|
||||
@Input() active: boolean;
|
||||
readonly active = input<boolean>();
|
||||
// TODO: Skipped for signal migration because:
|
||||
// This input overrides a field from a superclass, while the superclass field
|
||||
// is not migrated.
|
||||
@Input() disabled: boolean;
|
||||
|
||||
@HostBinding("attr.disabled")
|
||||
@@ -32,7 +35,7 @@ export class TabListItemDirective implements FocusableOption {
|
||||
@HostBinding("class")
|
||||
get classList(): string[] {
|
||||
return this.baseClassList
|
||||
.concat(this.active ? this.activeClassList : [])
|
||||
.concat(this.active() ? this.activeClassList : [])
|
||||
.concat(this.disabled ? this.disabledClassList : [])
|
||||
.concat(this.textColorClassList);
|
||||
}
|
||||
@@ -45,7 +48,7 @@ export class TabListItemDirective implements FocusableOption {
|
||||
if (this.disabled) {
|
||||
return ["!tw-text-secondary-300", "hover:!tw-text-secondary-300"];
|
||||
}
|
||||
if (this.active) {
|
||||
if (this.active()) {
|
||||
return ["!tw-text-primary-600", "hover:!tw-text-primary-700"];
|
||||
}
|
||||
return ["!tw-text-main", "hover:!tw-text-main"];
|
||||
|
||||
Reference in New Issue
Block a user