Skip to content

Releases: udayvunnam/xng-breadcrumb

v6.6.1

25 Feb 03:41
Compare
Choose a tag to compare

Bug Fixes

  • change breadcrumb array to observable with pipe async (#75) (fb05322)

v6.6.0

25 Feb 03:40
Compare
Choose a tag to compare

6.6.0 (2021-02-02)

Features

6.5.0 (2020-12-09)

Features

Bug Fixes

  • use tabindex and listen to keyboard enter since routerLink is no longer used (#67) (de6d7fa)

6.4.0 (2020-11-26)

Features

6.3.4 (2020-11-17)

Bug Fixes

6.3.3 (2020-11-16)

Bug Fixes

  • avoid empty breadcrumb at start when the for autogenerated case (#56) (b82ab8b)

6.3.2 (2020-11-16)

Bug Fixes

  • avoid empty breadcrumb at start when the for autogenerated case (#56) (b82ab8b)

v6.3.1

25 Feb 03:39
Compare
Choose a tag to compare

Changes

v6.3.0

14 Oct 02:24
Compare
Choose a tag to compare

Changes

  • feat: provide breadcrumb route interceptor for conditional routing and access to routing (#51) @udayvunnam

v6.2.0

07 Sep 15:59
Compare
Choose a tag to compare

Changes

v6.1.0

28 Aug 05:39
Compare
Choose a tag to compare

Changes

property Description Type Default
preserveQueryParams preserve query params while navigating via breadcrumbs boolean true
preserveFragment preserve fragment while navigating via breadcrumbs boolean true

Tapi

20 Jul 08:54
Compare
Choose a tag to compare

Uses Nx mono repo for the app and lib management

Krishna

14 Jun 10:09
Compare
Choose a tag to compare
  • Preserve Query Params and Fragment while navigating back via breadcrumbs
  • Disabled state for breadcrumb to block navigation to intermediate routes that have no meaning.
  • Bugfix: Label doesn't update properly while using route path

Narmada

07 Nov 10:35
Compare
Choose a tag to compare

Features

Custom Breadcrumb template (add icons, change text, add i18n ability, etc)

You can display whatever you want in the place of breadcrumb text by providing a custom template.

  • Use *xngBreadcrumbItem directive to provide a custom template
  • breadcrumb label is available implicitly in the template context

Change text case

  {
    path: '',
    pathMatch: 'full',
    component: HomeComponent,
    data: {
      breadcrumb: 'app home'
    }
  }
<xng-breadcrumb>
  <ng-container *xngBreadcrumbItem="let breadcrumb">
    <ng-container>{{ breadcrumb | titlecase }}</ng-container>
  </ng-container>
</xng-breadcrumb>

Add icons in front of label

  • define 'info' associated with breadcrumb in route config. 'info' has type . you can pass string or object as you need.
  • 'info' is available in the context of *xngBreadcrumbItem.
  • Additionally 'first' and 'last' are passed to identify 'first' and 'last' items respectively.
  {
    path: '',
    pathMatch: 'full',
    component: HomeComponent,
    data: {
      breadcrumb: {
        label: 'app home',
        info: 'home'
      }
    }
  }
<xng-breadcrumb>
  <ng-container *xngBreadcrumbItem="let breadcrumb; let info = info; let first = first">
    <mat-icon *ngIf="info">{{ info }}</mat-icon>
    <ng-container *ngIf="!first">{{ breadcrumb }}</ng-container>
  </ng-container>
</xng-breadcrumb>

i18n ability

  • Usually, internationalization is achieved in Angular using libraries like ngx-translate or transloco.
  • These libraries provide a pipe to change text while language is changed.
  • With ngx-translate you can change the language for breadcrumb text as shown below.
<xng-breadcrumb>
  <ng-container *xngBreadcrumbItem="let breadcrumb">
    <ng-container>{{ breadcrumb | translate }}</ng-container>
  </ng-container>
</xng-breadcrumb>

Custom separator

  • Breadcrumb uses '/' as the separator by default.
  • To use custom separator pass separator as an input to <xng-breadcrumb>.
  • You can either use a simple string(>>, -, -->) or a component (mat-icon, fa-icon) as a separator.

string as separator

<xng-breadcrumb separator=">"></xng-breadcrumb>

icon or component as separator

<xng-breadcrumb [separator]="iconTemplate"></xng-breadcrumb>

<ng-template #iconTemplate>
  <mat-icon>arrow_right</mat-icon>
</ng-template>

Custom Breadcrumb Styles

  • <xng-breadcrumb> defines the least possible specificity for selectors, to make it easy to override them.

  • override styles by changing the CSS for corresponding classes. (Keep this styles in app root styles file if you don't want to use ::ng-deep)

  • Below are classes visualization to help which class maps to which box

  • (Optional)xng-breadcrumb takes 'class' as input. This class will be applied to the root of the breadcrumb. This can be used to increase specificity when there are conflicting styles.

    image

.xng-breadcrumb-root {
  padding: 8px 16px;
  display: inline-block;
  border-radius: 4px;
  background-color: #e7f1f1;
}

.xng-breadcrumb-separator {
  padding: 0 4px;
}

BREAKING CHANGES

  • BreadcrumbService's setForAlias(), skip(), skipForAlias() have been deprecated earlier and removed in this release. set() method alone powers all of this features now.
  • class names have been updated. clear names are used for each block xng-breadcrumb-root, xng-breadcrumb-list, xng-breadcrumb-item, xng-breadcrumb-link, xng-breadcrumb-trail. Also ViewEncapsulation.None is used to make it easier to override them by clients

Kaveri

28 Sep 07:04
Compare
Choose a tag to compare