mirror of
https://github.com/richard-loafle/fuse-angular.git
synced 2025-12-22 11:37:09 +00:00
Compare commits
92 Commits
v13.0.3-st
...
v13.6.1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b6a3023ebd | ||
|
|
693e44dbaf | ||
|
|
206ef711a4 | ||
|
|
7e0cc1249e | ||
|
|
138a43da59 | ||
|
|
fe7e2514a6 | ||
|
|
b8f0d9f0b2 | ||
|
|
2a4a392153 | ||
|
|
c2fa88f4d4 | ||
|
|
67d25012ec | ||
|
|
6de6a07778 | ||
|
|
e7ab0ea13f | ||
|
|
4b686d86cc | ||
|
|
190395f14b | ||
|
|
4a9b8ee91e | ||
|
|
488fe8a1eb | ||
|
|
db9a2a2433 | ||
|
|
3dda8479cf | ||
|
|
7c402670a1 | ||
|
|
f6bf0fb5d3 | ||
|
|
d44c004d01 | ||
|
|
4ec40271c5 | ||
|
|
b21cdf1655 | ||
|
|
6fff259fe3 | ||
|
|
8fcb0aea03 | ||
|
|
2c90770d9b | ||
|
|
1581ea74cc | ||
|
|
569809aabb | ||
|
|
dde9333120 | ||
|
|
10ec1790ca | ||
|
|
a2ff55d4c1 | ||
|
|
966e2db743 | ||
|
|
49cccde93b | ||
|
|
952b64297b | ||
|
|
9b3ff6a724 | ||
|
|
961b86c8cb | ||
|
|
8b977c0eeb | ||
|
|
35e56cd6af | ||
|
|
c04550b887 | ||
|
|
747b4f44c8 | ||
|
|
c4914c80b3 | ||
|
|
178d09597b | ||
|
|
d206c55e6e | ||
|
|
9abe887df1 | ||
|
|
b87fdc407c | ||
|
|
58440b63a7 | ||
|
|
63f6edee9a | ||
|
|
ca8e422b21 | ||
|
|
cc703081ca | ||
|
|
038c74df50 | ||
|
|
9abbf5fec2 | ||
|
|
0ebc16ec05 | ||
|
|
56c4eb0356 | ||
|
|
a8a4f2b18d | ||
|
|
36c8727616 | ||
|
|
5ea37aed99 | ||
|
|
cbce71f155 | ||
|
|
ed47050232 | ||
|
|
c86a538d41 | ||
|
|
f369206ef8 | ||
|
|
1659d4babd | ||
|
|
fa37f99d33 | ||
|
|
331968ac5b | ||
|
|
27274c84d6 | ||
|
|
4b8a101a3e | ||
|
|
8080a85d40 | ||
|
|
36784c405f | ||
|
|
8f4f7886d5 | ||
|
|
d693a08136 | ||
|
|
0c0ef40de3 | ||
|
|
f4d737d3a3 | ||
|
|
47d9ddb08c | ||
|
|
4da3612d22 | ||
|
|
403a949d4a | ||
|
|
5b78a68116 | ||
|
|
214116e10d | ||
|
|
5962c80e8d | ||
|
|
ff086b1ed0 | ||
|
|
efdfa6418a | ||
|
|
c1c9904b9d | ||
|
|
39650d3cc9 | ||
|
|
bafa9adc01 | ||
|
|
bb9023f9df | ||
|
|
66096718e0 | ||
|
|
945d0a2240 | ||
|
|
9005f08ac7 | ||
|
|
89f5a4ec69 | ||
|
|
ca7b4c7e5d | ||
|
|
bb57ec2324 | ||
|
|
11ad2c89df | ||
|
|
fc1e7b02b0 | ||
|
|
446bfe4139 |
@@ -12,7 +12,7 @@ Run `ng generate component component-name` to generate a new component. You can
|
|||||||
|
|
||||||
## Build
|
## Build
|
||||||
|
|
||||||
Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `--prod` flag for a production build.
|
Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory.
|
||||||
|
|
||||||
## Running unit tests
|
## Running unit tests
|
||||||
|
|
||||||
@@ -20,7 +20,7 @@ Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.
|
|||||||
|
|
||||||
## Running end-to-end tests
|
## Running end-to-end tests
|
||||||
|
|
||||||
Run `ng e2e` to execute the end-to-end tests via a platform of your choice.
|
Run `ng e2e` to execute the end-to-end tests via a platform of your choice. To use this command, you need to first add a package that implements end-to-end testing capabilities.
|
||||||
|
|
||||||
## Further help
|
## Further help
|
||||||
|
|
||||||
|
|||||||
@@ -60,13 +60,13 @@
|
|||||||
"budgets": [
|
"budgets": [
|
||||||
{
|
{
|
||||||
"type": "initial",
|
"type": "initial",
|
||||||
"maximumWarning": "5mb",
|
"maximumWarning": "3mb",
|
||||||
"maximumError": "8mb"
|
"maximumError": "5mb"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "anyComponentStyle",
|
"type": "anyComponentStyle",
|
||||||
"maximumWarning": "100kb",
|
"maximumWarning": "75kb",
|
||||||
"maximumError": "150kb"
|
"maximumError": "90kb"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"fileReplacements": [
|
"fileReplacements": [
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ module.exports = function (config)
|
|||||||
suppressAll: true // removes the duplicated traces
|
suppressAll: true // removes the duplicated traces
|
||||||
},
|
},
|
||||||
coverageReporter : {
|
coverageReporter : {
|
||||||
dir : require('path').join(__dirname, './coverage/angular12'),
|
dir : require('path').join(__dirname, './coverage/fuse'),
|
||||||
subdir : '.',
|
subdir : '.',
|
||||||
reporters: [
|
reporters: [
|
||||||
{type: 'html'},
|
{type: 'html'},
|
||||||
|
|||||||
5592
package-lock.json
generated
5592
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
91
package.json
91
package.json
@@ -1,28 +1,30 @@
|
|||||||
{
|
{
|
||||||
"name": "@fuse/demo",
|
"name": "@fuse/demo",
|
||||||
"version": "13.0.3",
|
"version": "13.6.1",
|
||||||
|
"description": "Fuse - Angular Admin Template and Starter Project",
|
||||||
|
"author": "https://themeforest.net/user/srcn",
|
||||||
"license": "https://themeforest.net/licenses/standard",
|
"license": "https://themeforest.net/licenses/standard",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"ng": "ng",
|
"ng": "ng",
|
||||||
"start": "ng serve",
|
"start": "ng serve",
|
||||||
"build": "ng build",
|
"build": "ng build",
|
||||||
|
"watch": "ng build --watch --configuration development",
|
||||||
"test": "ng test",
|
"test": "ng test",
|
||||||
"lint": "ng lint",
|
"lint": "ng lint"
|
||||||
"e2e": "ng e2e"
|
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@angular/animations": "12.0.2",
|
"@angular/animations": "12.2.3",
|
||||||
"@angular/cdk": "12.0.2",
|
"@angular/cdk": "12.2.3",
|
||||||
"@angular/common": "12.0.2",
|
"@angular/common": "12.2.3",
|
||||||
"@angular/compiler": "12.0.2",
|
"@angular/compiler": "12.2.3",
|
||||||
"@angular/core": "12.0.2",
|
"@angular/core": "12.2.3",
|
||||||
"@angular/forms": "12.0.2",
|
"@angular/forms": "12.2.3",
|
||||||
"@angular/material": "12.0.2",
|
"@angular/material": "12.2.3",
|
||||||
"@angular/material-moment-adapter": "12.0.2",
|
"@angular/material-moment-adapter": "12.2.3",
|
||||||
"@angular/platform-browser": "12.0.2",
|
"@angular/platform-browser": "12.2.3",
|
||||||
"@angular/platform-browser-dynamic": "12.0.2",
|
"@angular/platform-browser-dynamic": "12.2.3",
|
||||||
"@angular/router": "12.0.2",
|
"@angular/router": "12.2.3",
|
||||||
"@fullcalendar/angular": "4.4.5-beta",
|
"@fullcalendar/angular": "4.4.5-beta",
|
||||||
"@fullcalendar/core": "4.4.2",
|
"@fullcalendar/core": "4.4.2",
|
||||||
"@fullcalendar/daygrid": "4.4.2",
|
"@fullcalendar/daygrid": "4.4.2",
|
||||||
@@ -31,60 +33,59 @@
|
|||||||
"@fullcalendar/moment": "4.4.2",
|
"@fullcalendar/moment": "4.4.2",
|
||||||
"@fullcalendar/rrule": "4.4.2",
|
"@fullcalendar/rrule": "4.4.2",
|
||||||
"@fullcalendar/timegrid": "4.4.2",
|
"@fullcalendar/timegrid": "4.4.2",
|
||||||
"@ngneat/transloco": "2.21.0",
|
"@ngneat/transloco": "2.22.0",
|
||||||
"apexcharts": "3.26.3",
|
"apexcharts": "3.28.1",
|
||||||
"crypto-js": "3.3.0",
|
"crypto-js": "3.3.0",
|
||||||
"highlight.js": "11.0.0",
|
"highlight.js": "11.2.0",
|
||||||
"lodash-es": "4.17.21",
|
"lodash-es": "4.17.21",
|
||||||
"moment": "2.29.1",
|
"moment": "2.29.1",
|
||||||
"ng-apexcharts": "1.5.10",
|
"ng-apexcharts": "1.5.12",
|
||||||
"ngx-markdown": "12.0.1",
|
"ngx-markdown": "12.0.1",
|
||||||
"ngx-quill": "14.0.0",
|
"ngx-quill": "14.3.0",
|
||||||
"perfect-scrollbar": "1.5.1",
|
"perfect-scrollbar": "1.5.2",
|
||||||
"quill": "1.3.7",
|
"quill": "1.3.7",
|
||||||
"rrule": "2.6.8",
|
"rrule": "2.6.8",
|
||||||
"rxjs": "6.6.7",
|
"rxjs": "6.6.7",
|
||||||
"tslib": "2.2.0",
|
"tslib": "2.3.1",
|
||||||
"web-animations-js": "2.3.2",
|
"web-animations-js": "2.3.2",
|
||||||
"zone.js": "0.11.4"
|
"zone.js": "0.11.4"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@angular-devkit/build-angular": "12.0.2",
|
"@angular-devkit/build-angular": "12.2.3",
|
||||||
"@angular-eslint/builder": "12.1.0",
|
"@angular-eslint/builder": "12.3.1",
|
||||||
"@angular-eslint/eslint-plugin": "12.1.0",
|
"@angular-eslint/eslint-plugin": "12.3.1",
|
||||||
"@angular-eslint/eslint-plugin-template": "12.1.0",
|
"@angular-eslint/eslint-plugin-template": "12.3.1",
|
||||||
"@angular-eslint/schematics": "12.1.0",
|
"@angular-eslint/schematics": "12.3.1",
|
||||||
"@angular-eslint/template-parser": "12.1.0",
|
"@angular-eslint/template-parser": "12.3.1",
|
||||||
"@angular/cli": "12.0.2",
|
"@angular/cli": "12.2.3",
|
||||||
"@angular/compiler-cli": "12.0.2",
|
"@angular/compiler-cli": "12.2.3",
|
||||||
"@angular/language-service": "12.0.2",
|
|
||||||
"@tailwindcss/aspect-ratio": "0.2.1",
|
"@tailwindcss/aspect-ratio": "0.2.1",
|
||||||
"@tailwindcss/line-clamp": "0.2.1",
|
"@tailwindcss/line-clamp": "0.2.1",
|
||||||
"@tailwindcss/typography": "0.4.1",
|
"@tailwindcss/typography": "0.4.1",
|
||||||
"@types/chroma-js": "2.1.3",
|
"@types/chroma-js": "2.1.3",
|
||||||
"@types/crypto-js": "3.1.47",
|
"@types/crypto-js": "3.1.47",
|
||||||
"@types/highlight.js": "10.1.0",
|
"@types/highlight.js": "10.1.0",
|
||||||
"@types/jasmine": "3.6.11",
|
"@types/jasmine": "3.8.2",
|
||||||
"@types/lodash": "4.14.170",
|
"@types/lodash": "4.14.172",
|
||||||
"@types/lodash-es": "4.17.4",
|
"@types/lodash-es": "4.17.4",
|
||||||
"@types/node": "12.20.14",
|
"@types/node": "12.20.21",
|
||||||
"@typescript-eslint/eslint-plugin": "4.26.0",
|
"@typescript-eslint/eslint-plugin": "4.30.0",
|
||||||
"@typescript-eslint/parser": "4.26.0",
|
"@typescript-eslint/parser": "4.30.0",
|
||||||
"autoprefixer": "10.2.6",
|
"autoprefixer": "10.3.3",
|
||||||
"chroma-js": "2.1.2",
|
"chroma-js": "2.1.2",
|
||||||
"eslint": "7.27.0",
|
"eslint": "7.32.0",
|
||||||
"eslint-plugin-import": "2.23.4",
|
"eslint-plugin-import": "2.24.2",
|
||||||
"eslint-plugin-jsdoc": "35.1.2",
|
"eslint-plugin-jsdoc": "36.0.8",
|
||||||
"eslint-plugin-prefer-arrow": "1.2.3",
|
"eslint-plugin-prefer-arrow": "1.2.3",
|
||||||
"jasmine-core": "3.7.1",
|
"jasmine-core": "3.8.0",
|
||||||
"karma": "6.3.3",
|
"karma": "6.3.4",
|
||||||
"karma-chrome-launcher": "3.1.0",
|
"karma-chrome-launcher": "3.1.0",
|
||||||
"karma-coverage": "2.0.3",
|
"karma-coverage": "2.0.3",
|
||||||
"karma-jasmine": "4.0.1",
|
"karma-jasmine": "4.0.1",
|
||||||
"karma-jasmine-html-reporter": "1.6.0",
|
"karma-jasmine-html-reporter": "1.7.0",
|
||||||
"lodash": "4.17.21",
|
"lodash": "4.17.21",
|
||||||
"postcss": "8.3.0",
|
"postcss": "8.3.6",
|
||||||
"tailwindcss": "2.1.4",
|
"tailwindcss": "2.2.9",
|
||||||
"typescript": "4.2.4"
|
"typescript": "4.3.5"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -116,7 +116,7 @@ fuse-drawer {
|
|||||||
left: 0;
|
left: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
z-index: 299;
|
z-index: 299;
|
||||||
opacity: 0;
|
opacity: 1;
|
||||||
background-color: rgba(0, 0, 0, 0.6);
|
background-color: rgba(0, 0, 0, 0.6);
|
||||||
|
|
||||||
/* Fixed mode */
|
/* Fixed mode */
|
||||||
|
|||||||
@@ -211,6 +211,12 @@ export class FuseDrawerComponent implements OnChanges, OnInit, OnDestroy
|
|||||||
*/
|
*/
|
||||||
ngOnDestroy(): void
|
ngOnDestroy(): void
|
||||||
{
|
{
|
||||||
|
// Finish the animation
|
||||||
|
if ( this._player )
|
||||||
|
{
|
||||||
|
this._player.finish();
|
||||||
|
}
|
||||||
|
|
||||||
// Deregister the drawer from the registry
|
// Deregister the drawer from the registry
|
||||||
this._fuseDrawerService.deregisterComponent(this.name);
|
this._fuseDrawerService.deregisterComponent(this.name);
|
||||||
}
|
}
|
||||||
@@ -338,9 +344,18 @@ export class FuseDrawerComponent implements OnChanges, OnInit, OnDestroy
|
|||||||
|
|
||||||
// Create the enter animation and attach it to the player
|
// Create the enter animation and attach it to the player
|
||||||
this._player = this._animationBuilder.build([
|
this._player = this._animationBuilder.build([
|
||||||
|
style({opacity: 0}),
|
||||||
animate('300ms cubic-bezier(0.25, 0.8, 0.25, 1)', style({opacity: 1}))
|
animate('300ms cubic-bezier(0.25, 0.8, 0.25, 1)', style({opacity: 1}))
|
||||||
]).create(this._overlay);
|
]).create(this._overlay);
|
||||||
|
|
||||||
|
// Once the animation is done...
|
||||||
|
this._player.onDone(() => {
|
||||||
|
|
||||||
|
// Destroy the player
|
||||||
|
this._player.destroy();
|
||||||
|
this._player = null;
|
||||||
|
});
|
||||||
|
|
||||||
// Play the animation
|
// Play the animation
|
||||||
this._player.play();
|
this._player.play();
|
||||||
|
|
||||||
@@ -373,6 +388,10 @@ export class FuseDrawerComponent implements OnChanges, OnInit, OnDestroy
|
|||||||
// Once the animation is done...
|
// Once the animation is done...
|
||||||
this._player.onDone(() => {
|
this._player.onDone(() => {
|
||||||
|
|
||||||
|
// Destroy the player
|
||||||
|
this._player.destroy();
|
||||||
|
this._player = null;
|
||||||
|
|
||||||
// If the backdrop still exists...
|
// If the backdrop still exists...
|
||||||
if ( this._overlay )
|
if ( this._overlay )
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,7 +1,12 @@
|
|||||||
<!-- Button -->
|
<!-- Button -->
|
||||||
<button
|
<button
|
||||||
mat-icon-button
|
mat-icon-button
|
||||||
[matTooltip]="'Toggle Fullscreen'"
|
[matTooltip]="tooltip || 'Toggle Fullscreen'"
|
||||||
(click)="toggleFullscreen()">
|
(click)="toggleFullscreen()">
|
||||||
<mat-icon [svgIcon]="'heroicons_outline:arrows-expand'"></mat-icon>
|
<ng-container [ngTemplateOutlet]="iconTpl || defaultIconTpl"></ng-container>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
|
<!-- Default icon -->
|
||||||
|
<ng-template #defaultIconTpl>
|
||||||
|
<mat-icon [svgIcon]="'heroicons_outline:arrows-expand'"></mat-icon>
|
||||||
|
</ng-template>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { ChangeDetectionStrategy, Component, Inject, OnInit, ViewEncapsulation } from '@angular/core';
|
import { ChangeDetectionStrategy, Component, Inject, Input, OnInit, TemplateRef, ViewEncapsulation } from '@angular/core';
|
||||||
import { DOCUMENT } from '@angular/common';
|
import { DOCUMENT } from '@angular/common';
|
||||||
import { FSDocument, FSDocumentElement } from '@fuse/components/fullscreen/fullscreen.types';
|
import { FSDocument, FSDocumentElement } from '@fuse/components/fullscreen/fullscreen.types';
|
||||||
|
|
||||||
@@ -11,6 +11,8 @@ import { FSDocument, FSDocumentElement } from '@fuse/components/fullscreen/fulls
|
|||||||
})
|
})
|
||||||
export class FuseFullscreenComponent implements OnInit
|
export class FuseFullscreenComponent implements OnInit
|
||||||
{
|
{
|
||||||
|
@Input() iconTpl: TemplateRef<any>;
|
||||||
|
@Input() tooltip: string;
|
||||||
private _fsDoc: FSDocument;
|
private _fsDoc: FSDocument;
|
||||||
private _fsDocEl: FSDocumentElement;
|
private _fsDocEl: FSDocumentElement;
|
||||||
private _isFullscreen: boolean = false;
|
private _isFullscreen: boolean = false;
|
||||||
|
|||||||
@@ -3,15 +3,17 @@ import { MatButtonModule } from '@angular/material/button';
|
|||||||
import { MatIconModule } from '@angular/material/icon';
|
import { MatIconModule } from '@angular/material/icon';
|
||||||
import { MatTooltipModule } from '@angular/material/tooltip';
|
import { MatTooltipModule } from '@angular/material/tooltip';
|
||||||
import { FuseFullscreenComponent } from '@fuse/components/fullscreen/fullscreen.component';
|
import { FuseFullscreenComponent } from '@fuse/components/fullscreen/fullscreen.component';
|
||||||
|
import { CommonModule } from '@angular/common';
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
declarations: [
|
declarations: [
|
||||||
FuseFullscreenComponent
|
FuseFullscreenComponent
|
||||||
],
|
],
|
||||||
imports : [
|
imports: [
|
||||||
MatButtonModule,
|
MatButtonModule,
|
||||||
MatIconModule,
|
MatIconModule,
|
||||||
MatTooltipModule
|
MatTooltipModule,
|
||||||
|
CommonModule
|
||||||
],
|
],
|
||||||
exports : [
|
exports : [
|
||||||
FuseFullscreenComponent
|
FuseFullscreenComponent
|
||||||
|
|||||||
@@ -5,69 +5,83 @@
|
|||||||
[ngClass]="item.classes?.wrapper">
|
[ngClass]="item.classes?.wrapper">
|
||||||
|
|
||||||
<!-- Item with an internal link -->
|
<!-- Item with an internal link -->
|
||||||
<div
|
<ng-container *ngIf="item.link && !item.externalLink && !item.function && !item.disabled">
|
||||||
class="fuse-horizontal-navigation-item"
|
<div
|
||||||
*ngIf="item.link && !item.externalLink && !item.function && !item.disabled"
|
class="fuse-horizontal-navigation-item"
|
||||||
[ngClass]="{'fuse-horizontal-navigation-item-active-forced': item.active}"
|
[ngClass]="{'fuse-horizontal-navigation-item-active-forced': item.active}"
|
||||||
[routerLink]="[item.link]"
|
[routerLink]="[item.link]"
|
||||||
[routerLinkActive]="'fuse-horizontal-navigation-item-active'"
|
[routerLinkActive]="'fuse-horizontal-navigation-item-active'"
|
||||||
[routerLinkActiveOptions]="isActiveMatchOptions">
|
[routerLinkActiveOptions]="isActiveMatchOptions"
|
||||||
<ng-container *ngTemplateOutlet="itemTemplate"></ng-container>
|
[matTooltip]="item.tooltip || ''">
|
||||||
</div>
|
<ng-container *ngTemplateOutlet="itemTemplate"></ng-container>
|
||||||
|
</div>
|
||||||
|
</ng-container>
|
||||||
|
|
||||||
<!-- Item with an external link -->
|
<!-- Item with an external link -->
|
||||||
<a
|
<ng-container *ngIf="item.link && item.externalLink && !item.function && !item.disabled">
|
||||||
class="fuse-horizontal-navigation-item"
|
<a
|
||||||
*ngIf="item.link && item.externalLink && !item.function && !item.disabled"
|
class="fuse-horizontal-navigation-item"
|
||||||
[href]="item.link">
|
[href]="item.link"
|
||||||
<ng-container *ngTemplateOutlet="itemTemplate"></ng-container>
|
[target]="item.target || '_self'"
|
||||||
</a>
|
[matTooltip]="item.tooltip || ''">
|
||||||
|
<ng-container *ngTemplateOutlet="itemTemplate"></ng-container>
|
||||||
|
</a>
|
||||||
|
</ng-container>
|
||||||
|
|
||||||
<!-- Item with a function -->
|
<!-- Item with a function -->
|
||||||
<div
|
<ng-container *ngIf="!item.link && item.function && !item.disabled">
|
||||||
class="fuse-horizontal-navigation-item"
|
<div
|
||||||
*ngIf="!item.link && item.function && !item.disabled"
|
class="fuse-horizontal-navigation-item"
|
||||||
[ngClass]="{'fuse-horizontal-navigation-item-active-forced': item.active}"
|
[ngClass]="{'fuse-horizontal-navigation-item-active-forced': item.active}"
|
||||||
(click)="item.function(item)">
|
[matTooltip]="item.tooltip || ''"
|
||||||
<ng-container *ngTemplateOutlet="itemTemplate"></ng-container>
|
(click)="item.function(item)">
|
||||||
</div>
|
<ng-container *ngTemplateOutlet="itemTemplate"></ng-container>
|
||||||
|
</div>
|
||||||
|
</ng-container>
|
||||||
|
|
||||||
<!-- Item with an internal link and function -->
|
<!-- Item with an internal link and function -->
|
||||||
<div
|
<ng-container *ngIf="item.link && !item.externalLink && item.function && !item.disabled">
|
||||||
class="fuse-horizontal-navigation-item"
|
<div
|
||||||
*ngIf="item.link && !item.externalLink && item.function && !item.disabled"
|
class="fuse-horizontal-navigation-item"
|
||||||
[ngClass]="{'fuse-horizontal-navigation-item-active-forced': item.active}"
|
[ngClass]="{'fuse-horizontal-navigation-item-active-forced': item.active}"
|
||||||
[routerLink]="[item.link]"
|
[routerLink]="[item.link]"
|
||||||
[routerLinkActive]="'fuse-horizontal-navigation-item-active'"
|
[routerLinkActive]="'fuse-horizontal-navigation-item-active'"
|
||||||
[routerLinkActiveOptions]="isActiveMatchOptions"
|
[routerLinkActiveOptions]="isActiveMatchOptions"
|
||||||
(click)="item.function(item)">
|
[matTooltip]="item.tooltip || ''"
|
||||||
<ng-container *ngTemplateOutlet="itemTemplate"></ng-container>
|
(click)="item.function(item)">
|
||||||
</div>
|
<ng-container *ngTemplateOutlet="itemTemplate"></ng-container>
|
||||||
|
</div>
|
||||||
|
</ng-container>
|
||||||
|
|
||||||
<!-- Item with an external link and function -->
|
<!-- Item with an external link and function -->
|
||||||
<a
|
<ng-container *ngIf="item.link && item.externalLink && item.function && !item.disabled">
|
||||||
class="fuse-horizontal-navigation-item"
|
<a
|
||||||
*ngIf="item.link && item.externalLink && item.function && !item.disabled"
|
class="fuse-horizontal-navigation-item"
|
||||||
[href]="item.link"
|
[href]="item.link"
|
||||||
(click)="item.function(item)"
|
[target]="item.target || '_self'"
|
||||||
mat-menu-item>
|
[matTooltip]="item.tooltip || ''"
|
||||||
<ng-container *ngTemplateOutlet="itemTemplate"></ng-container>
|
(click)="item.function(item)"
|
||||||
</a>
|
mat-menu-item>
|
||||||
|
<ng-container *ngTemplateOutlet="itemTemplate"></ng-container>
|
||||||
|
</a>
|
||||||
|
</ng-container>
|
||||||
|
|
||||||
<!-- Item with a no link and no function -->
|
<!-- Item with a no link and no function -->
|
||||||
<div
|
<ng-container *ngIf="!item.link && !item.function && !item.disabled">
|
||||||
class="fuse-horizontal-navigation-item"
|
<div
|
||||||
*ngIf="!item.link && !item.function && !item.disabled"
|
class="fuse-horizontal-navigation-item"
|
||||||
[ngClass]="{'fuse-horizontal-navigation-item-active-forced': item.active}">
|
[ngClass]="{'fuse-horizontal-navigation-item-active-forced': item.active}"
|
||||||
<ng-container *ngTemplateOutlet="itemTemplate"></ng-container>
|
[matTooltip]="item.tooltip || ''">
|
||||||
</div>
|
<ng-container *ngTemplateOutlet="itemTemplate"></ng-container>
|
||||||
|
</div>
|
||||||
|
</ng-container>
|
||||||
|
|
||||||
<!-- Item is disabled -->
|
<!-- Item is disabled -->
|
||||||
<div
|
<ng-container *ngIf="item.disabled">
|
||||||
class="fuse-horizontal-navigation-item fuse-horizontal-navigation-item-disabled"
|
<div class="fuse-horizontal-navigation-item fuse-horizontal-navigation-item-disabled">
|
||||||
*ngIf="item.disabled">
|
<ng-container *ngTemplateOutlet="itemTemplate"></ng-container>
|
||||||
<ng-container *ngTemplateOutlet="itemTemplate"></ng-container>
|
</div>
|
||||||
</div>
|
</ng-container>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -75,11 +89,12 @@
|
|||||||
<ng-template #itemTemplate>
|
<ng-template #itemTemplate>
|
||||||
|
|
||||||
<!-- Icon -->
|
<!-- Icon -->
|
||||||
<mat-icon
|
<ng-container *ngIf="item.icon">
|
||||||
class="fuse-horizontal-navigation-item-icon"
|
<mat-icon
|
||||||
[ngClass]="item.classes?.icon"
|
class="fuse-horizontal-navigation-item-icon"
|
||||||
*ngIf="item.icon"
|
[ngClass]="item.classes?.icon"
|
||||||
[svgIcon]="item.icon"></mat-icon>
|
[svgIcon]="item.icon"></mat-icon>
|
||||||
|
</ng-container>
|
||||||
|
|
||||||
<!-- Title & Subtitle -->
|
<!-- Title & Subtitle -->
|
||||||
<div class="fuse-horizontal-navigation-item-title-wrapper">
|
<div class="fuse-horizontal-navigation-item-title-wrapper">
|
||||||
@@ -88,24 +103,24 @@
|
|||||||
{{item.title}}
|
{{item.title}}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<ng-container *ngIf="item.subtitle">
|
||||||
class="fuse-horizontal-navigation-item-subtitle text-hint"
|
<div class="fuse-horizontal-navigation-item-subtitle text-hint">
|
||||||
*ngIf="item.subtitle">
|
<span [ngClass]="item.classes?.subtitle">
|
||||||
<span [ngClass]="item.classes?.subtitle">
|
{{item.subtitle}}
|
||||||
{{item.subtitle}}
|
</span>
|
||||||
</span>
|
</div>
|
||||||
</div>
|
</ng-container>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Badge -->
|
<!-- Badge -->
|
||||||
<div
|
<ng-container *ngIf="item.badge">
|
||||||
class="fuse-horizontal-navigation-item-badge"
|
<div class="fuse-horizontal-navigation-item-badge">
|
||||||
*ngIf="item.badge">
|
<div
|
||||||
<div
|
class="fuse-horizontal-navigation-item-badge-content"
|
||||||
class="fuse-horizontal-navigation-item-badge-content"
|
[ngClass]="item.badge.classes">
|
||||||
[ngClass]="item.badge.classes">
|
{{item.badge.title}}
|
||||||
{{item.badge.title}}
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</ng-container>
|
||||||
|
|
||||||
</ng-template>
|
</ng-template>
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ import { FuseUtilsService } from '@fuse/services/utils/utils.service';
|
|||||||
@Component({
|
@Component({
|
||||||
selector : 'fuse-horizontal-navigation-basic-item',
|
selector : 'fuse-horizontal-navigation-basic-item',
|
||||||
templateUrl : './basic.component.html',
|
templateUrl : './basic.component.html',
|
||||||
styles : [],
|
|
||||||
changeDetection: ChangeDetectionStrategy.OnPush
|
changeDetection: ChangeDetectionStrategy.OnPush
|
||||||
})
|
})
|
||||||
export class FuseHorizontalNavigationBasicItemComponent implements OnInit, OnDestroy
|
export class FuseHorizontalNavigationBasicItemComponent implements OnInit, OnDestroy
|
||||||
|
|||||||
@@ -1,59 +1,63 @@
|
|||||||
<div
|
<ng-container *ngIf="!child">
|
||||||
*ngIf="!child"
|
<div
|
||||||
[ngClass]="{'fuse-horizontal-navigation-menu-active': trigger.menuOpen,
|
[ngClass]="{'fuse-horizontal-navigation-menu-active': trigger.menuOpen,
|
||||||
'fuse-horizontal-navigation-menu-active-forced': item.active}"
|
'fuse-horizontal-navigation-menu-active-forced': item.active}"
|
||||||
[matMenuTriggerFor]="matMenu"
|
[matMenuTriggerFor]="matMenu"
|
||||||
(onMenuOpen)="triggerChangeDetection()"
|
(onMenuOpen)="triggerChangeDetection()"
|
||||||
(onMenuClose)="triggerChangeDetection()"
|
(onMenuClose)="triggerChangeDetection()"
|
||||||
#trigger="matMenuTrigger">
|
#trigger="matMenuTrigger">
|
||||||
<ng-container *ngTemplateOutlet="itemTemplate; context: {$implicit: item}"></ng-container>
|
<ng-container *ngTemplateOutlet="itemTemplate; context: {$implicit: item}"></ng-container>
|
||||||
</div>
|
</div>
|
||||||
|
</ng-container>
|
||||||
|
|
||||||
<mat-menu
|
<mat-menu
|
||||||
class="fuse-horizontal-navigation-menu-panel"
|
class="fuse-horizontal-navigation-menu-panel"
|
||||||
[overlapTrigger]="false"
|
[overlapTrigger]="false"
|
||||||
#matMenu="matMenu">
|
#matMenu="matMenu">
|
||||||
|
|
||||||
<ng-container *ngFor="let item of item.children">
|
<ng-container *ngFor="let item of item.children; trackBy: trackByFn">
|
||||||
|
|
||||||
<!-- Skip the hidden items -->
|
<!-- Skip the hidden items -->
|
||||||
<ng-container *ngIf="(item.hidden && !item.hidden(item)) || !item.hidden">
|
<ng-container *ngIf="(item.hidden && !item.hidden(item)) || !item.hidden">
|
||||||
|
|
||||||
<!-- Basic -->
|
<!-- Basic -->
|
||||||
<div
|
<ng-container *ngIf="item.type === 'basic'">
|
||||||
class="fuse-horizontal-navigation-menu-item"
|
<div
|
||||||
*ngIf="item.type === 'basic'"
|
class="fuse-horizontal-navigation-menu-item"
|
||||||
[disabled]="item.disabled"
|
[disabled]="item.disabled"
|
||||||
mat-menu-item>
|
mat-menu-item>
|
||||||
<fuse-horizontal-navigation-basic-item
|
<fuse-horizontal-navigation-basic-item
|
||||||
[item]="item"
|
[item]="item"
|
||||||
[name]="name"></fuse-horizontal-navigation-basic-item>
|
[name]="name"></fuse-horizontal-navigation-basic-item>
|
||||||
</div>
|
</div>
|
||||||
|
</ng-container>
|
||||||
|
|
||||||
<!-- Branch: aside, collapsable, group -->
|
<!-- Branch: aside, collapsable, group -->
|
||||||
<div
|
<ng-container *ngIf="item.type === 'aside' || item.type === 'collapsable' || item.type === 'group'">
|
||||||
class="fuse-horizontal-navigation-menu-item"
|
<div
|
||||||
*ngIf="item.type === 'aside' || item.type === 'collapsable' || item.type === 'group'"
|
class="fuse-horizontal-navigation-menu-item"
|
||||||
[disabled]="item.disabled"
|
[disabled]="item.disabled"
|
||||||
[matMenuTriggerFor]="branch.matMenu"
|
[matMenuTriggerFor]="branch.matMenu"
|
||||||
mat-menu-item>
|
mat-menu-item>
|
||||||
<ng-container *ngTemplateOutlet="itemTemplate; context: {$implicit: item}"></ng-container>
|
<ng-container *ngTemplateOutlet="itemTemplate; context: {$implicit: item}"></ng-container>
|
||||||
<fuse-horizontal-navigation-branch-item
|
<fuse-horizontal-navigation-branch-item
|
||||||
[child]="true"
|
[child]="true"
|
||||||
[item]="item"
|
[item]="item"
|
||||||
[name]="name"
|
[name]="name"
|
||||||
#branch></fuse-horizontal-navigation-branch-item>
|
#branch></fuse-horizontal-navigation-branch-item>
|
||||||
</div>
|
</div>
|
||||||
|
</ng-container>
|
||||||
|
|
||||||
<!-- Divider -->
|
<!-- Divider -->
|
||||||
<div
|
<ng-container *ngIf="item.type === 'divider'">
|
||||||
class="fuse-horizontal-navigation-menu-item"
|
<div
|
||||||
*ngIf="item.type === 'divider'"
|
class="fuse-horizontal-navigation-menu-item"
|
||||||
mat-menu-item>
|
mat-menu-item>
|
||||||
<fuse-horizontal-navigation-divider-item
|
<fuse-horizontal-navigation-divider-item
|
||||||
[item]="item"
|
[item]="item"
|
||||||
[name]="name"></fuse-horizontal-navigation-divider-item>
|
[name]="name"></fuse-horizontal-navigation-divider-item>
|
||||||
</div>
|
</div>
|
||||||
|
</ng-container>
|
||||||
|
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
@@ -74,14 +78,16 @@
|
|||||||
<div
|
<div
|
||||||
class="fuse-horizontal-navigation-item"
|
class="fuse-horizontal-navigation-item"
|
||||||
[ngClass]="{'fuse-horizontal-navigation-item-disabled': item.disabled,
|
[ngClass]="{'fuse-horizontal-navigation-item-disabled': item.disabled,
|
||||||
'fuse-horizontal-navigation-item-active-forced': item.active}">
|
'fuse-horizontal-navigation-item-active-forced': item.active}"
|
||||||
|
[matTooltip]="item.tooltip || ''">
|
||||||
|
|
||||||
<!-- Icon -->
|
<!-- Icon -->
|
||||||
<mat-icon
|
<ng-container *ngIf="item.icon">
|
||||||
class="fuse-horizontal-navigation-item-icon"
|
<mat-icon
|
||||||
[ngClass]="item.classes?.icon"
|
class="fuse-horizontal-navigation-item-icon"
|
||||||
*ngIf="item.icon"
|
[ngClass]="item.classes?.icon"
|
||||||
[svgIcon]="item.icon"></mat-icon>
|
[svgIcon]="item.icon"></mat-icon>
|
||||||
|
</ng-container>
|
||||||
|
|
||||||
<!-- Title & Subtitle -->
|
<!-- Title & Subtitle -->
|
||||||
<div class="fuse-horizontal-navigation-item-title-wrapper">
|
<div class="fuse-horizontal-navigation-item-title-wrapper">
|
||||||
@@ -90,25 +96,25 @@
|
|||||||
{{item.title}}
|
{{item.title}}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<ng-container *ngIf="item.subtitle">
|
||||||
class="fuse-horizontal-navigation-item-subtitle text-hint"
|
<div class="fuse-horizontal-navigation-item-subtitle text-hint">
|
||||||
*ngIf="item.subtitle">
|
<span [ngClass]="item.classes?.subtitle">
|
||||||
<span [ngClass]="item.classes?.subtitle">
|
{{item.subtitle}}
|
||||||
{{item.subtitle}}
|
</span>
|
||||||
</span>
|
</div>
|
||||||
</div>
|
</ng-container>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Badge -->
|
<!-- Badge -->
|
||||||
<div
|
<ng-container *ngIf="item.badge">
|
||||||
class="fuse-horizontal-navigation-item-badge"
|
<div class="fuse-horizontal-navigation-item-badge">
|
||||||
*ngIf="item.badge">
|
<div
|
||||||
<div
|
class="fuse-horizontal-navigation-item-badge-content"
|
||||||
class="fuse-horizontal-navigation-item-badge-content"
|
[ngClass]="item.badge.classes">
|
||||||
[ngClass]="item.badge.classes">
|
{{item.badge.title}}
|
||||||
{{item.badge.title}}
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</ng-container>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ import { FuseNavigationItem } from '@fuse/components/navigation/navigation.types
|
|||||||
@Component({
|
@Component({
|
||||||
selector : 'fuse-horizontal-navigation-branch-item',
|
selector : 'fuse-horizontal-navigation-branch-item',
|
||||||
templateUrl : './branch.component.html',
|
templateUrl : './branch.component.html',
|
||||||
styles : [],
|
|
||||||
changeDetection: ChangeDetectionStrategy.OnPush
|
changeDetection: ChangeDetectionStrategy.OnPush
|
||||||
})
|
})
|
||||||
export class FuseHorizontalNavigationBranchItemComponent implements OnInit, OnDestroy
|
export class FuseHorizontalNavigationBranchItemComponent implements OnInit, OnDestroy
|
||||||
@@ -81,4 +80,15 @@ export class FuseHorizontalNavigationBranchItemComponent implements OnInit, OnDe
|
|||||||
// Mark for check
|
// Mark for check
|
||||||
this._changeDetectorRef.markForCheck();
|
this._changeDetectorRef.markForCheck();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Track by function for ngFor loops
|
||||||
|
*
|
||||||
|
* @param index
|
||||||
|
* @param item
|
||||||
|
*/
|
||||||
|
trackByFn(index: number, item: any): any
|
||||||
|
{
|
||||||
|
return item.id || index;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ import { FuseNavigationItem } from '@fuse/components/navigation/navigation.types
|
|||||||
@Component({
|
@Component({
|
||||||
selector : 'fuse-horizontal-navigation-divider-item',
|
selector : 'fuse-horizontal-navigation-divider-item',
|
||||||
templateUrl : './divider.component.html',
|
templateUrl : './divider.component.html',
|
||||||
styles : [],
|
|
||||||
changeDetection: ChangeDetectionStrategy.OnPush
|
changeDetection: ChangeDetectionStrategy.OnPush
|
||||||
})
|
})
|
||||||
export class FuseHorizontalNavigationDividerItemComponent implements OnInit, OnDestroy
|
export class FuseHorizontalNavigationDividerItemComponent implements OnInit, OnDestroy
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ import { FuseNavigationItem } from '@fuse/components/navigation/navigation.types
|
|||||||
@Component({
|
@Component({
|
||||||
selector : 'fuse-horizontal-navigation-spacer-item',
|
selector : 'fuse-horizontal-navigation-spacer-item',
|
||||||
templateUrl : './spacer.component.html',
|
templateUrl : './spacer.component.html',
|
||||||
styles : [],
|
|
||||||
changeDetection: ChangeDetectionStrategy.OnPush
|
changeDetection: ChangeDetectionStrategy.OnPush
|
||||||
})
|
})
|
||||||
export class FuseHorizontalNavigationSpacerItemComponent implements OnInit, OnDestroy
|
export class FuseHorizontalNavigationSpacerItemComponent implements OnInit, OnDestroy
|
||||||
|
|||||||
@@ -1,30 +1,33 @@
|
|||||||
<div class="fuse-horizontal-navigation-wrapper">
|
<div class="fuse-horizontal-navigation-wrapper">
|
||||||
|
|
||||||
<ng-container *ngFor="let item of navigation">
|
<ng-container *ngFor="let item of navigation; trackBy: trackByFn">
|
||||||
|
|
||||||
<!-- Skip the hidden items -->
|
<!-- Skip the hidden items -->
|
||||||
<ng-container *ngIf="(item.hidden && !item.hidden(item)) || !item.hidden">
|
<ng-container *ngIf="(item.hidden && !item.hidden(item)) || !item.hidden">
|
||||||
|
|
||||||
<!-- Basic -->
|
<!-- Basic -->
|
||||||
<fuse-horizontal-navigation-basic-item
|
<ng-container *ngIf="item.type === 'basic'">
|
||||||
class="fuse-horizontal-navigation-menu-item"
|
<fuse-horizontal-navigation-basic-item
|
||||||
*ngIf="item.type === 'basic'"
|
class="fuse-horizontal-navigation-menu-item"
|
||||||
[item]="item"
|
[item]="item"
|
||||||
[name]="name"></fuse-horizontal-navigation-basic-item>
|
[name]="name"></fuse-horizontal-navigation-basic-item>
|
||||||
|
</ng-container>
|
||||||
|
|
||||||
<!-- Branch: aside, collapsable, group -->
|
<!-- Branch: aside, collapsable, group -->
|
||||||
<fuse-horizontal-navigation-branch-item
|
<ng-container *ngIf="item.type === 'aside' || item.type === 'collapsable' || item.type === 'group'">
|
||||||
class="fuse-horizontal-navigation-menu-item"
|
<fuse-horizontal-navigation-branch-item
|
||||||
*ngIf="item.type === 'aside' || item.type === 'collapsable' || item.type === 'group'"
|
class="fuse-horizontal-navigation-menu-item"
|
||||||
[item]="item"
|
[item]="item"
|
||||||
[name]="name"></fuse-horizontal-navigation-branch-item>
|
[name]="name"></fuse-horizontal-navigation-branch-item>
|
||||||
|
</ng-container>
|
||||||
|
|
||||||
<!-- Spacer -->
|
<!-- Spacer -->
|
||||||
<fuse-horizontal-navigation-spacer-item
|
<ng-container *ngIf="item.type === 'spacer'">
|
||||||
class="fuse-horizontal-navigation-menu-item"
|
<fuse-horizontal-navigation-spacer-item
|
||||||
*ngIf="item.type === 'spacer'"
|
class="fuse-horizontal-navigation-menu-item"
|
||||||
[item]="item"
|
[item]="item"
|
||||||
[name]="name"></fuse-horizontal-navigation-spacer-item>
|
[name]="name"></fuse-horizontal-navigation-spacer-item>
|
||||||
|
</ng-container>
|
||||||
|
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
|
|||||||
@@ -15,8 +15,15 @@ export interface FuseNavigationItem
|
|||||||
hidden?: (item: FuseNavigationItem) => boolean;
|
hidden?: (item: FuseNavigationItem) => boolean;
|
||||||
active?: boolean;
|
active?: boolean;
|
||||||
disabled?: boolean;
|
disabled?: boolean;
|
||||||
|
tooltip?: string;
|
||||||
link?: string;
|
link?: string;
|
||||||
externalLink?: boolean;
|
externalLink?: boolean;
|
||||||
|
target?:
|
||||||
|
| '_blank'
|
||||||
|
| '_self'
|
||||||
|
| '_parent'
|
||||||
|
| '_top'
|
||||||
|
| string;
|
||||||
exactMatch?: boolean;
|
exactMatch?: boolean;
|
||||||
isActiveMatchOptions?: IsActiveMatchOptions;
|
isActiveMatchOptions?: IsActiveMatchOptions;
|
||||||
function?: (item: FuseNavigationItem) => void;
|
function?: (item: FuseNavigationItem) => void;
|
||||||
|
|||||||
@@ -7,14 +7,16 @@
|
|||||||
class="fuse-vertical-navigation-item"
|
class="fuse-vertical-navigation-item"
|
||||||
[ngClass]="{'fuse-vertical-navigation-item-active': active,
|
[ngClass]="{'fuse-vertical-navigation-item-active': active,
|
||||||
'fuse-vertical-navigation-item-disabled': item.disabled,
|
'fuse-vertical-navigation-item-disabled': item.disabled,
|
||||||
'fuse-vertical-navigation-item-active-forced': item.active}">
|
'fuse-vertical-navigation-item-active-forced': item.active}"
|
||||||
|
[matTooltip]="item.tooltip || ''">
|
||||||
|
|
||||||
<!-- Icon -->
|
<!-- Icon -->
|
||||||
<mat-icon
|
<ng-container *ngIf="item.icon">
|
||||||
class="fuse-vertical-navigation-item-icon"
|
<mat-icon
|
||||||
[ngClass]="item.classes?.icon"
|
class="fuse-vertical-navigation-item-icon"
|
||||||
*ngIf="item.icon"
|
[ngClass]="item.classes?.icon"
|
||||||
[svgIcon]="item.icon"></mat-icon>
|
[svgIcon]="item.icon"></mat-icon>
|
||||||
|
</ng-container>
|
||||||
|
|
||||||
<!-- Title & Subtitle -->
|
<!-- Title & Subtitle -->
|
||||||
<div class="fuse-vertical-navigation-item-title-wrapper">
|
<div class="fuse-vertical-navigation-item-title-wrapper">
|
||||||
@@ -23,25 +25,25 @@
|
|||||||
{{item.title}}
|
{{item.title}}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<ng-container *ngIf="item.subtitle">
|
||||||
class="fuse-vertical-navigation-item-subtitle"
|
<div class="fuse-vertical-navigation-item-subtitle">
|
||||||
*ngIf="item.subtitle">
|
<span [ngClass]="item.classes?.subtitle">
|
||||||
<span [ngClass]="item.classes?.subtitle">
|
{{item.subtitle}}
|
||||||
{{item.subtitle}}
|
</span>
|
||||||
</span>
|
</div>
|
||||||
</div>
|
</ng-container>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Badge -->
|
<!-- Badge -->
|
||||||
<div
|
<ng-container *ngIf="item.badge">
|
||||||
class="fuse-vertical-navigation-item-badge"
|
<div class="fuse-vertical-navigation-item-badge">
|
||||||
*ngIf="item.badge">
|
<div
|
||||||
<div
|
class="fuse-vertical-navigation-item-badge-content"
|
||||||
class="fuse-vertical-navigation-item-badge-content"
|
[ngClass]="item.badge.classes">
|
||||||
[ngClass]="item.badge.classes">
|
{{item.badge.title}}
|
||||||
{{item.badge.title}}
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</ng-container>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -57,35 +59,40 @@
|
|||||||
<ng-container *ngIf="(item.hidden && !item.hidden(item)) || !item.hidden">
|
<ng-container *ngIf="(item.hidden && !item.hidden(item)) || !item.hidden">
|
||||||
|
|
||||||
<!-- Basic -->
|
<!-- Basic -->
|
||||||
<fuse-vertical-navigation-basic-item
|
<ng-container *ngIf="item.type === 'basic'">
|
||||||
*ngIf="item.type === 'basic'"
|
<fuse-vertical-navigation-basic-item
|
||||||
[item]="item"
|
[item]="item"
|
||||||
[name]="name"></fuse-vertical-navigation-basic-item>
|
[name]="name"></fuse-vertical-navigation-basic-item>
|
||||||
|
</ng-container>
|
||||||
|
|
||||||
<!-- Collapsable -->
|
<!-- Collapsable -->
|
||||||
<fuse-vertical-navigation-collapsable-item
|
<ng-container *ngIf="item.type === 'collapsable'">
|
||||||
*ngIf="item.type === 'collapsable'"
|
<fuse-vertical-navigation-collapsable-item
|
||||||
[item]="item"
|
[item]="item"
|
||||||
[name]="name"
|
[name]="name"
|
||||||
[autoCollapse]="autoCollapse"></fuse-vertical-navigation-collapsable-item>
|
[autoCollapse]="autoCollapse"></fuse-vertical-navigation-collapsable-item>
|
||||||
|
</ng-container>
|
||||||
|
|
||||||
<!-- Divider -->
|
<!-- Divider -->
|
||||||
<fuse-vertical-navigation-divider-item
|
<ng-container *ngIf="item.type === 'divider'">
|
||||||
*ngIf="item.type === 'divider'"
|
<fuse-vertical-navigation-divider-item
|
||||||
[item]="item"
|
[item]="item"
|
||||||
[name]="name"></fuse-vertical-navigation-divider-item>
|
[name]="name"></fuse-vertical-navigation-divider-item>
|
||||||
|
</ng-container>
|
||||||
|
|
||||||
<!-- Group -->
|
<!-- Group -->
|
||||||
<fuse-vertical-navigation-group-item
|
<ng-container *ngIf="item.type === 'group'">
|
||||||
*ngIf="item.type === 'group'"
|
<fuse-vertical-navigation-group-item
|
||||||
[item]="item"
|
[item]="item"
|
||||||
[name]="name"></fuse-vertical-navigation-group-item>
|
[name]="name"></fuse-vertical-navigation-group-item>
|
||||||
|
</ng-container>
|
||||||
|
|
||||||
<!-- Spacer -->
|
<!-- Spacer -->
|
||||||
<fuse-vertical-navigation-spacer-item
|
<ng-container *ngIf="item.type === 'spacer'">
|
||||||
*ngIf="item.type === 'spacer'"
|
<fuse-vertical-navigation-spacer-item
|
||||||
[item]="item"
|
[item]="item"
|
||||||
[name]="name"></fuse-vertical-navigation-spacer-item>
|
[name]="name"></fuse-vertical-navigation-spacer-item>
|
||||||
|
</ng-container>
|
||||||
|
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ import { FuseNavigationItem } from '@fuse/components/navigation/navigation.types
|
|||||||
@Component({
|
@Component({
|
||||||
selector : 'fuse-vertical-navigation-aside-item',
|
selector : 'fuse-vertical-navigation-aside-item',
|
||||||
templateUrl : './aside.component.html',
|
templateUrl : './aside.component.html',
|
||||||
styles : [],
|
|
||||||
changeDetection: ChangeDetectionStrategy.OnPush
|
changeDetection: ChangeDetectionStrategy.OnPush
|
||||||
})
|
})
|
||||||
export class FuseVerticalNavigationAsideItemComponent implements OnChanges, OnInit, OnDestroy
|
export class FuseVerticalNavigationAsideItemComponent implements OnChanges, OnInit, OnDestroy
|
||||||
|
|||||||
@@ -5,68 +5,84 @@
|
|||||||
[ngClass]="item.classes?.wrapper">
|
[ngClass]="item.classes?.wrapper">
|
||||||
|
|
||||||
<!-- Item with an internal link -->
|
<!-- Item with an internal link -->
|
||||||
<a
|
<ng-container *ngIf="item.link && !item.externalLink && !item.function && !item.disabled">
|
||||||
class="fuse-vertical-navigation-item"
|
<a
|
||||||
*ngIf="item.link && !item.externalLink && !item.function && !item.disabled"
|
class="fuse-vertical-navigation-item"
|
||||||
[ngClass]="{'fuse-vertical-navigation-item-active-forced': item.active}"
|
[ngClass]="{'fuse-vertical-navigation-item-active-forced': item.active}"
|
||||||
[routerLink]="[item.link]"
|
[routerLink]="[item.link]"
|
||||||
[routerLinkActive]="'fuse-vertical-navigation-item-active'"
|
[routerLinkActive]="'fuse-vertical-navigation-item-active'"
|
||||||
[routerLinkActiveOptions]="isActiveMatchOptions">
|
[routerLinkActiveOptions]="isActiveMatchOptions"
|
||||||
<ng-container *ngTemplateOutlet="itemTemplate"></ng-container>
|
[matTooltip]="item.tooltip || ''">
|
||||||
</a>
|
<ng-container *ngTemplateOutlet="itemTemplate"></ng-container>
|
||||||
|
</a>
|
||||||
|
</ng-container>
|
||||||
|
|
||||||
<!-- Item with an external link -->
|
<!-- Item with an external link -->
|
||||||
<a
|
<ng-container *ngIf="item.link && item.externalLink && !item.function && !item.disabled">
|
||||||
class="fuse-vertical-navigation-item"
|
<a
|
||||||
*ngIf="item.link && item.externalLink && !item.function && !item.disabled"
|
class="fuse-vertical-navigation-item"
|
||||||
[href]="item.link">
|
[href]="item.link"
|
||||||
<ng-container *ngTemplateOutlet="itemTemplate"></ng-container>
|
[target]="item.target || '_self'"
|
||||||
</a>
|
[matTooltip]="item.tooltip || ''">
|
||||||
|
<ng-container *ngTemplateOutlet="itemTemplate"></ng-container>
|
||||||
|
</a>
|
||||||
|
</ng-container>
|
||||||
|
|
||||||
<!-- Item with a function -->
|
<!-- Item with a function -->
|
||||||
<div
|
<ng-container *ngIf="!item.link && item.function && !item.disabled">
|
||||||
class="fuse-vertical-navigation-item"
|
<div
|
||||||
*ngIf="!item.link && item.function && !item.disabled"
|
class="fuse-vertical-navigation-item"
|
||||||
[ngClass]="{'fuse-vertical-navigation-item-active-forced': item.active}"
|
[ngClass]="{'fuse-vertical-navigation-item-active-forced': item.active}"
|
||||||
(click)="item.function(item)">
|
[matTooltip]="item.tooltip || ''"
|
||||||
<ng-container *ngTemplateOutlet="itemTemplate"></ng-container>
|
(click)="item.function(item)">
|
||||||
</div>
|
<ng-container *ngTemplateOutlet="itemTemplate"></ng-container>
|
||||||
|
</div>
|
||||||
|
</ng-container>
|
||||||
|
|
||||||
<!-- Item with an internal link and function -->
|
<!-- Item with an internal link and function -->
|
||||||
<a
|
<ng-container *ngIf="item.link && !item.externalLink && item.function && !item.disabled">
|
||||||
class="fuse-vertical-navigation-item"
|
<a
|
||||||
*ngIf="item.link && !item.externalLink && item.function && !item.disabled"
|
class="fuse-vertical-navigation-item"
|
||||||
[ngClass]="{'fuse-vertical-navigation-item-active-forced': item.active}"
|
[ngClass]="{'fuse-vertical-navigation-item-active-forced': item.active}"
|
||||||
[routerLink]="[item.link]"
|
[routerLink]="[item.link]"
|
||||||
[routerLinkActive]="'fuse-vertical-navigation-item-active'"
|
[routerLinkActive]="'fuse-vertical-navigation-item-active'"
|
||||||
[routerLinkActiveOptions]="isActiveMatchOptions"
|
[routerLinkActiveOptions]="isActiveMatchOptions"
|
||||||
(click)="item.function(item)">
|
[matTooltip]="item.tooltip || ''"
|
||||||
<ng-container *ngTemplateOutlet="itemTemplate"></ng-container>
|
(click)="item.function(item)">
|
||||||
</a>
|
<ng-container *ngTemplateOutlet="itemTemplate"></ng-container>
|
||||||
|
</a>
|
||||||
|
</ng-container>
|
||||||
|
|
||||||
<!-- Item with an external link and function -->
|
<!-- Item with an external link and function -->
|
||||||
<a
|
<ng-container *ngIf="item.link && item.externalLink && item.function && !item.disabled">
|
||||||
class="fuse-vertical-navigation-item"
|
<a
|
||||||
*ngIf="item.link && item.externalLink && item.function && !item.disabled"
|
class="fuse-vertical-navigation-item"
|
||||||
[href]="item.link"
|
[href]="item.link"
|
||||||
(click)="item.function(item)">
|
[target]="item.target || '_self'"
|
||||||
<ng-container *ngTemplateOutlet="itemTemplate"></ng-container>
|
[matTooltip]="item.tooltip || ''"
|
||||||
</a>
|
(click)="item.function(item)">
|
||||||
|
<ng-container *ngTemplateOutlet="itemTemplate"></ng-container>
|
||||||
|
</a>
|
||||||
|
</ng-container>
|
||||||
|
|
||||||
<!-- Item with a no link and no function -->
|
<!-- Item with a no link and no function -->
|
||||||
<div
|
<ng-container *ngIf="!item.link && !item.function && !item.disabled">
|
||||||
class="fuse-vertical-navigation-item"
|
<div
|
||||||
*ngIf="!item.link && !item.function && !item.disabled"
|
class="fuse-vertical-navigation-item"
|
||||||
[ngClass]="{'fuse-vertical-navigation-item-active-forced': item.active}">
|
[ngClass]="{'fuse-vertical-navigation-item-active-forced': item.active}"
|
||||||
<ng-container *ngTemplateOutlet="itemTemplate"></ng-container>
|
[matTooltip]="item.tooltip || ''">
|
||||||
</div>
|
<ng-container *ngTemplateOutlet="itemTemplate"></ng-container>
|
||||||
|
</div>
|
||||||
|
</ng-container>
|
||||||
|
|
||||||
<!-- Item is disabled -->
|
<!-- Item is disabled -->
|
||||||
<div
|
<ng-container *ngIf="item.disabled">
|
||||||
class="fuse-vertical-navigation-item fuse-vertical-navigation-item-disabled"
|
<div
|
||||||
*ngIf="item.disabled">
|
class="fuse-vertical-navigation-item fuse-vertical-navigation-item-disabled"
|
||||||
<ng-container *ngTemplateOutlet="itemTemplate"></ng-container>
|
[matTooltip]="item.tooltip || ''">
|
||||||
</div>
|
<ng-container *ngTemplateOutlet="itemTemplate"></ng-container>
|
||||||
|
</div>
|
||||||
|
</ng-container>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -74,11 +90,12 @@
|
|||||||
<ng-template #itemTemplate>
|
<ng-template #itemTemplate>
|
||||||
|
|
||||||
<!-- Icon -->
|
<!-- Icon -->
|
||||||
<mat-icon
|
<ng-container *ngIf="item.icon">
|
||||||
class="fuse-vertical-navigation-item-icon"
|
<mat-icon
|
||||||
[ngClass]="item.classes?.icon"
|
class="fuse-vertical-navigation-item-icon"
|
||||||
*ngIf="item.icon"
|
[ngClass]="item.classes?.icon"
|
||||||
[svgIcon]="item.icon"></mat-icon>
|
[svgIcon]="item.icon"></mat-icon>
|
||||||
|
</ng-container>
|
||||||
|
|
||||||
<!-- Title & Subtitle -->
|
<!-- Title & Subtitle -->
|
||||||
<div class="fuse-vertical-navigation-item-title-wrapper">
|
<div class="fuse-vertical-navigation-item-title-wrapper">
|
||||||
@@ -87,24 +104,24 @@
|
|||||||
{{item.title}}
|
{{item.title}}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<ng-container *ngIf="item.subtitle">
|
||||||
class="fuse-vertical-navigation-item-subtitle"
|
<div class="fuse-vertical-navigation-item-subtitle">
|
||||||
*ngIf="item.subtitle">
|
<span [ngClass]="item.classes?.subtitle">
|
||||||
<span [ngClass]="item.classes?.subtitle">
|
{{item.subtitle}}
|
||||||
{{item.subtitle}}
|
</span>
|
||||||
</span>
|
</div>
|
||||||
</div>
|
</ng-container>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Badge -->
|
<!-- Badge -->
|
||||||
<div
|
<ng-container *ngIf="item.badge">
|
||||||
class="fuse-vertical-navigation-item-badge"
|
<div class="fuse-vertical-navigation-item-badge">
|
||||||
*ngIf="item.badge">
|
<div
|
||||||
<div
|
class="fuse-vertical-navigation-item-badge-content"
|
||||||
class="fuse-vertical-navigation-item-badge-content"
|
[ngClass]="item.badge.classes">
|
||||||
[ngClass]="item.badge.classes">
|
{{item.badge.title}}
|
||||||
{{item.badge.title}}
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</ng-container>
|
||||||
|
|
||||||
</ng-template>
|
</ng-template>
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ import { FuseUtilsService } from '@fuse/services/utils/utils.service';
|
|||||||
@Component({
|
@Component({
|
||||||
selector : 'fuse-vertical-navigation-basic-item',
|
selector : 'fuse-vertical-navigation-basic-item',
|
||||||
templateUrl : './basic.component.html',
|
templateUrl : './basic.component.html',
|
||||||
styles : [],
|
|
||||||
changeDetection: ChangeDetectionStrategy.OnPush
|
changeDetection: ChangeDetectionStrategy.OnPush
|
||||||
})
|
})
|
||||||
export class FuseVerticalNavigationBasicItemComponent implements OnInit, OnDestroy
|
export class FuseVerticalNavigationBasicItemComponent implements OnInit, OnDestroy
|
||||||
|
|||||||
@@ -6,14 +6,16 @@
|
|||||||
<div
|
<div
|
||||||
class="fuse-vertical-navigation-item"
|
class="fuse-vertical-navigation-item"
|
||||||
[ngClass]="{'fuse-vertical-navigation-item-disabled': item.disabled}"
|
[ngClass]="{'fuse-vertical-navigation-item-disabled': item.disabled}"
|
||||||
|
[matTooltip]="item.tooltip || ''"
|
||||||
(click)="toggleCollapsable()">
|
(click)="toggleCollapsable()">
|
||||||
|
|
||||||
<!-- Icon -->
|
<!-- Icon -->
|
||||||
<mat-icon
|
<ng-container *ngIf="item.icon">
|
||||||
class="fuse-vertical-navigation-item-icon"
|
<mat-icon
|
||||||
[ngClass]="item.classes?.icon"
|
class="fuse-vertical-navigation-item-icon"
|
||||||
*ngIf="item.icon"
|
[ngClass]="item.classes?.icon"
|
||||||
[svgIcon]="item.icon"></mat-icon>
|
[svgIcon]="item.icon"></mat-icon>
|
||||||
|
</ng-container>
|
||||||
|
|
||||||
<!-- Title & Subtitle -->
|
<!-- Title & Subtitle -->
|
||||||
<div class="fuse-vertical-navigation-item-title-wrapper">
|
<div class="fuse-vertical-navigation-item-title-wrapper">
|
||||||
@@ -22,25 +24,25 @@
|
|||||||
{{item.title}}
|
{{item.title}}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<ng-container *ngIf="item.subtitle">
|
||||||
class="fuse-vertical-navigation-item-subtitle"
|
<div class="fuse-vertical-navigation-item-subtitle">
|
||||||
*ngIf="item.subtitle">
|
<span [ngClass]="item.classes?.subtitle">
|
||||||
<span [ngClass]="item.classes?.subtitle">
|
{{item.subtitle}}
|
||||||
{{item.subtitle}}
|
</span>
|
||||||
</span>
|
</div>
|
||||||
</div>
|
</ng-container>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Badge -->
|
<!-- Badge -->
|
||||||
<div
|
<ng-container *ngIf="item.badge">
|
||||||
class="fuse-vertical-navigation-item-badge"
|
<div class="fuse-vertical-navigation-item-badge">
|
||||||
*ngIf="item.badge">
|
<div
|
||||||
<div
|
class="fuse-vertical-navigation-item-badge-content"
|
||||||
class="fuse-vertical-navigation-item-badge-content"
|
[ngClass]="item.badge.classes">
|
||||||
[ngClass]="item.badge.classes">
|
{{item.badge.title}}
|
||||||
{{item.badge.title}}
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</ng-container>
|
||||||
|
|
||||||
<!-- Arrow -->
|
<!-- Arrow -->
|
||||||
<mat-icon
|
<mat-icon
|
||||||
@@ -62,35 +64,40 @@
|
|||||||
<ng-container *ngIf="(item.hidden && !item.hidden(item)) || !item.hidden">
|
<ng-container *ngIf="(item.hidden && !item.hidden(item)) || !item.hidden">
|
||||||
|
|
||||||
<!-- Basic -->
|
<!-- Basic -->
|
||||||
<fuse-vertical-navigation-basic-item
|
<ng-container *ngIf="item.type === 'basic'">
|
||||||
*ngIf="item.type === 'basic'"
|
<fuse-vertical-navigation-basic-item
|
||||||
[item]="item"
|
[item]="item"
|
||||||
[name]="name"></fuse-vertical-navigation-basic-item>
|
[name]="name"></fuse-vertical-navigation-basic-item>
|
||||||
|
</ng-container>
|
||||||
|
|
||||||
<!-- Collapsable -->
|
<!-- Collapsable -->
|
||||||
<fuse-vertical-navigation-collapsable-item
|
<ng-container *ngIf="item.type === 'collapsable'">
|
||||||
*ngIf="item.type === 'collapsable'"
|
<fuse-vertical-navigation-collapsable-item
|
||||||
[item]="item"
|
[item]="item"
|
||||||
[name]="name"
|
[name]="name"
|
||||||
[autoCollapse]="autoCollapse"></fuse-vertical-navigation-collapsable-item>
|
[autoCollapse]="autoCollapse"></fuse-vertical-navigation-collapsable-item>
|
||||||
|
</ng-container>
|
||||||
|
|
||||||
<!-- Divider -->
|
<!-- Divider -->
|
||||||
<fuse-vertical-navigation-divider-item
|
<ng-container *ngIf="item.type === 'divider'">
|
||||||
*ngIf="item.type === 'divider'"
|
<fuse-vertical-navigation-divider-item
|
||||||
[item]="item"
|
[item]="item"
|
||||||
[name]="name"></fuse-vertical-navigation-divider-item>
|
[name]="name"></fuse-vertical-navigation-divider-item>
|
||||||
|
</ng-container>
|
||||||
|
|
||||||
<!-- Group -->
|
<!-- Group -->
|
||||||
<fuse-vertical-navigation-group-item
|
<ng-container *ngIf="item.type === 'group'">
|
||||||
*ngIf="item.type === 'group'"
|
<fuse-vertical-navigation-group-item
|
||||||
[item]="item"
|
[item]="item"
|
||||||
[name]="name"></fuse-vertical-navigation-group-item>
|
[name]="name"></fuse-vertical-navigation-group-item>
|
||||||
|
</ng-container>
|
||||||
|
|
||||||
<!-- Spacer -->
|
<!-- Spacer -->
|
||||||
<fuse-vertical-navigation-spacer-item
|
<ng-container *ngIf="item.type === 'spacer'">
|
||||||
*ngIf="item.type === 'spacer'"
|
<fuse-vertical-navigation-spacer-item
|
||||||
[item]="item"
|
[item]="item"
|
||||||
[name]="name"></fuse-vertical-navigation-spacer-item>
|
[name]="name"></fuse-vertical-navigation-spacer-item>
|
||||||
|
</ng-container>
|
||||||
|
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ import { FuseNavigationItem } from '@fuse/components/navigation/navigation.types
|
|||||||
@Component({
|
@Component({
|
||||||
selector : 'fuse-vertical-navigation-collapsable-item',
|
selector : 'fuse-vertical-navigation-collapsable-item',
|
||||||
templateUrl : './collapsable.component.html',
|
templateUrl : './collapsable.component.html',
|
||||||
styles : [],
|
|
||||||
animations : fuseAnimations,
|
animations : fuseAnimations,
|
||||||
changeDetection: ChangeDetectionStrategy.OnPush
|
changeDetection: ChangeDetectionStrategy.OnPush
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ import { FuseNavigationItem } from '@fuse/components/navigation/navigation.types
|
|||||||
@Component({
|
@Component({
|
||||||
selector : 'fuse-vertical-navigation-divider-item',
|
selector : 'fuse-vertical-navigation-divider-item',
|
||||||
templateUrl : './divider.component.html',
|
templateUrl : './divider.component.html',
|
||||||
styles : [],
|
|
||||||
changeDetection: ChangeDetectionStrategy.OnPush
|
changeDetection: ChangeDetectionStrategy.OnPush
|
||||||
})
|
})
|
||||||
export class FuseVerticalNavigationDividerItemComponent implements OnInit, OnDestroy
|
export class FuseVerticalNavigationDividerItemComponent implements OnInit, OnDestroy
|
||||||
|
|||||||
@@ -7,11 +7,12 @@
|
|||||||
<div class="fuse-vertical-navigation-item">
|
<div class="fuse-vertical-navigation-item">
|
||||||
|
|
||||||
<!-- Icon -->
|
<!-- Icon -->
|
||||||
<mat-icon
|
<ng-container *ngIf="item.icon">
|
||||||
class="fuse-vertical-navigation-item-icon"
|
<mat-icon
|
||||||
[ngClass]="item.classes?.icon"
|
class="fuse-vertical-navigation-item-icon"
|
||||||
*ngIf="item.icon"
|
[ngClass]="item.classes?.icon"
|
||||||
[svgIcon]="item.icon"></mat-icon>
|
[svgIcon]="item.icon"></mat-icon>
|
||||||
|
</ng-container>
|
||||||
|
|
||||||
<!-- Title & Subtitle -->
|
<!-- Title & Subtitle -->
|
||||||
<div class="fuse-vertical-navigation-item-title-wrapper">
|
<div class="fuse-vertical-navigation-item-title-wrapper">
|
||||||
@@ -20,25 +21,25 @@
|
|||||||
{{item.title}}
|
{{item.title}}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<ng-container *ngIf="item.subtitle">
|
||||||
class="fuse-vertical-navigation-item-subtitle"
|
<div class="fuse-vertical-navigation-item-subtitle">
|
||||||
*ngIf="item.subtitle">
|
<span [ngClass]="item.classes?.subtitle">
|
||||||
<span [ngClass]="item.classes?.subtitle">
|
{{item.subtitle}}
|
||||||
{{item.subtitle}}
|
</span>
|
||||||
</span>
|
</div>
|
||||||
</div>
|
</ng-container>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Badge -->
|
<!-- Badge -->
|
||||||
<div
|
<ng-container *ngIf="item.badge">
|
||||||
class="fuse-vertical-navigation-item-badge"
|
<div class="fuse-vertical-navigation-item-badge">
|
||||||
*ngIf="item.badge">
|
<div
|
||||||
<div
|
class="fuse-vertical-navigation-item-badge-content"
|
||||||
class="fuse-vertical-navigation-item-badge-content"
|
[ngClass]="item.badge.classes">
|
||||||
[ngClass]="item.badge.classes">
|
{{item.badge.title}}
|
||||||
{{item.badge.title}}
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</ng-container>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -50,35 +51,40 @@
|
|||||||
<ng-container *ngIf="(item.hidden && !item.hidden(item)) || !item.hidden">
|
<ng-container *ngIf="(item.hidden && !item.hidden(item)) || !item.hidden">
|
||||||
|
|
||||||
<!-- Basic -->
|
<!-- Basic -->
|
||||||
<fuse-vertical-navigation-basic-item
|
<ng-container *ngIf="item.type === 'basic'">
|
||||||
*ngIf="item.type === 'basic'"
|
<fuse-vertical-navigation-basic-item
|
||||||
[item]="item"
|
[item]="item"
|
||||||
[name]="name"></fuse-vertical-navigation-basic-item>
|
[name]="name"></fuse-vertical-navigation-basic-item>
|
||||||
|
</ng-container>
|
||||||
|
|
||||||
<!-- Collapsable -->
|
<!-- Collapsable -->
|
||||||
<fuse-vertical-navigation-collapsable-item
|
<ng-container *ngIf="item.type === 'collapsable'">
|
||||||
*ngIf="item.type === 'collapsable'"
|
<fuse-vertical-navigation-collapsable-item
|
||||||
[item]="item"
|
[item]="item"
|
||||||
[name]="name"
|
[name]="name"
|
||||||
[autoCollapse]="autoCollapse"></fuse-vertical-navigation-collapsable-item>
|
[autoCollapse]="autoCollapse"></fuse-vertical-navigation-collapsable-item>
|
||||||
|
</ng-container>
|
||||||
|
|
||||||
<!-- Divider -->
|
<!-- Divider -->
|
||||||
<fuse-vertical-navigation-divider-item
|
<ng-container *ngIf="item.type === 'divider'">
|
||||||
*ngIf="item.type === 'divider'"
|
<fuse-vertical-navigation-divider-item
|
||||||
[item]="item"
|
[item]="item"
|
||||||
[name]="name"></fuse-vertical-navigation-divider-item>
|
[name]="name"></fuse-vertical-navigation-divider-item>
|
||||||
|
</ng-container>
|
||||||
|
|
||||||
<!-- Group -->
|
<!-- Group -->
|
||||||
<fuse-vertical-navigation-group-item
|
<ng-container *ngIf="item.type === 'group'">
|
||||||
*ngIf="item.type === 'group'"
|
<fuse-vertical-navigation-group-item
|
||||||
[item]="item"
|
[item]="item"
|
||||||
[name]="name"></fuse-vertical-navigation-group-item>
|
[name]="name"></fuse-vertical-navigation-group-item>
|
||||||
|
</ng-container>
|
||||||
|
|
||||||
<!-- Spacer -->
|
<!-- Spacer -->
|
||||||
<fuse-vertical-navigation-spacer-item
|
<ng-container *ngIf="item.type === 'spacer'">
|
||||||
*ngIf="item.type === 'spacer'"
|
<fuse-vertical-navigation-spacer-item
|
||||||
[item]="item"
|
[item]="item"
|
||||||
[name]="name"></fuse-vertical-navigation-spacer-item>
|
[name]="name"></fuse-vertical-navigation-spacer-item>
|
||||||
|
</ng-container>
|
||||||
|
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ import { FuseNavigationItem } from '@fuse/components/navigation/navigation.types
|
|||||||
@Component({
|
@Component({
|
||||||
selector : 'fuse-vertical-navigation-group-item',
|
selector : 'fuse-vertical-navigation-group-item',
|
||||||
templateUrl : './group.component.html',
|
templateUrl : './group.component.html',
|
||||||
styles : [],
|
|
||||||
changeDetection: ChangeDetectionStrategy.OnPush
|
changeDetection: ChangeDetectionStrategy.OnPush
|
||||||
})
|
})
|
||||||
export class FuseVerticalNavigationGroupItemComponent implements OnInit, OnDestroy
|
export class FuseVerticalNavigationGroupItemComponent implements OnInit, OnDestroy
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ import { FuseNavigationItem } from '@fuse/components/navigation/navigation.types
|
|||||||
@Component({
|
@Component({
|
||||||
selector : 'fuse-vertical-navigation-spacer-item',
|
selector : 'fuse-vertical-navigation-spacer-item',
|
||||||
templateUrl : './spacer.component.html',
|
templateUrl : './spacer.component.html',
|
||||||
styles : [],
|
|
||||||
changeDetection: ChangeDetectionStrategy.OnPush
|
changeDetection: ChangeDetectionStrategy.OnPush
|
||||||
})
|
})
|
||||||
export class FuseVerticalNavigationSpacerItemComponent implements OnInit, OnDestroy
|
export class FuseVerticalNavigationSpacerItemComponent implements OnInit, OnDestroy
|
||||||
|
|||||||
@@ -335,6 +335,7 @@ fuse-vertical-navigation {
|
|||||||
}
|
}
|
||||||
|
|
||||||
> .fuse-vertical-navigation-item-children {
|
> .fuse-vertical-navigation-item-children {
|
||||||
|
margin-top: 6px;
|
||||||
|
|
||||||
> *:last-child {
|
> *:last-child {
|
||||||
padding-bottom: 6px;
|
padding-bottom: 6px;
|
||||||
|
|||||||
@@ -24,46 +24,52 @@
|
|||||||
<ng-container *ngIf="(item.hidden && !item.hidden(item)) || !item.hidden">
|
<ng-container *ngIf="(item.hidden && !item.hidden(item)) || !item.hidden">
|
||||||
|
|
||||||
<!-- Aside -->
|
<!-- Aside -->
|
||||||
<fuse-vertical-navigation-aside-item
|
<ng-container *ngIf="item.type === 'aside'">
|
||||||
*ngIf="item.type === 'aside'"
|
<fuse-vertical-navigation-aside-item
|
||||||
[item]="item"
|
[item]="item"
|
||||||
[name]="name"
|
[name]="name"
|
||||||
[activeItemId]="activeAsideItemId"
|
[activeItemId]="activeAsideItemId"
|
||||||
[autoCollapse]="autoCollapse"
|
[autoCollapse]="autoCollapse"
|
||||||
[skipChildren]="true"
|
[skipChildren]="true"
|
||||||
(click)="toggleAside(item)"></fuse-vertical-navigation-aside-item>
|
(click)="toggleAside(item)"></fuse-vertical-navigation-aside-item>
|
||||||
|
</ng-container>
|
||||||
|
|
||||||
<!-- Basic -->
|
<!-- Basic -->
|
||||||
<fuse-vertical-navigation-basic-item
|
<ng-container *ngIf="item.type === 'basic'">
|
||||||
*ngIf="item.type === 'basic'"
|
<fuse-vertical-navigation-basic-item
|
||||||
[item]="item"
|
[item]="item"
|
||||||
[name]="name"></fuse-vertical-navigation-basic-item>
|
[name]="name"></fuse-vertical-navigation-basic-item>
|
||||||
|
</ng-container>
|
||||||
|
|
||||||
<!-- Collapsable -->
|
<!-- Collapsable -->
|
||||||
<fuse-vertical-navigation-collapsable-item
|
<ng-container *ngIf="item.type === 'collapsable'">
|
||||||
*ngIf="item.type === 'collapsable'"
|
<fuse-vertical-navigation-collapsable-item
|
||||||
[item]="item"
|
[item]="item"
|
||||||
[name]="name"
|
[name]="name"
|
||||||
[autoCollapse]="autoCollapse"></fuse-vertical-navigation-collapsable-item>
|
[autoCollapse]="autoCollapse"></fuse-vertical-navigation-collapsable-item>
|
||||||
|
</ng-container>
|
||||||
|
|
||||||
<!-- Divider -->
|
<!-- Divider -->
|
||||||
<fuse-vertical-navigation-divider-item
|
<ng-container *ngIf="item.type === 'divider'">
|
||||||
*ngIf="item.type === 'divider'"
|
<fuse-vertical-navigation-divider-item
|
||||||
[item]="item"
|
[item]="item"
|
||||||
[name]="name"></fuse-vertical-navigation-divider-item>
|
[name]="name"></fuse-vertical-navigation-divider-item>
|
||||||
|
</ng-container>
|
||||||
|
|
||||||
<!-- Group -->
|
<!-- Group -->
|
||||||
<fuse-vertical-navigation-group-item
|
<ng-container *ngIf="item.type === 'group'">
|
||||||
*ngIf="item.type === 'group'"
|
<fuse-vertical-navigation-group-item
|
||||||
[item]="item"
|
[item]="item"
|
||||||
[name]="name"
|
[name]="name"
|
||||||
[autoCollapse]="autoCollapse"></fuse-vertical-navigation-group-item>
|
[autoCollapse]="autoCollapse"></fuse-vertical-navigation-group-item>
|
||||||
|
</ng-container>
|
||||||
|
|
||||||
<!-- Spacer -->
|
<!-- Spacer -->
|
||||||
<fuse-vertical-navigation-spacer-item
|
<ng-container *ngIf="item.type === 'spacer'">
|
||||||
*ngIf="item.type === 'spacer'"
|
<fuse-vertical-navigation-spacer-item
|
||||||
[item]="item"
|
[item]="item"
|
||||||
[name]="name"></fuse-vertical-navigation-spacer-item>
|
[name]="name"></fuse-vertical-navigation-spacer-item>
|
||||||
|
</ng-container>
|
||||||
|
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
@@ -84,31 +90,33 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Aside -->
|
<!-- Aside -->
|
||||||
<div
|
<ng-container *ngIf="activeAsideItemId">
|
||||||
class="fuse-vertical-navigation-aside-wrapper"
|
<div
|
||||||
*ngIf="activeAsideItemId"
|
class="fuse-vertical-navigation-aside-wrapper"
|
||||||
fuseScrollbar
|
fuseScrollbar
|
||||||
[fuseScrollbarOptions]="{wheelPropagation: false, suppressScrollX: true}"
|
[fuseScrollbarOptions]="{wheelPropagation: false, suppressScrollX: true}"
|
||||||
[@fadeInLeft]="position === 'left'"
|
[@fadeInLeft]="position === 'left'"
|
||||||
[@fadeInRight]="position === 'right'"
|
[@fadeInRight]="position === 'right'"
|
||||||
[@fadeOutLeft]="position === 'left'"
|
[@fadeOutLeft]="position === 'left'"
|
||||||
[@fadeOutRight]="position === 'right'">
|
[@fadeOutRight]="position === 'right'">
|
||||||
|
|
||||||
<!-- Items -->
|
<!-- Items -->
|
||||||
<ng-container *ngFor="let item of navigation; trackBy: trackByFn">
|
<ng-container *ngFor="let item of navigation; trackBy: trackByFn">
|
||||||
|
|
||||||
<!-- Skip the hidden items -->
|
<!-- Skip the hidden items -->
|
||||||
<ng-container *ngIf="(item.hidden && !item.hidden(item)) || !item.hidden">
|
<ng-container *ngIf="(item.hidden && !item.hidden(item)) || !item.hidden">
|
||||||
|
|
||||||
<!-- Aside -->
|
<!-- Aside -->
|
||||||
<fuse-vertical-navigation-aside-item
|
<ng-container *ngIf="item.type === 'aside' && item.id === activeAsideItemId">
|
||||||
*ngIf="item.type === 'aside' && item.id === activeAsideItemId"
|
<fuse-vertical-navigation-aside-item
|
||||||
[item]="item"
|
[item]="item"
|
||||||
[name]="name"
|
[name]="name"
|
||||||
[autoCollapse]="autoCollapse"></fuse-vertical-navigation-aside-item>
|
[autoCollapse]="autoCollapse"></fuse-vertical-navigation-aside-item>
|
||||||
|
</ng-container>
|
||||||
|
|
||||||
|
</ng-container>
|
||||||
|
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
</ng-container>
|
</div>
|
||||||
|
</ng-container>
|
||||||
</div>
|
|
||||||
|
|||||||
@@ -374,6 +374,10 @@ export class FuseVerticalNavigationComponent implements OnChanges, OnInit, After
|
|||||||
*/
|
*/
|
||||||
ngOnDestroy(): void
|
ngOnDestroy(): void
|
||||||
{
|
{
|
||||||
|
// Forcefully close the navigation and aside in case they are opened
|
||||||
|
this.close();
|
||||||
|
this.closeAside();
|
||||||
|
|
||||||
// Deregister the navigation component from the registry
|
// Deregister the navigation component from the registry
|
||||||
this._fuseNavigationService.deregisterComponent(this.name);
|
this._fuseNavigationService.deregisterComponent(this.name);
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
import { NgModule, Optional, SkipSelf } from '@angular/core';
|
import { NgModule, Optional, SkipSelf } from '@angular/core';
|
||||||
|
import { MATERIAL_SANITY_CHECKS } from '@angular/material/core';
|
||||||
import { MAT_FORM_FIELD_DEFAULT_OPTIONS } from '@angular/material/form-field';
|
import { MAT_FORM_FIELD_DEFAULT_OPTIONS } from '@angular/material/form-field';
|
||||||
|
import { FuseConfirmationModule } from '@fuse/services/confirmation';
|
||||||
import { FuseMediaWatcherModule } from '@fuse/services/media-watcher/media-watcher.module';
|
import { FuseMediaWatcherModule } from '@fuse/services/media-watcher/media-watcher.module';
|
||||||
import { FuseSplashScreenModule } from '@fuse/services/splash-screen/splash-screen.module';
|
import { FuseSplashScreenModule } from '@fuse/services/splash-screen/splash-screen.module';
|
||||||
import { FuseTailwindConfigModule } from '@fuse/services/tailwind/tailwind.module';
|
import { FuseTailwindConfigModule } from '@fuse/services/tailwind/tailwind.module';
|
||||||
@@ -7,12 +9,22 @@ import { FuseUtilsModule } from '@fuse/services/utils/utils.module';
|
|||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports : [
|
imports : [
|
||||||
|
FuseConfirmationModule,
|
||||||
FuseMediaWatcherModule,
|
FuseMediaWatcherModule,
|
||||||
FuseSplashScreenModule,
|
FuseSplashScreenModule,
|
||||||
FuseTailwindConfigModule,
|
FuseTailwindConfigModule,
|
||||||
FuseUtilsModule
|
FuseUtilsModule
|
||||||
],
|
],
|
||||||
providers: [
|
providers: [
|
||||||
|
{
|
||||||
|
// Disable 'theme' sanity check
|
||||||
|
provide : MATERIAL_SANITY_CHECKS,
|
||||||
|
useValue: {
|
||||||
|
doctype: true,
|
||||||
|
theme : false,
|
||||||
|
version: true
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
// Use the 'fill' appearance on Angular Material form fields by default
|
// Use the 'fill' appearance on Angular Material form fields by default
|
||||||
provide : MAT_FORM_FIELD_DEFAULT_OPTIONS,
|
provide : MAT_FORM_FIELD_DEFAULT_OPTIONS,
|
||||||
|
|||||||
31
src/@fuse/services/confirmation/confirmation.module.ts
Normal file
31
src/@fuse/services/confirmation/confirmation.module.ts
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
import { NgModule } from '@angular/core';
|
||||||
|
import { MatButtonModule } from '@angular/material/button';
|
||||||
|
import { MatDialogModule } from '@angular/material/dialog';
|
||||||
|
import { MatIconModule } from '@angular/material/icon';
|
||||||
|
import { FuseConfirmationService } from '@fuse/services/confirmation/confirmation.service';
|
||||||
|
import { FuseConfirmationDialogComponent } from '@fuse/services/confirmation/dialog/dialog.component';
|
||||||
|
import { CommonModule } from '@angular/common';
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
declarations: [
|
||||||
|
FuseConfirmationDialogComponent
|
||||||
|
],
|
||||||
|
imports: [
|
||||||
|
MatButtonModule,
|
||||||
|
MatDialogModule,
|
||||||
|
MatIconModule,
|
||||||
|
CommonModule
|
||||||
|
],
|
||||||
|
providers : [
|
||||||
|
FuseConfirmationService
|
||||||
|
]
|
||||||
|
})
|
||||||
|
export class FuseConfirmationModule
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Constructor
|
||||||
|
*/
|
||||||
|
constructor(private _fuseConfirmationService: FuseConfirmationService)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
58
src/@fuse/services/confirmation/confirmation.service.ts
Normal file
58
src/@fuse/services/confirmation/confirmation.service.ts
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
import { MatDialog, MatDialogRef } from '@angular/material/dialog';
|
||||||
|
import { merge } from 'lodash-es';
|
||||||
|
import { FuseConfirmationDialogComponent } from '@fuse/services/confirmation/dialog/dialog.component';
|
||||||
|
import { FuseConfirmationConfig } from '@fuse/services/confirmation/confirmation.types';
|
||||||
|
|
||||||
|
@Injectable()
|
||||||
|
export class FuseConfirmationService
|
||||||
|
{
|
||||||
|
private _defaultConfig: FuseConfirmationConfig = {
|
||||||
|
title : 'Confirm action',
|
||||||
|
message : 'Are you sure you want to confirm this action?',
|
||||||
|
icon : {
|
||||||
|
show : true,
|
||||||
|
name : 'heroicons_outline:exclamation',
|
||||||
|
color: 'warn'
|
||||||
|
},
|
||||||
|
actions : {
|
||||||
|
confirm: {
|
||||||
|
show : true,
|
||||||
|
label: 'Confirm',
|
||||||
|
color: 'warn'
|
||||||
|
},
|
||||||
|
cancel : {
|
||||||
|
show : true,
|
||||||
|
label: 'Cancel'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
dismissible: false
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor
|
||||||
|
*/
|
||||||
|
constructor(
|
||||||
|
private _matDialog: MatDialog
|
||||||
|
)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------------------------------
|
||||||
|
// @ Public methods
|
||||||
|
// -----------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
open(config: FuseConfirmationConfig = {}): MatDialogRef<FuseConfirmationDialogComponent>
|
||||||
|
{
|
||||||
|
// Merge the user config with the default config
|
||||||
|
const userConfig = merge({}, this._defaultConfig, config);
|
||||||
|
|
||||||
|
// Open the dialog
|
||||||
|
return this._matDialog.open(FuseConfirmationDialogComponent, {
|
||||||
|
autoFocus : false,
|
||||||
|
disableClose: !userConfig.dismissible,
|
||||||
|
data : userConfig,
|
||||||
|
panelClass : 'fuse-confirmation-dialog-panel'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
22
src/@fuse/services/confirmation/confirmation.types.ts
Normal file
22
src/@fuse/services/confirmation/confirmation.types.ts
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
export interface FuseConfirmationConfig
|
||||||
|
{
|
||||||
|
title?: string;
|
||||||
|
message?: string;
|
||||||
|
icon?: {
|
||||||
|
show?: boolean;
|
||||||
|
name?: string;
|
||||||
|
color?: 'primary' | 'accent' | 'warn' | 'basic' | 'info' | 'success' | 'warning' | 'error';
|
||||||
|
};
|
||||||
|
actions?: {
|
||||||
|
confirm?: {
|
||||||
|
show?: boolean;
|
||||||
|
label?: string;
|
||||||
|
color?: 'primary' | 'accent' | 'warn';
|
||||||
|
};
|
||||||
|
cancel?: {
|
||||||
|
show?: boolean;
|
||||||
|
label?: string;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
dismissible?: boolean;
|
||||||
|
}
|
||||||
85
src/@fuse/services/confirmation/dialog/dialog.component.html
Normal file
85
src/@fuse/services/confirmation/dialog/dialog.component.html
Normal file
@@ -0,0 +1,85 @@
|
|||||||
|
<div class="relative flex flex-col w-full h-full">
|
||||||
|
|
||||||
|
<!-- Dismiss button -->
|
||||||
|
<ng-container *ngIf="data.dismissible">
|
||||||
|
<div class="absolute top-0 right-0 pt-4 pr-4">
|
||||||
|
<button
|
||||||
|
mat-icon-button
|
||||||
|
[matDialogClose]="undefined">
|
||||||
|
<mat-icon
|
||||||
|
class="text-secondary"
|
||||||
|
[svgIcon]="'heroicons_outline:x'"></mat-icon>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</ng-container>
|
||||||
|
|
||||||
|
<!-- Content -->
|
||||||
|
<div class="flex flex-col sm:flex-row flex-auto items-center sm:items-start p-8 pb-6 sm:pb-8">
|
||||||
|
|
||||||
|
<!-- Icon -->
|
||||||
|
<ng-container *ngIf="data.icon.show">
|
||||||
|
<div
|
||||||
|
class="flex flex-0 items-center justify-center w-10 h-10 sm:mr-4 rounded-full"
|
||||||
|
[ngClass]="{'text-primary-600 bg-primary-100 dark:text-primary-50 dark:bg-primary-600': data.icon.color === 'primary',
|
||||||
|
'text-accent-600 bg-accent-100 dark:text-accent-50 dark:bg-accent-600': data.icon.color === 'accent',
|
||||||
|
'text-warn-600 bg-warn-100 dark:text-warn-50 dark:bg-warn-600': data.icon.color === 'warn',
|
||||||
|
'text-gray-600 bg-gray-100 dark:text-gray-50 dark:bg-gray-600': data.icon.color === 'basic',
|
||||||
|
'text-blue-600 bg-blue-100 dark:text-blue-50 dark:bg-blue-600': data.icon.color === 'info',
|
||||||
|
'text-green-500 bg-green-100 dark:text-green-50 dark:bg-green-500': data.icon.color === 'success',
|
||||||
|
'text-amber-500 bg-amber-100 dark:text-amber-50 dark:bg-amber-500': data.icon.color === 'warning',
|
||||||
|
'text-red-600 bg-red-100 dark:text-red-50 dark:bg-red-600': data.icon.color === 'error'
|
||||||
|
}">
|
||||||
|
<mat-icon
|
||||||
|
class="text-current"
|
||||||
|
[svgIcon]="data.icon.name"></mat-icon>
|
||||||
|
</div>
|
||||||
|
</ng-container>
|
||||||
|
|
||||||
|
<ng-container *ngIf="data.title || data.message">
|
||||||
|
<div class="flex flex-col items-center sm:items-start mt-4 sm:mt-0 sm:pr-8 space-y-1 text-center sm:text-left">
|
||||||
|
|
||||||
|
<!-- Title -->
|
||||||
|
<ng-container *ngIf="data.title">
|
||||||
|
<div
|
||||||
|
class="text-xl leading-6 font-medium"
|
||||||
|
[innerHTML]="data.title"></div>
|
||||||
|
</ng-container>
|
||||||
|
|
||||||
|
<!-- Message -->
|
||||||
|
<ng-container *ngIf="data.message">
|
||||||
|
<div
|
||||||
|
class="text-secondary"
|
||||||
|
[innerHTML]="data.message"></div>
|
||||||
|
</ng-container>
|
||||||
|
</div>
|
||||||
|
</ng-container>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Actions -->
|
||||||
|
<ng-container *ngIf="data.actions.confirm.show || data.actions.cancel.show">
|
||||||
|
<div class="flex items-center justify-center sm:justify-end px-6 py-4 space-x-3 bg-gray-50 dark:bg-black dark:bg-opacity-10">
|
||||||
|
|
||||||
|
<!-- Cancel -->
|
||||||
|
<ng-container *ngIf="data.actions.cancel.show">
|
||||||
|
<button
|
||||||
|
mat-stroked-button
|
||||||
|
[matDialogClose]="'cancelled'">
|
||||||
|
{{data.actions.cancel.label}}
|
||||||
|
</button>
|
||||||
|
</ng-container>
|
||||||
|
|
||||||
|
<!-- Confirm -->
|
||||||
|
<ng-container *ngIf="data.actions.confirm.show">
|
||||||
|
<button
|
||||||
|
mat-flat-button
|
||||||
|
[color]="data.actions.confirm.color"
|
||||||
|
[matDialogClose]="'confirmed'">
|
||||||
|
{{data.actions.confirm.label}}
|
||||||
|
</button>
|
||||||
|
</ng-container>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</ng-container>
|
||||||
|
|
||||||
|
</div>
|
||||||
52
src/@fuse/services/confirmation/dialog/dialog.component.ts
Normal file
52
src/@fuse/services/confirmation/dialog/dialog.component.ts
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
import { Component, Inject, OnInit, ViewEncapsulation } from '@angular/core';
|
||||||
|
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
|
||||||
|
import { FuseConfirmationConfig } from '@fuse/services/confirmation/confirmation.types';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector : 'fuse-confirmation-dialog',
|
||||||
|
templateUrl : './dialog.component.html',
|
||||||
|
styles : [
|
||||||
|
/* language=SCSS */
|
||||||
|
`
|
||||||
|
.fuse-confirmation-dialog-panel {
|
||||||
|
@screen md {
|
||||||
|
@apply w-128;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mat-dialog-container {
|
||||||
|
padding: 0 !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`
|
||||||
|
],
|
||||||
|
encapsulation: ViewEncapsulation.None
|
||||||
|
})
|
||||||
|
export class FuseConfirmationDialogComponent implements OnInit
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Constructor
|
||||||
|
*/
|
||||||
|
constructor(
|
||||||
|
@Inject(MAT_DIALOG_DATA) public data: FuseConfirmationConfig,
|
||||||
|
public matDialogRef: MatDialogRef<FuseConfirmationDialogComponent>
|
||||||
|
)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------------------------------
|
||||||
|
// @ Lifecycle hooks
|
||||||
|
// -----------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
/**
|
||||||
|
* On init
|
||||||
|
*/
|
||||||
|
ngOnInit(): void
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------------------------------
|
||||||
|
// @ Public methods
|
||||||
|
// -----------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
}
|
||||||
1
src/@fuse/services/confirmation/index.ts
Normal file
1
src/@fuse/services/confirmation/index.ts
Normal file
@@ -0,0 +1 @@
|
|||||||
|
export * from '@fuse/services/confirmation/public-api';
|
||||||
3
src/@fuse/services/confirmation/public-api.ts
Normal file
3
src/@fuse/services/confirmation/public-api.ts
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
export * from '@fuse/services/confirmation/confirmation.module';
|
||||||
|
export * from '@fuse/services/confirmation/confirmation.service';
|
||||||
|
export * from '@fuse/services/confirmation/confirmation.types';
|
||||||
@@ -136,11 +136,8 @@
|
|||||||
.mat-flat-button,
|
.mat-flat-button,
|
||||||
.mat-raised-button,
|
.mat-raised-button,
|
||||||
.mat-stroked-button {
|
.mat-stroked-button {
|
||||||
|
padding: 0 20px !important;
|
||||||
.fuse-mat-rounded & {
|
border-radius: 9999px !important;
|
||||||
padding: 0 20px;
|
|
||||||
border-radius: 9999px;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Target all buttons */
|
/* Target all buttons */
|
||||||
@@ -334,6 +331,8 @@
|
|||||||
/* @ Button Toggle
|
/* @ Button Toggle
|
||||||
/* ----------------------------------------------------------------------------------------------------- */
|
/* ----------------------------------------------------------------------------------------------------- */
|
||||||
.mat-button-toggle-group {
|
.mat-button-toggle-group {
|
||||||
|
border: none !important;
|
||||||
|
@apply space-x-1;
|
||||||
|
|
||||||
&.mat-button-toggle-group-appearance-standard {
|
&.mat-button-toggle-group-appearance-standard {
|
||||||
|
|
||||||
@@ -341,36 +340,27 @@
|
|||||||
background-clip: padding-box;
|
background-clip: padding-box;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/* Rounded design */
|
.mat-button-toggle {
|
||||||
.fuse-mat-rounded {
|
border-radius: 9999px;
|
||||||
|
overflow: hidden;
|
||||||
.mat-button-toggle-group {
|
|
||||||
border: none !important;
|
border: none !important;
|
||||||
@apply space-x-1;
|
font-weight: 500;
|
||||||
|
|
||||||
.mat-button-toggle {
|
&.mat-button-toggle-checked {
|
||||||
border-radius: 9999px;
|
|
||||||
overflow: hidden;
|
|
||||||
border: none !important;
|
|
||||||
font-weight: 500;
|
|
||||||
|
|
||||||
&.mat-button-toggle-checked {
|
|
||||||
|
|
||||||
.mat-button-toggle-label-content {
|
|
||||||
@apply text-default #{'!important'};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.mat-button-toggle-label-content {
|
.mat-button-toggle-label-content {
|
||||||
padding: 0 20px;
|
@apply text-default #{'!important'};
|
||||||
@apply text-secondary;
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.mat-ripple {
|
.mat-button-toggle-label-content {
|
||||||
border-radius: 9999px;
|
padding: 0 20px;
|
||||||
}
|
@apply text-secondary;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mat-ripple {
|
||||||
|
border-radius: 9999px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1329,62 +1319,55 @@
|
|||||||
opacity: 0 !important;
|
opacity: 0 !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.mat-tab-header {
|
||||||
|
border-bottom: none !important;
|
||||||
|
|
||||||
|
.mat-tab-label-container {
|
||||||
|
padding: 0 24px;
|
||||||
|
|
||||||
|
.mat-tab-list {
|
||||||
|
|
||||||
|
.mat-tab-labels {
|
||||||
|
|
||||||
|
.mat-tab-label {
|
||||||
|
min-width: 0 !important;
|
||||||
|
height: 40px !important;
|
||||||
|
padding: 0 20px !important;
|
||||||
|
border-radius: 9999px !important;
|
||||||
|
@apply text-secondary;
|
||||||
|
|
||||||
|
&.mat-tab-label-active {
|
||||||
|
@apply bg-gray-700 bg-opacity-10 dark:bg-gray-50 dark:bg-opacity-10 #{'!important'};
|
||||||
|
@apply text-default #{'!important'};
|
||||||
|
}
|
||||||
|
|
||||||
|
+ .mat-tab-label {
|
||||||
|
margin-left: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mat-tab-label-content {
|
||||||
|
line-height: 20px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.mat-ink-bar {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.mat-tab-body-content {
|
||||||
|
padding: 24px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.mat-tab-label {
|
.mat-tab-label {
|
||||||
opacity: 1 !important;
|
opacity: 1 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Rounded design */
|
|
||||||
.fuse-mat-rounded {
|
|
||||||
|
|
||||||
.mat-tab-group {
|
|
||||||
|
|
||||||
.mat-tab-header {
|
|
||||||
border-bottom: none !important;
|
|
||||||
|
|
||||||
.mat-tab-label-container {
|
|
||||||
padding: 0 24px;
|
|
||||||
|
|
||||||
.mat-tab-list {
|
|
||||||
|
|
||||||
.mat-tab-labels {
|
|
||||||
|
|
||||||
.mat-tab-label {
|
|
||||||
min-width: 0 !important;
|
|
||||||
height: 40px !important;
|
|
||||||
padding: 0 20px !important;
|
|
||||||
border-radius: 9999px !important;
|
|
||||||
@apply text-secondary;
|
|
||||||
|
|
||||||
&.mat-tab-label-active {
|
|
||||||
@apply bg-gray-700 bg-opacity-10 dark:bg-gray-50 dark:bg-opacity-10 #{'!important'};
|
|
||||||
@apply text-default #{'!important'};
|
|
||||||
}
|
|
||||||
|
|
||||||
+ .mat-tab-label {
|
|
||||||
margin-left: 4px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.mat-tab-label-content {
|
|
||||||
line-height: 20px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.mat-ink-bar {
|
|
||||||
display: none !important;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.mat-tab-body-content {
|
|
||||||
padding: 24px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ----------------------------------------------------------------------------------------------------- */
|
/* ----------------------------------------------------------------------------------------------------- */
|
||||||
/* @ Textarea
|
/* @ Textarea
|
||||||
/* ----------------------------------------------------------------------------------------------------- */
|
/* ----------------------------------------------------------------------------------------------------- */
|
||||||
|
|||||||
@@ -4,11 +4,12 @@
|
|||||||
.ql-toolbar {
|
.ql-toolbar {
|
||||||
border-radius: 6px 6px 0 0;
|
border-radius: 6px 6px 0 0;
|
||||||
padding: 0 !important;
|
padding: 0 !important;
|
||||||
@apply bg-gray-100 border-gray-300;
|
@apply bg-gray-100;
|
||||||
|
@apply border-gray-300 border-opacity-100 #{'!important'};
|
||||||
|
|
||||||
.dark & {
|
.dark & {
|
||||||
background-color: rgba(0, 0, 0, 0.05);
|
background-color: rgba(0, 0, 0, 0.05);
|
||||||
@apply border-gray-500;
|
@apply border-gray-500 #{'!important'};
|
||||||
}
|
}
|
||||||
|
|
||||||
.ql-formats {
|
.ql-formats {
|
||||||
@@ -81,26 +82,22 @@
|
|||||||
.ql-container {
|
.ql-container {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
border-radius: 0 0 6px 6px;
|
border-radius: 0 0 6px 6px;
|
||||||
@apply border-gray-300 shadow-sm;
|
@apply border-gray-300 border-opacity-100 shadow-sm #{'!important'};
|
||||||
|
|
||||||
.dark & {
|
.dark & {
|
||||||
@apply border-gray-500;
|
@apply border-gray-500 #{'!important'};
|
||||||
}
|
}
|
||||||
|
|
||||||
.ql-editor {
|
.ql-editor {
|
||||||
min-height: 160px;
|
min-height: 160px;
|
||||||
max-height: 160px;
|
max-height: 160px;
|
||||||
height: 160px;
|
height: 160px;
|
||||||
@apply bg-gray-50;
|
@apply bg-card;
|
||||||
|
|
||||||
.dark & {
|
.dark & {
|
||||||
background-color: rgba(0, 0, 0, 0.05);
|
background-color: rgba(0, 0, 0, 0.05);
|
||||||
}
|
}
|
||||||
|
|
||||||
&:focus {
|
|
||||||
@apply bg-card;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.ql-blank::before {
|
&.ql-blank::before {
|
||||||
@apply text-hint;
|
@apply text-hint;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,81 +18,6 @@
|
|||||||
)
|
)
|
||||||
));
|
));
|
||||||
|
|
||||||
/* Prepare the Background and Foreground maps */
|
|
||||||
$background-light: (
|
|
||||||
status-bar: #CBD5E1, /* blueGray.300 */
|
|
||||||
app-bar: #FFFFFF,
|
|
||||||
background: #F1F5F9, /* blueGray.100 */
|
|
||||||
hover: rgba(148, 163, 184, 0.12), /* blueGray.400 + opacity */
|
|
||||||
card: #FFFFFF,
|
|
||||||
dialog: #FFFFFF,
|
|
||||||
disabled-button: rgba(148, 163, 184, 0.38), /* blueGray.400 + opacity */
|
|
||||||
raised-button: #FFFFFF,
|
|
||||||
focused-button: #64748B, /* blueGray.500 */
|
|
||||||
selected-button: #E2E8F0, /* blueGray.200 */
|
|
||||||
selected-disabled-button: #E2E8F0, /* blueGray.200 */
|
|
||||||
disabled-button-toggle: #CBD5E1, /* blueGray.300 */
|
|
||||||
unselected-chip: #E2E8F0, /* blueGray.200 */
|
|
||||||
disabled-list-option: #CBD5E1, /* blueGray.300 */
|
|
||||||
tooltip: #1E293B /* blueGray.800 */
|
|
||||||
);
|
|
||||||
|
|
||||||
$background-dark: (
|
|
||||||
status-bar: #0F172A, /* blueGray.900 */
|
|
||||||
app-bar: #0F172A, /* blueGray.900 */
|
|
||||||
background: #0F172A, /* blueGray.900 */
|
|
||||||
hover: rgba(255, 255, 255, 0.05),
|
|
||||||
card: #1E293B, /* blueGray.800 */
|
|
||||||
dialog: #1E293B, /* blueGray.800 */
|
|
||||||
disabled-button: rgba(15, 23, 42, 0.38), /* blueGray.900 + opacity */
|
|
||||||
raised-button: #0F172A, /* blueGray.900 */
|
|
||||||
focused-button: #E2E8F0, /* blueGray.200 */
|
|
||||||
selected-button: rgba(255, 255, 255, 0.05),
|
|
||||||
selected-disabled-button: #1E293B, /* blueGray.800 */
|
|
||||||
disabled-button-toggle: #0F172A, /* blueGray.900 */
|
|
||||||
unselected-chip: #475569, /* blueGray.600 */
|
|
||||||
disabled-list-option: #E2E8F0, /* blueGray.200 */
|
|
||||||
tooltip: #64748B /* blueGray.500 */
|
|
||||||
);
|
|
||||||
|
|
||||||
$foreground-light: (
|
|
||||||
base: #000000,
|
|
||||||
divider: #E2E8F0, /* blueGray.200 */
|
|
||||||
dividers: #E2E8F0, /* blueGray.200 */
|
|
||||||
disabled: #94A3B8, /* blueGray.400 */
|
|
||||||
disabled-button: #94A3B8, /* blueGray.400 */
|
|
||||||
disabled-text: #94A3B8, /* blueGray.400 */
|
|
||||||
elevation: #000000,
|
|
||||||
hint-text: #94A3B8, /* blueGray.400 */
|
|
||||||
secondary-text: #64748B, /* blueGray.500 */
|
|
||||||
icon: #64748B, /* blueGray.500 */
|
|
||||||
icons: #64748B, /* blueGray.500 */
|
|
||||||
mat-icon: #64748B, /* blueGray.500 */
|
|
||||||
text: #1E293B, /* blueGray.800 */
|
|
||||||
slider-min: #1E293B, /* blueGray.800 */
|
|
||||||
slider-off: #CBD5E1, /* blueGray.300 */
|
|
||||||
slider-off-active: #94A3B8 /* blueGray.400 */
|
|
||||||
);
|
|
||||||
|
|
||||||
$foreground-dark: (
|
|
||||||
base: #FFFFFF,
|
|
||||||
divider: rgba(241, 245, 249, 0.12), /* blueGray.100 + opacity */
|
|
||||||
dividers: rgba(241, 245, 249, 0.12), /* blueGray.100 + opacity */
|
|
||||||
disabled: #475569, /* blueGray.600 */
|
|
||||||
disabled-button: #1E293B, /* blueGray.800 */
|
|
||||||
disabled-text: #475569, /* blueGray.600 */
|
|
||||||
elevation: #000000,
|
|
||||||
hint-text: #64748B, /* blueGray.500 */
|
|
||||||
secondary-text: #94A3B8, /* blueGray.400 */
|
|
||||||
icon: #F1F5F9, /* blueGray.100 */
|
|
||||||
icons: #F1F5F9, /* blueGray.100 */
|
|
||||||
mat-icon: #94A3B8, /* blueGray.400 */
|
|
||||||
text: #FFFFFF,
|
|
||||||
slider-min: #FFFFFF,
|
|
||||||
slider-off: #64748B, /* blueGray.500 */
|
|
||||||
slider-off-active: #94A3B8 /* blueGray.400 */
|
|
||||||
);
|
|
||||||
|
|
||||||
/* Generate Primary, Accent and Warn palettes */
|
/* Generate Primary, Accent and Warn palettes */
|
||||||
$palettes: ();
|
$palettes: ();
|
||||||
@each $name in (primary, accent, warn) {
|
@each $name in (primary, accent, warn) {
|
||||||
@@ -145,8 +70,41 @@ body .light {
|
|||||||
accent: map.get(map.get($base-light-theme, color), accent),
|
accent: map.get(map.get($base-light-theme, color), accent),
|
||||||
warn: map.get(map.get($base-light-theme, color), warn),
|
warn: map.get(map.get($base-light-theme, color), warn),
|
||||||
is-dark: map.get(map.get($base-light-theme, color), is-dark),
|
is-dark: map.get(map.get($base-light-theme, color), is-dark),
|
||||||
foreground: $foreground-light,
|
foreground: (
|
||||||
background: $background-light
|
base: #000000,
|
||||||
|
divider: #E2E8F0, /* blueGray.200 */
|
||||||
|
dividers: #E2E8F0, /* blueGray.200 */
|
||||||
|
disabled: #94A3B8, /* blueGray.400 */
|
||||||
|
disabled-button: #94A3B8, /* blueGray.400 */
|
||||||
|
disabled-text: #94A3B8, /* blueGray.400 */
|
||||||
|
elevation: #000000,
|
||||||
|
hint-text: #94A3B8, /* blueGray.400 */
|
||||||
|
secondary-text: #64748B, /* blueGray.500 */
|
||||||
|
icon: #64748B, /* blueGray.500 */
|
||||||
|
icons: #64748B, /* blueGray.500 */
|
||||||
|
mat-icon: #64748B, /* blueGray.500 */
|
||||||
|
text: #1E293B, /* blueGray.800 */
|
||||||
|
slider-min: #1E293B, /* blueGray.800 */
|
||||||
|
slider-off: #CBD5E1, /* blueGray.300 */
|
||||||
|
slider-off-active: #94A3B8 /* blueGray.400 */
|
||||||
|
),
|
||||||
|
background: (
|
||||||
|
status-bar: #CBD5E1, /* blueGray.300 */
|
||||||
|
app-bar: #FFFFFF,
|
||||||
|
background: #F1F5F9, /* blueGray.100 */
|
||||||
|
hover: rgba(148, 163, 184, 0.12), /* blueGray.400 + opacity */
|
||||||
|
card: #FFFFFF,
|
||||||
|
dialog: #FFFFFF,
|
||||||
|
disabled-button: rgba(148, 163, 184, 0.38), /* blueGray.400 + opacity */
|
||||||
|
raised-button: #FFFFFF,
|
||||||
|
focused-button: #64748B, /* blueGray.500 */
|
||||||
|
selected-button: #E2E8F0, /* blueGray.200 */
|
||||||
|
selected-disabled-button: #E2E8F0, /* blueGray.200 */
|
||||||
|
disabled-button-toggle: #CBD5E1, /* blueGray.300 */
|
||||||
|
unselected-chip: #E2E8F0, /* blueGray.200 */
|
||||||
|
disabled-list-option: #CBD5E1, /* blueGray.300 */
|
||||||
|
tooltip: #1E293B /* blueGray.800 */
|
||||||
|
)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -166,8 +124,41 @@ body .dark {
|
|||||||
accent: map.get(map.get($base-dark-theme, color), accent),
|
accent: map.get(map.get($base-dark-theme, color), accent),
|
||||||
warn: map.get(map.get($base-dark-theme, color), warn),
|
warn: map.get(map.get($base-dark-theme, color), warn),
|
||||||
is-dark: map.get(map.get($base-dark-theme, color), is-dark),
|
is-dark: map.get(map.get($base-dark-theme, color), is-dark),
|
||||||
foreground: $foreground-dark,
|
foreground: (
|
||||||
background: $background-dark
|
base: #FFFFFF,
|
||||||
|
divider: rgba(241, 245, 249, 0.12), /* blueGray.100 + opacity */
|
||||||
|
dividers: rgba(241, 245, 249, 0.12), /* blueGray.100 + opacity */
|
||||||
|
disabled: #475569, /* blueGray.600 */
|
||||||
|
disabled-button: #1E293B, /* blueGray.800 */
|
||||||
|
disabled-text: #475569, /* blueGray.600 */
|
||||||
|
elevation: #000000,
|
||||||
|
hint-text: #64748B, /* blueGray.500 */
|
||||||
|
secondary-text: #94A3B8, /* blueGray.400 */
|
||||||
|
icon: #F1F5F9, /* blueGray.100 */
|
||||||
|
icons: #F1F5F9, /* blueGray.100 */
|
||||||
|
mat-icon: #94A3B8, /* blueGray.400 */
|
||||||
|
text: #FFFFFF,
|
||||||
|
slider-min: #FFFFFF,
|
||||||
|
slider-off: #64748B, /* blueGray.500 */
|
||||||
|
slider-off-active: #94A3B8 /* blueGray.400 */
|
||||||
|
),
|
||||||
|
background: (
|
||||||
|
status-bar: #0F172A, /* blueGray.900 */
|
||||||
|
app-bar: #0F172A, /* blueGray.900 */
|
||||||
|
background: #0F172A, /* blueGray.900 */
|
||||||
|
hover: rgba(255, 255, 255, 0.05),
|
||||||
|
card: #1E293B, /* blueGray.800 */
|
||||||
|
dialog: #1E293B, /* blueGray.800 */
|
||||||
|
disabled-button: rgba(15, 23, 42, 0.38), /* blueGray.900 + opacity */
|
||||||
|
raised-button: #0F172A, /* blueGray.900 */
|
||||||
|
focused-button: #E2E8F0, /* blueGray.200 */
|
||||||
|
selected-button: rgba(255, 255, 255, 0.05),
|
||||||
|
selected-disabled-button: #1E293B, /* blueGray.800 */
|
||||||
|
disabled-button-toggle: #0F172A, /* blueGray.900 */
|
||||||
|
unselected-chip: #475569, /* blueGray.600 */
|
||||||
|
disabled-list-option: #E2E8F0, /* blueGray.200 */
|
||||||
|
tooltip: #64748B /* blueGray.500 */
|
||||||
|
)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
import { Version } from '@fuse/version/version';
|
import { Version } from '@fuse/version/version';
|
||||||
|
|
||||||
export const FUSE_VERSION = new Version('13.0.3').full;
|
export const FUSE_VERSION = new Version('13.6.1').full;
|
||||||
|
|||||||
@@ -14,8 +14,8 @@ import { AppComponent } from 'app/app.component';
|
|||||||
import { appRoutes } from 'app/app.routing';
|
import { appRoutes } from 'app/app.routing';
|
||||||
|
|
||||||
const routerConfig: ExtraOptions = {
|
const routerConfig: ExtraOptions = {
|
||||||
scrollPositionRestoration: 'enabled',
|
preloadingStrategy : PreloadAllModules,
|
||||||
preloadingStrategy : PreloadAllModules
|
scrollPositionRestoration: 'enabled'
|
||||||
};
|
};
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
|
|||||||
@@ -1,9 +1,12 @@
|
|||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { HttpClient } from '@angular/common/http';
|
|
||||||
import { ActivatedRouteSnapshot, Resolve, RouterStateSnapshot } from '@angular/router';
|
import { ActivatedRouteSnapshot, Resolve, RouterStateSnapshot } from '@angular/router';
|
||||||
import { forkJoin, Observable } from 'rxjs';
|
import { forkJoin, Observable } from 'rxjs';
|
||||||
import { map } from 'rxjs/operators';
|
import { MessagesService } from 'app/layout/common/messages/messages.service';
|
||||||
import { InitialData } from 'app/app.types';
|
import { NavigationService } from 'app/core/navigation/navigation.service';
|
||||||
|
import { NotificationsService } from 'app/layout/common/notifications/notifications.service';
|
||||||
|
import { QuickChatService } from 'app/layout/common/quick-chat/quick-chat.service';
|
||||||
|
import { ShortcutsService } from 'app/layout/common/shortcuts/shortcuts.service';
|
||||||
|
import { UserService } from 'app/core/user/user.service';
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
@@ -13,7 +16,14 @@ export class InitialDataResolver implements Resolve<any>
|
|||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*/
|
*/
|
||||||
constructor(private _httpClient: HttpClient)
|
constructor(
|
||||||
|
private _messagesService: MessagesService,
|
||||||
|
private _navigationService: NavigationService,
|
||||||
|
private _notificationsService: NotificationsService,
|
||||||
|
private _quickChatService: QuickChatService,
|
||||||
|
private _shortcutsService: ShortcutsService,
|
||||||
|
private _userService: UserService
|
||||||
|
)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -27,29 +37,16 @@ export class InitialDataResolver implements Resolve<any>
|
|||||||
* @param route
|
* @param route
|
||||||
* @param state
|
* @param state
|
||||||
*/
|
*/
|
||||||
resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<InitialData>
|
resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<any>
|
||||||
{
|
{
|
||||||
// Fork join multiple API endpoint calls to wait all of them to finish
|
// Fork join multiple API endpoint calls to wait all of them to finish
|
||||||
return forkJoin([
|
return forkJoin([
|
||||||
this._httpClient.get<any>('api/common/messages'),
|
this._navigationService.get(),
|
||||||
this._httpClient.get<any>('api/common/navigation'),
|
this._messagesService.getAll(),
|
||||||
this._httpClient.get<any>('api/common/notifications'),
|
this._notificationsService.getAll(),
|
||||||
this._httpClient.get<any>('api/common/shortcuts'),
|
this._quickChatService.getChats(),
|
||||||
this._httpClient.get<any>('api/common/user')
|
this._shortcutsService.getAll(),
|
||||||
]).pipe(
|
this._userService.get()
|
||||||
map(([messages, navigation, notifications, shortcuts, user]) => ({
|
]);
|
||||||
messages,
|
|
||||||
navigation: {
|
|
||||||
compact : navigation.compact,
|
|
||||||
default : navigation.default,
|
|
||||||
futuristic: navigation.futuristic,
|
|
||||||
horizontal: navigation.horizontal
|
|
||||||
},
|
|
||||||
notifications,
|
|
||||||
shortcuts,
|
|
||||||
user
|
|
||||||
})
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -79,6 +79,8 @@ export const appRoutes: Route[] = [
|
|||||||
{path: 'dashboards', children: [
|
{path: 'dashboards', children: [
|
||||||
{path: 'project', loadChildren: () => import('app/modules/admin/dashboards/project/project.module').then(m => m.ProjectModule)},
|
{path: 'project', loadChildren: () => import('app/modules/admin/dashboards/project/project.module').then(m => m.ProjectModule)},
|
||||||
{path: 'analytics', loadChildren: () => import('app/modules/admin/dashboards/analytics/analytics.module').then(m => m.AnalyticsModule)},
|
{path: 'analytics', loadChildren: () => import('app/modules/admin/dashboards/analytics/analytics.module').then(m => m.AnalyticsModule)},
|
||||||
|
{path: 'finance', loadChildren: () => import('app/modules/admin/dashboards/finance/finance.module').then(m => m.FinanceModule)},
|
||||||
|
{path: 'crypto', loadChildren: () => import('app/modules/admin/dashboards/crypto/crypto.module').then(m => m.CryptoModule)},
|
||||||
]},
|
]},
|
||||||
|
|
||||||
// Apps
|
// Apps
|
||||||
@@ -105,7 +107,7 @@ export const appRoutes: Route[] = [
|
|||||||
// Authentication
|
// Authentication
|
||||||
{path: 'authentication', loadChildren: () => import('app/modules/admin/pages/authentication/authentication.module').then(m => m.AuthenticationModule)},
|
{path: 'authentication', loadChildren: () => import('app/modules/admin/pages/authentication/authentication.module').then(m => m.AuthenticationModule)},
|
||||||
|
|
||||||
// Coming soon
|
// Coming Soon
|
||||||
{path: 'coming-soon', loadChildren: () => import('app/modules/admin/pages/coming-soon/coming-soon.module').then(m => m.ComingSoonModule)},
|
{path: 'coming-soon', loadChildren: () => import('app/modules/admin/pages/coming-soon/coming-soon.module').then(m => m.ComingSoonModule)},
|
||||||
|
|
||||||
// Error
|
// Error
|
||||||
@@ -140,15 +142,24 @@ export const appRoutes: Route[] = [
|
|||||||
{path: 'settings', loadChildren: () => import('app/modules/admin/pages/settings/settings.module').then(m => m.SettingsModule)},
|
{path: 'settings', loadChildren: () => import('app/modules/admin/pages/settings/settings.module').then(m => m.SettingsModule)},
|
||||||
]},
|
]},
|
||||||
|
|
||||||
// User interface
|
// User Interface
|
||||||
{path: 'ui', children: [
|
{path: 'ui', children: [
|
||||||
|
|
||||||
// Angular Material
|
// Material Components
|
||||||
{path: 'angular-material', loadChildren: () => import('app/modules/admin/ui/angular-material/angular-material.module').then(m => m.AngularMaterialModule)},
|
{path: 'material-components', loadChildren: () => import('app/modules/admin/ui/material-components/material-components.module').then(m => m.MaterialComponentsModule)},
|
||||||
|
|
||||||
|
// Fuse Components
|
||||||
|
{path: 'fuse-components', loadChildren: () => import('app/modules/admin/ui/fuse-components/fuse-components.module').then(m => m.FuseComponentsModule)},
|
||||||
|
|
||||||
|
// Other Components
|
||||||
|
{path: 'other-components', loadChildren: () => import('app/modules/admin/ui/other-components/other-components.module').then(m => m.OtherComponentsModule)},
|
||||||
|
|
||||||
// TailwindCSS
|
// TailwindCSS
|
||||||
{path: 'tailwindcss', loadChildren: () => import('app/modules/admin/ui/tailwindcss/tailwindcss.module').then(m => m.TailwindCSSModule)},
|
{path: 'tailwindcss', loadChildren: () => import('app/modules/admin/ui/tailwindcss/tailwindcss.module').then(m => m.TailwindCSSModule)},
|
||||||
|
|
||||||
|
// Advanced Search
|
||||||
|
{path: 'advanced-search', loadChildren: () => import('app/modules/admin/ui/advanced-search/advanced-search.module').then(m => m.AdvancedSearchModule)},
|
||||||
|
|
||||||
// Animations
|
// Animations
|
||||||
{path: 'animations', loadChildren: () => import('app/modules/admin/ui/animations/animations.module').then(m => m.AnimationsModule)},
|
{path: 'animations', loadChildren: () => import('app/modules/admin/ui/animations/animations.module').then(m => m.AnimationsModule)},
|
||||||
|
|
||||||
@@ -158,6 +169,9 @@ export const appRoutes: Route[] = [
|
|||||||
// Colors
|
// Colors
|
||||||
{path: 'colors', loadChildren: () => import('app/modules/admin/ui/colors/colors.module').then(m => m.ColorsModule)},
|
{path: 'colors', loadChildren: () => import('app/modules/admin/ui/colors/colors.module').then(m => m.ColorsModule)},
|
||||||
|
|
||||||
|
// Confirmation Dialog
|
||||||
|
{path: 'confirmation-dialog', loadChildren: () => import('app/modules/admin/ui/confirmation-dialog/confirmation-dialog.module').then(m => m.ConfirmationDialogModule)},
|
||||||
|
|
||||||
// Datatable
|
// Datatable
|
||||||
{path: 'datatable', loadChildren: () => import('app/modules/admin/ui/datatable/datatable.module').then(m => m.DatatableModule)},
|
{path: 'datatable', loadChildren: () => import('app/modules/admin/ui/datatable/datatable.module').then(m => m.DatatableModule)},
|
||||||
|
|
||||||
@@ -171,7 +185,7 @@ export const appRoutes: Route[] = [
|
|||||||
// Icons
|
// Icons
|
||||||
{path: 'icons', loadChildren: () => import('app/modules/admin/ui/icons/icons.module').then(m => m.IconsModule)},
|
{path: 'icons', loadChildren: () => import('app/modules/admin/ui/icons/icons.module').then(m => m.IconsModule)},
|
||||||
|
|
||||||
// Page layouts
|
// Page Layouts
|
||||||
{path: 'page-layouts', loadChildren: () => import('app/modules/admin/ui/page-layouts/page-layouts.module').then(m => m.PageLayoutsModule)},
|
{path: 'page-layouts', loadChildren: () => import('app/modules/admin/ui/page-layouts/page-layouts.module').then(m => m.PageLayoutsModule)},
|
||||||
|
|
||||||
// Typography
|
// Typography
|
||||||
@@ -185,13 +199,7 @@ export const appRoutes: Route[] = [
|
|||||||
{path: 'changelog', loadChildren: () => import('app/modules/admin/docs/changelog/changelog.module').then(m => m.ChangelogModule)},
|
{path: 'changelog', loadChildren: () => import('app/modules/admin/docs/changelog/changelog.module').then(m => m.ChangelogModule)},
|
||||||
|
|
||||||
// Guides
|
// Guides
|
||||||
{path: 'guides', loadChildren: () => import('app/modules/admin/docs/guides/guides.module').then(m => m.GuidesModule)},
|
{path: 'guides', loadChildren: () => import('app/modules/admin/docs/guides/guides.module').then(m => m.GuidesModule)}
|
||||||
|
|
||||||
// Core features
|
|
||||||
{path: 'core-features', loadChildren: () => import('app/modules/admin/docs/core-features/core-features.module').then(m => m.CoreFeaturesModule)},
|
|
||||||
|
|
||||||
// Other components
|
|
||||||
{path: 'other-components', loadChildren: () => import('app/modules/admin/docs/other-components/other-components.module').then(m => m.OtherComponentsModule)},
|
|
||||||
]},
|
]},
|
||||||
|
|
||||||
// 404 & Catch all
|
// 404 & Catch all
|
||||||
|
|||||||
@@ -1,19 +0,0 @@
|
|||||||
import { FuseNavigationItem } from '@fuse/components/navigation';
|
|
||||||
import { Message } from 'app/layout/common/messages/messages.types';
|
|
||||||
import { Notification } from 'app/layout/common/notifications/notifications.types';
|
|
||||||
import { Shortcut } from 'app/layout/common/shortcuts/shortcuts.types';
|
|
||||||
import { User } from 'app/core/user/user.model';
|
|
||||||
|
|
||||||
export interface InitialData
|
|
||||||
{
|
|
||||||
messages: Message[];
|
|
||||||
navigation: {
|
|
||||||
compact: FuseNavigationItem[];
|
|
||||||
default: FuseNavigationItem[];
|
|
||||||
futuristic: FuseNavigationItem[];
|
|
||||||
horizontal: FuseNavigationItem[];
|
|
||||||
};
|
|
||||||
notifications: Notification[];
|
|
||||||
shortcuts: Shortcut[];
|
|
||||||
user: User;
|
|
||||||
}
|
|
||||||
48
src/app/core/navigation/navigation.service.ts
Normal file
48
src/app/core/navigation/navigation.service.ts
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
import { HttpClient } from '@angular/common/http';
|
||||||
|
import { Observable, ReplaySubject } from 'rxjs';
|
||||||
|
import { tap } from 'rxjs/operators';
|
||||||
|
import { Navigation } from 'app/core/navigation/navigation.types';
|
||||||
|
|
||||||
|
@Injectable({
|
||||||
|
providedIn: 'root'
|
||||||
|
})
|
||||||
|
export class NavigationService
|
||||||
|
{
|
||||||
|
private _navigation: ReplaySubject<Navigation> = new ReplaySubject<Navigation>(1);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor
|
||||||
|
*/
|
||||||
|
constructor(private _httpClient: HttpClient)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------------------------------
|
||||||
|
// @ Accessors
|
||||||
|
// -----------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Getter for navigation
|
||||||
|
*/
|
||||||
|
get navigation$(): Observable<Navigation>
|
||||||
|
{
|
||||||
|
return this._navigation.asObservable();
|
||||||
|
}
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------------------------------
|
||||||
|
// @ Public methods
|
||||||
|
// -----------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get all navigation data
|
||||||
|
*/
|
||||||
|
get(): Observable<Navigation>
|
||||||
|
{
|
||||||
|
return this._httpClient.get<Navigation>('api/common/navigation').pipe(
|
||||||
|
tap((navigation) => {
|
||||||
|
this._navigation.next(navigation);
|
||||||
|
})
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
9
src/app/core/navigation/navigation.types.ts
Normal file
9
src/app/core/navigation/navigation.types.ts
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
import { FuseNavigationItem } from '@fuse/components/navigation';
|
||||||
|
|
||||||
|
export interface Navigation
|
||||||
|
{
|
||||||
|
compact: FuseNavigationItem[];
|
||||||
|
default: FuseNavigationItem[];
|
||||||
|
futuristic: FuseNavigationItem[];
|
||||||
|
horizontal: FuseNavigationItem[];
|
||||||
|
}
|
||||||
@@ -27,6 +27,6 @@ export class TranslocoHttpLoader implements TranslocoLoader
|
|||||||
*/
|
*/
|
||||||
getTranslation(lang: string): Observable<Translation>
|
getTranslation(lang: string): Observable<Translation>
|
||||||
{
|
{
|
||||||
return this._httpClient.get<Translation>(`/assets/i18n/${lang}.json`);
|
return this._httpClient.get<Translation>(`./assets/i18n/${lang}.json`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ import { TranslocoHttpLoader } from 'app/core/transloco/transloco.http-loader';
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
defaultLang : 'en',
|
defaultLang : 'en',
|
||||||
|
fallbackLang : 'en',
|
||||||
reRenderOnLangChange: true,
|
reRenderOnLangChange: true,
|
||||||
prodMode : environment.production
|
prodMode : environment.production
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { HttpClient } from '@angular/common/http';
|
import { HttpClient } from '@angular/common/http';
|
||||||
import { Observable, ReplaySubject } from 'rxjs';
|
import { Observable, ReplaySubject } from 'rxjs';
|
||||||
import { map } from 'rxjs/operators';
|
import { map, tap } from 'rxjs/operators';
|
||||||
import { User } from 'app/core/user/user.model';
|
import { User } from 'app/core/user/user.types';
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
@@ -42,6 +42,18 @@ export class UserService
|
|||||||
// @ Public methods
|
// @ Public methods
|
||||||
// -----------------------------------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the current logged in user data
|
||||||
|
*/
|
||||||
|
get(): Observable<User>
|
||||||
|
{
|
||||||
|
return this._httpClient.get<User>('api/common/user').pipe(
|
||||||
|
tap((user) => {
|
||||||
|
this._user.next(user);
|
||||||
|
})
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Update the user
|
* Update the user
|
||||||
*
|
*
|
||||||
@@ -51,7 +63,6 @@ export class UserService
|
|||||||
{
|
{
|
||||||
return this._httpClient.patch<User>('api/common/user', {user}).pipe(
|
return this._httpClient.patch<User>('api/common/user', {user}).pipe(
|
||||||
map((response) => {
|
map((response) => {
|
||||||
// Execute the observable
|
|
||||||
this._user.next(response);
|
this._user.next(response);
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -4,13 +4,13 @@ import { AvailableLangs, TranslocoService } from '@ngneat/transloco';
|
|||||||
import { FuseNavigationService, FuseVerticalNavigationComponent } from '@fuse/components/navigation';
|
import { FuseNavigationService, FuseVerticalNavigationComponent } from '@fuse/components/navigation';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector : 'language',
|
selector : 'languages',
|
||||||
templateUrl : './language.component.html',
|
templateUrl : './languages.component.html',
|
||||||
encapsulation : ViewEncapsulation.None,
|
encapsulation : ViewEncapsulation.None,
|
||||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||||
exportAs : 'language'
|
exportAs : 'languages'
|
||||||
})
|
})
|
||||||
export class LanguageComponent implements OnInit, OnDestroy
|
export class LanguagesComponent implements OnInit, OnDestroy
|
||||||
{
|
{
|
||||||
availableLangs: AvailableLangs;
|
availableLangs: AvailableLangs;
|
||||||
activeLang: string;
|
activeLang: string;
|
||||||
@@ -2,12 +2,12 @@ import { NgModule } from '@angular/core';
|
|||||||
import { MatButtonModule } from '@angular/material/button';
|
import { MatButtonModule } from '@angular/material/button';
|
||||||
import { MatIconModule } from '@angular/material/icon';
|
import { MatIconModule } from '@angular/material/icon';
|
||||||
import { MatMenuModule } from '@angular/material/menu';
|
import { MatMenuModule } from '@angular/material/menu';
|
||||||
import { LanguageComponent } from 'app/layout/common/language/language.component';
|
import { LanguagesComponent } from 'app/layout/common/languages/languages.component';
|
||||||
import { SharedModule } from 'app/shared/shared.module';
|
import { SharedModule } from 'app/shared/shared.module';
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
declarations: [
|
declarations: [
|
||||||
LanguageComponent
|
LanguagesComponent
|
||||||
],
|
],
|
||||||
imports : [
|
imports : [
|
||||||
MatButtonModule,
|
MatButtonModule,
|
||||||
@@ -16,9 +16,9 @@ import { SharedModule } from 'app/shared/shared.module';
|
|||||||
SharedModule
|
SharedModule
|
||||||
],
|
],
|
||||||
exports : [
|
exports : [
|
||||||
LanguageComponent
|
LanguagesComponent
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
export class LanguageModule
|
export class LanguagesModule
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, Input, OnChanges, OnDestroy, OnInit, SimpleChanges, TemplateRef, ViewChild, ViewContainerRef, ViewEncapsulation } from '@angular/core';
|
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, OnDestroy, OnInit, TemplateRef, ViewChild, ViewContainerRef, ViewEncapsulation } from '@angular/core';
|
||||||
import { Overlay, OverlayRef } from '@angular/cdk/overlay';
|
import { Overlay, OverlayRef } from '@angular/cdk/overlay';
|
||||||
import { TemplatePortal } from '@angular/cdk/portal';
|
import { TemplatePortal } from '@angular/cdk/portal';
|
||||||
import { MatButton } from '@angular/material/button';
|
import { MatButton } from '@angular/material/button';
|
||||||
@@ -14,12 +14,12 @@ import { MessagesService } from 'app/layout/common/messages/messages.service';
|
|||||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||||
exportAs : 'messages'
|
exportAs : 'messages'
|
||||||
})
|
})
|
||||||
export class MessagesComponent implements OnInit, OnChanges, OnDestroy
|
export class MessagesComponent implements OnInit, OnDestroy
|
||||||
{
|
{
|
||||||
@Input() messages: Message[];
|
|
||||||
@ViewChild('messagesOrigin') private _messagesOrigin: MatButton;
|
@ViewChild('messagesOrigin') private _messagesOrigin: MatButton;
|
||||||
@ViewChild('messagesPanel') private _messagesPanel: TemplateRef<any>;
|
@ViewChild('messagesPanel') private _messagesPanel: TemplateRef<any>;
|
||||||
|
|
||||||
|
messages: Message[];
|
||||||
unreadCount: number = 0;
|
unreadCount: number = 0;
|
||||||
private _overlayRef: OverlayRef;
|
private _overlayRef: OverlayRef;
|
||||||
private _unsubscribeAll: Subject<any> = new Subject<any>();
|
private _unsubscribeAll: Subject<any> = new Subject<any>();
|
||||||
@@ -40,21 +40,6 @@ export class MessagesComponent implements OnInit, OnChanges, OnDestroy
|
|||||||
// @ Lifecycle hooks
|
// @ Lifecycle hooks
|
||||||
// -----------------------------------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
/**
|
|
||||||
* On changes
|
|
||||||
*
|
|
||||||
* @param changes
|
|
||||||
*/
|
|
||||||
ngOnChanges(changes: SimpleChanges): void
|
|
||||||
{
|
|
||||||
// Messages
|
|
||||||
if ( 'messages' in changes )
|
|
||||||
{
|
|
||||||
// Store the messages on the service
|
|
||||||
this._messagesService.store(changes.messages.currentValue);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* On init
|
* On init
|
||||||
*/
|
*/
|
||||||
@@ -182,7 +167,7 @@ export class MessagesComponent implements OnInit, OnChanges, OnDestroy
|
|||||||
scrollStrategy : this._overlay.scrollStrategies.block(),
|
scrollStrategy : this._overlay.scrollStrategies.block(),
|
||||||
positionStrategy: this._overlay.position()
|
positionStrategy: this._overlay.position()
|
||||||
.flexibleConnectedTo(this._messagesOrigin._elementRef.nativeElement)
|
.flexibleConnectedTo(this._messagesOrigin._elementRef.nativeElement)
|
||||||
.withLockedPosition()
|
.withLockedPosition(true)
|
||||||
.withPush(true)
|
.withPush(true)
|
||||||
.withPositions([
|
.withPositions([
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { Injectable } from '@angular/core';
|
|||||||
import { HttpClient } from '@angular/common/http';
|
import { HttpClient } from '@angular/common/http';
|
||||||
import { Observable, ReplaySubject } from 'rxjs';
|
import { Observable, ReplaySubject } from 'rxjs';
|
||||||
import { Message } from 'app/layout/common/messages/messages.types';
|
import { Message } from 'app/layout/common/messages/messages.types';
|
||||||
import { map, switchMap, take } from 'rxjs/operators';
|
import { map, switchMap, take, tap } from 'rxjs/operators';
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
@@ -35,17 +35,15 @@ export class MessagesService
|
|||||||
// -----------------------------------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Store messages on the service
|
* Get all messages
|
||||||
*
|
|
||||||
* @param messages
|
|
||||||
*/
|
*/
|
||||||
store(messages: Message[]): Observable<Message[]>
|
getAll(): Observable<Message[]>
|
||||||
{
|
{
|
||||||
// Load the messages
|
return this._httpClient.get<Message[]>('api/common/messages').pipe(
|
||||||
this._messages.next(messages);
|
tap((messages) => {
|
||||||
|
this._messages.next(messages);
|
||||||
// Return the messages
|
})
|
||||||
return this.messages$;
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, Input, OnChanges, OnDestroy, OnInit, SimpleChanges, TemplateRef, ViewChild, ViewContainerRef, ViewEncapsulation } from '@angular/core';
|
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, OnDestroy, OnInit, TemplateRef, ViewChild, ViewContainerRef, ViewEncapsulation } from '@angular/core';
|
||||||
import { Overlay, OverlayRef } from '@angular/cdk/overlay';
|
import { Overlay, OverlayRef } from '@angular/cdk/overlay';
|
||||||
import { TemplatePortal } from '@angular/cdk/portal';
|
import { TemplatePortal } from '@angular/cdk/portal';
|
||||||
import { MatButton } from '@angular/material/button';
|
import { MatButton } from '@angular/material/button';
|
||||||
@@ -14,12 +14,12 @@ import { NotificationsService } from 'app/layout/common/notifications/notificati
|
|||||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||||
exportAs : 'notifications'
|
exportAs : 'notifications'
|
||||||
})
|
})
|
||||||
export class NotificationsComponent implements OnChanges, OnInit, OnDestroy
|
export class NotificationsComponent implements OnInit, OnDestroy
|
||||||
{
|
{
|
||||||
@Input() notifications: Notification[];
|
|
||||||
@ViewChild('notificationsOrigin') private _notificationsOrigin: MatButton;
|
@ViewChild('notificationsOrigin') private _notificationsOrigin: MatButton;
|
||||||
@ViewChild('notificationsPanel') private _notificationsPanel: TemplateRef<any>;
|
@ViewChild('notificationsPanel') private _notificationsPanel: TemplateRef<any>;
|
||||||
|
|
||||||
|
notifications: Notification[];
|
||||||
unreadCount: number = 0;
|
unreadCount: number = 0;
|
||||||
private _overlayRef: OverlayRef;
|
private _overlayRef: OverlayRef;
|
||||||
private _unsubscribeAll: Subject<any> = new Subject<any>();
|
private _unsubscribeAll: Subject<any> = new Subject<any>();
|
||||||
@@ -40,21 +40,6 @@ export class NotificationsComponent implements OnChanges, OnInit, OnDestroy
|
|||||||
// @ Lifecycle hooks
|
// @ Lifecycle hooks
|
||||||
// -----------------------------------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
/**
|
|
||||||
* On changes
|
|
||||||
*
|
|
||||||
* @param changes
|
|
||||||
*/
|
|
||||||
ngOnChanges(changes: SimpleChanges): void
|
|
||||||
{
|
|
||||||
// Notifications
|
|
||||||
if ( 'notifications' in changes )
|
|
||||||
{
|
|
||||||
// Store the notifications on the service
|
|
||||||
this._notificationsService.store(changes.notifications.currentValue);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* On init
|
* On init
|
||||||
*/
|
*/
|
||||||
@@ -182,7 +167,7 @@ export class NotificationsComponent implements OnChanges, OnInit, OnDestroy
|
|||||||
scrollStrategy : this._overlay.scrollStrategies.block(),
|
scrollStrategy : this._overlay.scrollStrategies.block(),
|
||||||
positionStrategy: this._overlay.position()
|
positionStrategy: this._overlay.position()
|
||||||
.flexibleConnectedTo(this._notificationsOrigin._elementRef.nativeElement)
|
.flexibleConnectedTo(this._notificationsOrigin._elementRef.nativeElement)
|
||||||
.withLockedPosition()
|
.withLockedPosition(true)
|
||||||
.withPush(true)
|
.withPush(true)
|
||||||
.withPositions([
|
.withPositions([
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { Injectable } from '@angular/core';
|
|||||||
import { HttpClient } from '@angular/common/http';
|
import { HttpClient } from '@angular/common/http';
|
||||||
import { Observable, ReplaySubject } from 'rxjs';
|
import { Observable, ReplaySubject } from 'rxjs';
|
||||||
import { Notification } from 'app/layout/common/notifications/notifications.types';
|
import { Notification } from 'app/layout/common/notifications/notifications.types';
|
||||||
import { map, switchMap, take } from 'rxjs/operators';
|
import { map, switchMap, take, tap } from 'rxjs/operators';
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
@@ -35,17 +35,15 @@ export class NotificationsService
|
|||||||
// -----------------------------------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Store notifications on the service
|
* Get all notifications
|
||||||
*
|
|
||||||
* @param notifications
|
|
||||||
*/
|
*/
|
||||||
store(notifications: Notification[]): Observable<Notification[]>
|
getAll(): Observable<Notification[]>
|
||||||
{
|
{
|
||||||
// Load the notifications
|
return this._httpClient.get<Notification[]>('api/common/notifications').pipe(
|
||||||
this._notifications.next(notifications);
|
tap((notifications) => {
|
||||||
|
this._notifications.next(notifications);
|
||||||
// Return the notifications
|
})
|
||||||
return this.notifications$;
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
196
src/app/layout/common/quick-chat/quick-chat.component.html
Normal file
196
src/app/layout/common/quick-chat/quick-chat.component.html
Normal file
@@ -0,0 +1,196 @@
|
|||||||
|
<div class="fixed lg:sticky top-0 bottom-0 lg:left-full w-full sm:w-96 lg:w-16 lg:h-screen lg:shadow">
|
||||||
|
<div
|
||||||
|
class="flex flex-col w-full sm:w-96 h-full transform transition-transform duration-400 ease-drawer bg-card"
|
||||||
|
[ngClass]="{'-translate-x-full sm:-translate-x-96 lg:-translate-x-80 shadow': opened, 'translate-x-0': !opened}">
|
||||||
|
|
||||||
|
<!-- Header -->
|
||||||
|
<div
|
||||||
|
class="quick-chat-header flex flex-0 items-center justify-start cursor-pointer"
|
||||||
|
(click)="toggle()">
|
||||||
|
|
||||||
|
<!-- Toggle -->
|
||||||
|
<ng-container *ngIf="!opened || (opened && !selectedChat)">
|
||||||
|
<div class="flex flex-auto items-center justify-center">
|
||||||
|
<div class="flex flex-0 items-center justify-center w-16">
|
||||||
|
<mat-icon
|
||||||
|
class="icon-size-6"
|
||||||
|
[svgIcon]="'heroicons_outline:chat-alt-2'"></mat-icon>
|
||||||
|
</div>
|
||||||
|
<div class="text-lg font-medium text-secondary">Team Chat</div>
|
||||||
|
<button
|
||||||
|
class="ml-auto mr-4"
|
||||||
|
mat-icon-button>
|
||||||
|
<mat-icon [svgIcon]="'heroicons_outline:x'"></mat-icon>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</ng-container>
|
||||||
|
|
||||||
|
<!-- Contact info -->
|
||||||
|
<ng-container *ngIf="opened && selectedChat">
|
||||||
|
<div class="flex flex-auto items-center ml-3">
|
||||||
|
<div class="relative flex flex-0 items-center justify-center w-10 h-10">
|
||||||
|
<ng-container *ngIf="chat.contact.avatar">
|
||||||
|
<img
|
||||||
|
class="w-full h-full rounded-full object-cover"
|
||||||
|
[src]="chat.contact.avatar"
|
||||||
|
alt="Contact avatar"/>
|
||||||
|
</ng-container>
|
||||||
|
<ng-container *ngIf="!chat.contact.avatar">
|
||||||
|
<div class="flex items-center justify-center w-full h-full rounded-full text-lg uppercase bg-gray-200 text-gray-600 dark:bg-gray-700 dark:text-gray-200">
|
||||||
|
{{chat.contact.name.charAt(0)}}
|
||||||
|
</div>
|
||||||
|
</ng-container>
|
||||||
|
</div>
|
||||||
|
<div class="ml-4 text-lg font-medium leading-5 truncate">{{chat.contact.name}}</div>
|
||||||
|
<button
|
||||||
|
class="ml-auto mr-4"
|
||||||
|
mat-icon-button>
|
||||||
|
<mat-icon [svgIcon]="'heroicons_outline:x'"></mat-icon>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</ng-container>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Content -->
|
||||||
|
<div class="flex flex-auto border-t overflow-hidden">
|
||||||
|
|
||||||
|
<!-- Chat list -->
|
||||||
|
<div
|
||||||
|
class="flex-0 w-16 h-full overflow-y-auto overscroll-y-contain sm:overflow-hidden sm:overscroll-auto"
|
||||||
|
fuseScrollbar
|
||||||
|
[fuseScrollbarOptions]="{wheelPropagation: false}">
|
||||||
|
<div class="flex-auto">
|
||||||
|
<ng-container *ngFor="let chat of chats; trackBy: trackByFn">
|
||||||
|
<div
|
||||||
|
class="flex items-center py-3 px-4 cursor-pointer"
|
||||||
|
[ngClass]="{'hover:bg-gray-100 dark:hover:bg-hover': !selectedChat || selectedChat.id !== chat.id,
|
||||||
|
'bg-primary-50 dark:bg-hover': selectedChat && selectedChat.id === chat.id}"
|
||||||
|
(click)="selectChat(chat.id)">
|
||||||
|
<div class="relative flex flex-0 items-center justify-center w-8 h-8">
|
||||||
|
<ng-container *ngIf="chat.unreadCount > 0">
|
||||||
|
<div
|
||||||
|
class="absolute bottom-0 right-0 flex-0 w-2 h-2 -ml-0.5 rounded-full ring-2 ring-bg-card dark:ring-gray-900 bg-primary dark:bg-primary-500 text-on-primary"
|
||||||
|
[class.ring-primary-50]="selectedChat && selectedChat.id === chat.id"></div>
|
||||||
|
</ng-container>
|
||||||
|
<ng-container *ngIf="chat.contact.avatar">
|
||||||
|
<img
|
||||||
|
class="w-full h-full rounded-full object-cover"
|
||||||
|
[src]="chat.contact.avatar"
|
||||||
|
alt="Contact avatar"/>
|
||||||
|
</ng-container>
|
||||||
|
<ng-container *ngIf="!chat.contact.avatar">
|
||||||
|
<div class="flex items-center justify-center w-full h-full rounded-full text-lg uppercase bg-gray-200 text-gray-600 dark:bg-gray-700 dark:text-gray-200">
|
||||||
|
{{chat.contact.name.charAt(0)}}
|
||||||
|
</div>
|
||||||
|
</ng-container>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</ng-container>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Conversation -->
|
||||||
|
<div class="flex flex-col flex-auto border-l overflow-hidden bg-gray-50 dark:bg-transparent">
|
||||||
|
<ng-container *ngIf="chat; else selectChatOrStartNew">
|
||||||
|
<div class="flex flex-col-reverse overflow-y-auto overscroll-y-contain">
|
||||||
|
<div class="flex flex-col flex-auto flex-shrink p-6">
|
||||||
|
<ng-container *ngFor="let message of chat.messages; let i = index; let first = first; let last = last; trackBy: trackByFn">
|
||||||
|
<!-- Start of the day -->
|
||||||
|
<ng-container *ngIf="first || (chat.messages[i - 1].createdAt | date:'d') !== (message.createdAt | date:'d')">
|
||||||
|
<div class="flex items-center justify-center my-3 -mx-6">
|
||||||
|
<div class="flex-auto border-b"></div>
|
||||||
|
<div class="flex-0 mx-4 text-sm font-medium leading-5 text-secondary">
|
||||||
|
{{message.createdAt | date: 'longDate'}}
|
||||||
|
</div>
|
||||||
|
<div class="flex-auto border-b"></div>
|
||||||
|
</div>
|
||||||
|
</ng-container>
|
||||||
|
<div
|
||||||
|
class="flex flex-col"
|
||||||
|
[ngClass]="{'items-end': message.isMine,
|
||||||
|
'items-start': !message.isMine,
|
||||||
|
'mt-0.5': i > 0 && chat.messages[i - 1].isMine === message.isMine,
|
||||||
|
'mt-3': i > 0 && chat.messages[i - 1].isMine !== message.isMine}">
|
||||||
|
<!-- Bubble -->
|
||||||
|
<div
|
||||||
|
class="relative max-w-3/4 px-3 py-2 rounded-lg"
|
||||||
|
[ngClass]="{'bg-blue-500 text-blue-50': message.isMine,
|
||||||
|
'bg-gray-500 text-gray-50': !message.isMine}">
|
||||||
|
<!-- Speech bubble tail -->
|
||||||
|
<ng-container *ngIf="last || chat.messages[i + 1].isMine !== message.isMine">
|
||||||
|
<div
|
||||||
|
class="absolute bottom-0 w-3 transform"
|
||||||
|
[ngClass]="{'text-blue-500 -right-1 -mr-px mb-px': message.isMine,
|
||||||
|
'text-gray-500 -left-1 -ml-px mb-px -scale-x-1': !message.isMine}">
|
||||||
|
<ng-container *ngTemplateOutlet="speechBubbleExtension"></ng-container>
|
||||||
|
</div>
|
||||||
|
</ng-container>
|
||||||
|
<!-- Message -->
|
||||||
|
<div
|
||||||
|
class="min-w-4 leading-5"
|
||||||
|
[innerHTML]="message.value">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- Time -->
|
||||||
|
<ng-container
|
||||||
|
*ngIf="first
|
||||||
|
|| last
|
||||||
|
|| chat.messages[i + 1].isMine !== message.isMine
|
||||||
|
|| chat.messages[i + 1].createdAt !== message.createdAt">
|
||||||
|
<div
|
||||||
|
class="my-0.5 text-sm font-medium text-secondary"
|
||||||
|
[ngClass]="{'mr-3': message.isMine,
|
||||||
|
'ml-3': !message.isMine}">
|
||||||
|
{{message.createdAt | date:'HH:mm'}}
|
||||||
|
</div>
|
||||||
|
</ng-container>
|
||||||
|
</div>
|
||||||
|
</ng-container>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Message field -->
|
||||||
|
<div class="flex items-end p-4 border-t bg-gray-50 dark:bg-transparent">
|
||||||
|
<mat-form-field class="fuse-mat-dense fuse-mat-no-subscript fuse-mat-rounded fuse-mat-bold w-full">
|
||||||
|
<textarea
|
||||||
|
class="min-h-5 my-0 resize-none"
|
||||||
|
style="margin: 11px 0 !important; padding: 0 !important;"
|
||||||
|
[rows]="1"
|
||||||
|
matInput
|
||||||
|
#messageInput></textarea>
|
||||||
|
</mat-form-field>
|
||||||
|
<div class="flex items-center h-11 my-px ml-4">
|
||||||
|
<button
|
||||||
|
mat-icon-button>
|
||||||
|
<mat-icon
|
||||||
|
class="transform rotate-90"
|
||||||
|
[svgIcon]="'heroicons_outline:paper-airplane'"></mat-icon>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</ng-container>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Select chat or start new template -->
|
||||||
|
<ng-template #selectChatOrStartNew>
|
||||||
|
<div class="flex flex-col flex-auto items-center justify-center w-full h-full p-4">
|
||||||
|
<mat-icon
|
||||||
|
class="icon-size-20"
|
||||||
|
[svgIcon]="'iconsmind:speach_bubble'"></mat-icon>
|
||||||
|
<div class="mt-4 text-xl text-center font-medium tracking-tight text-secondary">Select a conversation</div>
|
||||||
|
</div>
|
||||||
|
</ng-template>
|
||||||
|
|
||||||
|
<!-- Speech bubble tail SVG -->
|
||||||
|
<!-- @formatter:off -->
|
||||||
|
<ng-template #speechBubbleExtension>
|
||||||
|
<svg width="100%" height="100%" viewBox="0 0 66 66" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||||
|
<path d="M1.01522827,0.516204834 C-8.83532715,54.3062744 61.7609863,70.5215302 64.8009949,64.3061218 C68.8074951,54.8859711 30.1663208,52.9997559 37.5036011,0.516204834 L1.01522827,0.516204834 Z" fill="currentColor" fill-rule="nonzero"></path>
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
</ng-template>
|
||||||
|
<!-- @formatter:on -->
|
||||||
58
src/app/layout/common/quick-chat/quick-chat.component.scss
Normal file
58
src/app/layout/common/quick-chat/quick-chat.component.scss
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
quick-chat {
|
||||||
|
z-index: 399;
|
||||||
|
|
||||||
|
> div {
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.quick-chat-opened {
|
||||||
|
|
||||||
|
> div {
|
||||||
|
overflow: visible;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
:not(&.quick-chat-opened) {
|
||||||
|
|
||||||
|
> div {
|
||||||
|
overflow: visible;
|
||||||
|
animation: addOverflowHidden 1ms linear 400ms;
|
||||||
|
animation-fill-mode: forwards;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Adjustments depending on the selected layout */
|
||||||
|
.quick-chat-header {
|
||||||
|
height: 64px;
|
||||||
|
|
||||||
|
enterprise-layout &,
|
||||||
|
modern-layout & {
|
||||||
|
height: 80px !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* Overlay */
|
||||||
|
.quick-chat-overlay {
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
z-index: 299;
|
||||||
|
opacity: 1;
|
||||||
|
background-color: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes addOverflowHidden {
|
||||||
|
0% {
|
||||||
|
overflow: visible
|
||||||
|
}
|
||||||
|
99% {
|
||||||
|
overflow: visible;
|
||||||
|
}
|
||||||
|
100% {
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
}
|
||||||
275
src/app/layout/common/quick-chat/quick-chat.component.ts
Normal file
275
src/app/layout/common/quick-chat/quick-chat.component.ts
Normal file
@@ -0,0 +1,275 @@
|
|||||||
|
import { Component, ElementRef, HostBinding, HostListener, NgZone, OnDestroy, OnInit, Renderer2, ViewChild, ViewEncapsulation } from '@angular/core';
|
||||||
|
import { ScrollStrategy, ScrollStrategyOptions } from '@angular/cdk/overlay';
|
||||||
|
import { Subject } from 'rxjs';
|
||||||
|
import { takeUntil } from 'rxjs/operators';
|
||||||
|
import { QuickChatService } from 'app/layout/common/quick-chat/quick-chat.service';
|
||||||
|
import { Chat } from 'app/layout/common/quick-chat/quick-chat.types';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector : 'quick-chat',
|
||||||
|
templateUrl : './quick-chat.component.html',
|
||||||
|
styleUrls : ['./quick-chat.component.scss'],
|
||||||
|
encapsulation: ViewEncapsulation.None,
|
||||||
|
exportAs : 'quickChat'
|
||||||
|
})
|
||||||
|
export class QuickChatComponent implements OnInit, OnDestroy
|
||||||
|
{
|
||||||
|
@ViewChild('messageInput') messageInput: ElementRef;
|
||||||
|
chat: Chat;
|
||||||
|
chats: Chat[];
|
||||||
|
opened: boolean = false;
|
||||||
|
selectedChat: Chat;
|
||||||
|
private _scrollStrategy: ScrollStrategy = this._scrollStrategyOptions.block();
|
||||||
|
private _overlay: HTMLElement;
|
||||||
|
private _unsubscribeAll: Subject<any> = new Subject<any>();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor
|
||||||
|
*/
|
||||||
|
constructor(
|
||||||
|
private _elementRef: ElementRef,
|
||||||
|
private _renderer2: Renderer2,
|
||||||
|
private _ngZone: NgZone,
|
||||||
|
private _quickChatService: QuickChatService,
|
||||||
|
private _scrollStrategyOptions: ScrollStrategyOptions
|
||||||
|
)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------------------------------
|
||||||
|
// @ Decorated methods
|
||||||
|
// -----------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Host binding for component classes
|
||||||
|
*/
|
||||||
|
@HostBinding('class') get classList(): any
|
||||||
|
{
|
||||||
|
return {
|
||||||
|
'quick-chat-opened': this.opened
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Resize on 'input' and 'ngModelChange' events
|
||||||
|
*
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
@HostListener('input')
|
||||||
|
@HostListener('ngModelChange')
|
||||||
|
private _resizeMessageInput(): void
|
||||||
|
{
|
||||||
|
// This doesn't need to trigger Angular's change detection by itself
|
||||||
|
this._ngZone.runOutsideAngular(() => {
|
||||||
|
|
||||||
|
setTimeout(() => {
|
||||||
|
|
||||||
|
// Set the height to 'auto' so we can correctly read the scrollHeight
|
||||||
|
this.messageInput.nativeElement.style.height = 'auto';
|
||||||
|
|
||||||
|
// Get the scrollHeight and subtract the vertical padding
|
||||||
|
this.messageInput.nativeElement.style.height = `${this.messageInput.nativeElement.scrollHeight}px`;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------------------------------
|
||||||
|
// @ Lifecycle hooks
|
||||||
|
// -----------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
/**
|
||||||
|
* On init
|
||||||
|
*/
|
||||||
|
ngOnInit(): void
|
||||||
|
{
|
||||||
|
// Chat
|
||||||
|
this._quickChatService.chat$
|
||||||
|
.pipe(takeUntil(this._unsubscribeAll))
|
||||||
|
.subscribe((chat: Chat) => {
|
||||||
|
this.chat = chat;
|
||||||
|
});
|
||||||
|
|
||||||
|
// Chats
|
||||||
|
this._quickChatService.chats$
|
||||||
|
.pipe(takeUntil(this._unsubscribeAll))
|
||||||
|
.subscribe((chats: Chat[]) => {
|
||||||
|
this.chats = chats;
|
||||||
|
});
|
||||||
|
|
||||||
|
// Selected chat
|
||||||
|
this._quickChatService.chat$
|
||||||
|
.pipe(takeUntil(this._unsubscribeAll))
|
||||||
|
.subscribe((chat: Chat) => {
|
||||||
|
this.selectedChat = chat;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* On destroy
|
||||||
|
*/
|
||||||
|
ngOnDestroy(): void
|
||||||
|
{
|
||||||
|
// Unsubscribe from all subscriptions
|
||||||
|
this._unsubscribeAll.next();
|
||||||
|
this._unsubscribeAll.complete();
|
||||||
|
}
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------------------------------
|
||||||
|
// @ Public methods
|
||||||
|
// -----------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Open the panel
|
||||||
|
*/
|
||||||
|
open(): void
|
||||||
|
{
|
||||||
|
// Return if the panel has already opened
|
||||||
|
if ( this.opened )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Open the panel
|
||||||
|
this._toggleOpened(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Close the panel
|
||||||
|
*/
|
||||||
|
close(): void
|
||||||
|
{
|
||||||
|
// Return if the panel has already closed
|
||||||
|
if ( !this.opened )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Close the panel
|
||||||
|
this._toggleOpened(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Toggle the panel
|
||||||
|
*/
|
||||||
|
toggle(): void
|
||||||
|
{
|
||||||
|
if ( this.opened )
|
||||||
|
{
|
||||||
|
this.close();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
this.open();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Select the chat
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
*/
|
||||||
|
selectChat(id: string): void
|
||||||
|
{
|
||||||
|
// Open the panel
|
||||||
|
this._toggleOpened(true);
|
||||||
|
|
||||||
|
// Get the chat data
|
||||||
|
this._quickChatService.getChatById(id).subscribe();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Track by function for ngFor loops
|
||||||
|
*
|
||||||
|
* @param index
|
||||||
|
* @param item
|
||||||
|
*/
|
||||||
|
trackByFn(index: number, item: any): any
|
||||||
|
{
|
||||||
|
return item.id || index;
|
||||||
|
}
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------------------------------
|
||||||
|
// @ Private methods
|
||||||
|
// -----------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Show the backdrop
|
||||||
|
*
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
private _showOverlay(): void
|
||||||
|
{
|
||||||
|
// Try hiding the overlay in case there is one already opened
|
||||||
|
this._hideOverlay();
|
||||||
|
|
||||||
|
// Create the backdrop element
|
||||||
|
this._overlay = this._renderer2.createElement('div');
|
||||||
|
|
||||||
|
// Return if overlay couldn't be create for some reason
|
||||||
|
if ( !this._overlay )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add a class to the backdrop element
|
||||||
|
this._overlay.classList.add('quick-chat-overlay');
|
||||||
|
|
||||||
|
// Append the backdrop to the parent of the panel
|
||||||
|
this._renderer2.appendChild(this._elementRef.nativeElement.parentElement, this._overlay);
|
||||||
|
|
||||||
|
// Enable block scroll strategy
|
||||||
|
this._scrollStrategy.enable();
|
||||||
|
|
||||||
|
// Add an event listener to the overlay
|
||||||
|
this._overlay.addEventListener('click', () => {
|
||||||
|
this.close();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Hide the backdrop
|
||||||
|
*
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
private _hideOverlay(): void
|
||||||
|
{
|
||||||
|
if ( !this._overlay )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// If the backdrop still exists...
|
||||||
|
if ( this._overlay )
|
||||||
|
{
|
||||||
|
// Remove the backdrop
|
||||||
|
this._overlay.parentNode.removeChild(this._overlay);
|
||||||
|
this._overlay = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Disable block scroll strategy
|
||||||
|
this._scrollStrategy.disable();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Open/close the panel
|
||||||
|
*
|
||||||
|
* @param open
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
private _toggleOpened(open: boolean): void
|
||||||
|
{
|
||||||
|
// Set the opened
|
||||||
|
this.opened = open;
|
||||||
|
|
||||||
|
// If the panel opens, show the overlay
|
||||||
|
if ( open )
|
||||||
|
{
|
||||||
|
this._showOverlay();
|
||||||
|
}
|
||||||
|
// Otherwise, hide the overlay
|
||||||
|
else
|
||||||
|
{
|
||||||
|
this._hideOverlay();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
32
src/app/layout/common/quick-chat/quick-chat.module.ts
Normal file
32
src/app/layout/common/quick-chat/quick-chat.module.ts
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
import { NgModule } from '@angular/core';
|
||||||
|
import { RouterModule } from '@angular/router';
|
||||||
|
import { MatButtonModule } from '@angular/material/button';
|
||||||
|
import { MatFormFieldModule } from '@angular/material/form-field';
|
||||||
|
import { MatIconModule } from '@angular/material/icon';
|
||||||
|
import { MatInputModule } from '@angular/material/input';
|
||||||
|
import { FuseDrawerModule } from '@fuse/components/drawer';
|
||||||
|
import { FuseScrollbarModule } from '@fuse/directives/scrollbar';
|
||||||
|
import { SharedModule } from 'app/shared/shared.module';
|
||||||
|
import { QuickChatComponent } from 'app/layout/common/quick-chat/quick-chat.component';
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
declarations: [
|
||||||
|
QuickChatComponent
|
||||||
|
],
|
||||||
|
imports: [
|
||||||
|
RouterModule,
|
||||||
|
MatButtonModule,
|
||||||
|
MatFormFieldModule,
|
||||||
|
MatIconModule,
|
||||||
|
MatInputModule,
|
||||||
|
FuseDrawerModule,
|
||||||
|
FuseScrollbarModule,
|
||||||
|
SharedModule,
|
||||||
|
],
|
||||||
|
exports : [
|
||||||
|
QuickChatComponent
|
||||||
|
]
|
||||||
|
})
|
||||||
|
export class QuickChatModule
|
||||||
|
{
|
||||||
|
}
|
||||||
85
src/app/layout/common/quick-chat/quick-chat.service.ts
Normal file
85
src/app/layout/common/quick-chat/quick-chat.service.ts
Normal file
@@ -0,0 +1,85 @@
|
|||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
import { HttpClient } from '@angular/common/http';
|
||||||
|
import { BehaviorSubject, Observable, of, throwError } from 'rxjs';
|
||||||
|
import { map, switchMap, tap } from 'rxjs/operators';
|
||||||
|
import { Chat } from 'app/layout/common/quick-chat/quick-chat.types';
|
||||||
|
|
||||||
|
@Injectable({
|
||||||
|
providedIn: 'root'
|
||||||
|
})
|
||||||
|
export class QuickChatService
|
||||||
|
{
|
||||||
|
private _chat: BehaviorSubject<Chat> = new BehaviorSubject(null);
|
||||||
|
private _chats: BehaviorSubject<Chat[]> = new BehaviorSubject<Chat[]>(null);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor
|
||||||
|
*/
|
||||||
|
constructor(private _httpClient: HttpClient)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------------------------------
|
||||||
|
// @ Accessors
|
||||||
|
// -----------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Getter for chat
|
||||||
|
*/
|
||||||
|
get chat$(): Observable<Chat>
|
||||||
|
{
|
||||||
|
return this._chat.asObservable();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Getter for chat
|
||||||
|
*/
|
||||||
|
get chats$(): Observable<Chat[]>
|
||||||
|
{
|
||||||
|
return this._chats.asObservable();
|
||||||
|
}
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------------------------------
|
||||||
|
// @ Public methods
|
||||||
|
// -----------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get chats
|
||||||
|
*/
|
||||||
|
getChats(): Observable<any>
|
||||||
|
{
|
||||||
|
return this._httpClient.get<Chat[]>('api/apps/chat/chats').pipe(
|
||||||
|
tap((response: Chat[]) => {
|
||||||
|
this._chats.next(response);
|
||||||
|
})
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get chat
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
*/
|
||||||
|
getChatById(id: string): Observable<any>
|
||||||
|
{
|
||||||
|
return this._httpClient.get<Chat>('api/apps/chat/chat', {params: {id}}).pipe(
|
||||||
|
map((chat) => {
|
||||||
|
|
||||||
|
// Update the chat
|
||||||
|
this._chat.next(chat);
|
||||||
|
|
||||||
|
// Return the chat
|
||||||
|
return chat;
|
||||||
|
}),
|
||||||
|
switchMap((chat) => {
|
||||||
|
|
||||||
|
if ( !chat )
|
||||||
|
{
|
||||||
|
return throwError('Could not found chat with id of ' + id + '!');
|
||||||
|
}
|
||||||
|
|
||||||
|
return of(chat);
|
||||||
|
})
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
46
src/app/layout/common/quick-chat/quick-chat.types.ts
Normal file
46
src/app/layout/common/quick-chat/quick-chat.types.ts
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
export interface Chat
|
||||||
|
{
|
||||||
|
id?: string;
|
||||||
|
contactId?: string;
|
||||||
|
contact?: Contact;
|
||||||
|
unreadCount?: number;
|
||||||
|
muted?: boolean;
|
||||||
|
lastMessage?: string;
|
||||||
|
lastMessageAt?: string;
|
||||||
|
messages?: {
|
||||||
|
id?: string;
|
||||||
|
chatId?: string;
|
||||||
|
contactId?: string;
|
||||||
|
isMine?: boolean;
|
||||||
|
value?: string;
|
||||||
|
createdAt?: string;
|
||||||
|
}[];
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface Contact
|
||||||
|
{
|
||||||
|
id?: string;
|
||||||
|
avatar?: string;
|
||||||
|
name?: string;
|
||||||
|
about?: string;
|
||||||
|
details?: {
|
||||||
|
emails?: {
|
||||||
|
email?: string;
|
||||||
|
label?: string;
|
||||||
|
}[];
|
||||||
|
phoneNumbers?: {
|
||||||
|
country?: string;
|
||||||
|
phoneNumber?: string;
|
||||||
|
label?: string;
|
||||||
|
}[];
|
||||||
|
title?: string;
|
||||||
|
company?: string;
|
||||||
|
birthday?: string;
|
||||||
|
address?: string;
|
||||||
|
};
|
||||||
|
attachments?: {
|
||||||
|
media?: any[];
|
||||||
|
docs?: any[];
|
||||||
|
links?: any[];
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -6,7 +6,6 @@
|
|||||||
(click)="open()">
|
(click)="open()">
|
||||||
<mat-icon [svgIcon]="'heroicons_outline:search'"></mat-icon>
|
<mat-icon [svgIcon]="'heroicons_outline:search'"></mat-icon>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
class="absolute inset-0 flex items-center flex-shrink-0 z-99 bg-card"
|
class="absolute inset-0 flex items-center flex-shrink-0 z-99 bg-card"
|
||||||
*ngIf="opened"
|
*ngIf="opened"
|
||||||
@@ -23,22 +22,36 @@
|
|||||||
(keydown)="onKeydown($event)"
|
(keydown)="onKeydown($event)"
|
||||||
#barSearchInput>
|
#barSearchInput>
|
||||||
<mat-autocomplete
|
<mat-autocomplete
|
||||||
class="max-h-128 border-t rounded-b shadow-md"
|
class="max-h-128 sm:px-2 border-t rounded-b shadow-md"
|
||||||
[disableRipple]="true"
|
[disableRipple]="true"
|
||||||
#matAutocomplete="matAutocomplete">
|
#matAutocomplete="matAutocomplete">
|
||||||
<mat-option
|
<mat-option
|
||||||
class="h-14 px-6 py-0 sm:px-8 text-md pointer-events-none text-secondary bg-transparent"
|
class="py-0 px-6 text-md pointer-events-none text-secondary bg-transparent"
|
||||||
*ngIf="results && !results.length">
|
*ngIf="resultSets && !resultSets.length">
|
||||||
No results found!
|
No results found!
|
||||||
</mat-option>
|
</mat-option>
|
||||||
<ng-container *ngFor="let result of results; trackBy: trackByFn">
|
<ng-container *ngFor="let resultSet of resultSets; trackBy: trackByFn">
|
||||||
<mat-option
|
<mat-optgroup class="flex items-center mt-2 px-2">
|
||||||
class="group relative h-14 px-6 py-0 sm:px-8 text-md"
|
<span class="text-sm font-semibold tracking-wider text-secondary">{{resultSet.label.toUpperCase()}}</span>
|
||||||
[routerLink]="result.link">
|
</mat-optgroup>
|
||||||
<ng-container
|
<ng-container *ngFor="let result of resultSet.results; trackBy: trackByFn">
|
||||||
[ngTemplateOutlet]="searchResult"
|
<mat-option
|
||||||
[ngTemplateOutletContext]="{$implicit: result}"></ng-container>
|
class="group relative mb-1 py-0 px-6 text-md rounded-md hover:bg-gray-100 dark:hover:bg-hover"
|
||||||
</mat-option>
|
[routerLink]="result.link">
|
||||||
|
<!-- Contacts -->
|
||||||
|
<ng-container *ngIf="resultSet.id === 'contacts'">
|
||||||
|
<ng-container *ngTemplateOutlet="contactResult; context: {$implicit: result}"></ng-container>
|
||||||
|
</ng-container>
|
||||||
|
<!-- Pages -->
|
||||||
|
<ng-container *ngIf="resultSet.id === 'pages'">
|
||||||
|
<ng-container *ngTemplateOutlet="pageResult; context: {$implicit: result}"></ng-container>
|
||||||
|
</ng-container>
|
||||||
|
<!-- Tasks -->
|
||||||
|
<ng-container *ngIf="resultSet.id === 'tasks'">
|
||||||
|
<ng-container *ngTemplateOutlet="taskResult; context: {$implicit: result}"></ng-container>
|
||||||
|
</ng-container>
|
||||||
|
</mat-option>
|
||||||
|
</ng-container>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
</mat-autocomplete>
|
</mat-autocomplete>
|
||||||
<button
|
<button
|
||||||
@@ -69,62 +82,89 @@
|
|||||||
[disableRipple]="true"
|
[disableRipple]="true"
|
||||||
#matAutocomplete="matAutocomplete">
|
#matAutocomplete="matAutocomplete">
|
||||||
<mat-option
|
<mat-option
|
||||||
class="h-14 px-5 py-0 text-md pointer-events-none text-secondary bg-transparent"
|
class="py-0 px-6 text-md pointer-events-none text-secondary bg-transparent"
|
||||||
*ngIf="results && !results.length">
|
*ngIf="resultSets && !resultSets.length">
|
||||||
No results found!
|
No results found!
|
||||||
</mat-option>
|
</mat-option>
|
||||||
<ng-container *ngFor="let result of results; trackBy: trackByFn">
|
<ng-container *ngFor="let resultSet of resultSets; trackBy: trackByFn">
|
||||||
<mat-option
|
<mat-optgroup class="flex items-center mt-2 px-2">
|
||||||
class="group relative h-14 px-5 py-0 text-md"
|
<span class="text-sm font-semibold tracking-wider text-secondary">{{resultSet.label.toUpperCase()}}</span>
|
||||||
[routerLink]="result.link">
|
</mat-optgroup>
|
||||||
<ng-container
|
<ng-container *ngFor="let result of resultSet.results; trackBy: trackByFn">
|
||||||
[ngTemplateOutlet]="searchResult"
|
<mat-option
|
||||||
[ngTemplateOutletContext]="{$implicit: result}"></ng-container>
|
class="group relative mb-1 py-0 px-6 text-md rounded-md hover:bg-gray-100 dark:hover:bg-hover"
|
||||||
</mat-option>
|
[routerLink]="result.link">
|
||||||
|
<!-- Contacts -->
|
||||||
|
<ng-container *ngIf="resultSet.id === 'contacts'">
|
||||||
|
<ng-container *ngTemplateOutlet="contactResult; context: {$implicit: result}"></ng-container>
|
||||||
|
</ng-container>
|
||||||
|
<!-- Pages -->
|
||||||
|
<ng-container *ngIf="resultSet.id === 'pages'">
|
||||||
|
<ng-container *ngTemplateOutlet="pageResult; context: {$implicit: result}"></ng-container>
|
||||||
|
</ng-container>
|
||||||
|
<!-- Tasks -->
|
||||||
|
<ng-container *ngIf="resultSet.id === 'tasks'">
|
||||||
|
<ng-container *ngTemplateOutlet="taskResult; context: {$implicit: result}"></ng-container>
|
||||||
|
</ng-container>
|
||||||
|
</mat-option>
|
||||||
|
</ng-container>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
</mat-autocomplete>
|
</mat-autocomplete>
|
||||||
</div>
|
</div>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
|
<!-- Contact result template -->
|
||||||
<ng-template
|
<ng-template
|
||||||
#searchResult
|
#contactResult
|
||||||
let-result>
|
let-result>
|
||||||
|
<div class="flex items-center">
|
||||||
<!-- Hover indicator -->
|
<div class="flex flex-shrink-0 items-center justify-center w-8 h-8 rounded-full overflow-hidden bg-primary-100 dark:bg-primary-800">
|
||||||
<div class="absolute inset-y-0 left-0 hidden w-1 bg-primary group-hover:flex"></div>
|
<img
|
||||||
|
*ngIf="result.avatar"
|
||||||
<!-- Contact result -->
|
[src]="result.avatar">
|
||||||
<ng-container *ngIf="result.resultType === 'contact'">
|
<mat-icon
|
||||||
<div class="flex items-center">
|
class="m-0 icon-size-5 text-primary dark:text-primary-400"
|
||||||
<div class="px-1.5 py-1 mr-4 text-xs font-semibold leading-normal rounded text-indigo-50 bg-indigo-600">Contact</div>
|
*ngIf="!result.avatar"
|
||||||
<div class="overflow-hidden overflow-ellipsis">
|
[svgIcon]="'heroicons_outline:user-circle'"></mat-icon>
|
||||||
<span [innerHTML]="result.title"></span>
|
|
||||||
</div>
|
|
||||||
<div class="flex flex-shrink-0 items-center justify-center w-8 h-8 ml-auto rounded-full overflow-hidden bg-primary-100 dark:bg-black dark:bg-opacity-5">
|
|
||||||
<img
|
|
||||||
*ngIf="result.avatar"
|
|
||||||
[src]="result.avatar">
|
|
||||||
<mat-icon
|
|
||||||
class="m-0 icon-size-5 text-primary"
|
|
||||||
*ngIf="!result.avatar"
|
|
||||||
[svgIcon]="'heroicons_outline:user-circle'"></mat-icon>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</ng-container>
|
<div class="ml-3 truncate">
|
||||||
|
<span [innerHTML]="result.name"></span>
|
||||||
<!-- Page result -->
|
|
||||||
<ng-container *ngIf="result.resultType === 'page'">
|
|
||||||
<div class="flex items-center">
|
|
||||||
<div class="px-1.5 py-1 mr-4 text-xs font-semibold leading-normal rounded text-teal-50 bg-teal-600">Page</div>
|
|
||||||
<div class="flex flex-col overflow-hidden overflow-ellipsis">
|
|
||||||
<span
|
|
||||||
class="overflow-hidden overflow-ellipsis whitespace-nowrap leading-normal"
|
|
||||||
[innerHTML]="result.title"></span>
|
|
||||||
<span
|
|
||||||
class="mt-1 text-secondary overflow-hidden overflow-ellipsis whitespace-nowrap leading-normal text-sm no-underline"
|
|
||||||
[routerLink]="result.link">{{result.link}}</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</ng-container>
|
</div>
|
||||||
|
</ng-template>
|
||||||
|
|
||||||
|
<!-- Page result template -->
|
||||||
|
<ng-template
|
||||||
|
#pageResult
|
||||||
|
let-result>
|
||||||
|
<div class="flex flex-col">
|
||||||
|
<div
|
||||||
|
class="truncate leading-normal"
|
||||||
|
[innerHTML]="result.title"></div>
|
||||||
|
<div class="truncate leading-normal text-sm text-secondary">
|
||||||
|
{{result.link}}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</ng-template>
|
||||||
|
|
||||||
|
<!-- Task result template -->
|
||||||
|
<ng-template
|
||||||
|
#taskResult
|
||||||
|
let-result>
|
||||||
|
<div class="flex items-center">
|
||||||
|
<ng-container *ngIf="result.completed">
|
||||||
|
<mat-icon
|
||||||
|
class="mr-0 text-primary dark:text-primary-400"
|
||||||
|
[svgIcon]="'heroicons_outline:check-circle'"></mat-icon>
|
||||||
|
</ng-container>
|
||||||
|
<ng-container *ngIf="!result.completed">
|
||||||
|
<mat-icon
|
||||||
|
class="mr-0 text-hint"
|
||||||
|
[svgIcon]="'heroicons_outline:check-circle'"></mat-icon>
|
||||||
|
</ng-container>
|
||||||
|
<div
|
||||||
|
class="ml-3 truncate leading-normal"
|
||||||
|
[ngClass]="{'line-through text-hint': result.completed}"
|
||||||
|
[innerHTML]="result.title"></div>
|
||||||
|
</div>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ export class SearchComponent implements OnChanges, OnInit, OnDestroy
|
|||||||
@Output() search: EventEmitter<any> = new EventEmitter<any>();
|
@Output() search: EventEmitter<any> = new EventEmitter<any>();
|
||||||
|
|
||||||
opened: boolean = false;
|
opened: boolean = false;
|
||||||
results: any[];
|
resultSets: any[];
|
||||||
searchControl: FormControl = new FormControl();
|
searchControl: FormControl = new FormControl();
|
||||||
private _unsubscribeAll: Subject<any> = new Subject<any>();
|
private _unsubscribeAll: Subject<any> = new Subject<any>();
|
||||||
|
|
||||||
@@ -104,12 +104,12 @@ export class SearchComponent implements OnChanges, OnInit, OnDestroy
|
|||||||
takeUntil(this._unsubscribeAll),
|
takeUntil(this._unsubscribeAll),
|
||||||
map((value) => {
|
map((value) => {
|
||||||
|
|
||||||
// Set the search results to null if there is no value or
|
// Set the resultSets to null if there is no value or
|
||||||
// the length of the value is smaller than the minLength
|
// the length of the value is smaller than the minLength
|
||||||
// so the autocomplete panel can be closed
|
// so the autocomplete panel can be closed
|
||||||
if ( !value || value.length < this.minLength )
|
if ( !value || value.length < this.minLength )
|
||||||
{
|
{
|
||||||
this.results = null;
|
this.resultSets = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Continue
|
// Continue
|
||||||
@@ -121,13 +121,13 @@ export class SearchComponent implements OnChanges, OnInit, OnDestroy
|
|||||||
)
|
)
|
||||||
.subscribe((value) => {
|
.subscribe((value) => {
|
||||||
this._httpClient.post('api/common/search', {query: value})
|
this._httpClient.post('api/common/search', {query: value})
|
||||||
.subscribe((response: any) => {
|
.subscribe((resultSets: any) => {
|
||||||
|
|
||||||
// Store the results
|
// Store the result sets
|
||||||
this.results = response.results;
|
this.resultSets = resultSets;
|
||||||
|
|
||||||
// Execute the event
|
// Execute the event
|
||||||
this.search.next(this.results);
|
this.search.next(resultSets);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
474
src/app/layout/common/settings/settings.component.html
Normal file
474
src/app/layout/common/settings/settings.component.html
Normal file
@@ -0,0 +1,474 @@
|
|||||||
|
<div
|
||||||
|
class="fixed flex items-center justify-center right-0 w-10 h-10 shadow-lg rounded-l-lg z-90 cursor-pointer bg-red-600 bg-opacity-90 print:hidden"
|
||||||
|
[class.lg:right-0]="config.layout === 'centered' || config.layout === 'material'"
|
||||||
|
[class.lg:right-16]="config.layout !== 'centered' && config.layout !== 'material'"
|
||||||
|
style="top: 275px"
|
||||||
|
(click)="settingsDrawer.toggle()">
|
||||||
|
<mat-icon
|
||||||
|
class="icon-size-5 text-white animate-spin-slow"
|
||||||
|
[svgIcon]="'heroicons_solid:cog'"></mat-icon>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<fuse-drawer
|
||||||
|
class="w-screen min-w-screen sm:w-100 sm:min-w-100 z-999"
|
||||||
|
fixed
|
||||||
|
[mode]="'over'"
|
||||||
|
[name]="'settingsDrawer'"
|
||||||
|
[position]="'right'"
|
||||||
|
#settingsDrawer>
|
||||||
|
|
||||||
|
<div class="flex flex-col w-full overflow-auto bg-card">
|
||||||
|
<div class="flex flex-row items-center px-6 h-20 min-h-20 text-white bg-primary">
|
||||||
|
<mat-icon
|
||||||
|
class="icon-size-7 text-current"
|
||||||
|
[svgIcon]="'heroicons_solid:cog'"></mat-icon>
|
||||||
|
<div class="ml-3 text-2xl font-semibold tracking-tight">Settings</div>
|
||||||
|
<button
|
||||||
|
class="ml-auto"
|
||||||
|
mat-icon-button
|
||||||
|
(click)="settingsDrawer.close()">
|
||||||
|
<mat-icon
|
||||||
|
class="text-current"
|
||||||
|
[svgIcon]="'heroicons_outline:x'"></mat-icon>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="flex flex-col p-6">
|
||||||
|
|
||||||
|
<!-- Theme -->
|
||||||
|
<div class="text-md font-semibold text-secondary">THEME</div>
|
||||||
|
<div class="grid grid-cols-2 sm:grid-cols-3 gap-3 mt-6">
|
||||||
|
<ng-container *ngFor="let theme of themes">
|
||||||
|
<div
|
||||||
|
class="flex items-center justify-center px-4 py-3 rounded-full cursor-pointer ring-inset ring-primary bg-hover"
|
||||||
|
[class.ring-2]="config.theme === theme[0]"
|
||||||
|
(click)="setTheme(theme[0])">
|
||||||
|
<div
|
||||||
|
class="flex-0 w-3 h-3 rounded-full"
|
||||||
|
[style.background-color]="theme[1].primary"></div>
|
||||||
|
<div
|
||||||
|
class="ml-2.5 font-medium leading-5 truncate"
|
||||||
|
[class.text-secondary]="config.theme !== theme[0]">
|
||||||
|
{{theme[0] | titlecase}}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</ng-container>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<hr class="my-8">
|
||||||
|
|
||||||
|
<!-- Scheme -->
|
||||||
|
<div class="text-md font-semibold text-secondary">SCHEME</div>
|
||||||
|
<div class="grid grid-cols-3 gap-3 justify-items-start mt-6">
|
||||||
|
<!-- Auto -->
|
||||||
|
<div
|
||||||
|
class="flex items-center py-3 pl-5 pr-6 rounded-full cursor-pointer ring-inset ring-primary bg-hover"
|
||||||
|
[class.ring-2]="config.scheme === 'auto'"
|
||||||
|
matTooltip="Automatically sets the scheme based on user's operating system's color scheme preference using 'prefer-color-scheme' media query."
|
||||||
|
(click)="setScheme('auto')">
|
||||||
|
<div class="flex items-center rounded-full overflow-hidden">
|
||||||
|
<mat-icon
|
||||||
|
class="icon-size-5"
|
||||||
|
[svgIcon]="'heroicons_solid:lightning-bolt'"></mat-icon>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
class="flex items-center ml-2 font-medium leading-5"
|
||||||
|
[class.text-secondary]="config.scheme !== 'auto'">
|
||||||
|
Auto
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- Dark -->
|
||||||
|
<div
|
||||||
|
class="flex items-center py-3 pl-5 pr-6 rounded-full cursor-pointer ring-inset ring-primary bg-hover"
|
||||||
|
[class.ring-2]="config.scheme === 'dark'"
|
||||||
|
(click)="setScheme('dark')">
|
||||||
|
<div class="flex items-center rounded-full overflow-hidden">
|
||||||
|
<mat-icon
|
||||||
|
class="icon-size-5"
|
||||||
|
[svgIcon]="'heroicons_solid:moon'"></mat-icon>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
class="flex items-center ml-2 font-medium leading-5"
|
||||||
|
[class.text-secondary]="config.scheme !== 'dark'">
|
||||||
|
Dark
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- Light -->
|
||||||
|
<div
|
||||||
|
class="flex items-center py-3 pl-5 pr-6 rounded-full cursor-pointer ring-inset ring-primary bg-hover"
|
||||||
|
[class.ring-2]="config.scheme === 'light'"
|
||||||
|
(click)="setScheme('light')">
|
||||||
|
<div class="flex items-center rounded-full overflow-hidden">
|
||||||
|
<mat-icon
|
||||||
|
class="icon-size-5"
|
||||||
|
[svgIcon]="'heroicons_solid:sun'"></mat-icon>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
class="flex items-center ml-2 font-medium leading-5"
|
||||||
|
[class.text-secondary]="config.scheme !== 'light'">
|
||||||
|
Light
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<hr class="my-8">
|
||||||
|
|
||||||
|
<!-- Layout -->
|
||||||
|
<div class="text-md font-semibold text-secondary">LAYOUT</div>
|
||||||
|
<div class="grid grid-cols-3 gap-3 mt-6">
|
||||||
|
|
||||||
|
<!-- Empty -->
|
||||||
|
<div
|
||||||
|
class="flex flex-col cursor-pointer"
|
||||||
|
(click)="setLayout('empty')">
|
||||||
|
<div
|
||||||
|
class="flex flex-col h-20 rounded-md overflow-hidden border-2 hover:opacity-80"
|
||||||
|
[class.border-primary]="config.layout === 'empty'">
|
||||||
|
<div class="flex flex-col flex-auto bg-gray-50 dark:bg-gray-900"></div>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
class="mt-2 text-md font-medium text-center text-secondary"
|
||||||
|
[class.text-primary]="config.layout === 'empty'">
|
||||||
|
Empty
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Classic -->
|
||||||
|
<div
|
||||||
|
class="flex flex-col cursor-pointer"
|
||||||
|
(click)="setLayout('classic')">
|
||||||
|
<div
|
||||||
|
class="flex h-20 rounded-md overflow-hidden border-2 hover:opacity-80"
|
||||||
|
[class.border-primary]="config.layout === 'classic'">
|
||||||
|
<div class="w-8 bg-gray-100 dark:bg-gray-800">
|
||||||
|
<div class="mt-3 mx-1.5 space-y-1">
|
||||||
|
<div class="h-1 rounded-sm bg-gray-300 dark:bg-gray-700"></div>
|
||||||
|
<div class="h-1 rounded-sm bg-gray-300 dark:bg-gray-700"></div>
|
||||||
|
<div class="h-1 rounded-sm bg-gray-300 dark:bg-gray-700"></div>
|
||||||
|
<div class="h-1 rounded-sm bg-gray-300 dark:bg-gray-700"></div>
|
||||||
|
<div class="h-1 rounded-sm bg-gray-300 dark:bg-gray-700"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="flex flex-col flex-auto border-l">
|
||||||
|
<div class="h-3 bg-gray-100 dark:bg-gray-800">
|
||||||
|
<div class="flex items-center justify-end h-full mr-1.5">
|
||||||
|
<div class="w-1 h-1 ml-1 rounded-full bg-gray-300 dark:bg-gray-700"></div>
|
||||||
|
<div class="w-1 h-1 ml-1 rounded-full bg-gray-300 dark:bg-gray-700"></div>
|
||||||
|
<div class="w-1 h-1 ml-1 rounded-full bg-gray-300 dark:bg-gray-700"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="flex flex-auto border-t bg-gray-50 dark:bg-gray-900"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
class="mt-2 text-md font-medium text-center text-secondary"
|
||||||
|
[class.text-primary]="config.layout === 'classic'">
|
||||||
|
Classic
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Classy -->
|
||||||
|
<div
|
||||||
|
class="flex flex-col cursor-pointer"
|
||||||
|
(click)="setLayout('classy')">
|
||||||
|
<div
|
||||||
|
class="flex h-20 rounded-md overflow-hidden border-2 hover:opacity-80"
|
||||||
|
[class.border-primary]="config.layout === 'classy'">
|
||||||
|
<div class="w-8 bg-gray-100 dark:bg-gray-800">
|
||||||
|
<div class="flex items-center mt-1 mx-1">
|
||||||
|
<div class="w-1 h-1 rounded-full bg-gray-300 dark:bg-gray-700"></div>
|
||||||
|
<div class="w-1 h-1 ml-auto rounded-full bg-gray-300 dark:bg-gray-700"></div>
|
||||||
|
<div class="w-1 h-1 ml-0.5 rounded-full bg-gray-300 dark:bg-gray-700"></div>
|
||||||
|
</div>
|
||||||
|
<div class="w-4 h-4 mt-2.5 mx-auto rounded-full bg-gray-300 dark:bg-gray-700"></div>
|
||||||
|
<div class="mt-2 mx-1 space-y-1">
|
||||||
|
<div class="h-1 rounded-sm bg-gray-300 dark:bg-gray-700"></div>
|
||||||
|
<div class="h-1 rounded-sm bg-gray-300 dark:bg-gray-700"></div>
|
||||||
|
<div class="h-1 rounded-sm bg-gray-300 dark:bg-gray-700"></div>
|
||||||
|
<div class="h-1 rounded-sm bg-gray-300 dark:bg-gray-700"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="flex flex-col flex-auto border-l">
|
||||||
|
<div class="h-3 bg-gray-100 dark:bg-gray-800">
|
||||||
|
<div class="flex items-center justify-end h-full mr-2">
|
||||||
|
<div class="w-1 h-1 rounded-full bg-gray-300 dark:bg-gray-700"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="flex flex-auto border-t bg-gray-50 dark:bg-gray-900"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
class="mt-2 text-md font-medium text-center text-secondary"
|
||||||
|
[class.text-primary]="config.layout === 'classy'">
|
||||||
|
Classy
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Compact -->
|
||||||
|
<div
|
||||||
|
class="flex flex-col cursor-pointer"
|
||||||
|
(click)="setLayout('compact')">
|
||||||
|
<div
|
||||||
|
class="flex h-20 rounded-md overflow-hidden border-2 hover:opacity-80"
|
||||||
|
[class.border-primary]="config.layout === 'compact'">
|
||||||
|
<div class="w-5 bg-gray-100 dark:bg-gray-800">
|
||||||
|
<div class="w-3 h-3 mt-2 mx-auto rounded-sm bg-gray-300 dark:bg-gray-700"></div>
|
||||||
|
<div class="flex flex-col items-center w-full mt-2 space-y-1">
|
||||||
|
<div class="w-3 h-2.5 rounded-sm bg-gray-300 dark:bg-gray-700"></div>
|
||||||
|
<div class="w-3 h-2.5 rounded-sm bg-gray-300 dark:bg-gray-700"></div>
|
||||||
|
<div class="w-3 h-2.5 rounded-sm bg-gray-300 dark:bg-gray-700"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="flex flex-col flex-auto border-l">
|
||||||
|
<div class="h-3 bg-gray-100 dark:bg-gray-800">
|
||||||
|
<div class="flex items-center justify-end h-full mr-1.5">
|
||||||
|
<div class="w-1 h-1 ml-1 rounded-full bg-gray-300 dark:bg-gray-700"></div>
|
||||||
|
<div class="w-1 h-1 ml-1 rounded-full bg-gray-300 dark:bg-gray-700"></div>
|
||||||
|
<div class="w-1 h-1 ml-1 rounded-full bg-gray-300 dark:bg-gray-700"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="flex flex-auto border-t bg-gray-50 dark:bg-gray-900"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
class="mt-2 text-md font-medium text-center text-secondary"
|
||||||
|
[class.text-primary]="config.layout === 'compact'">
|
||||||
|
Compact
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Dense -->
|
||||||
|
<div
|
||||||
|
class="flex flex-col cursor-pointer"
|
||||||
|
(click)="setLayout('dense')">
|
||||||
|
<div
|
||||||
|
class="flex h-20 rounded-md overflow-hidden border-2 hover:opacity-80"
|
||||||
|
[class.border-primary]="config.layout === 'dense'">
|
||||||
|
<div class="w-4 bg-gray-100 dark:bg-gray-800">
|
||||||
|
<div class="w-2 h-2 mt-2 mx-auto rounded-sm bg-gray-300 dark:bg-gray-700"></div>
|
||||||
|
<div class="flex flex-col items-center w-full mt-2 space-y-1">
|
||||||
|
<div class="w-2 h-2 rounded-sm bg-gray-300 dark:bg-gray-700"></div>
|
||||||
|
<div class="w-2 h-2 rounded-sm bg-gray-300 dark:bg-gray-700"></div>
|
||||||
|
<div class="w-2 h-2 rounded-sm bg-gray-300 dark:bg-gray-700"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="flex flex-col flex-auto border-l">
|
||||||
|
<div class="h-3 bg-gray-100 dark:bg-gray-800">
|
||||||
|
<div class="flex items-center justify-end h-full mr-1.5">
|
||||||
|
<div class="w-1 h-1 ml-1 rounded-full bg-gray-300 dark:bg-gray-700"></div>
|
||||||
|
<div class="w-1 h-1 ml-1 rounded-full bg-gray-300 dark:bg-gray-700"></div>
|
||||||
|
<div class="w-1 h-1 ml-1 rounded-full bg-gray-300 dark:bg-gray-700"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="flex flex-auto border-t bg-gray-50 dark:bg-gray-900"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
class="mt-2 text-md font-medium text-center text-secondary"
|
||||||
|
[class.text-primary]="config.layout === 'dense'">
|
||||||
|
Dense
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Futuristic -->
|
||||||
|
<div
|
||||||
|
class="flex flex-col cursor-pointer"
|
||||||
|
(click)="setLayout('futuristic')">
|
||||||
|
<div
|
||||||
|
class="flex h-20 rounded-md overflow-hidden border-2 hover:opacity-80"
|
||||||
|
[class.border-primary]="config.layout === 'futuristic'">
|
||||||
|
<div class="w-8 bg-gray-100 dark:bg-gray-800">
|
||||||
|
<div class="flex flex-col flex-auto h-full py-3 px-1.5 space-y-1">
|
||||||
|
<div class="h-1 rounded-sm bg-gray-300 dark:bg-gray-700"></div>
|
||||||
|
<div class="h-1 rounded-sm bg-gray-300 dark:bg-gray-700"></div>
|
||||||
|
<div class="h-1 rounded-sm bg-gray-300 dark:bg-gray-700"></div>
|
||||||
|
<div class="flex-auto"></div>
|
||||||
|
<div class="h-1 rounded-sm bg-gray-300 dark:bg-gray-700"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="flex flex-col flex-auto border-l">
|
||||||
|
<div class="h-3 bg-gray-100 dark:bg-gray-800">
|
||||||
|
<div class="flex items-center justify-end h-full mr-1.5">
|
||||||
|
<div class="w-1 h-1 ml-1 rounded-full bg-gray-300 dark:bg-gray-700"></div>
|
||||||
|
<div class="w-1 h-1 ml-1 rounded-full bg-gray-300 dark:bg-gray-700"></div>
|
||||||
|
<div class="w-1 h-1 ml-1 rounded-full bg-gray-300 dark:bg-gray-700"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="flex flex-auto border-t bg-gray-50 dark:bg-gray-900"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
class="mt-2 text-md font-medium text-center text-secondary"
|
||||||
|
[class.text-primary]="config.layout === 'futuristic'">
|
||||||
|
Futuristic
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Thin -->
|
||||||
|
<div
|
||||||
|
class="flex flex-col cursor-pointer"
|
||||||
|
(click)="setLayout('thin')">
|
||||||
|
<div
|
||||||
|
class="flex h-20 rounded-md overflow-hidden border-2 hover:opacity-80"
|
||||||
|
[class.border-primary]="config.layout === 'thin'">
|
||||||
|
<div class="w-3 bg-gray-100 dark:bg-gray-800">
|
||||||
|
<div class="w-1.5 h-1.5 mt-2 mx-auto rounded-sm bg-gray-300 dark:bg-gray-700"></div>
|
||||||
|
<div class="flex flex-col items-center w-full mt-2 space-y-1">
|
||||||
|
<div class="w-1.5 h-1.5 rounded-full bg-gray-300 dark:bg-gray-700"></div>
|
||||||
|
<div class="w-1.5 h-1.5 rounded-full bg-gray-300 dark:bg-gray-700"></div>
|
||||||
|
<div class="w-1.5 h-1.5 rounded-full bg-gray-300 dark:bg-gray-700"></div>
|
||||||
|
<div class="w-1.5 h-1.5 rounded-full bg-gray-300 dark:bg-gray-700"></div>
|
||||||
|
<div class="w-1.5 h-1.5 rounded-full bg-gray-300 dark:bg-gray-700"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="flex flex-col flex-auto border-l">
|
||||||
|
<div class="h-3 bg-gray-100 dark:bg-gray-800">
|
||||||
|
<div class="flex items-center justify-end h-full mr-1.5">
|
||||||
|
<div class="w-1 h-1 ml-1 rounded-full bg-gray-300 dark:bg-gray-700"></div>
|
||||||
|
<div class="w-1 h-1 ml-1 rounded-full bg-gray-300 dark:bg-gray-700"></div>
|
||||||
|
<div class="w-1 h-1 ml-1 rounded-full bg-gray-300 dark:bg-gray-700"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="flex flex-auto border-t bg-gray-50 dark:bg-gray-900"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
class="mt-2 text-md font-medium text-center text-secondary"
|
||||||
|
[class.text-primary]="config.layout === 'thin'">
|
||||||
|
Thin
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-span-2"></div>
|
||||||
|
|
||||||
|
<!-- Centered -->
|
||||||
|
<div
|
||||||
|
class="flex flex-col cursor-pointer"
|
||||||
|
(click)="setLayout('centered')">
|
||||||
|
<div
|
||||||
|
class="flex h-20 rounded-md overflow-hidden border-2 hover:opacity-80"
|
||||||
|
[class.border-primary]="config.layout === 'centered'">
|
||||||
|
<div class="flex flex-col flex-auto my-1 mx-2 border rounded-md overflow-hidden">
|
||||||
|
<div class="flex items-center h-3 bg-gray-100 dark:bg-gray-800">
|
||||||
|
<div class="flex ml-1.5">
|
||||||
|
<div class="w-1 h-1 rounded-full bg-gray-300 dark:bg-gray-700"></div>
|
||||||
|
<div class="w-3 h-1 ml-1 rounded-full bg-gray-300 dark:bg-gray-700"></div>
|
||||||
|
<div class="w-3 h-1 ml-1 rounded-full bg-gray-300 dark:bg-gray-700"></div>
|
||||||
|
<div class="w-3 h-1 ml-1 rounded-full bg-gray-300 dark:bg-gray-700"></div>
|
||||||
|
</div>
|
||||||
|
<div class="flex items-center justify-end ml-auto mr-1.5">
|
||||||
|
<div class="w-1 h-1 ml-1 rounded-full bg-gray-300 dark:bg-gray-700"></div>
|
||||||
|
<div class="w-1 h-1 ml-1 rounded-full bg-gray-300 dark:bg-gray-700"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="flex flex-auto border-t bg-gray-50 dark:bg-gray-900"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
class="mt-2 text-md font-medium text-center text-secondary"
|
||||||
|
[class.text-primary]="config.layout === 'centered'">
|
||||||
|
Centered
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Enterprise -->
|
||||||
|
<div
|
||||||
|
class="flex flex-col cursor-pointer"
|
||||||
|
(click)="setLayout('enterprise')">
|
||||||
|
<div
|
||||||
|
class="flex flex-col h-20 rounded-md overflow-hidden border-2 hover:opacity-80"
|
||||||
|
[class.border-primary]="config.layout === 'enterprise'">
|
||||||
|
<div class="flex items-center h-3 px-2 bg-gray-100 dark:bg-gray-800">
|
||||||
|
<div class="w-2 h-2 rounded-full bg-gray-300 dark:bg-gray-700"></div>
|
||||||
|
<div class="flex items-center justify-end ml-auto space-x-1">
|
||||||
|
<div class="w-1 h-1 rounded-full bg-gray-300 dark:bg-gray-700"></div>
|
||||||
|
<div class="w-1 h-1 rounded-full bg-gray-300 dark:bg-gray-700"></div>
|
||||||
|
<div class="w-1 h-1 rounded-full bg-gray-300 dark:bg-gray-700"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="flex items-center h-3 px-2 border-t border-b space-x-1 bg-gray-100 dark:bg-gray-800">
|
||||||
|
<div class="w-3 h-1 rounded-full bg-gray-300 dark:bg-gray-700"></div>
|
||||||
|
<div class="w-3 h-1 rounded-full bg-gray-300 dark:bg-gray-700"></div>
|
||||||
|
<div class="w-3 h-1 rounded-full bg-gray-300 dark:bg-gray-700"></div>
|
||||||
|
<div class="w-3 h-1 rounded-full bg-gray-300 dark:bg-gray-700"></div>
|
||||||
|
</div>
|
||||||
|
<div class="flex flex-col flex-auto my-1 mx-2 border rounded overflow-hidden">
|
||||||
|
<div class="flex flex-auto bg-gray-50 dark:bg-gray-900"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
class="mt-2 text-md font-medium text-center text-secondary"
|
||||||
|
[class.text-primary]="config.layout === 'enterprise'">
|
||||||
|
Enterprise
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Material -->
|
||||||
|
<div
|
||||||
|
class="flex flex-col cursor-pointer"
|
||||||
|
(click)="setLayout('material')">
|
||||||
|
<div
|
||||||
|
class="flex flex-col h-20 rounded-md overflow-hidden border-2 hover:opacity-80"
|
||||||
|
[class.border-primary]="config.layout === 'material'">
|
||||||
|
<div class="flex flex-col flex-auto my-1 mx-2 border rounded overflow-hidden">
|
||||||
|
<div class="flex items-center h-4 px-2 bg-gray-100 dark:bg-gray-800">
|
||||||
|
<div class="w-2 h-2 rounded-full bg-gray-300 dark:bg-gray-700"></div>
|
||||||
|
<div class="flex items-center justify-end ml-auto space-x-1">
|
||||||
|
<div class="w-1 h-1 rounded-full bg-gray-300 dark:bg-gray-700"></div>
|
||||||
|
<div class="w-1 h-1 rounded-full bg-gray-300 dark:bg-gray-700"></div>
|
||||||
|
<div class="w-1 h-1 rounded-full bg-gray-300 dark:bg-gray-700"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="flex items-center h-2 px-2 space-x-1 bg-gray-100 dark:bg-gray-800">
|
||||||
|
<div class="w-3 h-1 rounded-full bg-gray-300 dark:bg-gray-700"></div>
|
||||||
|
<div class="w-3 h-1 rounded-full bg-gray-300 dark:bg-gray-700"></div>
|
||||||
|
<div class="w-3 h-1 rounded-full bg-gray-300 dark:bg-gray-700"></div>
|
||||||
|
<div class="w-3 h-1 rounded-full bg-gray-300 dark:bg-gray-700"></div>
|
||||||
|
</div>
|
||||||
|
<div class="flex flex-auto border-t bg-gray-50 dark:bg-gray-900"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
class="mt-2 text-md font-medium text-center text-secondary"
|
||||||
|
[class.text-primary]="config.layout === 'material'">
|
||||||
|
Material
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Modern -->
|
||||||
|
<div
|
||||||
|
class="flex flex-col cursor-pointer"
|
||||||
|
(click)="setLayout('modern')">
|
||||||
|
<div
|
||||||
|
class="flex flex-col h-20 rounded-md overflow-hidden border-2 hover:opacity-80"
|
||||||
|
[class.border-primary]="config.layout === 'modern'">
|
||||||
|
<div class="flex items-center h-4 px-2 border-b bg-gray-100 dark:bg-gray-800">
|
||||||
|
<div class="w-2 h-2 rounded-full bg-gray-300 dark:bg-gray-700"></div>
|
||||||
|
<div class="flex items-center h-3 ml-2 space-x-1">
|
||||||
|
<div class="w-3 h-1 rounded-full bg-gray-300 dark:bg-gray-700"></div>
|
||||||
|
<div class="w-3 h-1 rounded-full bg-gray-300 dark:bg-gray-700"></div>
|
||||||
|
<div class="w-3 h-1 rounded-full bg-gray-300 dark:bg-gray-700"></div>
|
||||||
|
</div>
|
||||||
|
<div class="flex items-center justify-end ml-auto space-x-1">
|
||||||
|
<div class="w-1 h-1 rounded-full bg-gray-300 dark:bg-gray-700"></div>
|
||||||
|
<div class="w-1 h-1 rounded-full bg-gray-300 dark:bg-gray-700"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="flex flex-col flex-auto">
|
||||||
|
<div class="flex flex-auto bg-gray-50 dark:bg-gray-900"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
class="mt-2 text-md font-medium text-center text-secondary"
|
||||||
|
[class.text-primary]="config.layout === 'modern'">
|
||||||
|
Modern
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</fuse-drawer>
|
||||||
124
src/app/layout/common/settings/settings.component.ts
Normal file
124
src/app/layout/common/settings/settings.component.ts
Normal file
@@ -0,0 +1,124 @@
|
|||||||
|
import { Component, OnDestroy, OnInit, ViewEncapsulation } from '@angular/core';
|
||||||
|
import { Router } from '@angular/router';
|
||||||
|
import { Subject } from 'rxjs';
|
||||||
|
import { takeUntil } from 'rxjs/operators';
|
||||||
|
import { FuseConfigService } from '@fuse/services/config';
|
||||||
|
import { FuseTailwindService } from '@fuse/services/tailwind';
|
||||||
|
import { AppConfig, Scheme, Theme } from 'app/core/config/app.config';
|
||||||
|
import { Layout } from 'app/layout/layout.types';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector : 'settings',
|
||||||
|
templateUrl : './settings.component.html',
|
||||||
|
styles : [
|
||||||
|
`
|
||||||
|
settings {
|
||||||
|
position: static;
|
||||||
|
display: block;
|
||||||
|
flex: none;
|
||||||
|
width: auto;
|
||||||
|
}
|
||||||
|
`
|
||||||
|
],
|
||||||
|
encapsulation: ViewEncapsulation.None
|
||||||
|
})
|
||||||
|
export class SettingsComponent implements OnInit, OnDestroy
|
||||||
|
{
|
||||||
|
config: AppConfig;
|
||||||
|
layout: Layout;
|
||||||
|
scheme: 'dark' | 'light';
|
||||||
|
theme: string;
|
||||||
|
themes: [string, any][] = [];
|
||||||
|
private _unsubscribeAll: Subject<any> = new Subject<any>();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor
|
||||||
|
*/
|
||||||
|
constructor(
|
||||||
|
private _router: Router,
|
||||||
|
private _fuseConfigService: FuseConfigService,
|
||||||
|
private _fuseTailwindService: FuseTailwindService
|
||||||
|
)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------------------------------
|
||||||
|
// @ Lifecycle hooks
|
||||||
|
// -----------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
/**
|
||||||
|
* On init
|
||||||
|
*/
|
||||||
|
ngOnInit(): void
|
||||||
|
{
|
||||||
|
// Get the themes
|
||||||
|
this._fuseTailwindService.tailwindConfig$
|
||||||
|
.pipe(takeUntil(this._unsubscribeAll))
|
||||||
|
.subscribe((config) => {
|
||||||
|
this.themes = Object.entries(config.themes);
|
||||||
|
});
|
||||||
|
|
||||||
|
// Subscribe to config changes
|
||||||
|
this._fuseConfigService.config$
|
||||||
|
.pipe(takeUntil(this._unsubscribeAll))
|
||||||
|
.subscribe((config: AppConfig) => {
|
||||||
|
|
||||||
|
// Store the config
|
||||||
|
this.config = config;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* On destroy
|
||||||
|
*/
|
||||||
|
ngOnDestroy(): void
|
||||||
|
{
|
||||||
|
// Unsubscribe from all subscriptions
|
||||||
|
this._unsubscribeAll.next();
|
||||||
|
this._unsubscribeAll.complete();
|
||||||
|
}
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------------------------------
|
||||||
|
// @ Public methods
|
||||||
|
// -----------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the layout on the config
|
||||||
|
*
|
||||||
|
* @param layout
|
||||||
|
*/
|
||||||
|
setLayout(layout: string): void
|
||||||
|
{
|
||||||
|
// Clear the 'layout' query param to allow layout changes
|
||||||
|
this._router.navigate([], {
|
||||||
|
queryParams : {
|
||||||
|
layout: null
|
||||||
|
},
|
||||||
|
queryParamsHandling: 'merge'
|
||||||
|
}).then(() => {
|
||||||
|
|
||||||
|
// Set the config
|
||||||
|
this._fuseConfigService.config = {layout};
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the scheme on the config
|
||||||
|
*
|
||||||
|
* @param scheme
|
||||||
|
*/
|
||||||
|
setScheme(scheme: Scheme): void
|
||||||
|
{
|
||||||
|
this._fuseConfigService.config = {scheme};
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the theme on the config
|
||||||
|
*
|
||||||
|
* @param theme
|
||||||
|
*/
|
||||||
|
setTheme(theme: Theme): void
|
||||||
|
{
|
||||||
|
this._fuseConfigService.config = {theme};
|
||||||
|
}
|
||||||
|
}
|
||||||
28
src/app/layout/common/settings/settings.module.ts
Normal file
28
src/app/layout/common/settings/settings.module.ts
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
import { NgModule } from '@angular/core';
|
||||||
|
import { CommonModule } from '@angular/common';
|
||||||
|
import { RouterModule } from '@angular/router';
|
||||||
|
import { MatIconModule } from '@angular/material/icon';
|
||||||
|
import { MatTooltipModule } from '@angular/material/tooltip';
|
||||||
|
import { FuseDrawerModule } from '@fuse/components/drawer';
|
||||||
|
import { SettingsComponent } from 'app/layout/common/settings/settings.component';
|
||||||
|
import { MatButtonModule } from '@angular/material/button';
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
declarations: [
|
||||||
|
SettingsComponent
|
||||||
|
],
|
||||||
|
imports: [
|
||||||
|
CommonModule,
|
||||||
|
RouterModule,
|
||||||
|
MatIconModule,
|
||||||
|
MatTooltipModule,
|
||||||
|
FuseDrawerModule,
|
||||||
|
MatButtonModule
|
||||||
|
],
|
||||||
|
exports : [
|
||||||
|
SettingsComponent
|
||||||
|
]
|
||||||
|
})
|
||||||
|
export class SettingsModule
|
||||||
|
{
|
||||||
|
}
|
||||||
@@ -21,7 +21,15 @@
|
|||||||
[svgIcon]="'heroicons_solid:x'"></mat-icon>
|
[svgIcon]="'heroicons_solid:x'"></mat-icon>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="text-lg font-medium leading-10">Shortcuts</div>
|
<div class="flex items-center text-lg font-medium leading-10">
|
||||||
|
<span class="">Shortcuts</span>
|
||||||
|
<ng-container *ngIf="mode !== 'view'">
|
||||||
|
<span class="ml-1">
|
||||||
|
<ng-container *ngIf="mode === 'add'">- Add new</ng-container>
|
||||||
|
<ng-container *ngIf="mode === 'modify' || mode === 'edit'">- Editing</ng-container>
|
||||||
|
</span>
|
||||||
|
</ng-container>
|
||||||
|
</div>
|
||||||
<div class="ml-auto">
|
<div class="ml-auto">
|
||||||
|
|
||||||
<!-- View mode -->
|
<!-- View mode -->
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, Input, OnChanges, OnDestroy, OnInit, SimpleChanges, TemplateRef, ViewChild, ViewContainerRef, ViewEncapsulation } from '@angular/core';
|
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, OnDestroy, OnInit, TemplateRef, ViewChild, ViewContainerRef, ViewEncapsulation } from '@angular/core';
|
||||||
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
|
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
|
||||||
import { Overlay, OverlayRef } from '@angular/cdk/overlay';
|
import { Overlay, OverlayRef } from '@angular/cdk/overlay';
|
||||||
import { TemplatePortal } from '@angular/cdk/portal';
|
import { TemplatePortal } from '@angular/cdk/portal';
|
||||||
@@ -15,14 +15,14 @@ import { ShortcutsService } from 'app/layout/common/shortcuts/shortcuts.service'
|
|||||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||||
exportAs : 'shortcuts'
|
exportAs : 'shortcuts'
|
||||||
})
|
})
|
||||||
export class ShortcutsComponent implements OnChanges, OnInit, OnDestroy
|
export class ShortcutsComponent implements OnInit, OnDestroy
|
||||||
{
|
{
|
||||||
@Input() shortcuts: Shortcut[];
|
|
||||||
@ViewChild('shortcutsOrigin') private _shortcutsOrigin: MatButton;
|
@ViewChild('shortcutsOrigin') private _shortcutsOrigin: MatButton;
|
||||||
@ViewChild('shortcutsPanel') private _shortcutsPanel: TemplateRef<any>;
|
@ViewChild('shortcutsPanel') private _shortcutsPanel: TemplateRef<any>;
|
||||||
|
|
||||||
mode: 'view' | 'modify' | 'add' | 'edit' = 'view';
|
mode: 'view' | 'modify' | 'add' | 'edit' = 'view';
|
||||||
shortcutForm: FormGroup;
|
shortcutForm: FormGroup;
|
||||||
|
shortcuts: Shortcut[];
|
||||||
private _overlayRef: OverlayRef;
|
private _overlayRef: OverlayRef;
|
||||||
private _unsubscribeAll: Subject<any> = new Subject<any>();
|
private _unsubscribeAll: Subject<any> = new Subject<any>();
|
||||||
|
|
||||||
@@ -43,21 +43,6 @@ export class ShortcutsComponent implements OnChanges, OnInit, OnDestroy
|
|||||||
// @ Lifecycle hooks
|
// @ Lifecycle hooks
|
||||||
// -----------------------------------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
/**
|
|
||||||
* On changes
|
|
||||||
*
|
|
||||||
* @param changes
|
|
||||||
*/
|
|
||||||
ngOnChanges(changes: SimpleChanges): void
|
|
||||||
{
|
|
||||||
// Shortcuts
|
|
||||||
if ( 'shortcuts' in changes )
|
|
||||||
{
|
|
||||||
// Store the shortcuts on the service
|
|
||||||
this._shortcutsService.store(changes.shortcuts.currentValue);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* On init
|
* On init
|
||||||
*/
|
*/
|
||||||
@@ -236,7 +221,7 @@ export class ShortcutsComponent implements OnChanges, OnInit, OnDestroy
|
|||||||
scrollStrategy : this._overlay.scrollStrategies.block(),
|
scrollStrategy : this._overlay.scrollStrategies.block(),
|
||||||
positionStrategy: this._overlay.position()
|
positionStrategy: this._overlay.position()
|
||||||
.flexibleConnectedTo(this._shortcutsOrigin._elementRef.nativeElement)
|
.flexibleConnectedTo(this._shortcutsOrigin._elementRef.nativeElement)
|
||||||
.withLockedPosition()
|
.withLockedPosition(true)
|
||||||
.withPush(true)
|
.withPush(true)
|
||||||
.withPositions([
|
.withPositions([
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { HttpClient } from '@angular/common/http';
|
import { HttpClient } from '@angular/common/http';
|
||||||
import { Observable, ReplaySubject } from 'rxjs';
|
import { Observable, ReplaySubject } from 'rxjs';
|
||||||
import { map, switchMap, take } from 'rxjs/operators';
|
import { map, switchMap, take, tap } from 'rxjs/operators';
|
||||||
import { Shortcut } from 'app/layout/common/shortcuts/shortcuts.types';
|
import { Shortcut } from 'app/layout/common/shortcuts/shortcuts.types';
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
@@ -35,17 +35,15 @@ export class ShortcutsService
|
|||||||
// -----------------------------------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Store shortcuts on the service
|
* Get all messages
|
||||||
*
|
|
||||||
* @param shortcuts
|
|
||||||
*/
|
*/
|
||||||
store(shortcuts: Shortcut[]): Observable<Shortcut[]>
|
getAll(): Observable<Shortcut[]>
|
||||||
{
|
{
|
||||||
// Load the shortcuts
|
return this._httpClient.get<Shortcut[]>('api/common/shortcuts').pipe(
|
||||||
this._shortcuts.next(shortcuts);
|
tap((shortcuts) => {
|
||||||
|
this._shortcuts.next(shortcuts);
|
||||||
// Return the shortcuts
|
})
|
||||||
return this.shortcuts$;
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -3,17 +3,17 @@ import { Router } from '@angular/router';
|
|||||||
import { BooleanInput } from '@angular/cdk/coercion';
|
import { BooleanInput } from '@angular/cdk/coercion';
|
||||||
import { Subject } from 'rxjs';
|
import { Subject } from 'rxjs';
|
||||||
import { takeUntil } from 'rxjs/operators';
|
import { takeUntil } from 'rxjs/operators';
|
||||||
import { User } from 'app/core/user/user.model';
|
import { User } from 'app/core/user/user.types';
|
||||||
import { UserService } from 'app/core/user/user.service';
|
import { UserService } from 'app/core/user/user.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector : 'user-menu',
|
selector : 'user',
|
||||||
templateUrl : './user-menu.component.html',
|
templateUrl : './user.component.html',
|
||||||
encapsulation : ViewEncapsulation.None,
|
encapsulation : ViewEncapsulation.None,
|
||||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||||
exportAs : 'userMenu'
|
exportAs : 'user'
|
||||||
})
|
})
|
||||||
export class UserMenuComponent implements OnInit, OnDestroy
|
export class UserComponent implements OnInit, OnDestroy
|
||||||
{
|
{
|
||||||
/* eslint-disable @typescript-eslint/naming-convention */
|
/* eslint-disable @typescript-eslint/naming-convention */
|
||||||
static ngAcceptInputType_showAvatar: BooleanInput;
|
static ngAcceptInputType_showAvatar: BooleanInput;
|
||||||
@@ -3,12 +3,12 @@ import { MatButtonModule } from '@angular/material/button';
|
|||||||
import { MatDividerModule } from '@angular/material/divider';
|
import { MatDividerModule } from '@angular/material/divider';
|
||||||
import { MatIconModule } from '@angular/material/icon';
|
import { MatIconModule } from '@angular/material/icon';
|
||||||
import { MatMenuModule } from '@angular/material/menu';
|
import { MatMenuModule } from '@angular/material/menu';
|
||||||
import { UserMenuComponent } from 'app/layout/common/user-menu/user-menu.component';
|
import { UserComponent } from 'app/layout/common/user/user.component';
|
||||||
import { SharedModule } from 'app/shared/shared.module';
|
import { SharedModule } from 'app/shared/shared.module';
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
declarations: [
|
declarations: [
|
||||||
UserMenuComponent
|
UserComponent
|
||||||
],
|
],
|
||||||
imports : [
|
imports : [
|
||||||
MatButtonModule,
|
MatButtonModule,
|
||||||
@@ -18,9 +18,9 @@ import { SharedModule } from 'app/shared/shared.module';
|
|||||||
SharedModule
|
SharedModule
|
||||||
],
|
],
|
||||||
exports : [
|
exports : [
|
||||||
UserMenuComponent
|
UserComponent
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
export class UserMenuModule
|
export class UserModule
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -44,468 +44,4 @@
|
|||||||
<!-- ----------------------------------------------------------------------------------------------------- -->
|
<!-- ----------------------------------------------------------------------------------------------------- -->
|
||||||
<!-- Settings drawer - Remove this to remove the drawer and its button -->
|
<!-- Settings drawer - Remove this to remove the drawer and its button -->
|
||||||
<!-- ----------------------------------------------------------------------------------------------------- -->
|
<!-- ----------------------------------------------------------------------------------------------------- -->
|
||||||
<div
|
<settings></settings>
|
||||||
class="fixed flex items-center justify-center right-0 w-10 h-10 shadow-lg rounded-l-lg z-999 cursor-pointer bg-red-600 bg-opacity-90 print:hidden"
|
|
||||||
style="top: 275px"
|
|
||||||
(click)="settingsDrawer.toggle()">
|
|
||||||
<mat-icon
|
|
||||||
class="icon-size-5 text-white animate-spin-slow"
|
|
||||||
[svgIcon]="'heroicons_solid:cog'"></mat-icon>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<fuse-drawer
|
|
||||||
class="w-100 min-w-100"
|
|
||||||
fixed
|
|
||||||
transparentOverlay
|
|
||||||
[mode]="'over'"
|
|
||||||
[name]="'settingsDrawer'"
|
|
||||||
[position]="'right'"
|
|
||||||
#settingsDrawer>
|
|
||||||
|
|
||||||
<div class="flex flex-col w-full overflow-auto bg-card">
|
|
||||||
<div class="flex flex-row items-center px-6 h-20 min-h-20 text-white bg-primary">
|
|
||||||
<mat-icon
|
|
||||||
class="icon-size-7 text-current"
|
|
||||||
[svgIcon]="'heroicons_solid:cog'"></mat-icon>
|
|
||||||
<div class="ml-3 text-2xl font-semibold tracking-tight">Settings</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="flex flex-col p-6">
|
|
||||||
|
|
||||||
<!-- Theme -->
|
|
||||||
<div class="text-md font-semibold text-secondary">THEME</div>
|
|
||||||
<div class="grid grid-cols-3 gap-3 mt-6">
|
|
||||||
<ng-container *ngFor="let theme of themes">
|
|
||||||
<div
|
|
||||||
class="flex items-center px-4 py-3 rounded-full cursor-pointer ring-inset ring-primary bg-hover"
|
|
||||||
[class.ring-2]="config.theme === theme[0]"
|
|
||||||
(click)="setTheme(theme[0])">
|
|
||||||
<div
|
|
||||||
class="w-4 h-4 rounded-full"
|
|
||||||
[style.background-color]="theme[1].primary"></div>
|
|
||||||
<div
|
|
||||||
class="ml-2.5 font-medium leading-5"
|
|
||||||
[class.text-secondary]="config.theme !== theme[0]">
|
|
||||||
{{theme[0] | titlecase}}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</ng-container>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<hr class="my-8">
|
|
||||||
|
|
||||||
<!-- Scheme -->
|
|
||||||
<div class="text-md font-semibold text-secondary">SCHEME</div>
|
|
||||||
<div class="grid grid-cols-3 gap-3 justify-items-start mt-6">
|
|
||||||
<!-- Auto -->
|
|
||||||
<div
|
|
||||||
class="flex items-center py-3 pl-5 pr-6 rounded-full cursor-pointer ring-inset ring-primary bg-hover"
|
|
||||||
[class.ring-2]="config.scheme === 'auto'"
|
|
||||||
[matTooltip]="'Automatically sets the scheme based on user\'s operating system\'s color scheme preference using \'prefer-color-scheme\' media query.'"
|
|
||||||
(click)="setScheme('auto')">
|
|
||||||
<div class="flex items-center rounded-full overflow-hidden">
|
|
||||||
<mat-icon
|
|
||||||
class="icon-size-5"
|
|
||||||
[svgIcon]="'heroicons_solid:lightning-bolt'"></mat-icon>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
class="flex items-center ml-2 font-medium leading-5"
|
|
||||||
[class.text-secondary]="config.scheme !== 'auto'">
|
|
||||||
Auto
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<!-- Dark -->
|
|
||||||
<div
|
|
||||||
class="flex items-center py-3 pl-5 pr-6 rounded-full cursor-pointer ring-inset ring-primary bg-hover"
|
|
||||||
[class.ring-2]="config.scheme === 'dark'"
|
|
||||||
(click)="setScheme('dark')">
|
|
||||||
<div class="flex items-center rounded-full overflow-hidden">
|
|
||||||
<mat-icon
|
|
||||||
class="icon-size-5"
|
|
||||||
[svgIcon]="'heroicons_solid:moon'"></mat-icon>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
class="flex items-center ml-2 font-medium leading-5"
|
|
||||||
[class.text-secondary]="config.scheme !== 'dark'">
|
|
||||||
Dark
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<!-- Light -->
|
|
||||||
<div
|
|
||||||
class="flex items-center py-3 pl-5 pr-6 rounded-full cursor-pointer ring-inset ring-primary bg-hover"
|
|
||||||
[class.ring-2]="config.scheme === 'light'"
|
|
||||||
(click)="setScheme('light')">
|
|
||||||
<div class="flex items-center rounded-full overflow-hidden">
|
|
||||||
<mat-icon
|
|
||||||
class="icon-size-5"
|
|
||||||
[svgIcon]="'heroicons_solid:sun'"></mat-icon>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
class="flex items-center ml-2 font-medium leading-5"
|
|
||||||
[class.text-secondary]="config.scheme !== 'light'">
|
|
||||||
Light
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<hr class="my-8">
|
|
||||||
|
|
||||||
<!-- Layout -->
|
|
||||||
<div class="text-md font-semibold text-secondary">LAYOUT</div>
|
|
||||||
<div class="grid grid-cols-3 gap-3 mt-6">
|
|
||||||
|
|
||||||
<!-- Empty -->
|
|
||||||
<div
|
|
||||||
class="flex flex-col cursor-pointer"
|
|
||||||
(click)="setLayout('empty')">
|
|
||||||
<div
|
|
||||||
class="flex flex-col h-20 rounded-md overflow-hidden border-2 hover:opacity-80"
|
|
||||||
[class.border-primary]="config.layout === 'empty'">
|
|
||||||
<div class="flex flex-col flex-auto bg-gray-50 dark:bg-gray-900"></div>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
class="mt-2 text-md font-medium text-center text-secondary"
|
|
||||||
[class.text-primary]="config.layout === 'empty'">
|
|
||||||
Empty
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Classic -->
|
|
||||||
<div
|
|
||||||
class="flex flex-col cursor-pointer"
|
|
||||||
(click)="setLayout('classic')">
|
|
||||||
<div
|
|
||||||
class="flex h-20 rounded-md overflow-hidden border-2 hover:opacity-80"
|
|
||||||
[class.border-primary]="config.layout === 'classic'">
|
|
||||||
<div class="w-8 bg-gray-100 dark:bg-gray-800">
|
|
||||||
<div class="mt-3 mx-1.5 space-y-1">
|
|
||||||
<div class="h-1 rounded-sm bg-gray-300 dark:bg-gray-700"></div>
|
|
||||||
<div class="h-1 rounded-sm bg-gray-300 dark:bg-gray-700"></div>
|
|
||||||
<div class="h-1 rounded-sm bg-gray-300 dark:bg-gray-700"></div>
|
|
||||||
<div class="h-1 rounded-sm bg-gray-300 dark:bg-gray-700"></div>
|
|
||||||
<div class="h-1 rounded-sm bg-gray-300 dark:bg-gray-700"></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="flex flex-col flex-auto border-l">
|
|
||||||
<div class="h-3 bg-gray-100 dark:bg-gray-800">
|
|
||||||
<div class="flex items-center justify-end h-full mr-1.5">
|
|
||||||
<div class="w-1 h-1 ml-1 rounded-full bg-gray-300 dark:bg-gray-700"></div>
|
|
||||||
<div class="w-1 h-1 ml-1 rounded-full bg-gray-300 dark:bg-gray-700"></div>
|
|
||||||
<div class="w-1 h-1 ml-1 rounded-full bg-gray-300 dark:bg-gray-700"></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="flex flex-auto border-t bg-gray-50 dark:bg-gray-900"></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
class="mt-2 text-md font-medium text-center text-secondary"
|
|
||||||
[class.text-primary]="config.layout === 'classic'">
|
|
||||||
Classic
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Classy -->
|
|
||||||
<div
|
|
||||||
class="flex flex-col cursor-pointer"
|
|
||||||
(click)="setLayout('classy')">
|
|
||||||
<div
|
|
||||||
class="flex h-20 rounded-md overflow-hidden border-2 hover:opacity-80"
|
|
||||||
[class.border-primary]="config.layout === 'classy'">
|
|
||||||
<div class="w-8 bg-gray-100 dark:bg-gray-800">
|
|
||||||
<div class="flex items-center mt-1 mx-1">
|
|
||||||
<div class="w-1 h-1 rounded-full bg-gray-300 dark:bg-gray-700"></div>
|
|
||||||
<div class="w-1 h-1 ml-auto rounded-full bg-gray-300 dark:bg-gray-700"></div>
|
|
||||||
<div class="w-1 h-1 ml-0.5 rounded-full bg-gray-300 dark:bg-gray-700"></div>
|
|
||||||
</div>
|
|
||||||
<div class="w-4 h-4 mt-2.5 mx-auto rounded-full bg-gray-300 dark:bg-gray-700"></div>
|
|
||||||
<div class="mt-2 mx-1 space-y-1">
|
|
||||||
<div class="h-1 rounded-sm bg-gray-300 dark:bg-gray-700"></div>
|
|
||||||
<div class="h-1 rounded-sm bg-gray-300 dark:bg-gray-700"></div>
|
|
||||||
<div class="h-1 rounded-sm bg-gray-300 dark:bg-gray-700"></div>
|
|
||||||
<div class="h-1 rounded-sm bg-gray-300 dark:bg-gray-700"></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="flex flex-col flex-auto border-l">
|
|
||||||
<div class="h-3 bg-gray-100 dark:bg-gray-800">
|
|
||||||
<div class="flex items-center justify-end h-full mr-2">
|
|
||||||
<div class="w-1 h-1 rounded-full bg-gray-300 dark:bg-gray-700"></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="flex flex-auto border-t bg-gray-50 dark:bg-gray-900"></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
class="mt-2 text-md font-medium text-center text-secondary"
|
|
||||||
[class.text-primary]="config.layout === 'classy'">
|
|
||||||
Classy
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Compact -->
|
|
||||||
<div
|
|
||||||
class="flex flex-col cursor-pointer"
|
|
||||||
(click)="setLayout('compact')">
|
|
||||||
<div
|
|
||||||
class="flex h-20 rounded-md overflow-hidden border-2 hover:opacity-80"
|
|
||||||
[class.border-primary]="config.layout === 'compact'">
|
|
||||||
<div class="w-5 bg-gray-100 dark:bg-gray-800">
|
|
||||||
<div class="w-3 h-3 mt-2 mx-auto rounded-sm bg-gray-300 dark:bg-gray-700"></div>
|
|
||||||
<div class="flex flex-col items-center w-full mt-2 space-y-1">
|
|
||||||
<div class="w-3 h-2.5 rounded-sm bg-gray-300 dark:bg-gray-700"></div>
|
|
||||||
<div class="w-3 h-2.5 rounded-sm bg-gray-300 dark:bg-gray-700"></div>
|
|
||||||
<div class="w-3 h-2.5 rounded-sm bg-gray-300 dark:bg-gray-700"></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="flex flex-col flex-auto border-l">
|
|
||||||
<div class="h-3 bg-gray-100 dark:bg-gray-800">
|
|
||||||
<div class="flex items-center justify-end h-full mr-1.5">
|
|
||||||
<div class="w-1 h-1 ml-1 rounded-full bg-gray-300 dark:bg-gray-700"></div>
|
|
||||||
<div class="w-1 h-1 ml-1 rounded-full bg-gray-300 dark:bg-gray-700"></div>
|
|
||||||
<div class="w-1 h-1 ml-1 rounded-full bg-gray-300 dark:bg-gray-700"></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="flex flex-auto border-t bg-gray-50 dark:bg-gray-900"></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
class="mt-2 text-md font-medium text-center text-secondary"
|
|
||||||
[class.text-primary]="config.layout === 'compact'">
|
|
||||||
Compact
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Dense -->
|
|
||||||
<div
|
|
||||||
class="flex flex-col cursor-pointer"
|
|
||||||
(click)="setLayout('dense')">
|
|
||||||
<div
|
|
||||||
class="flex h-20 rounded-md overflow-hidden border-2 hover:opacity-80"
|
|
||||||
[class.border-primary]="config.layout === 'dense'">
|
|
||||||
<div class="w-4 bg-gray-100 dark:bg-gray-800">
|
|
||||||
<div class="w-2 h-2 mt-2 mx-auto rounded-sm bg-gray-300 dark:bg-gray-700"></div>
|
|
||||||
<div class="flex flex-col items-center w-full mt-2 space-y-1">
|
|
||||||
<div class="w-2 h-2 rounded-sm bg-gray-300 dark:bg-gray-700"></div>
|
|
||||||
<div class="w-2 h-2 rounded-sm bg-gray-300 dark:bg-gray-700"></div>
|
|
||||||
<div class="w-2 h-2 rounded-sm bg-gray-300 dark:bg-gray-700"></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="flex flex-col flex-auto border-l">
|
|
||||||
<div class="h-3 bg-gray-100 dark:bg-gray-800">
|
|
||||||
<div class="flex items-center justify-end h-full mr-1.5">
|
|
||||||
<div class="w-1 h-1 ml-1 rounded-full bg-gray-300 dark:bg-gray-700"></div>
|
|
||||||
<div class="w-1 h-1 ml-1 rounded-full bg-gray-300 dark:bg-gray-700"></div>
|
|
||||||
<div class="w-1 h-1 ml-1 rounded-full bg-gray-300 dark:bg-gray-700"></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="flex flex-auto border-t bg-gray-50 dark:bg-gray-900"></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
class="mt-2 text-md font-medium text-center text-secondary"
|
|
||||||
[class.text-primary]="config.layout === 'dense'">
|
|
||||||
Dense
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Futuristic -->
|
|
||||||
<div
|
|
||||||
class="flex flex-col cursor-pointer"
|
|
||||||
(click)="setLayout('futuristic')">
|
|
||||||
<div
|
|
||||||
class="flex h-20 rounded-md overflow-hidden border-2 hover:opacity-80"
|
|
||||||
[class.border-primary]="config.layout === 'futuristic'">
|
|
||||||
<div class="w-8 bg-gray-100 dark:bg-gray-800">
|
|
||||||
<div class="flex flex-col flex-auto h-full py-3 px-1.5 space-y-1">
|
|
||||||
<div class="h-1 rounded-sm bg-gray-300 dark:bg-gray-700"></div>
|
|
||||||
<div class="h-1 rounded-sm bg-gray-300 dark:bg-gray-700"></div>
|
|
||||||
<div class="h-1 rounded-sm bg-gray-300 dark:bg-gray-700"></div>
|
|
||||||
<div class="flex-auto"></div>
|
|
||||||
<div class="h-1 rounded-sm bg-gray-300 dark:bg-gray-700"></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="flex flex-col flex-auto border-l">
|
|
||||||
<div class="h-3 bg-gray-100 dark:bg-gray-800">
|
|
||||||
<div class="flex items-center justify-end h-full mr-1.5">
|
|
||||||
<div class="w-1 h-1 ml-1 rounded-full bg-gray-300 dark:bg-gray-700"></div>
|
|
||||||
<div class="w-1 h-1 ml-1 rounded-full bg-gray-300 dark:bg-gray-700"></div>
|
|
||||||
<div class="w-1 h-1 ml-1 rounded-full bg-gray-300 dark:bg-gray-700"></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="flex flex-auto border-t bg-gray-50 dark:bg-gray-900"></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
class="mt-2 text-md font-medium text-center text-secondary"
|
|
||||||
[class.text-primary]="config.layout === 'futuristic'">
|
|
||||||
Futuristic
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Thin -->
|
|
||||||
<div
|
|
||||||
class="flex flex-col cursor-pointer"
|
|
||||||
(click)="setLayout('thin')">
|
|
||||||
<div
|
|
||||||
class="flex h-20 rounded-md overflow-hidden border-2 hover:opacity-80"
|
|
||||||
[class.border-primary]="config.layout === 'thin'">
|
|
||||||
<div class="w-3 bg-gray-100 dark:bg-gray-800">
|
|
||||||
<div class="w-1.5 h-1.5 mt-2 mx-auto rounded-sm bg-gray-300 dark:bg-gray-700"></div>
|
|
||||||
<div class="flex flex-col items-center w-full mt-2 space-y-1">
|
|
||||||
<div class="w-1.5 h-1.5 rounded-full bg-gray-300 dark:bg-gray-700"></div>
|
|
||||||
<div class="w-1.5 h-1.5 rounded-full bg-gray-300 dark:bg-gray-700"></div>
|
|
||||||
<div class="w-1.5 h-1.5 rounded-full bg-gray-300 dark:bg-gray-700"></div>
|
|
||||||
<div class="w-1.5 h-1.5 rounded-full bg-gray-300 dark:bg-gray-700"></div>
|
|
||||||
<div class="w-1.5 h-1.5 rounded-full bg-gray-300 dark:bg-gray-700"></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="flex flex-col flex-auto border-l">
|
|
||||||
<div class="h-3 bg-gray-100 dark:bg-gray-800">
|
|
||||||
<div class="flex items-center justify-end h-full mr-1.5">
|
|
||||||
<div class="w-1 h-1 ml-1 rounded-full bg-gray-300 dark:bg-gray-700"></div>
|
|
||||||
<div class="w-1 h-1 ml-1 rounded-full bg-gray-300 dark:bg-gray-700"></div>
|
|
||||||
<div class="w-1 h-1 ml-1 rounded-full bg-gray-300 dark:bg-gray-700"></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="flex flex-auto border-t bg-gray-50 dark:bg-gray-900"></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
class="mt-2 text-md font-medium text-center text-secondary"
|
|
||||||
[class.text-primary]="config.layout === 'thin'">
|
|
||||||
Thin
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="col-span-2"></div>
|
|
||||||
|
|
||||||
<!-- Centered -->
|
|
||||||
<div
|
|
||||||
class="flex flex-col cursor-pointer"
|
|
||||||
(click)="setLayout('centered')">
|
|
||||||
<div
|
|
||||||
class="flex h-20 rounded-md overflow-hidden border-2 hover:opacity-80"
|
|
||||||
[class.border-primary]="config.layout === 'centered'">
|
|
||||||
<div class="flex flex-col flex-auto my-1 mx-2 border rounded-md overflow-hidden">
|
|
||||||
<div class="flex items-center h-3 bg-gray-100 dark:bg-gray-800">
|
|
||||||
<div class="flex ml-1.5">
|
|
||||||
<div class="w-1 h-1 rounded-full bg-gray-300 dark:bg-gray-700"></div>
|
|
||||||
<div class="w-3 h-1 ml-1 rounded-full bg-gray-300 dark:bg-gray-700"></div>
|
|
||||||
<div class="w-3 h-1 ml-1 rounded-full bg-gray-300 dark:bg-gray-700"></div>
|
|
||||||
<div class="w-3 h-1 ml-1 rounded-full bg-gray-300 dark:bg-gray-700"></div>
|
|
||||||
</div>
|
|
||||||
<div class="flex items-center justify-end ml-auto mr-1.5">
|
|
||||||
<div class="w-1 h-1 ml-1 rounded-full bg-gray-300 dark:bg-gray-700"></div>
|
|
||||||
<div class="w-1 h-1 ml-1 rounded-full bg-gray-300 dark:bg-gray-700"></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="flex flex-auto border-t bg-gray-50 dark:bg-gray-900"></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
class="mt-2 text-md font-medium text-center text-secondary"
|
|
||||||
[class.text-primary]="config.layout === 'centered'">
|
|
||||||
Centered
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Enterprise -->
|
|
||||||
<div
|
|
||||||
class="flex flex-col cursor-pointer"
|
|
||||||
(click)="setLayout('enterprise')">
|
|
||||||
<div
|
|
||||||
class="flex flex-col h-20 rounded-md overflow-hidden border-2 hover:opacity-80"
|
|
||||||
[class.border-primary]="config.layout === 'enterprise'">
|
|
||||||
<div class="flex items-center h-3 px-2 bg-gray-100 dark:bg-gray-800">
|
|
||||||
<div class="w-2 h-2 rounded-full bg-gray-300 dark:bg-gray-700"></div>
|
|
||||||
<div class="flex items-center justify-end ml-auto space-x-1">
|
|
||||||
<div class="w-1 h-1 rounded-full bg-gray-300 dark:bg-gray-700"></div>
|
|
||||||
<div class="w-1 h-1 rounded-full bg-gray-300 dark:bg-gray-700"></div>
|
|
||||||
<div class="w-1 h-1 rounded-full bg-gray-300 dark:bg-gray-700"></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="flex items-center h-3 px-2 border-t border-b space-x-1 bg-gray-100 dark:bg-gray-800">
|
|
||||||
<div class="w-3 h-1 rounded-full bg-gray-300 dark:bg-gray-700"></div>
|
|
||||||
<div class="w-3 h-1 rounded-full bg-gray-300 dark:bg-gray-700"></div>
|
|
||||||
<div class="w-3 h-1 rounded-full bg-gray-300 dark:bg-gray-700"></div>
|
|
||||||
<div class="w-3 h-1 rounded-full bg-gray-300 dark:bg-gray-700"></div>
|
|
||||||
</div>
|
|
||||||
<div class="flex flex-col flex-auto my-1 mx-2 border rounded overflow-hidden">
|
|
||||||
<div class="flex flex-auto bg-gray-50 dark:bg-gray-900"></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
class="mt-2 text-md font-medium text-center text-secondary"
|
|
||||||
[class.text-primary]="config.layout === 'enterprise'">
|
|
||||||
Enterprise
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Material -->
|
|
||||||
<div
|
|
||||||
class="flex flex-col cursor-pointer"
|
|
||||||
(click)="setLayout('material')">
|
|
||||||
<div
|
|
||||||
class="flex flex-col h-20 rounded-md overflow-hidden border-2 hover:opacity-80"
|
|
||||||
[class.border-primary]="config.layout === 'material'">
|
|
||||||
<div class="flex flex-col flex-auto my-1 mx-2 border rounded overflow-hidden">
|
|
||||||
<div class="flex items-center h-4 px-2 bg-gray-100 dark:bg-gray-800">
|
|
||||||
<div class="w-2 h-2 rounded-full bg-gray-300 dark:bg-gray-700"></div>
|
|
||||||
<div class="flex items-center justify-end ml-auto space-x-1">
|
|
||||||
<div class="w-1 h-1 rounded-full bg-gray-300 dark:bg-gray-700"></div>
|
|
||||||
<div class="w-1 h-1 rounded-full bg-gray-300 dark:bg-gray-700"></div>
|
|
||||||
<div class="w-1 h-1 rounded-full bg-gray-300 dark:bg-gray-700"></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="flex items-center h-2 px-2 space-x-1 bg-gray-100 dark:bg-gray-800">
|
|
||||||
<div class="w-3 h-1 rounded-full bg-gray-300 dark:bg-gray-700"></div>
|
|
||||||
<div class="w-3 h-1 rounded-full bg-gray-300 dark:bg-gray-700"></div>
|
|
||||||
<div class="w-3 h-1 rounded-full bg-gray-300 dark:bg-gray-700"></div>
|
|
||||||
<div class="w-3 h-1 rounded-full bg-gray-300 dark:bg-gray-700"></div>
|
|
||||||
</div>
|
|
||||||
<div class="flex flex-auto border-t bg-gray-50 dark:bg-gray-900"></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
class="mt-2 text-md font-medium text-center text-secondary"
|
|
||||||
[class.text-primary]="config.layout === 'material'">
|
|
||||||
Material
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Modern -->
|
|
||||||
<div
|
|
||||||
class="flex flex-col cursor-pointer"
|
|
||||||
(click)="setLayout('modern')">
|
|
||||||
<div
|
|
||||||
class="flex flex-col h-20 rounded-md overflow-hidden border-2 hover:opacity-80"
|
|
||||||
[class.border-primary]="config.layout === 'modern'">
|
|
||||||
<div class="flex items-center h-4 px-2 border-b bg-gray-100 dark:bg-gray-800">
|
|
||||||
<div class="w-2 h-2 rounded-full bg-gray-300 dark:bg-gray-700"></div>
|
|
||||||
<div class="flex items-center h-3 ml-2 space-x-1">
|
|
||||||
<div class="w-3 h-1 rounded-full bg-gray-300 dark:bg-gray-700"></div>
|
|
||||||
<div class="w-3 h-1 rounded-full bg-gray-300 dark:bg-gray-700"></div>
|
|
||||||
<div class="w-3 h-1 rounded-full bg-gray-300 dark:bg-gray-700"></div>
|
|
||||||
</div>
|
|
||||||
<div class="flex items-center justify-end ml-auto space-x-1">
|
|
||||||
<div class="w-1 h-1 rounded-full bg-gray-300 dark:bg-gray-700"></div>
|
|
||||||
<div class="w-1 h-1 rounded-full bg-gray-300 dark:bg-gray-700"></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="flex flex-col flex-auto">
|
|
||||||
<div class="flex flex-auto bg-gray-50 dark:bg-gray-900"></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
class="mt-2 text-md font-medium text-center text-secondary"
|
|
||||||
[class.text-primary]="config.layout === 'modern'">
|
|
||||||
Modern
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</fuse-drawer>
|
|
||||||
|
|||||||
@@ -5,10 +5,9 @@ import { combineLatest, Subject } from 'rxjs';
|
|||||||
import { filter, map, takeUntil } from 'rxjs/operators';
|
import { filter, map, takeUntil } from 'rxjs/operators';
|
||||||
import { FuseConfigService } from '@fuse/services/config';
|
import { FuseConfigService } from '@fuse/services/config';
|
||||||
import { FuseMediaWatcherService } from '@fuse/services/media-watcher';
|
import { FuseMediaWatcherService } from '@fuse/services/media-watcher';
|
||||||
import { FuseTailwindService } from '@fuse/services/tailwind/tailwind.service';
|
|
||||||
import { FUSE_VERSION } from '@fuse/version';
|
import { FUSE_VERSION } from '@fuse/version';
|
||||||
import { Layout } from 'app/layout/layout.types';
|
import { Layout } from 'app/layout/layout.types';
|
||||||
import { AppConfig, Scheme, Theme } from 'app/core/config/app.config';
|
import { AppConfig } from 'app/core/config/app.config';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector : 'layout',
|
selector : 'layout',
|
||||||
@@ -22,7 +21,6 @@ export class LayoutComponent implements OnInit, OnDestroy
|
|||||||
layout: Layout;
|
layout: Layout;
|
||||||
scheme: 'dark' | 'light';
|
scheme: 'dark' | 'light';
|
||||||
theme: string;
|
theme: string;
|
||||||
themes: [string, any][] = [];
|
|
||||||
private _unsubscribeAll: Subject<any> = new Subject<any>();
|
private _unsubscribeAll: Subject<any> = new Subject<any>();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -34,8 +32,7 @@ export class LayoutComponent implements OnInit, OnDestroy
|
|||||||
private _renderer2: Renderer2,
|
private _renderer2: Renderer2,
|
||||||
private _router: Router,
|
private _router: Router,
|
||||||
private _fuseConfigService: FuseConfigService,
|
private _fuseConfigService: FuseConfigService,
|
||||||
private _fuseMediaWatcherService: FuseMediaWatcherService,
|
private _fuseMediaWatcherService: FuseMediaWatcherService
|
||||||
private _fuseTailwindConfigService: FuseTailwindService
|
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -49,11 +46,6 @@ export class LayoutComponent implements OnInit, OnDestroy
|
|||||||
*/
|
*/
|
||||||
ngOnInit(): void
|
ngOnInit(): void
|
||||||
{
|
{
|
||||||
// Get the themes
|
|
||||||
this._fuseTailwindConfigService.tailwindConfig$.subscribe((config) => {
|
|
||||||
this.themes = Object.entries(config.themes);
|
|
||||||
});
|
|
||||||
|
|
||||||
// Set the theme and scheme based on the configuration
|
// Set the theme and scheme based on the configuration
|
||||||
combineLatest([
|
combineLatest([
|
||||||
this._fuseConfigService.config$,
|
this._fuseConfigService.config$,
|
||||||
@@ -123,50 +115,6 @@ export class LayoutComponent implements OnInit, OnDestroy
|
|||||||
this._unsubscribeAll.complete();
|
this._unsubscribeAll.complete();
|
||||||
}
|
}
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------------------------------
|
|
||||||
// @ Public methods
|
|
||||||
// -----------------------------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Set the layout on the config
|
|
||||||
*
|
|
||||||
* @param layout
|
|
||||||
*/
|
|
||||||
setLayout(layout: string): void
|
|
||||||
{
|
|
||||||
// Clear the 'layout' query param to allow layout changes
|
|
||||||
this._router.navigate([], {
|
|
||||||
queryParams : {
|
|
||||||
layout: null
|
|
||||||
},
|
|
||||||
queryParamsHandling: 'merge'
|
|
||||||
}).then(() => {
|
|
||||||
|
|
||||||
// Set the config
|
|
||||||
this._fuseConfigService.config = {layout};
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Set the scheme on the config
|
|
||||||
*
|
|
||||||
* @param scheme
|
|
||||||
*/
|
|
||||||
setScheme(scheme: Scheme): void
|
|
||||||
{
|
|
||||||
this._fuseConfigService.config = {scheme};
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Set the theme on the config
|
|
||||||
*
|
|
||||||
* @param theme
|
|
||||||
*/
|
|
||||||
setTheme(theme: Theme): void
|
|
||||||
{
|
|
||||||
this._fuseConfigService.config = {theme};
|
|
||||||
}
|
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------------------------------
|
||||||
// @ Private methods
|
// @ Private methods
|
||||||
// -----------------------------------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import { CompactLayoutModule } from 'app/layout/layouts/vertical/compact/compact
|
|||||||
import { DenseLayoutModule } from 'app/layout/layouts/vertical/dense/dense.module';
|
import { DenseLayoutModule } from 'app/layout/layouts/vertical/dense/dense.module';
|
||||||
import { FuturisticLayoutModule } from 'app/layout/layouts/vertical/futuristic/futuristic.module';
|
import { FuturisticLayoutModule } from 'app/layout/layouts/vertical/futuristic/futuristic.module';
|
||||||
import { ThinLayoutModule } from 'app/layout/layouts/vertical/thin/thin.module';
|
import { ThinLayoutModule } from 'app/layout/layouts/vertical/thin/thin.module';
|
||||||
|
import { SettingsModule } from 'app/layout/common/settings/settings.module';
|
||||||
import { SharedModule } from 'app/shared/shared.module';
|
import { SharedModule } from 'app/shared/shared.module';
|
||||||
|
|
||||||
const layoutModules = [
|
const layoutModules = [
|
||||||
@@ -39,12 +40,13 @@ const layoutModules = [
|
|||||||
declarations: [
|
declarations: [
|
||||||
LayoutComponent
|
LayoutComponent
|
||||||
],
|
],
|
||||||
imports : [
|
imports: [
|
||||||
MatIconModule,
|
MatIconModule,
|
||||||
MatTooltipModule,
|
MatTooltipModule,
|
||||||
FuseDrawerModule,
|
FuseDrawerModule,
|
||||||
SharedModule,
|
SharedModule,
|
||||||
...layoutModules
|
SettingsModule,
|
||||||
|
...layoutModules,
|
||||||
],
|
],
|
||||||
exports : [
|
exports : [
|
||||||
LayoutComponent,
|
LayoutComponent,
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
class="dark bg-gray-900 print:hidden"
|
class="dark bg-gray-900 print:hidden"
|
||||||
[mode]="'over'"
|
[mode]="'over'"
|
||||||
[name]="'mainNavigation'"
|
[name]="'mainNavigation'"
|
||||||
[navigation]="data.navigation.default"
|
[navigation]="navigation.default"
|
||||||
[opened]="false">
|
[opened]="false">
|
||||||
<!-- Navigation header hook -->
|
<!-- Navigation header hook -->
|
||||||
<ng-container fuseVerticalNavigationContentHeader>
|
<ng-container fuseVerticalNavigationContentHeader>
|
||||||
@@ -50,7 +50,7 @@
|
|||||||
<fuse-horizontal-navigation
|
<fuse-horizontal-navigation
|
||||||
class="mr-2"
|
class="mr-2"
|
||||||
[name]="'mainNavigation'"
|
[name]="'mainNavigation'"
|
||||||
[navigation]="data.navigation.horizontal"></fuse-horizontal-navigation>
|
[navigation]="navigation.horizontal"></fuse-horizontal-navigation>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
<!-- Navigation toggle button -->
|
<!-- Navigation toggle button -->
|
||||||
<ng-container *ngIf="isScreenSmall">
|
<ng-container *ngIf="isScreenSmall">
|
||||||
@@ -62,14 +62,14 @@
|
|||||||
</button>
|
</button>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
<!-- Components -->
|
<!-- Components -->
|
||||||
<div class="flex items-center pl-2 ml-auto space-x-2">
|
<div class="flex items-center pl-2 ml-auto space-x-1 sm:space-x-2">
|
||||||
<language></language>
|
<languages></languages>
|
||||||
<fuse-fullscreen></fuse-fullscreen>
|
<fuse-fullscreen class="hidden md:block"></fuse-fullscreen>
|
||||||
<search [appearance]="'bar'"></search>
|
<search [appearance]="'bar'"></search>
|
||||||
<shortcuts [shortcuts]="data.shortcuts"></shortcuts>
|
<shortcuts></shortcuts>
|
||||||
<messages [messages]="data.messages"></messages>
|
<messages></messages>
|
||||||
<notifications [notifications]="data.notifications"></notifications>
|
<notifications></notifications>
|
||||||
<user-menu></user-menu>
|
<user></user>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,8 @@ import { Subject } from 'rxjs';
|
|||||||
import { takeUntil } from 'rxjs/operators';
|
import { takeUntil } from 'rxjs/operators';
|
||||||
import { FuseMediaWatcherService } from '@fuse/services/media-watcher';
|
import { FuseMediaWatcherService } from '@fuse/services/media-watcher';
|
||||||
import { FuseNavigationService, FuseVerticalNavigationComponent } from '@fuse/components/navigation';
|
import { FuseNavigationService, FuseVerticalNavigationComponent } from '@fuse/components/navigation';
|
||||||
import { InitialData } from 'app/app.types';
|
import { Navigation } from 'app/core/navigation/navigation.types';
|
||||||
|
import { NavigationService } from 'app/core/navigation/navigation.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector : 'centered-layout',
|
selector : 'centered-layout',
|
||||||
@@ -13,7 +14,7 @@ import { InitialData } from 'app/app.types';
|
|||||||
})
|
})
|
||||||
export class CenteredLayoutComponent implements OnInit, OnDestroy
|
export class CenteredLayoutComponent implements OnInit, OnDestroy
|
||||||
{
|
{
|
||||||
data: InitialData;
|
navigation: Navigation;
|
||||||
isScreenSmall: boolean;
|
isScreenSmall: boolean;
|
||||||
private _unsubscribeAll: Subject<any> = new Subject<any>();
|
private _unsubscribeAll: Subject<any> = new Subject<any>();
|
||||||
|
|
||||||
@@ -23,6 +24,7 @@ export class CenteredLayoutComponent implements OnInit, OnDestroy
|
|||||||
constructor(
|
constructor(
|
||||||
private _activatedRoute: ActivatedRoute,
|
private _activatedRoute: ActivatedRoute,
|
||||||
private _router: Router,
|
private _router: Router,
|
||||||
|
private _navigationService: NavigationService,
|
||||||
private _fuseMediaWatcherService: FuseMediaWatcherService,
|
private _fuseMediaWatcherService: FuseMediaWatcherService,
|
||||||
private _fuseNavigationService: FuseNavigationService
|
private _fuseNavigationService: FuseNavigationService
|
||||||
)
|
)
|
||||||
@@ -50,10 +52,12 @@ export class CenteredLayoutComponent implements OnInit, OnDestroy
|
|||||||
*/
|
*/
|
||||||
ngOnInit(): void
|
ngOnInit(): void
|
||||||
{
|
{
|
||||||
// Subscribe to the resolved route data
|
// Subscribe to navigation data
|
||||||
this._activatedRoute.data.subscribe((data: Data) => {
|
this._navigationService.navigation$
|
||||||
this.data = data.initialData;
|
.pipe(takeUntil(this._unsubscribeAll))
|
||||||
});
|
.subscribe((navigation: Navigation) => {
|
||||||
|
this.navigation = navigation;
|
||||||
|
});
|
||||||
|
|
||||||
// Subscribe to media changes
|
// Subscribe to media changes
|
||||||
this._fuseMediaWatcherService.onMediaChange$
|
this._fuseMediaWatcherService.onMediaChange$
|
||||||
|
|||||||
@@ -7,12 +7,12 @@ import { MatIconModule } from '@angular/material/icon';
|
|||||||
import { MatMenuModule } from '@angular/material/menu';
|
import { MatMenuModule } from '@angular/material/menu';
|
||||||
import { FuseFullscreenModule } from '@fuse/components/fullscreen';
|
import { FuseFullscreenModule } from '@fuse/components/fullscreen';
|
||||||
import { FuseNavigationModule } from '@fuse/components/navigation';
|
import { FuseNavigationModule } from '@fuse/components/navigation';
|
||||||
import { LanguageModule } from 'app/layout/common/language/language.module';
|
import { LanguagesModule } from 'app/layout/common/languages/languages.module';
|
||||||
import { MessagesModule } from 'app/layout/common/messages/messages.module';
|
import { MessagesModule } from 'app/layout/common/messages/messages.module';
|
||||||
import { NotificationsModule } from 'app/layout/common/notifications/notifications.module';
|
import { NotificationsModule } from 'app/layout/common/notifications/notifications.module';
|
||||||
import { SearchModule } from 'app/layout/common/search/search.module';
|
import { SearchModule } from 'app/layout/common/search/search.module';
|
||||||
import { ShortcutsModule } from 'app/layout/common/shortcuts/shortcuts.module';
|
import { ShortcutsModule } from 'app/layout/common/shortcuts/shortcuts.module';
|
||||||
import { UserMenuModule } from 'app/layout/common/user-menu/user-menu.module';
|
import { UserModule } from 'app/layout/common/user/user.module';
|
||||||
import { SharedModule } from 'app/shared/shared.module';
|
import { SharedModule } from 'app/shared/shared.module';
|
||||||
import { CenteredLayoutComponent } from 'app/layout/layouts/horizontal/centered/centered.component';
|
import { CenteredLayoutComponent } from 'app/layout/layouts/horizontal/centered/centered.component';
|
||||||
|
|
||||||
@@ -29,12 +29,12 @@ import { CenteredLayoutComponent } from 'app/layout/layouts/horizontal/centered/
|
|||||||
MatMenuModule,
|
MatMenuModule,
|
||||||
FuseFullscreenModule,
|
FuseFullscreenModule,
|
||||||
FuseNavigationModule,
|
FuseNavigationModule,
|
||||||
LanguageModule,
|
LanguagesModule,
|
||||||
MessagesModule,
|
MessagesModule,
|
||||||
NotificationsModule,
|
NotificationsModule,
|
||||||
SearchModule,
|
SearchModule,
|
||||||
ShortcutsModule,
|
ShortcutsModule,
|
||||||
UserMenuModule,
|
UserModule,
|
||||||
SharedModule
|
SharedModule
|
||||||
],
|
],
|
||||||
exports : [
|
exports : [
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
class="dark bg-gray-900 print:hidden"
|
class="dark bg-gray-900 print:hidden"
|
||||||
[mode]="'over'"
|
[mode]="'over'"
|
||||||
[name]="'mainNavigation'"
|
[name]="'mainNavigation'"
|
||||||
[navigation]="data.navigation.default"
|
[navigation]="navigation.default"
|
||||||
[opened]="false">
|
[opened]="false">
|
||||||
<!-- Navigation header hook -->
|
<!-- Navigation header hook -->
|
||||||
<ng-container fuseVerticalNavigationContentHeader>
|
<ng-container fuseVerticalNavigationContentHeader>
|
||||||
@@ -45,14 +45,20 @@
|
|||||||
</button>
|
</button>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
<!-- Components -->
|
<!-- Components -->
|
||||||
<div class="flex items-center pl-2 ml-auto space-x-2">
|
<div class="flex items-center pl-2 ml-auto space-x-0.5 sm:space-x-2">
|
||||||
<language></language>
|
<languages></languages>
|
||||||
<fuse-fullscreen></fuse-fullscreen>
|
<fuse-fullscreen class="hidden md:block"></fuse-fullscreen>
|
||||||
<search [appearance]="'bar'"></search>
|
<search [appearance]="'bar'"></search>
|
||||||
<shortcuts [shortcuts]="data.shortcuts"></shortcuts>
|
<shortcuts></shortcuts>
|
||||||
<messages [messages]="data.messages"></messages>
|
<messages></messages>
|
||||||
<notifications [notifications]="data.notifications"></notifications>
|
<notifications></notifications>
|
||||||
<user-menu></user-menu>
|
<button
|
||||||
|
class="lg:hidden"
|
||||||
|
mat-icon-button
|
||||||
|
(click)="quickChat.toggle()">
|
||||||
|
<mat-icon [svgIcon]="'heroicons_outline:chat-alt-2'"></mat-icon>
|
||||||
|
</button>
|
||||||
|
<user></user>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -63,7 +69,7 @@
|
|||||||
<fuse-horizontal-navigation
|
<fuse-horizontal-navigation
|
||||||
class="-mx-4"
|
class="-mx-4"
|
||||||
[name]="'mainNavigation'"
|
[name]="'mainNavigation'"
|
||||||
[navigation]="data.navigation.horizontal"></fuse-horizontal-navigation>
|
[navigation]="navigation.horizontal"></fuse-horizontal-navigation>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
@@ -86,3 +92,6 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- Quick chat -->
|
||||||
|
<quick-chat #quickChat="quickChat"></quick-chat>
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
import { Component, OnDestroy, OnInit, ViewEncapsulation } from '@angular/core';
|
import { Component, OnDestroy, OnInit, ViewEncapsulation } from '@angular/core';
|
||||||
import { ActivatedRoute, Data, Router } from '@angular/router';
|
import { ActivatedRoute, Router } from '@angular/router';
|
||||||
import { Subject } from 'rxjs';
|
import { Subject } from 'rxjs';
|
||||||
import { takeUntil } from 'rxjs/operators';
|
import { takeUntil } from 'rxjs/operators';
|
||||||
import { FuseMediaWatcherService } from '@fuse/services/media-watcher';
|
import { FuseMediaWatcherService } from '@fuse/services/media-watcher';
|
||||||
import { FuseNavigationService, FuseVerticalNavigationComponent } from '@fuse/components/navigation';
|
import { FuseNavigationService, FuseVerticalNavigationComponent } from '@fuse/components/navigation';
|
||||||
import { InitialData } from 'app/app.types';
|
import { Navigation } from 'app/core/navigation/navigation.types';
|
||||||
|
import { NavigationService } from 'app/core/navigation/navigation.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector : 'enterprise-layout',
|
selector : 'enterprise-layout',
|
||||||
@@ -13,8 +14,8 @@ import { InitialData } from 'app/app.types';
|
|||||||
})
|
})
|
||||||
export class EnterpriseLayoutComponent implements OnInit, OnDestroy
|
export class EnterpriseLayoutComponent implements OnInit, OnDestroy
|
||||||
{
|
{
|
||||||
data: InitialData;
|
|
||||||
isScreenSmall: boolean;
|
isScreenSmall: boolean;
|
||||||
|
navigation: Navigation;
|
||||||
private _unsubscribeAll: Subject<any> = new Subject<any>();
|
private _unsubscribeAll: Subject<any> = new Subject<any>();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -23,6 +24,7 @@ export class EnterpriseLayoutComponent implements OnInit, OnDestroy
|
|||||||
constructor(
|
constructor(
|
||||||
private _activatedRoute: ActivatedRoute,
|
private _activatedRoute: ActivatedRoute,
|
||||||
private _router: Router,
|
private _router: Router,
|
||||||
|
private _navigationService: NavigationService,
|
||||||
private _fuseMediaWatcherService: FuseMediaWatcherService,
|
private _fuseMediaWatcherService: FuseMediaWatcherService,
|
||||||
private _fuseNavigationService: FuseNavigationService
|
private _fuseNavigationService: FuseNavigationService
|
||||||
)
|
)
|
||||||
@@ -50,10 +52,12 @@ export class EnterpriseLayoutComponent implements OnInit, OnDestroy
|
|||||||
*/
|
*/
|
||||||
ngOnInit(): void
|
ngOnInit(): void
|
||||||
{
|
{
|
||||||
// Subscribe to the resolved route data
|
// Subscribe to navigation data
|
||||||
this._activatedRoute.data.subscribe((data: Data) => {
|
this._navigationService.navigation$
|
||||||
this.data = data.initialData;
|
.pipe(takeUntil(this._unsubscribeAll))
|
||||||
});
|
.subscribe((navigation: Navigation) => {
|
||||||
|
this.navigation = navigation;
|
||||||
|
});
|
||||||
|
|
||||||
// Subscribe to media changes
|
// Subscribe to media changes
|
||||||
this._fuseMediaWatcherService.onMediaChange$
|
this._fuseMediaWatcherService.onMediaChange$
|
||||||
|
|||||||
@@ -7,12 +7,13 @@ import { MatIconModule } from '@angular/material/icon';
|
|||||||
import { MatMenuModule } from '@angular/material/menu';
|
import { MatMenuModule } from '@angular/material/menu';
|
||||||
import { FuseFullscreenModule } from '@fuse/components/fullscreen';
|
import { FuseFullscreenModule } from '@fuse/components/fullscreen';
|
||||||
import { FuseNavigationModule } from '@fuse/components/navigation';
|
import { FuseNavigationModule } from '@fuse/components/navigation';
|
||||||
import { LanguageModule } from 'app/layout/common/language/language.module';
|
import { LanguagesModule } from 'app/layout/common/languages/languages.module';
|
||||||
import { MessagesModule } from 'app/layout/common/messages/messages.module';
|
import { MessagesModule } from 'app/layout/common/messages/messages.module';
|
||||||
import { NotificationsModule } from 'app/layout/common/notifications/notifications.module';
|
import { NotificationsModule } from 'app/layout/common/notifications/notifications.module';
|
||||||
|
import { QuickChatModule } from 'app/layout/common/quick-chat/quick-chat.module';
|
||||||
import { SearchModule } from 'app/layout/common/search/search.module';
|
import { SearchModule } from 'app/layout/common/search/search.module';
|
||||||
import { ShortcutsModule } from 'app/layout/common/shortcuts/shortcuts.module';
|
import { ShortcutsModule } from 'app/layout/common/shortcuts/shortcuts.module';
|
||||||
import { UserMenuModule } from 'app/layout/common/user-menu/user-menu.module';
|
import { UserModule } from 'app/layout/common/user/user.module';
|
||||||
import { SharedModule } from 'app/shared/shared.module';
|
import { SharedModule } from 'app/shared/shared.module';
|
||||||
import { EnterpriseLayoutComponent } from 'app/layout/layouts/horizontal/enterprise/enterprise.component';
|
import { EnterpriseLayoutComponent } from 'app/layout/layouts/horizontal/enterprise/enterprise.component';
|
||||||
|
|
||||||
@@ -29,12 +30,13 @@ import { EnterpriseLayoutComponent } from 'app/layout/layouts/horizontal/enterpr
|
|||||||
MatMenuModule,
|
MatMenuModule,
|
||||||
FuseFullscreenModule,
|
FuseFullscreenModule,
|
||||||
FuseNavigationModule,
|
FuseNavigationModule,
|
||||||
LanguageModule,
|
LanguagesModule,
|
||||||
MessagesModule,
|
MessagesModule,
|
||||||
NotificationsModule,
|
NotificationsModule,
|
||||||
|
QuickChatModule,
|
||||||
SearchModule,
|
SearchModule,
|
||||||
ShortcutsModule,
|
ShortcutsModule,
|
||||||
UserMenuModule,
|
UserModule,
|
||||||
SharedModule
|
SharedModule
|
||||||
],
|
],
|
||||||
exports : [
|
exports : [
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
class="dark bg-gray-900 print:hidden"
|
class="dark bg-gray-900 print:hidden"
|
||||||
[mode]="'over'"
|
[mode]="'over'"
|
||||||
[name]="'mainNavigation'"
|
[name]="'mainNavigation'"
|
||||||
[navigation]="data.navigation.default"
|
[navigation]="navigation.default"
|
||||||
[opened]="false">
|
[opened]="false">
|
||||||
<!-- Navigation header hook -->
|
<!-- Navigation header hook -->
|
||||||
<ng-container fuseVerticalNavigationContentHeader>
|
<ng-container fuseVerticalNavigationContentHeader>
|
||||||
@@ -51,14 +51,14 @@
|
|||||||
</button>
|
</button>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
<!-- Components -->
|
<!-- Components -->
|
||||||
<div class="flex items-center pl-2 ml-auto space-x-2">
|
<div class="flex items-center pl-2 ml-auto space-x-1 sm:space-x-2">
|
||||||
<language></language>
|
<languages></languages>
|
||||||
<fuse-fullscreen></fuse-fullscreen>
|
<fuse-fullscreen class="hidden md:block"></fuse-fullscreen>
|
||||||
<search [appearance]="'bar'"></search>
|
<search [appearance]="'bar'"></search>
|
||||||
<shortcuts [shortcuts]="data.shortcuts"></shortcuts>
|
<shortcuts></shortcuts>
|
||||||
<messages [messages]="data.messages"></messages>
|
<messages></messages>
|
||||||
<notifications [notifications]="data.notifications"></notifications>
|
<notifications></notifications>
|
||||||
<user-menu></user-menu>
|
<user></user>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- Bottom bar -->
|
<!-- Bottom bar -->
|
||||||
@@ -66,7 +66,7 @@
|
|||||||
<div class="relative flex flex-auto flex-0 items-center h-16 px-4">
|
<div class="relative flex flex-auto flex-0 items-center h-16 px-4">
|
||||||
<fuse-horizontal-navigation
|
<fuse-horizontal-navigation
|
||||||
[name]="'mainNavigation'"
|
[name]="'mainNavigation'"
|
||||||
[navigation]="data.navigation.horizontal"></fuse-horizontal-navigation>
|
[navigation]="navigation.horizontal"></fuse-horizontal-navigation>
|
||||||
</div>
|
</div>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
import { Component, OnDestroy, OnInit, ViewEncapsulation } from '@angular/core';
|
import { Component, OnDestroy, OnInit, ViewEncapsulation } from '@angular/core';
|
||||||
import { ActivatedRoute, Data, Router } from '@angular/router';
|
import { ActivatedRoute, Router } from '@angular/router';
|
||||||
import { Subject } from 'rxjs';
|
import { Subject } from 'rxjs';
|
||||||
import { takeUntil } from 'rxjs/operators';
|
import { takeUntil } from 'rxjs/operators';
|
||||||
import { FuseMediaWatcherService } from '@fuse/services/media-watcher';
|
import { FuseMediaWatcherService } from '@fuse/services/media-watcher';
|
||||||
import { FuseNavigationService, FuseVerticalNavigationComponent } from '@fuse/components/navigation';
|
import { FuseNavigationService, FuseVerticalNavigationComponent } from '@fuse/components/navigation';
|
||||||
import { InitialData } from 'app/app.types';
|
import { Navigation } from 'app/core/navigation/navigation.types';
|
||||||
|
import { NavigationService } from 'app/core/navigation/navigation.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector : 'material-layout',
|
selector : 'material-layout',
|
||||||
@@ -13,8 +14,8 @@ import { InitialData } from 'app/app.types';
|
|||||||
})
|
})
|
||||||
export class MaterialLayoutComponent implements OnInit, OnDestroy
|
export class MaterialLayoutComponent implements OnInit, OnDestroy
|
||||||
{
|
{
|
||||||
data: InitialData;
|
|
||||||
isScreenSmall: boolean;
|
isScreenSmall: boolean;
|
||||||
|
navigation: Navigation;
|
||||||
private _unsubscribeAll: Subject<any> = new Subject<any>();
|
private _unsubscribeAll: Subject<any> = new Subject<any>();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -23,6 +24,7 @@ export class MaterialLayoutComponent implements OnInit, OnDestroy
|
|||||||
constructor(
|
constructor(
|
||||||
private _activatedRoute: ActivatedRoute,
|
private _activatedRoute: ActivatedRoute,
|
||||||
private _router: Router,
|
private _router: Router,
|
||||||
|
private _navigationService: NavigationService,
|
||||||
private _fuseMediaWatcherService: FuseMediaWatcherService,
|
private _fuseMediaWatcherService: FuseMediaWatcherService,
|
||||||
private _fuseNavigationService: FuseNavigationService
|
private _fuseNavigationService: FuseNavigationService
|
||||||
)
|
)
|
||||||
@@ -50,10 +52,12 @@ export class MaterialLayoutComponent implements OnInit, OnDestroy
|
|||||||
*/
|
*/
|
||||||
ngOnInit(): void
|
ngOnInit(): void
|
||||||
{
|
{
|
||||||
// Subscribe to the resolved route data
|
// Subscribe to navigation data
|
||||||
this._activatedRoute.data.subscribe((data: Data) => {
|
this._navigationService.navigation$
|
||||||
this.data = data.initialData;
|
.pipe(takeUntil(this._unsubscribeAll))
|
||||||
});
|
.subscribe((navigation: Navigation) => {
|
||||||
|
this.navigation = navigation;
|
||||||
|
});
|
||||||
|
|
||||||
// Subscribe to media changes
|
// Subscribe to media changes
|
||||||
this._fuseMediaWatcherService.onMediaChange$
|
this._fuseMediaWatcherService.onMediaChange$
|
||||||
|
|||||||
@@ -7,12 +7,12 @@ import { MatIconModule } from '@angular/material/icon';
|
|||||||
import { MatMenuModule } from '@angular/material/menu';
|
import { MatMenuModule } from '@angular/material/menu';
|
||||||
import { FuseFullscreenModule } from '@fuse/components/fullscreen';
|
import { FuseFullscreenModule } from '@fuse/components/fullscreen';
|
||||||
import { FuseNavigationModule } from '@fuse/components/navigation';
|
import { FuseNavigationModule } from '@fuse/components/navigation';
|
||||||
import { LanguageModule } from 'app/layout/common/language/language.module';
|
import { LanguagesModule } from 'app/layout/common/languages/languages.module';
|
||||||
import { MessagesModule } from 'app/layout/common/messages/messages.module';
|
import { MessagesModule } from 'app/layout/common/messages/messages.module';
|
||||||
import { NotificationsModule } from 'app/layout/common/notifications/notifications.module';
|
import { NotificationsModule } from 'app/layout/common/notifications/notifications.module';
|
||||||
import { SearchModule } from 'app/layout/common/search/search.module';
|
import { SearchModule } from 'app/layout/common/search/search.module';
|
||||||
import { ShortcutsModule } from 'app/layout/common/shortcuts/shortcuts.module';
|
import { ShortcutsModule } from 'app/layout/common/shortcuts/shortcuts.module';
|
||||||
import { UserMenuModule } from 'app/layout/common/user-menu/user-menu.module';
|
import { UserModule } from 'app/layout/common/user/user.module';
|
||||||
import { SharedModule } from 'app/shared/shared.module';
|
import { SharedModule } from 'app/shared/shared.module';
|
||||||
import { MaterialLayoutComponent } from 'app/layout/layouts/horizontal/material/material.component';
|
import { MaterialLayoutComponent } from 'app/layout/layouts/horizontal/material/material.component';
|
||||||
|
|
||||||
@@ -29,12 +29,12 @@ import { MaterialLayoutComponent } from 'app/layout/layouts/horizontal/material/
|
|||||||
MatMenuModule,
|
MatMenuModule,
|
||||||
FuseFullscreenModule,
|
FuseFullscreenModule,
|
||||||
FuseNavigationModule,
|
FuseNavigationModule,
|
||||||
LanguageModule,
|
LanguagesModule,
|
||||||
MessagesModule,
|
MessagesModule,
|
||||||
NotificationsModule,
|
NotificationsModule,
|
||||||
SearchModule,
|
SearchModule,
|
||||||
ShortcutsModule,
|
ShortcutsModule,
|
||||||
UserMenuModule,
|
UserModule,
|
||||||
SharedModule
|
SharedModule
|
||||||
],
|
],
|
||||||
exports : [
|
exports : [
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
class="dark bg-gray-900 print:hidden"
|
class="dark bg-gray-900 print:hidden"
|
||||||
[mode]="'over'"
|
[mode]="'over'"
|
||||||
[name]="'mainNavigation'"
|
[name]="'mainNavigation'"
|
||||||
[navigation]="data.navigation.default"
|
[navigation]="navigation.default"
|
||||||
[opened]="false">
|
[opened]="false">
|
||||||
<!-- Navigation header hook -->
|
<!-- Navigation header hook -->
|
||||||
<ng-container fuseVerticalNavigationContentHeader>
|
<ng-container fuseVerticalNavigationContentHeader>
|
||||||
@@ -43,7 +43,7 @@
|
|||||||
<fuse-horizontal-navigation
|
<fuse-horizontal-navigation
|
||||||
class="mr-2"
|
class="mr-2"
|
||||||
[name]="'mainNavigation'"
|
[name]="'mainNavigation'"
|
||||||
[navigation]="data.navigation.horizontal"></fuse-horizontal-navigation>
|
[navigation]="navigation.horizontal"></fuse-horizontal-navigation>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
<!-- Navigation toggle button -->
|
<!-- Navigation toggle button -->
|
||||||
<ng-container *ngIf="isScreenSmall">
|
<ng-container *ngIf="isScreenSmall">
|
||||||
@@ -54,14 +54,20 @@
|
|||||||
</button>
|
</button>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
<!-- Components -->
|
<!-- Components -->
|
||||||
<div class="flex items-center pl-2 ml-auto space-x-2">
|
<div class="flex items-center pl-2 ml-auto space-x-0.5 sm:space-x-2">
|
||||||
<language></language>
|
<languages></languages>
|
||||||
<fuse-fullscreen></fuse-fullscreen>
|
<fuse-fullscreen class="hidden md:block"></fuse-fullscreen>
|
||||||
<search [appearance]="'bar'"></search>
|
<search [appearance]="'bar'"></search>
|
||||||
<shortcuts [shortcuts]="data.shortcuts"></shortcuts>
|
<shortcuts></shortcuts>
|
||||||
<messages [messages]="data.messages"></messages>
|
<messages></messages>
|
||||||
<notifications [notifications]="data.notifications"></notifications>
|
<notifications></notifications>
|
||||||
<user-menu></user-menu>
|
<button
|
||||||
|
class="lg:hidden"
|
||||||
|
mat-icon-button
|
||||||
|
(click)="quickChat.toggle()">
|
||||||
|
<mat-icon [svgIcon]="'heroicons_outline:chat-alt-2'"></mat-icon>
|
||||||
|
</button>
|
||||||
|
<user></user>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -78,3 +84,6 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- Quick chat -->
|
||||||
|
<quick-chat #quickChat="quickChat"></quick-chat>
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
import { Component, OnDestroy, OnInit, ViewEncapsulation } from '@angular/core';
|
import { Component, OnDestroy, OnInit, ViewEncapsulation } from '@angular/core';
|
||||||
import { ActivatedRoute, Data, Router } from '@angular/router';
|
import { ActivatedRoute, Router } from '@angular/router';
|
||||||
import { Subject } from 'rxjs';
|
import { Subject } from 'rxjs';
|
||||||
import { takeUntil } from 'rxjs/operators';
|
import { takeUntil } from 'rxjs/operators';
|
||||||
import { FuseMediaWatcherService } from '@fuse/services/media-watcher';
|
import { FuseMediaWatcherService } from '@fuse/services/media-watcher';
|
||||||
import { FuseNavigationService, FuseVerticalNavigationComponent } from '@fuse/components/navigation';
|
import { FuseNavigationService, FuseVerticalNavigationComponent } from '@fuse/components/navigation';
|
||||||
import { InitialData } from 'app/app.types';
|
import { Navigation } from 'app/core/navigation/navigation.types';
|
||||||
|
import { NavigationService } from 'app/core/navigation/navigation.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector : 'modern-layout',
|
selector : 'modern-layout',
|
||||||
@@ -13,8 +14,8 @@ import { InitialData } from 'app/app.types';
|
|||||||
})
|
})
|
||||||
export class ModernLayoutComponent implements OnInit, OnDestroy
|
export class ModernLayoutComponent implements OnInit, OnDestroy
|
||||||
{
|
{
|
||||||
data: InitialData;
|
|
||||||
isScreenSmall: boolean;
|
isScreenSmall: boolean;
|
||||||
|
navigation: Navigation;
|
||||||
private _unsubscribeAll: Subject<any> = new Subject<any>();
|
private _unsubscribeAll: Subject<any> = new Subject<any>();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -23,6 +24,7 @@ export class ModernLayoutComponent implements OnInit, OnDestroy
|
|||||||
constructor(
|
constructor(
|
||||||
private _activatedRoute: ActivatedRoute,
|
private _activatedRoute: ActivatedRoute,
|
||||||
private _router: Router,
|
private _router: Router,
|
||||||
|
private _navigationService: NavigationService,
|
||||||
private _fuseMediaWatcherService: FuseMediaWatcherService,
|
private _fuseMediaWatcherService: FuseMediaWatcherService,
|
||||||
private _fuseNavigationService: FuseNavigationService
|
private _fuseNavigationService: FuseNavigationService
|
||||||
)
|
)
|
||||||
@@ -50,10 +52,12 @@ export class ModernLayoutComponent implements OnInit, OnDestroy
|
|||||||
*/
|
*/
|
||||||
ngOnInit(): void
|
ngOnInit(): void
|
||||||
{
|
{
|
||||||
// Subscribe to the resolved route data
|
// Subscribe to navigation data
|
||||||
this._activatedRoute.data.subscribe((data: Data) => {
|
this._navigationService.navigation$
|
||||||
this.data = data.initialData;
|
.pipe(takeUntil(this._unsubscribeAll))
|
||||||
});
|
.subscribe((navigation: Navigation) => {
|
||||||
|
this.navigation = navigation;
|
||||||
|
});
|
||||||
|
|
||||||
// Subscribe to media changes
|
// Subscribe to media changes
|
||||||
this._fuseMediaWatcherService.onMediaChange$
|
this._fuseMediaWatcherService.onMediaChange$
|
||||||
|
|||||||
@@ -7,12 +7,13 @@ import { MatIconModule } from '@angular/material/icon';
|
|||||||
import { MatMenuModule } from '@angular/material/menu';
|
import { MatMenuModule } from '@angular/material/menu';
|
||||||
import { FuseFullscreenModule } from '@fuse/components/fullscreen';
|
import { FuseFullscreenModule } from '@fuse/components/fullscreen';
|
||||||
import { FuseNavigationModule } from '@fuse/components/navigation';
|
import { FuseNavigationModule } from '@fuse/components/navigation';
|
||||||
import { LanguageModule } from 'app/layout/common/language/language.module';
|
import { LanguagesModule } from 'app/layout/common/languages/languages.module';
|
||||||
import { MessagesModule } from 'app/layout/common/messages/messages.module';
|
import { MessagesModule } from 'app/layout/common/messages/messages.module';
|
||||||
import { NotificationsModule } from 'app/layout/common/notifications/notifications.module';
|
import { NotificationsModule } from 'app/layout/common/notifications/notifications.module';
|
||||||
|
import { QuickChatModule } from 'app/layout/common/quick-chat/quick-chat.module';
|
||||||
import { SearchModule } from 'app/layout/common/search/search.module';
|
import { SearchModule } from 'app/layout/common/search/search.module';
|
||||||
import { ShortcutsModule } from 'app/layout/common/shortcuts/shortcuts.module';
|
import { ShortcutsModule } from 'app/layout/common/shortcuts/shortcuts.module';
|
||||||
import { UserMenuModule } from 'app/layout/common/user-menu/user-menu.module';
|
import { UserModule } from 'app/layout/common/user/user.module';
|
||||||
import { SharedModule } from 'app/shared/shared.module';
|
import { SharedModule } from 'app/shared/shared.module';
|
||||||
import { ModernLayoutComponent } from 'app/layout/layouts/horizontal/modern/modern.component';
|
import { ModernLayoutComponent } from 'app/layout/layouts/horizontal/modern/modern.component';
|
||||||
|
|
||||||
@@ -29,12 +30,13 @@ import { ModernLayoutComponent } from 'app/layout/layouts/horizontal/modern/mode
|
|||||||
MatMenuModule,
|
MatMenuModule,
|
||||||
FuseFullscreenModule,
|
FuseFullscreenModule,
|
||||||
FuseNavigationModule,
|
FuseNavigationModule,
|
||||||
LanguageModule,
|
LanguagesModule,
|
||||||
MessagesModule,
|
MessagesModule,
|
||||||
NotificationsModule,
|
NotificationsModule,
|
||||||
|
QuickChatModule,
|
||||||
SearchModule,
|
SearchModule,
|
||||||
ShortcutsModule,
|
ShortcutsModule,
|
||||||
UserMenuModule,
|
UserModule,
|
||||||
SharedModule
|
SharedModule
|
||||||
],
|
],
|
||||||
exports : [
|
exports : [
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
class="dark bg-gray-900 print:hidden"
|
class="dark bg-gray-900 print:hidden"
|
||||||
[mode]="isScreenSmall ? 'over' : 'side'"
|
[mode]="isScreenSmall ? 'over' : 'side'"
|
||||||
[name]="'mainNavigation'"
|
[name]="'mainNavigation'"
|
||||||
[navigation]="data.navigation.default"
|
[navigation]="navigation.default"
|
||||||
[opened]="!isScreenSmall">
|
[opened]="!isScreenSmall">
|
||||||
<!-- Navigation header hook -->
|
<!-- Navigation header hook -->
|
||||||
<ng-container fuseVerticalNavigationContentHeader>
|
<ng-container fuseVerticalNavigationContentHeader>
|
||||||
@@ -35,14 +35,20 @@
|
|||||||
<mat-icon [svgIcon]="'heroicons_outline:menu'"></mat-icon>
|
<mat-icon [svgIcon]="'heroicons_outline:menu'"></mat-icon>
|
||||||
</button>
|
</button>
|
||||||
<!-- Components -->
|
<!-- Components -->
|
||||||
<div class="flex items-center pl-2 ml-auto space-x-2">
|
<div class="flex items-center pl-2 ml-auto space-x-0.5 sm:space-x-2">
|
||||||
<language></language>
|
<languages></languages>
|
||||||
<fuse-fullscreen></fuse-fullscreen>
|
<fuse-fullscreen class="hidden md:block"></fuse-fullscreen>
|
||||||
<search [appearance]="'bar'"></search>
|
<search [appearance]="'bar'"></search>
|
||||||
<shortcuts [shortcuts]="data.shortcuts"></shortcuts>
|
<shortcuts></shortcuts>
|
||||||
<messages [messages]="data.messages"></messages>
|
<messages></messages>
|
||||||
<notifications [notifications]="data.notifications"></notifications>
|
<notifications></notifications>
|
||||||
<user-menu></user-menu>
|
<button
|
||||||
|
class="lg:hidden"
|
||||||
|
mat-icon-button
|
||||||
|
(click)="quickChat.toggle()">
|
||||||
|
<mat-icon [svgIcon]="'heroicons_outline:chat-alt-2'"></mat-icon>
|
||||||
|
</button>
|
||||||
|
<user></user>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -59,3 +65,6 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- Quick chat -->
|
||||||
|
<quick-chat #quickChat="quickChat"></quick-chat>
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
import { Component, OnDestroy, OnInit, ViewEncapsulation } from '@angular/core';
|
import { Component, OnDestroy, OnInit, ViewEncapsulation } from '@angular/core';
|
||||||
import { ActivatedRoute, Data, Router } from '@angular/router';
|
import { ActivatedRoute, Router } from '@angular/router';
|
||||||
import { Subject } from 'rxjs';
|
import { Subject } from 'rxjs';
|
||||||
import { takeUntil } from 'rxjs/operators';
|
import { takeUntil } from 'rxjs/operators';
|
||||||
import { FuseMediaWatcherService } from '@fuse/services/media-watcher';
|
import { FuseMediaWatcherService } from '@fuse/services/media-watcher';
|
||||||
import { FuseNavigationService, FuseVerticalNavigationComponent } from '@fuse/components/navigation';
|
import { FuseNavigationService, FuseVerticalNavigationComponent } from '@fuse/components/navigation';
|
||||||
import { InitialData } from 'app/app.types';
|
import { Navigation } from 'app/core/navigation/navigation.types';
|
||||||
|
import { NavigationService } from 'app/core/navigation/navigation.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector : 'classic-layout',
|
selector : 'classic-layout',
|
||||||
@@ -13,8 +14,8 @@ import { InitialData } from 'app/app.types';
|
|||||||
})
|
})
|
||||||
export class ClassicLayoutComponent implements OnInit, OnDestroy
|
export class ClassicLayoutComponent implements OnInit, OnDestroy
|
||||||
{
|
{
|
||||||
data: InitialData;
|
|
||||||
isScreenSmall: boolean;
|
isScreenSmall: boolean;
|
||||||
|
navigation: Navigation;
|
||||||
private _unsubscribeAll: Subject<any> = new Subject<any>();
|
private _unsubscribeAll: Subject<any> = new Subject<any>();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -23,6 +24,7 @@ export class ClassicLayoutComponent implements OnInit, OnDestroy
|
|||||||
constructor(
|
constructor(
|
||||||
private _activatedRoute: ActivatedRoute,
|
private _activatedRoute: ActivatedRoute,
|
||||||
private _router: Router,
|
private _router: Router,
|
||||||
|
private _navigationService: NavigationService,
|
||||||
private _fuseMediaWatcherService: FuseMediaWatcherService,
|
private _fuseMediaWatcherService: FuseMediaWatcherService,
|
||||||
private _fuseNavigationService: FuseNavigationService
|
private _fuseNavigationService: FuseNavigationService
|
||||||
)
|
)
|
||||||
@@ -50,10 +52,12 @@ export class ClassicLayoutComponent implements OnInit, OnDestroy
|
|||||||
*/
|
*/
|
||||||
ngOnInit(): void
|
ngOnInit(): void
|
||||||
{
|
{
|
||||||
// Subscribe to the resolved route data
|
// Subscribe to navigation data
|
||||||
this._activatedRoute.data.subscribe((data: Data) => {
|
this._navigationService.navigation$
|
||||||
this.data = data.initialData;
|
.pipe(takeUntil(this._unsubscribeAll))
|
||||||
});
|
.subscribe((navigation: Navigation) => {
|
||||||
|
this.navigation = navigation;
|
||||||
|
});
|
||||||
|
|
||||||
// Subscribe to media changes
|
// Subscribe to media changes
|
||||||
this._fuseMediaWatcherService.onMediaChange$
|
this._fuseMediaWatcherService.onMediaChange$
|
||||||
|
|||||||
@@ -7,12 +7,13 @@ import { MatIconModule } from '@angular/material/icon';
|
|||||||
import { MatMenuModule } from '@angular/material/menu';
|
import { MatMenuModule } from '@angular/material/menu';
|
||||||
import { FuseFullscreenModule } from '@fuse/components/fullscreen';
|
import { FuseFullscreenModule } from '@fuse/components/fullscreen';
|
||||||
import { FuseNavigationModule } from '@fuse/components/navigation';
|
import { FuseNavigationModule } from '@fuse/components/navigation';
|
||||||
import { LanguageModule } from 'app/layout/common/language/language.module';
|
import { LanguagesModule } from 'app/layout/common/languages/languages.module';
|
||||||
import { MessagesModule } from 'app/layout/common/messages/messages.module';
|
import { MessagesModule } from 'app/layout/common/messages/messages.module';
|
||||||
import { NotificationsModule } from 'app/layout/common/notifications/notifications.module';
|
import { NotificationsModule } from 'app/layout/common/notifications/notifications.module';
|
||||||
|
import { QuickChatModule } from 'app/layout/common/quick-chat/quick-chat.module';
|
||||||
import { SearchModule } from 'app/layout/common/search/search.module';
|
import { SearchModule } from 'app/layout/common/search/search.module';
|
||||||
import { ShortcutsModule } from 'app/layout/common/shortcuts/shortcuts.module';
|
import { ShortcutsModule } from 'app/layout/common/shortcuts/shortcuts.module';
|
||||||
import { UserMenuModule } from 'app/layout/common/user-menu/user-menu.module';
|
import { UserModule } from 'app/layout/common/user/user.module';
|
||||||
import { SharedModule } from 'app/shared/shared.module';
|
import { SharedModule } from 'app/shared/shared.module';
|
||||||
import { ClassicLayoutComponent } from 'app/layout/layouts/vertical/classic/classic.component';
|
import { ClassicLayoutComponent } from 'app/layout/layouts/vertical/classic/classic.component';
|
||||||
|
|
||||||
@@ -29,12 +30,13 @@ import { ClassicLayoutComponent } from 'app/layout/layouts/vertical/classic/clas
|
|||||||
MatMenuModule,
|
MatMenuModule,
|
||||||
FuseFullscreenModule,
|
FuseFullscreenModule,
|
||||||
FuseNavigationModule,
|
FuseNavigationModule,
|
||||||
LanguageModule,
|
LanguagesModule,
|
||||||
MessagesModule,
|
MessagesModule,
|
||||||
NotificationsModule,
|
NotificationsModule,
|
||||||
|
QuickChatModule,
|
||||||
SearchModule,
|
SearchModule,
|
||||||
ShortcutsModule,
|
ShortcutsModule,
|
||||||
UserMenuModule,
|
UserModule,
|
||||||
SharedModule
|
SharedModule
|
||||||
],
|
],
|
||||||
exports : [
|
exports : [
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
class="dark bg-gray-900 print:hidden"
|
class="dark bg-gray-900 print:hidden"
|
||||||
[mode]="isScreenSmall ? 'over' : 'side'"
|
[mode]="isScreenSmall ? 'over' : 'side'"
|
||||||
[name]="'mainNavigation'"
|
[name]="'mainNavigation'"
|
||||||
[navigation]="data.navigation.default"
|
[navigation]="navigation.default"
|
||||||
[opened]="!isScreenSmall">
|
[opened]="!isScreenSmall">
|
||||||
<!-- Navigation header hook -->
|
<!-- Navigation header hook -->
|
||||||
<ng-container fuseVerticalNavigationContentHeader>
|
<ng-container fuseVerticalNavigationContentHeader>
|
||||||
@@ -16,8 +16,8 @@
|
|||||||
</div>
|
</div>
|
||||||
<!-- Components -->
|
<!-- Components -->
|
||||||
<div class="flex items-center ml-auto">
|
<div class="flex items-center ml-auto">
|
||||||
<notifications [notifications]="data.notifications"></notifications>
|
<notifications></notifications>
|
||||||
<user-menu [showAvatar]="false"></user-menu>
|
<user [showAvatar]="false"></user>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- User -->
|
<!-- User -->
|
||||||
@@ -25,20 +25,20 @@
|
|||||||
<div class="relative w-24 h-24">
|
<div class="relative w-24 h-24">
|
||||||
<img
|
<img
|
||||||
class="w-full h-full rounded-full"
|
class="w-full h-full rounded-full"
|
||||||
*ngIf="data.user.avatar"
|
*ngIf="user.avatar"
|
||||||
[src]="data.user.avatar"
|
[src]="user.avatar"
|
||||||
alt="User avatar">
|
alt="User avatar">
|
||||||
<mat-icon
|
<mat-icon
|
||||||
class="icon-size-24"
|
class="icon-size-24"
|
||||||
*ngIf="!data.user.avatar"
|
*ngIf="!user.avatar"
|
||||||
[svgIcon]="'heroicons_solid:user-circle'"></mat-icon>
|
[svgIcon]="'heroicons_solid:user-circle'"></mat-icon>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex flex-col items-center justify-center w-full mt-6">
|
<div class="flex flex-col items-center justify-center w-full mt-6">
|
||||||
<div class="w-full whitespace-nowrap overflow-ellipsis overflow-hidden text-center leading-normal font-medium">
|
<div class="w-full whitespace-nowrap overflow-ellipsis overflow-hidden text-center leading-normal font-medium">
|
||||||
{{data.user.name}}
|
{{user.name}}
|
||||||
</div>
|
</div>
|
||||||
<div class="w-full mt-0.5 whitespace-nowrap overflow-ellipsis overflow-hidden text-center text-md leading-normal font-medium text-secondary">
|
<div class="w-full mt-0.5 whitespace-nowrap overflow-ellipsis overflow-hidden text-center text-md leading-normal font-medium text-secondary">
|
||||||
{{data.user.email}}
|
{{user.email}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -65,12 +65,18 @@
|
|||||||
<mat-icon [svgIcon]="'heroicons_outline:menu'"></mat-icon>
|
<mat-icon [svgIcon]="'heroicons_outline:menu'"></mat-icon>
|
||||||
</button>
|
</button>
|
||||||
<!-- Components -->
|
<!-- Components -->
|
||||||
<div class="flex items-center pl-2 ml-auto space-x-2">
|
<div class="flex items-center pl-2 ml-auto space-x-0.5 sm:space-x-2">
|
||||||
<language></language>
|
<languages></languages>
|
||||||
<fuse-fullscreen></fuse-fullscreen>
|
<fuse-fullscreen class="hidden md:block"></fuse-fullscreen>
|
||||||
<search [appearance]="'bar'"></search>
|
<search [appearance]="'bar'"></search>
|
||||||
<shortcuts [shortcuts]="data.shortcuts"></shortcuts>
|
<shortcuts></shortcuts>
|
||||||
<messages [messages]="data.messages"></messages>
|
<messages></messages>
|
||||||
|
<button
|
||||||
|
class="lg:hidden"
|
||||||
|
mat-icon-button
|
||||||
|
(click)="quickChat.toggle()">
|
||||||
|
<mat-icon [svgIcon]="'heroicons_outline:chat-alt-2'"></mat-icon>
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -87,3 +93,6 @@
|
|||||||
</div>-->
|
</div>-->
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- Quick chat -->
|
||||||
|
<quick-chat #quickChat="quickChat"></quick-chat>
|
||||||
|
|||||||
@@ -1,10 +1,13 @@
|
|||||||
import { Component, OnDestroy, OnInit, ViewEncapsulation } from '@angular/core';
|
import { Component, OnDestroy, OnInit, ViewEncapsulation } from '@angular/core';
|
||||||
import { ActivatedRoute, Data, Router } from '@angular/router';
|
import { ActivatedRoute, Router } from '@angular/router';
|
||||||
import { Subject } from 'rxjs';
|
import { Subject } from 'rxjs';
|
||||||
import { takeUntil } from 'rxjs/operators';
|
import { takeUntil } from 'rxjs/operators';
|
||||||
import { FuseMediaWatcherService } from '@fuse/services/media-watcher';
|
import { FuseMediaWatcherService } from '@fuse/services/media-watcher';
|
||||||
import { FuseNavigationService, FuseVerticalNavigationComponent } from '@fuse/components/navigation';
|
import { FuseNavigationService, FuseVerticalNavigationComponent } from '@fuse/components/navigation';
|
||||||
import { InitialData } from 'app/app.types';
|
import { Navigation } from 'app/core/navigation/navigation.types';
|
||||||
|
import { NavigationService } from 'app/core/navigation/navigation.service';
|
||||||
|
import { User } from 'app/core/user/user.types';
|
||||||
|
import { UserService } from 'app/core/user/user.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector : 'classy-layout',
|
selector : 'classy-layout',
|
||||||
@@ -13,8 +16,9 @@ import { InitialData } from 'app/app.types';
|
|||||||
})
|
})
|
||||||
export class ClassyLayoutComponent implements OnInit, OnDestroy
|
export class ClassyLayoutComponent implements OnInit, OnDestroy
|
||||||
{
|
{
|
||||||
data: InitialData;
|
|
||||||
isScreenSmall: boolean;
|
isScreenSmall: boolean;
|
||||||
|
navigation: Navigation;
|
||||||
|
user: User;
|
||||||
private _unsubscribeAll: Subject<any> = new Subject<any>();
|
private _unsubscribeAll: Subject<any> = new Subject<any>();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -23,6 +27,8 @@ export class ClassyLayoutComponent implements OnInit, OnDestroy
|
|||||||
constructor(
|
constructor(
|
||||||
private _activatedRoute: ActivatedRoute,
|
private _activatedRoute: ActivatedRoute,
|
||||||
private _router: Router,
|
private _router: Router,
|
||||||
|
private _navigationService: NavigationService,
|
||||||
|
private _userService: UserService,
|
||||||
private _fuseMediaWatcherService: FuseMediaWatcherService,
|
private _fuseMediaWatcherService: FuseMediaWatcherService,
|
||||||
private _fuseNavigationService: FuseNavigationService
|
private _fuseNavigationService: FuseNavigationService
|
||||||
)
|
)
|
||||||
@@ -50,10 +56,19 @@ export class ClassyLayoutComponent implements OnInit, OnDestroy
|
|||||||
*/
|
*/
|
||||||
ngOnInit(): void
|
ngOnInit(): void
|
||||||
{
|
{
|
||||||
// Subscribe to the resolved route data
|
// Subscribe to navigation data
|
||||||
this._activatedRoute.data.subscribe((data: Data) => {
|
this._navigationService.navigation$
|
||||||
this.data = data.initialData;
|
.pipe(takeUntil(this._unsubscribeAll))
|
||||||
});
|
.subscribe((navigation: Navigation) => {
|
||||||
|
this.navigation = navigation;
|
||||||
|
});
|
||||||
|
|
||||||
|
// Subscribe to the user service
|
||||||
|
this._userService.user$
|
||||||
|
.pipe((takeUntil(this._unsubscribeAll)))
|
||||||
|
.subscribe((user: User) => {
|
||||||
|
this.user = user;
|
||||||
|
});
|
||||||
|
|
||||||
// Subscribe to media changes
|
// Subscribe to media changes
|
||||||
this._fuseMediaWatcherService.onMediaChange$
|
this._fuseMediaWatcherService.onMediaChange$
|
||||||
|
|||||||
@@ -7,12 +7,13 @@ import { MatIconModule } from '@angular/material/icon';
|
|||||||
import { MatMenuModule } from '@angular/material/menu';
|
import { MatMenuModule } from '@angular/material/menu';
|
||||||
import { FuseNavigationModule } from '@fuse/components/navigation';
|
import { FuseNavigationModule } from '@fuse/components/navigation';
|
||||||
import { FuseFullscreenModule } from '@fuse/components/fullscreen/fullscreen.module';
|
import { FuseFullscreenModule } from '@fuse/components/fullscreen/fullscreen.module';
|
||||||
import { LanguageModule } from 'app/layout/common/language/language.module';
|
import { LanguagesModule } from 'app/layout/common/languages/languages.module';
|
||||||
import { MessagesModule } from 'app/layout/common/messages/messages.module';
|
import { MessagesModule } from 'app/layout/common/messages/messages.module';
|
||||||
import { NotificationsModule } from 'app/layout/common/notifications/notifications.module';
|
import { NotificationsModule } from 'app/layout/common/notifications/notifications.module';
|
||||||
|
import { QuickChatModule } from 'app/layout/common/quick-chat/quick-chat.module';
|
||||||
import { SearchModule } from 'app/layout/common/search/search.module';
|
import { SearchModule } from 'app/layout/common/search/search.module';
|
||||||
import { ShortcutsModule } from 'app/layout/common/shortcuts/shortcuts.module';
|
import { ShortcutsModule } from 'app/layout/common/shortcuts/shortcuts.module';
|
||||||
import { UserMenuModule } from 'app/layout/common/user-menu/user-menu.module';
|
import { UserModule } from 'app/layout/common/user/user.module';
|
||||||
import { SharedModule } from 'app/shared/shared.module';
|
import { SharedModule } from 'app/shared/shared.module';
|
||||||
import { ClassyLayoutComponent } from 'app/layout/layouts/vertical/classy/classy.component';
|
import { ClassyLayoutComponent } from 'app/layout/layouts/vertical/classy/classy.component';
|
||||||
|
|
||||||
@@ -29,12 +30,13 @@ import { ClassyLayoutComponent } from 'app/layout/layouts/vertical/classy/classy
|
|||||||
MatMenuModule,
|
MatMenuModule,
|
||||||
FuseFullscreenModule,
|
FuseFullscreenModule,
|
||||||
FuseNavigationModule,
|
FuseNavigationModule,
|
||||||
LanguageModule,
|
LanguagesModule,
|
||||||
MessagesModule,
|
MessagesModule,
|
||||||
NotificationsModule,
|
NotificationsModule,
|
||||||
|
QuickChatModule,
|
||||||
SearchModule,
|
SearchModule,
|
||||||
ShortcutsModule,
|
ShortcutsModule,
|
||||||
UserMenuModule,
|
UserModule,
|
||||||
SharedModule
|
SharedModule
|
||||||
],
|
],
|
||||||
exports : [
|
exports : [
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
[appearance]="'compact'"
|
[appearance]="'compact'"
|
||||||
[mode]="isScreenSmall ? 'over' : 'side'"
|
[mode]="isScreenSmall ? 'over' : 'side'"
|
||||||
[name]="'mainNavigation'"
|
[name]="'mainNavigation'"
|
||||||
[navigation]="data.navigation.compact"
|
[navigation]="navigation.compact"
|
||||||
[opened]="!isScreenSmall">
|
[opened]="!isScreenSmall">
|
||||||
<!-- Navigation header hook -->
|
<!-- Navigation header hook -->
|
||||||
<ng-container fuseVerticalNavigationContentHeader>
|
<ng-container fuseVerticalNavigationContentHeader>
|
||||||
@@ -30,14 +30,20 @@
|
|||||||
<mat-icon [svgIcon]="'heroicons_outline:menu'"></mat-icon>
|
<mat-icon [svgIcon]="'heroicons_outline:menu'"></mat-icon>
|
||||||
</button>
|
</button>
|
||||||
<!-- Components -->
|
<!-- Components -->
|
||||||
<div class="flex items-center pl-2 ml-auto space-x-2">
|
<div class="flex items-center pl-2 ml-auto space-x-0.5 sm:space-x-2">
|
||||||
<language></language>
|
<languages></languages>
|
||||||
<fuse-fullscreen></fuse-fullscreen>
|
<fuse-fullscreen class="hidden md:block"></fuse-fullscreen>
|
||||||
<search [appearance]="'bar'"></search>
|
<search [appearance]="'bar'"></search>
|
||||||
<shortcuts [shortcuts]="data.shortcuts"></shortcuts>
|
<shortcuts></shortcuts>
|
||||||
<messages [messages]="data.messages"></messages>
|
<messages></messages>
|
||||||
<notifications [notifications]="data.notifications"></notifications>
|
<notifications></notifications>
|
||||||
<user-menu></user-menu>
|
<button
|
||||||
|
class="lg:hidden"
|
||||||
|
mat-icon-button
|
||||||
|
(click)="quickChat.toggle()">
|
||||||
|
<mat-icon [svgIcon]="'heroicons_outline:chat-alt-2'"></mat-icon>
|
||||||
|
</button>
|
||||||
|
<user></user>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -54,3 +60,6 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- Quick chat -->
|
||||||
|
<quick-chat #quickChat="quickChat"></quick-chat>
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
import { Component, OnDestroy, OnInit, ViewEncapsulation } from '@angular/core';
|
import { Component, OnDestroy, OnInit, ViewEncapsulation } from '@angular/core';
|
||||||
import { ActivatedRoute, Data, Router } from '@angular/router';
|
import { ActivatedRoute, Router } from '@angular/router';
|
||||||
import { Subject } from 'rxjs';
|
import { Subject } from 'rxjs';
|
||||||
import { takeUntil } from 'rxjs/operators';
|
import { takeUntil } from 'rxjs/operators';
|
||||||
import { FuseMediaWatcherService } from '@fuse/services/media-watcher';
|
import { FuseMediaWatcherService } from '@fuse/services/media-watcher';
|
||||||
import { FuseNavigationService, FuseVerticalNavigationComponent } from '@fuse/components/navigation';
|
import { FuseNavigationService, FuseVerticalNavigationComponent } from '@fuse/components/navigation';
|
||||||
import { InitialData } from 'app/app.types';
|
import { Navigation } from 'app/core/navigation/navigation.types';
|
||||||
|
import { NavigationService } from 'app/core/navigation/navigation.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector : 'compact-layout',
|
selector : 'compact-layout',
|
||||||
@@ -13,8 +14,8 @@ import { InitialData } from 'app/app.types';
|
|||||||
})
|
})
|
||||||
export class CompactLayoutComponent implements OnInit, OnDestroy
|
export class CompactLayoutComponent implements OnInit, OnDestroy
|
||||||
{
|
{
|
||||||
data: InitialData;
|
|
||||||
isScreenSmall: boolean;
|
isScreenSmall: boolean;
|
||||||
|
navigation: Navigation;
|
||||||
private _unsubscribeAll: Subject<any> = new Subject<any>();
|
private _unsubscribeAll: Subject<any> = new Subject<any>();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -23,6 +24,7 @@ export class CompactLayoutComponent implements OnInit, OnDestroy
|
|||||||
constructor(
|
constructor(
|
||||||
private _activatedRoute: ActivatedRoute,
|
private _activatedRoute: ActivatedRoute,
|
||||||
private _router: Router,
|
private _router: Router,
|
||||||
|
private _navigationService: NavigationService,
|
||||||
private _fuseMediaWatcherService: FuseMediaWatcherService,
|
private _fuseMediaWatcherService: FuseMediaWatcherService,
|
||||||
private _fuseNavigationService: FuseNavigationService
|
private _fuseNavigationService: FuseNavigationService
|
||||||
)
|
)
|
||||||
@@ -50,10 +52,12 @@ export class CompactLayoutComponent implements OnInit, OnDestroy
|
|||||||
*/
|
*/
|
||||||
ngOnInit(): void
|
ngOnInit(): void
|
||||||
{
|
{
|
||||||
// Subscribe to the resolved route data
|
// Subscribe to navigation data
|
||||||
this._activatedRoute.data.subscribe((data: Data) => {
|
this._navigationService.navigation$
|
||||||
this.data = data.initialData;
|
.pipe(takeUntil(this._unsubscribeAll))
|
||||||
});
|
.subscribe((navigation: Navigation) => {
|
||||||
|
this.navigation = navigation;
|
||||||
|
});
|
||||||
|
|
||||||
// Subscribe to media changes
|
// Subscribe to media changes
|
||||||
this._fuseMediaWatcherService.onMediaChange$
|
this._fuseMediaWatcherService.onMediaChange$
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user