mirror of
https://github.com/bitwarden/browser
synced 2026-01-06 18:43:25 +00:00
[CL-135] Migrate component library to standalone components (#12389)
* Migrate component library to standalone components * Fix tests
This commit is contained in:
@@ -1,11 +1,13 @@
|
||||
// FIXME: Update this file to be type safe and remove this and next line
|
||||
// @ts-strict-ignore
|
||||
import { TemplatePortal } from "@angular/cdk/portal";
|
||||
import { TemplatePortal, CdkPortalOutlet } from "@angular/cdk/portal";
|
||||
import { Component, HostBinding, Input } from "@angular/core";
|
||||
|
||||
@Component({
|
||||
selector: "bit-tab-body",
|
||||
templateUrl: "tab-body.component.html",
|
||||
standalone: true,
|
||||
imports: [CdkPortalOutlet],
|
||||
})
|
||||
export class TabBodyComponent {
|
||||
private _firstRender: boolean;
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
// @ts-strict-ignore
|
||||
import { FocusKeyManager } from "@angular/cdk/a11y";
|
||||
import { coerceNumberProperty } from "@angular/cdk/coercion";
|
||||
import { CommonModule } from "@angular/common";
|
||||
import {
|
||||
AfterContentChecked,
|
||||
AfterContentInit,
|
||||
@@ -17,8 +18,11 @@ import {
|
||||
} from "@angular/core";
|
||||
import { Subject, takeUntil } from "rxjs";
|
||||
|
||||
import { TabHeaderComponent } from "../shared/tab-header.component";
|
||||
import { TabListContainerDirective } from "../shared/tab-list-container.directive";
|
||||
import { TabListItemDirective } from "../shared/tab-list-item.directive";
|
||||
|
||||
import { TabBodyComponent } from "./tab-body.component";
|
||||
import { TabComponent } from "./tab.component";
|
||||
|
||||
/** Used to generate unique ID's for each tab component */
|
||||
@@ -27,6 +31,14 @@ let nextId = 0;
|
||||
@Component({
|
||||
selector: "bit-tab-group",
|
||||
templateUrl: "./tab-group.component.html",
|
||||
standalone: true,
|
||||
imports: [
|
||||
CommonModule,
|
||||
TabHeaderComponent,
|
||||
TabListContainerDirective,
|
||||
TabListItemDirective,
|
||||
TabBodyComponent,
|
||||
],
|
||||
})
|
||||
export class TabGroupComponent
|
||||
implements AfterContentChecked, AfterContentInit, AfterViewInit, OnDestroy
|
||||
|
||||
@@ -16,6 +16,7 @@ import { Directive, TemplateRef } from "@angular/core";
|
||||
*/
|
||||
@Directive({
|
||||
selector: "[bitTabLabel]",
|
||||
standalone: true,
|
||||
})
|
||||
export class TabLabelDirective {
|
||||
constructor(public templateRef: TemplateRef<unknown>) {}
|
||||
|
||||
@@ -19,6 +19,7 @@ import { TabLabelDirective } from "./tab-label.directive";
|
||||
host: {
|
||||
role: "tabpanel",
|
||||
},
|
||||
standalone: true,
|
||||
})
|
||||
export class TabComponent implements OnInit {
|
||||
@Input() disabled = false;
|
||||
|
||||
Reference in New Issue
Block a user