mirror of
https://github.com/bitwarden/browser
synced 2025-12-12 14:23:32 +00:00
UIF - Prefer signal & change detection (#16940)
This commit is contained in:
@@ -34,6 +34,8 @@ import { SelectItemView } from "./models/select-item-view";
|
||||
// Increments for each instance of this component
|
||||
let nextId = 0;
|
||||
|
||||
// FIXME(https://bitwarden.atlassian.net/browse/CL-764): Migrate to OnPush
|
||||
// eslint-disable-next-line @angular-eslint/prefer-on-push-component-change-detection
|
||||
@Component({
|
||||
selector: "bit-multi-select",
|
||||
templateUrl: "./multi-select.component.html",
|
||||
@@ -64,6 +66,8 @@ export class MultiSelectComponent implements OnInit, BitFormFieldControl, Contro
|
||||
readonly loading = input(false);
|
||||
// TODO: Skipped for signal migration because:
|
||||
// Your application code writes to the input. This prevents migration.
|
||||
// FIXME(https://bitwarden.atlassian.net/browse/CL-903): Migrate to Signals
|
||||
// eslint-disable-next-line @angular-eslint/prefer-signals
|
||||
@Input({ transform: booleanAttribute }) disabled?: boolean;
|
||||
|
||||
// Internal tracking of selected items
|
||||
@@ -79,6 +83,8 @@ export class MultiSelectComponent implements OnInit, BitFormFieldControl, Contro
|
||||
/**Implemented as part of NG_VALUE_ACCESSOR */
|
||||
private notifyOnTouched?: () => void;
|
||||
|
||||
// FIXME(https://bitwarden.atlassian.net/browse/CL-903): Migrate to Signals
|
||||
// eslint-disable-next-line @angular-eslint/prefer-output-emitter-ref
|
||||
@Output() onItemsConfirmed = new EventEmitter<any[]>();
|
||||
|
||||
constructor(
|
||||
@@ -208,6 +214,8 @@ export class MultiSelectComponent implements OnInit, BitFormFieldControl, Contro
|
||||
// TODO: Skipped for signal migration because:
|
||||
// Accessor inputs cannot be migrated as they are too complex.
|
||||
@HostBinding("attr.required")
|
||||
// FIXME(https://bitwarden.atlassian.net/browse/CL-903): Migrate to Signals
|
||||
// eslint-disable-next-line @angular-eslint/prefer-signals
|
||||
@Input()
|
||||
get required() {
|
||||
return this._required ?? this.ngControl?.control?.hasValidator(Validators.required) ?? false;
|
||||
|
||||
Reference in New Issue
Block a user