mirror of
https://github.com/bitwarden/browser
synced 2025-12-14 23:33:31 +00:00
[CL-221] Add chip-select component (#9021)
--------- Co-authored-by: William Martin <contact@willmartian.com>
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
import { coerceBooleanProperty } from "@angular/cdk/coercion";
|
||||
import { Component, Input } from "@angular/core";
|
||||
import { Component, Input, booleanAttribute } from "@angular/core";
|
||||
|
||||
import { Option } from "./option";
|
||||
|
||||
@@ -11,18 +10,12 @@ export class OptionComponent<T = unknown> implements Option<T> {
|
||||
@Input()
|
||||
icon?: string;
|
||||
|
||||
@Input()
|
||||
value?: T = undefined;
|
||||
@Input({ required: true })
|
||||
value: T;
|
||||
|
||||
@Input()
|
||||
label?: string;
|
||||
@Input({ required: true })
|
||||
label: string;
|
||||
|
||||
private _disabled = false;
|
||||
@Input()
|
||||
get disabled() {
|
||||
return this._disabled;
|
||||
}
|
||||
set disabled(value: boolean | "") {
|
||||
this._disabled = coerceBooleanProperty(value);
|
||||
}
|
||||
@Input({ transform: booleanAttribute })
|
||||
disabled: boolean;
|
||||
}
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
import { TemplateRef } from "@angular/core";
|
||||
|
||||
export interface Option<T> {
|
||||
icon?: string;
|
||||
value?: T;
|
||||
value: T | null;
|
||||
label?: string;
|
||||
content?: TemplateRef<unknown>;
|
||||
disabled?: boolean;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user