mirror of
https://github.com/bitwarden/browser
synced 2025-12-20 02:03:39 +00:00
[PM-10934] Remove last form-field bottom border (#10751)
* match API of new CL FormField component * remove readonly border for additional options component * remove readonly border for last autofill option * remove readonly border for last custom-field form field * remove readonly border for when collection,org or folder is available * add `ReadOnlyCipherCardComponent` to handle readonly border * remove readonly border for the last identity form field * remove readonly border for the last card form field * remove readonly border for the last login form field * remove unneeded true value
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
<bit-card class="[&_bit-form-field:last-of-type]:tw-mb-0">
|
||||
<ng-content></ng-content>
|
||||
</bit-card>
|
||||
@@ -0,0 +1,26 @@
|
||||
import { AfterViewInit, Component, ContentChildren, QueryList } from "@angular/core";
|
||||
|
||||
import { CardComponent, BitFormFieldComponent } from "@bitwarden/components";
|
||||
|
||||
@Component({
|
||||
selector: "read-only-cipher-card",
|
||||
templateUrl: "./read-only-cipher-card.component.html",
|
||||
standalone: true,
|
||||
imports: [CardComponent],
|
||||
})
|
||||
/**
|
||||
* A thin wrapper around the `bit-card` component that disables the bottom border for the last form field.
|
||||
*/
|
||||
export class ReadOnlyCipherCardComponent implements AfterViewInit {
|
||||
@ContentChildren(BitFormFieldComponent) formFields: QueryList<BitFormFieldComponent>;
|
||||
|
||||
ngAfterViewInit(): void {
|
||||
// Disable the bottom border for the last form field
|
||||
if (this.formFields.last) {
|
||||
// Delay model update until next change detection cycle
|
||||
setTimeout(() => {
|
||||
this.formFields.last.disableReadOnlyBorder = true;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user