From d1fe72a4ab37bd87836e8a2ad03c6c66999c03de Mon Sep 17 00:00:00 2001
From: cyprain-okeke <108260115+cyprain-okeke@users.noreply.github.com>
Date: Tue, 17 Dec 2024 20:34:30 +0100
Subject: [PATCH 01/54] Fix the maxlength org name bug (#12397)
---
apps/web/src/locales/en/messages.json | 3 +++
.../providers/clients/create-client-dialog.component.html | 8 ++++++++
.../providers/clients/create-client-dialog.component.ts | 2 +-
3 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/apps/web/src/locales/en/messages.json b/apps/web/src/locales/en/messages.json
index abc3aa3a1d7..36143682fa2 100644
--- a/apps/web/src/locales/en/messages.json
+++ b/apps/web/src/locales/en/messages.json
@@ -9969,5 +9969,8 @@
},
"domainClaimed": {
"message": "Domain claimed"
+ },
+ "organizationNameMaxLength": {
+ "message": "Organization name cannot exceed 50 characters."
}
}
diff --git a/bitwarden_license/bit-web/src/app/billing/providers/clients/create-client-dialog.component.html b/bitwarden_license/bit-web/src/app/billing/providers/clients/create-client-dialog.component.html
index a08f5710f1e..78f2cb41bef 100644
--- a/bitwarden_license/bit-web/src/app/billing/providers/clients/create-client-dialog.component.html
+++ b/bitwarden_license/bit-web/src/app/billing/providers/clients/create-client-dialog.component.html
@@ -43,6 +43,14 @@
{{ "organizationName" | i18n }}
+
+ {{ "organizationNameMaxLength" | i18n }}
+
diff --git a/bitwarden_license/bit-web/src/app/billing/providers/clients/create-client-dialog.component.ts b/bitwarden_license/bit-web/src/app/billing/providers/clients/create-client-dialog.component.ts
index 18910491a0c..2a27b1b32f3 100644
--- a/bitwarden_license/bit-web/src/app/billing/providers/clients/create-client-dialog.component.ts
+++ b/bitwarden_license/bit-web/src/app/billing/providers/clients/create-client-dialog.component.ts
@@ -47,7 +47,7 @@ export class CreateClientDialogComponent implements OnInit {
protected discountPercentage: number;
protected formGroup = new FormGroup({
clientOwnerEmail: new FormControl("", [Validators.required, Validators.email]),
- organizationName: new FormControl("", [Validators.required]),
+ organizationName: new FormControl("", [Validators.required, Validators.maxLength(50)]),
seats: new FormControl(null, [Validators.required, Validators.min(1)]),
});
protected loading = true;
From e2e9a7c345e0594efbf258f17f76d9dd6ecf83ae Mon Sep 17 00:00:00 2001
From: Daniel James Smith <2670567+djsmith85@users.noreply.github.com>
Date: Tue, 17 Dec 2024 20:51:58 +0100
Subject: [PATCH 02/54] [PM-15483] PasswordXP-CSV-Importer: Add support for
German and Dutch headers (#12216)
* Add tests to verify importing German and Dutch headers work
* Add method to translate the headers from (German/Dutch into English) while the CSV data is being parsed
* Report "importFormatError" when header translation did not work, instead of a generic undefined error (startsWith)
* Move passwordxp-csv-importer into a dedicated folder
* Introduce files with the language header translations
---------
Co-authored-by: Daniel James Smith
---
.../spec/passwordxp-csv-importer.spec.ts | 80 ++++++++++++-------
.../test-data/passwordxp-csv/dutch-headers.ts | 7 ++
.../passwordxp-csv/german-headers.ts | 7 ++
libs/importer/src/importers/index.ts | 2 +-
.../importers/passsordxp/dutch-csv-headers.ts | 10 +++
.../passsordxp/german-csv-headers.ts | 11 +++
.../passwordxp-csv-importer.ts | 39 +++++++--
7 files changed, 117 insertions(+), 39 deletions(-)
create mode 100644 libs/importer/spec/test-data/passwordxp-csv/dutch-headers.ts
create mode 100644 libs/importer/spec/test-data/passwordxp-csv/german-headers.ts
create mode 100644 libs/importer/src/importers/passsordxp/dutch-csv-headers.ts
create mode 100644 libs/importer/src/importers/passsordxp/german-csv-headers.ts
rename libs/importer/src/importers/{ => passsordxp}/passwordxp-csv-importer.ts (68%)
diff --git a/libs/importer/spec/passwordxp-csv-importer.spec.ts b/libs/importer/spec/passwordxp-csv-importer.spec.ts
index f707b1138c5..fda323450c6 100644
--- a/libs/importer/spec/passwordxp-csv-importer.spec.ts
+++ b/libs/importer/spec/passwordxp-csv-importer.spec.ts
@@ -3,10 +3,46 @@ import { CipherType } from "@bitwarden/common/vault/enums";
import { PasswordXPCsvImporter } from "../src/importers";
import { ImportResult } from "../src/models/import-result";
+import { dutchHeaders } from "./test-data/passwordxp-csv/dutch-headers";
+import { germanHeaders } from "./test-data/passwordxp-csv/german-headers";
import { noFolder } from "./test-data/passwordxp-csv/no-folder.csv";
import { withFolders } from "./test-data/passwordxp-csv/passwordxp-with-folders.csv";
import { withoutFolders } from "./test-data/passwordxp-csv/passwordxp-without-folders.csv";
+async function importLoginWithCustomFields(importer: PasswordXPCsvImporter, csvData: string) {
+ const result: ImportResult = await importer.parse(csvData);
+ expect(result.success).toBe(true);
+
+ const cipher = result.ciphers.shift();
+ expect(cipher.type).toBe(CipherType.Login);
+ expect(cipher.name).toBe("Title2");
+ expect(cipher.notes).toBe("Test Notes");
+ expect(cipher.login.username).toBe("Username2");
+ expect(cipher.login.password).toBe("12345678");
+ expect(cipher.login.uris[0].uri).toBe("http://URL2.com");
+
+ expect(cipher.fields.length).toBe(5);
+ let field = cipher.fields.shift();
+ expect(field.name).toBe("Account");
+ expect(field.value).toBe("Account2");
+
+ field = cipher.fields.shift();
+ expect(field.name).toBe("Modified");
+ expect(field.value).toBe("27-3-2024 08:11:21");
+
+ field = cipher.fields.shift();
+ expect(field.name).toBe("Created");
+ expect(field.value).toBe("27-3-2024 08:11:21");
+
+ field = cipher.fields.shift();
+ expect(field.name).toBe("Expire on");
+ expect(field.value).toBe("27-5-2024 08:11:21");
+
+ field = cipher.fields.shift();
+ expect(field.name).toBe("Modified by");
+ expect(field.value).toBe("someone");
+}
+
describe("PasswordXPCsvImporter", () => {
let importer: PasswordXPCsvImporter;
@@ -20,6 +56,12 @@ describe("PasswordXPCsvImporter", () => {
expect(result.success).toBe(false);
});
+ it("should return success false if CSV headers did not get translated", async () => {
+ const data = germanHeaders.replace("Titel;", "UnknownTitle;");
+ const result: ImportResult = await importer.parse(data);
+ expect(result.success).toBe(false);
+ });
+
it("should skip rows starting with >>>", async () => {
const result: ImportResult = await importer.parse(noFolder);
expect(result.success).toBe(true);
@@ -61,38 +103,16 @@ describe("PasswordXPCsvImporter", () => {
expect(cipher.login.uris[0].uri).toBe("http://test");
});
- it("should parse CSV data and import unmapped columns as custom fields", async () => {
- const result: ImportResult = await importer.parse(withoutFolders);
- expect(result.success).toBe(true);
+ it("should parse CSV data with English headers and import unmapped columns as custom fields", async () => {
+ await importLoginWithCustomFields(importer, withoutFolders);
+ });
- const cipher = result.ciphers.shift();
- expect(cipher.type).toBe(CipherType.Login);
- expect(cipher.name).toBe("Title2");
- expect(cipher.notes).toBe("Test Notes");
- expect(cipher.login.username).toBe("Username2");
- expect(cipher.login.password).toBe("12345678");
- expect(cipher.login.uris[0].uri).toBe("http://URL2.com");
+ it("should parse CSV data with German headers and import unmapped columns as custom fields", async () => {
+ await importLoginWithCustomFields(importer, germanHeaders);
+ });
- expect(cipher.fields.length).toBe(5);
- let field = cipher.fields.shift();
- expect(field.name).toBe("Account");
- expect(field.value).toBe("Account2");
-
- field = cipher.fields.shift();
- expect(field.name).toBe("Modified");
- expect(field.value).toBe("27-3-2024 08:11:21");
-
- field = cipher.fields.shift();
- expect(field.name).toBe("Created");
- expect(field.value).toBe("27-3-2024 08:11:21");
-
- field = cipher.fields.shift();
- expect(field.name).toBe("Expire on");
- expect(field.value).toBe("27-5-2024 08:11:21");
-
- field = cipher.fields.shift();
- expect(field.name).toBe("Modified by");
- expect(field.value).toBe("someone");
+ it("should parse CSV data with Dutch headers and import unmapped columns as custom fields", async () => {
+ await importLoginWithCustomFields(importer, dutchHeaders);
});
it("should parse CSV data with folders and assign items to them", async () => {
diff --git a/libs/importer/spec/test-data/passwordxp-csv/dutch-headers.ts b/libs/importer/spec/test-data/passwordxp-csv/dutch-headers.ts
new file mode 100644
index 00000000000..9cab04f1e6d
--- /dev/null
+++ b/libs/importer/spec/test-data/passwordxp-csv/dutch-headers.ts
@@ -0,0 +1,7 @@
+export const dutchHeaders = `Titel;Gebruikersnaam;Account;URL;Wachtwoord;Gewijzigd;Gemaakt;Verloopt op;Beschrijving;Gewijzigd door
+>>>
+Title2;Username2;Account2;http://URL2.com;12345678;27-3-2024 08:11:21;27-3-2024 08:11:21;27-5-2024 08:11:21;Test Notes;someone
+Title Test 1;Username1;Account1;http://URL1.com;Password1;27-3-2024 08:10:52;27-3-2024 08:10:52;;Test Notes 2;
+Certificate 1;;;;;27-3-2024 10:22:39;27-3-2024 10:22:39;;Test Notes Certicate 1;
+test;testtest;;http://test;test;27-3-2024 12:36:59;27-3-2024 12:36:59;;Test Notes 3;
+`;
diff --git a/libs/importer/spec/test-data/passwordxp-csv/german-headers.ts b/libs/importer/spec/test-data/passwordxp-csv/german-headers.ts
new file mode 100644
index 00000000000..a6ac21c76d6
--- /dev/null
+++ b/libs/importer/spec/test-data/passwordxp-csv/german-headers.ts
@@ -0,0 +1,7 @@
+export const germanHeaders = `Titel;Benutzername;Konto;URL;Passwort;Geändert am;Erstellt am;Läuft ab am;Beschreibung;Geändert von
+>>>
+Title2;Username2;Account2;http://URL2.com;12345678;27-3-2024 08:11:21;27-3-2024 08:11:21;27-5-2024 08:11:21;Test Notes;someone
+Title Test 1;Username1;Account1;http://URL1.com;Password1;27-3-2024 08:10:52;27-3-2024 08:10:52;;Test Notes 2;
+Certificate 1;;;;;27-3-2024 10:22:39;27-3-2024 10:22:39;;Test Notes Certicate 1;
+test;testtest;;http://test;test;27-3-2024 12:36:59;27-3-2024 12:36:59;;Test Notes 3;
+`;
diff --git a/libs/importer/src/importers/index.ts b/libs/importer/src/importers/index.ts
index 19b22cfa80d..1ba3a0d9eb8 100644
--- a/libs/importer/src/importers/index.ts
+++ b/libs/importer/src/importers/index.ts
@@ -45,7 +45,7 @@ export { PasswordBossJsonImporter } from "./passwordboss-json-importer";
export { PasswordDragonXmlImporter } from "./passworddragon-xml-importer";
export { PasswordSafeXmlImporter } from "./passwordsafe-xml-importer";
export { PasswordWalletTxtImporter } from "./passwordwallet-txt-importer";
-export { PasswordXPCsvImporter } from "./passwordxp-csv-importer";
+export { PasswordXPCsvImporter } from "./passsordxp/passwordxp-csv-importer";
export { ProtonPassJsonImporter } from "./protonpass/protonpass-json-importer";
export { PsonoJsonImporter } from "./psono/psono-json-importer";
export { RememBearCsvImporter } from "./remembear-csv-importer";
diff --git a/libs/importer/src/importers/passsordxp/dutch-csv-headers.ts b/libs/importer/src/importers/passsordxp/dutch-csv-headers.ts
new file mode 100644
index 00000000000..7f9c219de56
--- /dev/null
+++ b/libs/importer/src/importers/passsordxp/dutch-csv-headers.ts
@@ -0,0 +1,10 @@
+export const dutchHeaderTranslations: { [key: string]: string } = {
+ Titel: "Title",
+ Gebruikersnaam: "Username",
+ Wachtwoord: "Password",
+ Gewijzigd: "Modified",
+ Gemaakt: "Created",
+ "Verloopt op": "Expire on",
+ Beschrijving: "Description",
+ "Gewijzigd door": "Modified by",
+};
diff --git a/libs/importer/src/importers/passsordxp/german-csv-headers.ts b/libs/importer/src/importers/passsordxp/german-csv-headers.ts
new file mode 100644
index 00000000000..584ad0badca
--- /dev/null
+++ b/libs/importer/src/importers/passsordxp/german-csv-headers.ts
@@ -0,0 +1,11 @@
+export const germanHeaderTranslations: { [key: string]: string } = {
+ Titel: "Title",
+ Benutzername: "Username",
+ Konto: "Account",
+ Passwort: "Password",
+ "Geändert am": "Modified",
+ "Erstellt am": "Created",
+ "Läuft ab am": "Expire on",
+ Beschreibung: "Description",
+ "Geändert von": "Modified by",
+};
diff --git a/libs/importer/src/importers/passwordxp-csv-importer.ts b/libs/importer/src/importers/passsordxp/passwordxp-csv-importer.ts
similarity index 68%
rename from libs/importer/src/importers/passwordxp-csv-importer.ts
rename to libs/importer/src/importers/passsordxp/passwordxp-csv-importer.ts
index 461432e98d4..226a284ec91 100644
--- a/libs/importer/src/importers/passwordxp-csv-importer.ts
+++ b/libs/importer/src/importers/passsordxp/passwordxp-csv-importer.ts
@@ -1,12 +1,28 @@
import { Utils } from "@bitwarden/common/platform/misc/utils";
import { CipherView } from "@bitwarden/common/vault/models/view/cipher.view";
-import { ImportResult } from "../models/import-result";
-
-import { BaseImporter } from "./base-importer";
-import { Importer } from "./importer";
+import { ImportResult } from "../../models/import-result";
+import { BaseImporter } from "../base-importer";
+import { Importer } from "../importer";
const _mappedColumns = new Set(["Title", "Username", "URL", "Password", "Description"]);
+import { dutchHeaderTranslations } from "./dutch-csv-headers";
+import { germanHeaderTranslations } from "./german-csv-headers";
+
+/* Translates the headers from non-English to English
+ * This is necessary because the parser only maps English headers to ciphers
+ * Currently only supports German and Dutch translations
+ */
+function translateIntoEnglishHeaders(header: string): string {
+ const translations: { [key: string]: string } = {
+ // The header column 'User name' is parsed by the parser, but cannot be used as a variable. This converts it to a valid variable name, prior to parsing.
+ "User name": "Username",
+ ...germanHeaderTranslations,
+ ...dutchHeaderTranslations,
+ };
+
+ return translations[header] || header;
+}
/**
* PasswordXP CSV importer
@@ -17,15 +33,22 @@ export class PasswordXPCsvImporter extends BaseImporter implements Importer {
* @param data
*/
parse(data: string): Promise {
- // The header column 'User name' is parsed by the parser, but cannot be used as a variable. This converts it to a valid variable name, prior to parsing.
- data = data.replace(";User name;", ";Username;");
-
const result = new ImportResult();
- const results = this.parseCsv(data, true, { skipEmptyLines: true });
+ const results = this.parseCsv(data, true, {
+ skipEmptyLines: true,
+ transformHeader: translateIntoEnglishHeaders,
+ });
if (results == null) {
result.success = false;
return Promise.resolve(result);
}
+
+ // If the first row (header check) does not contain the column "Title", then the data is invalid (no translation found)
+ if (!results[0].Title) {
+ result.success = false;
+ return Promise.resolve(result);
+ }
+
let currentFolderName = "";
results.forEach((row) => {
// Skip rows starting with '>>>' as they indicate items following have no folder assigned to them
From c3f58b2e70e3576dfa0a5634086d10a368760ce6 Mon Sep 17 00:00:00 2001
From: Evan Bassler
Date: Tue, 17 Dec 2024 13:55:28 -0600
Subject: [PATCH 03/54] fix large icon (#11896)
Co-authored-by: Evan Bassler
Co-authored-by: Matt Bishop
---
.../src/autofill/popup/settings/notifications.component.html | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/apps/browser/src/autofill/popup/settings/notifications.component.html b/apps/browser/src/autofill/popup/settings/notifications.component.html
index 86fe4923df8..c6446012d0c 100644
--- a/apps/browser/src/autofill/popup/settings/notifications.component.html
+++ b/apps/browser/src/autofill/popup/settings/notifications.component.html
@@ -50,7 +50,7 @@
{{ "excludedDomains" | i18n }}
-
+
From ac13cf7ce6fb23e1a81ead38008e4011e5217c5b Mon Sep 17 00:00:00 2001
From: rr-bw <102181210+rr-bw@users.noreply.github.com>
Date: Tue, 17 Dec 2024 12:48:37 -0800
Subject: [PATCH 04/54] feat(auth): [PM-15945] Add logout option to TDE
approval page (#12445)
This PR adds a logout option to the TDE approval screen. A TDE user on this page cannot use the "Back" button or click the Bitwarden logo to navigate back to `/` because the user is currently authenticated, which means that navigating to the `/` route would activate the `redirectGuard` and simply route the user back to `/login-initiated`. So we must log the user out first before routing.
Feature Flags: `UnauthenticatedExtensionUIRefresh` ON
---
.../login-decryption-options.component.html | 4 ++++
.../login-decryption-options.component.ts | 16 ++++++++++++++++
2 files changed, 20 insertions(+)
diff --git a/libs/auth/src/angular/login-decryption-options/login-decryption-options.component.html b/libs/auth/src/angular/login-decryption-options/login-decryption-options.component.html
index cb340f646f1..b3d218389bf 100644
--- a/libs/auth/src/angular/login-decryption-options/login-decryption-options.component.html
+++ b/libs/auth/src/angular/login-decryption-options/login-decryption-options.component.html
@@ -56,5 +56,9 @@
>
{{ "requestAdminApproval" | i18n }}
+
+
diff --git a/libs/auth/src/angular/login-decryption-options/login-decryption-options.component.ts b/libs/auth/src/angular/login-decryption-options/login-decryption-options.component.ts
index 070debf2205..5600077c363 100644
--- a/libs/auth/src/angular/login-decryption-options/login-decryption-options.component.ts
+++ b/libs/auth/src/angular/login-decryption-options/login-decryption-options.component.ts
@@ -30,6 +30,7 @@ import {
AsyncActionsModule,
ButtonModule,
CheckboxModule,
+ DialogService,
FormFieldModule,
ToastService,
TypographyModule,
@@ -90,6 +91,7 @@ export class LoginDecryptionOptionsComponent implements OnInit {
private apiService: ApiService,
private destroyRef: DestroyRef,
private deviceTrustService: DeviceTrustServiceAbstraction,
+ private dialogService: DialogService,
private formBuilder: FormBuilder,
private i18nService: I18nService,
private keyService: KeyService,
@@ -298,4 +300,18 @@ export class LoginDecryptionOptionsComponent implements OnInit {
this.loginEmailService.setLoginEmail(this.email);
await this.router.navigate(["/admin-approval-requested"]);
}
+
+ async logOut() {
+ const confirmed = await this.dialogService.openSimpleDialog({
+ title: { key: "logOut" },
+ content: { key: "logOutConfirmation" },
+ acceptButtonText: { key: "logOut" },
+ type: "warning",
+ });
+
+ const userId = (await firstValueFrom(this.accountService.activeAccount$))?.id;
+ if (confirmed) {
+ this.messagingService.send("logout", { userId: userId });
+ }
+ }
}
From 5a582dfc6f7311373e7d58034192a76fade3bb0b Mon Sep 17 00:00:00 2001
From: Oscar Hinton
Date: Tue, 17 Dec 2024 23:29:48 +0100
Subject: [PATCH 05/54] [CL-135] Migrate component library to standalone
components (#12389)
* Migrate component library to standalone components
* Fix tests
---
.../navigation-switcher.component.spec.ts | 11 +++-----
.../password-health.component.spec.ts | 3 +--
.../src/async-actions/async-actions.module.ts | 5 +---
.../src/async-actions/bit-action.directive.ts | 1 +
.../src/async-actions/bit-submit.directive.ts | 1 +
.../async-actions/form-button.directive.ts | 1 +
.../components/src/avatar/avatar.component.ts | 3 +++
libs/components/src/avatar/avatar.module.ts | 4 +--
.../src/badge-list/badge-list.component.ts | 6 ++++-
.../src/badge-list/badge-list.module.ts | 6 +----
libs/components/src/badge/badge.directive.ts | 1 +
libs/components/src/badge/badge.module.ts | 4 +--
.../src/banner/banner.component.spec.ts | 4 +--
.../components/src/banner/banner.component.ts | 6 +++++
libs/components/src/banner/banner.module.ts | 7 +----
.../src/breadcrumbs/breadcrumb.component.ts | 3 +++
.../src/breadcrumbs/breadcrumbs.component.ts | 8 ++++++
.../src/breadcrumbs/breadcrumbs.module.ts | 9 +------
.../components/src/button/button.component.ts | 3 +++
libs/components/src/button/button.module.ts | 4 +--
.../src/checkbox/checkbox.component.ts | 1 +
.../src/checkbox/checkbox.module.ts | 7 +----
.../color-password.component.ts | 3 +++
.../color-password/color-password.module.ts | 4 +--
libs/components/src/dialog/dialog.module.ts | 23 ++--------------
.../src/dialog/dialog/dialog.component.ts | 15 +++++++++++
.../directives/dialog-close.directive.ts | 1 +
.../dialog-title-container.directive.ts | 1 +
.../simple-configurable-dialog.component.ts | 17 +++++++++++-
.../simple-dialog/simple-dialog.component.ts | 10 ++++++-
.../form-control/form-control.component.ts | 6 +++++
.../src/form-control/form-control.module.ts | 6 +----
.../src/form-control/hint.component.ts | 1 +
.../src/form-field/error-summary.component.ts | 5 ++++
.../src/form-field/error.component.ts | 1 +
.../src/form-field/form-field.component.ts | 4 +++
.../src/form-field/form-field.module.ts | 17 ++++++------
.../password-input-toggle.directive.ts | 1 +
.../src/form-field/prefix.directive.ts | 1 +
.../src/form-field/suffix.directive.ts | 1 +
.../src/icon-button/icon-button.component.ts | 3 +++
.../src/icon-button/icon-button.module.ts | 4 +--
libs/components/src/icon/icon.component.ts | 1 +
.../src/icon/icon.components.spec.ts | 2 +-
libs/components/src/icon/icon.module.ts | 4 +--
libs/components/src/input/input.directive.ts | 1 +
libs/components/src/input/input.module.ts | 4 +--
libs/components/src/link/link.directive.ts | 2 ++
libs/components/src/link/link.module.ts | 4 +--
.../src/menu/menu-divider.component.ts | 1 +
.../src/menu/menu-item.directive.ts | 3 +++
.../src/menu/menu-trigger-for.directive.ts | 1 +
libs/components/src/menu/menu.component.ts | 4 ++-
libs/components/src/menu/menu.module.ts | 6 +----
libs/components/src/menu/menu.stories.ts | 16 +++---------
.../multi-select/multi-select.component.ts | 15 +++++++++--
.../src/multi-select/multi-select.module.ts | 9 +------
.../src/navigation/nav-divider.component.ts | 3 +++
.../src/navigation/nav-group.component.ts | 12 ++++++++-
.../src/navigation/nav-item.component.ts | 14 ++++++++--
.../src/navigation/nav-logo.component.ts | 6 +++++
.../src/navigation/navigation.module.ts | 19 --------------
.../src/navigation/side-nav.component.ts | 8 ++++++
.../src/no-items/no-items.component.ts | 3 +++
.../src/no-items/no-items.module.ts | 6 +----
.../src/progress/progress.component.ts | 3 +++
.../src/progress/progress.module.ts | 4 +--
.../radio-button/radio-button.component.ts | 5 ++++
.../src/radio-button/radio-button.module.ts | 5 +---
.../src/radio-button/radio-group.component.ts | 4 +++
.../src/radio-button/radio-input.component.ts | 1 +
.../components/src/search/search.component.ts | 11 +++++++-
libs/components/src/search/search.module.ts | 7 +----
.../components/src/select/option.component.ts | 1 +
.../components/src/select/select.component.ts | 13 ++++++++--
libs/components/src/select/select.module.ts | 6 +----
libs/components/src/shared/i18n.pipe.ts | 1 +
libs/components/src/shared/shared.module.ts | 3 +--
libs/components/src/table/cell.directive.ts | 1 +
libs/components/src/table/row.directive.ts | 1 +
.../src/table/sortable.component.ts | 3 +++
.../src/table/table-scroll.component.ts | 17 ++++++++++++
libs/components/src/table/table.component.ts | 4 +++
libs/components/src/table/table.module.ts | 6 +++--
.../src/tabs/shared/tab-header.component.ts | 1 +
.../shared/tab-list-container.directive.ts | 1 +
.../tabs/shared/tab-list-item.directive.ts | 5 +++-
.../src/tabs/tab-group/tab-body.component.ts | 4 ++-
.../src/tabs/tab-group/tab-group.component.ts | 12 +++++++++
.../src/tabs/tab-group/tab-label.directive.ts | 1 +
.../src/tabs/tab-group/tab.component.ts | 1 +
.../tabs/tab-nav-bar/tab-link.component.ts | 4 ++-
.../tabs/tab-nav-bar/tab-nav-bar.component.ts | 5 ++++
libs/components/src/tabs/tabs.module.ts | 26 +++++++------------
libs/components/src/toast/toast.module.ts | 5 +---
libs/components/src/toast/toastr.component.ts | 4 +++
.../toggle-group/toggle-group.component.ts | 1 +
.../src/toggle-group/toggle-group.module.ts | 6 +----
.../src/toggle-group/toggle.component.ts | 3 +++
.../src/typography/typography.directive.ts | 1 +
.../src/typography/typography.module.ts | 4 +--
101 files changed, 330 insertions(+), 216 deletions(-)
diff --git a/apps/web/src/app/layouts/product-switcher/navigation-switcher/navigation-switcher.component.spec.ts b/apps/web/src/app/layouts/product-switcher/navigation-switcher/navigation-switcher.component.spec.ts
index a07f56db2d7..382ce8e026b 100644
--- a/apps/web/src/app/layouts/product-switcher/navigation-switcher/navigation-switcher.component.spec.ts
+++ b/apps/web/src/app/layouts/product-switcher/navigation-switcher/navigation-switcher.component.spec.ts
@@ -6,7 +6,7 @@ import { BehaviorSubject } from "rxjs";
import { I18nPipe } from "@bitwarden/angular/platform/pipes/i18n.pipe";
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
-import { BitIconButtonComponent } from "@bitwarden/components/src/icon-button/icon-button.component";
+import { IconButtonModule, NavigationModule } from "@bitwarden/components";
import { NavItemComponent } from "@bitwarden/components/src/navigation/nav-item.component";
import { ProductSwitcherItem, ProductSwitcherService } from "../shared/product-switcher.service";
@@ -45,13 +45,8 @@ describe("NavigationProductSwitcherComponent", () => {
mockProducts$.next({ bento: [], other: [] });
await TestBed.configureTestingModule({
- imports: [RouterModule],
- declarations: [
- NavigationProductSwitcherComponent,
- NavItemComponent,
- BitIconButtonComponent,
- I18nPipe,
- ],
+ imports: [RouterModule, NavigationModule, IconButtonModule],
+ declarations: [NavigationProductSwitcherComponent, I18nPipe],
providers: [
{ provide: ProductSwitcherService, useValue: productSwitcherService },
{
diff --git a/bitwarden_license/bit-web/src/app/tools/access-intelligence/password-health.component.spec.ts b/bitwarden_license/bit-web/src/app/tools/access-intelligence/password-health.component.spec.ts
index 98637d0decb..1f1756731f6 100644
--- a/bitwarden_license/bit-web/src/app/tools/access-intelligence/password-health.component.spec.ts
+++ b/bitwarden_license/bit-web/src/app/tools/access-intelligence/password-health.component.spec.ts
@@ -13,7 +13,6 @@ import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.servic
import { PasswordStrengthServiceAbstraction } from "@bitwarden/common/tools/password-strength";
import { CipherService } from "@bitwarden/common/vault/abstractions/cipher.service";
import { TableModule } from "@bitwarden/components";
-import { TableBodyDirective } from "@bitwarden/components/src/table/table.component";
import { LooseComponentsModule } from "@bitwarden/web-vault/app/shared";
import { PipesModule } from "@bitwarden/web-vault/app/vault/individual-vault/pipes/pipes.module";
@@ -27,7 +26,7 @@ describe("PasswordHealthComponent", () => {
beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [PasswordHealthComponent, PipesModule, TableModule, LooseComponentsModule],
- declarations: [TableBodyDirective],
+ declarations: [],
providers: [
{ provide: CipherService, useValue: mock() },
{ provide: I18nService, useValue: mock() },
diff --git a/libs/components/src/async-actions/async-actions.module.ts b/libs/components/src/async-actions/async-actions.module.ts
index 8ff1deb2784..bff4286f890 100644
--- a/libs/components/src/async-actions/async-actions.module.ts
+++ b/libs/components/src/async-actions/async-actions.module.ts
@@ -1,14 +1,11 @@
import { NgModule } from "@angular/core";
-import { SharedModule } from "../shared";
-
import { BitActionDirective } from "./bit-action.directive";
import { BitSubmitDirective } from "./bit-submit.directive";
import { BitFormButtonDirective } from "./form-button.directive";
@NgModule({
- imports: [SharedModule],
- declarations: [BitActionDirective, BitFormButtonDirective, BitSubmitDirective],
+ imports: [BitActionDirective, BitFormButtonDirective, BitSubmitDirective],
exports: [BitActionDirective, BitFormButtonDirective, BitSubmitDirective],
})
export class AsyncActionsModule {}
diff --git a/libs/components/src/async-actions/bit-action.directive.ts b/libs/components/src/async-actions/bit-action.directive.ts
index 32ac73f418d..3e793ae2ecd 100644
--- a/libs/components/src/async-actions/bit-action.directive.ts
+++ b/libs/components/src/async-actions/bit-action.directive.ts
@@ -15,6 +15,7 @@ import { FunctionReturningAwaitable, functionToObservable } from "../utils/funct
*/
@Directive({
selector: "[bitAction]",
+ standalone: true,
})
export class BitActionDirective implements OnDestroy {
private destroy$ = new Subject();
diff --git a/libs/components/src/async-actions/bit-submit.directive.ts b/libs/components/src/async-actions/bit-submit.directive.ts
index 838d78af8b2..a38e76aaca6 100644
--- a/libs/components/src/async-actions/bit-submit.directive.ts
+++ b/libs/components/src/async-actions/bit-submit.directive.ts
@@ -14,6 +14,7 @@ import { FunctionReturningAwaitable, functionToObservable } from "../utils/funct
*/
@Directive({
selector: "[formGroup][bitSubmit]",
+ standalone: true,
})
export class BitSubmitDirective implements OnInit, OnDestroy {
private destroy$ = new Subject();
diff --git a/libs/components/src/async-actions/form-button.directive.ts b/libs/components/src/async-actions/form-button.directive.ts
index e4685188693..7c92865b984 100644
--- a/libs/components/src/async-actions/form-button.directive.ts
+++ b/libs/components/src/async-actions/form-button.directive.ts
@@ -25,6 +25,7 @@ import { BitSubmitDirective } from "./bit-submit.directive";
*/
@Directive({
selector: "button[bitFormButton]",
+ standalone: true,
})
export class BitFormButtonDirective implements OnDestroy {
private destroy$ = new Subject();
diff --git a/libs/components/src/avatar/avatar.component.ts b/libs/components/src/avatar/avatar.component.ts
index e1758d795d6..76ff702e88b 100644
--- a/libs/components/src/avatar/avatar.component.ts
+++ b/libs/components/src/avatar/avatar.component.ts
@@ -1,5 +1,6 @@
// FIXME: Update this file to be type safe and remove this and next line
// @ts-strict-ignore
+import { NgIf, NgClass } from "@angular/common";
import { Component, Input, OnChanges } from "@angular/core";
import { DomSanitizer, SafeResourceUrl } from "@angular/platform-browser";
@@ -18,6 +19,8 @@ const SizeClasses: Record = {
@Component({
selector: "bit-avatar",
template: `
`,
+ standalone: true,
+ imports: [NgIf, NgClass],
})
export class AvatarComponent implements OnChanges {
@Input() border = false;
diff --git a/libs/components/src/avatar/avatar.module.ts b/libs/components/src/avatar/avatar.module.ts
index ea78ff3a1d2..4ef0978cbec 100644
--- a/libs/components/src/avatar/avatar.module.ts
+++ b/libs/components/src/avatar/avatar.module.ts
@@ -1,11 +1,9 @@
-import { CommonModule } from "@angular/common";
import { NgModule } from "@angular/core";
import { AvatarComponent } from "./avatar.component";
@NgModule({
- imports: [CommonModule],
+ imports: [AvatarComponent],
exports: [AvatarComponent],
- declarations: [AvatarComponent],
})
export class AvatarModule {}
diff --git a/libs/components/src/badge-list/badge-list.component.ts b/libs/components/src/badge-list/badge-list.component.ts
index 9270e5e1238..ac8cb3281ab 100644
--- a/libs/components/src/badge-list/badge-list.component.ts
+++ b/libs/components/src/badge-list/badge-list.component.ts
@@ -1,12 +1,16 @@
// FIXME: Update this file to be type safe and remove this and next line
// @ts-strict-ignore
+import { CommonModule } from "@angular/common";
import { Component, Input, OnChanges } from "@angular/core";
-import { BadgeVariant } from "../badge";
+import { BadgeModule, BadgeVariant } from "../badge";
+import { I18nPipe } from "../shared/i18n.pipe";
@Component({
selector: "bit-badge-list",
templateUrl: "badge-list.component.html",
+ standalone: true,
+ imports: [CommonModule, BadgeModule, I18nPipe],
})
export class BadgeListComponent implements OnChanges {
private _maxItems: number;
diff --git a/libs/components/src/badge-list/badge-list.module.ts b/libs/components/src/badge-list/badge-list.module.ts
index d2a4ce211b1..9359fe2c5c5 100644
--- a/libs/components/src/badge-list/badge-list.module.ts
+++ b/libs/components/src/badge-list/badge-list.module.ts
@@ -1,13 +1,9 @@
import { NgModule } from "@angular/core";
-import { BadgeModule } from "../badge";
-import { SharedModule } from "../shared";
-
import { BadgeListComponent } from "./badge-list.component";
@NgModule({
- imports: [SharedModule, BadgeModule],
+ imports: [BadgeListComponent],
exports: [BadgeListComponent],
- declarations: [BadgeListComponent],
})
export class BadgeListModule {}
diff --git a/libs/components/src/badge/badge.directive.ts b/libs/components/src/badge/badge.directive.ts
index f39f8f87639..eef876a664d 100644
--- a/libs/components/src/badge/badge.directive.ts
+++ b/libs/components/src/badge/badge.directive.ts
@@ -31,6 +31,7 @@ const hoverStyles: Record = {
@Directive({
selector: "span[bitBadge], a[bitBadge], button[bitBadge]",
providers: [{ provide: FocusableElement, useExisting: BadgeDirective }],
+ standalone: true,
})
export class BadgeDirective implements FocusableElement {
@HostBinding("class") get classList() {
diff --git a/libs/components/src/badge/badge.module.ts b/libs/components/src/badge/badge.module.ts
index e1b8292363f..e7f3770785a 100644
--- a/libs/components/src/badge/badge.module.ts
+++ b/libs/components/src/badge/badge.module.ts
@@ -1,11 +1,9 @@
-import { CommonModule } from "@angular/common";
import { NgModule } from "@angular/core";
import { BadgeDirective } from "./badge.directive";
@NgModule({
- imports: [CommonModule],
+ imports: [BadgeDirective],
exports: [BadgeDirective],
- declarations: [BadgeDirective],
})
export class BadgeModule {}
diff --git a/libs/components/src/banner/banner.component.spec.ts b/libs/components/src/banner/banner.component.spec.ts
index 29f10016a15..2bbc7965642 100644
--- a/libs/components/src/banner/banner.component.spec.ts
+++ b/libs/components/src/banner/banner.component.spec.ts
@@ -2,7 +2,6 @@ import { ComponentFixture, TestBed } from "@angular/core/testing";
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
-import { SharedModule } from "../shared/shared.module";
import { I18nMockService } from "../utils/i18n-mock.service";
import { BannerComponent } from "./banner.component";
@@ -13,8 +12,7 @@ describe("BannerComponent", () => {
beforeEach(async () => {
await TestBed.configureTestingModule({
- imports: [SharedModule],
- declarations: [BannerComponent],
+ imports: [BannerComponent],
providers: [
{
provide: I18nService,
diff --git a/libs/components/src/banner/banner.component.ts b/libs/components/src/banner/banner.component.ts
index 7d59ceb0ee9..d3f64329978 100644
--- a/libs/components/src/banner/banner.component.ts
+++ b/libs/components/src/banner/banner.component.ts
@@ -1,7 +1,11 @@
// FIXME: Update this file to be type safe and remove this and next line
// @ts-strict-ignore
+import { CommonModule } from "@angular/common";
import { Component, Input, OnInit, Output, EventEmitter } from "@angular/core";
+import { IconButtonModule } from "../icon-button";
+import { I18nPipe } from "../shared/i18n.pipe";
+
type BannerTypes = "premium" | "info" | "warning" | "danger";
const defaultIcon: Record = {
@@ -14,6 +18,8 @@ const defaultIcon: Record = {
@Component({
selector: "bit-banner",
templateUrl: "./banner.component.html",
+ standalone: true,
+ imports: [CommonModule, IconButtonModule, I18nPipe],
})
export class BannerComponent implements OnInit {
@Input("bannerType") bannerType: BannerTypes = "info";
diff --git a/libs/components/src/banner/banner.module.ts b/libs/components/src/banner/banner.module.ts
index 2c819fbc5b4..3301218ed1a 100644
--- a/libs/components/src/banner/banner.module.ts
+++ b/libs/components/src/banner/banner.module.ts
@@ -1,14 +1,9 @@
-import { CommonModule } from "@angular/common";
import { NgModule } from "@angular/core";
-import { IconButtonModule } from "../icon-button";
-import { SharedModule } from "../shared/shared.module";
-
import { BannerComponent } from "./banner.component";
@NgModule({
- imports: [CommonModule, SharedModule, IconButtonModule],
+ imports: [BannerComponent],
exports: [BannerComponent],
- declarations: [BannerComponent],
})
export class BannerModule {}
diff --git a/libs/components/src/breadcrumbs/breadcrumb.component.ts b/libs/components/src/breadcrumbs/breadcrumb.component.ts
index d6128540442..ce18bde171f 100644
--- a/libs/components/src/breadcrumbs/breadcrumb.component.ts
+++ b/libs/components/src/breadcrumbs/breadcrumb.component.ts
@@ -1,11 +1,14 @@
// FIXME: Update this file to be type safe and remove this and next line
// @ts-strict-ignore
+import { NgIf } from "@angular/common";
import { Component, EventEmitter, Input, Output, TemplateRef, ViewChild } from "@angular/core";
import { QueryParamsHandling } from "@angular/router";
@Component({
selector: "bit-breadcrumb",
templateUrl: "./breadcrumb.component.html",
+ standalone: true,
+ imports: [NgIf],
})
export class BreadcrumbComponent {
@Input()
diff --git a/libs/components/src/breadcrumbs/breadcrumbs.component.ts b/libs/components/src/breadcrumbs/breadcrumbs.component.ts
index 64ca8146c80..6e8fbf5c25a 100644
--- a/libs/components/src/breadcrumbs/breadcrumbs.component.ts
+++ b/libs/components/src/breadcrumbs/breadcrumbs.component.ts
@@ -1,10 +1,18 @@
+import { CommonModule } from "@angular/common";
import { Component, ContentChildren, Input, QueryList } from "@angular/core";
+import { RouterModule } from "@angular/router";
+
+import { IconButtonModule } from "../icon-button";
+import { LinkModule } from "../link";
+import { MenuModule } from "../menu";
import { BreadcrumbComponent } from "./breadcrumb.component";
@Component({
selector: "bit-breadcrumbs",
templateUrl: "./breadcrumbs.component.html",
+ standalone: true,
+ imports: [CommonModule, LinkModule, RouterModule, IconButtonModule, MenuModule],
})
export class BreadcrumbsComponent {
@Input()
diff --git a/libs/components/src/breadcrumbs/breadcrumbs.module.ts b/libs/components/src/breadcrumbs/breadcrumbs.module.ts
index 0812b552f9a..89b57fd19b5 100644
--- a/libs/components/src/breadcrumbs/breadcrumbs.module.ts
+++ b/libs/components/src/breadcrumbs/breadcrumbs.module.ts
@@ -1,17 +1,10 @@
-import { CommonModule } from "@angular/common";
import { NgModule } from "@angular/core";
-import { RouterModule } from "@angular/router";
-
-import { IconButtonModule } from "../icon-button";
-import { LinkModule } from "../link";
-import { MenuModule } from "../menu";
import { BreadcrumbComponent } from "./breadcrumb.component";
import { BreadcrumbsComponent } from "./breadcrumbs.component";
@NgModule({
- imports: [CommonModule, LinkModule, IconButtonModule, MenuModule, RouterModule],
- declarations: [BreadcrumbsComponent, BreadcrumbComponent],
+ imports: [BreadcrumbsComponent, BreadcrumbComponent],
exports: [BreadcrumbsComponent, BreadcrumbComponent],
})
export class BreadcrumbsModule {}
diff --git a/libs/components/src/button/button.component.ts b/libs/components/src/button/button.component.ts
index 67b57d576ab..96311f91529 100644
--- a/libs/components/src/button/button.component.ts
+++ b/libs/components/src/button/button.component.ts
@@ -1,6 +1,7 @@
// FIXME: Update this file to be type safe and remove this and next line
// @ts-strict-ignore
import { coerceBooleanProperty } from "@angular/cdk/coercion";
+import { NgClass } from "@angular/common";
import { Input, HostBinding, Component } from "@angular/core";
import { ButtonLikeAbstraction, ButtonType } from "../shared/button-like.abstraction";
@@ -46,6 +47,8 @@ const buttonStyles: Record = {
selector: "button[bitButton], a[bitButton]",
templateUrl: "button.component.html",
providers: [{ provide: ButtonLikeAbstraction, useExisting: ButtonComponent }],
+ standalone: true,
+ imports: [NgClass],
})
export class ButtonComponent implements ButtonLikeAbstraction {
@HostBinding("class") get classList() {
diff --git a/libs/components/src/button/button.module.ts b/libs/components/src/button/button.module.ts
index 448e7c9dcf6..f1a86eff3ab 100644
--- a/libs/components/src/button/button.module.ts
+++ b/libs/components/src/button/button.module.ts
@@ -1,11 +1,9 @@
-import { CommonModule } from "@angular/common";
import { NgModule } from "@angular/core";
import { ButtonComponent } from "./button.component";
@NgModule({
- imports: [CommonModule],
+ imports: [ButtonComponent],
exports: [ButtonComponent],
- declarations: [ButtonComponent],
})
export class ButtonModule {}
diff --git a/libs/components/src/checkbox/checkbox.component.ts b/libs/components/src/checkbox/checkbox.component.ts
index 1ca27e84b82..0ce6f1889b5 100644
--- a/libs/components/src/checkbox/checkbox.component.ts
+++ b/libs/components/src/checkbox/checkbox.component.ts
@@ -9,6 +9,7 @@ import { BitFormControlAbstraction } from "../form-control";
selector: "input[type=checkbox][bitCheckbox]",
template: "",
providers: [{ provide: BitFormControlAbstraction, useExisting: CheckboxComponent }],
+ standalone: true,
})
export class CheckboxComponent implements BitFormControlAbstraction {
@HostBinding("class")
diff --git a/libs/components/src/checkbox/checkbox.module.ts b/libs/components/src/checkbox/checkbox.module.ts
index d03b9cf5050..3abfb4b1bfd 100644
--- a/libs/components/src/checkbox/checkbox.module.ts
+++ b/libs/components/src/checkbox/checkbox.module.ts
@@ -1,14 +1,9 @@
-import { CommonModule } from "@angular/common";
import { NgModule } from "@angular/core";
-import { FormControlModule } from "../form-control";
-import { SharedModule } from "../shared";
-
import { CheckboxComponent } from "./checkbox.component";
@NgModule({
- imports: [SharedModule, CommonModule, FormControlModule],
- declarations: [CheckboxComponent],
+ imports: [CheckboxComponent],
exports: [CheckboxComponent],
})
export class CheckboxModule {}
diff --git a/libs/components/src/color-password/color-password.component.ts b/libs/components/src/color-password/color-password.component.ts
index 35732760ac7..cbf746e9d73 100644
--- a/libs/components/src/color-password/color-password.component.ts
+++ b/libs/components/src/color-password/color-password.component.ts
@@ -1,5 +1,6 @@
// FIXME: Update this file to be type safe and remove this and next line
// @ts-strict-ignore
+import { NgFor, NgIf } from "@angular/common";
import { Component, HostBinding, Input } from "@angular/core";
import { Utils } from "@bitwarden/common/platform/misc/utils";
@@ -23,6 +24,8 @@ enum CharacterType {
}}
`,
preserveWhitespaces: false,
+ standalone: true,
+ imports: [NgFor, NgIf],
})
export class ColorPasswordComponent {
@Input() password: string = null;
diff --git a/libs/components/src/color-password/color-password.module.ts b/libs/components/src/color-password/color-password.module.ts
index 692c206bb4c..3ebc1c80e12 100644
--- a/libs/components/src/color-password/color-password.module.ts
+++ b/libs/components/src/color-password/color-password.module.ts
@@ -1,11 +1,9 @@
-import { CommonModule } from "@angular/common";
import { NgModule } from "@angular/core";
import { ColorPasswordComponent } from "./color-password.component";
@NgModule({
- imports: [CommonModule],
+ imports: [ColorPasswordComponent],
exports: [ColorPasswordComponent],
- declarations: [ColorPasswordComponent],
})
export class ColorPasswordModule {}
diff --git a/libs/components/src/dialog/dialog.module.ts b/libs/components/src/dialog/dialog.module.ts
index bc37f749c05..f31fdd52060 100644
--- a/libs/components/src/dialog/dialog.module.ts
+++ b/libs/components/src/dialog/dialog.module.ts
@@ -1,44 +1,25 @@
import { DialogModule as CdkDialogModule } from "@angular/cdk/dialog";
import { NgModule } from "@angular/core";
-import { ReactiveFormsModule } from "@angular/forms";
-
-import { AsyncActionsModule } from "../async-actions";
-import { ButtonModule } from "../button";
-import { IconButtonModule } from "../icon-button";
-import { SharedModule } from "../shared";
-import { TypographyModule } from "../typography";
import { DialogComponent } from "./dialog/dialog.component";
import { DialogService } from "./dialog.service";
import { DialogCloseDirective } from "./directives/dialog-close.directive";
-import { DialogTitleContainerDirective } from "./directives/dialog-title-container.directive";
-import { SimpleConfigurableDialogComponent } from "./simple-dialog/simple-configurable-dialog/simple-configurable-dialog.component";
import { IconDirective, SimpleDialogComponent } from "./simple-dialog/simple-dialog.component";
@NgModule({
imports: [
- SharedModule,
- AsyncActionsModule,
- ButtonModule,
CdkDialogModule,
- IconButtonModule,
- ReactiveFormsModule,
- TypographyModule,
- ],
- declarations: [
DialogCloseDirective,
- DialogTitleContainerDirective,
DialogComponent,
SimpleDialogComponent,
- SimpleConfigurableDialogComponent,
IconDirective,
],
exports: [
CdkDialogModule,
- DialogComponent,
- SimpleDialogComponent,
DialogCloseDirective,
+ DialogComponent,
IconDirective,
+ SimpleDialogComponent,
],
providers: [DialogService],
})
diff --git a/libs/components/src/dialog/dialog/dialog.component.ts b/libs/components/src/dialog/dialog/dialog.component.ts
index 2f901d10d2d..ed47201805a 100644
--- a/libs/components/src/dialog/dialog/dialog.component.ts
+++ b/libs/components/src/dialog/dialog/dialog.component.ts
@@ -1,14 +1,29 @@
// FIXME: Update this file to be type safe and remove this and next line
// @ts-strict-ignore
import { coerceBooleanProperty } from "@angular/cdk/coercion";
+import { CommonModule } from "@angular/common";
import { Component, HostBinding, Input } from "@angular/core";
+import { BitIconButtonComponent } from "../../icon-button/icon-button.component";
+import { I18nPipe } from "../../shared/i18n.pipe";
+import { TypographyDirective } from "../../typography/typography.directive";
import { fadeIn } from "../animations";
+import { DialogCloseDirective } from "../directives/dialog-close.directive";
+import { DialogTitleContainerDirective } from "../directives/dialog-title-container.directive";
@Component({
selector: "bit-dialog",
templateUrl: "./dialog.component.html",
animations: [fadeIn],
+ standalone: true,
+ imports: [
+ CommonModule,
+ DialogTitleContainerDirective,
+ TypographyDirective,
+ BitIconButtonComponent,
+ DialogCloseDirective,
+ I18nPipe,
+ ],
})
export class DialogComponent {
/** Background color */
diff --git a/libs/components/src/dialog/directives/dialog-close.directive.ts b/libs/components/src/dialog/directives/dialog-close.directive.ts
index 5e44ced7c21..5e5fda3e014 100644
--- a/libs/components/src/dialog/directives/dialog-close.directive.ts
+++ b/libs/components/src/dialog/directives/dialog-close.directive.ts
@@ -3,6 +3,7 @@ import { Directive, HostBinding, HostListener, Input, Optional } from "@angular/
@Directive({
selector: "[bitDialogClose]",
+ standalone: true,
})
export class DialogCloseDirective {
@Input("bitDialogClose") dialogResult: any;
diff --git a/libs/components/src/dialog/directives/dialog-title-container.directive.ts b/libs/components/src/dialog/directives/dialog-title-container.directive.ts
index e17487f2780..cf46396967b 100644
--- a/libs/components/src/dialog/directives/dialog-title-container.directive.ts
+++ b/libs/components/src/dialog/directives/dialog-title-container.directive.ts
@@ -6,6 +6,7 @@ let nextId = 0;
@Directive({
selector: "[bitDialogTitleContainer]",
+ standalone: true,
})
export class DialogTitleContainerDirective implements OnInit {
@HostBinding("id") id = `bit-dialog-title-${nextId++}`;
diff --git a/libs/components/src/dialog/simple-dialog/simple-configurable-dialog/simple-configurable-dialog.component.ts b/libs/components/src/dialog/simple-dialog/simple-configurable-dialog/simple-configurable-dialog.component.ts
index 29d52e9cf07..60b2e1c3a3f 100644
--- a/libs/components/src/dialog/simple-dialog/simple-configurable-dialog/simple-configurable-dialog.component.ts
+++ b/libs/components/src/dialog/simple-dialog/simple-configurable-dialog/simple-configurable-dialog.component.ts
@@ -1,12 +1,17 @@
// FIXME: Update this file to be type safe and remove this and next line
// @ts-strict-ignore
import { DialogRef, DIALOG_DATA } from "@angular/cdk/dialog";
+import { NgIf } from "@angular/common";
import { Component, Inject } from "@angular/core";
-import { FormGroup } from "@angular/forms";
+import { FormGroup, ReactiveFormsModule } from "@angular/forms";
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
import { SimpleDialogOptions, SimpleDialogType, Translation } from "../..";
+import { BitSubmitDirective } from "../../../async-actions/bit-submit.directive";
+import { BitFormButtonDirective } from "../../../async-actions/form-button.directive";
+import { ButtonComponent } from "../../../button/button.component";
+import { SimpleDialogComponent, IconDirective } from "../simple-dialog.component";
const DEFAULT_ICON: Record = {
primary: "bwi-business",
@@ -26,6 +31,16 @@ const DEFAULT_COLOR: Record = {
@Component({
templateUrl: "./simple-configurable-dialog.component.html",
+ standalone: true,
+ imports: [
+ ReactiveFormsModule,
+ BitSubmitDirective,
+ SimpleDialogComponent,
+ IconDirective,
+ ButtonComponent,
+ BitFormButtonDirective,
+ NgIf,
+ ],
})
export class SimpleConfigurableDialogComponent {
get iconClasses() {
diff --git a/libs/components/src/dialog/simple-dialog/simple-dialog.component.ts b/libs/components/src/dialog/simple-dialog/simple-dialog.component.ts
index 912b0299f66..c02a13bd150 100644
--- a/libs/components/src/dialog/simple-dialog/simple-dialog.component.ts
+++ b/libs/components/src/dialog/simple-dialog/simple-dialog.component.ts
@@ -1,14 +1,22 @@
+import { NgIf } from "@angular/common";
import { Component, ContentChild, Directive } from "@angular/core";
+import { TypographyDirective } from "../../typography/typography.directive";
import { fadeIn } from "../animations";
+import { DialogTitleContainerDirective } from "../directives/dialog-title-container.directive";
-@Directive({ selector: "[bitDialogIcon]" })
+@Directive({
+ selector: "[bitDialogIcon]",
+ standalone: true,
+})
export class IconDirective {}
@Component({
selector: "bit-simple-dialog",
templateUrl: "./simple-dialog.component.html",
animations: [fadeIn],
+ standalone: true,
+ imports: [NgIf, DialogTitleContainerDirective, TypographyDirective],
})
export class SimpleDialogComponent {
@ContentChild(IconDirective) icon!: IconDirective;
diff --git a/libs/components/src/form-control/form-control.component.ts b/libs/components/src/form-control/form-control.component.ts
index 6c24e7a53e6..9b87c44157a 100644
--- a/libs/components/src/form-control/form-control.component.ts
+++ b/libs/components/src/form-control/form-control.component.ts
@@ -1,15 +1,21 @@
// FIXME: Update this file to be type safe and remove this and next line
// @ts-strict-ignore
import { coerceBooleanProperty } from "@angular/cdk/coercion";
+import { NgClass, NgIf } from "@angular/common";
import { Component, ContentChild, HostBinding, Input } from "@angular/core";
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
+import { I18nPipe } from "../shared/i18n.pipe";
+import { TypographyDirective } from "../typography/typography.directive";
+
import { BitFormControlAbstraction } from "./form-control.abstraction";
@Component({
selector: "bit-form-control",
templateUrl: "form-control.component.html",
+ standalone: true,
+ imports: [NgClass, TypographyDirective, NgIf, I18nPipe],
})
export class FormControlComponent {
@Input() label: string;
diff --git a/libs/components/src/form-control/form-control.module.ts b/libs/components/src/form-control/form-control.module.ts
index f6969a97e9c..df168d8e98f 100644
--- a/libs/components/src/form-control/form-control.module.ts
+++ b/libs/components/src/form-control/form-control.module.ts
@@ -1,15 +1,11 @@
import { NgModule } from "@angular/core";
-import { SharedModule } from "../shared";
-import { TypographyModule } from "../typography";
-
import { FormControlComponent } from "./form-control.component";
import { BitHintComponent } from "./hint.component";
import { BitLabel } from "./label.component";
@NgModule({
- imports: [SharedModule, BitLabel, TypographyModule],
- declarations: [FormControlComponent, BitHintComponent],
+ imports: [BitLabel, FormControlComponent, BitHintComponent],
exports: [FormControlComponent, BitLabel, BitHintComponent],
})
export class FormControlModule {}
diff --git a/libs/components/src/form-control/hint.component.ts b/libs/components/src/form-control/hint.component.ts
index c1f21bf2545..4fee0d4560f 100644
--- a/libs/components/src/form-control/hint.component.ts
+++ b/libs/components/src/form-control/hint.component.ts
@@ -8,6 +8,7 @@ let nextId = 0;
host: {
class: "tw-text-muted tw-font-normal tw-inline-block tw-mt-1 tw-text-xs",
},
+ standalone: true,
})
export class BitHintComponent {
@HostBinding() id = `bit-hint-${nextId++}`;
diff --git a/libs/components/src/form-field/error-summary.component.ts b/libs/components/src/form-field/error-summary.component.ts
index f374740b20e..beed32a88ac 100644
--- a/libs/components/src/form-field/error-summary.component.ts
+++ b/libs/components/src/form-field/error-summary.component.ts
@@ -1,8 +1,11 @@
// FIXME: Update this file to be type safe and remove this and next line
// @ts-strict-ignore
+import { NgIf } from "@angular/common";
import { Component, Input } from "@angular/core";
import { AbstractControl, UntypedFormGroup } from "@angular/forms";
+import { I18nPipe } from "../shared/i18n.pipe";
+
@Component({
selector: "bit-error-summary",
template: ` 0">
@@ -12,6 +15,8 @@ import { AbstractControl, UntypedFormGroup } from "@angular/forms";
class: "tw-block tw-text-danger tw-mt-2",
"aria-live": "assertive",
},
+ standalone: true,
+ imports: [NgIf, I18nPipe],
})
export class BitErrorSummary {
@Input()
diff --git a/libs/components/src/form-field/error.component.ts b/libs/components/src/form-field/error.component.ts
index a0f7906b366..27adbf7d313 100644
--- a/libs/components/src/form-field/error.component.ts
+++ b/libs/components/src/form-field/error.component.ts
@@ -14,6 +14,7 @@ let nextId = 0;
class: "tw-block tw-mt-1 tw-text-danger tw-text-xs",
"aria-live": "assertive",
},
+ standalone: true,
})
export class BitErrorComponent {
@HostBinding() id = `bit-error-${nextId++}`;
diff --git a/libs/components/src/form-field/form-field.component.ts b/libs/components/src/form-field/form-field.component.ts
index 6f425e41496..9f41c6cf6ac 100644
--- a/libs/components/src/form-field/form-field.component.ts
+++ b/libs/components/src/form-field/form-field.component.ts
@@ -1,5 +1,6 @@
// FIXME: Update this file to be type safe and remove this and next line
// @ts-strict-ignore
+import { CommonModule } from "@angular/common";
import {
AfterContentChecked,
booleanAttribute,
@@ -16,6 +17,7 @@ import {
import { BitHintComponent } from "../form-control/hint.component";
import { BitLabel } from "../form-control/label.component";
import { inputBorderClasses } from "../input/input.directive";
+import { I18nPipe } from "../shared/i18n.pipe";
import { BitErrorComponent } from "./error.component";
import { BitFormFieldControl } from "./form-field-control";
@@ -23,6 +25,8 @@ import { BitFormFieldControl } from "./form-field-control";
@Component({
selector: "bit-form-field",
templateUrl: "./form-field.component.html",
+ standalone: true,
+ imports: [CommonModule, BitErrorComponent, I18nPipe],
})
export class BitFormFieldComponent implements AfterContentChecked {
@ContentChild(BitFormFieldControl) input: BitFormFieldControl;
diff --git a/libs/components/src/form-field/form-field.module.ts b/libs/components/src/form-field/form-field.module.ts
index 989375167d4..88d7ffcc78b 100644
--- a/libs/components/src/form-field/form-field.module.ts
+++ b/libs/components/src/form-field/form-field.module.ts
@@ -1,11 +1,8 @@
import { NgModule } from "@angular/core";
import { FormControlModule } from "../form-control";
-import { BitInputDirective } from "../input/input.directive";
import { InputModule } from "../input/input.module";
-import { MultiSelectComponent } from "../multi-select/multi-select.component";
import { MultiSelectModule } from "../multi-select/multi-select.module";
-import { SharedModule } from "../shared";
import { BitErrorSummary } from "./error-summary.component";
import { BitErrorComponent } from "./error.component";
@@ -15,8 +12,11 @@ import { BitPrefixDirective } from "./prefix.directive";
import { BitSuffixDirective } from "./suffix.directive";
@NgModule({
- imports: [SharedModule, FormControlModule, InputModule, MultiSelectModule],
- declarations: [
+ imports: [
+ FormControlModule,
+ InputModule,
+ MultiSelectModule,
+
BitErrorComponent,
BitErrorSummary,
BitFormFieldComponent,
@@ -25,15 +25,16 @@ import { BitSuffixDirective } from "./suffix.directive";
BitSuffixDirective,
],
exports: [
+ FormControlModule,
+ InputModule,
+ MultiSelectModule,
+
BitErrorComponent,
BitErrorSummary,
BitFormFieldComponent,
- BitInputDirective,
BitPasswordInputToggleDirective,
BitPrefixDirective,
BitSuffixDirective,
- MultiSelectComponent,
- FormControlModule,
],
})
export class FormFieldModule {}
diff --git a/libs/components/src/form-field/password-input-toggle.directive.ts b/libs/components/src/form-field/password-input-toggle.directive.ts
index a696a88c468..933722db5b4 100644
--- a/libs/components/src/form-field/password-input-toggle.directive.ts
+++ b/libs/components/src/form-field/password-input-toggle.directive.ts
@@ -18,6 +18,7 @@ import { BitFormFieldComponent } from "./form-field.component";
@Directive({
selector: "[bitPasswordInputToggle]",
+ standalone: true,
})
export class BitPasswordInputToggleDirective implements AfterContentInit, OnChanges {
/**
diff --git a/libs/components/src/form-field/prefix.directive.ts b/libs/components/src/form-field/prefix.directive.ts
index 34fcbf85233..b44e90cbaad 100644
--- a/libs/components/src/form-field/prefix.directive.ts
+++ b/libs/components/src/form-field/prefix.directive.ts
@@ -4,6 +4,7 @@ import { BitIconButtonComponent } from "../icon-button/icon-button.component";
@Directive({
selector: "[bitPrefix]",
+ standalone: true,
})
export class BitPrefixDirective implements OnInit {
@HostBinding("class") @Input() get classList() {
diff --git a/libs/components/src/form-field/suffix.directive.ts b/libs/components/src/form-field/suffix.directive.ts
index 28736ce78a9..baf1afce763 100644
--- a/libs/components/src/form-field/suffix.directive.ts
+++ b/libs/components/src/form-field/suffix.directive.ts
@@ -4,6 +4,7 @@ import { BitIconButtonComponent } from "../icon-button/icon-button.component";
@Directive({
selector: "[bitSuffix]",
+ standalone: true,
})
export class BitSuffixDirective implements OnInit {
@HostBinding("class") @Input() get classList() {
diff --git a/libs/components/src/icon-button/icon-button.component.ts b/libs/components/src/icon-button/icon-button.component.ts
index 97016f9fd0c..ac7dff0408b 100644
--- a/libs/components/src/icon-button/icon-button.component.ts
+++ b/libs/components/src/icon-button/icon-button.component.ts
@@ -1,5 +1,6 @@
// FIXME: Update this file to be type safe and remove this and next line
// @ts-strict-ignore
+import { NgClass } from "@angular/common";
import { Component, ElementRef, HostBinding, Input } from "@angular/core";
import { ButtonLikeAbstraction, ButtonType } from "../shared/button-like.abstraction";
@@ -134,6 +135,8 @@ const sizes: Record = {
{ provide: ButtonLikeAbstraction, useExisting: BitIconButtonComponent },
{ provide: FocusableElement, useExisting: BitIconButtonComponent },
],
+ standalone: true,
+ imports: [NgClass],
})
export class BitIconButtonComponent implements ButtonLikeAbstraction, FocusableElement {
@Input("bitIconButton") icon: string;
diff --git a/libs/components/src/icon-button/icon-button.module.ts b/libs/components/src/icon-button/icon-button.module.ts
index fb4e8589717..26f48cdb177 100644
--- a/libs/components/src/icon-button/icon-button.module.ts
+++ b/libs/components/src/icon-button/icon-button.module.ts
@@ -1,11 +1,9 @@
-import { CommonModule } from "@angular/common";
import { NgModule } from "@angular/core";
import { BitIconButtonComponent } from "./icon-button.component";
@NgModule({
- imports: [CommonModule],
- declarations: [BitIconButtonComponent],
+ imports: [BitIconButtonComponent],
exports: [BitIconButtonComponent],
})
export class IconButtonModule {}
diff --git a/libs/components/src/icon/icon.component.ts b/libs/components/src/icon/icon.component.ts
index 55615d4dae3..2382d197bec 100644
--- a/libs/components/src/icon/icon.component.ts
+++ b/libs/components/src/icon/icon.component.ts
@@ -8,6 +8,7 @@ import { Icon, isIcon } from "./icon";
@Component({
selector: "bit-icon",
template: ``,
+ standalone: true,
})
export class BitIconComponent {
@Input() set icon(icon: Icon) {
diff --git a/libs/components/src/icon/icon.components.spec.ts b/libs/components/src/icon/icon.components.spec.ts
index 351ed5f0218..7d499cdd419 100644
--- a/libs/components/src/icon/icon.components.spec.ts
+++ b/libs/components/src/icon/icon.components.spec.ts
@@ -9,7 +9,7 @@ describe("IconComponent", () => {
beforeEach(async () => {
await TestBed.configureTestingModule({
- declarations: [BitIconComponent],
+ imports: [BitIconComponent],
}).compileComponents();
fixture = TestBed.createComponent(BitIconComponent);
diff --git a/libs/components/src/icon/icon.module.ts b/libs/components/src/icon/icon.module.ts
index 32e95fd0468..3d15b5bb3c3 100644
--- a/libs/components/src/icon/icon.module.ts
+++ b/libs/components/src/icon/icon.module.ts
@@ -1,11 +1,9 @@
-import { CommonModule } from "@angular/common";
import { NgModule } from "@angular/core";
import { BitIconComponent } from "./icon.component";
@NgModule({
- imports: [CommonModule],
- declarations: [BitIconComponent],
+ imports: [BitIconComponent],
exports: [BitIconComponent],
})
export class IconModule {}
diff --git a/libs/components/src/input/input.directive.ts b/libs/components/src/input/input.directive.ts
index 4a6a03295d4..f6c6c3d542e 100644
--- a/libs/components/src/input/input.directive.ts
+++ b/libs/components/src/input/input.directive.ts
@@ -30,6 +30,7 @@ export function inputBorderClasses(error: boolean) {
@Directive({
selector: "input[bitInput], select[bitInput], textarea[bitInput]",
providers: [{ provide: BitFormFieldControl, useExisting: BitInputDirective }],
+ standalone: true,
})
export class BitInputDirective implements BitFormFieldControl {
@HostBinding("class") @Input() get classList() {
diff --git a/libs/components/src/input/input.module.ts b/libs/components/src/input/input.module.ts
index cfc49cefb7d..9399cb06517 100644
--- a/libs/components/src/input/input.module.ts
+++ b/libs/components/src/input/input.module.ts
@@ -1,11 +1,9 @@
-import { CommonModule } from "@angular/common";
import { NgModule } from "@angular/core";
import { BitInputDirective } from "./input.directive";
@NgModule({
- imports: [CommonModule],
- declarations: [BitInputDirective],
+ imports: [BitInputDirective],
exports: [BitInputDirective],
})
export class InputModule {}
diff --git a/libs/components/src/link/link.directive.ts b/libs/components/src/link/link.directive.ts
index b127d80fedf..52aba557661 100644
--- a/libs/components/src/link/link.directive.ts
+++ b/libs/components/src/link/link.directive.ts
@@ -68,6 +68,7 @@ abstract class LinkDirective {
@Directive({
selector: "a[bitLink]",
+ standalone: true,
})
export class AnchorLinkDirective extends LinkDirective {
@HostBinding("class") get classList() {
@@ -79,6 +80,7 @@ export class AnchorLinkDirective extends LinkDirective {
@Directive({
selector: "button[bitLink]",
+ standalone: true,
})
export class ButtonLinkDirective extends LinkDirective {
@HostBinding("class") get classList() {
diff --git a/libs/components/src/link/link.module.ts b/libs/components/src/link/link.module.ts
index b8b54d57c00..52d2f29e53c 100644
--- a/libs/components/src/link/link.module.ts
+++ b/libs/components/src/link/link.module.ts
@@ -1,11 +1,9 @@
-import { CommonModule } from "@angular/common";
import { NgModule } from "@angular/core";
import { AnchorLinkDirective, ButtonLinkDirective } from "./link.directive";
@NgModule({
- imports: [CommonModule],
+ imports: [AnchorLinkDirective, ButtonLinkDirective],
exports: [AnchorLinkDirective, ButtonLinkDirective],
- declarations: [AnchorLinkDirective, ButtonLinkDirective],
})
export class LinkModule {}
diff --git a/libs/components/src/menu/menu-divider.component.ts b/libs/components/src/menu/menu-divider.component.ts
index 194506ee50f..55b5c013c93 100644
--- a/libs/components/src/menu/menu-divider.component.ts
+++ b/libs/components/src/menu/menu-divider.component.ts
@@ -3,5 +3,6 @@ import { Component } from "@angular/core";
@Component({
selector: "bit-menu-divider",
templateUrl: "./menu-divider.component.html",
+ standalone: true,
})
export class MenuDividerComponent {}
diff --git a/libs/components/src/menu/menu-item.directive.ts b/libs/components/src/menu/menu-item.directive.ts
index 5fdc8fabfce..d0975e8e391 100644
--- a/libs/components/src/menu/menu-item.directive.ts
+++ b/libs/components/src/menu/menu-item.directive.ts
@@ -1,10 +1,13 @@
import { FocusableOption } from "@angular/cdk/a11y";
import { coerceBooleanProperty } from "@angular/cdk/coercion";
+import { NgClass } from "@angular/common";
import { Component, ElementRef, HostBinding, Input } from "@angular/core";
@Component({
selector: "[bitMenuItem]",
templateUrl: "menu-item.component.html",
+ standalone: true,
+ imports: [NgClass],
})
export class MenuItemDirective implements FocusableOption {
@HostBinding("class") classList = [
diff --git a/libs/components/src/menu/menu-trigger-for.directive.ts b/libs/components/src/menu/menu-trigger-for.directive.ts
index d318a77ef00..786554e981c 100644
--- a/libs/components/src/menu/menu-trigger-for.directive.ts
+++ b/libs/components/src/menu/menu-trigger-for.directive.ts
@@ -19,6 +19,7 @@ import { MenuComponent } from "./menu.component";
@Directive({
selector: "[bitMenuTriggerFor]",
exportAs: "menuTrigger",
+ standalone: true,
})
export class MenuTriggerForDirective implements OnDestroy {
@HostBinding("attr.aria-expanded") isOpen = false;
diff --git a/libs/components/src/menu/menu.component.ts b/libs/components/src/menu/menu.component.ts
index f0bf4f81df9..a39dceb4454 100644
--- a/libs/components/src/menu/menu.component.ts
+++ b/libs/components/src/menu/menu.component.ts
@@ -1,6 +1,6 @@
// FIXME: Update this file to be type safe and remove this and next line
// @ts-strict-ignore
-import { FocusKeyManager } from "@angular/cdk/a11y";
+import { FocusKeyManager, CdkTrapFocus } from "@angular/cdk/a11y";
import {
Component,
Output,
@@ -19,6 +19,8 @@ import { MenuItemDirective } from "./menu-item.directive";
selector: "bit-menu",
templateUrl: "./menu.component.html",
exportAs: "menuComponent",
+ standalone: true,
+ imports: [CdkTrapFocus],
})
export class MenuComponent implements AfterContentInit {
@ViewChild(TemplateRef) templateRef: TemplateRef;
diff --git a/libs/components/src/menu/menu.module.ts b/libs/components/src/menu/menu.module.ts
index b165629e6c5..117460df559 100644
--- a/libs/components/src/menu/menu.module.ts
+++ b/libs/components/src/menu/menu.module.ts
@@ -1,6 +1,3 @@
-import { A11yModule } from "@angular/cdk/a11y";
-import { OverlayModule } from "@angular/cdk/overlay";
-import { CommonModule } from "@angular/common";
import { NgModule } from "@angular/core";
import { MenuDividerComponent } from "./menu-divider.component";
@@ -9,8 +6,7 @@ import { MenuTriggerForDirective } from "./menu-trigger-for.directive";
import { MenuComponent } from "./menu.component";
@NgModule({
- imports: [A11yModule, CommonModule, OverlayModule],
- declarations: [MenuComponent, MenuTriggerForDirective, MenuItemDirective, MenuDividerComponent],
+ imports: [MenuComponent, MenuTriggerForDirective, MenuItemDirective, MenuDividerComponent],
exports: [MenuComponent, MenuTriggerForDirective, MenuItemDirective, MenuDividerComponent],
})
export class MenuModule {}
diff --git a/libs/components/src/menu/menu.stories.ts b/libs/components/src/menu/menu.stories.ts
index c5d232b2057..65fafd2d04d 100644
--- a/libs/components/src/menu/menu.stories.ts
+++ b/libs/components/src/menu/menu.stories.ts
@@ -3,23 +3,15 @@ import { Meta, StoryObj, moduleMetadata } from "@storybook/angular";
import { ButtonModule } from "../button/button.module";
-import { MenuDividerComponent } from "./menu-divider.component";
-import { MenuItemDirective } from "./menu-item.directive";
import { MenuTriggerForDirective } from "./menu-trigger-for.directive";
-import { MenuComponent } from "./menu.component";
+import { MenuModule } from "./menu.module";
export default {
title: "Component Library/Menu",
component: MenuTriggerForDirective,
decorators: [
moduleMetadata({
- declarations: [
- MenuTriggerForDirective,
- MenuComponent,
- MenuItemDirective,
- MenuDividerComponent,
- ],
- imports: [OverlayModule, ButtonModule],
+ imports: [MenuModule, OverlayModule, ButtonModule],
}),
],
parameters: {
@@ -51,7 +43,7 @@ export const OpenMenu: Story = {
Disabled button
-
+