diff --git a/src/app/core/animations.ts b/src/app/core/animations.ts index 614d7774..d6f3ff61 100644 --- a/src/app/core/animations.ts +++ b/src/app/core/animations.ts @@ -4,6 +4,19 @@ import { sequence, trigger, stagger, animate, style, group, query, transition, k export class Animations { + public static fadeInOut = trigger('fadeInOut', [ + state('0', style({ + display: 'none', + opacity: 0 + })), + state('1', style({ + display: 'block', + opacity: 1 + })), + transition('1 => 0', animate('300ms ease-out')), + transition('0 => 1', animate('300ms ease-in')) + ]); + public static slideInOut = trigger('slideInOut', [ state('0', style({ height : '0px', diff --git a/src/app/core/components/navigation/horizontal/nav-collapse/nav-horizontal-collapse.component.html b/src/app/core/components/navigation/horizontal/nav-collapse/nav-horizontal-collapse.component.html new file mode 100644 index 00000000..045e077d --- /dev/null +++ b/src/app/core/components/navigation/horizontal/nav-collapse/nav-horizontal-collapse.component.html @@ -0,0 +1,19 @@ + + {{item.icon}} + {{item.title}} + keyboard_arrow_right + + +
+ +
+ + + + + + +
+ +
\ No newline at end of file diff --git a/src/app/core/components/navigation/horizontal/nav-collapse/nav-horizontal-collapse.component.scss b/src/app/core/components/navigation/horizontal/nav-collapse/nav-horizontal-collapse.component.scss new file mode 100644 index 00000000..32c65c8c --- /dev/null +++ b/src/app/core/components/navigation/horizontal/nav-collapse/nav-horizontal-collapse.component.scss @@ -0,0 +1,3 @@ +:host { + +} diff --git a/src/app/core/components/navigation/horizontal/nav-collapse/nav-horizontal-collapse.component.ts b/src/app/core/components/navigation/horizontal/nav-collapse/nav-horizontal-collapse.component.ts new file mode 100644 index 00000000..84954253 --- /dev/null +++ b/src/app/core/components/navigation/horizontal/nav-collapse/nav-horizontal-collapse.component.ts @@ -0,0 +1,50 @@ +import { Component, HostBinding, HostListener, Input, OnDestroy } from '@angular/core'; +import { Animations } from '../../../../animations'; +import { FuseConfigService } from '../../../../services/config.service'; +import { Subscription } from 'rxjs/Subscription'; + +@Component({ + selector : 'fuse-nav-horizontal-collapse', + templateUrl: './nav-horizontal-collapse.component.html', + styleUrls : ['./nav-horizontal-collapse.component.scss'], + animations : [Animations.slideInOut] +}) +export class FuseNavHorizontalCollapseComponent implements OnDestroy +{ + onSettingsChanged: Subscription; + fuseSettings: any; + isOpen = false; + + @HostBinding('class') classes = 'nav-item nav-collapse'; + @Input() item: any; + + @HostListener('mouseenter') + open() + { + this.isOpen = true; + } + + @HostListener('mouseleave') + close() + { + this.isOpen = false; + } + + constructor( + private fuseConfig: FuseConfigService + ) + { + this.onSettingsChanged = + this.fuseConfig.onSettingsChanged + .subscribe( + (newSettings) => { + this.fuseSettings = newSettings; + } + ); + } + + ngOnDestroy() + { + this.onSettingsChanged.unsubscribe(); + } +} diff --git a/src/app/core/components/navigation/horizontal/nav-item/nav-horizontal-item.component.html b/src/app/core/components/navigation/horizontal/nav-item/nav-horizontal-item.component.html new file mode 100644 index 00000000..54045a83 --- /dev/null +++ b/src/app/core/components/navigation/horizontal/nav-item/nav-horizontal-item.component.html @@ -0,0 +1,6 @@ + + {{item.icon}} + {{item.title}} + {{item.badge.title}} + \ No newline at end of file diff --git a/src/app/core/components/navigation/horizontal/nav-item/nav-horizontal-item.component.scss b/src/app/core/components/navigation/horizontal/nav-item/nav-horizontal-item.component.scss new file mode 100644 index 00000000..32c65c8c --- /dev/null +++ b/src/app/core/components/navigation/horizontal/nav-item/nav-horizontal-item.component.scss @@ -0,0 +1,3 @@ +:host { + +} diff --git a/src/app/core/components/navigation/horizontal/nav-item/nav-horizontal-item.component.ts b/src/app/core/components/navigation/horizontal/nav-item/nav-horizontal-item.component.ts new file mode 100644 index 00000000..8f9d0b25 --- /dev/null +++ b/src/app/core/components/navigation/horizontal/nav-item/nav-horizontal-item.component.ts @@ -0,0 +1,12 @@ +import { Component, HostBinding, Input } from '@angular/core'; + +@Component({ + selector : 'fuse-nav-horizontal-item', + templateUrl: './nav-horizontal-item.component.html', + styleUrls : ['./nav-horizontal-item.component.scss'] +}) +export class FuseNavHorizontalItemComponent +{ + @HostBinding('class') classes = 'nav-item'; + @Input() item: any; +} diff --git a/src/app/core/components/navigation/nav-subheader/nav-subheader.component.ts b/src/app/core/components/navigation/nav-subheader/nav-subheader.component.ts deleted file mode 100644 index d2ed28b9..00000000 --- a/src/app/core/components/navigation/nav-subheader/nav-subheader.component.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { Component, HostBinding, Input, OnInit } from '@angular/core'; - -@Component({ - selector : 'fuse-nav-subheader', - templateUrl: './nav-subheader.component.html', - styleUrls : ['./nav-subheader.component.scss'] -}) -export class FuseNavSubheaderComponent implements OnInit -{ - @HostBinding('class') classes = 'nav-subheader'; - @Input() item: any; - - constructor() - { - } - - ngOnInit() - { - } - -} diff --git a/src/app/core/components/navigation/navigation.component.html b/src/app/core/components/navigation/navigation.component.html index 1eb592cd..12b31aff 100644 --- a/src/app/core/components/navigation/navigation.component.html +++ b/src/app/core/components/navigation/navigation.component.html @@ -1,11 +1,27 @@ -