1
0
mirror of https://github.com/bitwarden/browser synced 2026-03-01 11:01:17 +00:00

Enable directive-class-suffix (#17385)

This commit is contained in:
Oscar Hinton
2025-11-24 18:03:16 +01:00
committed by jaasen-livefront
parent 107f66257c
commit 67af777d76
12 changed files with 28 additions and 14 deletions

View File

@@ -1,11 +1,11 @@
import { NgModule } from "@angular/core";
import { FormControlComponent } from "./form-control.component";
import { BitHintComponent } from "./hint.component";
import { BitHintDirective } from "./hint.directive";
import { BitLabelComponent } from "./label.component";
@NgModule({
imports: [BitLabelComponent, FormControlComponent, BitHintComponent],
exports: [FormControlComponent, BitLabelComponent, BitHintComponent],
imports: [BitLabelComponent, FormControlComponent, BitHintDirective],
exports: [FormControlComponent, BitLabelComponent, BitHintDirective],
})
export class FormControlModule {}

View File

@@ -9,6 +9,6 @@ let nextId = 0;
class: "tw-text-muted tw-font-normal tw-inline-block tw-mt-1 tw-text-xs",
},
})
export class BitHintComponent {
export class BitHintDirective {
@HostBinding() id = `bit-hint-${nextId++}`;
}

View File

@@ -15,7 +15,7 @@ import {
import { I18nPipe } from "@bitwarden/ui-common";
import { BitHintComponent } from "../form-control/hint.component";
import { BitHintDirective } from "../form-control/hint.directive";
import { BitLabelComponent } from "../form-control/label.component";
import { inputBorderClasses } from "../input/input.directive";
@@ -31,7 +31,7 @@ import { BitFormFieldControl } from "./form-field-control";
})
export class BitFormFieldComponent implements AfterContentChecked {
readonly input = contentChild.required(BitFormFieldControl);
readonly hint = contentChild(BitHintComponent);
readonly hint = contentChild(BitHintDirective);
readonly label = contentChild(BitLabelComponent);
readonly prefixContainer = viewChild<ElementRef<HTMLDivElement>>("prefixContainer");

View File

@@ -13,7 +13,7 @@ import { ControlValueAccessor, NG_VALUE_ACCESSOR } from "@angular/forms";
import { AriaDisableDirective } from "../a11y";
import { FormControlModule } from "../form-control/form-control.module";
import { BitHintComponent } from "../form-control/hint.component";
import { BitHintDirective } from "../form-control/hint.directive";
import { BitLabelComponent } from "../form-control/label.component";
let nextId = 0;
@@ -56,7 +56,7 @@ export class SwitchComponent implements ControlValueAccessor, AfterViewInit {
protected readonly disabled = model(false);
protected readonly disabledReasonText = input<string | null>(null);
private readonly hintComponent = contentChild<BitHintComponent>(BitHintComponent);
private readonly hintComponent = contentChild<BitHintDirective>(BitHintDirective);
protected readonly disabledReasonTextId = `bit-switch-disabled-text-${nextId++}`;

View File

@@ -35,7 +35,7 @@ import { TableComponent } from "./table.component";
@Directive({
selector: "[bitRowDef]",
})
export class BitRowDef {
export class BitRowDefDirective {
constructor(public template: TemplateRef<any>) {}
}
@@ -69,7 +69,7 @@ export class TableScrollComponent
/** Optional trackBy function. */
readonly trackBy = input<TrackByFunction<any> | undefined>();
protected readonly rowDef = contentChild(BitRowDef);
protected readonly rowDef = contentChild(BitRowDefDirective);
/**
* Height of the thead element (in pixels).

View File

@@ -5,14 +5,14 @@ import { NgModule } from "@angular/core";
import { CellDirective } from "./cell.directive";
import { RowDirective } from "./row.directive";
import { SortableComponent } from "./sortable.component";
import { BitRowDef, TableScrollComponent } from "./table-scroll.component";
import { BitRowDefDirective, TableScrollComponent } from "./table-scroll.component";
import { TableBodyDirective, TableComponent } from "./table.component";
@NgModule({
imports: [
CommonModule,
ScrollingModule,
BitRowDef,
BitRowDefDirective,
CellDirective,
RowDirective,
SortableComponent,
@@ -21,7 +21,7 @@ import { TableBodyDirective, TableComponent } from "./table.component";
TableScrollComponent,
],
exports: [
BitRowDef,
BitRowDefDirective,
CellDirective,
RowDirective,
SortableComponent,