Compare commits

..

79 Commits

Author SHA1 Message Date
Sercan Yemen
798e2632bc Updated changelog 2018-07-13 18:58:02 +03:00
Sercan Yemen
19c960cc4c (Navbar) Moved navbar style into the variants
(AppComponent) Moved boxed class to the body
Fixed: Horizontal layout navbar covers entire screen
2018-07-13 18:55:45 +03:00
Sercan Yemen
8dfc3e854b Added comments to the app.component.html 2018-07-13 18:47:29 +03:00
Sercan Yemen
04b80ca168 Updated changelog 2018-07-13 14:43:03 +03:00
Sercan Yemen
54451bb19e (FuseProgressBar) Added new component and its service
(LoadingBarService) Removed due to the new progress bar service
Added documentation for the FuseProgressBar
2018-07-13 14:16:05 +03:00
Sercan Yemen
5e98d986e2 (AppComponent) Property order fix 2018-07-13 12:54:02 +03:00
Sercan Yemen
293192557f Updated Angular and various other packages
Increased the Fuse version number
2018-07-13 12:23:56 +03:00
Sercan Yemen
d61549d9e6 Fixed: Scrolling is not smooth on iOS devices 2018-07-13 12:23:30 +03:00
Sercan Yemen
b2ceb02709 Updated changelog and nav badge 2018-07-12 17:49:16 +03:00
Sercan Yemen
ffbd000fe2 (Chat Panel) Style and logic tweaks 2018-07-12 17:45:46 +03:00
Sercan Yemen
b6ebd2b839 (Navbar) Fixed: IE11 issues
(Chat Panel) Fixed: IE11 issues
2018-07-12 16:04:56 +03:00
Sercan Yemen
4d4d52ba05 (Navbar) Fixed: Style variant 2 doesn't scroll on Firefox, IE & Edge
(Chat Panel) Fixed: Doesn't scroll on Firefox, IE & Edge
Increased Fuse version
2018-07-12 15:48:55 +03:00
Sercan Yemen
251732f221 Updated changelog 2018-07-12 13:59:51 +03:00
Sercan Yemen
1c34a65034 Increased Fuse version 2018-07-12 13:30:17 +03:00
Sercan Yemen
b8803a055f Removed side panel from auth pages
Updated the changelog
Theme options button adjustments
2018-07-12 13:27:26 +03:00
Sercan Yemen
6b8cd41d5e Added SidePanel to the layouts for controlling the chat bar and possible other bar properties via FuseConfig 2018-07-12 13:19:34 +03:00
Sercan Yemen
2c7ef4de00 Updated Fuse version and changelog 2018-07-12 11:38:02 +03:00
Sercan Yemen
fdb572fadd (Toolbar) Removed unnecessary chat panel toggle method 2018-07-12 11:13:09 +03:00
Sercan Yemen
528c3f95e7 (Navbar) Fixed: Navbar doesn't grow if it has a small content 2018-07-12 11:04:54 +03:00
Sercan Yemen
f395046945 (Chat Panel) Removed mat-list, moved mat-tooltip to the avatar due to mobile scrolling issues 2018-07-12 10:48:31 +03:00
Sercan Yemen
b099022f5a (FuseSidebar) Max. width & width tweaks for small screen devices 2018-07-12 10:20:34 +03:00
Sercan Yemen
25a6ca2684 (Navbar) Added classes to the navbar containing fuse-sidebar's to contain their custom styles 2018-07-12 09:25:56 +03:00
Sercan Yemen
0cd5d613e0 (AppComponent) Added missing 'is-mobile' control - Fixes: Visible scrollbars on some mobile devices 2018-07-12 09:24:54 +03:00
Sercan Yemen
f45ad11861 Updated changelog date 2018-07-11 11:03:37 +03:00
Sercan Yemen
3cbe302b54 (Toolbar) Changed the username + Small margin tweaks
(Navbar) Style variant 2 adjustments and tweaks
2018-07-11 10:29:21 +03:00
Sercan Yemen
e1c906f08b (Chat Panel) Don't unfold the panel on hover
(Chat Panel) Always keep the contacts list in view
2018-07-10 14:55:30 +03:00
Sercan Yemen
585709cf93 (FuseSidebar) Exported temporary fold & unfold methods
(FuseSidebar) Added [foldedAutoTriggerOnHover] input for disabling the fold/unfold on mouseenter/mouseleave
(Chat Panel) Don't unfold the panel on hover
(Chat Panel) Always keep the contacts list in view
2018-07-10 14:55:08 +03:00
Sercan Yemen
ac70ecc616 (Navbar) Improved the style variant 1
Updated Changelog
2018-07-10 13:47:58 +03:00
Sercan Yemen
d5b64f3258 Updated Angular Material to 6.3.3 2018-07-10 12:26:55 +03:00
Sercan Yemen
59d838ef51 Updated changelog 2018-07-10 12:26:40 +03:00
Sercan Yemen
8b14366763 (Angular Material Examples) Updated the examples 2018-07-10 12:26:29 +03:00
Sercan Yemen
23b86a7e3d (Navbar) Style1 variant folded height 2018-07-10 12:26:04 +03:00
Sercan Yemen
2f497f1c7b (Navbar) Improved navbar style1 variant 2018-07-10 11:55:04 +03:00
Sercan Yemen
18009c9275 (Navbar) Finished navbar variants 2018-07-09 21:29:15 +03:00
Sercan Yemen
20d5a68bf3 (Colors) Further improved the color generators + added adaptive-border-color class 2018-07-09 16:37:00 +03:00
Sercan Yemen
59d53ba0b9 (Colors) Improved the color generators 2018-07-09 16:29:46 +03:00
Sercan Yemen
a6c91dd744 (AngularCLI) Added a configuration to serve with extractCss and sourceMap enabled 2018-07-09 14:31:11 +03:00
Sercan Yemen
5045482ef5 (Navbar) Started to adding new style variants to the navbar (wip) 2018-07-09 14:09:53 +03:00
Sercan Yemen
c7d9a7808a (Footer) Updated buy button link 2018-07-06 10:55:18 +03:00
Sercan Yemen
e4c0340cd7 (Sidebar) Import the takeUntil from the correct location 2018-07-04 19:32:24 +03:00
Sercan Yemen
67cb05be6b (Chat) Replaced multi line comments with single line comments 2018-07-04 17:55:52 +03:00
Sercan Yemen
634ff42f1a (Navigation) Updated version number badge 2018-07-04 17:50:37 +03:00
Sercan Yemen
0149beb33c (Chat Panel) Small color tweak on logo
Updated Angular Material to 6.3.2
Updated the changelog
Increased the Fuse version to 6.2.0 due to the amount of new stuff
2018-07-04 17:49:44 +03:00
Sercan Yemen
42d9748b10 (Chat Panel) Changed the chat panel icon and title 2018-07-04 17:29:44 +03:00
Sercan Yemen
8355e8a17c Updated changelog 2018-07-04 17:26:25 +03:00
Sercan Yemen
dbb925334a (Chat Panel) Styling adjustments 2018-07-04 17:21:51 +03:00
Sercan Yemen
49c8e32dce (Chat Panel) Styling adjustments 2018-07-03 21:05:52 +03:00
Sercan Yemen
595b16275b (Chat Panel) Added a chat panel 2018-07-03 18:23:51 +03:00
Sercan Yemen
fb003bc96f (Scrumboard) Removed an extra semi-colon 2018-07-03 18:06:33 +03:00
Sercan Yemen
d781e59928 (Sidebar) Added "foldedWidth" input for controlling the width of the folded sidebar
(Sidebar) Replaced the margin with padding on the folded sidebar's sibling
(Docs) Updated Sidebar docs
2018-07-03 13:54:19 +03:00
Sercan Yemen
89f71735a8 (Footer) Make the footer fixed for the Demo so the links can be seen at all times 2018-07-03 13:51:31 +03:00
Sercan Yemen
51d7c6fd6f (Contacts) Make the "Add Contact" button sticky on mobile devices 2018-07-02 19:51:37 +03:00
Sercan Yemen
e182f19644 Fix scss import path 2018-07-02 19:48:48 +03:00
Sercan Yemen
a1aed2998d (Navbar) Small fix for "scroll the active menu item into the view" 2018-07-02 16:46:55 +03:00
Sercan Yemen
7ff1d2aed0 (Navbar) Scroll the active menu item into the view 2018-07-02 15:58:07 +03:00
Sercan Yemen
09d1b1034e (Fuse) Tree-shakable core services, closes #64 2018-07-02 14:30:18 +03:00
Sercan Yemen
4e98ab1682 (Search Bar) Fixed: Height adjustment happens on the wrong media step 2018-07-02 13:29:33 +03:00
Sercan Yemen
984004d07a (Toolbar) Fixed: Unnecessary _.find in setLanguage method, Closes #66
(Navigation) Fixed: Removed id causing a style issue
2018-07-02 13:22:14 +03:00
Sercan Yemen
64e0451dc6 Removed the id from the navigation as there might be multiple navigations
Fixed: getFlatNavigation doesn't correctly get the 'collapsable' items because of the item.type change
Closes #71: getFlatNavigation method not correctly working when its called multiple times
2018-07-02 13:15:49 +03:00
Sercan Yemen
224bbf479a Fixed the Loading bar service small issue 2018-07-02 11:42:03 +03:00
Sercan Yemen
1aa79c257b Updated the changelog 2018-07-01 14:06:41 +03:00
Sercan Yemen
4d93b6acef Added a service for the Loading Bar
Added FuseLoadingBarService docs
Renamed service docs files
2018-07-01 14:02:14 +03:00
Sercan Yemen
ae29f1f03d Added 'openedChanged' and 'foldedChanged' events to the sidebar
Updated the Sidebar docs
2018-07-01 13:10:11 +03:00
Sercan Yemen
f35c1add1c Added ability to add custom classes to the navigation items using the "classes" property
Fixed: Item function and External URL's are missing from horizontal navigation
Fixed: Horizontal navigation active item does not highlight correctly
2018-07-01 12:20:33 +03:00
Sercan Yemen
388b724e90 Revert version number increase 2018-06-29 16:58:00 +03:00
Sercan Yemen
023bfea4df Removed the types definition for Webstorm IDE compatibility 2018-06-28 20:59:55 +03:00
Sercan Yemen
fd4da1e060 Simplified the class and the template as we don't need an extra object for errors
Used native .hasError checks on template
2018-06-28 20:34:43 +03:00
Sercan Yemen
85226e6094 Fixed: Changing 'password' field while 'passwordConfirm' field is filled doesn't trigger the 'confirmPassword' validator
Simplified the class and the template as we don't need an extra object for errors
Used native .hasError checks on template
2018-06-28 20:11:36 +03:00
Sercan Yemen
26a7cc41de Fixed broken print styles due to the latest layout updates 2018-06-28 17:39:22 +03:00
Sercan Yemen
3deba51322 Updated Angular & Angular Material
Increase the Fuse version number
Fixed the HMR serve ('npm run start-hmr' and 'npm run start-hmr-sourcemaps')
2018-06-28 13:28:56 +03:00
Sercan Yemen
1835c060d6 Updated the package-lock.json 2018-06-20 17:07:06 +03:00
Sercan Yemen
f75d458abe Added changelog for v6.1.2 2018-06-20 16:37:59 +03:00
Sercan Yemen
6320e98938 Added sticky header to the e-commerce tables 2018-06-20 16:36:31 +03:00
Sercan Yemen
94d20f8d8d Replace cdkTable stuff with matTable since table now is a proper Material element 2018-06-20 16:32:26 +03:00
Sercan Yemen
ba2f50bf62 Fixed Angular Material datepicker examples 2018-06-20 16:29:28 +03:00
Sercan Yemen
13746c2a73 Updated Angular Material examples 2018-06-20 16:16:03 +03:00
Sercan Yemen
faef6ec6f8 Increased the Fuse version number
Updated Angular Material and couple other packages
2018-06-20 15:30:54 +03:00
Sercan Yemen
b46b253c1c Small responsive fixes on e-commerce pages 2018-06-18 18:53:21 +03:00
Sercan Yemen
3abd764715 Updated the changelog 2018-06-18 18:42:35 +03:00
301 changed files with 7102 additions and 2907 deletions

View File

@@ -49,6 +49,18 @@
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true
},
"ec": {
"sourceMap": true,
"extractCss": true
},
"hmr": {
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.hmr.ts"
}
]
}
}
},
@@ -63,12 +75,10 @@
},
"hmr": {
"hmr": true,
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.hmr.ts"
}
]
"browserTarget": "fuse:build:hmr"
},
"ec": {
"browserTarget": "fuse:build:ec"
}
}
},

