Renamed 'collapse' to 'collapsable' in navigation types

Renamed navigation component files
Small fix in shortcuts ('nav-item' to 'item')
This commit is contained in:
Sercan Yemen 2018-06-07 20:49:29 +03:00
parent ba35ebae94
commit a39021188e
21 changed files with 61 additions and 58 deletions

View File

@ -31,18 +31,19 @@
[ngStyle]="{'background-color': item.badge.bg,'color': item.badge.fg}"> [ngStyle]="{'background-color': item.badge.bg,'color': item.badge.fg}">
{{item.badge.title}} {{item.badge.title}}
</span> </span>
<mat-icon class="collapse-arrow">keyboard_arrow_right</mat-icon> <mat-icon class="collapsable-arrow">keyboard_arrow_right</mat-icon>
</ng-template> </ng-template>
<div class="children" [ngClass]="{'open': isOpen}"> <div class="children" [ngClass]="{'open': isOpen}">
<div class="{{fuseSettings.colorClasses.navbar}}"> <div class="{{fuseConfig.layout.navbar.background}}">
<ng-container *ngFor="let item of item.children"> <ng-container *ngFor="let item of item.children">
<fuse-nav-horizontal-item *ngIf="item.type=='item'" [item]="item"></fuse-nav-horizontal-item> <fuse-nav-horizontal-item *ngIf="item.type=='item'" [item]="item"></fuse-nav-horizontal-item>
<fuse-nav-horizontal-collapse *ngIf="item.type=='collapse'" <fuse-nav-horizontal-collapsable *ngIf="item.type=='collapsable'"
[item]="item"></fuse-nav-horizontal-collapse> [item]="item"></fuse-nav-horizontal-collapsable>
<fuse-nav-horizontal-collapse *ngIf="item.type=='group'" [item]="item"></fuse-nav-horizontal-collapse> <fuse-nav-horizontal-collapsable *ngIf="item.type=='group'"
[item]="item"></fuse-nav-horizontal-collapsable>
</ng-container> </ng-container>
</div> </div>

View File

