mirror of
https://github.com/bitwarden/browser
synced 2025-12-18 01:03:35 +00:00
Migrate remaining components to standalone in libs/components (#15053)
Migrates the remaining non standalone components from libs/components. Also resolved some linting ignores and applying strict typescript.
This commit is contained in:
@@ -1,18 +1,15 @@
|
||||
import { DIALOG_DATA, DialogModule, DialogRef } from "@angular/cdk/dialog";
|
||||
import { DIALOG_DATA, DialogRef } from "@angular/cdk/dialog";
|
||||
import { Component, Inject } from "@angular/core";
|
||||
import { provideAnimations } from "@angular/platform-browser/animations";
|
||||
import { Meta, StoryObj, moduleMetadata } from "@storybook/angular";
|
||||
|
||||
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
|
||||
|
||||
import { ButtonModule } from "../button";
|
||||
import { IconButtonModule } from "../icon-button";
|
||||
import { SharedModule } from "../shared";
|
||||
import { I18nMockService } from "../utils/i18n-mock.service";
|
||||
|
||||
import { DialogComponent } from "./dialog/dialog.component";
|
||||
import { DialogModule } from "./dialog.module";
|
||||
import { DialogService } from "./dialog.service";
|
||||
import { DialogCloseDirective } from "./directives/dialog-close.directive";
|
||||
import { DialogTitleContainerDirective } from "./directives/dialog-title-container.directive";
|
||||
|
||||
interface Animal {
|
||||
animal: string;
|
||||
@@ -20,7 +17,7 @@ interface Animal {
|
||||
|
||||
@Component({
|
||||
template: `<button bitButton type="button" (click)="openDialog()">Open Dialog</button>`,
|
||||
standalone: false,
|
||||
imports: [ButtonModule],
|
||||
})
|
||||
class StoryDialogComponent {
|
||||
constructor(public dialogService: DialogService) {}
|
||||
@@ -50,7 +47,7 @@ class StoryDialogComponent {
|
||||
</ng-container>
|
||||
</bit-dialog>
|
||||
`,
|
||||
standalone: false,
|
||||
imports: [DialogModule, ButtonModule],
|
||||
})
|
||||
class StoryDialogContentComponent {
|
||||
constructor(
|
||||
@@ -68,17 +65,8 @@ export default {
|
||||
component: StoryDialogComponent,
|
||||
decorators: [
|
||||
moduleMetadata({
|
||||
declarations: [StoryDialogContentComponent],
|
||||
imports: [
|
||||
SharedModule,
|
||||
ButtonModule,
|
||||
DialogModule,
|
||||
IconButtonModule,
|
||||
DialogCloseDirective,
|
||||
DialogComponent,
|
||||
DialogTitleContainerDirective,
|
||||
],
|
||||
providers: [
|
||||
provideAnimations(),
|
||||
DialogService,
|
||||
{
|
||||
provide: I18nService,
|
||||
|
||||
Reference in New Issue
Block a user