1034
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,12 +1,12 @@
{
"name": "fuse",
"version": "6.1.1",
"version": "6.2.4",
"license": "https://themeforest.net/licenses/terms/regular",
"scripts": {
"ng": "ng",
"start": "ng serve --open",
"start-hmr": "ng serve --configuration hmr -sm=false",
"start-hmr-sourcemaps": "ng serve --hmr -e=hmr",
"start-hmr": "ng serve --configuration hmr --source-map=false --hmr-warning=false",
"start-hmr-sourcemaps": "ng serve --configuration hmr --source-map=true --hmr-warning=false",
"build": "node --max_old_space_size=6144 ./node_modules/@angular/cli/bin/ng build --dev",
"build-stats": "node --max_old_space_size=6144 ./node_modules/@angular/cli/bin/ng build --dev --stats-json",
"build-prod": "node --max_old_space_size=6144 ./node_modules/@angular/cli/bin/ng build --prod",
@@ -19,19 +19,19 @@
"private": true,
"dependencies": {
"@agm/core": "1.0.0-beta.3",
"@angular/animations": "6.0.5",
"@angular/cdk": "6.2.1",
"@angular/common": "6.0.5",
"@angular/compiler": "6.0.5",
"@angular/core": "6.0.5",
"@angular/animations": "6.0.9",
"@angular/cdk": "6.3.3",
"@angular/common": "6.0.9",
"@angular/compiler": "6.0.9",
"@angular/core": "6.0.9",
"@angular/flex-layout": "6.0.0-beta.16",
"@angular/forms": "6.0.5",
"@angular/http": "6.0.5",
"@angular/material": "6.2.1",
"@angular/material-moment-adapter": "6.2.1",
"@angular/platform-browser": "6.0.5",
"@angular/platform-browser-dynamic": "6.0.5",
"@angular/router": "6.0.5",
"@angular/forms": "6.0.9",
"@angular/http": "6.0.9",
"@angular/material": "6.3.3",
"@angular/material-moment-adapter": "6.3.3",
"@angular/platform-browser": "6.0.9",
"@angular/platform-browser-dynamic": "6.0.9",
"@angular/router": "6.0.9",
"@ngrx/effects": "6.0.1",
"@ngrx/router-store": "6.0.1",
"@ngrx/store": "6.0.1",
@@ -46,16 +46,16 @@
"chart.js": "2.7.2",
"classlist.js": "1.1.20150312",
"core-js": "2.5.7",
"d3": "5.4.0",
"d3": "5.5.0",
"hammerjs": "2.0.8",
"lodash": "4.17.10",
"moment": "2.22.2",
"ng2-charts": "1.6.0",
"ngrx-store-freeze": "0.2.4",
"ngx-color-picker": "6.3.3",
"ngx-color-picker": "6.5.0",
"ngx-cookie-service": "1.0.10",
"perfect-scrollbar": "1.4.0",
"prismjs": "1.14.0",
"prismjs": "1.15.0",
"rxjs": "6.2.1",
"rxjs-compat": "6.2.1",
"web-animations-js": "2.3.1",
@@ -63,13 +63,13 @@
},
"devDependencies": {
"@angular/cli": "6.0.8",
"@angular/compiler-cli": "6.0.5",
"@angular/language-service": "6.0.5",
"@angular/compiler-cli": "6.0.9",
"@angular/language-service": "6.0.9",
"@angular-devkit/build-angular": "0.6.8",
"@angularclass/hmr": "2.1.3",
"@types/jasmine": "2.8.8",
"@types/jasminewd2": "2.0.3",
"@types/lodash": "4.14.109",
"@types/lodash": "4.14.111",
"@types/node": "8.9.5",
"codelyzer": "4.2.1",
"jasmine-core": "2.99.1",

View File

@@ -4,4 +4,5 @@
background: #263238;
cursor: text;
overflow: auto;
-webkit-overflow-scrolling: touch;
}

View File

@@ -4,6 +4,7 @@ export * from './demo/demo.module';
export * from './highlight/highlight.module';
export * from './material-color-picker/material-color-picker.module';
export * from './navigation/navigation.module';
export * from './progress-bar/progress-bar.module';
export * from './search-bar/search-bar.module';
export * from './shortcuts/shortcuts.module';
export * from './sidebar/sidebar.module';

View File

@@ -1,29 +1,45 @@
<ng-container *ngIf="!item.hidden">
<!-- normal collapse -->
<a class="nav-link" *ngIf="!item.url && !item.function" matRipple>
<a class="nav-link" [ngClass]="item.classes" *ngIf="!item.url && !item.function" matRipple>
<ng-container *ngTemplateOutlet="itemContent"></ng-container>
</a>
<!-- item.url -->
<a class="nav-link" *ngIf="item.url && !item.function"
[routerLink]="[item.url]" routerLinkActive="active"
[routerLinkActiveOptions]="{exact: item.exactMatch || false}" matRipple>
<a class="nav-link" [ngClass]="item.classes" *ngIf="item.url && !item.externalUrl && !item.function"
[routerLink]="[item.url]" [routerLinkActive]="['active', 'mat-accent-bg']"
[routerLinkActiveOptions]="{exact: item.exactMatch || false}"
[target]="item.openInNewTab ? '_blank' : '_self'" matRipple>
<ng-container *ngTemplateOutlet="itemContent"></ng-container>
</a>
<!-- item.externalUrl -->
<a class="nav-link" [ngClass]="item.classes" *ngIf="item.url && item.externalUrl && !item.function"
[href]="item.url" [target]="item.openInNewTab ? '_blank' : '_self'" matRipple>
<ng-container *ngTemplateOutlet="itemContent"></ng-container>
</a>
<!-- item.function -->
<span class="nav-link" *ngIf="!item.url && item.function" (click)="item.function()" matRipple>
<span class="nav-link" [ngClass]="item.classes" *ngIf="!item.url && item.function"
(click)="item.function()" matRipple>
<ng-container *ngTemplateOutlet="itemContent"></ng-container>
</span>
<!-- item.url && item.function -->
<a class="nav-link" *ngIf="item.url && item.function" (click)="item.function()"
[routerLink]="[item.url]" routerLinkActive="active"
<a class="nav-link" [ngClass]="item.classes" *ngIf="item.url && !item.externalUrl && item.function"
(click)="item.function()"
[routerLink]="[item.url]" [routerLinkActive]="['active', 'mat-accent-bg']"
[routerLinkActiveOptions]="{exact: item.exactMatch || false}" matRipple>
<ng-container *ngTemplateOutlet="itemContent"></ng-container>
</a>
<!-- item.externalUrl && item.function -->
<a class="nav-link" [ngClass]="item.classes" *ngIf="item.url && item.externalUrl && item.function"
(click)="item.function()"
[href]="item.url" [target]="item.openInNewTab ? '_blank' : '_self'" matRipple>
<ng-container *ngTemplateOutlet="itemContent"></ng-container>
</a>
<ng-template #itemContent>
<mat-icon class="nav-link-icon" *ngIf="item.icon">{{item.icon}}</mat-icon>
<span class="nav-link-title" [translate]="item.translate">{{item.title}}</span>

View File

@@ -1,20 +1,38 @@
<ng-container *ngIf="!item.hidden">
<!-- item.url -->
<a class="nav-link" *ngIf="item.url" [routerLink]="[item.url]" routerLinkActive="active"
[routerLinkActiveOptions]="{exact: item.exactMatch || false}" matRipple>
<a class="nav-link" [ngClass]="item.classes" *ngIf="item.url && !item.externalUrl && !item.function"
[routerLink]="[item.url]" [routerLinkActive]="['active', 'mat-accent-bg']"
[routerLinkActiveOptions]="{exact: item.exactMatch || false}"
[target]="item.openInNewTab ? '_blank' : '_self'" matRipple>
<ng-container *ngTemplateOutlet="itemContent"></ng-container>
</a>
<!-- item.externalUrl -->
<a class="nav-link" [ngClass]="item.classes" *ngIf="item.url && item.externalUrl && !item.function"
[href]="item.url" [target]="item.openInNewTab ? '_blank' : '_self'" matRipple>
<ng-container *ngTemplateOutlet="itemContent"></ng-container>
</a>
<!-- item.function -->
<span class="nav-link" *ngIf="item.function" (click)="item.function()" matRipple>
<span class="nav-link" [ngClass]="item.classes" *ngIf="!item.url && item.function"
(click)="item.function()" matRipple>
<ng-container *ngTemplateOutlet="itemContent"></ng-container>
</span>
<!-- item.url && item.function -->
<a class="nav-link" *ngIf="item.url && item.function" (click)="item.function()"
[routerLink]="[item.url]" routerLinkActive="active"
[routerLinkActiveOptions]="{exact: item.exactMatch || false}" matRipple>
<a class="nav-link" [ngClass]="item.classes" *ngIf="item.url && !item.externalUrl && item.function"
(click)="item.function()"
[routerLink]="[item.url]" [routerLinkActive]="['active', 'mat-accent-bg']"
[routerLinkActiveOptions]="{exact: item.exactMatch || false}"
[target]="item.openInNewTab ? '_blank' : '_self'" matRipple>
<ng-container *ngTemplateOutlet="itemContent"></ng-container>
</a>
<!-- item.externalUrl && item.function -->
<a class="nav-link" [ngClass]="item.classes" *ngIf="item.url && item.externalUrl && item.function"
(click)="item.function()"
[href]="item.url" [target]="item.openInNewTab ? '_blank' : '_self'" matRipple>
<ng-container *ngTemplateOutlet="itemContent"></ng-container>
</a>
@@ -27,4 +45,4 @@
</span>
</ng-template>
</ng-container>
</ng-container>

View File

@@ -1,5 +1,4 @@
<div id="main-navigation" class="nav"
[ngClass]="{'horizontal':layout === 'horizontal', 'vertical':layout === 'vertical'}">
<div class="nav" [ngClass]="{'horizontal':layout === 'horizontal', 'vertical':layout === 'vertical'}">
<!-- Vertical Navigation Layout -->
<ng-container *ngIf="layout === 'vertical'">
@@ -21,7 +20,8 @@
<ng-container *ngFor="let item of navigation">
<fuse-nav-horizontal-collapsable *ngIf="item.type=='group'" [item]="item"></fuse-nav-horizontal-collapsable>
<fuse-nav-horizontal-collapsable *ngIf="item.type=='collapse'" [item]="item"></fuse-nav-horizontal-collapsable>
<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>
</ng-container>

View File

@@ -4,7 +4,7 @@ fuse-navigation {
display: flex;
flex: 1 0 auto;
#main-navigation {
> .nav {
margin: 0;
padding: 0;
width: 100%;

View File

@@ -1,11 +1,13 @@
import { Injectable } from '@angular/core';
import { BehaviorSubject, Observable, Subject } from 'rxjs';
@Injectable()
import { FuseNavigationItem } from '@fuse/types';
@Injectable({
providedIn: 'root'
})
export class FuseNavigationService
{
flatNavigation: any[] = [];
onItemCollapsed: Subject<any>;
onItemCollapseToggled: Subject<any>;
@@ -138,39 +140,30 @@ export class FuseNavigationService
* Get flattened navigation array
*
* @param navigation
* @param flatNavigation
* @returns {any[]}
*/
getFlatNavigation(navigation): any
getFlatNavigation(navigation, flatNavigation: FuseNavigationItem[] = []): any
{
for ( const navItem of navigation )
for ( const item of navigation )
{
if ( navItem.type === 'item' )
if ( item.type === 'item' )
{
this.flatNavigation.push({
id : navItem.id || null,
title : navItem.title || null,
translate : navItem.translate || null,
type : navItem.type,
icon : navItem.icon || null,
url : navItem.url || null,
function : navItem.function || null,
exactMatch: navItem.exactMatch || false,
badge : navItem.badge || null
});
flatNavigation.push(item);
continue;
}
if ( navItem.type === 'collapse' || navItem.type === 'group' )
if ( item.type === 'collapsable' || item.type === 'group' )
{
if ( navItem.children )
if ( item.children )
{
this.getFlatNavigation(navItem.children);
this.getFlatNavigation(item.children, flatNavigation);
}
}
}
return this.flatNavigation;
return flatNavigation;
}
/**

View File

@@ -1,12 +1,14 @@
<ng-container *ngIf="!item.hidden">
<!-- normal collapse -->
<a class="nav-link" *ngIf="!item.url && !item.function" (click)="toggleOpen($event)" matRipple>
<a class="nav-link" [ngClass]="item.classes" *ngIf="!item.url && !item.function"
(click)="toggleOpen($event)" matRipple>
<ng-container *ngTemplateOutlet="itemContent"></ng-container>
</a>
<!-- item.url -->
<a class="nav-link" *ngIf="item.url && !item.externalUrl && !item.function" (click)="toggleOpen($event)"
<a class="nav-link" [ngClass]="item.classes" *ngIf="item.url && !item.externalUrl && !item.function"
(click)="toggleOpen($event)"
[routerLink]="[item.url]" [routerLinkActive]="['active', 'mat-accent-bg']"
[routerLinkActiveOptions]="{exact: item.exactMatch || false}"
[target]="item.openInNewTab ? '_blank' : '_self'" matRipple>
@@ -14,19 +16,20 @@
</a>
<!-- item.externalUrl -->
<a class="nav-link" *ngIf="item.url && item.externalUrl && !item.function" (click)="toggleOpen($event)"
<a class="nav-link" [ngClass]="item.classes" *ngIf="item.url && item.externalUrl && !item.function"
(click)="toggleOpen($event)"
[href]="item.url" [target]="item.openInNewTab ? '_blank' : '_self'" matRipple>
<ng-container *ngTemplateOutlet="itemContent"></ng-container>
</a>
<!-- item.function -->
<span class="nav-link" *ngIf="!item.url && item.function"
<span class="nav-link" [ngClass]="item.classes" *ngIf="!item.url && item.function"
(click)="toggleOpen($event);item.function()" matRipple>
<ng-container *ngTemplateOutlet="itemContent"></ng-container>
</span>
<!-- item.url && item.function -->
<a class="nav-link" *ngIf="item.url && !item.externalUrl && item.function"
<a class="nav-link" [ngClass]="item.classes" *ngIf="item.url && !item.externalUrl && item.function"
(click)="toggleOpen($event);item.function()"
[routerLink]="[item.url]" [routerLinkActive]="['active', 'mat-accent-bg']"
[routerLinkActiveOptions]="{exact: item.exactMatch || false}" matRipple>
@@ -34,7 +37,7 @@
</a>
<!-- item.externalUrl && item.function -->
<a class="nav-link" *ngIf="item.url && item.externalUrl && item.function"
<a class="nav-link" [ngClass]="item.classes" *ngIf="item.url && item.externalUrl && item.function"
(click)="toggleOpen($event);item.function()"
[href]="item.url" [target]="item.openInNewTab ? '_blank' : '_self'" matRipple>
<ng-container *ngTemplateOutlet="itemContent"></ng-container>

View File

@@ -1,6 +1,6 @@
<ng-container *ngIf="!item.hidden">
<div class="group-title">
<div class="group-title" [ngClass]="item.classes">
<span class="hint-text" [translate]="item.translate">{{ item.title }}</span>
</div>

View File

@@ -1,7 +1,7 @@
<ng-container *ngIf="!item.hidden">
<!-- item.url -->
<a class="nav-link" *ngIf="item.url && !item.externalUrl && !item.function"
<a class="nav-link" [ngClass]="item.classes" *ngIf="item.url && !item.externalUrl && !item.function"
[routerLink]="[item.url]" [routerLinkActive]="['active', 'mat-accent-bg']"
[routerLinkActiveOptions]="{exact: item.exactMatch || false}"
[target]="item.openInNewTab ? '_blank' : '_self'" matRipple>
@@ -9,19 +9,20 @@
</a>
<!-- item.externalUrl -->
<a class="nav-link" *ngIf="item.url && item.externalUrl && !item.function"
<a class="nav-link" [ngClass]="item.classes" *ngIf="item.url && item.externalUrl && !item.function"
[href]="item.url" [target]="item.openInNewTab ? '_blank' : '_self'" matRipple>
<ng-container *ngTemplateOutlet="itemContent"></ng-container>
</a>
<!-- item.function -->
<span class="nav-link" *ngIf="!item.url && item.function"
<span class="nav-link" [ngClass]="item.classes" *ngIf="!item.url && item.function"
(click)="item.function()" matRipple>
<ng-container *ngTemplateOutlet="itemContent"></ng-container>
</span>
<!-- item.url && item.function -->
<a class="nav-link" *ngIf="item.url && !item.externalUrl && item.function" (click)="item.function()"
<a class="nav-link" [ngClass]="item.classes" *ngIf="item.url && !item.externalUrl && item.function"
(click)="item.function()"
[routerLink]="[item.url]" [routerLinkActive]="['active', 'mat-accent-bg']"
[routerLinkActiveOptions]="{exact: item.exactMatch || false}"
[target]="item.openInNewTab ? '_blank' : '_self'" matRipple>
@@ -29,7 +30,8 @@
</a>
<!-- item.externalUrl && item.function -->
<a class="nav-link" *ngIf="item.url && item.externalUrl && item.function" (click)="item.function()"
<a class="nav-link" [ngClass]="item.classes" *ngIf="item.url && item.externalUrl && item.function"
(click)="item.function()"
[href]="item.url" [target]="item.openInNewTab ? '_blank' : '_self'" matRipple>
<ng-container *ngTemplateOutlet="itemContent"></ng-container>
</a>

View File

@@ -0,0 +1,5 @@
<ng-container *ngIf="visible">
<mat-progress-bar color="accent" [bufferValue]="bufferValue" [mode]="mode" [value]="value"></mat-progress-bar>
</ng-container>

View File

@@ -0,0 +1,17 @@
@import "src/@fuse/scss/fuse";
fuse-progress-bar {
position: absolute;
top: 0;
left: 0;
right: 0;
width: 100%;
z-index: 99998;
mat-progress-bar {
.mat-progress-bar-buffer {
background-color: #C5C6CB !important;
}
}
}

View File

@@ -0,0 +1,93 @@
import { Component, OnDestroy, OnInit, ViewEncapsulation } from '@angular/core';
import { Subject } from 'rxjs';
import { takeUntil } from 'rxjs/operators';
import { FuseProgressBarService } from '@fuse/components/progress-bar/progress-bar.service';
@Component({
selector : 'fuse-progress-bar',
templateUrl : './progress-bar.component.html',
styleUrls : ['./progress-bar.component.scss'],
encapsulation: ViewEncapsulation.None
})
export class FuseProgressBarComponent implements OnInit, OnDestroy
{
bufferValue: number;
mode: 'determinate' | 'indeterminate' | 'buffer' | 'query';
value: number;
visible: boolean;
// Private
private _unsubscribeAll: Subject<any>;
/**
* Constructor
*
* @param {FuseProgressBarService} _fuseProgressBarService
*/
constructor(
private _fuseProgressBarService: FuseProgressBarService
)
{
// Set the defaults
// Set the private defaults
this._unsubscribeAll = new Subject();
}
// -----------------------------------------------------------------------------------------------------
// @ Lifecycle hooks
// -----------------------------------------------------------------------------------------------------
/**
* On init
*/
ngOnInit(): void
{
// Subscribe to the progress bar service properties
// Buffer value
this._fuseProgressBarService.bufferValue
.pipe(takeUntil(this._unsubscribeAll))
.subscribe((bufferValue) => {
this.bufferValue = bufferValue;
});
// Mode
this._fuseProgressBarService.mode
.pipe(takeUntil(this._unsubscribeAll))
.subscribe((mode) => {
this.mode = mode;
});
// Value
this._fuseProgressBarService.value
.pipe(takeUntil(this._unsubscribeAll))
.subscribe((value) => {
this.value = value;
});
// Visible
this._fuseProgressBarService.visible
.pipe(takeUntil(this._unsubscribeAll))
.subscribe((visible) => {
this.visible = visible;
});
}
/**
* On destroy
*/
ngOnDestroy(): void
{
// Unsubscribe from all subscriptions
this._unsubscribeAll.next();
this._unsubscribeAll.complete();
}
// -----------------------------------------------------------------------------------------------------
// @ Public methods
// -----------------------------------------------------------------------------------------------------
}

View File

@@ -0,0 +1,27 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { RouterModule } from '@angular/router';
import { MatButtonModule, MatIconModule, MatProgressBarModule } from '@angular/material';
import { FuseProgressBarComponent } from './progress-bar.component';
@NgModule({
declarations: [
FuseProgressBarComponent
],
imports : [
CommonModule,
RouterModule,
MatButtonModule,
MatIconModule,
MatProgressBarModule
],
exports : [
FuseProgressBarComponent
]
})
export class FuseProgressBarModule
{
}

View File

@@ -0,0 +1,132 @@
import { Injectable } from '@angular/core';
import { NavigationEnd, NavigationStart, Router } from '@angular/router';
import { BehaviorSubject, Observable } from 'rxjs';
import { filter } from 'rxjs/operators';
@Injectable({
providedIn: 'root'
})
export class FuseProgressBarService
{
// Private
private _bufferValue: BehaviorSubject<number>;
private _mode: BehaviorSubject<string>;
private _value: BehaviorSubject<number>;
private _visible: BehaviorSubject<boolean>;
/**
* Constructor
*
* @param {Router} _router
*/
constructor(
private _router: Router
)
{
// Initialize the service
this._init();
}
// -----------------------------------------------------------------------------------------------------
// @ Accessors
// -----------------------------------------------------------------------------------------------------
/**
* Buffer value
*/
get bufferValue(): Observable<any>
{
return this._bufferValue.asObservable();
}
setBufferValue(value: number): void
{
this._bufferValue.next(value);
}
/**
* Mode
*/
get mode(): Observable<any>
{
return this._mode.asObservable();
}
setMode(value: 'determinate' | 'indeterminate' | 'buffer' | 'query'): void
{
this._mode.next(value);
}
/**
* Value
*/
get value(): Observable<any>
{
return this._value.asObservable();
}
setValue(value: number): void
{
this._value.next(value);
}
/**
* Visible
*/
get visible(): Observable<any>
{
return this._visible.asObservable();
}
// -----------------------------------------------------------------------------------------------------
// @ Private methods
// -----------------------------------------------------------------------------------------------------
/**
* Initialize
*
* @private
*/
private _init(): void
{
// Initialize the behavior subjects
this._bufferValue = new BehaviorSubject(0);
this._mode = new BehaviorSubject('indeterminate');
this._value = new BehaviorSubject(0);
this._visible = new BehaviorSubject(false);
// Subscribe to the router events to show/hide the loading bar
this._router.events
.pipe(filter((event) => event instanceof NavigationStart))
.subscribe(() => {
this.show();
});
this._router.events
.pipe(filter((event) => event instanceof NavigationEnd))
.subscribe(() => {
this.hide();
});
}
// -----------------------------------------------------------------------------------------------------
// @ Public methods
// -----------------------------------------------------------------------------------------------------
/**
* Show the progress bar
*/
show(): void
{
this._visible.next(true);
}
/**
* Hide the progress bar
*/
hide(): void
{
this._visible.next(false);
}
}

View File

@@ -9,7 +9,7 @@
height: 64px;
font-size: 13px;
@include media-breakpoint-down('sm') {
@include media-breakpoint-down('xs') {
height: 56px;
}
@@ -28,7 +28,7 @@
height: 64px !important;
line-height: 64px !important;
@include media-breakpoint-down('sm') {
@include media-breakpoint-down('xs') {
height: 56px !important;
line-height: 56px !important;
}
@@ -39,7 +39,7 @@
height: 64px !important;
line-height: 64px !important;
@include media-breakpoint-down('sm') {
@include media-breakpoint-down('xs') {
height: 56px !important;
line-height: 56px !important;
}

View File

@@ -1,3 +1,5 @@
@import "src/@fuse/scss/fuse";
fuse-sidebar {
display: flex;
flex-direction: column;
@@ -7,6 +9,7 @@ fuse-sidebar {
bottom: 0;
overflow-x: hidden;
overflow-y: auto;
-webkit-overflow-scrolling: touch;
width: 280px;
min-width: 280px;
max-width: 280px;
@@ -14,6 +17,12 @@ fuse-sidebar {
box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.35);
background: white;
@include media-breakpoint-down('xs') {
min-width: 0 !important;
max-width: 80vw !important;
width: 80vw !important;
}
&.left-positioned {
left: 0;
transform: translateX(-100%);
@@ -37,12 +46,6 @@ fuse-sidebar {
position: absolute !important;
top: 0;
bottom: 0;
&:not(.unfolded) {
width: 64px;
min-width: 64px;
max-width: 64px;
}
}
&.animations-enabled {

View File

@@ -1,8 +1,8 @@
import { ChangeDetectorRef, Component, ElementRef, HostBinding, HostListener, Input, OnDestroy, OnInit, Renderer2, RendererStyleFlags2, ViewEncapsulation } from '@angular/core';
import { ChangeDetectorRef, Component, ElementRef, EventEmitter, HostBinding, HostListener, Input, OnDestroy, OnInit, Output, Renderer2, RendererStyleFlags2, ViewEncapsulation } from '@angular/core';
import { animate, AnimationBuilder, AnimationPlayer, style } from '@angular/animations';
import { ObservableMedia } from '@angular/flex-layout';
import { Subject } from 'rxjs';
import { takeUntil } from 'rxjs/internal/operators';
import { takeUntil } from 'rxjs/operators';
import { FuseSidebarService } from './sidebar.service';
import { FuseMatchMediaService } from '@fuse/services/match-media.service';
@@ -40,6 +40,14 @@ export class FuseSidebarComponent implements OnInit, OnDestroy
@HostBinding('class.locked-open')
isLockedOpen: boolean;
// Folded width
@Input()
foldedWidth: number;
// Folded auto trigger on hover
@Input()
foldedAutoTriggerOnHover: boolean;
// Folded unfolded
@HostBinding('class.unfolded')
unfolded: boolean;
@@ -48,6 +56,14 @@ export class FuseSidebarComponent implements OnInit, OnDestroy
@Input()
invisibleOverlay: boolean;
// Folded changed
@Output()
foldedChanged: EventEmitter<boolean>;
// Opened changed
@Output()
openedChanged: EventEmitter<boolean>;
// Private
private _folded: boolean;
private _fuseConfig: any;
@@ -84,8 +100,11 @@ export class FuseSidebarComponent implements OnInit, OnDestroy
)
{
// Set the defaults
this.foldedAutoTriggerOnHover = true;
this.foldedWidth = 64;
this.foldedChanged = new EventEmitter();
this.openedChanged = new EventEmitter();
this.opened = false;
// this.folded = false;
this.position = 'left';
this.invisibleOverlay = false;
@@ -99,7 +118,11 @@ export class FuseSidebarComponent implements OnInit, OnDestroy
// @ Accessors
// -----------------------------------------------------------------------------------------------------
// Folded
/**
* Folded
*
* @param {boolean} value
*/
@Input()
set folded(value: boolean)
{
@@ -112,23 +135,23 @@ export class FuseSidebarComponent implements OnInit, OnDestroy
return;
}
// Programmatically add/remove margin to the element
// Programmatically add/remove padding to the element
// that comes after or before based on the position
let sibling,
styleRule;
const styleValue = '64px';
const styleValue = this.foldedWidth + 'px';
// Get the sibling and set the style rule
if ( this.position === 'left' )
{
sibling = this._elementRef.nativeElement.nextElementSibling;
styleRule = 'margin-left';
styleRule = 'padding-left';
}
else
{
sibling = this._elementRef.nativeElement.previousElementSibling;
styleRule = 'margin-right';
styleRule = 'padding-right';
}
// If there is no sibling, return...
@@ -143,6 +166,11 @@ export class FuseSidebarComponent implements OnInit, OnDestroy
// Fold the sidebar
this.fold();
// Set the folded width
this._renderer.setStyle(this._elementRef.nativeElement, 'width', styleValue);
this._renderer.setStyle(this._elementRef.nativeElement, 'min-width', styleValue);
this._renderer.setStyle(this._elementRef.nativeElement, 'max-width', styleValue);
// Set the style and class
this._renderer.setStyle(sibling, styleRule, styleValue, RendererStyleFlags2.Important + RendererStyleFlags2.DashCase);
this._renderer.addClass(this._elementRef.nativeElement, 'folded');
@@ -153,10 +181,18 @@ export class FuseSidebarComponent implements OnInit, OnDestroy
// Unfold the sidebar
this.unfold();
// Remove the folded width
this._renderer.removeStyle(this._elementRef.nativeElement, 'width');
this._renderer.removeStyle(this._elementRef.nativeElement, 'min-width');
this._renderer.removeStyle(this._elementRef.nativeElement, 'max-width');
// Remove the style and class
this._renderer.removeStyle(sibling, styleRule);
this._renderer.removeClass(this._elementRef.nativeElement, 'folded');
}
// Emit the 'foldedChanged' event
this.foldedChanged.emit(this.folded);
}
get folded(): boolean
@@ -301,6 +337,9 @@ export class FuseSidebarComponent implements OnInit, OnDestroy
// Force the the opened status to true
this.opened = true;
// Emit the 'openedChanged' event
this.openedChanged.emit(this.opened);
// If the sidebar was folded, forcefully fold it again
if ( this._wasFolded )
{
@@ -329,6 +368,9 @@ export class FuseSidebarComponent implements OnInit, OnDestroy
// Force the the opened status to close
this.opened = false;
// Emit the 'openedChanged' event
this.openedChanged.emit(this.opened);
// Hide the sidebar
this._hideSidebar();
}
@@ -357,23 +399,23 @@ export class FuseSidebarComponent implements OnInit, OnDestroy
return;
}
// Programmatically add/remove margin to the element
// Programmatically add/remove padding to the element
// that comes after or before based on the position
let sibling,
styleRule;
const styleValue = '64px';
const styleValue = this.foldedWidth + 'px';
// Get the sibling and set the style rule
if ( this.position === 'left' )
{
sibling = this._elementRef.nativeElement.nextElementSibling;
styleRule = 'margin-left';
styleRule = 'padding-left';
}
else
{
sibling = this._elementRef.nativeElement.previousElementSibling;
styleRule = 'margin-right';
styleRule = 'padding-right';
}
// If there is no sibling, return...
@@ -385,6 +427,11 @@ export class FuseSidebarComponent implements OnInit, OnDestroy
// Fold the sidebar
this.fold();
// Set the folded width
this._renderer.setStyle(this._elementRef.nativeElement, 'width', styleValue);
this._renderer.setStyle(this._elementRef.nativeElement, 'min-width', styleValue);
this._renderer.setStyle(this._elementRef.nativeElement, 'max-width', styleValue);
// Set the style and class
this._renderer.setStyle(sibling, styleRule, styleValue, RendererStyleFlags2.Important + RendererStyleFlags2.DashCase);
this._renderer.addClass(this._elementRef.nativeElement, 'folded');
@@ -558,6 +605,9 @@ export class FuseSidebarComponent implements OnInit, OnDestroy
// Set the opened status
this.opened = true;
// Emit the 'openedChanged' event
this.openedChanged.emit(this.opened);
// Mark for check
this._changeDetectorRef.markForCheck();
}
@@ -581,6 +631,9 @@ export class FuseSidebarComponent implements OnInit, OnDestroy
// Set the opened status
this.opened = false;
// Emit the 'openedChanged' event
this.openedChanged.emit(this.opened);
// Hide the sidebar
this._hideSidebar();
@@ -609,20 +662,13 @@ export class FuseSidebarComponent implements OnInit, OnDestroy
@HostListener('mouseenter')
onMouseEnter(): void
{
// Only work if the sidebar is folded
if ( !this.folded )
// Only work if the auto trigger is enabled
if ( !this.foldedAutoTriggerOnHover )
{
return;
}
// Enable the animations
this._enableAnimations();
// Unfold the sidebar temporarily
this.unfolded = true;
// Mark for check
this._changeDetectorRef.markForCheck();
this.unfoldTemporarily();
}
/**
@@ -631,20 +677,13 @@ export class FuseSidebarComponent implements OnInit, OnDestroy
@HostListener('mouseleave')
onMouseLeave(): void
{
// Only work if the sidebar is folded
if ( !this.folded )
// Only work if the auto trigger is enabled
if ( !this.foldedAutoTriggerOnHover )
{
return;
}
// Enable the animations
this._enableAnimations();
// Fold the sidebar back
this.unfolded = false;
// Mark for check
this._changeDetectorRef.markForCheck();
this.foldTemporarily();
}
/**
@@ -703,4 +742,58 @@ export class FuseSidebarComponent implements OnInit, OnDestroy
this.fold();
}
}
/**
* Fold the temporarily unfolded sidebar back
*/
foldTemporarily(): void
{
// Only work if the sidebar is folded
if ( !this.folded )
{
return;
}
// Enable the animations
this._enableAnimations();
// Fold the sidebar back
this.unfolded = false;
// Set the folded width
const styleValue = this.foldedWidth + 'px';
this._renderer.setStyle(this._elementRef.nativeElement, 'width', styleValue);
this._renderer.setStyle(this._elementRef.nativeElement, 'min-width', styleValue);
this._renderer.setStyle(this._elementRef.nativeElement, 'max-width', styleValue);
// Mark for check
this._changeDetectorRef.markForCheck();
}
/**
* Unfold the sidebar temporarily
*/
unfoldTemporarily(): void
{
// Only work if the sidebar is folded
if ( !this.folded )
{
return;
}
// Enable the animations
this._enableAnimations();
// Unfold the sidebar temporarily
this.unfolded = true;
// Remove the folded width
this._renderer.removeStyle(this._elementRef.nativeElement, 'width');
this._renderer.removeStyle(this._elementRef.nativeElement, 'min-width');
this._renderer.removeStyle(this._elementRef.nativeElement, 'max-width');
// Mark for check
this._changeDetectorRef.markForCheck();
}
}

View File

@@ -2,7 +2,9 @@ import { Injectable } from '@angular/core';
import { FuseSidebarComponent } from './sidebar.component';
@Injectable()
@Injectable({
providedIn: 'root'
})
export class FuseSidebarService
{
// Private

View File

@@ -73,6 +73,17 @@
<mat-radio-button class="mb-16" value="right">Right</mat-radio-button>
</mat-radio-group>
<h3 class="mt-8">Variant:</h3>
<mat-radio-group fxLayout="column" fxLayoutAlign="start start" formControlName="variant">
<mat-radio-button class="mb-16" value="vertical-style-1">Style 1</mat-radio-button>
<mat-radio-button class="mb-16" value="vertical-style-2">Style 2</mat-radio-button>
</mat-radio-group>
<h3 class="mt-24 mb-8">Color:</h3>
<fuse-material-color-picker class="mb-16"
[(selectedClass)]="fuseConfig.layout.navbar.background">
</fuse-material-color-picker>
</div>
<!-- TOOLBAR -->
@@ -91,6 +102,11 @@
<mat-radio-button class="mb-12" value="below-fixed">Below Fixed</mat-radio-button>
</mat-radio-group>
<h3 class="mt-24 mb-8">Color:</h3>
<fuse-material-color-picker class="mb-16"
[(selectedClass)]="fuseConfig.layout.toolbar.background">
</fuse-material-color-picker>
</div>
<!-- FOOTER -->
@@ -109,6 +125,28 @@
<mat-radio-button class="mb-12" value="below-fixed">Below Fixed</mat-radio-button>
</mat-radio-group>
<h3 class="mt-24 mb-8">Color:</h3>
<fuse-material-color-picker class="mb-16"
[(selectedClass)]="fuseConfig.layout.footer.background">
</fuse-material-color-picker>
</div>
<!-- SIDE PANEL -->
<div class="group" formGroupName="sidepanel">
<h2>Side Panel</h2>
<mat-slide-toggle formControlName="hidden">
Hide
</mat-slide-toggle>
<h3 class="mt-24">Position:</h3>
<mat-radio-group fxLayout="column" fxLayoutAlign="start start" formControlName="position">
<mat-radio-button class="mb-12" value="left">Left</mat-radio-button>
<mat-radio-button class="mb-12" value="right">Right</mat-radio-button>
</mat-radio-group>
</div>
</ng-container>
@@ -146,6 +184,17 @@
<mat-radio-button class="mb-16" value="right">Right</mat-radio-button>
</mat-radio-group>
<h3 class="mt-8">Variant:</h3>
<mat-radio-group fxLayout="column" fxLayoutAlign="start start" formControlName="variant">
<mat-radio-button class="mb-16" value="vertical-style-1">Style 1</mat-radio-button>
<mat-radio-button class="mb-16" value="vertical-style-2">Style 2</mat-radio-button>
</mat-radio-group>
<h3 class="mt-24 mb-8">Color:</h3>
<fuse-material-color-picker class="mb-16"
[(selectedClass)]="fuseConfig.layout.navbar.background">
</fuse-material-color-picker>
</div>
<!-- TOOLBAR -->
@@ -164,6 +213,11 @@
<mat-radio-button class="mb-12" value="below">Below</mat-radio-button>
</mat-radio-group>
<h3 class="mt-24 mb-8">Color:</h3>
<fuse-material-color-picker class="mb-16"
[(selectedClass)]="fuseConfig.layout.toolbar.background">
</fuse-material-color-picker>
</div>
<!-- FOOTER -->
@@ -182,6 +236,28 @@
<mat-radio-button class="mb-12" value="below">Below</mat-radio-button>
</mat-radio-group>
<h3 class="mt-24 mb-8">Color:</h3>
<fuse-material-color-picker class="mb-16"
[(selectedClass)]="fuseConfig.layout.footer.background">
</fuse-material-color-picker>
</div>
<!-- SIDE PANEL -->
<div class="group" formGroupName="sidepanel">
<h2>Side Panel</h2>
<mat-slide-toggle formControlName="hidden">
Hide
</mat-slide-toggle>
<h3 class="mt-24">Position:</h3>
<mat-radio-group fxLayout="column" fxLayoutAlign="start start" formControlName="position">
<mat-radio-button class="mb-12" value="left">Left</mat-radio-button>
<mat-radio-button class="mb-12" value="right">Right</mat-radio-button>
</mat-radio-group>
</div>
</ng-container>
@@ -219,6 +295,17 @@
<mat-radio-button class="mb-16" value="right">Right</mat-radio-button>
</mat-radio-group>
<h3 class="mt-8">Variant:</h3>
<mat-radio-group fxLayout="column" fxLayoutAlign="start start" formControlName="variant">
<mat-radio-button class="mb-16" value="vertical-style-1">Style 1</mat-radio-button>
<mat-radio-button class="mb-16" value="vertical-style-2">Style 2</mat-radio-button>
</mat-radio-group>
<h3 class="mt-24 mb-8">Color:</h3>
<fuse-material-color-picker class="mb-16"
[(selectedClass)]="fuseConfig.layout.navbar.background">
</fuse-material-color-picker>
</div>
<!-- TOOLBAR -->
@@ -236,6 +323,11 @@
<mat-radio-button class="mb-12" value="above-fixed">Above Fixed</mat-radio-button>
</mat-radio-group>
<h3 class="mt-24 mb-8">Color:</h3>
<fuse-material-color-picker class="mb-16"
[(selectedClass)]="fuseConfig.layout.toolbar.background">
</fuse-material-color-picker>
</div>
<!-- FOOTER -->
@@ -253,6 +345,28 @@
<mat-radio-button class="mb-12" value="above-fixed">Above Fixed</mat-radio-button>
</mat-radio-group>
<h3 class="mt-24 mb-8">Color:</h3>
<fuse-material-color-picker class="mb-16"
[(selectedClass)]="fuseConfig.layout.footer.background">
</fuse-material-color-picker>
</div>
<!-- SIDE PANEL -->
<div class="group" formGroupName="sidepanel">
<h2>Side Panel</h2>
<mat-slide-toggle formControlName="hidden">
Hide
</mat-slide-toggle>
<h3 class="mt-24">Position:</h3>
<mat-radio-group fxLayout="column" fxLayoutAlign="start start" formControlName="position">
<mat-radio-button class="mb-12" value="left">Left</mat-radio-button>
<mat-radio-button class="mb-12" value="right">Right</mat-radio-button>
</mat-radio-group>
</div>
</ng-container>
@@ -285,6 +399,17 @@
<mat-radio-button class="mb-16" value="top">Top</mat-radio-button>
</mat-radio-group>
<h3 class="mt-8">Variant (Vertical):</h3>
<mat-radio-group fxLayout="column" fxLayoutAlign="start start" formControlName="variant">
<mat-radio-button class="mb-16" value="vertical-style-1">Style 1</mat-radio-button>
<mat-radio-button class="mb-16" value="vertical-style-2">Style 2</mat-radio-button>
</mat-radio-group>
<h3 class="mt-24 mb-8">Color:</h3>
<fuse-material-color-picker class="mb-16"
[(selectedClass)]="fuseConfig.layout.navbar.background">
</fuse-material-color-picker>
</div>
<!-- TOOLBAR -->
@@ -302,6 +427,11 @@
<mat-radio-button class="mb-12" value="below">Below</mat-radio-button>
</mat-radio-group>
<h3 class="mt-24 mb-8">Color:</h3>
<fuse-material-color-picker class="mb-16"
[(selectedClass)]="fuseConfig.layout.toolbar.background">
</fuse-material-color-picker>
</div>
<!-- FOOTER -->
@@ -319,6 +449,28 @@
<mat-radio-button class="mb-12" value="above-static">Above Static</mat-radio-button>
</mat-radio-group>
<h3 class="mt-24 mb-8">Color:</h3>
<fuse-material-color-picker class="mb-16"
[(selectedClass)]="fuseConfig.layout.footer.background">
</fuse-material-color-picker>
</div>
<!-- SIDE PANEL -->
<div class="group" formGroupName="sidepanel">
<h2>Side Panel</h2>
<mat-slide-toggle formControlName="hidden">
Hide
</mat-slide-toggle>
<h3 class="mt-24">Position:</h3>
<mat-radio-group fxLayout="column" fxLayoutAlign="start start" formControlName="position">
<mat-radio-button class="mb-12" value="left">Left</mat-radio-button>
<mat-radio-button class="mb-12" value="right">Right</mat-radio-button>
</mat-radio-group>
</div>
</ng-container>
@@ -338,35 +490,6 @@
</div>
<!-- COLORS -->
<div class="group">
<h2>Colors</h2>
<div class="colors">
<div fxFlex fxLayout="row" fxLayoutAlign="space-between center">
<h4 class="mr-8">Toolbar Color</h4>
<fuse-material-color-picker
[(selectedClass)]="fuseConfig.layout.toolbar.background"></fuse-material-color-picker>
</div>
<div fxFlex fxLayout="row" fxLayoutAlign="space-between center">
<h4 class="mr-8">Navbar Color</h4>
<fuse-material-color-picker
[(selectedClass)]="fuseConfig.layout.navbar.background"></fuse-material-color-picker>
</div>
<div fxFlex fxLayout="row" fxLayoutAlign="space-between center">
<h4 class="mr-8">Footer Color</h4>
<fuse-material-color-picker
[(selectedClass)]="fuseConfig.layout.footer.background"></fuse-material-color-picker>
</div>
</div>
</div>
</form>
</div>

View File

@@ -19,6 +19,7 @@
flex: 1 0 auto;
padding: 40px 24px 24px 24px;
overflow: auto;
-webkit-overflow-scrolling: touch;
.header {
display: flex;
@@ -73,11 +74,6 @@
}
}
}
.colors {
display: block !important;
width: 100%;
}
}
}
}

View File

@@ -62,23 +62,28 @@ export class FuseThemeOptionsComponent implements OnInit, OnDestroy
// noinspection TypeScriptValidateTypes
this.form = this._formBuilder.group({
layout : this._formBuilder.group({
style : new FormControl(),
width : new FormControl(),
navbar : this._formBuilder.group({
hidden : new FormControl(),
position : new FormControl(),
style : new FormControl(),
width : new FormControl(),
navbar : this._formBuilder.group({
background: new FormControl(),
folded : new FormControl(),
background: new FormControl()
}),
toolbar: this._formBuilder.group({
hidden : new FormControl(),
position : new FormControl(),
background: new FormControl()
variant : new FormControl()
}),
footer : this._formBuilder.group({
toolbar : this._formBuilder.group({
background: new FormControl(),
hidden : new FormControl(),
position : new FormControl(),
background: new FormControl()
position : new FormControl()
}),
footer : this._formBuilder.group({
background: new FormControl(),
hidden : new FormControl(),
position : new FormControl()
}),
sidepanel: this._formBuilder.group({
hidden: new FormControl(),
position : new FormControl()
})
}),
customScrollbars: new FormControl()
@@ -174,20 +179,21 @@ export class FuseThemeOptionsComponent implements OnInit, OnDestroy
layout: {
width : 'fullwidth',
navbar : {
background: 'mat-fuse-dark-700-bg',
folded : false,
hidden : false,
position : 'left',
folded : false,
background: 'mat-fuse-dark-700-bg'
variant : 'vertical-style-1'
},
toolbar: {
background: 'mat-white-500-bg',
hidden : false,
position : 'below-static',
background: 'mat-white-500-bg'
position : 'below-static'
},
footer : {
background: 'mat-fuse-dark-900-bg',
hidden : false,
position : 'below-static',
background: 'mat-fuse-dark-900-bg'
position : 'below-static'
}
}
});
@@ -202,20 +208,21 @@ export class FuseThemeOptionsComponent implements OnInit, OnDestroy
layout: {
width : 'fullwidth',
navbar : {
background: 'mat-fuse-dark-700-bg',
folded : false,
hidden : false,
position : 'left',
folded : false,
background: 'mat-fuse-dark-700-bg'
variant : 'vertical-style-1'
},
toolbar: {
background: 'mat-white-500-bg',
hidden : false,
position : 'below',
background: 'mat-white-500-bg'
position : 'below'
},
footer : {
background: 'mat-fuse-dark-900-bg',
hidden : false,
position : 'below',
background: 'mat-fuse-dark-900-bg'
position : 'below'
}
}
});
@@ -230,20 +237,21 @@ export class FuseThemeOptionsComponent implements OnInit, OnDestroy
layout: {
width : 'fullwidth',
navbar : {
background: 'mat-fuse-dark-700-bg',
folded : false,
hidden : false,
position : 'left',
folded : false,
background: 'mat-fuse-dark-700-bg'
layout : 'vertical-style-1'
},
toolbar: {
background: 'mat-white-500-bg',
hidden : false,
position : 'above-static',
background: 'mat-white-500-bg'
position : 'above-static'
},
footer : {
background: 'mat-fuse-dark-900-bg',
hidden : false,
position : 'above-static',
background: 'mat-fuse-dark-900-bg'
position : 'above-static'
}
}
});
@@ -258,20 +266,21 @@ export class FuseThemeOptionsComponent implements OnInit, OnDestroy
layout: {
width : 'fullwidth',
navbar : {
background: 'mat-fuse-dark-700-bg',
folded : false,
hidden : false,
position : 'top',
folded : false,
background: 'mat-fuse-dark-700-bg'
variant : 'vertical-style-1'
},
toolbar: {
background: 'mat-white-500-bg',
hidden : false,
position : 'above',
background: 'mat-white-500-bg'
position : 'above'
},
footer : {
background: 'mat-fuse-dark-900-bg',
hidden : false,
position : 'above-fixed',
background: 'mat-fuse-dark-900-bg'
position : 'above-fixed'
}
}
});

