1
0
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:
Nick Krantz
2024-09-04 10:50:34 -05:00
committed by GitHub
parent 192fd885d5
commit 3e9fb2009e
13 changed files with 67 additions and 15 deletions

View File

@@ -0,0 +1,3 @@
<bit-card class="[&_bit-form-field:last-of-type]:tw-mb-0">
<ng-content></ng-content>
</bit-card>

View File

@@ -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;
});
}
}
}