1
0
mirror of https://github.com/bitwarden/browser synced 2026-02-05 11:13:44 +00:00
Files
browser/libs/components/src/table/row.directive.ts
Oscar Hinton 5a582dfc6f [CL-135] Migrate component library to standalone components (#12389)
* Migrate component library to standalone components

* Fix tests
2024-12-17 17:29:48 -05:00

35 lines
777 B
TypeScript

import { Directive, HostBinding, Input } from "@angular/core";
@Directive({
selector: "tr[bitRow]",
standalone: true,
})
export class RowDirective {
@Input() alignContent: "top" | "middle" | "bottom" | "baseline" = "middle";
get alignmentClass(): string {
switch (this.alignContent) {
case "top":
return "tw-align-top";
case "middle":
return "tw-align-middle";
case "bottom":
return "tw-align-bottom";
default:
return "tw-align-baseline";
}
}
@HostBinding("class") get classList() {
return [
"tw-border-0",
"tw-border-b",
"tw-border-secondary-300",
"tw-border-solid",
"hover:tw-bg-background-alt",
"last:tw-border-0",
this.alignmentClass,
];
}
}