View File

@@ -1,7 +1,9 @@
import { Injectable } from '@angular/core';
import { MatSidenav } from '@angular/material';
@Injectable()
@Injectable({
providedIn: 'root'
})
export class FuseMatSidenavHelperService
{
sidenavInstances: MatSidenav[];

View File

@@ -1,27 +1,8 @@
import { ModuleWithProviders, NgModule, Optional, SkipSelf } from '@angular/core';
import { FUSE_CONFIG, FuseConfigService } from '@fuse/services/config.service';
import { FuseCopierService } from '@fuse/services/copier.service';
import { FuseMatchMediaService } from '@fuse/services/match-media.service';
import { FuseMatSidenavHelperService } from '@fuse/directives/fuse-mat-sidenav/fuse-mat-sidenav.service';
import { FuseNavigationService } from '@fuse/components/navigation/navigation.service';
import { FuseSidebarService } from '@fuse/components/sidebar/sidebar.service';
import { FuseSplashScreenService } from '@fuse/services/splash-screen.service';
import { FuseTranslationLoaderService } from '@fuse/services/translation-loader.service';
import { FUSE_CONFIG } from '@fuse/services/config.service';
@NgModule({
entryComponents: [],
providers : [
FuseConfigService,
FuseCopierService,
FuseMatchMediaService,
FuseMatSidenavHelperService,
FuseNavigationService,
FuseSidebarService,
FuseSplashScreenService,
FuseTranslationLoaderService
]
})
@NgModule()
export class FuseModule
{
constructor(@Optional() @SkipSelf() parentModule: FuseModule)

View File

@@ -6,6 +6,11 @@
}
}
// Fix: "Smooth scrolling for iOS"
.mat-dialog-container {
-webkit-overflow-scrolling: touch;
}
// Fix: "Inconsistent font sizes across elements"
.mat-form-field-wrapper {
font-size: 16px;

View File

@@ -14,7 +14,7 @@ i {
}
// Material colors map
$matColorsMap: (
$matPalettes: (
primary: $primary,
accent: $accent,
warn: $warn,
@@ -43,75 +43,91 @@ $matColorsMap: (
);
// Material color hues list
$matColorHues: 50, 100, 200, 300, 400, 500, 600, 700, 800, 900, A100, A200, A400, A700;
$matHues: 50, 100, 200, 300, 400, 500, 600, 700, 800, 900, A100, A200, A400, A700;
// Text color levels generator mixin
@mixin generateTextColorLevels($baseTextColor) {
@mixin generateTextColorLevels($classes, $contrast) {
// If the base text color is black...
@if (rgba(black, 1) == rgba($baseTextColor, 1)) {
// If the contrast is dark...
@if ($contrast == 'dark') {
i,
.icon {
color: rgba(0, 0, 0, 0.54);
}
// Put down the color classes
#{$classes} {
&.secondary-text,
.secondary-text {
color: rgba(0, 0, 0, 0.54) !important;
}
i,
.icon {
color: rgba(0, 0, 0, 0.54);
}
&.hint-text,
.hint-text,
&.disabled-text,
.disabled-text {
color: rgba(0, 0, 0, 0.38) !important;
}
&.secondary-text,
.secondary-text {
color: rgba(0, 0, 0, 0.54) !important;
}
&.divider,
.divider {
color: rgba(0, 0, 0, 0.12) !important;
}
&.hint-text,
.hint-text,
&.disabled-text,
.disabled-text {
color: rgba(0, 0, 0, 0.38) !important;
}
.mat-ripple-element {
background: rgba(0, 0, 0, 0.1);
&.divider,
.divider {
color: rgba(0, 0, 0, 0.12) !important;
}
.mat-ripple-element {
background: rgba(0, 0, 0, 0.1);
}
.adaptive-border-color {
border-color: rgba(0, 0, 0, 0.12);
}
}
}
// If the base text color is white...
@else {
i,
.icon {
color: rgba(255, 255, 255, 1);
}
// Put down the color classes
#{$classes} {
&.secondary-text,
.secondary-text {
color: rgba(255, 255, 255, 0.70) !important;
}
i,
.icon {
color: rgba(255, 255, 255, 1);
}
&.hint-text,
.hint-text,
&.disabled-text,
.disabled-text {
color: rgba(255, 255, 255, 0.50) !important;
}
&.secondary-text,
.secondary-text {
color: rgba(255, 255, 255, 0.70) !important;
}
&.divider,
.divider {
color: rgba(255, 255, 255, 0.12) !important;
}
&.hint-text,
.hint-text,
&.disabled-text,
.disabled-text {
color: rgba(255, 255, 255, 0.50) !important;
}
.mat-ripple-element {
background: rgba(255, 255, 255, 0.1);
&.divider,
.divider {
color: rgba(255, 255, 255, 0.12) !important;
}
.mat-ripple-element {
background: rgba(255, 255, 255, 0.1);
}
.adaptive-border-color {
border-color: rgba(255, 255, 255, 0.12);
}
}
}
}
@mixin generateMaterialElementColors($contrastColor) {
@mixin generateMaterialElementColors($classes, $contrast) {
// If the contrast color is white...
// If the contrast color is light...
$fuseForeground: (
base: white,
text: white,
@@ -119,8 +135,8 @@ $matColorHues: 50, 100, 200, 300, 400, 500, 600, 700, 800, 900, A100, A200, A400
divider: rgba(white, 0.12),
);
// If the contrast color is black...
@if (rgba(black, 1) == rgba($contrastColor, 1)) {
// If the contrast color is dark...
@if ($contrast == 'dark') {
$fuseForeground: (
base: black,
@@ -129,43 +145,47 @@ $matColorHues: 50, 100, 200, 300, 400, 500, 600, 700, 800, 900, A100, A200, A400
);
}
// Native Input
input[type="text"] {
color: map_get($fuseForeground, base);
}
// Put down the color classes
#{$classes} {
// Input
.mat-form-field-label {
color: map_get($fuseForeground, hint-text);
}
// Native Input
input[type="text"] {
color: map_get($fuseForeground, base);
}
.mat-form-field-underline {
background-color: map_get($fuseForeground, divider);
}
// Input
.mat-form-field-label {
color: map_get($fuseForeground, hint-text);
}
// Select
.mat-select-trigger,
.mat-select-arrow {
color: map_get($fuseForeground, hint-text);
}
.mat-form-field-underline {
background-color: map_get($fuseForeground, divider);
}
.mat-select-underline {
background-color: map_get($fuseForeground, divider);
}
// Select
.mat-select-trigger,
.mat-select-arrow {
color: map_get($fuseForeground, hint-text);
}
.mat-select-disabled .mat-select-value,
.mat-select-arrow,
.mat-select-trigger {
color: map_get($fuseForeground, hint-text);
}
.mat-select-underline {
background-color: map_get($fuseForeground, divider);
}
.mat-select-content,
.mat-select-panel-done-animating {
background: map_get($background, card);
}
.mat-select-disabled .mat-select-value,
.mat-select-arrow,
.mat-select-trigger {
color: map_get($fuseForeground, hint-text);
}
.mat-select-value {
color: map_get($fuseForeground, text);
.mat-select-content,
.mat-select-panel-done-animating {
background: map_get($background, card);
}
.mat-select-value {
color: map_get($fuseForeground, text);
}
}
}
@@ -180,14 +200,6 @@ $matColorHues: 50, 100, 200, 300, 400, 500, 600, 700, 800, 900, A100, A200, A400
background-color: $color !important;
color: $contrastColor !important;
// Generate text color levels
// based on current contrast color
@include generateTextColorLevels($contrastColor);
// Generate material element colors
// based on current contrast color
@include generateMaterialElementColors($contrastColor);
&[disabled] {
background-color: rgba($color, .12) !important;
color: rgba($contrastColor, .26) !important;
@@ -196,14 +208,6 @@ $matColorHues: 50, 100, 200, 300, 400, 500, 600, 700, 800, 900, A100, A200, A400
.#{$colorName}#{$hue}-fg {
color: $color !important;
// Generate text color levels
// based on current contrast color
@include generateTextColorLevels($color);
// Generate material element colors
// based on current contrast color
@include generateMaterialElementColors($color);
}
.#{$colorName}#{$hue}-border {
@@ -229,49 +233,126 @@ $matColorHues: 50, 100, 200, 300, 400, 500, 600, 700, 800, 900, A100, A200, A400
@mixin generateFuseColorClasses($primary, $accent, $warn) {
$colorMap: (
$palettes: (
primary: $primary,
accent: $accent,
warn: $warn
);
// Define contrast lists
$light-contrasting-classes: ();
$dark-contrasting-classes: ();
// Generate the color classes...
@each $name, $map in $colorMap {
@each $paletteName, $palette in $palettes {
@each $hue in $matColorHues {
// Get the contrasts map
$contrasts: map-get($palette, 'contrast');
$color: map-get($map, $hue);
$contrastColor: map-get(map-get($map, 'contrast'), $hue);
@each $hue in $matHues {
@if ($color != null and $contrastColor != null) {
// Get the color and the contrasting color
$color: map-get($palette, $hue);
$contrast: map-get($contrasts, $hue);
@include generateColorClasses($name, $color, $contrastColor, '-#{$hue}');
@if ($color != null and $contrast != null) {
// Generate color classes
@include generateColorClasses($paletteName, $color, $contrast, '-#{$hue}');
// If the contrast color is dark
@if (rgba(black, 1) == rgba($contrast, 1)) {
$dark-contrasting-classes: append($dark-contrasting-classes, unquote('.mat-#{$paletteName}-#{$hue}-bg'), 'comma');
}
// if the contrast color is light
@else {
$light-contrasting-classes: append($light-contrasting-classes, unquote('.mat-#{$paletteName}-#{$hue}-bg'), 'comma');
}
// Run the generator one more time for default values (500)
@if ($hue == 500) {
@include generateColorClasses($name, $color, $contrastColor, '');
// Generate color classes
@include generateColorClasses($paletteName, $color, $contrast, '');
// Add color to the correct list depending on the contrasting color
// If the contrast color is dark
@if (rgba(black, 1) == rgba($contrast, 1)) {
$dark-contrasting-classes: append($dark-contrasting-classes, unquote('.mat-#{$paletteName}-bg'), 'comma');
}
// if the contrast color is light
@else {
$light-contrasting-classes: append($light-contrasting-classes, unquote('.mat-#{$paletteName}-bg'), 'comma');
}
}
}
}
}
// Generate contrasting colors
@include generateTextColorLevels($dark-contrasting-classes, 'dark');
@include generateTextColorLevels($light-contrasting-classes, 'light');
@include generateMaterialElementColors($dark-contrasting-classes, 'dark');
@include generateMaterialElementColors($light-contrasting-classes, 'light');
}
// Generate the color classes...
// Define contrast lists
$light-contrasting-classes: ();
$dark-contrasting-classes: ();
@each $paletteName, $palette in $matPalettes {
// Get the contrasts map
$contrasts: map-get($palette, 'contrast');
@each $hue in $matHues {
// Get the color and the contrasting color
$color: map-get($palette, $hue);
$contrast: map-get($contrasts, $hue);
@if ($color != null and $contrast != null) {
// Generate color classes
@include generateColorClasses($paletteName, $color, $contrast, '-#{$hue}');
// Add color to the correct list depending on the contrasting color
// If the contrast color is dark
@if (rgba(black, 1) == rgba($contrast, 1)) {
$dark-contrasting-classes: append($dark-contrasting-classes, unquote('.mat-#{$paletteName}-#{$hue}-bg'), 'comma');
}
// if the contrast color is light
@else {
$light-contrasting-classes: append($light-contrasting-classes, unquote('.mat-#{$paletteName}-#{$hue}-bg'), 'comma');
}
// Run the generator one more time for default values (500)
@if ($hue == 500) {
// Generate color classes
@include generateColorClasses($paletteName, $color, $contrast, '');
// Add color to the correct list depending on the contrasting color
// If the contrast color is dark
@if (rgba(black, 1) == rgba($contrast, 1)) {
$dark-contrasting-classes: append($dark-contrasting-classes, unquote('.mat-#{$paletteName}-bg'), 'comma');
}
// if the contrast color is light
@else {
$light-contrasting-classes: append($light-contrasting-classes, unquote('.mat-#{$paletteName}-bg'), 'comma');
}
}
}
}
}
// Generate the color classes...
@each $colorName, $colorMap in $matColorsMap {
@each $hue in $matColorHues {
$color: map-get($colorMap, $hue);
$contrastColor: map-get(map-get($colorMap, 'contrast'), $hue);
@if ($color != null and $contrastColor != null) {
@include generateColorClasses($colorName, $color, $contrastColor, '-#{$hue}');
// Run the generator one more time for default values (500)
@if ($hue == 500) {
@include generateColorClasses($colorName, $color, $contrastColor, '');
}
}
}
}
// Generate contrasting colors
@include generateTextColorLevels($dark-contrasting-classes, 'dark');
@include generateTextColorLevels($light-contrasting-classes, 'light');
@include generateMaterialElementColors($dark-contrasting-classes, 'dark');
@include generateMaterialElementColors($light-contrasting-classes, 'light');

View File

@@ -10,4 +10,15 @@ body {
padding: 0;
overflow: hidden;
background: #F5F5F5;
}
body {
// Boxed
&.boxed {
max-width: 1200px;
margin: 0 auto;
@include mat-elevation(8);
}
}

View File

@@ -219,4 +219,26 @@
}
}
}
// Material style
&.material {
.nav-subheader {
border-top: 1px solid rgba(0, 0, 0, 0.12);
&:first-child {
border-top: none;
}
}
.nav-item {
.nav-link {
height: 40px;
padding: 0 16px;
margin: 4px 8px;
border-radius: 4px;
}
}
}
}

View File

@@ -143,8 +143,9 @@ $carded-header-height-without-toolbar-sm: $carded-header-height-sm - $carded-too
flex: 1 1 auto;
> .content {
overflow: auto;
flex: 1 1 auto;
overflow: auto;
-webkit-overflow-scrolling: touch;
}
}
}
@@ -166,6 +167,7 @@ $carded-header-height-without-toolbar-sm: $carded-header-height-sm - $carded-too
.tab-content {
overflow: auto;
-webkit-overflow-scrolling: touch;
}
}
}
@@ -346,6 +348,7 @@ $carded-header-height-without-toolbar-sm: $carded-header-height-sm - $carded-too
.content {
overflow: auto;
-webkit-overflow-scrolling: touch;
}
}
@@ -358,6 +361,7 @@ $carded-header-height-without-toolbar-sm: $carded-header-height-sm - $carded-too
> .content {
flex: 1 1 auto;
overflow: auto;
-webkit-overflow-scrolling: touch;
}
}
}
@@ -379,6 +383,7 @@ $carded-header-height-without-toolbar-sm: $carded-header-height-sm - $carded-too
.tab-content {
overflow: auto;
-webkit-overflow-scrolling: touch;
}
}
}
@@ -500,12 +505,14 @@ $carded-header-height-without-toolbar-sm: $carded-header-height-sm - $carded-too
.content {
overflow: auto;
-webkit-overflow-scrolling: touch;
}
}
> .center {
flex: 1 1 auto;
overflow: auto;
-webkit-overflow-scrolling: touch;
}
}
@@ -528,12 +535,14 @@ $carded-header-height-without-toolbar-sm: $carded-header-height-sm - $carded-too
.content {
overflow: auto;
-webkit-overflow-scrolling: touch;
}
}
> .center {
flex: 1 1 auto;
overflow: auto;
-webkit-overflow-scrolling: touch;
}
}
}

