mirror of
https://github.com/bitwarden/browser
synced 2026-02-10 13:40:06 +00:00
finish migrating button
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
import { coerceBooleanProperty } from "@angular/cdk/coercion";
|
||||
import { NgClass } from "@angular/common";
|
||||
import { Input, HostBinding, Component, model, computed, input } from "@angular/core";
|
||||
import { HostBinding, Component, model, computed, input, booleanAttribute } from "@angular/core";
|
||||
import { toObservable, toSignal } from "@angular/core/rxjs-interop";
|
||||
import { debounce, interval } from "rxjs";
|
||||
|
||||
@@ -70,7 +69,7 @@ export class ButtonComponent implements ButtonLikeAbstraction {
|
||||
"hover:tw-no-underline",
|
||||
"focus:tw-outline-none",
|
||||
]
|
||||
.concat(this.block ? ["tw-w-full", "tw-block"] : ["tw-inline-block"])
|
||||
.concat(this.block() ? ["tw-w-full", "tw-block"] : ["tw-inline-block"])
|
||||
.concat(buttonStyles[this.buttonType() ?? "secondary"])
|
||||
.concat(
|
||||
this.showDisabledStyles() || this.disabled()
|
||||
@@ -110,18 +109,7 @@ export class ButtonComponent implements ButtonLikeAbstraction {
|
||||
|
||||
size = input<ButtonSize>("default");
|
||||
|
||||
private _block = false;
|
||||
|
||||
// TODO: Skipped for migration because:
|
||||
// Accessor inputs cannot be migrated as they are too complex.
|
||||
@Input()
|
||||
get block(): boolean {
|
||||
return this._block;
|
||||
}
|
||||
|
||||
set block(value: boolean | "") {
|
||||
this._block = coerceBooleanProperty(value);
|
||||
}
|
||||
block = input(false, { transform: booleanAttribute });
|
||||
|
||||
loading = model<boolean>(false);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user