mirror of
https://github.com/bitwarden/browser
synced 2025-12-15 07:43:35 +00:00
[CL-206] update bit-nav components to active match query params (#8242)
* remove exactMatch input in favor of routerLinkActiveOptions
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
import { Directive, EventEmitter, Input, Output } from "@angular/core";
|
||||
import { ActivatedRoute } from "@angular/router";
|
||||
import { RouterLink, RouterLinkActive } from "@angular/router";
|
||||
|
||||
/**
|
||||
* Base class used in `NavGroupComponent` and `NavItemComponent`
|
||||
* `NavGroupComponent` builds upon `NavItemComponent`. This class represents the properties that are passed down to `NavItemComponent`.
|
||||
*/
|
||||
@Directive()
|
||||
export abstract class NavBaseComponent {
|
||||
@@ -22,14 +22,36 @@ export abstract class NavBaseComponent {
|
||||
@Input() icon: string;
|
||||
|
||||
/**
|
||||
* Route to be passed to internal `routerLink`
|
||||
* 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: string | any[];
|
||||
@Input() route?: RouterLink["routerLink"];
|
||||
|
||||
/**
|
||||
* Passed to internal `routerLink`
|
||||
*
|
||||
* See {@link RouterLink.relativeTo}
|
||||
*/
|
||||
@Input() relativeTo?: ActivatedRoute | null;
|
||||
@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"`
|
||||
|
||||
Reference in New Issue
Block a user