View File

@@ -36,11 +36,11 @@
/* General styles */
app {
fuse-navbar-vertical,
fuse-navbar-horizontal,
fuse-toolbar,
fuse-footer,
fuse-quick-panel,
fuse-sidebar,
navbar,
toolbar,
footer,
.theme-options-button,
fuse-theme-options,
.ps > .ps__rail-x,
.ps > .ps__rail-y {

View File

@@ -146,6 +146,7 @@ owl-date-time {
padding: .25em;
background-color: rgba(0, 0, 0, .1);
overflow-y: auto;
-webkit-overflow-scrolling: touch;
}
.owl-calendar-wrapper {

View File

@@ -11,6 +11,7 @@
height: 140px;
overflow-y: auto;
overflow-x: hidden;
-webkit-overflow-scrolling: touch;
> hr {
display: none;

View File

@@ -8,7 +8,9 @@ import * as _ from 'lodash';
// Create the injection token for the custom settings
export const FUSE_CONFIG = new InjectionToken('fuseCustomConfig');
@Injectable()
@Injectable({
providedIn: 'root'
})
export class FuseConfigService
{
// Private

View File

@@ -1,14 +1,15 @@
/**
* This class is based on the code in the following projects:
*
* - https://github.com/zenorocha/select
* - https://github.com/zenorocha/clipboard.js/
* https://github.com/zenorocha/select
* https://github.com/zenorocha/clipboard.js/
*
* Both released under MIT license - © Zeno Rocha
*/
import { Injectable } from '@angular/core';
@Injectable()
@Injectable({
providedIn: 'root'
})
export class FuseCopierService
{
private textarea: HTMLTextAreaElement;

View File

@@ -2,7 +2,9 @@ import { MediaChange, ObservableMedia } from '@angular/flex-layout';
import { Injectable } from '@angular/core';
import { BehaviorSubject } from 'rxjs';
@Injectable()
@Injectable({
providedIn: 'root'
})
export class FuseMatchMediaService
{
activeMediaQuery: string;

View File

@@ -3,7 +3,9 @@ import { DOCUMENT } from '@angular/common';
import { animate, AnimationBuilder, AnimationPlayer, style } from '@angular/animations';
import { NavigationEnd, Router } from '@angular/router';
@Injectable()
@Injectable({
providedIn: 'root'
})
export class FuseSplashScreenService
{
splashScreenEl: any;

View File

@@ -7,7 +7,9 @@ export interface Locale
data: Object;
}
@Injectable()
@Injectable({
providedIn: 'root'
})
export class FuseTranslationLoaderService
{
/**

View File

@@ -4,20 +4,25 @@ export interface FuseConfig
style: string,
width: 'fullwidth' | 'boxed',
navbar: {
background: string,
hidden: boolean,
folded: boolean,
position: 'left' | 'right' | 'top',
background: string
variant: string
},
toolbar: {
background: string,
hidden: boolean,
position: 'above' | 'above-static' | 'above-fixed' | 'below' | 'below-static' | 'below-fixed',
background: string
position: 'above' | 'above-static' | 'above-fixed' | 'below' | 'below-static' | 'below-fixed'
}
footer: {
background: string,
hidden: boolean,
position: 'above' | 'above-static' | 'above-fixed' | 'below' | 'below-static' | 'below-fixed',
background: string
position: 'above' | 'above-static' | 'above-fixed' | 'below' | 'below-static' | 'below-fixed'
},
sidepanel: {
hidden: boolean,
position: 'left' | 'right'
}
};
customScrollbars: boolean;

View File

@@ -7,6 +7,7 @@ export interface FuseNavigationItem
icon?: string;
hidden?: boolean;
url?: string;
classes?: string;
exactMatch?: boolean;
externalUrl?: boolean;
openInNewTab?: boolean;

View File

@@ -1,29 +1,40 @@
<!-- PROGRESS BAR -->
<fuse-progress-bar></fuse-progress-bar>
<!-- / PROGRESS BAR -->
<!-- VERTICAL LAYOUT 1 -->
<ng-container *ngIf="fuseConfig.layout.style === 'vertical-layout-1'">
<vertical-layout-1></vertical-layout-1>
</ng-container>
<!-- / VERTICAL LAYOUT 1 -->
<!-- VERTICAL LAYOUT 2 -->
<ng-container *ngIf="fuseConfig.layout.style === 'vertical-layout-2'">
<vertical-layout-2></vertical-layout-2>
</ng-container>
<!-- / VERTICAL LAYOUT 2 -->
<!-- VERTICAL LAYOUT 3 -->
<ng-container *ngIf="fuseConfig.layout.style === 'vertical-layout-3'">
<vertical-layout-3></vertical-layout-3>
</ng-container>
<!-- / VERTICAL LAYOUT 3 -->
<!-- HORIZONTAL LAYOUT 1 -->
<ng-container *ngIf="fuseConfig.layout.style === 'horizontal-layout-1'">
<horizontal-layout-1></horizontal-layout-1>
</ng-container>
<!-- / HORIZONTAL LAYOUT 1 -->
<!-- THEME OPTIONS PANEL -->
<button mat-icon-button class="mat-primary-bg mat-elevation-z2 theme-options-button"
[ngClass]="{'right-side-panel': fuseConfig.layout.sidepanel.position === 'right',
'side-panel-hidden': fuseConfig.layout.sidepanel.hidden === true}"
(click)="toggleSidebarOpen('themeOptionsPanel')">
<mat-icon>settings</mat-icon>
</button>
<fuse-sidebar name="themeOptionsPanel" class="theme-options-sidebar" position="right" [invisibleOverlay]="true">
<fuse-theme-options></fuse-theme-options>
</fuse-sidebar>
</fuse-sidebar>
<!-- / THEME OPTIONS PANEL -->

View File

@@ -1,3 +1,5 @@
@import "src/@fuse/scss/fuse";
:host {
position: relative;
display: flex;
@@ -18,9 +20,20 @@
border-radius: 0;
margin: 0;
pointer-events: auto;
opacity: .75;
opacity: .90;
z-index: 998;
&.right-side-panel {
@include media-breakpoint-up('lg') {
right: 70px;
}
}
&.side-panel-hidden {
right: 0 !important;
}
mat-icon {
animation: rotating 3s linear infinite;
}

View File

@@ -1,4 +1,6 @@
import { Component, OnDestroy, OnInit } from '@angular/core';
import { Component, Inject, OnDestroy, OnInit } from '@angular/core';
import { DOCUMENT } from '@angular/common';
import { Platform } from '@angular/cdk/platform';
import { TranslateService } from '@ngx-translate/core';
import { Subject } from 'rxjs';
import { takeUntil } from 'rxjs/operators';
@@ -20,8 +22,8 @@ import { locale as navigationTurkish } from 'app/navigation/i18n/tr';
})
export class AppComponent implements OnInit, OnDestroy
{
navigation: any;
fuseConfig: any;
navigation: any;
// Private
private _unsubscribeAll: Subject<any>;
@@ -29,20 +31,24 @@ export class AppComponent implements OnInit, OnDestroy
/**
* Constructor
*
* @param {DOCUMENT} document
* @param {FuseConfigService} _fuseConfigService
* @param {FuseNavigationService} _fuseNavigationService
* @param {FuseSidebarService} _fuseSidebarService
* @param {FuseSplashScreenService} _fuseSplashScreenService
* @param {FuseTranslationLoaderService} _fuseTranslationLoaderService
* @param {Platform} _platform
* @param {TranslateService} _translateService
*/
constructor(
@Inject(DOCUMENT) private document: any,
private _fuseConfigService: FuseConfigService,
private _fuseNavigationService: FuseNavigationService,
private _fuseSidebarService: FuseSidebarService,
private _fuseSplashScreenService: FuseSplashScreenService,
private _fuseTranslationLoaderService: FuseTranslationLoaderService,
private _translateService: TranslateService
private _translateService: TranslateService,
private _platform: Platform
)
{
// Get default navigation
@@ -66,6 +72,12 @@ export class AppComponent implements OnInit, OnDestroy
// Use a language
this._translateService.use('en');
// Add is-mobile class to the body if the platform is mobile
if ( this._platform.ANDROID || this._platform.IOS )
{
this.document.body.classList.add('is-mobile');
}
// Set the private defaults
this._unsubscribeAll = new Subject();
}
@@ -84,6 +96,15 @@ export class AppComponent implements OnInit, OnDestroy
.pipe(takeUntil(this._unsubscribeAll))
.subscribe((config) => {
this.fuseConfig = config;
if ( this.fuseConfig.layout.width === 'boxed' )
{
this.document.body.classList.add('boxed');
}
else
{
this.document.body.classList.remove('boxed');
}
});
}

View File

@@ -11,7 +11,7 @@ import 'hammerjs';
import { FuseModule } from '@fuse/fuse.module';
import { FuseSharedModule } from '@fuse/shared.module';
import { FuseSidebarModule, FuseThemeOptionsModule } from '@fuse/components';
import { FuseProgressBarModule, FuseSidebarModule, FuseThemeOptionsModule } from '@fuse/components';
import { fuseConfig } from 'app/fuse-config';
@@ -72,6 +72,7 @@ const appRoutes: Routes = [
// Fuse modules
FuseModule.forRoot(fuseConfig),
FuseProgressBarModule,
FuseSharedModule,
FuseSidebarModule,
FuseThemeOptionsModule,

View File

@@ -0,0 +1,343 @@
export class ChatPanelFakeDb
{
public static contacts = [
{
'id' : '5725a680b3249760ea21de52',
'name' : 'Alice Freeman',
'avatar': 'assets/images/avatars/alice.jpg',
'status': 'online',
'mood' : 'Lorem ipsum dolor sit amet, consectetur adipiscing elit...',
'unread': '2'
},
{
'id' : '5725a680606588342058356d',
'name' : 'Arnold',
'avatar': 'assets/images/avatars/Arnold.jpg',
'status': 'do-not-disturb',
'mood' : 'Lorem ipsum dolor sit amet, consectetur adipiscing elit...'
},
{
'id' : '5725a68009e20d0a9e9acf2a',
'name' : 'Barrera',
'avatar': 'assets/images/avatars/Barrera.jpg',
'status': 'do-not-disturb',
'mood' : 'Lorem ipsum dolor sit amet, consectetur adipiscing elit...'
},
{
'id' : '5725a6809fdd915739187ed5',
'name' : 'Blair',
'avatar': 'assets/images/avatars/Blair.jpg',
'status': 'offline',
'mood' : 'Lorem ipsum dolor sit amet, consectetur adipiscing elit...',
'unread': '3'
},
{
'id' : '5725a68007920cf75051da64',
'name' : 'Boyle',
'avatar': 'assets/images/avatars/Boyle.jpg',
'status': 'offline',
'mood' : 'Lorem ipsum dolor sit amet, consectetur adipiscing elit...',
'unread': '1'
},
{
'id' : '5725a68031fdbb1db2c1af47',
'name' : 'Christy',
'avatar': 'assets/images/avatars/Christy.jpg',
'status': 'offline',
'mood' : 'Lorem ipsum dolor sit amet, consectetur adipiscing elit...'
},
{
'id' : '5725a680bc670af746c435e2',
'name' : 'Copeland',
'avatar': 'assets/images/avatars/Copeland.jpg',
'status': 'online',
'mood' : 'Lorem ipsum dolor sit amet, consectetur adipiscing elit...'
},
{
'id' : '5725a680e7eb988a58ddf303',
'name' : 'Estes',
'avatar': 'assets/images/avatars/Estes.jpg',
'status': 'away',
'mood' : 'Lorem ipsum dolor sit amet, consectetur adipiscing elit...'
},
{
'id' : '5725a680dcb077889f758961',
'name' : 'Harper',
'avatar': 'assets/images/avatars/Harper.jpg',
'status': 'offline',
'mood' : 'Lorem ipsum dolor sit amet, consectetur adipiscing elit...'
},
{
'id' : '5725a6806acf030f9341e925',
'name' : 'Helen',
'avatar': 'assets/images/avatars/Helen.jpg',
'status': 'away',
'mood' : 'Lorem ipsum dolor sit amet, consectetur adipiscing elit...'
},
{
'id' : '5725a680ae1ae9a3c960d487',
'name' : 'Henderson',
'avatar': 'assets/images/avatars/Henderson.jpg',
'status': 'offline',
'mood' : 'Lorem ipsum dolor sit amet, consectetur adipiscing elit...'
},
{
'id' : '5725a680b8d240c011dd224b',
'name' : 'Josefina',
'avatar': 'assets/images/avatars/Josefina.jpg',
'status': 'online',
'mood' : 'Lorem ipsum dolor sit amet, consectetur adipiscing elit...'
},
{
'id' : '5725a68034cb3968e1f79eac',
'name' : 'Katina',
'avatar': 'assets/images/avatars/Katina.jpg',
'status': 'away',
'mood' : 'Lorem ipsum dolor sit amet, consectetur adipiscing elit...'
},
{
'id' : '5725a6801146cce777df2a08',
'name' : 'Lily',
'avatar': 'assets/images/avatars/Lily.jpg',
'status': 'do-not-disturb',
'mood' : 'Lorem ipsum dolor sit amet, consectetur adipiscing elit...',
'unread': '10'
},
{
'id' : '5725a6808a178bfd034d6ecf',
'name' : 'Mai',
'avatar': 'assets/images/avatars/Mai.jpg',
'status': 'away',
'mood' : 'Lorem ipsum dolor sit amet, consectetur adipiscing elit...'
},
{
'id' : '5725a680653c265f5c79b5a9',
'name' : 'Nancy',
'avatar': 'assets/images/avatars/Nancy.jpg',
'status': 'do-not-disturb',
'mood' : 'Lorem ipsum dolor sit amet, consectetur adipiscing elit...'
},
{
'id' : '5725a680bbcec3cc32a8488a',
'name' : 'Nora',
'avatar': 'assets/images/avatars/Nora.jpg',
'status': 'do-not-disturb',
'mood' : 'Lorem ipsum dolor sit amet, consectetur adipiscing elit...',
'unread': '7'
},
{
'id' : '5725a6803d87f1b77e17b62b',
'name' : 'Odessa',
'avatar': 'assets/images/avatars/Odessa.jpg',
'status': 'away',
'mood' : 'Lorem ipsum dolor sit amet, consectetur adipiscing elit...',
'unread': '1'
},
{
'id' : '5725a680e87cb319bd9bd673',
'name' : 'Reyna',
'avatar': 'assets/images/avatars/Reyna.jpg',
'status': 'offline',
'mood' : 'Lorem ipsum dolor sit amet, consectetur adipiscing elit...'
},
{
'id' : '5725a6802d10e277a0f35775',
'name' : 'Shauna',
'avatar': 'assets/images/avatars/Shauna.jpg',
'status': 'online',
'mood' : 'Lorem ipsum dolor sit amet, consectetur adipiscing elit...'
},
{
'id' : '5725a680aef1e5cf26dd3d1f',
'name' : 'Shepard',
'avatar': 'assets/images/avatars/Shepard.jpg',
'status': 'online',
'mood' : 'Lorem ipsum dolor sit amet, consectetur adipiscing elit...'
},
{
'id' : '5725a680cd7efa56a45aea5d',
'name' : 'Tillman',
'avatar': 'assets/images/avatars/Tillman.jpg',
'status': 'do-not-disturb',
'mood' : '',
'unread': '99+'
},
{
'id' : '5725a680fb65c91a82cb35e2',
'name' : 'Trevino',
'avatar': 'assets/images/avatars/Trevino.jpg',
'status': 'away',
'mood' : 'Lorem ipsum dolor sit amet, consectetur adipiscing elit...'
},
{
'id' : '5725a68018c663044be49cbf',
'name' : 'Tyson',
'avatar': 'assets/images/avatars/Tyson.jpg',
'status': 'do-not-disturb',
'mood' : 'Lorem ipsum dolor sit amet, consectetur adipiscing elit...'
},
{
'id' : '5725a6809413bf8a0a5272b1',
'name' : 'Velazquez',
'avatar': 'assets/images/avatars/Velazquez.jpg',
'status': 'online',
'mood' : 'Lorem ipsum dolor sit amet, consectetur adipiscing elit...'
}
];
public static chats = [
{
'id' : '1725a680b3249760ea21de52',
'dialog': [
{
'who' : '5725a680b3249760ea21de52',
'message': 'Quickly come to the meeting room 1B, we have a big server issue',
'time' : '2017-03-22T08:54:28.299Z'
},
{
'who' : '5725a6802d10e277a0f35724',
'message': 'Im having breakfast right now, cant you wait for 10 minutes?',
'time' : '2017-03-22T08:55:28.299Z'
},
{
'who' : '5725a6802d10e277a0f35724',
'message': 'Im having breakfast right now, cant you wait for 10 minutes?',
'time' : '2017-03-22T08:55:28.299Z'
},
{
'who' : '5725a680b3249760ea21de52',
'message': 'We are losing money! Quick!',
'time' : '2017-03-22T09:00:28.299Z'
},
{
'who' : '5725a6802d10e277a0f35724',
'message': 'Its not my money, you know. I will eat my breakfast and then I will come to the meeting room.',
'time' : '2017-03-22T09:02:28.299Z'
},
{
'who' : '5725a680b3249760ea21de52',
'message': 'You are the worst!',
'time' : '2017-03-22T09:05:28.299Z'
},
{
'who' : '5725a680b3249760ea21de52',
'message': 'We are losing money! Quick!',
'time' : '2017-03-22T09:15:28.299Z'
},
{
'who' : '5725a680b3249760ea21de52',
'message': 'You are the worst!',
'time' : '2017-03-22T09:05:28.299Z'
},
{
'who' : '5725a680b3249760ea21de52',
'message': 'We are losing money! Quick!',
'time' : '2017-03-22T09:15:28.299Z'
},
{
'who' : '5725a6802d10e277a0f35724',
'message': 'Its not my money, you know. I will eat my breakfast and then I will come to the meeting room.',
'time' : '2017-03-22T09:20:28.299Z'
},
{
'who' : '5725a680b3249760ea21de52',
'message': 'You are the worst!',
'time' : '2017-03-22T09:22:28.299Z'
},
{
'who' : '5725a680b3249760ea21de52',
'message': 'We are losing money! Quick!',
'time' : '2017-03-22T09:25:28.299Z'
},
{
'who' : '5725a6802d10e277a0f35724',
'message': 'Its not my money, you know. I will eat my breakfast and then I will come to the meeting room.',
'time' : '2017-03-22T09:27:28.299Z'
},
{
'who' : '5725a680b3249760ea21de52',
'message': 'You are the worst!',
'time' : '2017-03-22T09:33:28.299Z'
},
{
'who' : '5725a680b3249760ea21de52',
'message': 'You are the worst!',
'time' : '2017-03-22T09:33:28.299Z'
},
{
'who' : '5725a680b3249760ea21de52',
'message': 'We are losing money! Quick!',
'time' : '2017-03-22T09:35:28.299Z'
},
{
'who' : '5725a6802d10e277a0f35724',
'message': 'Its not my money, you know. I will eat my breakfast and then I will come to the meeting room.',
'time' : '2017-03-22T09:45:28.299Z'
},
{
'who' : '5725a680b3249760ea21de52',
'message': 'You are the worst!',
'time' : '2017-03-22T10:00:28.299Z'
}
]
},
{
'id' : '2725a680b8d240c011dd2243',
'dialog': [
{
'who' : '5725a680606588342058356d',
'message': 'Quickly come to the meeting room 1B, we have a big server issue',
'time' : '2017-04-22T01:00:00.299Z'
},
{
'who' : '5725a6802d10e277a0f35724',
'message': 'Im having breakfast right now, cant you wait for 10 minutes?',
'time' : '2017-04-22T01:05:00.299Z'
},
{
'who' : '5725a680606588342058356d',
'message': 'We are losing money! Quick!',
'time' : '2017-04-22T01:10:00.299Z'
}
]
},
{
'id' : '3725a6809413bf8a0a5272b4',
'dialog': [
{
'who' : '5725a68009e20d0a9e9acf2a',
'message': 'Quickly come to the meeting room 1B, we have a big server issue',
'time' : '2017-04-22T02:10:00.299Z'
}
]
}
];
public static user = [
{
'id' : '5725a6802d10e277a0f35724',
'name' : 'John Doe',
'avatar' : 'assets/images/avatars/profile.jpg',
'status' : 'online',
'mood' : '',
'chatList': [
{
'chatId' : '1725a680b3249760ea21de52',
'contactId' : '5725a680b3249760ea21de52',
'lastMessageTime': '2017-06-12T02:10:18.931Z'
},
{
'chatId' : '2725a680b8d240c011dd2243',
'contactId' : '5725a680606588342058356d',
'lastMessageTime': '2017-02-18T10:30:18.931Z'
},
{
'chatId' : '3725a6809413bf8a0a5272b4',
'contactId' : '5725a68009e20d0a9e9acf2a',
'lastMessageTime': '2017-03-18T12:30:18.931Z'
}
]
}
];
}

View File

@@ -17,6 +17,7 @@ import { SearchFakeDb } from 'app/fake-db/search';
import { FaqFakeDb } from 'app/fake-db/faq';
import { KnowledgeBaseFakeDb } from 'app/fake-db/knowledge-base';
import { IconsFakeDb } from 'app/fake-db/icons';
import { ChatPanelFakeDb } from 'app/fake-db/chat-panel';
import { QuickPanelFakeDb } from 'app/fake-db/quick-panel';
export class FakeDbService implements InMemoryDbService
@@ -89,6 +90,11 @@ export class FakeDbService implements InMemoryDbService
// Icons
'icons': IconsFakeDb.icons,
// Chat Panel
'chat-panel-contacts' : ChatPanelFakeDb.contacts,
'chat-panel-chats': ChatPanelFakeDb.chats,
'chat-panel-user': ChatPanelFakeDb.user,
// Quick Panel
'quick-panel-notes' : QuickPanelFakeDb.notes,
'quick-panel-events': QuickPanelFakeDb.events

View File

@@ -10,23 +10,28 @@ import { FuseConfig } from '@fuse/types';
export const fuseConfig: FuseConfig = {
layout : {
style : 'vertical-layout-1',
width : 'fullwidth',
navbar : {
style : 'vertical-layout-1',
width : 'fullwidth',
navbar : {
background: 'mat-fuse-dark-700-bg',
folded : false,
hidden : false,
position : 'left',
folded : false,
background: 'mat-fuse-dark-700-bg'
variant : 'vertical-style-1'
},
toolbar : {
toolbar : {
background: 'mat-white-500-bg',
hidden : false,
position : 'below-static',
background: 'mat-white-500-bg'
position : 'below-static'
},
footer : {
footer : {
background: 'mat-fuse-dark-900-bg',
hidden : false,
position : 'below-static',
background: 'mat-fuse-dark-900-bg'
position : 'below-fixed'
},
sidepanel: {
hidden : false,
position: 'right'
}
},
customScrollbars: true

View File

@@ -0,0 +1,140 @@
<div class="header mat-elevation-z4 mat-primary-bg" fxLayout="row" fxLayoutAlign="space-between center">
<ng-container *ngIf="selectedContact === null">
<div class="title ml-16" fxLayout="row" fxLayoutAlign="start center"
(click)="unfoldSidebarTemporarily()">
<mat-icon class="s-32 white-fg">chat</mat-icon>
<h3 class="ml-12">Team Chat</h3>
</div>
</ng-container>
<ng-container *ngIf="selectedContact !== null">
<div class="title" fxLayout="row" fxLayoutAlign="start center">
<img [src]="selectedContact.avatar" class="avatar mx-16">
<h3 class="text-truncate">{{selectedContact.name}}</h3>
</div>
</ng-container>
<button mat-icon-button class="toggle-sidebar-folded mr-8" (click)="foldSidebarTemporarily();resetChat();"
fxHide fxShow.gt-md>
<mat-icon class="secondary-text s-20">close</mat-icon>
</button>
<button mat-icon-button class="toggle-sidebar-open mr-8" (click)="toggleSidebarOpen();resetChat();"
fxHide.gt-md>
<mat-icon class="secondary-text">close</mat-icon>
</button>
</div>
<div class="content">
<!-- Contacts -->
<div id="contacts-list" fusePerfectScrollbar [fusePerfectScrollbarOptions]="{suppressScrollX: true}">
<div *ngFor="let contact of contacts"
class="contacts-list-item"
[ngClass]="contact.status"
[class.active]="contact.id === selectedContact?.id"
(click)="toggleChat(contact)">
<img class="avatar" [src]="contact.avatar"
[matTooltip]="contact.name"
matTooltipPosition="left">
<div class="unread-count" *ngIf="contact.unread">{{contact.unread}}</div>
<div class="status-icon" [ngClass]="contact.status"></div>
</div>
</div>
<!-- / Contacts -->
<!-- Chat -->
<div id="chat" fxLayout="column" fxFlex="1 1 auto">
<div id="messages" class="messages" fxFlex="1 1 auto" fusePerfectScrollbar>
<ng-container *ngIf="chat && chat.dialog && chat.dialog.length > 0">
<div *ngFor="let message of chat.dialog; let i = index" class="message-row"
[ngClass]="{
'me': message.who === user.id,
'contact': message.who !== user.id,
'first-of-group': isFirstMessageOfGroup(message, i),
'last-of-group': isLastMessageOfGroup(message, i)
}">
<img *ngIf="shouldShowContactAvatar(message, i)"
src="{{selectedContact.avatar}}"
class="avatar">
<div class="bubble">
<div class="message">{{message.message}}</div>
<div class="time secondary-text">{{message.time | date:'short'}}</div>
</div>
</div>
</ng-container>
<ng-container *ngIf="selectedContact && chat && chat.dialog && chat.dialog.length === 0">
<div class="no-messages-icon">
<mat-icon class="s-128">chat</mat-icon>
</div>
<div class="no-messages secondary-text">
Start a conversation by typing your message below.
</div>
</ng-container>
<ng-container *ngIf="!selectedContact">
<div class="no-contact-selected">
<div class="no-contact-icon">
<mat-icon class="s-128">chat</mat-icon>
</div>
<div class="no-contact secondary-text">
Select a contact to start a conversation.
</div>
</div>
</ng-container>
</div>
<div class="reply-form" fxFlex="0 0 auto" fxLayout="row" fxLayoutAlign="center center"
*ngIf="selectedContact">
<form #replyForm="ngForm"
(ngSubmit)="reply($event)"
(keydown.enter)="reply($event)"
fxFlex
fxLayout="row"
fxLayoutAlign="start center">
<mat-form-field class="message-text" fxFlex floatLabel="never" appearance="standard">
<textarea matInput #replyInput ngModel name="message" placeholder="Type your message"
[rows]="1" [matTextareaAutosize]="true"></textarea>
</mat-form-field>
<button class="send-message-button" mat-icon-button type="submit" aria-label="Send message">
<mat-icon class="secondary-text">send</mat-icon>
</button>
</form>
</div>
</div>
<!-- / Chat -->
</div>

View File

@@ -0,0 +1,466 @@
@import "src/@fuse/scss/fuse";
chat-panel {
display: flex;
flex-direction: column;
flex: 1 1 auto;
width: 360px;
min-width: 360px;
max-width: 360px;
z-index: 99;
overflow: hidden;
@include media-breakpoint-down('xs') {
max-width: none !important;
width: 100% !important;
}
.header {
position: relative;
height: 64px;
max-height: 64px;
min-height: 64px;
z-index: 10;
.title {
cursor: pointer;
mat-icon {
margin-left: 4px;
}
h3 {
max-width: 120px;
transition: opacity 300ms ease-in-out;
}
}
}
.content {
flex: 1 1 100%;
min-height: 0;
}
#contacts-list {
position: relative;
z-index: 5;
padding: 16px 0;
width: 72px;
min-width: 72px;
max-width: 72px;
background-color: #F9F9F9;
overflow: auto;
-webkit-overflow-scrolling: touch;
// Perfect scrollbar
.ps__rail-y {
width: 3px !important;
.ps__thumb-y {
width: 3px !important;
}
}
.contacts-list-item {
position: relative;
display: flex;
align-items: center;
justify-content: center;
padding: 0 16px;
height: 56px;
cursor: pointer;
&.active {
position: relative;
background-color: mat-color(mat-palette($mat-indigo, 50));
.status-icon {
border-color: mat-color(mat-palette($mat-indigo, 50));
}
&:after {
position: absolute;
top: 8px;
right: 0;
bottom: 8px;
content: "";
width: 4px;
border-top-left-radius: 4px;
border-bottom-left-radius: 4px;
background-color: mat-color(mat-palette($mat-indigo));
}
}
&.offline {
.mat-list-item-content {
img {
filter: grayscale(100%);
opacity: 0.7;
}
h3 {
opacity: 0.7;
}
}
}
.avatar {
margin: 0;
width: 32px;
height: 32px;
min-width: 32px;
}
.unread-count {
position: absolute;
min-width: 18px;
height: 18px;
top: 8px;
left: 12px;
border-radius: 9px;
padding: 0 5px;
font-size: 11px;
text-align: center;
display: flex;
align-items: center;
justify-content: center;
background-color: mat-color(mat-palette($mat-indigo));
color: white;
box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.35);
}
.status-icon {
position: absolute;
width: 12px;
height: 12px;
bottom: 10px;
left: 44px;
border: 2px solid #F9F9F9;
border-radius: 50%;
&.online {
background-color: #4CAF50;
}
&.do-not-disturb {
background-color: #F44336;
}
&.away {
background-color: #FFC107;
}
&.offline {
background-color: #646464;
}
}
}
}
#chat {
position: relative;
z-index: 7;
flex: 1 1 100%;
background-color: white;
box-shadow: -1px 0 2px 0 rgba(0, 0, 0, 0.25);
.messages {
position: relative;
padding: 16px 0 40px 40px;
overflow: auto;
-webkit-overflow-scrolling: touch;
.message-row {
position: relative;
display: flex;
flex-direction: column;
align-items: flex-start;
justify-content: flex-end;
padding: 0 16px 4px 16px;
.avatar {
position: absolute;
left: -32px;
margin: 0;
}
.bubble {
position: relative;
display: flex;
align-items: center;
justify-content: center;
padding: 12px;
max-width: 100%;
.message {
white-space: pre-wrap;
line-height: 1.2;
}
.time {
position: absolute;
display: none;
width: 100%;
font-size: 11px;
margin-top: 8px;
top: 100%;
left: 0;
color: $black-87-opacity;
white-space: nowrap;
}
}
&.contact {
.bubble {
background-color: mat-color(mat-palette($mat-indigo));
color: white;
border-top-left-radius: 5px;
border-bottom-left-radius: 5px;
border-top-right-radius: 20px;
border-bottom-right-radius: 20px;
.time {
margin-left: 12px;
}
}
&.first-of-group {
.bubble {
border-top-left-radius: 20px;
}
}
&.last-of-group {
.bubble {
border-bottom-left-radius: 20px;
}
}
}
&.me {
padding-left: 40px;
.avatar {
order: 2;
margin: 0 0 0 16px;
}
.bubble {
margin-left: auto;
background-color: #E0E0E0;
color: $black-87-opacity;
border-top-left-radius: 20px;
border-bottom-left-radius: 20px;
border-top-right-radius: 5px;
border-bottom-right-radius: 5px;
.time {
justify-content: flex-end;
right: 0;
margin-right: 12px;
}
}
&.first-of-group {
.bubble {
border-top-right-radius: 20px;
}
}
&.last-of-group {
.bubble {
border-bottom-right-radius: 20px;
}
}
}
&.contact + .me,
&.me + .contact {
padding-top: 20px;
margin-top: 20px;
}
&.first-of-group {
.bubble {
border-top-left-radius: 20px;
padding-top: 13px;
}
}
&.last-of-group {
.bubble {
border-bottom-left-radius: 20px;
padding-bottom: 13px;
.time {
display: flex;
}
}
}
}
.no-messages-icon {
position: absolute;
top: 50%;
right: 0;
left: 0;
padding: 0 24px;
margin-top: -64px;
text-align: center;
mat-icon {
color: rgba(0, 0, 0, 0.06);
}
}
.no-messages {
position: absolute;
right: 0;
bottom: 0;
left: 0;
padding: 0 16px 24px 16px;
text-align: center;
}
.no-contact-selected {
position: absolute;
top: 50%;
right: 0;
left: 0;
transform: translateY(-50%);
padding: 0 24px;
text-align: center;
.no-contact-icon {
mat-icon {
color: rgba(0, 0, 0, 0.06);
}
}
.no-contact {
margin-top: 24px;
}
}
}
.reply-form {
position: relative;
.message-text {
background-color: #E0E0E0;
padding: 16px 8px;
.mat-form-field-wrapper {
padding: 0;
.mat-form-field-flex {
padding: 0;
.mat-form-field-infix {
padding: 0;
border: none;
background: white;
border-radius: 20px;
@include mat-elevation(2);
textarea {
overflow: hidden;
margin: 16px 48px 16px 16px;
width: calc(100% - 64px);
padding: 0;
}
}
}
.mat-form-field-underline {
display: none !important;
}
}
}
.send-message-button {
position: absolute;
right: 16px;
bottom: 21px;
}
}
}
}
fuse-sidebar {
&.chat-panel {
width: 360px;
min-width: 360px;
max-width: 360px;
@include media-breakpoint-down('xs') {
min-width: 0 !important;
max-width: 100vw !important;
width: 100vw !important;
}
&.left-chat-panel {
.header {
.toggle-sidebar-folded,
.toggle-sidebar-open {
mat-icon {
transform: rotate(180deg);
}
}
}
}
// Folded
&.folded {
chat-panel {
.header {
.title {
h3 {
opacity: 0;
}
}
}
}
// Folded unfolded
&.unfolded {
chat-panel {
.header {
.title {
h3 {
opacity: 1;
}
}
}
}
}
}
}
}

View File

@@ -0,0 +1,286 @@
import { AfterViewInit, Component, ElementRef, OnDestroy, OnInit, QueryList, ViewChild, ViewChildren, ViewEncapsulation } from '@angular/core';
import { NgForm } from '@angular/forms';
import { HttpClient } from '@angular/common/http';
import { Subject } from 'rxjs';
import { takeUntil } from 'rxjs/operators';
import { FuseSidebarService } from '@fuse/components/sidebar/sidebar.service';
import { FusePerfectScrollbarDirective } from '@fuse/directives/fuse-perfect-scrollbar/fuse-perfect-scrollbar.directive';
import { ChatPanelService } from 'app/layout/components/chat-panel/chat-panel.service';
@Component({
selector : 'chat-panel',
templateUrl : './chat-panel.component.html',
styleUrls : ['./chat-panel.component.scss'],
encapsulation: ViewEncapsulation.None
})
export class ChatPanelComponent implements OnInit, AfterViewInit, OnDestroy
{
contacts: any[];
chat: any;
selectedContact: any;
sidebarFolded: boolean;
user: any;
@ViewChild('replyForm')
set replyForm(content: NgForm)
{
this._replyForm = content;
}
@ViewChild('replyInput')
set replyInput(content: ElementRef)
{
this._replyInput = content;
}
@ViewChildren(FusePerfectScrollbarDirective)
private _fusePerfectScrollbarDirectives: QueryList<FusePerfectScrollbarDirective>;
// Private
private _chatViewScrollbar: FusePerfectScrollbarDirective;
private _replyForm: NgForm;
private _replyInput: ElementRef;
private _unsubscribeAll: Subject<any>;
/**
* Constructor
*
* @param {ChatPanelService} _chatPanelService
* @param {HttpClient} _httpClient
* @param {FuseSidebarService} _fuseSidebarService
*/
constructor(
private _chatPanelService: ChatPanelService,
private _httpClient: HttpClient,
private _fuseSidebarService: FuseSidebarService
)
{
// Set the defaults
this.selectedContact = null;
this.sidebarFolded = true;
// Set the private defaults
this._unsubscribeAll = new Subject();
}
// -----------------------------------------------------------------------------------------------------
// @ Lifecycle hooks
// -----------------------------------------------------------------------------------------------------
/**
* On init
*/
ngOnInit(): void
{
// Load the contacts
this._chatPanelService.loadContacts().then(() => {
this.contacts = this._chatPanelService.contacts;
this.user = this._chatPanelService.user;
});
// Subscribe to the foldedChanged observable
this._fuseSidebarService.getSidebar('chatPanel').foldedChanged
.pipe(takeUntil(this._unsubscribeAll))
.subscribe((folded) => {
this.sidebarFolded = folded;
});
}
/**
* After view init
*/
ngAfterViewInit(): void
{
this._chatViewScrollbar = this._fusePerfectScrollbarDirectives.find((directive) => {
return directive.elementRef.nativeElement.id === 'messages';
});
}
/**
* On destroy
*/
ngOnDestroy(): void
{
// Unsubscribe from all subscriptions
this._unsubscribeAll.next();
this._unsubscribeAll.complete();
}
// -----------------------------------------------------------------------------------------------------
// @ Private methods
// -----------------------------------------------------------------------------------------------------
/**
* Prepare the chat for the replies
*/
private _prepareChatForReplies(): void
{
setTimeout(() => {
// Reset the reply form
this._replyForm.reset();
// Focus to the reply input
// this._replyInput.nativeElement.focus();
// Scroll to the bottom of the messages list
if ( this._chatViewScrollbar )
{
this._chatViewScrollbar.update();
setTimeout(() => {
this._chatViewScrollbar.scrollToBottom(0);
});
}
});
}
// -----------------------------------------------------------------------------------------------------
// @ Public methods
// -----------------------------------------------------------------------------------------------------
/**
* Fold the temporarily unfolded sidebar back
*/
foldSidebarTemporarily(): void
{
this._fuseSidebarService.getSidebar('chatPanel').foldTemporarily();
}
/**
* Unfold the sidebar temporarily
*/
unfoldSidebarTemporarily(): void
{
this._fuseSidebarService.getSidebar('chatPanel').unfoldTemporarily();
}
/**
* Toggle sidebar opened status
*/
toggleSidebarOpen(): void
{
this._fuseSidebarService.getSidebar('chatPanel').toggleOpen();
}
/**
* Decide whether to show or not the contact's avatar in the message row
*
* @param message
* @param i
* @returns {boolean}
*/
shouldShowContactAvatar(message, i): boolean
{
return (
message.who === this.selectedContact.id &&
((this.chat.dialog[i + 1] && this.chat.dialog[i + 1].who !== this.selectedContact.id) || !this.chat.dialog[i + 1])
);
}
/**
* Check if the given message is the first message of a group
*
* @param message
* @param i
* @returns {boolean}
*/
isFirstMessageOfGroup(message, i): boolean
{
return (i === 0 || this.chat.dialog[i - 1] && this.chat.dialog[i - 1].who !== message.who);
}
/**
* Check if the given message is the last message of a group
*
* @param message
* @param i
* @returns {boolean}
*/
isLastMessageOfGroup(message, i): boolean
{
return (i === this.chat.dialog.length - 1 || this.chat.dialog[i + 1] && this.chat.dialog[i + 1].who !== message.who);
}
/**
* Toggle chat with the contact
*
* @param contact
*/
toggleChat(contact): void
{
// If the contact equals to the selectedContact,
// that means we will deselect the contact and
// unload the chat
if ( this.selectedContact && contact.id === this.selectedContact.id )
{
// Reset
this.resetChat();
}
// Otherwise, we will select the contact, open
// the sidebar and start the chat
else
{
// Unfold the sidebar temporarily
this.unfoldSidebarTemporarily();
// Set the selected contact
this.selectedContact = contact;
// Load the chat
this._chatPanelService.getChat(contact.id).then((chat) => {
// Set the chat
this.chat = chat;
// Prepare the chat for the replies
this._prepareChatForReplies();
});
}
}
/**
* Remove the selected contact and unload the chat
*/
resetChat(): void
{
// Set the selected contact as null
this.selectedContact = null;
// Set the chat as null
this.chat = null;
}
/**
* Reply
*/
reply(event): void
{
event.preventDefault();
if ( !this._replyForm.form.value.message )
{
return;
}
// Message
const message = {
who : this.user.id,
message: this._replyForm.form.value.message,
time : new Date().toISOString()
};
// Add the message to the chat
this.chat.dialog.push(message);
// Update the server
this._chatPanelService.updateChat(this.chat.id, this.chat.dialog).then(response => {
// Prepare the chat for the replies
this._prepareChatForReplies();
});
}
}

View File

@@ -0,0 +1,33 @@
import { NgModule } from '@angular/core';
import { MatButtonModule, MatFormFieldModule, MatIconModule, MatInputModule, MatRippleModule, MatTabsModule, MatTooltipModule } from '@angular/material';
import { FuseSharedModule } from '@fuse/shared.module';
import { ChatPanelComponent } from 'app/layout/components/chat-panel/chat-panel.component';
import { ChatPanelService } from 'app/layout/components/chat-panel/chat-panel.service';
@NgModule({
declarations: [
ChatPanelComponent
],
providers : [
ChatPanelService
],
imports : [
MatButtonModule,
MatFormFieldModule,
MatIconModule,
MatInputModule,
MatTabsModule,
MatTooltipModule,
MatRippleModule,
FuseSharedModule
],
exports : [
ChatPanelComponent
]
})
export class ChatPanelModule
{
}

View File

@@ -0,0 +1,182 @@
import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { FuseUtils } from '@fuse/utils';
@Injectable()
export class ChatPanelService
{
contacts: any[];
chats: any[];
user: any;
/**
* Constructor
*
* @param {HttpClient} _httpClient
*/
constructor(
private _httpClient: HttpClient
)
{
}
/**
* Loader
*
* @returns {Promise<any> | any}
*/
loadContacts(): Promise<any> | any
{
return new Promise((resolve, reject) => {
Promise.all([
this.getContacts(),
this.getUser()
]).then(
([contacts, user]) => {
this.contacts = contacts;
this.user = user;
resolve();
},
reject
);
});
}
/**
* Get chat
*
* @param contactId
* @returns {Promise<any>}
*/
getChat(contactId): Promise<any>
{
const chatItem = this.user.chatList.find((item) => {
return item.contactId === contactId;
});
// Get the chat
return new Promise((resolve, reject) => {
// If there is a chat with this user, return that.
if ( chatItem )
{
this._httpClient.get('api/chat-panel-chats/' + chatItem.chatId)
.subscribe((chat) => {
// Resolve the promise
resolve(chat);
}, reject);
}
// If there is no chat with this user, create one...
else
{
this.createNewChat(contactId).then(() => {
// and then recall the getChat method
this.getChat(contactId).then((chat) => {
resolve(chat);
});
});
}
});
}
/**
* Create new chat
*
* @param contactId
* @returns {Promise<any>}
*/
createNewChat(contactId): Promise<any>
{
return new Promise((resolve, reject) => {
// Generate a new id
const chatId = FuseUtils.generateGUID();
// Prepare the chat object
const chat = {
id : chatId,
dialog: []
};
// Prepare the chat list entry
const chatListItem = {
chatId : chatId,
contactId : contactId,
lastMessageTime: '2017-02-18T10:30:18.931Z'
};
// Add new chat list item to the user's chat list
this.user.chatList.push(chatListItem);
// Post the created chat to the server
this._httpClient.post('api/chat-panel-chats', {...chat})
.subscribe(() => {
// Post the updated user data to the server
this._httpClient.post('api/chat-panel-user/' + this.user.id, this.user)
.subscribe(() => {
// Resolve the promise
resolve();
});
}, reject);
});
}
/**
* Update the chat
*
* @param chatId
* @param dialog
* @returns {Promise<any>}
*/
updateChat(chatId, dialog): Promise<any>
{
return new Promise((resolve, reject) => {
const newData = {
id : chatId,
dialog: dialog
};
this._httpClient.post('api/chat-panel-chats/' + chatId, newData)
.subscribe(updatedChat => {
resolve(updatedChat);
}, reject);
});
}
/**
* Get contacts
*
* @returns {Promise<any>}
*/
getContacts(): Promise<any>
{
return new Promise((resolve, reject) => {
this._httpClient.get('api/chat-panel-contacts')
.subscribe((response: any) => {
resolve(response);
}, reject);
});
}
/**
* Get user
*
* @returns {Promise<any>}
*/
getUser(): Promise<any>
{
return new Promise((resolve, reject) => {
this._httpClient.get('api/chat-panel-user')
.subscribe((response: any) => {
resolve(response[0]);
}, reject);
});
}
}

View File

@@ -2,7 +2,7 @@
<div fxLayout="row" fxLayoutAlign="center center" fxLayoutAlign.gt-xs="space-between center" fxFlex>
<a href="http://themeforest.net/item/fuse-angularjs-material-design-admin-template/12931855?ref=srcn"
<a href="https://1.envato.market/c/1257954/275988/4415?u=https%3A%2F%2Fthemeforest.net%2Fitem%2Ffuse-angularjs-material-design-admin-template%2F12931855"
target="_blank" mat-button class="mat-pink-bg" fxFlex="0 0 auto" fxLayout="row"
fxLayoutAlign="start center">
<mat-icon class="s-16 mr-sm-4">shopping_cart</mat-icon>
@@ -16,7 +16,6 @@
</div>
</div>
</mat-toolbar>

View File

@@ -0,0 +1 @@
<fuse-navigation layout="horizontal"></fuse-navigation>

View File

@@ -0,0 +1,16 @@
navbar-horizontal-style-1 {
}
navbar {
&.horizontal-style-1 {
display: flex;
flex-direction: column;
flex: 1 1 auto;
width: 100%;
height: 56px;
max-height: 56px;
min-height: 56px;
}
}

View File

@@ -0,0 +1,65 @@
import { Component, OnDestroy, OnInit, ViewEncapsulation } from '@angular/core';
import { Subject } from 'rxjs';
import { filter, takeUntil } from 'rxjs/operators';
import { FuseNavigationService } from '@fuse/components/navigation/navigation.service';
import { FuseSidebarService } from '@fuse/components/sidebar/sidebar.service';
@Component({
selector : 'navbar-horizontal-style-1',
templateUrl : './style-1.component.html',
styleUrls : ['./style-1.component.scss'],
encapsulation: ViewEncapsulation.None
})
export class NavbarHorizontalStyle1Component implements OnInit, OnDestroy
{
navigation: any;
// Private
private _unsubscribeAll: Subject<any>;
/**
* Constructor
*
* @param {FuseNavigationService} _fuseNavigationService
* @param {FuseSidebarService} _fuseSidebarService
*/
constructor(
private _fuseNavigationService: FuseNavigationService,
private _fuseSidebarService: FuseSidebarService
)
{
// Set the private defaults
this._unsubscribeAll = new Subject();
}
// -----------------------------------------------------------------------------------------------------
// @ Lifecycle hooks
// -----------------------------------------------------------------------------------------------------
/**
* On init
*/
ngOnInit(): void
{
// Get current navigation
this._fuseNavigationService.onNavigationChanged
.pipe(
filter(value => value !== null),
takeUntil(this._unsubscribeAll)
)
.subscribe(() => {
this.navigation = this._fuseNavigationService.getCurrentNavigation();
});
}
/**
* On destroy
*/
ngOnDestroy(): void
{
// Unsubscribe from all subscriptions
this._unsubscribeAll.next();
this._unsubscribeAll.complete();
}
}

View File

@@ -0,0 +1,26 @@
import { NgModule } from '@angular/core';
import { MatButtonModule, MatIconModule } from '@angular/material';
import { FuseNavigationModule } from '@fuse/components';
import { FuseSharedModule } from '@fuse/shared.module';
import { NavbarHorizontalStyle1Component } from 'app/layout/components/navbar/horizontal/style-1/style-1.component';
@NgModule({
declarations: [
NavbarHorizontalStyle1Component
],
imports : [
MatButtonModule,
MatIconModule,
FuseSharedModule,
FuseNavigationModule
],
exports : [
NavbarHorizontalStyle1Component
]
})
export class NavbarHorizontalStyle1Module
{
}

View File

@@ -1,39 +1,11 @@
<ng-container *ngIf="layout == 'vertical'">
<div class="navbar-vertical">
<div class="navbar-header">
<div class="logo">
<img class="logo-icon" src="assets/images/logos/fuse.svg">
<span class="logo-text">FUSE</span>
</div>
<button mat-icon-button class="toggle-sidebar-folded"
(click)="toggleSidebarFolded()" fxHide.lt-lg>
<mat-icon>menu</mat-icon>
</button>
<button mat-icon-button class="toggle-sidebar-opened"
(click)="toggleSidebarOpened()" fxHide.gt-md>
<mat-icon>arrow_back</mat-icon>
</button>
</div>
<div class="navbar-content" fusePerfectScrollbar
[fusePerfectScrollbarOptions]="{suppressScrollX: true}">
<fuse-navigation layout="vertical"></fuse-navigation>
</div>
</div>
<ng-container *ngIf="variant === 'horizontal-style-1'">
<navbar-horizontal-style-1></navbar-horizontal-style-1>
</ng-container>
<ng-container *ngIf="layout == 'horizontal'">
<ng-container *ngIf="variant === 'vertical-style-1'">
<navbar-vertical-style-1></navbar-vertical-style-1>
</ng-container>
<div class="navbar-horizontal">
<fuse-navigation layout="horizontal"></fuse-navigation>
</div>
</ng-container>
<ng-container *ngIf="variant === 'vertical-style-2'">
<navbar-vertical-style-2></navbar-vertical-style-2>
</ng-container>

View File

@@ -1,81 +1,3 @@
@import "src/@fuse/scss/fuse";
fuse-sidebar {
&.folded:not(.unfolded) {
.navbar-vertical {
.navbar-header {
padding: 0 13px;
.logo {
.logo-text {
opacity: 0;
transition: opacity 200ms ease;
}
}
}
}
}
}
navbar {
&:not(.top-navbar) {
height: 100%;
overflow: hidden;
}
.navbar-vertical {
display: flex;
flex-direction: column;
width: 100%;
height: 100%;
.navbar-header {
display: flex;
align-items: center;
justify-content: space-between;
height: 64px;
min-height: 64px;
padding: 0 16px 0 24px;
transition: padding 200ms ease;
background-color: rgba(255, 255, 255, .05);
@include mat-elevation(1);
.logo {
display: flex;
align-items: center;
.logo-icon {
width: 38px;
height: 38px;
}
.logo-text {
margin-left: 8px;
font-size: 20px;
font-weight: 300;
letter-spacing: 0.4px;
}
}
}
.navbar-content {
flex: 1 1 auto;
overflow-y: auto;
}
}
&.right-navbar {
.toggle-sidebar-opened {
mat-icon {
transform: rotate(180deg);
}
}
}
}

View File

@@ -1,11 +1,4 @@
import { Component, Input, OnDestroy, OnInit, ViewChild, ViewEncapsulation } from '@angular/core';
import { NavigationEnd, Router } from '@angular/router';
import { Subject } from 'rxjs';
import { filter, takeUntil } from 'rxjs/operators';
import { FuseNavigationService } from '@fuse/components/navigation/navigation.service';
import { FusePerfectScrollbarDirective } from '@fuse/directives/fuse-perfect-scrollbar/fuse-perfect-scrollbar.directive';
import { FuseSidebarService } from '@fuse/components/sidebar/sidebar.service';
import { Component, ElementRef, Input, Renderer2, ViewEncapsulation } from '@angular/core';
@Component({
selector : 'navbar',
@@ -13,125 +6,48 @@ import { FuseSidebarService } from '@fuse/components/sidebar/sidebar.service';
styleUrls : ['./navbar.component.scss'],
encapsulation: ViewEncapsulation.None
})
export class NavbarComponent implements OnInit, OnDestroy
export class NavbarComponent
{
// Layout
@Input()
layout;
fusePerfectScrollbarUpdateTimeout: any;
navigation: any;
// Private
private _fusePerfectScrollbar: FusePerfectScrollbarDirective;
private _unsubscribeAll: Subject<any>;
_variant: string;
/**
* Constructor
*
* @param {FuseNavigationService} _fuseNavigationService
* @param {FuseSidebarService} _fuseSidebarService
* @param {Router} _router
* @param {ElementRef} _elementRef
* @param {Renderer2} _renderer
*/
constructor(
private _fuseNavigationService: FuseNavigationService,
private _fuseSidebarService: FuseSidebarService,
private _router: Router
private _elementRef: ElementRef,
private _renderer: Renderer2
)
{
// Set the defaults
this.layout = 'vertical';
// Set the private defaults
this._unsubscribeAll = new Subject();
this._variant = 'vertical-style-1';
}
// -----------------------------------------------------------------------------------------------------
// @ Accessors
// -----------------------------------------------------------------------------------------------------
// Directive
@ViewChild(FusePerfectScrollbarDirective)
set directive(theDirective: FusePerfectScrollbarDirective)
/**
* Variant
*/
get variant(): string
{
if ( !theDirective )
{
return;
}
this._fusePerfectScrollbar = theDirective;
this._fuseNavigationService.onItemCollapseToggled
.pipe(takeUntil(this._unsubscribeAll))
.subscribe(() => {
this.fusePerfectScrollbarUpdateTimeout = setTimeout(() => {
this._fusePerfectScrollbar.update();
}, 310);
});
return this._variant;
}
// -----------------------------------------------------------------------------------------------------
// @ Lifecycle hooks
// -----------------------------------------------------------------------------------------------------
/**
* On init
*/
ngOnInit(): void
@Input()
set variant(value: string)
{
this._router.events
.pipe(
filter((event) => event instanceof NavigationEnd),
takeUntil(this._unsubscribeAll)
)
.subscribe(() => {
if ( this._fuseSidebarService.getSidebar('navbar') )
{
this._fuseSidebarService.getSidebar('navbar').close();
}
}
);
// Remove the old class name
this._renderer.removeClass(this._elementRef.nativeElement, this.variant);
// Get current navigation
this._fuseNavigationService.onNavigationChanged
.pipe(filter(value => value !== null))
.subscribe(() => {
this.navigation = this._fuseNavigationService.getCurrentNavigation();
});
}
// Store the variant value
this._variant = value;
/**
* On destroy
*/
ngOnDestroy(): void
{
if ( this.fusePerfectScrollbarUpdateTimeout )
{
clearTimeout(this.fusePerfectScrollbarUpdateTimeout);
}
// Unsubscribe from all subscriptions
this._unsubscribeAll.next();
this._unsubscribeAll.complete();
}
// -----------------------------------------------------------------------------------------------------
// @ Public methods
// -----------------------------------------------------------------------------------------------------
/**
* Toggle sidebar opened status
*/
toggleSidebarOpened(): void
{
this._fuseSidebarService.getSidebar('navbar').toggleOpen();
}
/**
* Toggle sidebar folded status
*/
toggleSidebarFolded(): void
{
this._fuseSidebarService.getSidebar('navbar').toggleFold();
// Add the new class name
this._renderer.addClass(this._elementRef.nativeElement, value);
}
}

View File

@@ -1,21 +1,22 @@
import { NgModule } from '@angular/core';
import { MatButtonModule, MatIconModule } from '@angular/material';
import { FuseNavigationModule } from '@fuse/components';
import { FuseSharedModule } from '@fuse/shared.module';
import { NavbarComponent } from 'app/layout/components/navbar/navbar.component';
import { NavbarHorizontalStyle1Module } from 'app/layout/components/navbar/horizontal/style-1/style-1.module';
import { NavbarVerticalStyle1Module } from 'app/layout/components/navbar/vertical/style-1/style-1.module';
import { NavbarVerticalStyle2Module } from 'app/layout/components/navbar/vertical/style-2/style-2.module';
@NgModule({
declarations: [
NavbarComponent
],
imports : [
MatButtonModule,
MatIconModule,
FuseSharedModule,
FuseNavigationModule
NavbarHorizontalStyle1Module,
NavbarVerticalStyle1Module,
NavbarVerticalStyle2Module
],
exports : [
NavbarComponent

View File

@@ -0,0 +1,41 @@
<div class="navbar-top mat-indigo-700-bg">
<div class="logo">
<img class="logo-icon" src="assets/images/logos/fuse.svg">
<span class="logo-text secondary-text">FUSE</span>
</div>
<div class="buttons">
<button mat-icon-button class="toggle-sidebar-folded"
(click)="toggleSidebarFolded()" fxHide.lt-lg>
<mat-icon class="secondary-text">menu</mat-icon>
</button>
<button mat-icon-button class="toggle-sidebar-opened"
(click)="toggleSidebarOpened()" fxHide.gt-md>
<mat-icon class="secondary-text">arrow_back</mat-icon>
</button>
</div>
</div>
<div class="navbar-scroll-container" fusePerfectScrollbar [fusePerfectScrollbarOptions]="{suppressScrollX: true}">
<div class="user mat-indigo-700-bg" fxLayout="column">
<div class="h3 username">Charlie Adams</div>
<div class="h5 email hint-text mt-8">adams.charlie@mail.com</div>
<div class="avatar-container" [ngClass]="fuseConfig.layout.navbar.background">
<img class="avatar" src="assets/images/avatars/Velazquez.jpg">
</div>
</div>
<div class="navbar-content">
<fuse-navigation layout="vertical"></fuse-navigation>
</div>
</div>

View File

@@ -0,0 +1,177 @@
@import "src/@fuse/scss/fuse";
fuse-sidebar {
&.navbar-fuse-sidebar {
overflow: hidden;
&.folded:not(.unfolded) {
navbar {
navbar-vertical-style-1 {
.navbar-top {
padding: 12px 0;
justify-content: center;
.buttons {
display: none;
}
.logo {
.logo-icon {
width: 32px;
height: 32px;
}
.logo-text {
display: none;
}
}
}
.navbar-scroll-container {
.user {
padding: 12px 0;
.avatar-container {
position: relative;
top: auto;
padding: 0;
transform: translateX(0);
left: auto;
.avatar {
width: 40px;
height: 40px;
}
}
.username,
.email {
display: none;
}
}
.navbar-content {
margin-top: 0;
}
}
}
}
}
}
}
navbar {
&.vertical-style-1 {
display: flex;
flex-direction: column;
flex: 1 1 auto;
width: 100%;
height: 100%;
&.right-navbar {
.toggle-sidebar-opened {
mat-icon {
transform: rotate(180deg);
}
}
}
}
navbar-vertical-style-1 {
display: flex;
flex-direction: column;
width: 100%;
height: 100%;
.navbar-top {
display: flex;
flex-direction: row;
flex: 1 0 auto;
align-items: center;
justify-content: space-between;
min-height: 64px;
max-height: 64px;
height: 64px;
padding: 12px 12px 12px 20px;
@include media-breakpoint('xs') {
min-height: 56px;
max-height: 56px;
height: 56px;
}
.logo {
display: flex;
align-items: center;
.logo-icon {
width: 24px;
height: 24px;
}
.logo-text {
margin-left: 12px;
font-size: 16px;
font-weight: 300;
letter-spacing: 0.4px;
line-height: normal;
}
}
.buttons {
display: flex;
align-items: center;
}
}
.navbar-scroll-container {
overflow-y: auto;
-webkit-overflow-scrolling: touch;
background: linear-gradient(rgba(0, 0, 0, 0) 30%, rgba(0, 0, 0, 0) 30%),
linear-gradient(rgba(0, 0, 0, 0.25) 0, rgba(0, 0, 0, 0) 40%);
background-repeat: no-repeat;
background-size: 100% 40px, 100% 10px;
background-attachment: local, scroll;
.user {
position: relative;
display: flex;
align-items: center;
justify-content: flex-start;
width: 100%;
padding: 24px 0 64px 0;
.avatar-container {
position: absolute;
top: 92px;
border-radius: 50%;
padding: 8px;
transform: translateX(-50%);
left: 50%;
.avatar {
width: 72px;
height: 72px;
margin: 0;
}
}
}
.navbar-content {
flex: 1 1 auto;
margin-top: 32px;
}
}
}
}

View File

@@ -0,0 +1,167 @@
import { Component, OnDestroy, OnInit, ViewChild, ViewEncapsulation } from '@angular/core';
import { NavigationEnd, Router } from '@angular/router';
import { Subject } from 'rxjs';
import { filter, take, takeUntil } from 'rxjs/operators';
import { FuseConfigService } from '@fuse/services/config.service';
import { FuseNavigationService } from '@fuse/components/navigation/navigation.service';
import { FusePerfectScrollbarDirective } from '@fuse/directives/fuse-perfect-scrollbar/fuse-perfect-scrollbar.directive';
import { FuseSidebarService } from '@fuse/components/sidebar/sidebar.service';
@Component({
selector : 'navbar-vertical-style-1',
templateUrl : './style-1.component.html',
styleUrls : ['./style-1.component.scss'],
encapsulation: ViewEncapsulation.None
})
export class NavbarVerticalStyle1Component implements OnInit, OnDestroy
{
fuseConfig: any;
fusePerfectScrollbarUpdateTimeout: any;
navigation: any;
// Private
private _fusePerfectScrollbar: FusePerfectScrollbarDirective;
private _unsubscribeAll: Subject<any>;
/**
* Constructor
*
* @param {FuseConfigService} _fuseConfigService
* @param {FuseNavigationService} _fuseNavigationService
* @param {FuseSidebarService} _fuseSidebarService
* @param {Router} _router
*/
constructor(
private _fuseConfigService: FuseConfigService,
private _fuseNavigationService: FuseNavigationService,
private _fuseSidebarService: FuseSidebarService,
private _router: Router
)
{
// Set the private defaults
this._unsubscribeAll = new Subject();
}
// -----------------------------------------------------------------------------------------------------
// @ Accessors
// -----------------------------------------------------------------------------------------------------
// Directive
@ViewChild(FusePerfectScrollbarDirective)
set directive(theDirective: FusePerfectScrollbarDirective)
{
if ( !theDirective )
{
return;
}
this._fusePerfectScrollbar = theDirective;
// Update the scrollbar on collapsable item toggle
this._fuseNavigationService.onItemCollapseToggled
.pipe(takeUntil(this._unsubscribeAll))
.subscribe(() => {
this.fusePerfectScrollbarUpdateTimeout = setTimeout(() => {
this._fusePerfectScrollbar.update();
}, 310);
});
// Scroll to the active item position
this._router.events
.pipe(
filter((event) => event instanceof NavigationEnd),
take(1)
)
.subscribe(() => {
setTimeout(() => {
const activeNavItem: any = document.querySelector('navbar .nav-link.active');
if ( activeNavItem )
{
const activeItemOffsetTop = activeNavItem.offsetTop,
activeItemOffsetParentTop = activeNavItem.offsetParent.offsetTop,
scrollDistance = activeItemOffsetTop - activeItemOffsetParentTop - (48 * 3) - 168;
this._fusePerfectScrollbar.scrollToTop(scrollDistance);
}
});
}
);
}
// -----------------------------------------------------------------------------------------------------
// @ Lifecycle hooks
// -----------------------------------------------------------------------------------------------------
/**
* On init
*/
ngOnInit(): void
{
this._router.events
.pipe(
filter((event) => event instanceof NavigationEnd),
takeUntil(this._unsubscribeAll)
)
.subscribe(() => {
if ( this._fuseSidebarService.getSidebar('navbar') )
{
this._fuseSidebarService.getSidebar('navbar').close();
}
}
);
// Subscribe to the config changes
this._fuseConfigService.config
.pipe(takeUntil(this._unsubscribeAll))
.subscribe((config) => {
this.fuseConfig = config;
});
// Get current navigation
this._fuseNavigationService.onNavigationChanged
.pipe(
filter(value => value !== null),
takeUntil(this._unsubscribeAll)
)
.subscribe(() => {
this.navigation = this._fuseNavigationService.getCurrentNavigation();
});
}
/**
* On destroy
*/
ngOnDestroy(): void
{
if ( this.fusePerfectScrollbarUpdateTimeout )
{
clearTimeout(this.fusePerfectScrollbarUpdateTimeout);
}
// Unsubscribe from all subscriptions
this._unsubscribeAll.next();
this._unsubscribeAll.complete();
}
// -----------------------------------------------------------------------------------------------------
// @ Public methods
// -----------------------------------------------------------------------------------------------------
/**
* Toggle sidebar opened status
*/
toggleSidebarOpened(): void
{
this._fuseSidebarService.getSidebar('navbar').toggleOpen();
}
/**
* Toggle sidebar folded status
*/
toggleSidebarFolded(): void
{
this._fuseSidebarService.getSidebar('navbar').toggleFold();
}
}

View File

@@ -0,0 +1,26 @@
import { NgModule } from '@angular/core';
import { MatButtonModule, MatIconModule } from '@angular/material';
import { FuseNavigationModule } from '@fuse/components';
import { FuseSharedModule } from '@fuse/shared.module';
import { NavbarVerticalStyle1Component } from 'app/layout/components/navbar/vertical/style-1/style-1.component';
@NgModule({
declarations: [
NavbarVerticalStyle1Component
],
imports : [
MatButtonModule,
MatIconModule,
FuseSharedModule,
FuseNavigationModule
],
exports : [
NavbarVerticalStyle1Component
]
})
export class NavbarVerticalStyle1Module
{
}

View File

@@ -0,0 +1,23 @@
<div class="navbar-header">
<div class="logo">
<img class="logo-icon" src="assets/images/logos/fuse.svg">
<span class="logo-text">FUSE</span>
</div>
<button mat-icon-button class="toggle-sidebar-folded"
(click)="toggleSidebarFolded()" fxHide.lt-lg>
<mat-icon>menu</mat-icon>
</button>
<button mat-icon-button class="toggle-sidebar-opened"
(click)="toggleSidebarOpened()" fxHide.gt-md>
<mat-icon>arrow_back</mat-icon>
</button>
</div>
<div class="navbar-content" fusePerfectScrollbar
[fusePerfectScrollbarOptions]="{suppressScrollX: true}">
<fuse-navigation layout="vertical"></fuse-navigation>
</div>

View File

@@ -0,0 +1,93 @@
@import "src/@fuse/scss/fuse";
fuse-sidebar {
&.navbar-fuse-sidebar {
overflow: hidden;
&.folded:not(.unfolded) {
navbar {
navbar-vertical-style-2 {
.navbar-header {
padding: 0 13px;
.logo {
.logo-text {
opacity: 0;
transition: opacity 200ms ease;
}
}
}
}
}
}
}
}
navbar {
&.vertical-style-2 {
display: flex;
flex-direction: column;
flex: 1 1 auto;
width: 100%;
height: 100%;
&.right-navbar {
.toggle-sidebar-opened {
mat-icon {
transform: rotate(180deg);
}
}
}
}
navbar-vertical-style-2 {
display: flex;
flex-direction: column;
width: 100%;
height: 100%;
.navbar-header {
display: flex;
align-items: center;
justify-content: space-between;
height: 64px;
min-height: 64px;
padding: 0 16px 0 24px;
transition: padding 200ms ease;
background-color: rgba(255, 255, 255, .05);
@include mat-elevation(1);
.logo {
display: flex;
align-items: center;
.logo-icon {
width: 38px;
height: 38px;
}
.logo-text {
margin-left: 8px;
font-size: 20px;
font-weight: 300;
letter-spacing: 0.4px;
}
}
}
.navbar-content {
flex: 1 1 auto;
overflow-y: auto;
-webkit-overflow-scrolling: touch;
}
}
}

View File

@@ -0,0 +1,156 @@
import { Component, OnDestroy, OnInit, ViewChild, ViewEncapsulation } from '@angular/core';
import { NavigationEnd, Router } from '@angular/router';
import { Subject } from 'rxjs';
import { filter, take, takeUntil } from 'rxjs/operators';
import { FuseNavigationService } from '@fuse/components/navigation/navigation.service';
import { FusePerfectScrollbarDirective } from '@fuse/directives/fuse-perfect-scrollbar/fuse-perfect-scrollbar.directive';
import { FuseSidebarService } from '@fuse/components/sidebar/sidebar.service';
@Component({
selector : 'navbar-vertical-style-2',
templateUrl : './style-2.component.html',
styleUrls : ['./style-2.component.scss'],
encapsulation: ViewEncapsulation.None
})
export class NavbarVerticalStyle2Component implements OnInit, OnDestroy
{
fusePerfectScrollbarUpdateTimeout: any;
navigation: any;
// Private
private _fusePerfectScrollbar: FusePerfectScrollbarDirective;
private _unsubscribeAll: Subject<any>;
/**
* Constructor
*
* @param {FuseNavigationService} _fuseNavigationService
* @param {FuseSidebarService} _fuseSidebarService
* @param {Router} _router
*/
constructor(
private _fuseNavigationService: FuseNavigationService,
private _fuseSidebarService: FuseSidebarService,
private _router: Router
)
{
// Set the private defaults
this._unsubscribeAll = new Subject();
}
// -----------------------------------------------------------------------------------------------------
// @ Accessors
// -----------------------------------------------------------------------------------------------------
// Directive
@ViewChild(FusePerfectScrollbarDirective)
set directive(theDirective: FusePerfectScrollbarDirective)
{
if ( !theDirective )
{
return;
}
this._fusePerfectScrollbar = theDirective;
// Update the scrollbar on collapsable item toggle
this._fuseNavigationService.onItemCollapseToggled
.pipe(takeUntil(this._unsubscribeAll))
.subscribe(() => {
this.fusePerfectScrollbarUpdateTimeout = setTimeout(() => {
this._fusePerfectScrollbar.update();
}, 310);
});
// Scroll to the active item position
this._router.events
.pipe(
filter((event) => event instanceof NavigationEnd),
take(1)
)
.subscribe(() => {
setTimeout(() => {
const activeNavItem: any = document.querySelector('navbar .nav-link.active');
if ( activeNavItem )
{
const activeItemOffsetTop = activeNavItem.offsetTop,
activeItemOffsetParentTop = activeNavItem.offsetParent.offsetTop,
scrollDistance = activeItemOffsetTop - activeItemOffsetParentTop - (48 * 3);
this._fusePerfectScrollbar.scrollToTop(scrollDistance);
}
});
}
);
}
// -----------------------------------------------------------------------------------------------------
// @ Lifecycle hooks
// -----------------------------------------------------------------------------------------------------
/**
* On init
*/
ngOnInit(): void
{
this._router.events
.pipe(
filter((event) => event instanceof NavigationEnd),
takeUntil(this._unsubscribeAll)
)
.subscribe(() => {
if ( this._fuseSidebarService.getSidebar('navbar') )
{
this._fuseSidebarService.getSidebar('navbar').close();
}
}
);
// Get current navigation
this._fuseNavigationService.onNavigationChanged
.pipe(
filter(value => value !== null),
takeUntil(this._unsubscribeAll)
)
.subscribe(() => {
this.navigation = this._fuseNavigationService.getCurrentNavigation();
});
}
/**
* On destroy
*/
ngOnDestroy(): void
{
if ( this.fusePerfectScrollbarUpdateTimeout )
{
clearTimeout(this.fusePerfectScrollbarUpdateTimeout);
}
// Unsubscribe from all subscriptions
this._unsubscribeAll.next();
this._unsubscribeAll.complete();
}
// -----------------------------------------------------------------------------------------------------
// @ Public methods
// -----------------------------------------------------------------------------------------------------
/**
* Toggle sidebar opened status
*/
toggleSidebarOpened(): void
{
this._fuseSidebarService.getSidebar('navbar').toggleOpen();
}
/**
* Toggle sidebar folded status
*/
toggleSidebarFolded(): void
{
this._fuseSidebarService.getSidebar('navbar').toggleFold();
}
}

View File

@@ -0,0 +1,26 @@
import { NgModule } from '@angular/core';
import { MatButtonModule, MatIconModule } from '@angular/material';
import { FuseNavigationModule } from '@fuse/components';
import { FuseSharedModule } from '@fuse/shared.module';
import { NavbarVerticalStyle2Component } from 'app/layout/components/navbar/vertical/style-2/style-2.component';
@NgModule({
declarations: [
NavbarVerticalStyle2Component
],
imports : [
MatButtonModule,
MatIconModule,
FuseSharedModule,
FuseNavigationModule
],
exports : [
NavbarVerticalStyle2Component
]
})
export class NavbarVerticalStyle2Module
{
}

View File

@@ -1,7 +1,5 @@
<mat-toolbar class="p-0 mat-elevation-z1">
<mat-progress-bar *ngIf="showLoadingBar" class="loading-bar" color="accent" mode="indeterminate"></mat-progress-bar>
<div fxFlex fxFill fxLayout="row" fxLayoutAlign="start center">
<div fxFlex="1 0 auto" fxLayout="row" fxLayoutAlign="start center">
@@ -30,8 +28,8 @@
<button mat-button [matMenuTriggerFor]="userMenu"
class="user-button">
<div fxLayout="row" fxLayoutAlign="center center">
<img class="avatar" src="assets/images/avatars/profile.jpg">
<span class="username mr-12" fxHide fxShow.gt-sm>John Doe</span>
<img class="avatar mr-0 mr-sm-16" src="assets/images/avatars/Velazquez.jpg">
<span class="username mr-12" fxHide fxShow.gt-sm>Charlie Adams</span>
<mat-icon class="s-16" fxHide.xs>keyboard_arrow_down</mat-icon>
</div>
</button>
@@ -72,7 +70,7 @@
<mat-menu #languageMenu="matMenu" [overlapTrigger]="false">
<button mat-menu-item *ngFor="let lang of languages" (click)="setLanguage(lang.id)">
<button mat-menu-item *ngFor="let lang of languages" (click)="setLanguage(lang)">
<span fxLayout="row" fxLayoutAlign="start center">
<img class="flag mr-16" [src]="'assets/images/flags/'+lang.flag+'.png'">
<span class="iso">{{lang.title}}</span>
@@ -89,6 +87,15 @@
<div class="toolbar-separator" fxHide fxShow.gt-xs></div>
<button mat-icon-button fxHide.gt-md
class="chat-panel-toggle-button"
(click)="toggleSidebarOpen('chatPanel')"
aria-label="Toggle chat panel">
<mat-icon class="icon">chat</mat-icon>
</button>
<div class="toolbar-separator" fxHide.gt-md></div>
<button mat-icon-button
class="quick-panel-toggle-button"
(click)="toggleSidebarOpen('quickPanel')"

View File

@@ -11,17 +11,9 @@
}
.mat-toolbar {
position: relative;
background: inherit;
color: inherit;
position: relative;
.loading-bar {
position: absolute;
top: 0;
left: 0;
right: 0;
width: 100%;
}
}
.logo {
@@ -36,6 +28,7 @@
.user-button,
fuse-search-bar,
.language-button,
.chat-panel-toggle-button,
.quick-panel-toggle-button {
min-width: 64px;
height: 64px;

View File

@@ -1,7 +1,6 @@
import { Component, OnDestroy, OnInit } from '@angular/core';
import { NavigationEnd, NavigationStart, Router } from '@angular/router';
import { Subject } from 'rxjs';
import { filter, takeUntil } from 'rxjs/operators';
import { takeUntil } from 'rxjs/operators';
import { TranslateService } from '@ngx-translate/core';
import * as _ from 'lodash';
@@ -24,7 +23,6 @@ export class ToolbarComponent implements OnInit, OnDestroy
languages: any;
navigation: any;
selectedLanguage: any;
showLoadingBar: boolean;
userStatusOptions: any[];
// Private
@@ -35,13 +33,11 @@ export class ToolbarComponent implements OnInit, OnDestroy
*
* @param {FuseConfigService} _fuseConfigService
* @param {FuseSidebarService} _fuseSidebarService
* @param {Router} _router
* @param {TranslateService} _translateService
*/
constructor(
private _fuseConfigService: FuseConfigService,
private _fuseSidebarService: FuseSidebarService,
private _router: Router,
private _translateService: TranslateService
)
{
@@ -102,24 +98,6 @@ export class ToolbarComponent implements OnInit, OnDestroy
*/
ngOnInit(): void
{
// Subscribe to the router events to show/hide the loading bar
this._router.events
.pipe(
filter((event) => event instanceof NavigationStart),
takeUntil(this._unsubscribeAll)
)
.subscribe((event) => {
this.showLoadingBar = true;
});
this._router.events
.pipe(
filter((event) => event instanceof NavigationEnd)
)
.subscribe((event) => {
this.showLoadingBar = false;
});
// Subscribe to the config changes
this._fuseConfigService.config
.pipe(takeUntil(this._unsubscribeAll))
@@ -171,14 +149,14 @@ export class ToolbarComponent implements OnInit, OnDestroy
/**
* Set the language
*
* @param langId
* @param lang
*/
setLanguage(langId): void
setLanguage(lang): void
{
// Set the selected language for toolbar
this.selectedLanguage = _.find(this.languages, {'id': langId});
// Set the selected language for the toolbar
this.selectedLanguage = lang;
// Use the selected language for translations
this._translateService.use(langId);
this._translateService.use(lang.id);
}
}

View File

@@ -1,6 +1,6 @@
import { NgModule } from '@angular/core';
import { RouterModule } from '@angular/router';
import { MatButtonModule, MatIconModule, MatMenuModule, MatProgressBarModule, MatToolbarModule } from '@angular/material';
import { MatButtonModule, MatIconModule, MatMenuModule, MatToolbarModule } from '@angular/material';
import { FuseSearchBarModule, FuseShortcutsModule } from '@fuse/components';
import { FuseSharedModule } from '@fuse/shared.module';
@@ -16,7 +16,6 @@ import { ToolbarComponent } from 'app/layout/components/toolbar/toolbar.componen
MatButtonModule,
MatIconModule,
MatMenuModule,
MatProgressBarModule,
MatToolbarModule,
FuseSharedModule,

View File

@@ -1,4 +1,18 @@
<div id="main" [ngClass]="{'boxed':fuseConfig.layout.width === 'boxed'}">
<!-- SIDE PANEL -->
<ng-container *ngIf="!fuseConfig.layout.sidepanel.hidden && fuseConfig.layout.sidepanel.position === 'left'">
<!-- CHAT PANEL -->
<fuse-sidebar name="chatPanel" position="left" class="chat-panel left-chat-panel"
[folded]="true" [foldedWidth]="70" [foldedAutoTriggerOnHover]="false"
lockedOpen="gt-md">
<chat-panel></chat-panel>
</fuse-sidebar>
<!-- / CHAT PANEL -->
</ng-container>
<!-- / SIDE PANEL -->
<div id="main">
<!-- TOOLBAR: Above -->
<ng-container *ngIf="fuseConfig.layout.toolbar.position === 'above'">
@@ -55,6 +69,20 @@
</div>
<!-- SIDE PANEL -->
<ng-container *ngIf="!fuseConfig.layout.sidepanel.hidden && fuseConfig.layout.sidepanel.position === 'right'">
<!-- CHAT PANEL -->
<fuse-sidebar name="chatPanel" position="right" class="chat-panel right-chat-panel"
[folded]="true" [foldedWidth]="70" [foldedAutoTriggerOnHover]="false"
lockedOpen="gt-md">
<chat-panel></chat-panel>
</fuse-sidebar>
<!-- / CHAT PANEL -->
</ng-container>
<!-- / SIDE PANEL -->
<!-- QUICK PANEL -->
<fuse-sidebar name="quickPanel" position="right" class="quick-panel">
<quick-panel></quick-panel>
@@ -81,7 +109,7 @@
<!-- TOP NAVBAR -->
<ng-template #topNavbar>
<navbar layout="horizontal"
<navbar variant="horizontal-style-1"
class="top-navbar" [ngClass]="fuseConfig.layout.navbar.background"
fxHide fxShow.gt-md
*ngIf="!fuseConfig.layout.navbar.hidden">
@@ -91,10 +119,11 @@
<!-- LEFT NAVBAR -->
<ng-template #leftNavbar>
<fuse-sidebar name="navbar"
<fuse-sidebar name="navbar" class="navbar-fuse-sidebar"
[folded]="fuseConfig.layout.navbar.folded"
*ngIf="!fuseConfig.layout.navbar.hidden">
<navbar class="left-navbar" [ngClass]="fuseConfig.layout.navbar.background" layout="vertical"></navbar>
<navbar [variant]="fuseConfig.layout.navbar.variant"
class="left-navbar" [ngClass]="fuseConfig.layout.navbar.background"></navbar>
</fuse-sidebar>
</ng-template>
<!-- / LEFT NAVBAR -->

View File

@@ -14,13 +14,7 @@ horizontal-layout-1 {
width: 100%;
height: 100%;
z-index: 1;
// Boxed
&.boxed {
max-width: 1200px;
margin: 0 auto;
@include mat-elevation(8);
}
min-width: 0;
// Container 1
> .container {
@@ -48,6 +42,7 @@ horizontal-layout-1 {
transform: translateZ(0);
overflow-x: hidden;
overflow-y: auto;
-webkit-overflow-scrolling: touch;
// Content component
content {

View File

@@ -4,6 +4,7 @@ import { MatSidenavModule } from '@angular/material';
import { FuseSidebarModule, FuseThemeOptionsModule } from '@fuse/components';
import { FuseSharedModule } from '@fuse/shared.module';
import { ChatPanelModule } from 'app/layout/components/chat-panel/chat-panel.module';
import { ContentModule } from 'app/layout/components/content/content.module';
import { FooterModule } from 'app/layout/components/footer/footer.module';
import { NavbarModule } from 'app/layout/components/navbar/navbar.module';
@@ -23,6 +24,7 @@ import { HorizontalLayout1Component } from 'app/layout/horizontal/layout-1/layou
FuseSidebarModule,
FuseThemeOptionsModule,
ChatPanelModule,
ContentModule,
FooterModule,
NavbarModule,

View File

@@ -1,4 +1,18 @@
<div id="main" [ngClass]="{'boxed':fuseConfig.layout.width === 'boxed'}">
<!-- SIDE PANEL -->
<ng-container *ngIf="!fuseConfig.layout.sidepanel.hidden && fuseConfig.layout.sidepanel.position === 'left'">
<!-- CHAT PANEL -->
<fuse-sidebar name="chatPanel" position="left" class="chat-panel left-chat-panel"
[folded]="true" [foldedWidth]="70" [foldedAutoTriggerOnHover]="false"
lockedOpen="gt-md">
<chat-panel></chat-panel>
</fuse-sidebar>
<!-- / CHAT PANEL -->
</ng-container>
<!-- / SIDE PANEL -->
<div id="main">
<!-- TOOLBAR: Above -->
<ng-container *ngIf="fuseConfig.layout.toolbar.position === 'above'">
@@ -67,6 +81,20 @@
</div>
<!-- SIDE PANEL -->
<ng-container *ngIf="!fuseConfig.layout.sidepanel.hidden && fuseConfig.layout.sidepanel.position === 'right'">
<!-- CHAT PANEL -->
<fuse-sidebar name="chatPanel" position="right" class="chat-panel right-chat-panel"
[folded]="true" [foldedWidth]="70" [foldedAutoTriggerOnHover]="false"
lockedOpen="gt-md">
<chat-panel></chat-panel>
</fuse-sidebar>
<!-- / CHAT PANEL -->
</ng-container>
<!-- / SIDE PANEL -->
<!-- QUICK PANEL -->
<fuse-sidebar name="quickPanel" position="right" class="quick-panel">
<quick-panel></quick-panel>
@@ -93,22 +121,24 @@
<!-- LEFT NAVBAR -->
<ng-template #leftNavbar>
<fuse-sidebar name="navbar"
<fuse-sidebar name="navbar" class="navbar-fuse-sidebar"
[folded]="fuseConfig.layout.navbar.folded"
lockedOpen="gt-md"
*ngIf="!fuseConfig.layout.navbar.hidden">
<navbar class="left-navbar" [ngClass]="fuseConfig.layout.navbar.background" layout="vertical"></navbar>
<navbar [variant]="fuseConfig.layout.navbar.variant"
class="left-navbar" [ngClass]="fuseConfig.layout.navbar.background"></navbar>
</fuse-sidebar>
</ng-template>
<!-- / LEFT NAVBAR -->
<!-- RIGHT NAVBAR -->
<ng-template #rightNavbar>
<fuse-sidebar name="navbar" position="right"
<fuse-sidebar name="navbar" position="right" class="navbar-fuse-sidebar"
[folded]="fuseConfig.layout.navbar.folded"
lockedOpen="gt-md"
*ngIf="!fuseConfig.layout.navbar.hidden">
<navbar class="right-navbar" [ngClass]="fuseConfig.layout.navbar.background" layout="vertical"></navbar>
<navbar [variant]="fuseConfig.layout.navbar.variant"
class="right-navbar" [ngClass]="fuseConfig.layout.navbar.background"></navbar>
</fuse-sidebar>
</ng-template>
<!-- / RIGHT NAVBAR -->

View File

@@ -14,13 +14,7 @@ vertical-layout-1 {
width: 100%;
height: 100%;
z-index: 1;
// Boxed
&.boxed {
max-width: 1200px;
margin: 0 auto;
@include mat-elevation(8);
}
min-width: 0;
// Container 1
> .container {
@@ -48,6 +42,7 @@ vertical-layout-1 {
transform: translateZ(0);
overflow-x: hidden;
overflow-y: auto;
-webkit-overflow-scrolling: touch;
// Content component
content {

View File

@@ -4,6 +4,7 @@ import { RouterModule } from '@angular/router';
import { FuseSidebarModule } from '@fuse/components';
import { FuseSharedModule } from '@fuse/shared.module';
import { ChatPanelModule } from 'app/layout/components/chat-panel/chat-panel.module';
import { ContentModule } from 'app/layout/components/content/content.module';
import { FooterModule } from 'app/layout/components/footer/footer.module';
import { NavbarModule } from 'app/layout/components/navbar/navbar.module';
@@ -22,6 +23,7 @@ import { VerticalLayout1Component } from 'app/layout/vertical/layout-1/layout-1.
FuseSharedModule,
FuseSidebarModule,
ChatPanelModule,
ContentModule,
FooterModule,
NavbarModule,

View File

@@ -1,4 +1,18 @@
<div id="main" [ngClass]="{'boxed':fuseConfig.layout.width === 'boxed'}">
<!-- SIDE PANEL -->
<ng-container *ngIf="!fuseConfig.layout.sidepanel.hidden && fuseConfig.layout.sidepanel.position === 'left'">
<!-- CHAT PANEL -->
<fuse-sidebar name="chatPanel" position="left" class="chat-panel left-chat-panel"
[folded]="true" [foldedWidth]="70" [foldedAutoTriggerOnHover]="false"
lockedOpen="gt-md">
<chat-panel></chat-panel>
</fuse-sidebar>
<!-- / CHAT PANEL -->
</ng-container>
<!-- / SIDE PANEL -->
<div id="main">
<!-- TOOLBAR: Above fixed -->
<ng-container *ngIf="fuseConfig.layout.toolbar.position === 'above-fixed'">
@@ -67,6 +81,20 @@
</div>
<!-- SIDE PANEL -->
<ng-container *ngIf="!fuseConfig.layout.sidepanel.hidden && fuseConfig.layout.sidepanel.position === 'right'">
<!-- CHAT PANEL -->
<fuse-sidebar name="chatPanel" position="right" class="chat-panel right-chat-panel"
[folded]="true" [foldedWidth]="70" [foldedAutoTriggerOnHover]="false"
lockedOpen="gt-md">
<chat-panel></chat-panel>
</fuse-sidebar>
<!-- / CHAT PANEL -->
</ng-container>
<!-- / SIDE PANEL -->
<!-- QUICK PANEL -->
<fuse-sidebar name="quickPanel" position="right" class="quick-panel">
<quick-panel></quick-panel>
@@ -93,22 +121,24 @@
<!-- LEFT NAVBAR -->
<ng-template #leftNavbar>
<fuse-sidebar name="navbar"
<fuse-sidebar name="navbar" class="navbar-fuse-sidebar"
[folded]="fuseConfig.layout.navbar.folded"
lockedOpen="gt-md"
*ngIf="!fuseConfig.layout.navbar.hidden">
<navbar class="left-navbar" [ngClass]="fuseConfig.layout.navbar.background" layout="vertical"></navbar>
<navbar [variant]="fuseConfig.layout.navbar.variant"
class="left-navbar" [ngClass]="fuseConfig.layout.navbar.background"></navbar>
</fuse-sidebar>
</ng-template>
<!-- / LEFT NAVBAR -->
<!-- RIGHT NAVBAR -->
<ng-template #rightNavbar>
<fuse-sidebar name="navbar" position="right"
<fuse-sidebar name="navbar" position="right" class="navbar-fuse-sidebar"
[folded]="fuseConfig.layout.navbar.folded"
lockedOpen="gt-md"
*ngIf="!fuseConfig.layout.navbar.hidden">
<navbar class="right-navbar" [ngClass]="fuseConfig.layout.navbar.background" layout="vertical"></navbar>
<navbar [variant]="fuseConfig.layout.navbar.variant"
class="right-navbar" [ngClass]="fuseConfig.layout.navbar.background"></navbar>
</fuse-sidebar>
</ng-template>
<!-- / RIGHT NAVBAR -->

View File

@@ -14,13 +14,7 @@ vertical-layout-2 {
width: 100%;
height: 100%;
z-index: 1;
// Boxed
&.boxed {
max-width: 1200px;
margin: 0 auto;
@include mat-elevation(8);
}
min-width: 0;
// Container 1 (Scrollable)
> .container {
@@ -31,6 +25,7 @@ vertical-layout-2 {
width: 100%;
overflow-x: hidden;
overflow-y: auto;
-webkit-overflow-scrolling: touch;
transform: translateZ(0);
// Container 2

View File

@@ -4,6 +4,7 @@ import { RouterModule } from '@angular/router';
import { FuseSidebarModule } from '@fuse/components';
import { FuseSharedModule } from '@fuse/shared.module';
import { ChatPanelModule } from 'app/layout/components/chat-panel/chat-panel.module';
import { ContentModule } from 'app/layout/components/content/content.module';
import { FooterModule } from 'app/layout/components/footer/footer.module';
import { NavbarModule } from 'app/layout/components/navbar/navbar.module';
@@ -22,6 +23,7 @@ import { VerticalLayout2Component } from 'app/layout/vertical/layout-2/layout-2.
FuseSharedModule,
FuseSidebarModule,
ChatPanelModule,
ContentModule,
FooterModule,
NavbarModule,

View File

@@ -1,4 +1,18 @@
<div id="main" [ngClass]="{'boxed':fuseConfig.layout.width === 'boxed'}">
<!-- SIDE PANEL -->
<ng-container *ngIf="!fuseConfig.layout.sidepanel.hidden && fuseConfig.layout.sidepanel.position === 'left'">
<!-- CHAT PANEL -->
<fuse-sidebar name="chatPanel" position="left" class="chat-panel left-chat-panel"
[folded]="true" [foldedWidth]="70" [foldedAutoTriggerOnHover]="false"
lockedOpen="gt-md">
<chat-panel></chat-panel>
</fuse-sidebar>
<!-- / CHAT PANEL -->
</ng-container>
<!-- / SIDE PANEL -->
<div id="main">
<!-- TOOLBAR: Above fixed -->
<ng-container *ngIf="fuseConfig.layout.toolbar.position === 'above-fixed'">
@@ -53,6 +67,20 @@
</div>
<!-- SIDE PANEL -->
<ng-container *ngIf="!fuseConfig.layout.sidepanel.hidden && fuseConfig.layout.sidepanel.position === 'right'">
<!-- CHAT PANEL -->
<fuse-sidebar name="chatPanel" position="right" class="chat-panel right-chat-panel"
[folded]="true" [foldedWidth]="70" [foldedAutoTriggerOnHover]="false"
lockedOpen="gt-md">
<chat-panel></chat-panel>
</fuse-sidebar>
<!-- / CHAT PANEL -->
</ng-container>
<!-- / SIDE PANEL -->
<!-- QUICK PANEL -->
<fuse-sidebar name="quickPanel" position="right" class="quick-panel">
<quick-panel></quick-panel>
@@ -79,22 +107,24 @@
<!-- LEFT NAVBAR -->
<ng-template #leftNavbar>
<fuse-sidebar name="navbar"
<fuse-sidebar name="navbar" class="navbar-fuse-sidebar"
[folded]="fuseConfig.layout.navbar.folded"
lockedOpen="gt-md"
*ngIf="!fuseConfig.layout.navbar.hidden">
<navbar class="left-navbar" [ngClass]="fuseConfig.layout.navbar.background" layout="vertical"></navbar>
<navbar [variant]="fuseConfig.layout.navbar.variant"
class="left-navbar" [ngClass]="fuseConfig.layout.navbar.background"></navbar>
</fuse-sidebar>
</ng-template>
<!-- / LEFT NAVBAR -->
<!-- RIGHT NAVBAR -->
<ng-template #rightNavbar>
<fuse-sidebar name="navbar" position="right"
<fuse-sidebar name="navbar" position="right" class="navbar-fuse-sidebar"
[folded]="fuseConfig.layout.navbar.folded"
lockedOpen="gt-md"
*ngIf="!fuseConfig.layout.navbar.hidden">
<navbar class="right-navbar" [ngClass]="fuseConfig.layout.navbar.background" layout="vertical"></navbar>
<navbar [variant]="fuseConfig.layout.navbar.variant"
class="right-navbar" [ngClass]="fuseConfig.layout.navbar.background"></navbar>
</fuse-sidebar>
</ng-template>
<!-- / RIGHT NAVBAR -->

View File

@@ -1,4 +1,4 @@
@import "../../../../@fuse/scss/fuse";
@import "src/@fuse/scss/fuse";
vertical-layout-3 {
display: flex;
@@ -14,13 +14,7 @@ vertical-layout-3 {
width: 100%;
height: 100%;
z-index: 1;
// Boxed
&.boxed {
max-width: 1200px;
margin: 0 auto;
@include mat-elevation(8);
}
min-width: 0;
// Container 1 (Scrollable)
> .container {
@@ -31,6 +25,7 @@ vertical-layout-3 {
width: 100%;
overflow-x: hidden;
overflow-y: auto;
-webkit-overflow-scrolling: touch;
transform: translateZ(0);
// Container 2

View File

@@ -4,6 +4,7 @@ import { RouterModule } from '@angular/router';
import { FuseSidebarModule } from '@fuse/components/index';
import { FuseSharedModule } from '@fuse/shared.module';
import { ChatPanelModule } from 'app/layout/components/chat-panel/chat-panel.module';
import { ContentModule } from 'app/layout/components/content/content.module';
import { FooterModule } from 'app/layout/components/footer/footer.module';
import { NavbarModule } from 'app/layout/components/navbar/navbar.module';
@@ -22,6 +23,7 @@ import { VerticalLayout3Component } from 'app/layout/vertical/layout-3/layout-3.
FuseSharedModule,
FuseSidebarModule,
ChatPanelModule,
ContentModule,
FooterModule,
NavbarModule,

View File

@@ -95,8 +95,6 @@ import { TableHttpExample } from 'assets/angular-material-examples/table-http/ta
import { TableOverviewExample } from 'assets/angular-material-examples/table-overview/table-overview-example';
import { TablePaginationExample } from 'assets/angular-material-examples/table-pagination/table-pagination-example';
import { TableSortingExample } from 'assets/angular-material-examples/table-sorting/table-sorting-example';
import { TabsOverviewExample } from 'assets/angular-material-examples/tabs-overview/tabs-overview-example';
import { TabsTemplateLabelExample } from 'assets/angular-material-examples/tabs-template-label/tabs-template-label-example';
import { ToolbarMultirowExample } from 'assets/angular-material-examples/toolbar-multirow/toolbar-multirow-example';
import { ToolbarOverviewExample } from 'assets/angular-material-examples/toolbar-overview/toolbar-overview-example';
import { TooltipOverviewExample } from 'assets/angular-material-examples/tooltip-overview/tooltip-overview-example';
@@ -137,7 +135,6 @@ import { SliderFormattingExample } from 'assets/angular-material-examples/slider
import { StepperEditableExample } from 'assets/angular-material-examples/stepper-editable/stepper-editable-example';
import { StepperOptionalExample } from 'assets/angular-material-examples/stepper-optional/stepper-optional-example';
import { TableFooterRowExample } from 'assets/angular-material-examples/table-footer-row/table-footer-row-example';
import { TableNativeOnlyExample } from 'assets/angular-material-examples/table-native-only/table-native-only-example';
import { TextFieldAutofillDirectiveExample } from 'assets/angular-material-examples/text-field-autofill-directive/text-field-autofill-directive-example';
import { TextFieldAutofillMonitorExample } from 'assets/angular-material-examples/text-field-autofill-monitor/text-field-autofill-monitor-example';
import { TextFieldAutosizeTextareaExample } from 'assets/angular-material-examples/text-field-autosize-textarea/text-field-autosize-textarea-example';
@@ -146,6 +143,32 @@ import { TreeDynamicExample } from 'assets/angular-material-examples/tree-dynami
import { TreeFlatOverviewExample } from 'assets/angular-material-examples/tree-flat-overview/tree-flat-overview-example';
import { TreeLoadmoreExample } from 'assets/angular-material-examples/tree-loadmore/tree-loadmore-example';
import { TreeNestedOverviewExample } from 'assets/angular-material-examples/tree-nested-overview/tree-nested-overview-example';
import { CdkTableBasicFlexExample } from 'assets/angular-material-examples/cdk-table-basic-flex/cdk-table-basic-flex-example';
import { StepperVerticalExample } from 'assets/angular-material-examples/stepper-vertical/stepper-vertical-example';
import { TabGroupBasicExample } from 'assets/angular-material-examples/tab-group-basic/tab-group-basic-example';
import { TabGroupAsyncExample } from 'assets/angular-material-examples/tab-group-async/tab-group-async-example';
import { TabGroupCustomLabelExample } from 'assets/angular-material-examples/tab-group-custom-label/tab-group-custom-label-example';
import { TabGroupDynamicExample } from 'assets/angular-material-examples/tab-group-dynamic/tab-group-dynamic-example';
import { TabGroupDynamicHeightExample } from 'assets/angular-material-examples/tab-group-dynamic-height/tab-group-dynamic-height-example';
import { TabGroupHeaderBelowExample } from 'assets/angular-material-examples/tab-group-header-below/tab-group-header-below-example';
import { TabGroupLazyLoadedExample } from 'assets/angular-material-examples/tab-group-lazy-loaded/tab-group-lazy-loaded-example';
import { TabGroupStretchedExample } from 'assets/angular-material-examples/tab-group-stretched/tab-group-stretched-example';
import { TabGroupThemeExample } from 'assets/angular-material-examples/tab-group-theme/tab-group-theme-example';
import { TabNavBarBasicExample } from 'assets/angular-material-examples/tab-nav-bar-basic/tab-nav-bar-basic-example';
import { TooltipAutoHideExample } from 'assets/angular-material-examples/tooltip-auto-hide/tooltip-auto-hide-example';
import { TooltipCustomClassExample } from 'assets/angular-material-examples/tooltip-custom-class/tooltip-custom-class-example';
import { TooltipDisabledExample } from 'assets/angular-material-examples/tooltip-disabled/tooltip-disabled-example';
import { TooltipMessageExample } from 'assets/angular-material-examples/tooltip-message/tooltip-message-example';
import { TableBasicFlexExample } from 'assets/angular-material-examples/table-basic-flex/table-basic-flex-example';
import { TableDynamicColumnsExample } from 'assets/angular-material-examples/table-dynamic-columns/table-dynamic-columns-example';
import { TableExpandableRowsExample } from 'assets/angular-material-examples/table-expandable-rows/table-expandable-rows-example';
import { TableMultipleHeaderFooterExample } from 'assets/angular-material-examples/table-multiple-header-footer/table-multiple-header-footer-example';
import { TableRowContextExample } from 'assets/angular-material-examples/table-row-context/table-row-context-example';
import { TableStickyColumnsExample } from 'assets/angular-material-examples/table-sticky-columns/table-sticky-columns-example';
import { TableStickyComplexExample } from 'assets/angular-material-examples/table-sticky-complex/table-sticky-complex-example';
import { TableStickyComplexFlexExample } from 'assets/angular-material-examples/table-sticky-complex-flex/table-sticky-complex-flex-example';
import { TableStickyFooterExample } from 'assets/angular-material-examples/table-sticky-footer/table-sticky-footer-example';
import { TableStickyHeaderExample } from 'assets/angular-material-examples/table-sticky-header/table-sticky-header-example';
export const COMPONENT_MAP = {
'autocomplete' : [
@@ -176,6 +199,7 @@ export const COMPONENT_MAP = {
],
// 'cdk-table' : [
// 'cdk-table-basic',
// 'cdk-table-basic-flex',
// 'cdk-table-flat'
// ],
// 'cdk-tree' : [
@@ -333,22 +357,40 @@ export const COMPONENT_MAP = {
'stepper' : [
'stepper-overview',
'stepper-editable',
'stepper-optional'
'stepper-optional',
'stepper-vertical'
],
'table' : [
'table-overview',
'table-basic',
'table-basic-flex',
'table-dynamic-columns',
'table-expandable-rows',
'table-filtering',
'table-footer-row',
'table-http',
'table-native-only',
'table-multiple-header-footer',
'table-pagination',
'table-row-context',
'table-selection',
'table-sorting'
'table-sorting',
'table-sticky-columns',
'table-sticky-complex',
'table-sticky-complex-flex',
'table-sticky-header',
'table-sticky-footer',
],
'tabs' : [
'tabs-overview',
'tabs-template-label'
'tab-group-basic',
'tab-group-async',
'tab-group-custom-label',
'tab-group-dynamic',
'tab-group-dynamic-height',
'tab-group-header-below',
'tab-group-lazy-loaded',
'tab-group-stretched',
'tab-group-theme',
'tab-nav-bar-basic'
],
'text-field' : [
'text-field-autofill-directive',
@@ -361,8 +403,12 @@ export const COMPONENT_MAP = {
],
'tooltip' : [
'tooltip-overview',
'tooltip-auto-hide',
'tooltip-custom-class',
'tooltip-delay',
'tooltip-disabled',
'tooltip-manual',
'tooltip-message',
'tooltip-modified-defaults',
'tooltip-position'
],
@@ -438,6 +484,10 @@ export const EXAMPLE_COMPONENTS = {
title : 'Basic CDK data-table',
component: CdkTableBasicExample
},
'cdk-table-basic-flex' : {
title : 'Basic use of `<cdk-table>` (uses display flex)',
component: CdkTableBasicFlexExample
},
'cdk-tree-flat' : {
title : 'Tree with flat nodes',
component: CdkTreeFlatExample
@@ -879,10 +929,26 @@ export const EXAMPLE_COMPONENTS = {
title : 'Stepper overview',
component: StepperOverviewExample
},
'stepper-vertical' : {
title : 'Stepper vertical',
component: StepperVerticalExample
},
'table-basic' : {
title : 'Basic table',
component: TableBasicExample
},
'table-basic-flex' : {
title : 'Basic use of `<mat-table>` (uses display flex)',
component: TableBasicFlexExample
},
'table-dynamic-columns' : {
title : 'Table dynamically changing the columns displayed',
component: TableDynamicColumnsExample
},
'table-expandable-rows' : {
title : 'Table with expandable rows',
component: TableExpandableRowsExample
},
'table-filtering' : {
title : 'Table with filtering',
component: TableFilteringExample
@@ -895,9 +961,9 @@ export const EXAMPLE_COMPONENTS = {
title : 'Table retrieving data through HTTP',
component: TableHttpExample
},
'table-native-only' : {
title : 'Native `<table>` that only applies the Material styles',
component: TableNativeOnlyExample
'table-multiple-header-footer' : {
title : 'Table with multiple header and footer rows',
component: TableMultipleHeaderFooterExample
},
'table-overview' : {
title : 'Data table with sorting, pagination, and filtering.',
@@ -907,6 +973,10 @@ export const EXAMPLE_COMPONENTS = {
title : 'Table with pagination',
component: TablePaginationExample
},
'table-row-context' : {
title : 'Table showing each row context properties',
component: TableRowContextExample
},
'table-selection' : {
title : 'Table with selection',
component: TableSelectionExample
@@ -915,13 +985,65 @@ export const EXAMPLE_COMPONENTS = {
title : 'Table with sorting',
component: TableSortingExample
},
'tabs-overview' : {
title : 'Basic tabs',
component: TabsOverviewExample
'table-sticky-columns' : {
title : 'Table with a sticky columns',
component: TableStickyColumnsExample
},
'tabs-template-label' : {
title : 'Complex Example',
component: TabsTemplateLabelExample
'table-sticky-complex' : {
title : 'Tables with toggle-able sticky headers, footers, and columns',
component: TableStickyComplexExample
},
'table-sticky-complex-flex' : {
title : 'Flex-layout tables with toggle-able sticky headers, footers, and columns',
component: TableStickyComplexFlexExample
},
'table-sticky-footer' : {
title : 'Table with a sticky footer',
component: TableStickyFooterExample
},
'table-sticky-header' : {
title : 'Table with sticky header',
component: TableStickyHeaderExample
},
'tab-group-basic' : {
title : 'Basic use of the tab group',
component: TabGroupBasicExample
},
'tab-group-async' : {
title : 'Tab group with asynchronously loading tab contents',
component: TabGroupAsyncExample
},
'tab-group-custom-label' : {
title : 'Using tabs with a custom label template',
component: TabGroupCustomLabelExample
},
'tab-group-dynamic' : {
title : 'Tab group with dynamically changing tabs',
component: TabGroupDynamicExample
},
'tab-group-dynamic-height' : {
title : 'Tab group with dynamic height based on tab contents',
component: TabGroupDynamicHeightExample
},
'tab-group-header-below' : {
title : 'Tab group with the headers on the bottom',
component: TabGroupHeaderBelowExample
},
'tab-group-lazy-loaded' : {
title : 'Tab group where the tab content is loaded lazily (when activated)',
component: TabGroupLazyLoadedExample
},
'tab-group-stretched' : {
title : 'Tab group with stretched labels',
component: TabGroupStretchedExample
},
'tab-group-theme' : {
title : 'Customizing the theme options on the tab group',
component: TabGroupThemeExample
},
'tab-nav-bar-basic' : {
title : 'Basic use of the tab nav bar',
component: TabNavBarBasicExample
},
'text-field-autofill-directive' : {
title : 'Monitoring autofill state with cdkAutofill',
@@ -943,14 +1065,30 @@ export const EXAMPLE_COMPONENTS = {
title : 'Basic toolbar',
component: ToolbarOverviewExample
},
'tooltip-auto-hide' : {
title : 'Tooltip that demonstrates auto-hiding when it clips out of its scrolling container',
component: TooltipAutoHideExample
},
'tooltip-custom-class' : {
title : 'Tooltip that can have a custom class applied',
component: TooltipCustomClassExample
},
'tooltip-delay' : {
title : 'Tooltip with a show and hide delay',
component: TooltipDelayExample
},
'tooltip-disabled' : {
title : 'Tooltip that can be disabled',
component: TooltipDisabledExample
},
'tooltip-manual' : {
title : 'Tooltip that can be manually shown/hidden.',
title : 'Tooltip that can be manually shown/hidden',
component: TooltipManualExample
},
'tooltip-message' : {
title : 'Tooltip with a changing message',
component: TooltipMessageExample
},
'tooltip-modified-defaults' : {
title : 'Tooltip with a show and hide delay',
component: TooltipModifiedDefaultsExample
@@ -1001,6 +1139,7 @@ export const EXAMPLE_LIST = [
CardFancyExample,
CardOverviewExample,
CdkTableBasicExample,
CdkTableBasicFlexExample,
CdkTreeFlatExample,
CdkTreeNestedExample,
CheckboxConfigurableExample,
@@ -1108,24 +1247,47 @@ export const EXAMPLE_LIST = [
StepperEditableExample,
StepperOptionalExample,
StepperOverviewExample,
StepperVerticalExample,
TableBasicExample,
TableBasicFlexExample,
TableDynamicColumnsExample,
TableExpandableRowsExample,
TableFilteringExample,
TableFooterRowExample,
TableHttpExample,
TableNativeOnlyExample,
TableMultipleHeaderFooterExample,
TableOverviewExample,
TablePaginationExample,
TableRowContextExample,
TableSelectionExample,
TableSortingExample,
TabsOverviewExample,
TabsTemplateLabelExample,
TableStickyColumnsExample,
TableStickyComplexExample,
TableStickyComplexFlexExample,
TableStickyFooterExample,
TableStickyHeaderExample,
TabGroupBasicExample,
TabGroupAsyncExample,
TabGroupCustomLabelExample,
TabGroupDynamicExample,
TabGroupDynamicHeightExample,
TabGroupHeaderBelowExample,
TabGroupLazyLoadedExample,
TabGroupStretchedExample,
TabGroupStretchedExample,
TabGroupThemeExample,
TabNavBarBasicExample,
TextFieldAutofillDirectiveExample,
TextFieldAutofillMonitorExample,
TextFieldAutosizeTextareaExample,
ToolbarMultirowExample,
ToolbarOverviewExample,
TooltipAutoHideExample,
TooltipCustomClassExample,
TooltipDelayExample,
TooltipDisabledExample,
TooltipManualExample,
TooltipMessageExample,
TooltipModifiedDefaultsExample,
TooltipOverviewExample,
TooltipPositionExample,

View File

@@ -1,4 +1,4 @@
@import "../../../../@fuse/scss/fuse";
@import "src/@fuse/scss/fuse";
example-viewer {
display: block;

View File

@@ -149,6 +149,7 @@
left: 0;
padding: 48px;
overflow: auto;
-webkit-overflow-scrolling: touch;
&.ng-animating {
overflow: hidden;

View File

@@ -33,6 +33,7 @@
#chat-content {
background: transparent;
overflow: auto;
-webkit-overflow-scrolling: touch;
.message-row {
padding: 16px;
@@ -113,9 +114,10 @@
padding-right: 16px;
textarea {
overflow: auto;
max-height: 80px;
transition: height 200ms ease;
overflow: auto;
-webkit-overflow-scrolling: touch;
&.grow {
height: 80px;

View File

@@ -74,9 +74,7 @@ export class ChatService implements Resolve<any>
return item.contactId === contactId;
});
/**
* Create new chat, if it's not created yet.
*/
// Create new chat, if it's not created yet.
if ( !chatItem )
{
this.createNewChat(contactId).then((newChats) => {
@@ -137,26 +135,18 @@ export class ChatService implements Resolve<any>
unread : null
};
/**
* Add new chat list item to the user's chat list
*/
// Add new chat list item to the user's chat list
this.user.chatList.push(chatListItem);
/**
* Post the created chat
*/
// Post the created chat
this._httpClient.post('api/chat-chats', {...chat})
.subscribe((response: any) => {
/**
* Post the new the user data
*/
// Post the new the user data
this._httpClient.post('api/chat-user/' + this.user.id, this.user)
.subscribe(newUserData => {
/**
* Update the user data from server
*/
// Update the user data from server
this.getUser().then(updatedUser => {
this.onUserUpdated.next(updatedUser);
resolve(updatedUser);

View File

@@ -42,6 +42,7 @@
.sidenav-content {
overflow: auto;
-webkit-overflow-scrolling: touch;
.contact-list, .chat-list {

View File

@@ -5,6 +5,7 @@
flex: 1;
flex-direction: column;
overflow: auto;
-webkit-overflow-scrolling: touch;
mat-toolbar {

View File

@@ -5,6 +5,7 @@
flex: 1;
flex-direction: column;
overflow: auto;
-webkit-overflow-scrolling: touch;
mat-toolbar {

View File

@@ -1,9 +1,9 @@
<mat-table #table [dataSource]="dataSource"
[@animateStagger]="{value:'50'}">
<!-- Checkbox Column -->
<ng-container cdkColumnDef="checkbox">
<mat-header-cell *cdkHeaderCellDef></mat-header-cell>
<mat-cell *cdkCellDef="let contact">
<ng-container matColumnDef="checkbox">
<mat-header-cell *matHeaderCellDef></mat-header-cell>
<mat-cell *matCellDef="let contact">
<mat-checkbox [(ngModel)]="checkboxes[contact.id]" (ngModelChange)="onSelectedChange(contact.id)"
(click)="$event.stopPropagation()">
</mat-checkbox>
@@ -11,26 +11,26 @@
</ng-container>
<!-- Avatar Column -->
<ng-container cdkColumnDef="avatar">
<mat-header-cell *cdkHeaderCellDef></mat-header-cell>
<mat-cell *cdkCellDef="let contact">
<ng-container matColumnDef="avatar">
<mat-header-cell *matHeaderCellDef></mat-header-cell>
<mat-cell *matCellDef="let contact">
<img class="avatar" *ngIf="contact.avatar" [alt]="contact.name"
[src]="contact.avatar"/>
</mat-cell>
</ng-container>
<!-- Name Column -->
<ng-container cdkColumnDef="name">
<mat-header-cell *cdkHeaderCellDef>Name</mat-header-cell>
<mat-cell *cdkCellDef="let contact">
<ng-container matColumnDef="name">
<mat-header-cell *matHeaderCellDef>Name</mat-header-cell>
<mat-cell *matCellDef="let contact">
<p class="text-truncate font-weight-600">{{contact.name}} {{contact.lastName}}</p>
</mat-cell>
</ng-container>
<!-- Email Column -->
<ng-container cdkColumnDef="email">
<mat-header-cell *cdkHeaderCellDef fxHide fxShow.gt-sm>Email</mat-header-cell>
<mat-cell *cdkCellDef="let contact" fxHide fxShow.gt-sm>
<ng-container matColumnDef="email">
<mat-header-cell *matHeaderCellDef fxHide fxShow.gt-sm>Email</mat-header-cell>
<mat-cell *matCellDef="let contact" fxHide fxShow.gt-sm>
<p class="email text-truncate">
{{contact.email}}
</p>
@@ -38,9 +38,9 @@
</ng-container>
<!-- Phone Column -->
<ng-container cdkColumnDef="phone">
<mat-header-cell *cdkHeaderCellDef fxHide fxShow.gt-md>Phone</mat-header-cell>
<mat-cell *cdkCellDef="let contact" fxHide fxShow.gt-md>
<ng-container matColumnDef="phone">
<mat-header-cell *matHeaderCellDef fxHide fxShow.gt-md>Phone</mat-header-cell>
<mat-cell *matCellDef="let contact" fxHide fxShow.gt-md>
<p class="phone text-truncate">
{{contact.phone}}
</p>
@@ -48,9 +48,9 @@
</ng-container>
<!-- Job Title Column -->
<ng-container cdkColumnDef="jobTitle">
<mat-header-cell *cdkHeaderCellDef fxHide fxShow.gt-lg>Job title</mat-header-cell>
<mat-cell *cdkCellDef="let contact" fxHide fxShow.gt-lg>
<ng-container matColumnDef="jobTitle">
<mat-header-cell *matHeaderCellDef fxHide fxShow.gt-lg>Job title</mat-header-cell>
<mat-cell *matCellDef="let contact" fxHide fxShow.gt-lg>
<p class="job-title text-truncate">
{{contact.jobTitle}}
</p>
@@ -58,9 +58,9 @@
</ng-container>
<!-- Company Column -->
<ng-container cdkColumnDef="company">
<mat-header-cell *cdkHeaderCellDef fxHide fxShow.gt-lg>Company</mat-header-cell>
<mat-cell *cdkCellDef="let contact" fxHide fxShow.gt-lg>
<ng-container matColumnDef="company">
<mat-header-cell *matHeaderCellDef fxHide fxShow.gt-lg>Company</mat-header-cell>
<mat-cell *matCellDef="let contact" fxHide fxShow.gt-lg>
<p class="company text-truncate">
{{contact.company}}
</p>
@@ -68,9 +68,9 @@
</ng-container>
<!-- Buttons Column -->
<ng-container cdkColumnDef="buttons">
<mat-header-cell *cdkHeaderCellDef></mat-header-cell>
<mat-cell *cdkCellDef="let contact">
<ng-container matColumnDef="buttons">
<mat-header-cell *matHeaderCellDef></mat-header-cell>
<mat-cell *matCellDef="let contact">
<div fxFlex="row" fxLayoutAlign="end center">
<button mat-icon-button (click)="$event.stopPropagation();toggleStar(contact.id)" aria-label="Toggle star">
<mat-icon class="amber-fg" *ngIf="user.starred.includes(contact.id)">star</mat-icon>
@@ -93,8 +93,8 @@
</mat-cell>
</ng-container>
<mat-header-row *cdkHeaderRowDef="displayedColumns"></mat-header-row>
<mat-row *cdkRowDef="let contact; columns: displayedColumns;"
<mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row>
<mat-row *matRowDef="let contact; columns: displayedColumns;"
class="contact"
(click)="editContact(contact)"
[ngClass]="{'mat-accent-50-bg':checkboxes[contact.id]}"

View File

@@ -50,4 +50,10 @@ contacts-contact-list {
right: 12px;
padding: 0;
z-index: 99;
@include media-breakpoint-down('xs') {
position: sticky;
top: calc(100vh - 72px);
bottom: auto;
}
}

View File

@@ -1,7 +1,5 @@
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { CdkTableModule } from '@angular/cdk/table';
import { MatButtonModule, MatCheckboxModule, MatDatepickerModule, MatFormFieldModule, MatIconModule, MatInputModule, MatMenuModule, MatRippleModule, MatTableModule, MatToolbarModule } from '@angular/material';
import { FuseSharedModule } from '@fuse/shared.module';
@@ -34,7 +32,6 @@ const routes: Routes = [
],
imports : [
RouterModule.forChild(routes),
CdkTableModule,
MatButtonModule,
MatCheckboxModule,

View File

@@ -816,28 +816,28 @@
<mat-table #table [dataSource]="widget11.dataSource">
<!-- Avatar Column -->
<ng-container cdkColumnDef="avatar">
<mat-header-cell fxFlex="96px" *cdkHeaderCellDef></mat-header-cell>
<mat-cell fxFlex="96px" *cdkCellDef="let contact">
<ng-container matColumnDef="avatar">
<mat-header-cell fxFlex="96px" *matHeaderCellDef></mat-header-cell>
<mat-cell fxFlex="96px" *matCellDef="let contact">
<img class="avatar" *ngIf="contact.avatar" [alt]="contact.name"
[src]="contact.avatar"/>
</mat-cell>
</ng-container>
<!-- Name Column -->
<ng-container cdkColumnDef="name">
<mat-header-cell *cdkHeaderCellDef>Name</mat-header-cell>
<mat-cell *cdkCellDef="let contact">
<ng-container matColumnDef="name">
<mat-header-cell *matHeaderCellDef>Name</mat-header-cell>
<mat-cell *matCellDef="let contact">
<p class="text-truncate font-weight-600">{{contact.name}}
{{contact.lastName}}</p>
</mat-cell>
</ng-container>
<!-- Position Column -->
<ng-container cdkColumnDef="position">
<mat-header-cell *cdkHeaderCellDef fxHide fxShow.gt-sm>Position
<ng-container matColumnDef="position">
<mat-header-cell *matHeaderCellDef fxHide fxShow.gt-sm>Position
</mat-header-cell>
<mat-cell *cdkCellDef="let contact" fxHide fxShow.gt-sm>
<mat-cell *matCellDef="let contact" fxHide fxShow.gt-sm>
<p class="position text-truncate">
{{contact.position}}
</p>
@@ -845,10 +845,10 @@
</ng-container>
<!-- Office Column -->
<ng-container cdkColumnDef="office">
<mat-header-cell *cdkHeaderCellDef fxHide fxShow.gt-md>Office
<ng-container matColumnDef="office">
<mat-header-cell *matHeaderCellDef fxHide fxShow.gt-md>Office
</mat-header-cell>
<mat-cell *cdkCellDef="let contact" fxHide fxShow.gt-md>
<mat-cell *matCellDef="let contact" fxHide fxShow.gt-md>
<p class="office text-truncate">
{{contact.office}}
</p>
@@ -856,10 +856,10 @@
</ng-container>
<!-- Email Column -->
<ng-container cdkColumnDef="email">
<mat-header-cell *cdkHeaderCellDef fxHide fxShow.gt-sm>Email
<ng-container matColumnDef="email">
<mat-header-cell *matHeaderCellDef fxHide fxShow.gt-sm>Email
</mat-header-cell>
<mat-cell *cdkCellDef="let contact" fxHide fxShow.gt-sm>
<mat-cell *matCellDef="let contact" fxHide fxShow.gt-sm>
<p class="email text-truncate">
{{contact.email}}
</p>
@@ -867,10 +867,10 @@
</ng-container>
<!-- Phone Column -->
<ng-container cdkColumnDef="phone">
<mat-header-cell *cdkHeaderCellDef fxHide fxShow.gt-md>Phone
<ng-container matColumnDef="phone">
<mat-header-cell *matHeaderCellDef fxHide fxShow.gt-md>Phone
</mat-header-cell>
<mat-cell *cdkCellDef="let contact" fxHide fxShow.gt-md>
<mat-cell *matCellDef="let contact" fxHide fxShow.gt-md>
<p class="phone text-truncate">
{{contact.phone}}
</p>
@@ -878,8 +878,8 @@
</ng-container>
<mat-header-row
*cdkHeaderRowDef="widgets.widget11.table.columns"></mat-header-row>
<mat-row *cdkRowDef="let contact; columns: widgets.widget11.table.columns;">
*matHeaderRowDef="widgets.widget11.table.columns"></mat-header-row>
<mat-row *matRowDef="let contact; columns: widgets.widget11.table.columns;">
</mat-row>
</mat-table>
</div>

View File

@@ -1,6 +1,5 @@
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { CdkTableModule } from '@angular/cdk/table';
import { MatButtonModule, MatDividerModule, MatFormFieldModule, MatIconModule, MatMenuModule, MatSelectModule, MatTableModule, MatTabsModule } from '@angular/material';
import { NgxChartsModule } from '@swimlane/ngx-charts';
@@ -28,7 +27,6 @@ const routes: Routes = [
imports : [
RouterModule.forChild(routes),
CdkTableModule,
MatButtonModule,
MatDividerModule,
MatFormFieldModule,

Some files were not shown because too many files have changed in this diff Show More