@ -6,18 +6,18 @@ import { fuseAnimations } from '@fuse/animations';
import { FuseConfigService } from '@fuse/services/config.service'; import { FuseConfigService } from '@fuse/services/config.service';
@Component({ @Component({
selector : 'fuse-nav-horizontal-collapse', selector : 'fuse-nav-horizontal-collapsable',
templateUrl: './nav-horizontal-collapse.component.html', templateUrl: './collapsable.component.html',
styleUrls : ['./nav-horizontal-collapse.component.scss'], styleUrls : ['./collapsable.component.scss'],
animations : fuseAnimations animations : fuseAnimations
}) })
export class FuseNavHorizontalCollapseComponent implements OnInit, OnDestroy export class FuseNavHorizontalCollapsableComponent implements OnInit, OnDestroy
{ {
fuseConfig: any; fuseConfig: any;
isOpen = false; isOpen = false;
@HostBinding('class') @HostBinding('class')
classes = 'nav-item nav-collapse'; classes = 'nav-collapsable nav-item';
@Input() @Input()
item: any; item: any;

View File

@ -2,8 +2,8 @@ import { Component, HostBinding, Input } from '@angular/core';
@Component({ @Component({
selector : 'fuse-nav-horizontal-item', selector : 'fuse-nav-horizontal-item',
templateUrl: './nav-horizontal-item.component.html', templateUrl: './item.component.html',
styleUrls : ['./nav-horizontal-item.component.scss'] styleUrls : ['./item.component.scss']
}) })
export class FuseNavHorizontalItemComponent export class FuseNavHorizontalItemComponent
{ {

View File

@ -7,7 +7,7 @@
<ng-container *ngFor="let item of navigation"> <ng-container *ngFor="let item of navigation">
<fuse-nav-vertical-group *ngIf="item.type=='group'" [item]="item"></fuse-nav-vertical-group> <fuse-nav-vertical-group *ngIf="item.type=='group'" [item]="item"></fuse-nav-vertical-group>
<fuse-nav-vertical-collapse *ngIf="item.type=='collapse'" [item]="item"></fuse-nav-vertical-collapse> <fuse-nav-vertical-collapsable *ngIf="item.type=='collapse'" [item]="item"></fuse-nav-vertical-collapsable>
<fuse-nav-vertical-item *ngIf="item.type=='item'" [item]="item"></fuse-nav-vertical-item> <fuse-nav-vertical-item *ngIf="item.type=='item'" [item]="item"></fuse-nav-vertical-item>
</ng-container> </ng-container>
@ -20,8 +20,8 @@
<ng-container *ngFor="let item of navigation"> <ng-container *ngFor="let item of navigation">
<fuse-nav-horizontal-collapse *ngIf="item.type=='group'" [item]="item"></fuse-nav-horizontal-collapse> <fuse-nav-horizontal-collapsable *ngIf="item.type=='group'" [item]="item"></fuse-nav-horizontal-collapsable>
<fuse-nav-horizontal-collapse *ngIf="item.type=='collapse'" [item]="item"></fuse-nav-horizontal-collapse> <fuse-nav-horizontal-collapsable *ngIf="item.type=='collapse'" [item]="item"></fuse-nav-horizontal-collapsable>
<fuse-nav-horizontal-item *ngIf="item.type=='item'" [item]="item"></fuse-nav-horizontal-item> <fuse-nav-horizontal-item *ngIf="item.type=='item'" [item]="item"></fuse-nav-horizontal-item>
</ng-container> </ng-container>

View File

@ -6,11 +6,11 @@ import { MatIconModule, MatRippleModule } from '@angular/material';
import { TranslateModule } from '@ngx-translate/core'; import { TranslateModule } from '@ngx-translate/core';
import { FuseNavigationComponent } from './navigation.component'; import { FuseNavigationComponent } from './navigation.component';
import { FuseNavVerticalItemComponent } from './vertical/nav-item/nav-vertical-item.component'; import { FuseNavVerticalItemComponent } from './vertical/item/item.component';
import { FuseNavVerticalCollapseComponent } from './vertical/nav-collapse/nav-vertical-collapse.component'; import { FuseNavVerticalCollapsableComponent } from './vertical/collapsable/collapsable.component';
import { FuseNavVerticalGroupComponent } from './vertical/nav-group/nav-vertical-group.component'; import { FuseNavVerticalGroupComponent } from './vertical/group/group.component';
import { FuseNavHorizontalItemComponent } from './horizontal/nav-item/nav-horizontal-item.component'; import { FuseNavHorizontalItemComponent } from './horizontal/item/item.component';
import { FuseNavHorizontalCollapseComponent } from './horizontal/nav-collapse/nav-horizontal-collapse.component'; import { FuseNavHorizontalCollapsableComponent } from './horizontal/collapsable/collapsable.component';
@NgModule({ @NgModule({
imports : [ imports : [
@ -29,9 +29,9 @@ import { FuseNavHorizontalCollapseComponent } from './horizontal/nav-collapse/na
FuseNavigationComponent, FuseNavigationComponent,
FuseNavVerticalGroupComponent, FuseNavVerticalGroupComponent,
FuseNavVerticalItemComponent, FuseNavVerticalItemComponent,
FuseNavVerticalCollapseComponent, FuseNavVerticalCollapsableComponent,
FuseNavHorizontalItemComponent, FuseNavHorizontalItemComponent,
FuseNavHorizontalCollapseComponent FuseNavHorizontalCollapsableComponent
] ]
}) })
export class FuseNavigationModule export class FuseNavigationModule

View File

@ -47,13 +47,14 @@
[ngStyle]="{'background-color': item.badge.bg,'color': item.badge.fg}"> [ngStyle]="{'background-color': item.badge.bg,'color': item.badge.fg}">
{{item.badge.title}} {{item.badge.title}}
</span> </span>
<mat-icon class="collapse-arrow">keyboard_arrow_right</mat-icon> <mat-icon class="collapsable-arrow">keyboard_arrow_right</mat-icon>
</ng-template> </ng-template>
<div class="children" [@slideInOut]="isOpen"> <div class="children" [@slideInOut]="isOpen">
<ng-container *ngFor="let item of item.children"> <ng-container *ngFor="let item of item.children">
<fuse-nav-vertical-item *ngIf="item.type=='item'" [item]="item"></fuse-nav-vertical-item> <fuse-nav-vertical-item *ngIf="item.type=='item'" [item]="item"></fuse-nav-vertical-item>
<fuse-nav-vertical-collapse *ngIf="item.type=='collapse'" [item]="item"></fuse-nav-vertical-collapse> <fuse-nav-vertical-collapsable *ngIf="item.type=='collapsable'"
[item]="item"></fuse-nav-vertical-collapsable>
<fuse-nav-vertical-group *ngIf="item.type=='group'" [item]="item"></fuse-nav-vertical-group> <fuse-nav-vertical-group *ngIf="item.type=='group'" [item]="item"></fuse-nav-vertical-group>
</ng-container> </ng-container>
</div> </div>

View File

@ -8,18 +8,18 @@ import { fuseAnimations } from '@fuse/animations';
import { FuseNavigationService } from '@fuse/components/navigation/navigation.service'; import { FuseNavigationService } from '@fuse/components/navigation/navigation.service';
@Component({ @Component({
selector : 'fuse-nav-vertical-collapse', selector : 'fuse-nav-vertical-collapsable',
templateUrl: './nav-vertical-collapse.component.html', templateUrl: './collapsable.component.html',
styleUrls : ['./nav-vertical-collapse.component.scss'], styleUrls : ['./collapsable.component.scss'],
animations : fuseAnimations animations : fuseAnimations
}) })
export class FuseNavVerticalCollapseComponent implements OnInit, OnDestroy export class FuseNavVerticalCollapsableComponent implements OnInit, OnDestroy
{ {
@Input() @Input()
item: FuseNavigationItem; item: FuseNavigationItem;
@HostBinding('class') @HostBinding('class')
classes = 'nav-collapse nav-item'; classes = 'nav-collapsable nav-item';
@HostBinding('class.open') @HostBinding('class.open')
public isOpen = false; public isOpen = false;

View File

@ -7,7 +7,8 @@
<div class="group-items"> <div class="group-items">
<ng-container *ngFor="let item of item.children"> <ng-container *ngFor="let item of item.children">
<fuse-nav-vertical-group *ngIf="item.type=='group'" [item]="item"></fuse-nav-vertical-group> <fuse-nav-vertical-group *ngIf="item.type=='group'" [item]="item"></fuse-nav-vertical-group>
<fuse-nav-vertical-collapse *ngIf="item.type=='collapse'" [item]="item"></fuse-nav-vertical-collapse> <fuse-nav-vertical-collapsable *ngIf="item.type=='collapsable'"
[item]="item"></fuse-nav-vertical-collapsable>
<fuse-nav-vertical-item *ngIf="item.type=='item'" [item]="item"></fuse-nav-vertical-item> <fuse-nav-vertical-item *ngIf="item.type=='item'" [item]="item"></fuse-nav-vertical-item>
</ng-container> </ng-container>
</div> </div>

View File

@ -4,8 +4,8 @@ import { FuseNavigationItem } from '@fuse/types';
@Component({ @Component({
selector : 'fuse-nav-vertical-group', selector : 'fuse-nav-vertical-group',
templateUrl: './nav-vertical-group.component.html', templateUrl: './group.component.html',
styleUrls : ['./nav-vertical-group.component.scss'] styleUrls : ['./group.component.scss']
}) })
export class FuseNavVerticalGroupComponent export class FuseNavVerticalGroupComponent
{ {

View File

@ -4,8 +4,8 @@ import { FuseNavigationItem } from '@fuse/types';
@Component({ @Component({
selector : 'fuse-nav-vertical-item', selector : 'fuse-nav-vertical-item',
templateUrl: './nav-vertical-item.component.html', templateUrl: './item.component.html',
styleUrls : ['./nav-vertical-item.component.scss'] styleUrls : ['./item.component.scss']
}) })
export class FuseNavVerticalItemComponent export class FuseNavVerticalItemComponent
{ {

View File

@ -95,25 +95,25 @@ export class FuseShortcutsComponent implements OnInit, OnDestroy
this.shortcutItems = [ this.shortcutItems = [
{ {
'title': 'Calendar', 'title': 'Calendar',
'type' : 'nav-item', 'type' : 'item',
'icon' : 'today', 'icon' : 'today',
'url' : '/apps/calendar' 'url' : '/apps/calendar'
}, },
{ {
'title': 'Mail', 'title': 'Mail',
'type' : 'nav-item', 'type' : 'item',
'icon' : 'email', 'icon' : 'email',
'url' : '/apps/mail' 'url' : '/apps/mail'
}, },
{ {
'title': 'Contacts', 'title': 'Contacts',
'type' : 'nav-item', 'type' : 'item',
'icon' : 'account_box', 'icon' : 'account_box',
'url' : '/apps/contacts' 'url' : '/apps/contacts'
}, },
{ {
'title': 'To-Do', 'title': 'To-Do',
'type' : 'nav-item', 'type' : 'item',
'icon' : 'check_box', 'icon' : 'check_box',
'url' : '/apps/todo' 'url' : '/apps/todo'
} }

View File

@ -58,7 +58,7 @@
transition: opacity 0.2s ease-in-out 0.1s; transition: opacity 0.2s ease-in-out 0.1s;
margin-left: 8px; margin-left: 8px;
+ .collapse-arrow { + .collapsable-arrow {
margin-left: 8px; margin-left: 8px;
} }
} }
@ -93,7 +93,7 @@
} }
.nav-link-icon, .nav-link-icon,
.collapse-arrow { .collapsable-arrow {
font-size: 16px; font-size: 16px;
width: 16px; width: 16px;
height: 16px; height: 16px;
@ -103,7 +103,7 @@
} }
} }
&.nav-collapse { &.nav-collapsable {
display: block; display: block;
> .children { > .children {
@ -135,7 +135,7 @@
> .nav-item { > .nav-item {
&.nav-collapse { &.nav-collapsable {
background: transparent; background: transparent;
transition: background 200ms ease-in-out; transition: background 200ms ease-in-out;
@ -149,7 +149,7 @@
> .group-items { > .group-items {
> .nav-collapse { > .nav-collapsable {
background: transparent; background: transparent;
transition: background 200ms ease-in-out; transition: background 200ms ease-in-out;
@ -176,7 +176,7 @@
.nav-item { .nav-item {
&.nav-collapse { &.nav-collapsable {
position: relative; position: relative;
.children { .children {
@ -205,13 +205,13 @@
height: 56px; height: 56px;
} }
&.nav-collapse { &.nav-collapsable {
position: relative; position: relative;
> .nav-link { > .nav-link {
height: 56px; height: 56px;
.collapse-arrow { .collapsable-arrow {
display: none; display: none;
} }
} }

View File

@ -2,7 +2,7 @@ export interface FuseNavigationItem
{ {
id: string; id: string;
title: string; title: string;
type: 'item' | 'group' | 'collapse'; type: 'item' | 'group' | 'collapsable';
translate?: string; translate?: string;
icon?: string; icon?: string;
hidden?: boolean; hidden?: boolean;

View File

@ -12,7 +12,7 @@ export const navigation: FuseNavigation[] = [
id : 'dashboards', id : 'dashboards',
title : 'Dashboards', title : 'Dashboards',
translate: 'NAV.DASHBOARDS', translate: 'NAV.DASHBOARDS',
type : 'collapse', type : 'collapsable',
icon : 'dashboard', icon : 'dashboard',
children : [ children : [
{ {
@ -41,7 +41,7 @@ export const navigation: FuseNavigation[] = [
id : 'e-commerce', id : 'e-commerce',
title : 'E-Commerce', title : 'E-Commerce',
translate: 'NAV.ECOMMERCE', translate: 'NAV.ECOMMERCE',
type : 'collapse', type : 'collapsable',
icon : 'shopping_cart', icon : 'shopping_cart',
children : [ children : [
{ {
@ -177,7 +177,7 @@ export const navigation: FuseNavigation[] = [
{ {
id : 'authentication', id : 'authentication',
title : 'Authentication', title : 'Authentication',
type : 'collapse', type : 'collapsable',
icon : 'lock', icon : 'lock',
badge : { badge : {
title: '10', title: '10',
@ -257,7 +257,7 @@ export const navigation: FuseNavigation[] = [
{ {
id : 'errors', id : 'errors',
title : 'Errors', title : 'Errors',
type : 'collapse', type : 'collapsable',
icon : 'error', icon : 'error',
children: [ children: [
{ {
@ -277,7 +277,7 @@ export const navigation: FuseNavigation[] = [
{ {
id : 'invoice', id : 'invoice',
title : 'Invoice', title : 'Invoice',
type : 'collapse', type : 'collapsable',
icon : 'receipt', icon : 'receipt',
children: [ children: [
{ {
@ -304,7 +304,7 @@ export const navigation: FuseNavigation[] = [
{ {
id : 'pricing', id : 'pricing',
title : 'Pricing', title : 'Pricing',
type : 'collapse', type : 'collapsable',
icon : 'attach_money', icon : 'attach_money',
children: [ children: [
{ {
@ -394,13 +394,13 @@ export const navigation: FuseNavigation[] = [
{ {
id : 'page-layouts', id : 'page-layouts',
title : 'Page Layouts', title : 'Page Layouts',
type : 'collapse', type : 'collapsable',
icon : 'view_quilt', icon : 'view_quilt',
children: [ children: [
{ {
id : 'carded', id : 'carded',
title : 'Carded', title : 'Carded',
type : 'collapse', type : 'collapsable',
badge : { badge : {
title: '12', title: '12',
bg : '#525e8a', bg : '#525e8a',
@ -484,7 +484,7 @@ export const navigation: FuseNavigation[] = [
{ {
id : 'simple', id : 'simple',
title : 'Simple', title : 'Simple',
type : 'collapse', type : 'collapsable',
badge : { badge : {
title: '8', title: '8',
bg : '#525e8a', bg : '#525e8a',
@ -589,7 +589,7 @@ export const navigation: FuseNavigation[] = [
{ {
id : 'angular-material-elements', id : 'angular-material-elements',
title : 'Angular Material Elements', title : 'Angular Material Elements',
type : 'collapse', type : 'collapsable',
icon : 'layers', icon : 'layers',
children: [ children: [
{ {
@ -927,7 +927,7 @@ export const navigation: FuseNavigation[] = [
{ {
id : 'datatables', id : 'datatables',
title : 'Datatables', title : 'Datatables',
type : 'collapse', type : 'collapsable',
icon : 'border_all', icon : 'border_all',
children: [ children: [
{ {