mirror of
https://github.com/bitwarden/browser
synced 2025-12-30 07:03:26 +00:00
20 lines
669 B
TypeScript
20 lines
669 B
TypeScript
import { Component, booleanAttribute, input } from "@angular/core";
|
|
|
|
import { MappedOptionComponent } from "./option";
|
|
|
|
// 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-option",
|
|
template: `<ng-template><ng-content></ng-content></ng-template>`,
|
|
})
|
|
export class OptionComponent<T = unknown> implements MappedOptionComponent<T> {
|
|
readonly icon = input<string>();
|
|
|
|
readonly value = input.required<T>();
|
|
|
|
readonly label = input.required<string>();
|
|
|
|
readonly disabled = input(undefined, { transform: booleanAttribute });
|
|
}
|