1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-06 00:13:28 +00:00

Uif/export switch (#17234)

* fix private variables used in template

* remove module

* fix test import
This commit is contained in:
Bryan Cunningham
2025-11-05 13:28:28 -05:00
committed by GitHub
parent f76d2f36e6
commit 6e97927db6
5 changed files with 5 additions and 13 deletions

View File

@@ -46,3 +46,4 @@ export * from "./tooltip";
export * from "./typography";
export * from "./utils";
export * from "./stepper";
export * from "./switch";

View File

@@ -0,0 +1 @@
export * from "./switch.component";

View File

@@ -6,7 +6,6 @@ import { By } from "@angular/platform-browser";
import { BitLabel } from "../form-control/label.component";
import { SwitchComponent } from "./switch.component";
import { SwitchModule } from "./switch.module";
describe("SwitchComponent", () => {
let fixture: ComponentFixture<TestHostComponent>;
@@ -17,7 +16,7 @@ describe("SwitchComponent", () => {
// eslint-disable-next-line @angular-eslint/prefer-on-push-component-change-detection
@Component({
selector: "test-host",
imports: [FormsModule, BitLabel, ReactiveFormsModule, SwitchModule],
imports: [FormsModule, BitLabel, ReactiveFormsModule, SwitchComponent],
template: `
<form [formGroup]="formObj">
<bit-switch formControlName="switch">

View File

@@ -58,9 +58,9 @@ export class SwitchComponent implements ControlValueAccessor, AfterViewInit {
private readonly hintComponent = contentChild<BitHintComponent>(BitHintComponent);
private disabledReasonTextId = `bit-switch-disabled-text-${nextId++}`;
protected readonly disabledReasonTextId = `bit-switch-disabled-text-${nextId++}`;
private readonly describedByIds = computed(() => {
protected readonly describedByIds = computed(() => {
const ids: string[] = [];
if (this.disabledReasonText() && this.disabled()) {

View File

@@ -1,9 +0,0 @@
import { NgModule } from "@angular/core";
import { SwitchComponent } from "./switch.component";
@NgModule({
imports: [SwitchComponent],
exports: [SwitchComponent],
})
export class SwitchModule {}