mirror of
https://github.com/bitwarden/browser
synced 2025-12-11 05:43:41 +00:00
Uif/export switch (#17234)
* fix private variables used in template * remove module * fix test import
This commit is contained in:
@@ -46,3 +46,4 @@ export * from "./tooltip";
|
|||||||
export * from "./typography";
|
export * from "./typography";
|
||||||
export * from "./utils";
|
export * from "./utils";
|
||||||
export * from "./stepper";
|
export * from "./stepper";
|
||||||
|
export * from "./switch";
|
||||||
|
|||||||
1
libs/components/src/switch/index.ts
Normal file
1
libs/components/src/switch/index.ts
Normal file
@@ -0,0 +1 @@
|
|||||||
|
export * from "./switch.component";
|
||||||
@@ -6,7 +6,6 @@ import { By } from "@angular/platform-browser";
|
|||||||
import { BitLabel } from "../form-control/label.component";
|
import { BitLabel } from "../form-control/label.component";
|
||||||
|
|
||||||
import { SwitchComponent } from "./switch.component";
|
import { SwitchComponent } from "./switch.component";
|
||||||
import { SwitchModule } from "./switch.module";
|
|
||||||
|
|
||||||
describe("SwitchComponent", () => {
|
describe("SwitchComponent", () => {
|
||||||
let fixture: ComponentFixture<TestHostComponent>;
|
let fixture: ComponentFixture<TestHostComponent>;
|
||||||
@@ -17,7 +16,7 @@ describe("SwitchComponent", () => {
|
|||||||
// eslint-disable-next-line @angular-eslint/prefer-on-push-component-change-detection
|
// eslint-disable-next-line @angular-eslint/prefer-on-push-component-change-detection
|
||||||
@Component({
|
@Component({
|
||||||
selector: "test-host",
|
selector: "test-host",
|
||||||
imports: [FormsModule, BitLabel, ReactiveFormsModule, SwitchModule],
|
imports: [FormsModule, BitLabel, ReactiveFormsModule, SwitchComponent],
|
||||||
template: `
|
template: `
|
||||||
<form [formGroup]="formObj">
|
<form [formGroup]="formObj">
|
||||||
<bit-switch formControlName="switch">
|
<bit-switch formControlName="switch">
|
||||||
|
|||||||
@@ -58,9 +58,9 @@ export class SwitchComponent implements ControlValueAccessor, AfterViewInit {
|
|||||||
|
|
||||||
private readonly hintComponent = contentChild<BitHintComponent>(BitHintComponent);
|
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[] = [];
|
const ids: string[] = [];
|
||||||
|
|
||||||
if (this.disabledReasonText() && this.disabled()) {
|
if (this.disabledReasonText() && this.disabled()) {
|
||||||
|
|||||||
@@ -1,9 +0,0 @@
|
|||||||
import { NgModule } from "@angular/core";
|
|
||||||
|
|
||||||
import { SwitchComponent } from "./switch.component";
|
|
||||||
|
|
||||||
@NgModule({
|
|
||||||
imports: [SwitchComponent],
|
|
||||||
exports: [SwitchComponent],
|
|
||||||
})
|
|
||||||
export class SwitchModule {}
|
|
||||||
Reference in New Issue
Block a user