1
0
mirror of https://github.com/bitwarden/browser synced 2026-02-24 00:23:17 +00:00
Files
browser/libs/components/src/navigation/nav-base.component.ts
Vicki League 8ecb32f30f [CL-333] Icon Refresh Feature Branch (#14298)
* [CL-571] Update icons to new fileset and metaphors (#14163)

* [CL-518] Convert icons docs to stories (#14299)

* [CL-574] Update inline autofill icons (#14379)

---------

Co-authored-by: William Martin <contact@willmartian.com>
2025-05-07 17:07:14 -04:00

78 lines
2.0 KiB
TypeScript

// FIXME: Update this file to be type safe and remove this and next line
// @ts-strict-ignore
import { Directive, EventEmitter, Input, Output } from "@angular/core";
import { RouterLink, RouterLinkActive } from "@angular/router";
/**
* `NavGroupComponent` builds upon `NavItemComponent`. This class represents the properties that are passed down to `NavItemComponent`.
*/
@Directive()
export abstract class NavBaseComponent {
/**
* Text to display in main content
*/
@Input() text: string;
/**
* `aria-label` for main content
*/
@Input() ariaLabel: string;
/**
* Optional icon, e.g. `"bwi-collection-shared"`
*/
@Input() icon: string;
/**
* Optional route to be passed to internal `routerLink`. If not provided, the nav component will render as a button.
*
* See: {@link RouterLink.routerLink}
*
* ---
*
* We can't name this "routerLink" because Angular will mount the `RouterLink` directive.
*
* See: {@link https://github.com/angular/angular/issues/24482}
*/
@Input() route?: RouterLink["routerLink"];
/**
* Passed to internal `routerLink`
*
* See {@link RouterLink.relativeTo}
*/
@Input() relativeTo?: RouterLink["relativeTo"];
/**
* Passed to internal `routerLink`
*
* See {@link RouterLinkActive.routerLinkActiveOptions}
*/
@Input() routerLinkActiveOptions?: RouterLinkActive["routerLinkActiveOptions"] = {
paths: "subset",
queryParams: "ignored",
fragment: "ignored",
matrixParams: "ignored",
};
/**
* If this item is used within a tree, set `variant` to `"tree"`
*/
@Input() variant: "default" | "tree" = "default";
/**
* Depth level when nested inside of a `'tree'` variant
*/
@Input() treeDepth = 0;
/**
* If `true`, do not change styles when nav item is active.
*/
@Input() hideActiveStyles = false;
/**
* Fires when main content is clicked
*/
@Output() mainContentClicked: EventEmitter<MouseEvent> = new EventEmitter();
}