-
Notifications
You must be signed in to change notification settings - Fork 132
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(core): migrate breadcrumbs component (#8402)
* feat(core): migrate breadcrumbs component * fix(core): fix flickering of the overflow layout items * fix(docs): remove deprecated example * fix(core): dispose subscription on destroy * fix(core): add complete subscriptions on destroy * fix(fn): unsubscribe from observable * fix(core): fix unit tests * fix(core): add deprecation message
- Loading branch information
Showing
33 changed files
with
856 additions
and
509 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 0 additions & 16 deletions
16
.../app/core/component-docs/breadcrumb/examples/breadcrumb-responsive-example.component.html
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,74 @@ | ||
<fd-menu #menu [closeOnEscapeKey]="true" [focusAutoCapture]="true" [placement]="_placement$ | async"> | ||
<ng-container *ngFor="let breadcrumbItem of _collapsedBreadcrumbItems"> | ||
<li fd-menu-item [disabled]="breadcrumbItem.breadcrumbLink ? breadcrumbItem.breadcrumbLink.disabled : false"> | ||
<fd-overflow-layout | ||
[reverseHiddenItems]="reverse" | ||
showMorePosition="left" | ||
[enableKeyboardNavigation]="false" | ||
(visibleItemsCount)="_onVisibleItemsCountChange($event)" | ||
(hiddenItemsCount)="_onHiddenItemsCountChange($event)" | ||
> | ||
<ng-container *ngFor="let breadcrumb of _items"> | ||
<div | ||
*fdOverflowItemRef="breadcrumb; let hidden" | ||
fdOverflowLayoutItem | ||
(hiddenChange)="_onHiddenChange($event, breadcrumb)" | ||
> | ||
<ng-template [cdkPortalOutlet]="breadcrumb.portal"></ng-template> | ||
</div> | ||
</ng-container> | ||
<ng-container *fdOverflowExpand="let breadcrumbs; items: _items"> | ||
<fd-menu #menu [closeOnEscapeKey]="true" [focusAutoCapture]="true" [placement]="_placement$ | async"> | ||
<ng-container *ngFor="let breadcrumbItem of breadcrumbs"> | ||
<li | ||
fd-menu-item | ||
[disabled]=" | ||
breadcrumbItem.item.breadcrumbLink ? breadcrumbItem.item.breadcrumbLink.disabled : false | ||
" | ||
> | ||
<a | ||
fd-menu-interactive | ||
(click)="itemClicked(breadcrumbItem.item, $event)" | ||
(keydown.enter)="itemClicked(breadcrumbItem.item, $event)" | ||
(keydown.space)="itemClicked(breadcrumbItem.item, $event)" | ||
> | ||
<ng-container *ngIf="breadcrumbItem?.item.breadcrumbLink; else portalContent"> | ||
<ng-container *ngIf="breadcrumbItem.item.breadcrumbLink._prefixIconName"> | ||
<fd-menu-addon | ||
position="before" | ||
[glyph]="breadcrumbItem.item.breadcrumbLink._prefixIconName" | ||
></fd-menu-addon> | ||
</ng-container> | ||
<span fd-menu-title> | ||
<ng-container [cdkPortalOutlet]="breadcrumbItem.item.linkContentPortal"></ng-container> | ||
</span> | ||
<ng-container *ngIf="breadcrumbItem.item.breadcrumbLink._postfixIconName"> | ||
<fd-menu-addon | ||
[glyph]="breadcrumbItem.item.breadcrumbLink._postfixIconName" | ||
></fd-menu-addon> | ||
</ng-container> | ||
</ng-container> | ||
<ng-template #portalContent> | ||
<span fd-menu-title> | ||
<ng-container | ||
[cdkPortalOutlet]="breadcrumbItem.item.breadcrumbItemPortal" | ||
></ng-container> | ||
</span> | ||
</ng-template> | ||
</a> | ||
</li> | ||
</ng-container> | ||
</fd-menu> | ||
<span class="fd-breadcrumb__item" *ngIf="breadcrumbs.length > 0" [fdMenuTrigger]="menu"> | ||
<a | ||
fd-menu-interactive | ||
(click)="itemClicked(breadcrumbItem, $event)" | ||
(keydown.enter)="itemClicked(breadcrumbItem, $event)" | ||
(keydown.space)="itemClicked(breadcrumbItem, $event)" | ||
fd-link | ||
tabindex="0" | ||
class="fd-breadcrumb__collapsed" | ||
(keydown.enter)="_keyDownHandle($event)" | ||
(keydown.space)="_keyDownHandle($event)" | ||
> | ||
<ng-container *ngIf="breadcrumbItem?.breadcrumbLink; else portalContent"> | ||
<ng-container *ngIf="breadcrumbItem.breadcrumbLink._prefixIconName"> | ||
<fd-menu-addon | ||
position="before" | ||
[glyph]="breadcrumbItem.breadcrumbLink._prefixIconName" | ||
></fd-menu-addon> | ||
</ng-container> | ||
<span fd-menu-title> | ||
<ng-container [cdkPortalOutlet]="breadcrumbItem.linkContentPortal"></ng-container> | ||
</span> | ||
<ng-container *ngIf="breadcrumbItem.breadcrumbLink._postfixIconName"> | ||
<fd-menu-addon [glyph]="breadcrumbItem.breadcrumbLink._postfixIconName"></fd-menu-addon> | ||
</ng-container> | ||
</ng-container> | ||
<ng-template #portalContent> | ||
<span fd-menu-title> | ||
<ng-container [cdkPortalOutlet]="breadcrumbItem.breadcrumbItemPortal"></ng-container> | ||
</span> | ||
</ng-template> | ||
… | ||
<fd-icon glyph="slim-arrow-down"></fd-icon> | ||
</a> | ||
</li> | ||
</span> | ||
</ng-container> | ||
</fd-menu> | ||
|
||
<span | ||
class="fd-breadcrumb__item" | ||
*ngIf="_collapsedBreadcrumbItems.length" | ||
[fdMenuTrigger]="menu" | ||
#overflowBreadcrumbsContainer | ||
> | ||
<a | ||
fd-link | ||
tabindex="0" | ||
class="fd-breadcrumb__collapsed" | ||
(keydown.enter)="_keyDownHandle($event)" | ||
(keydown.space)="_keyDownHandle($event)" | ||
> | ||
... | ||
<fd-icon glyph="slim-arrow-down"></fd-icon> | ||
</a> | ||
</span> | ||
</fd-overflow-layout> | ||
|
||
<ng-content></ng-content> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,18 @@ | ||
@import '~fundamental-styles/dist/breadcrumb'; | ||
|
||
.fd-breadcrumb { | ||
display: inline-block; | ||
display: flex; | ||
white-space: nowrap; | ||
|
||
.fd-breadcrumb__collapsed { | ||
cursor: pointer; | ||
} | ||
} | ||
|
||
.fd-breadcrumb__item:last-child::after { | ||
content: '/'; | ||
} | ||
|
||
.fd-overflow-layout__item--last .fd-breadcrumb__item::after { | ||
content: none; | ||
} |
Oops, something went wrong.