mirror of
https://github.com/bitwarden/browser
synced 2025-12-18 17:23:37 +00:00
Move to libs
This commit is contained in:
28
libs/components/src/form-field/prefix.directive.ts
Normal file
28
libs/components/src/form-field/prefix.directive.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
import { Directive, HostBinding, Input } from "@angular/core";
|
||||
|
||||
export const PrefixClasses = [
|
||||
"tw-block",
|
||||
"tw-px-3",
|
||||
"tw-py-1.5",
|
||||
"tw-bg-background-alt",
|
||||
"tw-border",
|
||||
"tw-border-solid",
|
||||
"tw-border-secondary-500",
|
||||
"tw-text-muted",
|
||||
"tw-rounded",
|
||||
];
|
||||
|
||||
@Directive({
|
||||
selector: "[bitPrefix]",
|
||||
})
|
||||
export class BitPrefixDirective {
|
||||
@HostBinding("class") @Input() get classList() {
|
||||
return PrefixClasses.concat([
|
||||
"tw-border-r-0",
|
||||
"tw-rounded-r-none",
|
||||
!this.first ? "tw-rounded-l-none" : "",
|
||||
]).filter((c) => c != "");
|
||||
}
|
||||
|
||||
@Input() first = false;
|
||||
}
|
||||
Reference in New Issue
Block a user