projects/wvr-elements/src/lib/wvr-nav-list/wvr-nav-li/wvr-nav-li.component.ts
The WvrNavLi Component is the list element to be used with the wvre-nav-list element.
| changeDetection | ChangeDetectionStrategy.OnPush |
| selector | wvr-nav-li-component |
| styleUrls | ./wvr-nav-li.component.scss |
| templateUrl | ./wvr-nav-li.component.html |
Properties |
|
Methods |
Inputs |
Outputs |
HostBindings |
constructor(injector: Injector)
|
||||||
|
Parameters :
|
| href | |
Type : string
|
|
|
A resolvable URI to to which this li will link, when provided. If no link is provided, the list element will not display as a link. |
|
| liCursor | |
Type : any
|
|
|
Allows for the override of the --wvr-nav-li-cursor css variable. Default: pointer. |
|
| liHeight | |
Type : any
|
|
|
Allows for the override of the --wvr-nav-li-height css variable. Default: 100%. |
|
| linkBackgroundHover | |
Type : any
|
|
|
Allows for the override of the --wvr-nav-link-background-hover css variable. Default: --wvr-primary |
|
| linkColor | |
Type : any
|
|
|
Allows for the override of the --wvr-nav-link-color css variable. --wvr-blue |
|
| linkColorHover | |
Type : any
|
|
|
Allows for the override of the --wvr-nav-link-color-hover css variable. Default: --wvr-primary |
|
| linkFontSize | |
Type : any
|
|
|
Allows for the override of the --wvr-nav-link-font-size css variable. Defualt: inherit |
|
| linkFontWeight | |
Type : any
|
|
|
Allows for the override of the --wvr-nav-link-font-weight css variable. Default: inherit |
|
| linkTextDecorationHover | |
Type : any
|
|
|
Allows for the override of the --wvr-nav-link-text-decoration-hover css variable. Default: none |
|
| liWidth | |
Type : any
|
|
|
Allows for the override of the --wvr-nav-li-width css variable. Default: 140px. |
|
| animate | |
Type : string
|
|
|
Inherited from
WvrBaseComponent
|
|
|
Defined in
WvrBaseComponent:68
|
|
|
A setter which parses a json string describing animation instructions and stores the derived object in |
|
| animateConfig | |
Type : string
|
|
|
Inherited from
WvrBaseComponent
|
|
|
Defined in
WvrBaseComponent:76
|
|
|
A setter which parses a json string describing animation setting and stores the derived object in |
|
| animateId | |
Type : string
|
|
|
Inherited from
WvrBaseComponent
|
|
|
Defined in
WvrBaseComponent:84
|
|
|
An attribute input allowing for the designation of an animation identifier for the purpose of animation targeting. |
|
| animateTarget | |
Type : string
|
|
|
Inherited from
WvrBaseComponent
|
|
|
Defined in
WvrBaseComponent:87
|
|
|
An attribute input allowing for the designation of an animation target for animation events. |
|
| hiddenInMobile | |
Type : boolean
|
|
Default value : false
|
|
|
Inherited from
WvrBaseComponent
|
|
|
Defined in
WvrBaseComponent:107
|
|
|
An attribute input specifying if this component should be hidden in the mobile layout. |
|
| ngBindings | |
Type : string
|
|
|
Inherited from
WvrBaseComponent
|
|
|
Defined in
WvrBaseComponent:116
|
|
| themeVariant | |
Type : ThemeVariantName
|
|
|
Inherited from
WvrBaseComponent
|
|
|
Defined in
WvrBaseComponent:55
|
|
|
Used to define the class type of an alert component. |
|
| wvrData | |
Type : string
|
|
|
Inherited from
WvrBaseComponent
|
|
|
Defined in
WvrBaseComponent:45
|
|
| wvrTheme | |
Type : string
|
|
|
Inherited from
WvrBaseComponent
|
|
|
Defined in
WvrBaseComponent:50
|
|
|
Allows for the override of theme for the particular component. |
|
| animationEventTrigger | |
Type : EventEmitter
|
|
|
Inherited from
WvrBaseComponent
|
|
|
Defined in
WvrBaseComponent:110
|
|
|
An Output biding used for triggering animations. |
|
| class.wvr-bootstrap |
Type : boolean
|
Default value : true
|
|
Inherited from
WvrBaseComponent
|
|
Defined in
WvrBaseComponent:58
|
|
A host binding used to ensure the presense of the |
| class.wvr-hidden |
Type : boolean
|
|
Inherited from
WvrBaseComponent
|
|
Defined in
WvrBaseComponent:102
|
|
A host bound accessor which applies the wvr-hidden class if both isMobileLayout and hiddenInMobile evaluate to true. |
| style |
Type : any
|
|
Inherited from
WvrBaseComponent
|
|
Defined in
WvrBaseComponent:60
|
| applyThemeOverride |
applyThemeOverride(customProperty: string, value: string)
|
|
Inherited from
WvrBaseComponent
|
|
Defined in
WvrBaseComponent:237
|
|
Returns :
void
|
| bootstrapNgBindings |
bootstrapNgBindings()
|
|
Inherited from
WvrBaseComponent
|
|
Defined in
WvrBaseComponent:175
|
|
Returns :
void
|
| getWvrData |
getWvrData()
|
|
Inherited from
WvrBaseComponent
|
|
Defined in
WvrBaseComponent:262
|
|
Returns :
string
|
| hasWvrData |
hasWvrData()
|
|
Inherited from
WvrBaseComponent
|
|
Defined in
WvrBaseComponent:258
|
|
Returns :
boolean
|
| initializeAnimationElement |
initializeAnimationElement()
|
|
Inherited from
WvrBaseComponent
|
|
Defined in
WvrBaseComponent:267
|
|
Returns :
void
|
| initializeAnimationRegistration |
initializeAnimationRegistration()
|
|
Inherited from
WvrBaseComponent
|
|
Defined in
WvrBaseComponent:273
|
|
Returns :
void
|
| ngAfterContentInit |
ngAfterContentInit()
|
|
Inherited from
WvrBaseComponent
|
|
Defined in
WvrBaseComponent:160
|
|
Used for post content initialization animation setup.
Returns :
void
|
| ngOnDestroy |
ngOnDestroy()
|
|
Inherited from
WvrBaseComponent
|
|
Defined in
WvrBaseComponent:166
|
|
Handles the the unregistering of this component with the component registry.
Returns :
void
|
| ngOnInit |
ngOnInit()
|
|
Inherited from
WvrBaseComponent
|
|
Defined in
WvrBaseComponent:145
|
|
Used to setup this component for animating.
Returns :
void
|
| onAnimationEvent | ||||||
onAnimationEvent($event: Event)
|
||||||
|
Inherited from
WvrBaseComponent
|
||||||
|
Defined in
WvrBaseComponent:290
|
||||||
|
Trigger's the animation specified by the incoming event.
Parameters :
Returns :
void
|
| Private processData |
processData()
|
|
Inherited from
WvrBaseComponent
|
|
Defined in
WvrBaseComponent:295
|
|
Returns :
void
|
| triggerAnimations | ||||||
triggerAnimations(animationTriggerType: string)
|
||||||
|
Inherited from
WvrBaseComponent
|
||||||
|
Defined in
WvrBaseComponent:244
|
||||||
|
Plays the animation specified by the incoming animation trigger.
Parameters :
Returns :
void
|
| Private _animationConfig |
Type : any
|
Default value : {}
|
|
Inherited from
WvrBaseComponent
|
|
Defined in
WvrBaseComponent:73
|
|
An object representation of the settings specifying the specific behavior of the animation for this component. |
| Private Readonly _animationService |
Type : AnimationService<WvrBaseComponent>
|
|
Inherited from
WvrBaseComponent
|
|
Defined in
WvrBaseComponent:93
|
|
A reference to the AnimationService |
| Private _animationSettings |
Type : any
|
Default value : {}
|
|
Inherited from
WvrBaseComponent
|
|
Defined in
WvrBaseComponent:65
|
|
An object representation of the animation instructions for this component. |
| Private _ngBindings |
Type : literal type
|
|
Inherited from
WvrBaseComponent
|
|
Defined in
WvrBaseComponent:114
|
| animationRootElem |
Type : ElementRef
|
Decorators :
@ViewChild('animationRoot')
|
|
Inherited from
WvrBaseComponent
|
|
Defined in
WvrBaseComponent:90
|
|
A view child of the template element containing the #animationRoot identifier. |
| Private animationStateId |
Type : number
|
|
Inherited from
WvrBaseComponent
|
|
Defined in
WvrBaseComponent:81
|
|
An identifier used to access the animation state for this component. |
| Readonly appConfig |
Type : AppConfig
|
|
Inherited from
WvrBaseComponent
|
|
Defined in
WvrBaseComponent:37
|
|
A reference to the AppConfig |
| Readonly cdRef |
Type : ChangeDetectorRef
|
|
Inherited from
WvrBaseComponent
|
|
Defined in
WvrBaseComponent:34
|
|
A reference to the ChangeDetectorRef |
| Readonly componentRegistry |
Type : ComponentRegistryService<WvrBaseComponent>
|
|
Inherited from
WvrBaseComponent
|
|
Defined in
WvrBaseComponent:25
|
|
A reference to the ComponentRegistryService |
| data |
Type : literal type
|
Default value : {}
|
|
Inherited from
WvrBaseComponent
|
|
Defined in
WvrBaseComponent:42
|
| Readonly eRef |
Type : ElementRef
|
|
Inherited from
WvrBaseComponent
|
|
Defined in
WvrBaseComponent:31
|
|
A reference to the ElementRef |
| Readonly id |
Type : number
|
|
Inherited from
WvrBaseComponent
|
|
Defined in
WvrBaseComponent:28
|
|
A generated unique identifier for this comonent. |
| isMobile |
Type : Observable<boolean>
|
|
Inherited from
WvrBaseComponent
|
|
Defined in
WvrBaseComponent:120
|
| isMobileLayout |
Type : boolean
|
|
Inherited from
WvrBaseComponent
|
|
Defined in
WvrBaseComponent:112
|
| Private Readonly kebabize |
Default value : () => {...}
|
|
Inherited from
WvrBaseComponent
|
|
Defined in
WvrBaseComponent:321
|
| Private Readonly ngBindingsService |
Type : NgBindingsService
|
|
Inherited from
WvrBaseComponent
|
|
Defined in
WvrBaseComponent:99
|
|
A reference to the NgBindingsService |
| Readonly store |
Type : Store<RootState>
|
|
Inherited from
WvrBaseComponent
|
|
Defined in
WvrBaseComponent:40
|
|
A reference to the Store |
| style |
Decorators :
@HostBinding('style')
|
|
Inherited from
WvrBaseComponent
|
|
Defined in
WvrBaseComponent:60
|
| Protected subscriptions |
Type : Array<Subscription>
|
|
Inherited from
WvrBaseComponent
|
|
Defined in
WvrBaseComponent:122
|
| themeOverrides |
Type : object
|
Default value : {}
|
|
Inherited from
WvrBaseComponent
|
|
Defined in
WvrBaseComponent:47
|
| Private Readonly themeService |
Type : ThemeService
|
|
Inherited from
WvrBaseComponent
|
|
Defined in
WvrBaseComponent:96
|
|
A reference to the ThemeService |
| variantTypes |
Type : []
|
Default value : []
|
|
Inherited from
WvrBaseComponent
|
|
Defined in
WvrBaseComponent:62
|
| wvrBootstrap |
Default value : true
|
Decorators :
@HostBinding('class.wvr-bootstrap')
|
|
Inherited from
WvrBaseComponent
|
|
Defined in
WvrBaseComponent:58
|
|
A host binding used to ensure the presense of the |
import { ChangeDetectionStrategy, Component, HostBinding, Injector, Input } from '@angular/core';
import { WvrBaseComponent } from '../../shared/wvr-base.component';
/**
* The WvrNavLi Component is the list element to be used with the wvre-nav-list element.
*/
@Component({
selector: 'wvr-nav-li-component',
templateUrl: './wvr-nav-li.component.html',
styleUrls: ['./wvr-nav-li.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush
})
export class WvrNavLiComponent extends WvrBaseComponent {
/** A resolvable URI to to which this li will link, when provided. If no link is provided, the list element will not display as a link. */
@Input() href: string;
/** Allows for the override of the --wvr-nav-li-cursor css variable. Default: pointer. */
@HostBinding('style.--wvr-nav-li-cursor') @Input() liCursor;
/** Allows for the override of the --wvr-nav-li-height css variable. Default: 100%. */
@HostBinding('style.--wvr-nav-li-height') @Input() liHeight;
/** Allows for the override of the --wvr-nav-li-width css variable. Default: 140px. */
@HostBinding('style.--wvr-nav-li-width') @Input() liWidth;
/** Allows for the override of the --wvr-nav-link-background-hover css variable. Default: --wvr-primary */
@HostBinding('style.--wvr-nav-link-background-hover') @Input() linkBackgroundHover;
/** Allows for the override of the --wvr-nav-link-color-hover css variable. Default: --wvr-primary */
@HostBinding('style.--wvr-nav-link-color-hover') @Input() linkColorHover;
/** Allows for the override of the --wvr-nav-link-color css variable. --wvr-blue */
@HostBinding('style.--wvr-nav-link-color') @Input() linkColor;
/** Allows for the override of the --wvr-nav-link-font-size css variable. Defualt: inherit */
@HostBinding('style.--wvr-nav-link-font-size') @Input() linkFontSize;
/** Allows for the override of the --wvr-nav-link-font-weight css variable. Default: inherit */
@HostBinding('style.--wvr-nav-link-font-weight') @Input() linkFontWeight;
/** Allows for the override of the --wvr-nav-link-text-decoration-hover css variable. Default: none */
@HostBinding('style.--wvr-nav-link-text-decoration-hover') @Input() linkTextDecorationHover;
constructor(injector: Injector) {
super(injector);
}
}
<div *ngIf="href" class="nav-item d-flex align-items-center justify-content-center" role="menuitem">
<a class="nav-link" [href]="href">
<ng-container *ngTemplateOutlet="contentProjection"></ng-container>
</a>
</div>
<div *ngIf="!href" class="nav-item d-flex align-items-center justify-content-center" role="menuitem">
<ng-container *ngTemplateOutlet="contentProjection"></ng-container>
</div>
<ng-template #contentProjection>
<ng-content></ng-content>
</ng-template>
./wvr-nav-li.component.scss
@import "../../shared/styles/variables";
:host {
@extend .variables;
--wvr-nav-li-cursor: pointer;
--wvr-nav-li-height: 100%;
--wvr-nav-li-width: 140px;
--wvr-nav-link-background-hover: var(--wvr-primary);
--wvr-nav-link-color-hover: var(--wvr-dark);
--wvr-nav-link-color: var(--wvr-blue);
--wvr-nav-link-font-size: inherit;
--wvr-nav-link-font-weight: inherit;
--wvr-nav-link-text-decoration-hover: none;
}
a.nav-link,
[role=menuitem].nav-item {
height: var(--wvr-nav-li-height);
cursor: var(--wvr-nav-li-cursor);
::ng-deep wvre-dropdown {
display: flex;
width: 100%;
height: 100%;
align-content: center;
justify-content: center;
[ngbdropdown],
[ngdropdownanchor],
wvre-dropdown-btn,
.wvr-dropdown {
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
}
wvre-dropdown-menu {
justify-self: self-start;
}
}
}
a.nav-link {
color: var(--wvr-nav-link-color);
font-size: var(--wvr-nav-link-font-size);
font-weight: var(--wvr-nav-link-font-weight);
}
[role=menuitem].nav-item {
min-width: var(--wvr-nav-li-width);
}
[role=menuitem].nav-item:focus-within,
[role=menuitem].nav-item:hover {
color: var(--wvr-nav-link-color-hover);
background: var(--wvr-nav-link-background-hover);
text-decoration: var(--wvr-nav-link-text-decoration-hover);
a.nav-link {
color: var(--wvr-nav-link-color-hover);
text-decoration: var(--wvr-nav-link-text-decoration-hover);
}
}