mirror of
https://github.com/bitwarden/browser.git
synced 2024-09-27 04:03:00 +02:00
55d9ee22ab
* [EC-667] feat: scaffold new select component * [EC-667] feat: sort of working implementation * [EC-667] feat: support for using in forms * [EC-667] feat: add bit-select example to full form * [EC-667] fix: broken aria label connetion * [EC-667] fix: web not building * [EC-667] fix: dropdown getting trapped in dialog * [EC-667] fix: select not emitting correct value * [EC-667] feat: add collection icon to options * [EC-667] feat: add default select placeholder translation * [EC-667] fix: undefined handling * [EC-667] fix: value vs options race condition * [EC-667] feat: remove x and add "no collection" option * [EC-667] chore: add country list disclaimer * chore: clean up comments * [EC-667] chore: cleanup commented import * [EC-667] fix: input text color not applying to single-select
29 lines
606 B
TypeScript
29 lines
606 B
TypeScript
import { coerceBooleanProperty } from "@angular/cdk/coercion";
|
|
import { Component, Input } from "@angular/core";
|
|
|
|
import { Option } from "./option";
|
|
|
|
@Component({
|
|
selector: "bit-option",
|
|
template: `<ng-template><ng-content></ng-content></ng-template>`,
|
|
})
|
|
export class OptionComponent<T = unknown> implements Option<T> {
|
|
@Input()
|
|
icon?: string;
|
|
|
|
@Input()
|
|
value?: T = undefined;
|
|
|
|
@Input()
|
|
label?: string;
|
|
|
|
private _disabled = false;
|
|
@Input()
|
|
get disabled() {
|
|
return this._disabled;
|
|
}
|
|
set disabled(value: boolean | "") {
|
|
this._disabled = coerceBooleanProperty(value);
|
|
}
|
|
}
|