File

projects/tl-elements/src/lib/tl-footer/tl-footer.component.ts

Description

A fullwidth footer component which attaches to the bottom of the document body.

Extends

TamuAbstractBaseComponent

Implements

OnChanges

Metadata

Index

Properties
Methods
Inputs
HostBindings

Constructor

constructor(injector: Injector)
Parameters :
Name Type Optional
injector Injector No

Inputs

loginUrl
Type : string
inheritFontStyle
Type : "true" | "false"

HostBindings

style.--tl-font-family-sans-serif
Type : string
Default value : 'var(--tl-default-font-family-sans-serif)'

Allows for the override of the --tl-font-family-sans-serif css variable.

style.--tl-font-size
Type : string
Default value : 'var(--tl-default-font-size)'

Allows for the override of the --tl-default-font-size css variable.

Methods

index
index(index: number, link: Link)
Parameters :
Name Type Optional
index number No
link Link No
Returns : number
ngOnChanges
ngOnChanges(changes: SimpleChanges)
Parameters :
Name Type Optional
changes SimpleChanges No
Returns : void

Properties

links
Type : Array<Link>
Default value : [ { href: 'https://howdy.tamu.edu/uPortal/normal/render.uP', value: 'howdy.tamu.edu' }, { href: 'https://library.tamu.edu/services/tech_troubleshooting.html', value: 'Off-Campus Access' }, { href: 'http://tamu.edu/', value: 'Texas A& M University' }, { href: 'http://library.tamu.edu/about/compliance.html', value: 'Site Policies' }, { href: 'https://library.tamu.edu/services/accessibility.html', value: 'Accessibility' }, { href: 'https://txcrews.org/', value: 'Texas CREWS' }, { href: 'https://askus.library.tamu.edu/contact/index', value: 'Comments' }, { href: 'https://library.tamu.edu/status/', value: 'Services Status' } ]

Used to iterate the footer navigation list.

variantTypes
Type : []
Default value : ['button']
_fontFamily
Type : string
Default value : 'var(--tl-default-font-family-sans-serif)'
Decorators :
@HostBinding('style.--tl-font-family-sans-serif')

Allows for the override of the --tl-font-family-sans-serif css variable.

_fontSize
Type : string
Default value : 'var(--tl-default-font-size)'
Decorators :
@HostBinding('style.--tl-font-size')

Allows for the override of the --tl-default-font-size css variable.

import { ChangeDetectionStrategy, Component, Injector, Input, OnChanges, SimpleChanges, ViewEncapsulation } from '@angular/core';
import { Link } from '../shared/link';
import { TamuAbstractBaseComponent } from '../shared/tl-abstract-base.component';

export const LOGIN_LABEL = 'Login';

/**
 * A fullwidth footer component which attaches to the bottom of the document body.
 */
@Component({
  selector: 'tl-footer-component',
  templateUrl: './tl-footer.component.html',
  styleUrls: ['./tl-footer.component.scss'],
  encapsulation: ViewEncapsulation.ShadowDom,
  changeDetection: ChangeDetectionStrategy.Default
})
export class TlFooterComponent extends TamuAbstractBaseComponent implements OnChanges {

  @Input() loginUrl: string;

  /** Used to iterate the footer navigation list. */
  links: Array<Link> = [
    { href: 'https://howdy.tamu.edu/uPortal/normal/render.uP', value: 'howdy.tamu.edu' },
    { href: 'https://library.tamu.edu/services/tech_troubleshooting.html', value: 'Off-Campus Access' },
    { href: 'http://tamu.edu/', value: 'Texas A& M University' },
    { href: 'http://library.tamu.edu/about/compliance.html', value: 'Site Policies' },
    { href: 'https://library.tamu.edu/services/accessibility.html', value: 'Accessibility' },
    { href: 'https://txcrews.org/', value: 'Texas CREWS' },
    { href: 'https://askus.library.tamu.edu/contact/index', value: 'Comments' },
    { href: 'https://library.tamu.edu/status/', value: 'Services Status' }
  ];

  variantTypes = ['button'];

  // tslint:disable-next-line:unnecessary-constructor
  constructor(injector: Injector) {
    super(injector);
  }

  ngOnChanges(changes: SimpleChanges): void {
    if (changes.loginUrl) {
      this.links = this.links.filter(link => link.value !== LOGIN_LABEL);
      if (this.loginUrl) {
        this.links.push({
          href: this.loginUrl,
          value: LOGIN_LABEL
        });
      }
    }
  }

  index(index: number, link: Link): number {
    return index;
  }

}
<wvr-footer-component [themeVariant]="'secondary'">
  <template footer-content>
    <wvr-nav-list-component aligned="CENTER">
      <template nav-list-items>
        <wvr-nav-li-component *ngFor="let link of links; trackBy:index" [href]="link.href">
          <wvr-text-component [value]="link.value"></wvr-text-component>
        </wvr-nav-li-component>
      </template>
    </wvr-nav-list-component>
  </template>
</wvr-footer-component>

./tl-footer.component.scss

@import "../shared/styles/tl-encapsulated.scss";
@import "../shared/styles/tl-variables.scss";

:host {
  font-family: var(--tl-font-family-sans-serif);
  wvr-footer-component {
    // Weaver Component overrides
    --wvr-navbar-padding: 0px;
    --wvr-font-family-sans-serif: var(--tl-font-family-sans-serif);
    --wvr-nav-link-font-size: var(--tl-nav-item-font-size);
    --footer-height: 50px;
  }

   // Weaver Nav List overrides for top navigation
   wvr-nav-list-component wvr-nav-li-component {
    --wvr-nav-link-color: var(--primary-button-color);
    --wvr-nav-link-color-hover: var(--warning-button-bg);
    --wvr-nav-link-background-hover: transparent;
    --wvr-nav-link-text-decoration-hover: underline;
    --wvr-nav-li-width: max-content;
  }

  .bg-secondary {
    background-color: var(--primary-default-bg) !important;
  }

  @media (max-width: 992px) {
    wvr-footer-component {
      --footer-height: auto;
      --footer-height: auto;
      wvr-nav-list-component {
        [role=menu].flex-row {
          flex-direction: column !important;
        }
      }
    }
  }
}
Legend
Html element
Component
Html element with directive

results matching ""

    No results matching ""