mirror of
https://github.com/richard-loafle/fuse-angular.git
synced 2025-12-22 22:27:07 +00:00
Compare commits
185 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b2ceb02709 | ||
|
|
ffbd000fe2 | ||
|
|
b6ebd2b839 | ||
|
|
4d4d52ba05 | ||
|
|
251732f221 | ||
|
|
1c34a65034 | ||
|
|
b8803a055f | ||
|
|
6b8cd41d5e | ||
|
|
2c7ef4de00 | ||
|
|
fdb572fadd | ||
|
|
528c3f95e7 | ||
|
|
f395046945 | ||
|
|
b099022f5a | ||
|
|
25a6ca2684 | ||
|
|
0cd5d613e0 | ||
|
|
f45ad11861 | ||
|
|
3cbe302b54 | ||
|
|
e1c906f08b | ||
|
|
585709cf93 | ||
|
|
ac70ecc616 | ||
|
|
d5b64f3258 | ||
|
|
59d838ef51 | ||
|
|
8b14366763 | ||
|
|
23b86a7e3d | ||
|
|
2f497f1c7b | ||
|
|
18009c9275 | ||
|
|
20d5a68bf3 | ||
|
|
59d53ba0b9 | ||
|
|
a6c91dd744 | ||
|
|
5045482ef5 | ||
|
|
c7d9a7808a | ||
|
|
e4c0340cd7 | ||
|
|
67cb05be6b | ||
|
|
634ff42f1a | ||
|
|
0149beb33c | ||
|
|
42d9748b10 | ||
|
|
8355e8a17c | ||
|
|
dbb925334a | ||
|
|
49c8e32dce | ||
|
|
595b16275b | ||
|
|
fb003bc96f | ||
|
|
d781e59928 | ||
|
|
89f71735a8 | ||
|
|
51d7c6fd6f | ||
|
|
e182f19644 | ||
|
|
a1aed2998d | ||
|
|
7ff1d2aed0 | ||
|
|
09d1b1034e | ||
|
|
4e98ab1682 | ||
|
|
984004d07a | ||
|
|
64e0451dc6 | ||
|
|
224bbf479a | ||
|
|
1aa79c257b | ||
|
|
4d93b6acef | ||
|
|
ae29f1f03d | ||
|
|
f35c1add1c | ||
|
|
388b724e90 | ||
|
|
023bfea4df | ||
|
|
fd4da1e060 | ||
|
|
85226e6094 | ||
|
|
26a7cc41de | ||
|
|
3deba51322 | ||
|
|
1835c060d6 | ||
|
|
f75d458abe | ||
|
|
6320e98938 | ||
|
|
94d20f8d8d | ||
|
|
ba2f50bf62 | ||
|
|
13746c2a73 | ||
|
|
faef6ec6f8 | ||
|
|
b46b253c1c | ||
|
|
3abd764715 | ||
|
|
1acfe2dfb3 | ||
|
|
6d3cfe8ace | ||
|
|
147525d16a | ||
|
|
29f8ddda9e | ||
|
|
1f77e201a1 | ||
|
|
75b7e4e270 | ||
|
|
9efab7ed20 | ||
|
|
65523c3c95 | ||
|
|
22b3a3c799 | ||
|
|
2b4bd45ad6 | ||
|
|
1e47c79f15 | ||
|
|
58ab766edf | ||
|
|
8db1206c91 | ||
|
|
562ae61098 | ||
|
|
e43ae86a58 | ||
|
|
5459579d04 | ||
|
|
95759be710 | ||
|
|
edb4683dcb | ||
|
|
58dd3b93c3 | ||
|
|
91e8d88488 | ||
|
|
ddcf1d5483 | ||
|
|
0b5727ff15 | ||
|
|
20f80e3fe4 | ||
|
|
5bf9fd177b | ||
|
|
507fe97e84 | ||
|
|
a6a7442607 | ||
|
|
43189728e5 | ||
|
|
9c88524185 | ||
|
|
52cfeec2e7 | ||
|
|
ffb134f1ec | ||
|
|
8520ca77be | ||
|
|
a174c00072 | ||
|
|
42ab15d9e1 | ||
|
|
a87e68251e | ||
|
|
436bd0aa91 | ||
|
|
d5f1fcfefa | ||
|
|
234dec3d6a | ||
|
|
928be05725 | ||
|
|
bcf5a9e6cb | ||
|
|
e79bfb7bce | ||
|
|
86815b7737 | ||
|
|
73a81699ec | ||
|
|
c2970e34ba | ||
|
|
7d6a92fada | ||
|
|
acbed8e305 | ||
|
|
b46f81b6ac | ||
|
|
a284063d22 | ||
|
|
1c8cc35693 | ||
|
|
6cc7d03430 | ||
|
|
f8f97f8ad4 | ||
|
|
bd79830cb4 | ||
|
|
5ed04c3925 | ||
|
|
90fe94a417 | ||
|
|
a39021188e | ||
|
|
ba35ebae94 | ||
|
|
97f864bb76 | ||
|
|
ea15a8b832 | ||
|
|
5c1f2ad1e3 | ||
|
|
420d8d1a1b | ||
|
|
f693298f3a | ||
|
|
a29c4b01ad | ||
|
|
1b94d8d14e | ||
|
|
232b4de752 | ||
|
|
b918fa4122 | ||
|
|
83c395b866 | ||
|
|
387077882b | ||
|
|
70d895c6ed | ||
|
|
0ac4e6c220 | ||
|
|
850e43c653 | ||
|
|
1e6bd8139c | ||
|
|
c6969cf9df | ||
|
|
745c51878d | ||
|
|
9635165316 | ||
|
|
02f305be1f | ||
|
|
27197a55dc | ||
|
|
5d000a849d | ||
|
|
07341c5ffa | ||
|
|
742da904da | ||
|
|
880529ad62 | ||
|
|
126ba35d3d | ||
|
|
0039f44936 | ||
|
|
ced0853af8 | ||
|
|
3d483b5a4b | ||
|
|
96813406a2 | ||
|
|
7fa892d7cc | ||
|
|
832a08208a | ||
|
|
7580176042 | ||
|
|
725719317a | ||
|
|
5ce276de8e | ||
|
|
d330b42dec | ||
|
|
6bf2fe0b17 | ||
|
|
a2187e0134 | ||
|
|
a1cf7dba91 | ||
|
|
b8039899db | ||
|
|
26e55d7f3d | ||
|
|
1a9229a3ae | ||
|
|
ebf865e2c7 | ||
|
|
5fd146b8da | ||
|
|
3401a67959 | ||
|
|
10dad46d7c | ||
|
|
1c4983c756 | ||
|
|
f4636d9a37 | ||
|
|
02df48ab4e | ||
|
|
831d48f5a3 | ||
|
|
ca42f71b0e | ||
|
|
ed4a3cb8d7 | ||
|
|
5c66d95951 | ||
|
|
44663342f4 | ||
|
|
4e6207fef5 | ||
|
|
bd67b660c8 | ||
|
|
174789930d | ||
|
|
7af9c57977 | ||
|
|
874ef26f0b | ||
|
|
329fbb5a38 |
@@ -1,74 +0,0 @@
|
|||||||
{
|
|
||||||
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
|
|
||||||
"project": {
|
|
||||||
"name": "fuse"
|
|
||||||
},
|
|
||||||
"apps": [
|
|
||||||
{
|
|
||||||
"root": "src",
|
|
||||||
"outDir": "dist",
|
|
||||||
"assets": [
|
|
||||||
"assets",
|
|
||||||
"app/main/content/components/angular-material",
|
|
||||||
"favicon.ico"
|
|
||||||
],
|
|
||||||
"index": "index.html",
|
|
||||||
"main": "main.ts",
|
|
||||||
"polyfills": "polyfills.ts",
|
|
||||||
"test": "test.ts",
|
|
||||||
"tsconfig": "tsconfig.app.json",
|
|
||||||
"testTsconfig": "tsconfig.spec.json",
|
|
||||||
"prefix": "app",
|
|
||||||
"styles": [
|
|
||||||
"styles.scss"
|
|
||||||
],
|
|
||||||
"scripts": [],
|
|
||||||
"environmentSource": "environments/environment.ts",
|
|
||||||
"environments": {
|
|
||||||
"dev": "environments/environment.ts",
|
|
||||||
"hmr": "environments/environment.hmr.ts",
|
|
||||||
"prod": "environments/environment.prod.ts"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"e2e": {
|
|
||||||
"protractor": {
|
|
||||||
"config": "./protractor.conf.js"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"lint": [
|
|
||||||
{
|
|
||||||
"project": "src/tsconfig.app.json",
|
|
||||||
"exclude": [
|
|
||||||
"**/node_modules/**",
|
|
||||||
"**/src/app/fuse-fake-db/**/*",
|
|
||||||
"**/src/assets/angular-material-examples/**/*"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"project": "src/tsconfig.spec.json",
|
|
||||||
"exclude": [
|
|
||||||
"**/node_modules/**",
|
|
||||||
"**/src/app/fuse-fake-db/**/*",
|
|
||||||
"**/src/assets/angular-material-examples/**/*"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"project": "e2e/tsconfig.e2e.json",
|
|
||||||
"exclude": [
|
|
||||||
"**/node_modules/**",
|
|
||||||
"**/src/app/fuse-fake-db/**/*",
|
|
||||||
"**/src/assets/angular-material-examples/**/*"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"test": {
|
|
||||||
"karma": {
|
|
||||||
"config": "./karma.conf.js"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"defaults": {
|
|
||||||
"styleExt": "scss",
|
|
||||||
"component": {}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,12 +1,6 @@
|
|||||||
root = true
|
|
||||||
|
|
||||||
[*]
|
[*]
|
||||||
charset = utf-8
|
charset=utf-8
|
||||||
indent_style = space
|
end_of_line=lf
|
||||||
indent_size = 2
|
insert_final_newline=false
|
||||||
insert_final_newline = true
|
indent_style=space
|
||||||
trim_trailing_whitespace = true
|
indent_size=4
|
||||||
|
|
||||||
[*.md]
|
|
||||||
max_line_length = off
|
|
||||||
trim_trailing_whitespace = false
|
|
||||||
|
|||||||
5
.gitignore
vendored
5
.gitignore
vendored
@@ -30,13 +30,10 @@
|
|||||||
/coverage
|
/coverage
|
||||||
/libpeerconnection.log
|
/libpeerconnection.log
|
||||||
npm-debug.log
|
npm-debug.log
|
||||||
|
yarn-error.log
|
||||||
testem.log
|
testem.log
|
||||||
/typings
|
/typings
|
||||||
|
|
||||||
# e2e
|
|
||||||
/e2e/*.js
|
|
||||||
/e2e/*.map
|
|
||||||
|
|
||||||
# System Files
|
# System Files
|
||||||
.DS_Store
|
.DS_Store
|
||||||
Thumbs.db
|
Thumbs.db
|
||||||
|
|||||||
14
README.md
14
README.md
@@ -1,6 +1,6 @@
|
|||||||
# Fuse2
|
# Fuse - Angular
|
||||||
|
|
||||||
Material Design Admin Template with Angular 5+ and Angular Material 2
|
Material Design Admin Template with Angular 6+ and Angular Material
|
||||||
|
|
||||||
## The Community
|
## The Community
|
||||||
|
|
||||||
@@ -14,11 +14,11 @@ Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app w
|
|||||||
|
|
||||||
## Code scaffolding
|
## Code scaffolding
|
||||||
|
|
||||||
Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|module`.
|
Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.
|
||||||
|
|
||||||
## 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. Use the `--prod` flag for a production build.
|
||||||
|
|
||||||
## Running unit tests
|
## Running unit tests
|
||||||
|
|
||||||
@@ -27,4 +27,8 @@ 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 [Protractor](http://www.protractortest.org/).
|
Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).
|
||||||
Before running the tests make sure you are serving the app via `ng serve`.
|
|
||||||
|
## Further help
|
||||||
|
|
||||||
|
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).
|
||||||
|
|
||||||
|
|||||||
150
angular.json
Normal file
150
angular.json
Normal file
@@ -0,0 +1,150 @@
|
|||||||
|
{
|
||||||
|
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
|
||||||
|
"version": 1,
|
||||||
|
"newProjectRoot": "projects",
|
||||||
|
"projects": {
|
||||||
|
"fuse": {
|
||||||
|
"root": "",
|
||||||
|
"sourceRoot": "src",
|
||||||
|
"projectType": "application",
|
||||||
|
"prefix": "app",
|
||||||
|
"schematics": {
|
||||||
|
"@schematics/angular:component": {
|
||||||
|
"styleext": "scss"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"architect": {
|
||||||
|
"build": {
|
||||||
|
"builder": "@angular-devkit/build-angular:browser",
|
||||||
|
"options": {
|
||||||
|
"outputPath": "dist",
|
||||||
|
"index": "src/index.html",
|
||||||
|
"main": "src/main.ts",
|
||||||
|
"polyfills": "src/polyfills.ts",
|
||||||
|
"tsConfig": "src/tsconfig.app.json",
|
||||||
|
"assets": [
|
||||||
|
"src/favicon.ico",
|
||||||
|
"src/assets",
|
||||||
|
"src/app/main/angular-material-elements"
|
||||||
|
],
|
||||||
|
"styles": [
|
||||||
|
"src/styles.scss"
|
||||||
|
],
|
||||||
|
"scripts": []
|
||||||
|
},
|
||||||
|
"configurations": {
|
||||||
|
"production": {
|
||||||
|
"fileReplacements": [
|
||||||
|
{
|
||||||
|
"replace": "src/environments/environment.ts",
|
||||||
|
"with": "src/environments/environment.prod.ts"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"optimization": true,
|
||||||
|
"outputHashing": "all",
|
||||||
|
"sourceMap": false,
|
||||||
|
"extractCss": true,
|
||||||
|
"namedChunks": false,
|
||||||
|
"aot": true,
|
||||||
|
"extractLicenses": true,
|
||||||
|
"vendorChunk": false,
|
||||||
|
"buildOptimizer": true
|
||||||
|
},
|
||||||
|
"ec": {
|
||||||
|
"sourceMap": true,
|
||||||
|
"extractCss": true
|
||||||
|
},
|
||||||
|
"hmr": {
|
||||||
|
"fileReplacements": [
|
||||||
|
{
|
||||||
|
"replace": "src/environments/environment.ts",
|
||||||
|
"with": "src/environments/environment.hmr.ts"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"serve": {
|
||||||
|
"builder": "@angular-devkit/build-angular:dev-server",
|
||||||
|
"options": {
|
||||||
|
"browserTarget": "fuse:build"
|
||||||
|
},
|
||||||
|
"configurations": {
|
||||||
|
"production": {
|
||||||
|
"browserTarget": "fuse:build:production"
|
||||||
|
},
|
||||||
|
"hmr": {
|
||||||
|
"hmr": true,
|
||||||
|
"browserTarget": "fuse:build:hmr"
|
||||||
|
},
|
||||||
|
"ec": {
|
||||||
|
"browserTarget": "fuse:build:ec"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"extract-i18n": {
|
||||||
|
"builder": "@angular-devkit/build-angular:extract-i18n",
|
||||||
|
"options": {
|
||||||
|
"browserTarget": "fuse:build"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"test": {
|
||||||
|
"builder": "@angular-devkit/build-angular:karma",
|
||||||
|
"options": {
|
||||||
|
"main": "src/test.ts",
|
||||||
|
"polyfills": "src/polyfills.ts",
|
||||||
|
"tsConfig": "src/tsconfig.spec.json",
|
||||||
|
"karmaConfig": "src/karma.conf.js",
|
||||||
|
"styles": [
|
||||||
|
"styles.scss"
|
||||||
|
],
|
||||||
|
"scripts": [],
|
||||||
|
"assets": [
|
||||||
|
"src/favicon.ico",
|
||||||
|
"src/assets"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"lint": {
|
||||||
|
"builder": "@angular-devkit/build-angular:tslint",
|
||||||
|
"options": {
|
||||||
|
"tsConfig": [
|
||||||
|
"src/tsconfig.app.json",
|
||||||
|
"src/tsconfig.spec.json"
|
||||||
|
],
|
||||||
|
"exclude": [
|
||||||
|
"**/node_modules/**",
|
||||||
|
"**/src/app/fake-db/**/*",
|
||||||
|
"**/src/assets/angular-material-examples/**/*"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"fuse-e2e": {
|
||||||
|
"root": "e2e/",
|
||||||
|
"projectType": "application",
|
||||||
|
"architect": {
|
||||||
|
"e2e": {
|
||||||
|
"builder": "@angular-devkit/build-angular:protractor",
|
||||||
|
"options": {
|
||||||
|
"protractorConfig": "e2e/protractor.conf.js",
|
||||||
|
"devServerTarget": "fuse:serve"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"lint": {
|
||||||
|
"builder": "@angular-devkit/build-angular:tslint",
|
||||||
|
"options": {
|
||||||
|
"tsConfig": "e2e/tsconfig.e2e.json",
|
||||||
|
"exclude": [
|
||||||
|
"**/node_modules/**",
|
||||||
|
"**/src/app/fake-db/**/*",
|
||||||
|
"**/src/assets/angular-material-examples/**/*"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"defaultProject": "fuse"
|
||||||
|
}
|
||||||
31
e2e/protractor.conf.js
Normal file
31
e2e/protractor.conf.js
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
// Protractor configuration file, see link for more information
|
||||||
|
// https://github.com/angular/protractor/blob/master/lib/config.ts
|
||||||
|
|
||||||
|
const {SpecReporter} = require('jasmine-spec-reporter');
|
||||||
|
|
||||||
|
exports.config = {
|
||||||
|
allScriptsTimeout: 11000,
|
||||||
|
specs : [
|
||||||
|
'./src/**/*.e2e-spec.ts'
|
||||||
|
],
|
||||||
|
capabilities : {
|
||||||
|
'browserName': 'chrome'
|
||||||
|
},
|
||||||
|
directConnect : true,
|
||||||
|
baseUrl : 'http://localhost:4200/',
|
||||||
|
framework : 'jasmine',
|
||||||
|
jasmineNodeOpts : {
|
||||||
|
showColors : true,
|
||||||
|
defaultTimeoutInterval: 30000,
|
||||||
|
print : function ()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onPrepare()
|
||||||
|
{
|
||||||
|
require('ts-node').register({
|
||||||
|
project: require('path').join(__dirname, './tsconfig.e2e.json')
|
||||||
|
});
|
||||||
|
jasmine.getEnv().addReporter(new SpecReporter({spec: {displayStacktrace: true}}));
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -9,6 +9,6 @@ describe('Fuse2 App', () => {
|
|||||||
|
|
||||||
it('should display welcome message', () => {
|
it('should display welcome message', () => {
|
||||||
page.navigateTo();
|
page.navigateTo();
|
||||||
expect(page.getParagraphText()).toEqual('Welcome to app!');
|
expect(page.getParagraphText()).toEqual('Welcome to Fuse2!');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -1,8 +1,7 @@
|
|||||||
{
|
{
|
||||||
"extends": "../tsconfig.json",
|
"extends": "../tsconfig.json",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"outDir": "../out-tsc/e2e",
|
"outDir": "../out-tsc/app",
|
||||||
"baseUrl": "./",
|
|
||||||
"module": "commonjs",
|
"module": "commonjs",
|
||||||
"target": "es5",
|
"target": "es5",
|
||||||
"types": [
|
"types": [
|
||||||
@@ -11,4 +10,4 @@
|
|||||||
"node"
|
"node"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,33 +0,0 @@
|
|||||||
// Karma configuration file, see link for more information
|
|
||||||
// https://karma-runner.github.io/1.0/config/configuration-file.html
|
|
||||||
|
|
||||||
module.exports = function (config) {
|
|
||||||
config.set({
|
|
||||||
basePath: '',
|
|
||||||
frameworks: ['jasmine', '@angular/cli'],
|
|
||||||
plugins: [
|
|
||||||
require('karma-jasmine'),
|
|
||||||
require('karma-chrome-launcher'),
|
|
||||||
require('karma-jasmine-html-reporter'),
|
|
||||||
require('karma-coverage-istanbul-reporter'),
|
|
||||||
require('@angular/cli/plugins/karma')
|
|
||||||
],
|
|
||||||
client:{
|
|
||||||
clearContext: false // leave Jasmine Spec Runner output visible in browser
|
|
||||||
},
|
|
||||||
coverageIstanbulReporter: {
|
|
||||||
reports: [ 'html', 'lcovonly' ],
|
|
||||||
fixWebpackSourcePaths: true
|
|
||||||
},
|
|
||||||
angularCli: {
|
|
||||||
environment: 'dev'
|
|
||||||
},
|
|
||||||
reporters: ['progress', 'kjhtml'],
|
|
||||||
port: 9876,
|
|
||||||
colors: true,
|
|
||||||
logLevel: config.LOG_INFO,
|
|
||||||
autoWatch: true,
|
|
||||||
browsers: ['Chrome'],
|
|
||||||
singleRun: false
|
|
||||||
});
|
|
||||||
};
|
|
||||||
15637
package-lock.json
generated
15637
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
103
package.json
103
package.json
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "fuse",
|
"name": "fuse",
|
||||||
"version": "5.2.9",
|
"version": "6.2.3",
|
||||||
"license": "https://themeforest.net/licenses/terms/regular",
|
"license": "https://themeforest.net/licenses/terms/regular",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"ng": "ng",
|
"ng": "ng",
|
||||||
"start": "ng serve --open",
|
"start": "ng serve --open",
|
||||||
"start-hmr": "ng serve --hmr -e=hmr -sm=false",
|
"start-hmr": "ng serve --configuration hmr --source-map=false --hmr-warning=false",
|
||||||
"start-hmr-sourcemaps": "ng serve --hmr -e=hmr",
|
"start-hmr-sourcemaps": "ng serve --configuration hmr --source-map=true --hmr-warning=false",
|
||||||
"build": "node --max_old_space_size=6144 ./node_modules/@angular/cli/bin/ng build --dev",
|
"build": "node --max_old_space_size=6144 ./node_modules/@angular/cli/bin/ng build --dev",
|
||||||
"build-stats": "node --max_old_space_size=6144 ./node_modules/@angular/cli/bin/ng build --dev --stats-json",
|
"build-stats": "node --max_old_space_size=6144 ./node_modules/@angular/cli/bin/ng build --dev --stats-json",
|
||||||
"build-prod": "node --max_old_space_size=6144 ./node_modules/@angular/cli/bin/ng build --prod",
|
"build-prod": "node --max_old_space_size=6144 ./node_modules/@angular/cli/bin/ng build --prod",
|
||||||
@@ -18,68 +18,71 @@
|
|||||||
},
|
},
|
||||||
"private": true,
|
"private": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@agm/core": "1.0.0-beta.2",
|
"@agm/core": "1.0.0-beta.3",
|
||||||
"@angular/animations": "5.2.8",
|
"@angular/animations": "6.0.7",
|
||||||
"@angular/cdk": "5.2.4",
|
"@angular/cdk": "6.3.3",
|
||||||
"@angular/common": "5.2.8",
|
"@angular/common": "6.0.7",
|
||||||
"@angular/compiler": "5.2.8",
|
"@angular/compiler": "6.0.7",
|
||||||
"@angular/core": "5.2.8",
|
"@angular/core": "6.0.7",
|
||||||
"@angular/flex-layout": "5.0.0-beta.13",
|
"@angular/flex-layout": "6.0.0-beta.16",
|
||||||
"@angular/forms": "5.2.8",
|
"@angular/forms": "6.0.7",
|
||||||
"@angular/http": "5.2.8",
|
"@angular/http": "6.0.7",
|
||||||
"@angular/material": "5.2.4",
|
"@angular/material": "6.3.3",
|
||||||
"@angular/material-moment-adapter": "5.2.4",
|
"@angular/material-moment-adapter": "6.3.3",
|
||||||
"@angular/platform-browser": "5.2.8",
|
"@angular/platform-browser": "6.0.7",
|
||||||
"@angular/platform-browser-dynamic": "5.2.8",
|
"@angular/platform-browser-dynamic": "6.0.7",
|
||||||
"@angular/router": "5.2.8",
|
"@angular/router": "6.0.7",
|
||||||
"@ngrx/effects": "5.2.0",
|
"@ngrx/effects": "6.0.1",
|
||||||
"@ngrx/router-store": "5.2.0",
|
"@ngrx/router-store": "6.0.1",
|
||||||
"@ngrx/store": "5.2.0",
|
"@ngrx/store": "6.0.1",
|
||||||
"@ngrx/store-devtools": "5.2.0",
|
"@ngrx/store-devtools": "6.0.1",
|
||||||
"@ngx-translate/core": "9.1.1",
|
"@ngx-translate/core": "10.0.2",
|
||||||
"@swimlane/ngx-charts": "7.1.1",
|
"@swimlane/ngx-charts": "8.1.0",
|
||||||
"@swimlane/ngx-datatable": "11.2.0",
|
"@swimlane/ngx-datatable": "13.0.1",
|
||||||
"@swimlane/ngx-dnd": "3.1.0",
|
"@swimlane/ngx-dnd": "4.0.0",
|
||||||
"@types/prismjs": "1.9.0",
|
"@types/prismjs": "1.9.0",
|
||||||
"angular-calendar": "0.23.6",
|
"angular-calendar": "0.25.2",
|
||||||
"angular-in-memory-web-api": "0.5.3",
|
"angular-in-memory-web-api": "0.6.0",
|
||||||
"chart.js": "2.7.2",
|
"chart.js": "2.7.2",
|
||||||
"classlist.js": "1.1.20150312",
|
"classlist.js": "1.1.20150312",
|
||||||
"core-js": "2.5.3",
|
"core-js": "2.5.7",
|
||||||
"d3": "4.13.0",
|
"d3": "5.5.0",
|
||||||
"hammerjs": "2.0.8",
|
"hammerjs": "2.0.8",
|
||||||
"intl": "1.2.5",
|
"lodash": "4.17.10",
|
||||||
"moment": "2.21.0",
|
"moment": "2.22.2",
|
||||||
"ng2-charts": "1.6.0",
|
"ng2-charts": "1.6.0",
|
||||||
"ngrx-store-freeze": "0.2.1",
|
"ngrx-store-freeze": "0.2.4",
|
||||||
"ngx-color-picker": "5.3.4",
|
"ngx-color-picker": "6.4.0",
|
||||||
"ngx-cookie-service": "1.0.10",
|
"ngx-cookie-service": "1.0.10",
|
||||||
"perfect-scrollbar": "1.3.0",
|
"perfect-scrollbar": "1.4.0",
|
||||||
"prismjs": "1.11.0",
|
"prismjs": "1.15.0",
|
||||||
"rxjs": "5.5.6",
|
"rxjs": "6.2.1",
|
||||||
|
"rxjs-compat": "6.2.1",
|
||||||
"web-animations-js": "2.3.1",
|
"web-animations-js": "2.3.1",
|
||||||
"zone.js": "0.8.20"
|
"zone.js": "0.8.26"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@angular/cli": "1.7.3",
|
"@angular/cli": "6.0.8",
|
||||||
"@angular/compiler-cli": "5.2.8",
|
"@angular/compiler-cli": "6.0.7",
|
||||||
"@angular/language-service": "5.2.8",
|
"@angular/language-service": "6.0.7",
|
||||||
|
"@angular-devkit/build-angular": "0.6.8",
|
||||||
"@angularclass/hmr": "2.1.3",
|
"@angularclass/hmr": "2.1.3",
|
||||||
"@types/jasmine": "2.8.6",
|
"@types/jasmine": "2.8.8",
|
||||||
"@types/jasminewd2": "2.0.3",
|
"@types/jasminewd2": "2.0.3",
|
||||||
"@types/node": "6.0.101",
|
"@types/lodash": "4.14.110",
|
||||||
|
"@types/node": "8.9.5",
|
||||||
"codelyzer": "4.2.1",
|
"codelyzer": "4.2.1",
|
||||||
"jasmine-core": "2.8.0",
|
"jasmine-core": "2.99.1",
|
||||||
"jasmine-spec-reporter": "4.2.1",
|
"jasmine-spec-reporter": "4.2.1",
|
||||||
"karma": "2.0.0",
|
"karma": "1.7.1",
|
||||||
"karma-chrome-launcher": "2.2.0",
|
"karma-chrome-launcher": "2.2.0",
|
||||||
"karma-coverage-istanbul-reporter": "1.4.2",
|
"karma-coverage-istanbul-reporter": "2.0.1",
|
||||||
"karma-jasmine": "1.1.1",
|
"karma-jasmine": "1.1.2",
|
||||||
"karma-jasmine-html-reporter": "0.2.2",
|
"karma-jasmine-html-reporter": "0.2.2",
|
||||||
"protractor": "5.1.2",
|
"protractor": "5.3.2",
|
||||||
"ts-node": "4.1.0",
|
"ts-node": "5.0.1",
|
||||||
"tslint": "5.9.1",
|
"tslint": "5.9.1",
|
||||||
"typescript": "2.6.2",
|
"typescript": "2.7.2",
|
||||||
"webpack-bundle-analyzer": "2.11.1"
|
"webpack-bundle-analyzer": "2.13.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,28 +0,0 @@
|
|||||||
// Protractor configuration file, see link for more information
|
|
||||||
// https://github.com/angular/protractor/blob/master/lib/config.ts
|
|
||||||
|
|
||||||
const { SpecReporter } = require('jasmine-spec-reporter');
|
|
||||||
|
|
||||||
exports.config = {
|
|
||||||
allScriptsTimeout: 11000,
|
|
||||||
specs: [
|
|
||||||
'./e2e/**/*.e2e-spec.ts'
|
|
||||||
],
|
|
||||||
capabilities: {
|
|
||||||
'browserName': 'chrome'
|
|
||||||
},
|
|
||||||
directConnect: true,
|
|
||||||
baseUrl: 'http://localhost:4200/',
|
|
||||||
framework: 'jasmine',
|
|
||||||
jasmineNodeOpts: {
|
|
||||||
showColors: true,
|
|
||||||
defaultTimeoutInterval: 30000,
|
|
||||||
print: function() {}
|
|
||||||
},
|
|
||||||
onPrepare() {
|
|
||||||
require('ts-node').register({
|
|
||||||
project: 'e2e/tsconfig.e2e.json'
|
|
||||||
});
|
|
||||||
jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }));
|
|
||||||
}
|
|
||||||
};
|
|
||||||
@@ -187,10 +187,14 @@ export const fuseAnimations = [
|
|||||||
transition('* => void', animate('300ms ease-in'))
|
transition('* => void', animate('300ms ease-in'))
|
||||||
]),
|
]),
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------------------------------
|
||||||
|
// @ Router animations
|
||||||
|
// -----------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
trigger('routerTransitionLeft', [
|
trigger('routerTransitionLeft', [
|
||||||
|
|
||||||
transition('* => *', [
|
transition('* => *', [
|
||||||
query('fuse-content > :enter, fuse-content > :leave', [
|
query('content > :enter, content > :leave', [
|
||||||
style({
|
style({
|
||||||
position: 'absolute',
|
position: 'absolute',
|
||||||
top : 0,
|
top : 0,
|
||||||
@@ -199,7 +203,7 @@ export const fuseAnimations = [
|
|||||||
right : 0
|
right : 0
|
||||||
})
|
})
|
||||||
], {optional: true}),
|
], {optional: true}),
|
||||||
query('fuse-content > :enter', [
|
query('content > :enter', [
|
||||||
style({
|
style({
|
||||||
transform: 'translateX(100%)',
|
transform: 'translateX(100%)',
|
||||||
opacity : 0
|
opacity : 0
|
||||||
@@ -207,7 +211,7 @@ export const fuseAnimations = [
|
|||||||
], {optional: true}),
|
], {optional: true}),
|
||||||
sequence([
|
sequence([
|
||||||
group([
|
group([
|
||||||
query('fuse-content > :leave', [
|
query('content > :leave', [
|
||||||
style({
|
style({
|
||||||
transform: 'translateX(0)',
|
transform: 'translateX(0)',
|
||||||
opacity : 1
|
opacity : 1
|
||||||
@@ -218,7 +222,7 @@ export const fuseAnimations = [
|
|||||||
opacity : 0
|
opacity : 0
|
||||||
}))
|
}))
|
||||||
], {optional: true}),
|
], {optional: true}),
|
||||||
query('fuse-content > :enter', [
|
query('content > :enter', [
|
||||||
style({transform: 'translateX(100%)'}),
|
style({transform: 'translateX(100%)'}),
|
||||||
animate('600ms cubic-bezier(0.0, 0.0, 0.2, 1)',
|
animate('600ms cubic-bezier(0.0, 0.0, 0.2, 1)',
|
||||||
style({
|
style({
|
||||||
@@ -227,8 +231,8 @@ export const fuseAnimations = [
|
|||||||
}))
|
}))
|
||||||
], {optional: true})
|
], {optional: true})
|
||||||
]),
|
]),
|
||||||
query('fuse-content > :leave', animateChild(), {optional: true}),
|
query('content > :leave', animateChild(), {optional: true}),
|
||||||
query('fuse-content > :enter', animateChild(), {optional: true})
|
query('content > :enter', animateChild(), {optional: true})
|
||||||
])
|
])
|
||||||
])
|
])
|
||||||
]),
|
]),
|
||||||
@@ -236,7 +240,7 @@ export const fuseAnimations = [
|
|||||||
trigger('routerTransitionRight', [
|
trigger('routerTransitionRight', [
|
||||||
|
|
||||||
transition('* => *', [
|
transition('* => *', [
|
||||||
query('fuse-content > :enter, fuse-content > :leave', [
|
query('content > :enter, content > :leave', [
|
||||||
style({
|
style({
|
||||||
position: 'absolute',
|
position: 'absolute',
|
||||||
top : 0,
|
top : 0,
|
||||||
@@ -245,7 +249,7 @@ export const fuseAnimations = [
|
|||||||
right : 0
|
right : 0
|
||||||
})
|
})
|
||||||
], {optional: true}),
|
], {optional: true}),
|
||||||
query('fuse-content > :enter', [
|
query('content > :enter', [
|
||||||
style({
|
style({
|
||||||
transform: 'translateX(-100%)',
|
transform: 'translateX(-100%)',
|
||||||
opacity : 0
|
opacity : 0
|
||||||
@@ -253,7 +257,7 @@ export const fuseAnimations = [
|
|||||||
], {optional: true}),
|
], {optional: true}),
|
||||||
sequence([
|
sequence([
|
||||||
group([
|
group([
|
||||||
query('fuse-content > :leave', [
|
query('content > :leave', [
|
||||||
style({
|
style({
|
||||||
transform: 'translateX(0)',
|
transform: 'translateX(0)',
|
||||||
opacity : 1
|
opacity : 1
|
||||||
@@ -264,7 +268,7 @@ export const fuseAnimations = [
|
|||||||
opacity : 0
|
opacity : 0
|
||||||
}))
|
}))
|
||||||
], {optional: true}),
|
], {optional: true}),
|
||||||
query('fuse-content > :enter', [
|
query('content > :enter', [
|
||||||
style({transform: 'translateX(-100%)'}),
|
style({transform: 'translateX(-100%)'}),
|
||||||
animate('600ms cubic-bezier(0.0, 0.0, 0.2, 1)',
|
animate('600ms cubic-bezier(0.0, 0.0, 0.2, 1)',
|
||||||
style({
|
style({
|
||||||
@@ -273,8 +277,8 @@ export const fuseAnimations = [
|
|||||||
}))
|
}))
|
||||||
], {optional: true})
|
], {optional: true})
|
||||||
]),
|
]),
|
||||||
query('fuse-content > :leave', animateChild(), {optional: true}),
|
query('content > :leave', animateChild(), {optional: true}),
|
||||||
query('fuse-content > :enter', animateChild(), {optional: true})
|
query('content > :enter', animateChild(), {optional: true})
|
||||||
])
|
])
|
||||||
])
|
])
|
||||||
]),
|
]),
|
||||||
@@ -282,7 +286,7 @@ export const fuseAnimations = [
|
|||||||
trigger('routerTransitionUp', [
|
trigger('routerTransitionUp', [
|
||||||
|
|
||||||
transition('* => *', [
|
transition('* => *', [
|
||||||
query('fuse-content > :enter, fuse-content > :leave', [
|
query('content > :enter, content > :leave', [
|
||||||
style({
|
style({
|
||||||
position: 'absolute',
|
position: 'absolute',
|
||||||
top : 0,
|
top : 0,
|
||||||
@@ -291,14 +295,14 @@ export const fuseAnimations = [
|
|||||||
right : 0
|
right : 0
|
||||||
})
|
})
|
||||||
], {optional: true}),
|
], {optional: true}),
|
||||||
query('fuse-content > :enter', [
|
query('content > :enter', [
|
||||||
style({
|
style({
|
||||||
transform: 'translateY(100%)',
|
transform: 'translateY(100%)',
|
||||||
opacity : 0
|
opacity : 0
|
||||||
})
|
})
|
||||||
], {optional: true}),
|
], {optional: true}),
|
||||||
group([
|
group([
|
||||||
query('fuse-content > :leave', [
|
query('content > :leave', [
|
||||||
style({
|
style({
|
||||||
transform: 'translateY(0)',
|
transform: 'translateY(0)',
|
||||||
opacity : 1
|
opacity : 1
|
||||||
@@ -309,7 +313,7 @@ export const fuseAnimations = [
|
|||||||
opacity : 0
|
opacity : 0
|
||||||
}))
|
}))
|
||||||
], {optional: true}),
|
], {optional: true}),
|
||||||
query('fuse-content > :enter', [
|
query('content > :enter', [
|
||||||
style({transform: 'translateY(100%)'}),
|
style({transform: 'translateY(100%)'}),
|
||||||
animate('600ms cubic-bezier(0.0, 0.0, 0.2, 1)',
|
animate('600ms cubic-bezier(0.0, 0.0, 0.2, 1)',
|
||||||
style({
|
style({
|
||||||
@@ -318,15 +322,15 @@ export const fuseAnimations = [
|
|||||||
}))
|
}))
|
||||||
], {optional: true})
|
], {optional: true})
|
||||||
]),
|
]),
|
||||||
query('fuse-content > :leave', animateChild(), {optional: true}),
|
query('content > :leave', animateChild(), {optional: true}),
|
||||||
query('fuse-content > :enter', animateChild(), {optional: true})
|
query('content > :enter', animateChild(), {optional: true})
|
||||||
])
|
])
|
||||||
]),
|
]),
|
||||||
|
|
||||||
trigger('routerTransitionDown', [
|
trigger('routerTransitionDown', [
|
||||||
|
|
||||||
transition('* => *', [
|
transition('* => *', [
|
||||||
query('fuse-content > :enter, fuse-content > :leave', [
|
query('content > :enter, content > :leave', [
|
||||||
style({
|
style({
|
||||||
position: 'absolute',
|
position: 'absolute',
|
||||||
top : 0,
|
top : 0,
|
||||||
@@ -335,7 +339,7 @@ export const fuseAnimations = [
|
|||||||
right : 0
|
right : 0
|
||||||
})
|
})
|
||||||
], {optional: true}),
|
], {optional: true}),
|
||||||
query('fuse-content > :enter', [
|
query('content > :enter', [
|
||||||
style({
|
style({
|
||||||
transform: 'translateY(-100%)',
|
transform: 'translateY(-100%)',
|
||||||
opacity : 0
|
opacity : 0
|
||||||
@@ -343,7 +347,7 @@ export const fuseAnimations = [
|
|||||||
], {optional: true}),
|
], {optional: true}),
|
||||||
sequence([
|
sequence([
|
||||||
group([
|
group([
|
||||||
query('fuse-content > :leave', [
|
query('content > :leave', [
|
||||||
style({
|
style({
|
||||||
transform: 'translateY(0)',
|
transform: 'translateY(0)',
|
||||||
opacity : 1
|
opacity : 1
|
||||||
@@ -354,7 +358,7 @@ export const fuseAnimations = [
|
|||||||
opacity : 0
|
opacity : 0
|
||||||
}))
|
}))
|
||||||
], {optional: true}),
|
], {optional: true}),
|
||||||
query('fuse-content > :enter', [
|
query('content > :enter', [
|
||||||
style({transform: 'translateY(-100%)'}),
|
style({transform: 'translateY(-100%)'}),
|
||||||
animate('600ms cubic-bezier(0.0, 0.0, 0.2, 1)',
|
animate('600ms cubic-bezier(0.0, 0.0, 0.2, 1)',
|
||||||
style({
|
style({
|
||||||
@@ -363,8 +367,8 @@ export const fuseAnimations = [
|
|||||||
}))
|
}))
|
||||||
], {optional: true})
|
], {optional: true})
|
||||||
]),
|
]),
|
||||||
query('fuse-content > :leave', animateChild(), {optional: true}),
|
query('content > :leave', animateChild(), {optional: true}),
|
||||||
query('fuse-content > :enter', animateChild(), {optional: true})
|
query('content > :enter', animateChild(), {optional: true})
|
||||||
])
|
])
|
||||||
])
|
])
|
||||||
]),
|
]),
|
||||||
@@ -373,7 +377,7 @@ export const fuseAnimations = [
|
|||||||
|
|
||||||
transition('* => *', group([
|
transition('* => *', group([
|
||||||
|
|
||||||
query('fuse-content > :enter, fuse-content > :leave ', [
|
query('content > :enter, content > :leave ', [
|
||||||
style({
|
style({
|
||||||
position: 'absolute',
|
position: 'absolute',
|
||||||
top : 0,
|
top : 0,
|
||||||
@@ -383,12 +387,12 @@ export const fuseAnimations = [
|
|||||||
})
|
})
|
||||||
], {optional: true}),
|
], {optional: true}),
|
||||||
|
|
||||||
query('fuse-content > :enter', [
|
query('content > :enter', [
|
||||||
style({
|
style({
|
||||||
opacity: 0
|
opacity: 0
|
||||||
})
|
})
|
||||||
], {optional: true}),
|
], {optional: true}),
|
||||||
query('fuse-content > :leave', [
|
query('content > :leave', [
|
||||||
style({
|
style({
|
||||||
opacity: 1
|
opacity: 1
|
||||||
}),
|
}),
|
||||||
@@ -397,7 +401,7 @@ export const fuseAnimations = [
|
|||||||
opacity: 0
|
opacity: 0
|
||||||
}))
|
}))
|
||||||
], {optional: true}),
|
], {optional: true}),
|
||||||
query('fuse-content > :enter', [
|
query('content > :enter', [
|
||||||
style({
|
style({
|
||||||
opacity: 0
|
opacity: 0
|
||||||
}),
|
}),
|
||||||
@@ -406,8 +410,8 @@ export const fuseAnimations = [
|
|||||||
opacity: 1
|
opacity: 1
|
||||||
}))
|
}))
|
||||||
], {optional: true}),
|
], {optional: true}),
|
||||||
query('fuse-content > :enter', animateChild(), {optional: true}),
|
query('content > :enter', animateChild(), {optional: true}),
|
||||||
query('fuse-content > :leave', animateChild(), {optional: true})
|
query('content > :leave', animateChild(), {optional: true})
|
||||||
]))
|
]))
|
||||||
])
|
])
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -10,7 +10,14 @@ export class FuseConfirmDialogComponent
|
|||||||
{
|
{
|
||||||
public confirmMessage: string;
|
public confirmMessage: string;
|
||||||
|
|
||||||
constructor(public dialogRef: MatDialogRef<FuseConfirmDialogComponent>)
|
/**
|
||||||
|
* Constructor
|
||||||
|
*
|
||||||
|
* @param {MatDialogRef<FuseConfirmDialogComponent>} dialogRef
|
||||||
|
*/
|
||||||
|
constructor(
|
||||||
|
public dialogRef: MatDialogRef<FuseConfirmDialogComponent>
|
||||||
|
)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import { Component, Input, OnInit } from '@angular/core';
|
import { Component, Input, OnDestroy, OnInit } from '@angular/core';
|
||||||
import { Observable } from 'rxjs/Observable';
|
import { interval, Subject } from 'rxjs';
|
||||||
import 'rxjs/add/observable/interval';
|
import { map, takeUntil } from 'rxjs/operators';
|
||||||
|
|
||||||
import * as moment from 'moment';
|
import * as moment from 'moment';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
@@ -9,47 +8,82 @@ import * as moment from 'moment';
|
|||||||
templateUrl: './countdown.component.html',
|
templateUrl: './countdown.component.html',
|
||||||
styleUrls : ['./countdown.component.scss']
|
styleUrls : ['./countdown.component.scss']
|
||||||
})
|
})
|
||||||
export class FuseCountdownComponent implements OnInit
|
export class FuseCountdownComponent implements OnInit, OnDestroy
|
||||||
{
|
{
|
||||||
@Input('eventDate') eventDate;
|
// Event date
|
||||||
|
@Input('eventDate')
|
||||||
|
eventDate;
|
||||||
|
|
||||||
countdown: any;
|
countdown: any;
|
||||||
|
|
||||||
|
// Private
|
||||||
|
private _unsubscribeAll: Subject<any>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor
|
||||||
|
*/
|
||||||
constructor()
|
constructor()
|
||||||
{
|
{
|
||||||
|
// Set the defaults
|
||||||
this.countdown = {
|
this.countdown = {
|
||||||
days : '',
|
days : '',
|
||||||
hours : '',
|
hours : '',
|
||||||
minutes: '',
|
minutes: '',
|
||||||
seconds: ''
|
seconds: ''
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Set the private defaults
|
||||||
|
this._unsubscribeAll = new Subject();
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit()
|
// -----------------------------------------------------------------------------------------------------
|
||||||
|
// @ Lifecycle hooks
|
||||||
|
// -----------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
/**
|
||||||
|
* On init
|
||||||
|
*/
|
||||||
|
ngOnInit(): void
|
||||||
{
|
{
|
||||||
const currDate = moment();
|
const currDate = moment();
|
||||||
const eventDate = moment(this.eventDate);
|
const eventDate = moment(this.eventDate);
|
||||||
|
|
||||||
|
// Get the difference in between the current date and event date
|
||||||
let diff = eventDate.diff(currDate, 'seconds');
|
let diff = eventDate.diff(currDate, 'seconds');
|
||||||
|
|
||||||
const countDown =
|
// Create a subscribable interval
|
||||||
Observable
|
const countDown = interval(1000)
|
||||||
.interval(1000)
|
.pipe(
|
||||||
.map(value => {
|
map(value => {
|
||||||
return diff = diff - 1;
|
return diff = diff - 1;
|
||||||
})
|
}),
|
||||||
.map(value => {
|
map(value => {
|
||||||
const timeLeft = moment.duration(value, 'seconds');
|
const timeLeft = moment.duration(value, 'seconds');
|
||||||
|
|
||||||
return {
|
return {
|
||||||
days : timeLeft.asDays().toFixed(0),
|
days : timeLeft.asDays().toFixed(0),
|
||||||
hours : timeLeft.hours(),
|
hours : timeLeft.hours(),
|
||||||
minutes: timeLeft.minutes(),
|
minutes: timeLeft.minutes(),
|
||||||
seconds: timeLeft.seconds()
|
seconds: timeLeft.seconds()
|
||||||
};
|
};
|
||||||
});
|
})
|
||||||
|
);
|
||||||
|
|
||||||
countDown.subscribe(value => {
|
// Subscribe to the countdown interval
|
||||||
this.countdown = value;
|
countDown
|
||||||
});
|
.pipe(takeUntil(this._unsubscribeAll))
|
||||||
|
.subscribe(value => {
|
||||||
|
this.countdown = value;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* On destroy
|
||||||
|
*/
|
||||||
|
ngOnDestroy(): void
|
||||||
|
{
|
||||||
|
// Unsubscribe from all subscriptions
|
||||||
|
this._unsubscribeAll.next();
|
||||||
|
this._unsubscribeAll.complete();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,9 @@ import { Component } from '@angular/core';
|
|||||||
})
|
})
|
||||||
export class FuseDemoContentComponent
|
export class FuseDemoContentComponent
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* Constructor
|
||||||
|
*/
|
||||||
constructor()
|
constructor()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,99 +1,99 @@
|
|||||||
<div class="demo-sidenav">
|
<div class="demo-sidebar">
|
||||||
<mat-list>
|
<mat-list>
|
||||||
<h3 matSubheader>Sidenav Demo</h3>
|
<h3 matSubheader>Sidebar Demo</h3>
|
||||||
|
|
||||||
<mat-list-item>
|
<mat-list-item>
|
||||||
<span>Sidenav Item 1</span>
|
<span>Sidebar Item 1</span>
|
||||||
</mat-list-item>
|
</mat-list-item>
|
||||||
|
|
||||||
<mat-divider></mat-divider>
|
<mat-divider></mat-divider>
|
||||||
|
|
||||||
<mat-list-item>
|
<mat-list-item>
|
||||||
<span>Sidenav Item 2</span>
|
<span>Sidebar Item 2</span>
|
||||||
</mat-list-item>
|
</mat-list-item>
|
||||||
|
|
||||||
<mat-divider></mat-divider>
|
<mat-divider></mat-divider>
|
||||||
|
|
||||||
<mat-list-item>
|
<mat-list-item>
|
||||||
<span>Sidenav Item 3</span>
|
<span>Sidebar Item 3</span>
|
||||||
</mat-list-item>
|
</mat-list-item>
|
||||||
|
|
||||||
<mat-divider></mat-divider>
|
<mat-divider></mat-divider>
|
||||||
|
|
||||||
<mat-list-item>
|
<mat-list-item>
|
||||||
<span>Sidenav Item 4</span>
|
<span>Sidebar Item 4</span>
|
||||||
</mat-list-item>
|
</mat-list-item>
|
||||||
|
|
||||||
<mat-divider></mat-divider>
|
<mat-divider></mat-divider>
|
||||||
|
|
||||||
<mat-list-item>
|
<mat-list-item>
|
||||||
<span>Sidenav Item 5</span>
|
<span>Sidebar Item 5</span>
|
||||||
</mat-list-item>
|
</mat-list-item>
|
||||||
|
|
||||||
<mat-divider></mat-divider>
|
<mat-divider></mat-divider>
|
||||||
|
|
||||||
<mat-list-item>
|
<mat-list-item>
|
||||||
<span>Sidenav Item 6</span>
|
<span>Sidebar Item 6</span>
|
||||||
</mat-list-item>
|
</mat-list-item>
|
||||||
|
|
||||||
<mat-divider></mat-divider>
|
<mat-divider></mat-divider>
|
||||||
|
|
||||||
<mat-list-item>
|
<mat-list-item>
|
||||||
<span>Sidenav Item 7</span>
|
<span>Sidebar Item 7</span>
|
||||||
</mat-list-item>
|
</mat-list-item>
|
||||||
|
|
||||||
<mat-divider></mat-divider>
|
<mat-divider></mat-divider>
|
||||||
|
|
||||||
<mat-list-item>
|
<mat-list-item>
|
||||||
<span>Sidenav Item 8</span>
|
<span>Sidebar Item 8</span>
|
||||||
</mat-list-item>
|
</mat-list-item>
|
||||||
|
|
||||||
<mat-divider></mat-divider>
|
<mat-divider></mat-divider>
|
||||||
|
|
||||||
<mat-list-item>
|
<mat-list-item>
|
||||||
<span>Sidenav Item 9</span>
|
<span>Sidebar Item 9</span>
|
||||||
</mat-list-item>
|
</mat-list-item>
|
||||||
|
|
||||||
<mat-divider></mat-divider>
|
<mat-divider></mat-divider>
|
||||||
|
|
||||||
<mat-list-item>
|
<mat-list-item>
|
||||||
<span>Sidenav Item 10</span>
|
<span>Sidebar Item 10</span>
|
||||||
</mat-list-item>
|
</mat-list-item>
|
||||||
|
|
||||||
<mat-divider></mat-divider>
|
<mat-divider></mat-divider>
|
||||||
|
|
||||||
<mat-list-item>
|
<mat-list-item>
|
||||||
<span>Sidenav Item 11</span>
|
<span>Sidebar Item 11</span>
|
||||||
</mat-list-item>
|
</mat-list-item>
|
||||||
|
|
||||||
<mat-divider></mat-divider>
|
<mat-divider></mat-divider>
|
||||||
|
|
||||||
<mat-list-item>
|
<mat-list-item>
|
||||||
<span>Sidenav Item 12</span>
|
<span>Sidebar Item 12</span>
|
||||||
</mat-list-item>
|
</mat-list-item>
|
||||||
|
|
||||||
<mat-divider></mat-divider>
|
<mat-divider></mat-divider>
|
||||||
|
|
||||||
<mat-list-item>
|
<mat-list-item>
|
||||||
<span>Sidenav Item 13</span>
|
<span>Sidebar Item 13</span>
|
||||||
</mat-list-item>
|
</mat-list-item>
|
||||||
|
|
||||||
<mat-divider></mat-divider>
|
<mat-divider></mat-divider>
|
||||||
|
|
||||||
<mat-list-item>
|
<mat-list-item>
|
||||||
<span>Sidenav Item 14</span>
|
<span>Sidebar Item 14</span>
|
||||||
</mat-list-item>
|
</mat-list-item>
|
||||||
|
|
||||||
<mat-divider></mat-divider>
|
<mat-divider></mat-divider>
|
||||||
|
|
||||||
<mat-list-item>
|
<mat-list-item>
|
||||||
<span>Sidenav Item 15</span>
|
<span>Sidebar Item 15</span>
|
||||||
</mat-list-item>
|
</mat-list-item>
|
||||||
|
|
||||||
<mat-divider></mat-divider>
|
<mat-divider></mat-divider>
|
||||||
|
|
||||||
<mat-list-item>
|
<mat-list-item>
|
||||||
<span>Sidenav Item 16</span>
|
<span>Sidebar Item 16</span>
|
||||||
</mat-list-item>
|
</mat-list-item>
|
||||||
|
|
||||||
</mat-list>
|
</mat-list>
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
import { Component } from '@angular/core';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector : 'fuse-demo-sidebar',
|
||||||
|
templateUrl: './demo-sidebar.component.html',
|
||||||
|
styleUrls : ['./demo-sidebar.component.scss']
|
||||||
|
})
|
||||||
|
export class FuseDemoSidebarComponent
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Constructor
|
||||||
|
*/
|
||||||
|
constructor()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
import { Component } from '@angular/core';
|
|
||||||
|
|
||||||
@Component({
|
|
||||||
selector : 'fuse-demo-sidenav',
|
|
||||||
templateUrl: './demo-sidenav.component.html',
|
|
||||||
styleUrls : ['./demo-sidenav.component.scss']
|
|
||||||
})
|
|
||||||
export class FuseDemoSidenavComponent
|
|
||||||
{
|
|
||||||
constructor()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -4,12 +4,12 @@ import { RouterModule } from '@angular/router';
|
|||||||
import { MatDividerModule, MatListModule } from '@angular/material';
|
import { MatDividerModule, MatListModule } from '@angular/material';
|
||||||
|
|
||||||
import { FuseDemoContentComponent } from './demo-content/demo-content.component';
|
import { FuseDemoContentComponent } from './demo-content/demo-content.component';
|
||||||
import { FuseDemoSidenavComponent } from './demo-sidenav/demo-sidenav.component';
|
import { FuseDemoSidebarComponent } from './demo-sidebar/demo-sidebar.component';
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
declarations: [
|
declarations: [
|
||||||
FuseDemoContentComponent,
|
FuseDemoContentComponent,
|
||||||
FuseDemoSidenavComponent
|
FuseDemoSidebarComponent
|
||||||
],
|
],
|
||||||
imports : [
|
imports : [
|
||||||
RouterModule,
|
RouterModule,
|
||||||
@@ -19,7 +19,7 @@ import { FuseDemoSidenavComponent } from './demo-sidenav/demo-sidenav.component'
|
|||||||
],
|
],
|
||||||
exports : [
|
exports : [
|
||||||
FuseDemoContentComponent,
|
FuseDemoContentComponent,
|
||||||
FuseDemoSidenavComponent
|
FuseDemoSidebarComponent
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
export class FuseDemoModule
|
export class FuseDemoModule
|
||||||
|
|||||||
@@ -3,4 +3,5 @@
|
|||||||
padding: 8px;
|
padding: 8px;
|
||||||
background: #263238;
|
background: #263238;
|
||||||
cursor: text;
|
cursor: text;
|
||||||
|
overflow: auto;
|
||||||
}
|
}
|
||||||
@@ -1,28 +1,55 @@
|
|||||||
import { Component, ContentChild, ElementRef, Input, OnInit } from '@angular/core';
|
import { Component, ContentChild, ElementRef, Input, OnDestroy, OnInit } from '@angular/core';
|
||||||
import { HttpClient } from '@angular/common/http';
|
import { HttpClient } from '@angular/common/http';
|
||||||
|
import { Subject } from 'rxjs';
|
||||||
|
import { takeUntil } from 'rxjs/operators';
|
||||||
import * as Prism from 'prismjs/prism';
|
import * as Prism from 'prismjs/prism';
|
||||||
import './prism-languages';
|
import '@fuse/components/highlight/prism-languages';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector : 'fuse-highlight',
|
selector : 'fuse-highlight',
|
||||||
template : ' ',
|
template : '',
|
||||||
styleUrls: ['./highlight.component.scss']
|
styleUrls: ['./highlight.component.scss']
|
||||||
})
|
})
|
||||||
export class FuseHighlightComponent implements OnInit
|
export class FuseHighlightComponent implements OnInit, OnDestroy
|
||||||
{
|
{
|
||||||
@ContentChild('source') source: ElementRef;
|
// Source
|
||||||
@Input('lang') lang: string;
|
@ContentChild('source')
|
||||||
@Input('path') path: string;
|
source: ElementRef;
|
||||||
|
|
||||||
|
// Lang
|
||||||
|
@Input('lang')
|
||||||
|
lang: string;
|
||||||
|
|
||||||
|
// Path
|
||||||
|
@Input('path')
|
||||||
|
path: string;
|
||||||
|
|
||||||
|
// Private
|
||||||
|
private _unsubscribeAll: Subject<any>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor
|
||||||
|
*
|
||||||
|
* @param {ElementRef} _elementRef
|
||||||
|
* @param {HttpClient} _httpClient
|
||||||
|
*/
|
||||||
constructor(
|
constructor(
|
||||||
private elementRef: ElementRef,
|
private _elementRef: ElementRef,
|
||||||
private http: HttpClient
|
private _httpClient: HttpClient
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
// Set the private defaults
|
||||||
|
this._unsubscribeAll = new Subject();
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit()
|
// -----------------------------------------------------------------------------------------------------
|
||||||
|
// @ Lifecycle hooks
|
||||||
|
// -----------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
/**
|
||||||
|
* On init
|
||||||
|
*/
|
||||||
|
ngOnInit(): void
|
||||||
{
|
{
|
||||||
// If there is no language defined, return...
|
// If there is no language defined, return...
|
||||||
if ( !this.lang )
|
if ( !this.lang )
|
||||||
@@ -34,11 +61,13 @@ export class FuseHighlightComponent implements OnInit
|
|||||||
if ( this.path )
|
if ( this.path )
|
||||||
{
|
{
|
||||||
// Get the source
|
// Get the source
|
||||||
this.http.get(this.path, {responseType: 'text'}).subscribe((response) => {
|
this._httpClient.get(this.path, {responseType: 'text'})
|
||||||
|
.pipe(takeUntil(this._unsubscribeAll))
|
||||||
|
.subscribe((response) => {
|
||||||
|
|
||||||
// Highlight it
|
// Highlight it
|
||||||
this.highlight(response);
|
this.highlight(response);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// If the path is not defined and the source element exists...
|
// If the path is not defined and the source element exists...
|
||||||
@@ -49,7 +78,26 @@ export class FuseHighlightComponent implements OnInit
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
highlight(sourceCode)
|
/**
|
||||||
|
* On destroy
|
||||||
|
*/
|
||||||
|
ngOnDestroy(): void
|
||||||
|
{
|
||||||
|
// Unsubscribe from all subscriptions
|
||||||
|
this._unsubscribeAll.next();
|
||||||
|
this._unsubscribeAll.complete();
|
||||||
|
}
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------------------------------
|
||||||
|
// @ Public methods
|
||||||
|
// -----------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Highlight the given source code
|
||||||
|
*
|
||||||
|
* @param sourceCode
|
||||||
|
*/
|
||||||
|
highlight(sourceCode): void
|
||||||
{
|
{
|
||||||
// Split the source into lines
|
// Split the source into lines
|
||||||
const sourceLines = sourceCode.split('\n');
|
const sourceLines = sourceCode.split('\n');
|
||||||
@@ -94,9 +142,8 @@ export class FuseHighlightComponent implements OnInit
|
|||||||
const highlightedCode = Prism.highlight(source, Prism.languages[this.lang]);
|
const highlightedCode = Prism.highlight(source, Prism.languages[this.lang]);
|
||||||
|
|
||||||
// Replace the innerHTML of the component with the highlighted code
|
// Replace the innerHTML of the component with the highlighted code
|
||||||
this.elementRef.nativeElement.innerHTML =
|
this._elementRef.nativeElement.innerHTML =
|
||||||
'<pre><code class="highlight language-' + this.lang + '">' + highlightedCode + '</code></pre>';
|
'<pre><code class="highlight language-' + this.lang + '">' + highlightedCode + '</code></pre>';
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,12 @@
|
|||||||
import 'prismjs/prism';
|
import 'prismjs/prism';
|
||||||
|
import 'prismjs/components/prism-bash';
|
||||||
import 'prismjs/components/prism-c';
|
import 'prismjs/components/prism-c';
|
||||||
import 'prismjs/components/prism-cpp';
|
import 'prismjs/components/prism-cpp';
|
||||||
import 'prismjs/components/prism-csharp';
|
import 'prismjs/components/prism-csharp';
|
||||||
import 'prismjs/components/prism-css';
|
import 'prismjs/components/prism-css';
|
||||||
import 'prismjs/components/prism-diff';
|
import 'prismjs/components/prism-diff';
|
||||||
import 'prismjs/components/prism-markup';
|
import 'prismjs/components/prism-markup';
|
||||||
|
import 'prismjs/components/prism-markup-templating';
|
||||||
import 'prismjs/components/prism-java';
|
import 'prismjs/components/prism-java';
|
||||||
import 'prismjs/components/prism-javascript';
|
import 'prismjs/components/prism-javascript';
|
||||||
import 'prismjs/components/prism-json';
|
import 'prismjs/components/prism-json';
|
||||||
|
|||||||
@@ -13,22 +13,78 @@ import { MatColors } from '@fuse/mat-colors';
|
|||||||
export class FuseMaterialColorPickerComponent implements OnChanges
|
export class FuseMaterialColorPickerComponent implements OnChanges
|
||||||
{
|
{
|
||||||
colors: any;
|
colors: any;
|
||||||
selectedColor: any;
|
|
||||||
hues: string[];
|
hues: string[];
|
||||||
view = 'palettes';
|
selectedColor: any;
|
||||||
|
view: string;
|
||||||
|
|
||||||
@Input() selectedPalette = '';
|
@Input()
|
||||||
@Input() selectedHue = '';
|
selectedPalette: string;
|
||||||
@Input() selectedFg = '';
|
|
||||||
@Input() value: any;
|
|
||||||
@Output() onValueChange = new EventEmitter();
|
|
||||||
@Output() selectedPaletteChange = new EventEmitter();
|
|
||||||
@Output() selectedHueChange = new EventEmitter();
|
|
||||||
@Output() selectedClassChange = new EventEmitter();
|
|
||||||
@Output() selectedBgChange = new EventEmitter();
|
|
||||||
@Output() selectedFgChange = new EventEmitter();
|
|
||||||
|
|
||||||
_selectedClass = '';
|
@Input()
|
||||||
|
selectedHue: string;
|
||||||
|
|
||||||
|
@Input()
|
||||||
|
selectedFg: string;
|
||||||
|
|
||||||
|
@Input()
|
||||||
|
value: any;
|
||||||
|
|
||||||
|
@Output()
|
||||||
|
onValueChange: EventEmitter<any>;
|
||||||
|
|
||||||
|
@Output()
|
||||||
|
selectedPaletteChange: EventEmitter<any>;
|
||||||
|
|
||||||
|
@Output()
|
||||||
|
selectedHueChange: EventEmitter<any>;
|
||||||
|
|
||||||
|
@Output()
|
||||||
|
selectedClassChange: EventEmitter<any>;
|
||||||
|
|
||||||
|
@Output()
|
||||||
|
selectedBgChange: EventEmitter<any>;
|
||||||
|
|
||||||
|
@Output()
|
||||||
|
selectedFgChange: EventEmitter<any>;
|
||||||
|
|
||||||
|
// Private
|
||||||
|
_selectedClass: string;
|
||||||
|
_selectedBg: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor
|
||||||
|
*/
|
||||||
|
constructor()
|
||||||
|
{
|
||||||
|
// Set the defaults
|
||||||
|
this.colors = MatColors.all;
|
||||||
|
this.hues = ['50', '100', '200', '300', '400', '500', '600', '700', '800', '900', 'A100', 'A200', 'A400', 'A700'];
|
||||||
|
this.selectedFg = '';
|
||||||
|
this.selectedHue = '';
|
||||||
|
this.selectedPalette = '';
|
||||||
|
this.view = 'palettes';
|
||||||
|
|
||||||
|
this.onValueChange = new EventEmitter();
|
||||||
|
this.selectedPaletteChange = new EventEmitter();
|
||||||
|
this.selectedHueChange = new EventEmitter();
|
||||||
|
this.selectedClassChange = new EventEmitter();
|
||||||
|
this.selectedBgChange = new EventEmitter();
|
||||||
|
this.selectedFgChange = new EventEmitter();
|
||||||
|
|
||||||
|
// Set the private defaults
|
||||||
|
this._selectedClass = '';
|
||||||
|
this._selectedBg = '';
|
||||||
|
}
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------------------------------
|
||||||
|
// @ Accessors
|
||||||
|
// -----------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Selected class
|
||||||
|
*
|
||||||
|
* @param value
|
||||||
|
*/
|
||||||
@Input()
|
@Input()
|
||||||
set selectedClass(value)
|
set selectedClass(value)
|
||||||
{
|
{
|
||||||
@@ -54,7 +110,11 @@ export class FuseMaterialColorPickerComponent implements OnChanges
|
|||||||
return this._selectedClass;
|
return this._selectedClass;
|
||||||
}
|
}
|
||||||
|
|
||||||
_selectedBg = '';
|
/**
|
||||||
|
* Selected bg
|
||||||
|
*
|
||||||
|
* @param value
|
||||||
|
*/
|
||||||
@Input()
|
@Input()
|
||||||
set selectedBg(value)
|
set selectedBg(value)
|
||||||
{
|
{
|
||||||
@@ -86,13 +146,16 @@ export class FuseMaterialColorPickerComponent implements OnChanges
|
|||||||
return this._selectedBg;
|
return this._selectedBg;
|
||||||
}
|
}
|
||||||
|
|
||||||
constructor()
|
// -----------------------------------------------------------------------------------------------------
|
||||||
{
|
// @ Lifecycle hooks
|
||||||
this.colors = MatColors.all;
|
// -----------------------------------------------------------------------------------------------------
|
||||||
this.hues = ['50', '100', '200', '300', '400', '500', '600', '700', '800', '900', 'A100', 'A200', 'A400', 'A700'];
|
|
||||||
}
|
|
||||||
|
|
||||||
ngOnChanges(changes: any)
|
/**
|
||||||
|
* On changes
|
||||||
|
*
|
||||||
|
* @param changes
|
||||||
|
*/
|
||||||
|
ngOnChanges(changes: any): void
|
||||||
{
|
{
|
||||||
if ( changes.selectedBg && changes.selectedBg.currentValue === '' ||
|
if ( changes.selectedBg && changes.selectedBg.currentValue === '' ||
|
||||||
changes.selectedClass && changes.selectedClass.currentValue === '' ||
|
changes.selectedClass && changes.selectedClass.currentValue === '' ||
|
||||||
@@ -106,21 +169,38 @@ export class FuseMaterialColorPickerComponent implements OnChanges
|
|||||||
this.updateSelectedColor();
|
this.updateSelectedColor();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
selectPalette(palette)
|
// -----------------------------------------------------------------------------------------------------
|
||||||
|
// @ Public methods
|
||||||
|
// -----------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Select palette
|
||||||
|
*
|
||||||
|
* @param palette
|
||||||
|
*/
|
||||||
|
selectPalette(palette): void
|
||||||
{
|
{
|
||||||
this.selectedPalette = palette;
|
this.selectedPalette = palette;
|
||||||
this.updateSelectedColor();
|
this.updateSelectedColor();
|
||||||
this.view = 'hues';
|
this.view = 'hues';
|
||||||
}
|
}
|
||||||
|
|
||||||
selectHue(hue)
|
/**
|
||||||
|
* Select hue
|
||||||
|
*
|
||||||
|
* @param hue
|
||||||
|
*/
|
||||||
|
selectHue(hue): void
|
||||||
{
|
{
|
||||||
this.selectedHue = hue;
|
this.selectedHue = hue;
|
||||||
this.updateSelectedColor();
|
this.updateSelectedColor();
|
||||||
}
|
}
|
||||||
|
|
||||||
removeColor()
|
/**
|
||||||
|
* Remove color
|
||||||
|
*/
|
||||||
|
removeColor(): void
|
||||||
{
|
{
|
||||||
this.selectedPalette = '';
|
this.selectedPalette = '';
|
||||||
this.selectedHue = '';
|
this.selectedHue = '';
|
||||||
@@ -128,7 +208,10 @@ export class FuseMaterialColorPickerComponent implements OnChanges
|
|||||||
this.view = 'palettes';
|
this.view = 'palettes';
|
||||||
}
|
}
|
||||||
|
|
||||||
updateSelectedColor()
|
/**
|
||||||
|
* Update selected color
|
||||||
|
*/
|
||||||
|
updateSelectedColor(): void
|
||||||
{
|
{
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
|
|
||||||
@@ -168,12 +251,18 @@ export class FuseMaterialColorPickerComponent implements OnChanges
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
backToPaletteSelection()
|
/**
|
||||||
|
* Go back to palette selection
|
||||||
|
*/
|
||||||
|
backToPaletteSelection(): void
|
||||||
{
|
{
|
||||||
this.view = 'palettes';
|
this.view = 'palettes';
|
||||||
}
|
}
|
||||||
|
|
||||||
onMenuOpen()
|
/**
|
||||||
|
* On menu open
|
||||||
|
*/
|
||||||
|
onMenuOpen(): void
|
||||||
{
|
{
|
||||||
if ( this.selectedPalette === '' )
|
if ( this.selectedPalette === '' )
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import { NgModule } from '@angular/core';
|
import { NgModule } from '@angular/core';
|
||||||
import { CommonModule } from '@angular/common';
|
import { CommonModule } from '@angular/common';
|
||||||
import { FlexLayoutModule } from '@angular/flex-layout';
|
import { FlexLayoutModule } from '@angular/flex-layout';
|
||||||
|
|
||||||
import { MatButtonModule, MatIconModule, MatMenuModule, MatRippleModule } from '@angular/material';
|
import { MatButtonModule, MatIconModule, MatMenuModule, MatRippleModule } from '@angular/material';
|
||||||
|
|
||||||
import { FusePipesModule } from '@fuse/pipes/pipes.module';
|
import { FusePipesModule } from '@fuse/pipes/pipes.module';
|
||||||
|
|||||||
@@ -0,0 +1,69 @@
|
|||||||
|
<ng-container *ngIf="!item.hidden">
|
||||||
|
|
||||||
|
<!-- normal collapse -->
|
||||||
|
<a class="nav-link" [ngClass]="item.classes" *ngIf="!item.url && !item.function" matRipple>
|
||||||
|
<ng-container *ngTemplateOutlet="itemContent"></ng-container>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
<!-- item.url -->
|
||||||
|
<a class="nav-link" [ngClass]="item.classes" *ngIf="item.url && !item.externalUrl && !item.function"
|
||||||
|
[routerLink]="[item.url]" [routerLinkActive]="['active', 'mat-accent-bg']"
|
||||||
|
[routerLinkActiveOptions]="{exact: item.exactMatch || false}"
|
||||||
|
[target]="item.openInNewTab ? '_blank' : '_self'" matRipple>
|
||||||
|
<ng-container *ngTemplateOutlet="itemContent"></ng-container>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
<!-- item.externalUrl -->
|
||||||
|
<a class="nav-link" [ngClass]="item.classes" *ngIf="item.url && item.externalUrl && !item.function"
|
||||||
|
[href]="item.url" [target]="item.openInNewTab ? '_blank' : '_self'" matRipple>
|
||||||
|
<ng-container *ngTemplateOutlet="itemContent"></ng-container>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
<!-- item.function -->
|
||||||
|
<span class="nav-link" [ngClass]="item.classes" *ngIf="!item.url && item.function"
|
||||||
|
(click)="item.function()" matRipple>
|
||||||
|
<ng-container *ngTemplateOutlet="itemContent"></ng-container>
|
||||||
|
</span>
|
||||||
|
|
||||||
|
<!-- item.url && item.function -->
|
||||||
|
<a class="nav-link" [ngClass]="item.classes" *ngIf="item.url && !item.externalUrl && item.function"
|
||||||
|
(click)="item.function()"
|
||||||
|
[routerLink]="[item.url]" [routerLinkActive]="['active', 'mat-accent-bg']"
|
||||||
|
[routerLinkActiveOptions]="{exact: item.exactMatch || false}" matRipple>
|
||||||
|
<ng-container *ngTemplateOutlet="itemContent"></ng-container>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
<!-- item.externalUrl && item.function -->
|
||||||
|
<a class="nav-link" [ngClass]="item.classes" *ngIf="item.url && item.externalUrl && item.function"
|
||||||
|
(click)="item.function()"
|
||||||
|
[href]="item.url" [target]="item.openInNewTab ? '_blank' : '_self'" matRipple>
|
||||||
|
<ng-container *ngTemplateOutlet="itemContent"></ng-container>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
<ng-template #itemContent>
|
||||||
|
<mat-icon class="nav-link-icon" *ngIf="item.icon">{{item.icon}}</mat-icon>
|
||||||
|
<span class="nav-link-title" [translate]="item.translate">{{item.title}}</span>
|
||||||
|
<span class="nav-link-badge" *ngIf="item.badge" [translate]="item.badge.translate"
|
||||||
|
[ngStyle]="{'background-color': item.badge.bg,'color': item.badge.fg}">
|
||||||
|
{{item.badge.title}}
|
||||||
|
</span>
|
||||||
|
<mat-icon class="collapsable-arrow">keyboard_arrow_right</mat-icon>
|
||||||
|
</ng-template>
|
||||||
|
|
||||||
|
<div class="children" [ngClass]="{'open': isOpen}">
|
||||||
|
|
||||||
|
<div class="{{fuseConfig.layout.navbar.background}}">
|
||||||
|
|
||||||
|
<ng-container *ngFor="let item of item.children">
|
||||||
|
<fuse-nav-horizontal-item *ngIf="item.type=='item'" [item]="item"></fuse-nav-horizontal-item>
|
||||||
|
<fuse-nav-horizontal-collapsable *ngIf="item.type=='collapsable'"
|
||||||
|
[item]="item"></fuse-nav-horizontal-collapsable>
|
||||||
|
<fuse-nav-horizontal-collapsable *ngIf="item.type=='group'"
|
||||||
|
[item]="item"></fuse-nav-horizontal-collapsable>
|
||||||
|
</ng-container>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</ng-container>
|
||||||
@@ -0,0 +1,86 @@
|
|||||||
|
import { Component, HostBinding, HostListener, Input, OnDestroy, OnInit } from '@angular/core';
|
||||||
|
import { Subject } from 'rxjs';
|
||||||
|
import { takeUntil } from 'rxjs/operators';
|
||||||
|
|
||||||
|
import { fuseAnimations } from '@fuse/animations';
|
||||||
|
import { FuseConfigService } from '@fuse/services/config.service';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector : 'fuse-nav-horizontal-collapsable',
|
||||||
|
templateUrl: './collapsable.component.html',
|
||||||
|
styleUrls : ['./collapsable.component.scss'],
|
||||||
|
animations : fuseAnimations
|
||||||
|
})
|
||||||
|
export class FuseNavHorizontalCollapsableComponent implements OnInit, OnDestroy
|
||||||
|
{
|
||||||
|
fuseConfig: any;
|
||||||
|
isOpen = false;
|
||||||
|
|
||||||
|
@HostBinding('class')
|
||||||
|
classes = 'nav-collapsable nav-item';
|
||||||
|
|
||||||
|
@Input()
|
||||||
|
item: any;
|
||||||
|
|
||||||
|
// Private
|
||||||
|
private _unsubscribeAll: Subject<any>;
|
||||||
|
|
||||||
|
constructor(
|
||||||
|
private _fuseConfigService: FuseConfigService
|
||||||
|
)
|
||||||
|
{
|
||||||
|
// Set the private defaults
|
||||||
|
this._unsubscribeAll = new Subject();
|
||||||
|
}
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------------------------------
|
||||||
|
// @ Lifecycle hooks
|
||||||
|
// -----------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
/**
|
||||||
|
* On init
|
||||||
|
*/
|
||||||
|
ngOnInit(): void
|
||||||
|
{
|
||||||
|
// Subscribe to config changes
|
||||||
|
this._fuseConfigService.config
|
||||||
|
.pipe(takeUntil(this._unsubscribeAll))
|
||||||
|
.subscribe(
|
||||||
|
(config) => {
|
||||||
|
this.fuseConfig = config;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* On destroy
|
||||||
|
*/
|
||||||
|
ngOnDestroy(): void
|
||||||
|
{
|
||||||
|
// Unsubscribe from all subscriptions
|
||||||
|
this._unsubscribeAll.next();
|
||||||
|
this._unsubscribeAll.complete();
|
||||||
|
}
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------------------------------
|
||||||
|
// @ Public methods
|
||||||
|
// -----------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Open
|
||||||
|
*/
|
||||||
|
@HostListener('mouseenter')
|
||||||
|
open(): void
|
||||||
|
{
|
||||||
|
this.isOpen = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Close
|
||||||
|
*/
|
||||||
|
@HostListener('mouseleave')
|
||||||
|
close(): void
|
||||||
|
{
|
||||||
|
this.isOpen = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,48 @@
|
|||||||
|
<ng-container *ngIf="!item.hidden">
|
||||||
|
|
||||||
|
<!-- item.url -->
|
||||||
|
<a class="nav-link" [ngClass]="item.classes" *ngIf="item.url && !item.externalUrl && !item.function"
|
||||||
|
[routerLink]="[item.url]" [routerLinkActive]="['active', 'mat-accent-bg']"
|
||||||
|
[routerLinkActiveOptions]="{exact: item.exactMatch || false}"
|
||||||
|
[target]="item.openInNewTab ? '_blank' : '_self'" matRipple>
|
||||||
|
<ng-container *ngTemplateOutlet="itemContent"></ng-container>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
<!-- item.externalUrl -->
|
||||||
|
<a class="nav-link" [ngClass]="item.classes" *ngIf="item.url && item.externalUrl && !item.function"
|
||||||
|
[href]="item.url" [target]="item.openInNewTab ? '_blank' : '_self'" matRipple>
|
||||||
|
<ng-container *ngTemplateOutlet="itemContent"></ng-container>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
<!-- item.function -->
|
||||||
|
<span class="nav-link" [ngClass]="item.classes" *ngIf="!item.url && item.function"
|
||||||
|
(click)="item.function()" matRipple>
|
||||||
|
<ng-container *ngTemplateOutlet="itemContent"></ng-container>
|
||||||
|
</span>
|
||||||
|
|
||||||
|
<!-- item.url && item.function -->
|
||||||
|
<a class="nav-link" [ngClass]="item.classes" *ngIf="item.url && !item.externalUrl && item.function"
|
||||||
|
(click)="item.function()"
|
||||||
|
[routerLink]="[item.url]" [routerLinkActive]="['active', 'mat-accent-bg']"
|
||||||
|
[routerLinkActiveOptions]="{exact: item.exactMatch || false}"
|
||||||
|
[target]="item.openInNewTab ? '_blank' : '_self'" matRipple>
|
||||||
|
<ng-container *ngTemplateOutlet="itemContent"></ng-container>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
<!-- item.externalUrl && item.function -->
|
||||||
|
<a class="nav-link" [ngClass]="item.classes" *ngIf="item.url && item.externalUrl && item.function"
|
||||||
|
(click)="item.function()"
|
||||||
|
[href]="item.url" [target]="item.openInNewTab ? '_blank' : '_self'" matRipple>
|
||||||
|
<ng-container *ngTemplateOutlet="itemContent"></ng-container>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
<ng-template #itemContent>
|
||||||
|
<mat-icon class="nav-link-icon" *ngIf="item.icon">{{item.icon}}</mat-icon>
|
||||||
|
<span class="nav-link-title" [translate]="item.translate">{{item.title}}</span>
|
||||||
|
<span class="nav-link-badge" *ngIf="item.badge" [translate]="item.badge.translate"
|
||||||
|
[ngStyle]="{'background-color': item.badge.bg,'color': item.badge.fg}">
|
||||||
|
{{item.badge.title}}
|
||||||
|
</span>
|
||||||
|
</ng-template>
|
||||||
|
|
||||||
|
</ng-container>
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
import { Component, HostBinding, Input } from '@angular/core';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector : 'fuse-nav-horizontal-item',
|
||||||
|
templateUrl: './item.component.html',
|
||||||
|
styleUrls : ['./item.component.scss']
|
||||||
|
})
|
||||||
|
export class FuseNavHorizontalItemComponent
|
||||||
|
{
|
||||||
|
@HostBinding('class')
|
||||||
|
classes = 'nav-item';
|
||||||
|
|
||||||
|
@Input()
|
||||||
|
item: any;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor
|
||||||
|
*/
|
||||||
|
constructor()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
<a class="nav-link" matRipple>
|
|
||||||
<mat-icon class="nav-link-icon" *ngIf="item.icon">{{item.icon}}</mat-icon>
|
|
||||||
<span class="nav-link-title" [translate]="item.translate">{{item.title}}</span>
|
|
||||||
<span class="nav-link-badge" *ngIf="item.badge" [translate]="item.badge.translate"
|
|
||||||
[ngStyle]="{'background-color': item.badge.bg,'color': item.badge.fg}">
|
|
||||||
{{item.badge.title}}
|
|
||||||
</span>
|
|
||||||
<mat-icon class="collapse-arrow">keyboard_arrow_right</mat-icon>
|
|
||||||
</a>
|
|
||||||
|
|
||||||
<div class="children" [ngClass]="{'open': isOpen}">
|
|
||||||
|
|
||||||
<div class="{{fuseSettings.colorClasses.navbar}}">
|
|
||||||
|
|
||||||
<ng-container *ngFor="let item of item.children">
|
|
||||||
<fuse-nav-horizontal-item *ngIf="item.type=='item'" [item]="item"></fuse-nav-horizontal-item>
|
|
||||||
<fuse-nav-horizontal-collapse *ngIf="item.type=='collapse'" [item]="item"></fuse-nav-horizontal-collapse>
|
|
||||||
<fuse-nav-horizontal-collapse *ngIf="item.type=='group'" [item]="item"></fuse-nav-horizontal-collapse>
|
|
||||||
</ng-container>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
@@ -1,50 +0,0 @@
|
|||||||
import { Component, HostBinding, HostListener, Input, OnDestroy } from '@angular/core';
|
|
||||||
import { fuseAnimations } from '../../../../animations/index';
|
|
||||||
import { FuseConfigService } from '../../../../services/config.service';
|
|
||||||
import { Subscription } from 'rxjs/Subscription';
|
|
||||||
|
|
||||||
@Component({
|
|
||||||
selector : 'fuse-nav-horizontal-collapse',
|
|
||||||
templateUrl: './nav-horizontal-collapse.component.html',
|
|
||||||
styleUrls : ['./nav-horizontal-collapse.component.scss'],
|
|
||||||
animations : fuseAnimations
|
|
||||||
})
|
|
||||||
export class FuseNavHorizontalCollapseComponent implements OnDestroy
|
|
||||||
{
|
|
||||||
onConfigChanged: Subscription;
|
|
||||||
fuseSettings: any;
|
|
||||||
isOpen = false;
|
|
||||||
|
|
||||||
@HostBinding('class') classes = 'nav-item nav-collapse';
|
|
||||||
@Input() item: any;
|
|
||||||
|
|
||||||
@HostListener('mouseenter')
|
|
||||||
open()
|
|
||||||
{
|
|
||||||
this.isOpen = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@HostListener('mouseleave')
|
|
||||||
close()
|
|
||||||
{
|
|
||||||
this.isOpen = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
constructor(
|
|
||||||
private fuseConfig: FuseConfigService
|
|
||||||
)
|
|
||||||
{
|
|
||||||
this.onConfigChanged =
|
|
||||||
this.fuseConfig.onConfigChanged
|
|
||||||
.subscribe(
|
|
||||||
(newSettings) => {
|
|
||||||
this.fuseSettings = newSettings;
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
ngOnDestroy()
|
|
||||||
{
|
|
||||||
this.onConfigChanged.unsubscribe();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
<a class="nav-link" *ngIf="item.url" [routerLink]="[item.url]" routerLinkActive="active"
|
|
||||||
[routerLinkActiveOptions]="{exact: item.exactMatch || false}" matRipple>
|
|
||||||
<mat-icon class="nav-link-icon" *ngIf="item.icon">{{item.icon}}</mat-icon>
|
|
||||||
<span class="nav-link-title" [translate]="item.translate">{{item.title}}</span>
|
|
||||||
<span class="nav-link-badge" *ngIf="item.badge" [translate]="item.badge.translate"
|
|
||||||
[ngStyle]="{'background-color': item.badge.bg,'color': item.badge.fg}">
|
|
||||||
{{item.badge.title}}
|
|
||||||
</span>
|
|
||||||
</a>
|
|
||||||
|
|
||||||
<span class="nav-link" *ngIf="item.function" (click)="item.function()" matRipple>
|
|
||||||
<mat-icon class="nav-link-icon" *ngIf="item.icon">{{item.icon}}</mat-icon>
|
|
||||||
<span class="nav-link-title" [translate]="item.translate">{{item.title}}</span>
|
|
||||||
<span class="nav-link-badge" *ngIf="item.badge" [translate]="item.badge.translate"
|
|
||||||
[ngStyle]="{'background-color': item.badge.bg,'color': item.badge.fg}">
|
|
||||||
{{item.badge.title}}
|
|
||||||
</span>
|
|
||||||
</span>
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
import { Component, HostBinding, Input } from '@angular/core';
|
|
||||||
|
|
||||||
@Component({
|
|
||||||
selector : 'fuse-nav-horizontal-item',
|
|
||||||
templateUrl: './nav-horizontal-item.component.html',
|
|
||||||
styleUrls : ['./nav-horizontal-item.component.scss']
|
|
||||||
})
|
|
||||||
export class FuseNavHorizontalItemComponent
|
|
||||||
{
|
|
||||||
@HostBinding('class') classes = 'nav-item';
|
|
||||||
@Input() item: any;
|
|
||||||
}
|
|
||||||
@@ -1,5 +1,4 @@
|
|||||||
<div id="main-navigation" class="nav"
|
<div class="nav" [ngClass]="{'horizontal':layout === 'horizontal', 'vertical':layout === 'vertical'}">
|
||||||
[ngClass]="{'horizontal':layout === 'horizontal', 'vertical':layout === 'vertical'}">
|
|
||||||
|
|
||||||
<!-- Vertical Navigation Layout -->
|
<!-- Vertical Navigation Layout -->
|
||||||
<ng-container *ngIf="layout === 'vertical'">
|
<ng-container *ngIf="layout === 'vertical'">
|
||||||
@@ -7,7 +6,7 @@
|
|||||||
<ng-container *ngFor="let item of navigation">
|
<ng-container *ngFor="let item of navigation">
|
||||||
|
|
||||||
<fuse-nav-vertical-group *ngIf="item.type=='group'" [item]="item"></fuse-nav-vertical-group>
|
<fuse-nav-vertical-group *ngIf="item.type=='group'" [item]="item"></fuse-nav-vertical-group>
|
||||||
<fuse-nav-vertical-collapse *ngIf="item.type=='collapse'" [item]="item"></fuse-nav-vertical-collapse>
|
<fuse-nav-vertical-collapsable *ngIf="item.type=='collapse'" [item]="item"></fuse-nav-vertical-collapsable>
|
||||||
<fuse-nav-vertical-item *ngIf="item.type=='item'" [item]="item"></fuse-nav-vertical-item>
|
<fuse-nav-vertical-item *ngIf="item.type=='item'" [item]="item"></fuse-nav-vertical-item>
|
||||||
|
|
||||||
</ng-container>
|
</ng-container>
|
||||||
@@ -20,8 +19,9 @@
|
|||||||
|
|
||||||
<ng-container *ngFor="let item of navigation">
|
<ng-container *ngFor="let item of navigation">
|
||||||
|
|
||||||
<fuse-nav-horizontal-collapse *ngIf="item.type=='group'" [item]="item"></fuse-nav-horizontal-collapse>
|
<fuse-nav-horizontal-collapsable *ngIf="item.type=='group'" [item]="item"></fuse-nav-horizontal-collapsable>
|
||||||
<fuse-nav-horizontal-collapse *ngIf="item.type=='collapse'" [item]="item"></fuse-nav-horizontal-collapse>
|
<fuse-nav-horizontal-collapsable *ngIf="item.type=='collapse'"
|
||||||
|
[item]="item"></fuse-nav-horizontal-collapsable>
|
||||||
<fuse-nav-horizontal-item *ngIf="item.type=='item'" [item]="item"></fuse-nav-horizontal-item>
|
<fuse-nav-horizontal-item *ngIf="item.type=='item'" [item]="item"></fuse-nav-horizontal-item>
|
||||||
|
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ fuse-navigation {
|
|||||||
display: flex;
|
display: flex;
|
||||||
flex: 1 0 auto;
|
flex: 1 0 auto;
|
||||||
|
|
||||||
#main-navigation {
|
> .nav {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|||||||
@@ -1,4 +1,8 @@
|
|||||||
import { Component, Input, ViewEncapsulation } from '@angular/core';
|
import { Component, Input, OnInit, ViewEncapsulation } from '@angular/core';
|
||||||
|
import { Subject } from 'rxjs';
|
||||||
|
import { takeUntil } from 'rxjs/operators';
|
||||||
|
|
||||||
|
import { FuseNavigationService } from '@fuse/components/navigation/navigation.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector : 'fuse-navigation',
|
selector : 'fuse-navigation',
|
||||||
@@ -6,13 +10,45 @@ import { Component, Input, ViewEncapsulation } from '@angular/core';
|
|||||||
styleUrls : ['./navigation.component.scss'],
|
styleUrls : ['./navigation.component.scss'],
|
||||||
encapsulation: ViewEncapsulation.None
|
encapsulation: ViewEncapsulation.None
|
||||||
})
|
})
|
||||||
export class FuseNavigationComponent
|
export class FuseNavigationComponent implements OnInit
|
||||||
{
|
{
|
||||||
@Input() layout = 'vertical';
|
@Input()
|
||||||
@Input() navigation: any;
|
layout = 'vertical';
|
||||||
|
|
||||||
constructor()
|
@Input()
|
||||||
|
navigation: any;
|
||||||
|
|
||||||
|
// Private
|
||||||
|
private _unsubscribeAll: Subject<any>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor
|
||||||
|
*/
|
||||||
|
constructor(
|
||||||
|
private _fuseNavigationService: FuseNavigationService
|
||||||
|
)
|
||||||
{
|
{
|
||||||
|
// Set the private defaults
|
||||||
|
this._unsubscribeAll = new Subject();
|
||||||
|
}
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------------------------------
|
||||||
|
// @ Lifecycle hooks
|
||||||
|
// -----------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
/**
|
||||||
|
* On init
|
||||||
|
*/
|
||||||
|
ngOnInit(): void
|
||||||
|
{
|
||||||
|
// Load the navigation either from the input or from the service
|
||||||
|
this.navigation = this.navigation || this._fuseNavigationService.getCurrentNavigation();
|
||||||
|
|
||||||
|
// Subscribe to the current navigation changes
|
||||||
|
this._fuseNavigationService.onNavigationChanged
|
||||||
|
.pipe(takeUntil(this._unsubscribeAll))
|
||||||
|
.subscribe(() => {
|
||||||
|
this.navigation = this._fuseNavigationService.getCurrentNavigation();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,11 +6,11 @@ import { MatIconModule, MatRippleModule } from '@angular/material';
|
|||||||
import { TranslateModule } from '@ngx-translate/core';
|
import { TranslateModule } from '@ngx-translate/core';
|
||||||
|
|
||||||
import { FuseNavigationComponent } from './navigation.component';
|
import { FuseNavigationComponent } from './navigation.component';
|
||||||
import { FuseNavVerticalItemComponent } from './vertical/nav-item/nav-vertical-item.component';
|
import { FuseNavVerticalItemComponent } from './vertical/item/item.component';
|
||||||
import { FuseNavVerticalCollapseComponent } from './vertical/nav-collapse/nav-vertical-collapse.component';
|
import { FuseNavVerticalCollapsableComponent } from './vertical/collapsable/collapsable.component';
|
||||||
import { FuseNavVerticalGroupComponent } from './vertical/nav-group/nav-vertical-group.component';
|
import { FuseNavVerticalGroupComponent } from './vertical/group/group.component';
|
||||||
import { FuseNavHorizontalItemComponent } from './horizontal/nav-item/nav-horizontal-item.component';
|
import { FuseNavHorizontalItemComponent } from './horizontal/item/item.component';
|
||||||
import { FuseNavHorizontalCollapseComponent } from './horizontal/nav-collapse/nav-horizontal-collapse.component';
|
import { FuseNavHorizontalCollapsableComponent } from './horizontal/collapsable/collapsable.component';
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports : [
|
imports : [
|
||||||
@@ -29,9 +29,9 @@ import { FuseNavHorizontalCollapseComponent } from './horizontal/nav-collapse/na
|
|||||||
FuseNavigationComponent,
|
FuseNavigationComponent,
|
||||||
FuseNavVerticalGroupComponent,
|
FuseNavVerticalGroupComponent,
|
||||||
FuseNavVerticalItemComponent,
|
FuseNavVerticalItemComponent,
|
||||||
FuseNavVerticalCollapseComponent,
|
FuseNavVerticalCollapsableComponent,
|
||||||
FuseNavHorizontalItemComponent,
|
FuseNavHorizontalItemComponent,
|
||||||
FuseNavHorizontalCollapseComponent
|
FuseNavHorizontalCollapsableComponent
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
export class FuseNavigationModule
|
export class FuseNavigationModule
|
||||||
|
|||||||
@@ -1,48 +1,350 @@
|
|||||||
import { EventEmitter, Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { Subject } from 'rxjs/Subject';
|
import { BehaviorSubject, Observable, Subject } from 'rxjs';
|
||||||
|
|
||||||
@Injectable()
|
import { FuseNavigationItem } from '@fuse/types';
|
||||||
|
|
||||||
|
@Injectable({
|
||||||
|
providedIn: 'root'
|
||||||
|
})
|
||||||
export class FuseNavigationService
|
export class FuseNavigationService
|
||||||
{
|
{
|
||||||
flatNavigation: any[] = [];
|
onItemCollapsed: Subject<any>;
|
||||||
|
onItemCollapseToggled: Subject<any>;
|
||||||
|
|
||||||
onItemCollapsed: Subject<any> = new Subject;
|
// Private
|
||||||
onItemCollapseToggled: Subject<any> = new Subject;
|
private _onNavigationChanged: BehaviorSubject<any>;
|
||||||
|
private _onNavigationRegistered: BehaviorSubject<any>;
|
||||||
|
private _onNavigationUnregistered: BehaviorSubject<any>;
|
||||||
|
|
||||||
|
private _currentNavigationKey: string;
|
||||||
|
private _registry: { [key: string]: any } = {};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor
|
||||||
|
*/
|
||||||
constructor()
|
constructor()
|
||||||
{
|
{
|
||||||
|
// Set the defaults
|
||||||
|
this.onItemCollapsed = new Subject();
|
||||||
|
this.onItemCollapseToggled = new Subject();
|
||||||
|
|
||||||
|
// Set the private defaults
|
||||||
|
this._currentNavigationKey = null;
|
||||||
|
this._onNavigationChanged = new BehaviorSubject(null);
|
||||||
|
this._onNavigationRegistered = new BehaviorSubject(null);
|
||||||
|
this._onNavigationUnregistered = new BehaviorSubject(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------------------------------
|
||||||
|
// @ Accessors
|
||||||
|
// -----------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get onNavigationChanged
|
||||||
|
*
|
||||||
|
* @returns {Observable<any>}
|
||||||
|
*/
|
||||||
|
get onNavigationChanged(): Observable<any>
|
||||||
|
{
|
||||||
|
return this._onNavigationChanged.asObservable();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get onNavigationRegistered
|
||||||
|
*
|
||||||
|
* @returns {Observable<any>}
|
||||||
|
*/
|
||||||
|
get onNavigationRegistered(): Observable<any>
|
||||||
|
{
|
||||||
|
return this._onNavigationRegistered.asObservable();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get onNavigationUnregistered
|
||||||
|
*
|
||||||
|
* @returns {Observable<any>}
|
||||||
|
*/
|
||||||
|
get onNavigationUnregistered(): Observable<any>
|
||||||
|
{
|
||||||
|
return this._onNavigationUnregistered.asObservable();
|
||||||
|
}
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------------------------------
|
||||||
|
// @ Public methods
|
||||||
|
// -----------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Register the given navigation
|
||||||
|
* with the given key
|
||||||
|
*
|
||||||
|
* @param key
|
||||||
|
* @param navigation
|
||||||
|
*/
|
||||||
|
register(key, navigation): void
|
||||||
|
{
|
||||||
|
// Check if the key already being used
|
||||||
|
if ( this._registry[key] )
|
||||||
|
{
|
||||||
|
console.error(`The navigation with the key '${key}' already exists. Either unregister it first or use a unique key.`);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add to the registry
|
||||||
|
this._registry[key] = navigation;
|
||||||
|
|
||||||
|
// Notify the subject
|
||||||
|
this._onNavigationRegistered.next([key, navigation]);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Unregister the navigation from the registry
|
||||||
|
* @param key
|
||||||
|
*/
|
||||||
|
unregister(key): void
|
||||||
|
{
|
||||||
|
// Check if the navigation exists
|
||||||
|
if ( !this._registry[key] )
|
||||||
|
{
|
||||||
|
console.warn(`The navigation with the key '${key}' doesn't exist in the registry.`);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Unregister the sidebar
|
||||||
|
delete this._registry[key];
|
||||||
|
|
||||||
|
// Notify the subject
|
||||||
|
this._onNavigationUnregistered.next(key);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get navigation from registry by key
|
||||||
|
*
|
||||||
|
* @param key
|
||||||
|
* @returns {any}
|
||||||
|
*/
|
||||||
|
getNavigation(key): any
|
||||||
|
{
|
||||||
|
// Check if the navigation exists
|
||||||
|
if ( !this._registry[key] )
|
||||||
|
{
|
||||||
|
console.warn(`The navigation with the key '${key}' doesn't exist in the registry.`);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Return the sidebar
|
||||||
|
return this._registry[key];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get flattened navigation array
|
* Get flattened navigation array
|
||||||
|
*
|
||||||
* @param navigation
|
* @param navigation
|
||||||
|
* @param flatNavigation
|
||||||
* @returns {any[]}
|
* @returns {any[]}
|
||||||
*/
|
*/
|
||||||
getFlatNavigation(navigation)
|
getFlatNavigation(navigation, flatNavigation: FuseNavigationItem[] = []): any
|
||||||
{
|
{
|
||||||
for ( const navItem of navigation )
|
for ( const item of navigation )
|
||||||
{
|
{
|
||||||
if ( navItem.type === 'item' )
|
if ( item.type === 'item' )
|
||||||
{
|
{
|
||||||
this.flatNavigation.push({
|
flatNavigation.push(item);
|
||||||
title: navItem.title,
|
|
||||||
type : navItem.type,
|
|
||||||
icon : navItem.icon || false,
|
|
||||||
url : navItem.url
|
|
||||||
});
|
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( navItem.type === 'collapse' || navItem.type === 'group' )
|
if ( item.type === 'collapsable' || item.type === 'group' )
|
||||||
{
|
{
|
||||||
if ( navItem.children )
|
if ( item.children )
|
||||||
{
|
{
|
||||||
this.getFlatNavigation(navItem.children);
|
this.getFlatNavigation(item.children, flatNavigation);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.flatNavigation;
|
return flatNavigation;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the current navigation
|
||||||
|
*
|
||||||
|
* @returns {any}
|
||||||
|
*/
|
||||||
|
getCurrentNavigation(): any
|
||||||
|
{
|
||||||
|
if ( !this._currentNavigationKey )
|
||||||
|
{
|
||||||
|
console.warn(`The current navigation is not set.`);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
return this.getNavigation(this._currentNavigationKey);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the navigation with the key
|
||||||
|
* as the current navigation
|
||||||
|
*
|
||||||
|
* @param key
|
||||||
|
*/
|
||||||
|
setCurrentNavigation(key): void
|
||||||
|
{
|
||||||
|
// Check if the sidebar exists
|
||||||
|
if ( !this._registry[key] )
|
||||||
|
{
|
||||||
|
console.warn(`The navigation with the key '${key}' doesn't exist in the registry.`);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set the current navigation key
|
||||||
|
this._currentNavigationKey = key;
|
||||||
|
|
||||||
|
// Notify the subject
|
||||||
|
this._onNavigationChanged.next(key);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get navigation item by id from the
|
||||||
|
* current navigation
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @param {any} navigation
|
||||||
|
* @returns {any | boolean}
|
||||||
|
*/
|
||||||
|
getNavigationItem(id, navigation = null): any | boolean
|
||||||
|
{
|
||||||
|
if ( !navigation )
|
||||||
|
{
|
||||||
|
navigation = this.getCurrentNavigation();
|
||||||
|
}
|
||||||
|
|
||||||
|
for ( const item of navigation )
|
||||||
|
{
|
||||||
|
if ( item.id === id )
|
||||||
|
{
|
||||||
|
return item;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( item.children )
|
||||||
|
{
|
||||||
|
const childItem = this.getNavigationItem(id, item.children);
|
||||||
|
|
||||||
|
if ( childItem )
|
||||||
|
{
|
||||||
|
return childItem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the parent of the navigation item
|
||||||
|
* with the id
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @param {any} navigation
|
||||||
|
* @param parent
|
||||||
|
*/
|
||||||
|
getNavigationItemParent(id, navigation = null, parent = null): any
|
||||||
|
{
|
||||||
|
if ( !navigation )
|
||||||
|
{
|
||||||
|
navigation = this.getCurrentNavigation();
|
||||||
|
parent = navigation;
|
||||||
|
}
|
||||||
|
|
||||||
|
for ( const item of navigation )
|
||||||
|
{
|
||||||
|
if ( item.id === id )
|
||||||
|
{
|
||||||
|
return parent;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( item.children )
|
||||||
|
{
|
||||||
|
const childItem = this.getNavigationItemParent(id, item.children, item);
|
||||||
|
|
||||||
|
if ( childItem )
|
||||||
|
{
|
||||||
|
return childItem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add a navigation item to the specified location
|
||||||
|
*
|
||||||
|
* @param item
|
||||||
|
* @param id
|
||||||
|
*/
|
||||||
|
addNavigationItem(item, id): void
|
||||||
|
{
|
||||||
|
// Get the current navigation
|
||||||
|
const navigation: any[] = this.getCurrentNavigation();
|
||||||
|
|
||||||
|
// Add to the end of the navigation
|
||||||
|
if ( id === 'end' )
|
||||||
|
{
|
||||||
|
navigation.push(item);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add to the start of the navigation
|
||||||
|
if ( id === 'start' )
|
||||||
|
{
|
||||||
|
navigation.unshift(item);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add it to a specific location
|
||||||
|
const parent: any = this.getNavigationItem(id);
|
||||||
|
|
||||||
|
if ( parent )
|
||||||
|
{
|
||||||
|
// Check if parent has a children entry,
|
||||||
|
// and add it if it doesn't
|
||||||
|
if ( !parent.children )
|
||||||
|
{
|
||||||
|
parent.children = [];
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add the item
|
||||||
|
parent.children.push(item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Remove navigation item with the given id
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
*/
|
||||||
|
removeNavigationItem(id): void
|
||||||
|
{
|
||||||
|
const item = this.getNavigationItem(id);
|
||||||
|
|
||||||
|
// Return, if there is not such an item
|
||||||
|
if ( !item )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get the parent of the item
|
||||||
|
let parent = this.getNavigationItemParent(id);
|
||||||
|
|
||||||
|
// This check is required because of the first level
|
||||||
|
// of the navigation, since the first level is not
|
||||||
|
// inside the 'children' array
|
||||||
|
parent = parent.children || parent;
|
||||||
|
|
||||||
|
// Remove the item
|
||||||
|
parent.splice(parent.indexOf(item), 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,65 @@
|
|||||||
|
<ng-container *ngIf="!item.hidden">
|
||||||
|
|
||||||
|
<!-- normal collapse -->
|
||||||
|
<a class="nav-link" [ngClass]="item.classes" *ngIf="!item.url && !item.function"
|
||||||
|
(click)="toggleOpen($event)" matRipple>
|
||||||
|
<ng-container *ngTemplateOutlet="itemContent"></ng-container>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
<!-- item.url -->
|
||||||
|
<a class="nav-link" [ngClass]="item.classes" *ngIf="item.url && !item.externalUrl && !item.function"
|
||||||
|
(click)="toggleOpen($event)"
|
||||||
|
[routerLink]="[item.url]" [routerLinkActive]="['active', 'mat-accent-bg']"
|
||||||
|
[routerLinkActiveOptions]="{exact: item.exactMatch || false}"
|
||||||
|
[target]="item.openInNewTab ? '_blank' : '_self'" matRipple>
|
||||||
|
<ng-container *ngTemplateOutlet="itemContent"></ng-container>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
<!-- item.externalUrl -->
|
||||||
|
<a class="nav-link" [ngClass]="item.classes" *ngIf="item.url && item.externalUrl && !item.function"
|
||||||
|
(click)="toggleOpen($event)"
|
||||||
|
[href]="item.url" [target]="item.openInNewTab ? '_blank' : '_self'" matRipple>
|
||||||
|
<ng-container *ngTemplateOutlet="itemContent"></ng-container>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
<!-- item.function -->
|
||||||
|
<span class="nav-link" [ngClass]="item.classes" *ngIf="!item.url && item.function"
|
||||||
|
(click)="toggleOpen($event);item.function()" matRipple>
|
||||||
|
<ng-container *ngTemplateOutlet="itemContent"></ng-container>
|
||||||
|
</span>
|
||||||
|
|
||||||
|
<!-- item.url && item.function -->
|
||||||
|
<a class="nav-link" [ngClass]="item.classes" *ngIf="item.url && !item.externalUrl && item.function"
|
||||||
|
(click)="toggleOpen($event);item.function()"
|
||||||
|
[routerLink]="[item.url]" [routerLinkActive]="['active', 'mat-accent-bg']"
|
||||||
|
[routerLinkActiveOptions]="{exact: item.exactMatch || false}" matRipple>
|
||||||
|
<ng-container *ngTemplateOutlet="itemContent"></ng-container>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
<!-- item.externalUrl && item.function -->
|
||||||
|
<a class="nav-link" [ngClass]="item.classes" *ngIf="item.url && item.externalUrl && item.function"
|
||||||
|
(click)="toggleOpen($event);item.function()"
|
||||||
|
[href]="item.url" [target]="item.openInNewTab ? '_blank' : '_self'" matRipple>
|
||||||
|
<ng-container *ngTemplateOutlet="itemContent"></ng-container>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
<ng-template #itemContent>
|
||||||
|
<mat-icon class="nav-link-icon" *ngIf="item.icon">{{item.icon}}</mat-icon>
|
||||||
|
<span class="nav-link-title" [translate]="item.translate">{{item.title}}</span>
|
||||||
|
<span class="nav-link-badge" *ngIf="item.badge" [translate]="item.badge.translate"
|
||||||
|
[ngStyle]="{'background-color': item.badge.bg,'color': item.badge.fg}">
|
||||||
|
{{item.badge.title}}
|
||||||
|
</span>
|
||||||
|
<mat-icon class="collapsable-arrow">keyboard_arrow_right</mat-icon>
|
||||||
|
</ng-template>
|
||||||
|
|
||||||
|
<div class="children" [@slideInOut]="isOpen">
|
||||||
|
<ng-container *ngFor="let item of item.children">
|
||||||
|
<fuse-nav-vertical-item *ngIf="item.type=='item'" [item]="item"></fuse-nav-vertical-item>
|
||||||
|
<fuse-nav-vertical-collapsable *ngIf="item.type=='collapsable'"
|
||||||
|
[item]="item"></fuse-nav-vertical-collapsable>
|
||||||
|
<fuse-nav-vertical-group *ngIf="item.type=='group'" [item]="item"></fuse-nav-vertical-group>
|
||||||
|
</ng-container>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</ng-container>
|
||||||
@@ -20,7 +20,7 @@
|
|||||||
|
|
||||||
.nav-link {
|
.nav-link {
|
||||||
|
|
||||||
.collapse-arrow {
|
.collapsable-arrow {
|
||||||
transition: transform .3s ease-in-out, opacity .25s ease-in-out .1s;
|
transition: transform .3s ease-in-out, opacity .25s ease-in-out .1s;
|
||||||
transform: rotate(0);
|
transform: rotate(0);
|
||||||
}
|
}
|
||||||
@@ -34,13 +34,9 @@
|
|||||||
|
|
||||||
> .nav-link {
|
> .nav-link {
|
||||||
|
|
||||||
.collapse-arrow {
|
.collapsable-arrow {
|
||||||
transform: rotate(90deg);
|
transform: rotate(90deg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
> .children {
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,46 +1,79 @@
|
|||||||
import { Component, HostBinding, Input, OnInit } from '@angular/core';
|
import { Component, HostBinding, Input, OnDestroy, OnInit } from '@angular/core';
|
||||||
import { FuseNavigationService } from '../../navigation.service';
|
|
||||||
import { NavigationEnd, Router } from '@angular/router';
|
import { NavigationEnd, Router } from '@angular/router';
|
||||||
import { fuseAnimations } from '../../../../animations/index';
|
import { Subject } from 'rxjs';
|
||||||
|
import { filter, takeUntil } from 'rxjs/operators';
|
||||||
|
|
||||||
|
import { FuseNavigationItem } from '@fuse/types';
|
||||||
|
import { fuseAnimations } from '@fuse/animations';
|
||||||
|
import { FuseNavigationService } from '@fuse/components/navigation/navigation.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector : 'fuse-nav-vertical-collapse',
|
selector : 'fuse-nav-vertical-collapsable',
|
||||||
templateUrl: './nav-vertical-collapse.component.html',
|
templateUrl: './collapsable.component.html',
|
||||||
styleUrls : ['./nav-vertical-collapse.component.scss'],
|
styleUrls : ['./collapsable.component.scss'],
|
||||||
animations : fuseAnimations
|
animations : fuseAnimations
|
||||||
})
|
})
|
||||||
export class FuseNavVerticalCollapseComponent implements OnInit
|
export class FuseNavVerticalCollapsableComponent implements OnInit, OnDestroy
|
||||||
{
|
{
|
||||||
@Input() item: any;
|
@Input()
|
||||||
@HostBinding('class') classes = 'nav-collapse nav-item';
|
item: FuseNavigationItem;
|
||||||
@HostBinding('class.open') public isOpen = false;
|
|
||||||
|
|
||||||
|
@HostBinding('class')
|
||||||
|
classes = 'nav-collapsable nav-item';
|
||||||
|
|
||||||
|
@HostBinding('class.open')
|
||||||
|
public isOpen = false;
|
||||||
|
|
||||||
|
// Private
|
||||||
|
private _unsubscribeAll: Subject<any>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor
|
||||||
|
*
|
||||||
|
* @param {FuseNavigationService} _fuseNavigationService
|
||||||
|
* @param {Router} _router
|
||||||
|
*/
|
||||||
constructor(
|
constructor(
|
||||||
private navigationService: FuseNavigationService,
|
private _fuseNavigationService: FuseNavigationService,
|
||||||
private router: Router
|
private _router: Router
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
// Listen for route changes
|
// Set the private defaults
|
||||||
router.events.subscribe(
|
this._unsubscribeAll = new Subject();
|
||||||
(event) => {
|
}
|
||||||
if ( event instanceof NavigationEnd )
|
|
||||||
|
// -----------------------------------------------------------------------------------------------------
|
||||||
|
// @ Lifecycle hooks
|
||||||
|
// -----------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
/**
|
||||||
|
* On init
|
||||||
|
*/
|
||||||
|
ngOnInit(): void
|
||||||
|
{
|
||||||
|
// Listen for router events
|
||||||
|
this._router.events
|
||||||
|
.pipe(
|
||||||
|
filter(event => event instanceof NavigationEnd),
|
||||||
|
takeUntil(this._unsubscribeAll)
|
||||||
|
)
|
||||||
|
.subscribe((event: NavigationEnd) => {
|
||||||
|
|
||||||
|
// Check if the url can be found in
|
||||||
|
// one of the children of this item
|
||||||
|
if ( this.isUrlInChildren(this.item, event.urlAfterRedirects) )
|
||||||
{
|
{
|
||||||
// Check if the url can be found in
|
this.expand();
|
||||||
// one of the children of this item
|
|
||||||
if ( this.isUrlInChildren(this.item, event.urlAfterRedirects) )
|
|
||||||
{
|
|
||||||
this.expand();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
this.collapse();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
else
|
||||||
);
|
{
|
||||||
|
this.collapse();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
// Listen for collapsing of any navigation item
|
// Listen for collapsing of any navigation item
|
||||||
this.navigationService.onItemCollapsed
|
this._fuseNavigationService.onItemCollapsed
|
||||||
|
.pipe(takeUntil(this._unsubscribeAll))
|
||||||
.subscribe(
|
.subscribe(
|
||||||
(clickedItem) => {
|
(clickedItem) => {
|
||||||
if ( clickedItem && clickedItem.children )
|
if ( clickedItem && clickedItem.children )
|
||||||
@@ -54,7 +87,7 @@ export class FuseNavVerticalCollapseComponent implements OnInit
|
|||||||
|
|
||||||
// Check if the url can be found in
|
// Check if the url can be found in
|
||||||
// one of the children of this item
|
// one of the children of this item
|
||||||
if ( this.isUrlInChildren(this.item, this.router.url) )
|
if ( this.isUrlInChildren(this.item, this._router.url) )
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -67,13 +100,10 @@ export class FuseNavVerticalCollapseComponent implements OnInit
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
|
||||||
|
|
||||||
ngOnInit()
|
|
||||||
{
|
|
||||||
// Check if the url can be found in
|
// Check if the url can be found in
|
||||||
// one of the children of this item
|
// one of the children of this item
|
||||||
if ( this.isUrlInChildren(this.item, this.router.url) )
|
if ( this.isUrlInChildren(this.item, this._router.url) )
|
||||||
{
|
{
|
||||||
this.expand();
|
this.expand();
|
||||||
}
|
}
|
||||||
@@ -83,26 +113,40 @@ export class FuseNavVerticalCollapseComponent implements OnInit
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* On destroy
|
||||||
|
*/
|
||||||
|
ngOnDestroy(): void
|
||||||
|
{
|
||||||
|
// Unsubscribe from all subscriptions
|
||||||
|
this._unsubscribeAll.next();
|
||||||
|
this._unsubscribeAll.complete();
|
||||||
|
}
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------------------------------
|
||||||
|
// @ Public methods
|
||||||
|
// -----------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Toggle collapse
|
* Toggle collapse
|
||||||
*
|
*
|
||||||
* @param ev
|
* @param ev
|
||||||
*/
|
*/
|
||||||
toggleOpen(ev)
|
toggleOpen(ev): void
|
||||||
{
|
{
|
||||||
ev.preventDefault();
|
ev.preventDefault();
|
||||||
|
|
||||||
this.isOpen = !this.isOpen;
|
this.isOpen = !this.isOpen;
|
||||||
|
|
||||||
// Navigation collapse toggled...
|
// Navigation collapse toggled...
|
||||||
this.navigationService.onItemCollapsed.next(this.item);
|
this._fuseNavigationService.onItemCollapsed.next(this.item);
|
||||||
this.navigationService.onItemCollapseToggled.next();
|
this._fuseNavigationService.onItemCollapseToggled.next();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Expand the collapsable navigation
|
* Expand the collapsable navigation
|
||||||
*/
|
*/
|
||||||
expand()
|
expand(): void
|
||||||
{
|
{
|
||||||
if ( this.isOpen )
|
if ( this.isOpen )
|
||||||
{
|
{
|
||||||
@@ -110,13 +154,13 @@ export class FuseNavVerticalCollapseComponent implements OnInit
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.isOpen = true;
|
this.isOpen = true;
|
||||||
this.navigationService.onItemCollapseToggled.next();
|
this._fuseNavigationService.onItemCollapseToggled.next();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Collapse the collapsable navigation
|
* Collapse the collapsable navigation
|
||||||
*/
|
*/
|
||||||
collapse()
|
collapse(): void
|
||||||
{
|
{
|
||||||
if ( !this.isOpen )
|
if ( !this.isOpen )
|
||||||
{
|
{
|
||||||
@@ -124,7 +168,7 @@ export class FuseNavVerticalCollapseComponent implements OnInit
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.isOpen = false;
|
this.isOpen = false;
|
||||||
this.navigationService.onItemCollapseToggled.next();
|
this._fuseNavigationService.onItemCollapseToggled.next();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -133,9 +177,9 @@ export class FuseNavVerticalCollapseComponent implements OnInit
|
|||||||
*
|
*
|
||||||
* @param parent
|
* @param parent
|
||||||
* @param item
|
* @param item
|
||||||
* @return {any}
|
* @returns {boolean}
|
||||||
*/
|
*/
|
||||||
isChildrenOf(parent, item)
|
isChildrenOf(parent, item): boolean
|
||||||
{
|
{
|
||||||
if ( !parent.children )
|
if ( !parent.children )
|
||||||
{
|
{
|
||||||
@@ -162,9 +206,9 @@ export class FuseNavVerticalCollapseComponent implements OnInit
|
|||||||
*
|
*
|
||||||
* @param parent
|
* @param parent
|
||||||
* @param url
|
* @param url
|
||||||
* @returns {any}
|
* @returns {boolean}
|
||||||
*/
|
*/
|
||||||
isUrlInChildren(parent, url)
|
isUrlInChildren(parent, url): boolean
|
||||||
{
|
{
|
||||||
if ( !parent.children )
|
if ( !parent.children )
|
||||||
{
|
{
|
||||||
@@ -1,13 +1,14 @@
|
|||||||
<ng-container *ngIf="!item.hidden">
|
<ng-container *ngIf="!item.hidden">
|
||||||
|
|
||||||
<div class="group-title">
|
<div class="group-title" [ngClass]="item.classes">
|
||||||
<span class="hint-text" [translate]="item.translate">{{ item.title }}</span>
|
<span class="hint-text" [translate]="item.translate">{{ item.title }}</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="group-items">
|
<div class="group-items">
|
||||||
<ng-container *ngFor="let item of item.children">
|
<ng-container *ngFor="let item of item.children">
|
||||||
<fuse-nav-vertical-group *ngIf="item.type=='group'" [item]="item"></fuse-nav-vertical-group>
|
<fuse-nav-vertical-group *ngIf="item.type=='group'" [item]="item"></fuse-nav-vertical-group>
|
||||||
<fuse-nav-vertical-collapse *ngIf="item.type=='collapse'" [item]="item"></fuse-nav-vertical-collapse>
|
<fuse-nav-vertical-collapsable *ngIf="item.type=='collapsable'"
|
||||||
|
[item]="item"></fuse-nav-vertical-collapsable>
|
||||||
<fuse-nav-vertical-item *ngIf="item.type=='item'" [item]="item"></fuse-nav-vertical-item>
|
<fuse-nav-vertical-item *ngIf="item.type=='item'" [item]="item"></fuse-nav-vertical-item>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
</div>
|
</div>
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
import { Component, HostBinding, Input } from '@angular/core';
|
||||||
|
|
||||||
|
import { FuseNavigationItem } from '@fuse/types';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector : 'fuse-nav-vertical-group',
|
||||||
|
templateUrl: './group.component.html',
|
||||||
|
styleUrls : ['./group.component.scss']
|
||||||
|
})
|
||||||
|
export class FuseNavVerticalGroupComponent
|
||||||
|
{
|
||||||
|
@HostBinding('class')
|
||||||
|
classes = 'nav-group nav-item';
|
||||||
|
|
||||||
|
@Input()
|
||||||
|
item: FuseNavigationItem;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor
|
||||||
|
*/
|
||||||
|
constructor()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,48 @@
|
|||||||
|
<ng-container *ngIf="!item.hidden">
|
||||||
|
|
||||||
|
<!-- item.url -->
|
||||||
|
<a class="nav-link" [ngClass]="item.classes" *ngIf="item.url && !item.externalUrl && !item.function"
|
||||||
|
[routerLink]="[item.url]" [routerLinkActive]="['active', 'mat-accent-bg']"
|
||||||
|
[routerLinkActiveOptions]="{exact: item.exactMatch || false}"
|
||||||
|
[target]="item.openInNewTab ? '_blank' : '_self'" matRipple>
|
||||||
|
<ng-container *ngTemplateOutlet="itemContent"></ng-container>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
<!-- item.externalUrl -->
|
||||||
|
<a class="nav-link" [ngClass]="item.classes" *ngIf="item.url && item.externalUrl && !item.function"
|
||||||
|
[href]="item.url" [target]="item.openInNewTab ? '_blank' : '_self'" matRipple>
|
||||||
|
<ng-container *ngTemplateOutlet="itemContent"></ng-container>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
<!-- item.function -->
|
||||||
|
<span class="nav-link" [ngClass]="item.classes" *ngIf="!item.url && item.function"
|
||||||
|
(click)="item.function()" matRipple>
|
||||||
|
<ng-container *ngTemplateOutlet="itemContent"></ng-container>
|
||||||
|
</span>
|
||||||
|
|
||||||
|
<!-- item.url && item.function -->
|
||||||
|
<a class="nav-link" [ngClass]="item.classes" *ngIf="item.url && !item.externalUrl && item.function"
|
||||||
|
(click)="item.function()"
|
||||||
|
[routerLink]="[item.url]" [routerLinkActive]="['active', 'mat-accent-bg']"
|
||||||
|
[routerLinkActiveOptions]="{exact: item.exactMatch || false}"
|
||||||
|
[target]="item.openInNewTab ? '_blank' : '_self'" matRipple>
|
||||||
|
<ng-container *ngTemplateOutlet="itemContent"></ng-container>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
<!-- item.externalUrl && item.function -->
|
||||||
|
<a class="nav-link" [ngClass]="item.classes" *ngIf="item.url && item.externalUrl && item.function"
|
||||||
|
(click)="item.function()"
|
||||||
|
[href]="item.url" [target]="item.openInNewTab ? '_blank' : '_self'" matRipple>
|
||||||
|
<ng-container *ngTemplateOutlet="itemContent"></ng-container>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
<ng-template #itemContent>
|
||||||
|
<mat-icon class="nav-link-icon" *ngIf="item.icon">{{item.icon}}</mat-icon>
|
||||||
|
<span class="nav-link-title" [translate]="item.translate">{{item.title}}</span>
|
||||||
|
<span class="nav-link-badge" *ngIf="item.badge" [translate]="item.badge.translate"
|
||||||
|
[ngStyle]="{'background-color': item.badge.bg,'color': item.badge.fg}">
|
||||||
|
{{item.badge.title}}
|
||||||
|
</span>
|
||||||
|
</ng-template>
|
||||||
|
|
||||||
|
</ng-container>
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
import { Component, HostBinding, Input } from '@angular/core';
|
||||||
|
|
||||||
|
import { FuseNavigationItem } from '@fuse/types';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector : 'fuse-nav-vertical-item',
|
||||||
|
templateUrl: './item.component.html',
|
||||||
|
styleUrls : ['./item.component.scss']
|
||||||
|
})
|
||||||
|
export class FuseNavVerticalItemComponent
|
||||||
|
{
|
||||||
|
@HostBinding('class')
|
||||||
|
classes = 'nav-item';
|
||||||
|
|
||||||
|
@Input()
|
||||||
|
item: FuseNavigationItem;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor
|
||||||
|
*/
|
||||||
|
constructor()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
<ng-container *ngIf="!item.hidden">
|
|
||||||
|
|
||||||
<a class="nav-link" matRipple (click)="toggleOpen($event)">
|
|
||||||
<mat-icon class="nav-link-icon" *ngIf="item.icon">{{item.icon}}</mat-icon>
|
|
||||||
<span class="nav-link-title" [translate]="item.translate">{{item.title}}</span>
|
|
||||||
<span class="nav-link-badge" *ngIf="item.badge" [translate]="item.badge.translate"
|
|
||||||
[ngStyle]="{'background-color': item.badge.bg,'color': item.badge.fg}">
|
|
||||||
{{item.badge.title}}
|
|
||||||
</span>
|
|
||||||
<mat-icon class="collapse-arrow">keyboard_arrow_right</mat-icon>
|
|
||||||
</a>
|
|
||||||
|
|
||||||
<div class="children" [@slideInOut]="isOpen">
|
|
||||||
<ng-container *ngFor="let item of item.children">
|
|
||||||
<fuse-nav-vertical-item *ngIf="item.type=='item'" [item]="item"></fuse-nav-vertical-item>
|
|
||||||
<fuse-nav-vertical-collapse *ngIf="item.type=='collapse'" [item]="item"></fuse-nav-vertical-collapse>
|
|
||||||
<fuse-nav-vertical-group *ngIf="item.type=='group'" [item]="item"></fuse-nav-vertical-group>
|
|
||||||
</ng-container>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</ng-container>
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
import { Component, HostBinding, Input } from '@angular/core';
|
|
||||||
|
|
||||||
@Component({
|
|
||||||
selector : 'fuse-nav-vertical-group',
|
|
||||||
templateUrl: './nav-vertical-group.component.html',
|
|
||||||
styleUrls : ['./nav-vertical-group.component.scss']
|
|
||||||
})
|
|
||||||
export class FuseNavVerticalGroupComponent
|
|
||||||
{
|
|
||||||
@HostBinding('class') classes = 'nav-group nav-item';
|
|
||||||
@Input() item: any;
|
|
||||||
|
|
||||||
constructor()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
<ng-container *ngIf="!item.hidden">
|
|
||||||
|
|
||||||
<a class="nav-link" *ngIf="item.url" [routerLink]="[item.url]" routerLinkActive="active"
|
|
||||||
[routerLinkActiveOptions]="{exact: item.exactMatch || false}" matRipple>
|
|
||||||
<mat-icon class="nav-link-icon" *ngIf="item.icon">{{item.icon}}</mat-icon>
|
|
||||||
<span class="nav-link-title" [translate]="item.translate">{{item.title}}</span>
|
|
||||||
<span class="nav-link-badge" *ngIf="item.badge" [translate]="item.badge.translate"
|
|
||||||
[ngStyle]="{'background-color': item.badge.bg,'color': item.badge.fg}">
|
|
||||||
{{item.badge.title}}
|
|
||||||
</span>
|
|
||||||
</a>
|
|
||||||
|
|
||||||
<span class="nav-link" *ngIf="item.function" (click)="item.function()" matRipple>
|
|
||||||
<mat-icon class="nav-link-icon" *ngIf="item.icon">{{item.icon}}</mat-icon>
|
|
||||||
<span class="nav-link-title" [translate]="item.translate">{{item.title}}</span>
|
|
||||||
<span class="nav-link-badge" *ngIf="item.badge" [translate]="item.badge.translate"
|
|
||||||
[ngStyle]="{'background-color': item.badge.bg,'color': item.badge.fg}">
|
|
||||||
{{item.badge.title}}
|
|
||||||
</span>
|
|
||||||
</span>
|
|
||||||
|
|
||||||
</ng-container>
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
import { Component, HostBinding, Input } from '@angular/core';
|
|
||||||
|
|
||||||
@Component({
|
|
||||||
selector : 'fuse-nav-vertical-item',
|
|
||||||
templateUrl: './nav-vertical-item.component.html',
|
|
||||||
styleUrls : ['./nav-vertical-item.component.scss']
|
|
||||||
})
|
|
||||||
export class FuseNavVerticalItemComponent
|
|
||||||
{
|
|
||||||
@HostBinding('class') classes = 'nav-item';
|
|
||||||
@Input() item: any;
|
|
||||||
|
|
||||||
constructor()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,21 +1,25 @@
|
|||||||
<div class="fuse-search-bar" [ngClass]="{'expanded':!collapsed}" fxFlex="0 1 auto">
|
<div class="fuse-search-bar" [ngClass]="{'expanded':!collapsed}">
|
||||||
<div [ngClass]="toolbarColor" fxLayout="row" fxLayoutAlign="start center" fxFlex>
|
|
||||||
|
<div class="fuse-search-bar-content" [ngClass]="fuseConfig.layout.toolbar.background">
|
||||||
|
|
||||||
<label for="fuse-search-bar-input">
|
<label for="fuse-search-bar-input">
|
||||||
<button mat-icon-button class="fuse-search-bar-expander" aria-label="Expand Search Bar" (click)="expand()"
|
<button mat-icon-button class="fuse-search-bar-expander" aria-label="Expand Search Bar" (click)="expand()"
|
||||||
*ngIf="collapsed">
|
*ngIf="collapsed">
|
||||||
<mat-icon class="s-24">search</mat-icon>
|
<mat-icon class="s-24 secondary-text">search</mat-icon>
|
||||||
</button>
|
</button>
|
||||||
<!--<span class="fuse-search-bar-loader" fxLayout="row" fxLayoutAlign="center center" *ngIf="!collapsed">
|
<!--<span class="fuse-search-bar-loader" fxLayout="row" fxLayoutAlign="center center" *ngIf="!collapsed">
|
||||||
<mat-progress-spinner color="mat-accent" mode="indeterminate"></mat-progress-spinner>
|
<mat-progress-spinner color="mat-accent" mode="indeterminate"></mat-progress-spinner>
|
||||||
</span>-->
|
</span>-->
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
<input id="fuse-search-bar-input" class="ml-24" type="text" placeholder="Search" (input)="search($event)" fxFlex>
|
<input id="fuse-search-bar-input" class="ml-24" type="text" placeholder="Search" (input)="search($event)"
|
||||||
|
fxFlex>
|
||||||
|
|
||||||
<button mat-icon-button class="fuse-search-bar-collapser mat-icon-button" (click)="collapse()"
|
<button mat-icon-button class="fuse-search-bar-collapser" (click)="collapse()"
|
||||||
aria-label="Collapse Search Bar">
|
aria-label="Collapse Search Bar">
|
||||||
<mat-icon class="s-24">close</mat-icon>
|
<mat-icon class="s-24 secondary-text">close</mat-icon>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
@@ -3,48 +3,59 @@
|
|||||||
:host {
|
:host {
|
||||||
|
|
||||||
.fuse-search-bar {
|
.fuse-search-bar {
|
||||||
|
display: flex;
|
||||||
|
flex: 0 1 auto;
|
||||||
min-width: 64px;
|
min-width: 64px;
|
||||||
height: 64px;
|
height: 64px;
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
|
|
||||||
@include media-breakpoint-down('sm') {
|
@include media-breakpoint-down('xs') {
|
||||||
height: 56px;
|
height: 56px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.fuse-search-bar-expander,
|
.fuse-search-bar-content {
|
||||||
.fuse-search-bar-collapser {
|
display: flex;
|
||||||
cursor: pointer;
|
flex: 1 1 auto;
|
||||||
padding: 0 20px;
|
align-items: center;
|
||||||
margin: 0;
|
justify-content: flex-start;
|
||||||
width: 64px !important;
|
|
||||||
height: 64px !important;
|
|
||||||
line-height: 64px !important;
|
|
||||||
|
|
||||||
@include media-breakpoint-down('sm') {
|
.fuse-search-bar-expander,
|
||||||
height: 56px !important;
|
.fuse-search-bar-collapser {
|
||||||
line-height: 56px !important;
|
cursor: pointer;
|
||||||
|
padding: 0 20px;
|
||||||
|
margin: 0;
|
||||||
|
width: 64px !important;
|
||||||
|
height: 64px !important;
|
||||||
|
line-height: 64px !important;
|
||||||
|
|
||||||
|
@include media-breakpoint-down('xs') {
|
||||||
|
height: 56px !important;
|
||||||
|
line-height: 56px !important;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
.fuse-search-bar-loader {
|
.fuse-search-bar-loader {
|
||||||
width: 64px !important;
|
width: 64px !important;
|
||||||
height: 64px !important;
|
height: 64px !important;
|
||||||
line-height: 64px !important;
|
line-height: 64px !important;
|
||||||
@include media-breakpoint-down('sm') {
|
|
||||||
height: 56px !important;
|
@include media-breakpoint-down('xs') {
|
||||||
line-height: 56px !important;
|
height: 56px !important;
|
||||||
|
line-height: 56px !important;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
.fuse-search-bar-collapser {
|
.fuse-search-bar-collapser {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
#fuse-search-bar-input {
|
#fuse-search-bar-input {
|
||||||
display: none;
|
display: none;
|
||||||
min-height: 64px;
|
flex: 1 0 auto;
|
||||||
background-color: transparent;
|
min-height: 64px;
|
||||||
font-size: 16px;
|
background-color: transparent;
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&.expanded {
|
&.expanded {
|
||||||
@@ -55,12 +66,15 @@
|
|||||||
left: 0;
|
left: 0;
|
||||||
z-index: 10;
|
z-index: 10;
|
||||||
|
|
||||||
#fuse-search-bar-input {
|
.fuse-search-bar-content {
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
|
|
||||||
.fuse-search-bar-collapser {
|
#fuse-search-bar-input {
|
||||||
display: block;
|
display: flex;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fuse-search-bar-collapser {
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import { Component, EventEmitter, Output } from '@angular/core';
|
import { Component, EventEmitter, OnDestroy, OnInit, Output } from '@angular/core';
|
||||||
import { Subscription } from 'rxjs/Subscription';
|
import { Subject } from 'rxjs';
|
||||||
|
import { takeUntil } from 'rxjs/operators';
|
||||||
|
|
||||||
import { FuseConfigService } from '@fuse/services/config.service';
|
import { FuseConfigService } from '@fuse/services/config.service';
|
||||||
|
|
||||||
@@ -8,42 +9,91 @@ import { FuseConfigService } from '@fuse/services/config.service';
|
|||||||
templateUrl: './search-bar.component.html',
|
templateUrl: './search-bar.component.html',
|
||||||
styleUrls : ['./search-bar.component.scss']
|
styleUrls : ['./search-bar.component.scss']
|
||||||
})
|
})
|
||||||
export class FuseSearchBarComponent
|
export class FuseSearchBarComponent implements OnInit, OnDestroy
|
||||||
{
|
{
|
||||||
collapsed: boolean;
|
collapsed: boolean;
|
||||||
toolbarColor: string;
|
fuseConfig: any;
|
||||||
@Output() onInput: EventEmitter<any> = new EventEmitter();
|
|
||||||
onConfigChanged: Subscription;
|
|
||||||
|
|
||||||
|
@Output()
|
||||||
|
input: EventEmitter<any>;
|
||||||
|
|
||||||
|
// Private
|
||||||
|
private _unsubscribeAll: Subject<any>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor
|
||||||
|
*
|
||||||
|
* @param {FuseConfigService} _fuseConfigService
|
||||||
|
*/
|
||||||
constructor(
|
constructor(
|
||||||
private fuseConfig: FuseConfigService
|
private _fuseConfigService: FuseConfigService
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
// Set the defaults
|
||||||
|
this.input = new EventEmitter();
|
||||||
this.collapsed = true;
|
this.collapsed = true;
|
||||||
this.onConfigChanged =
|
|
||||||
this.fuseConfig.onConfigChanged
|
// Set the private defaults
|
||||||
.subscribe(
|
this._unsubscribeAll = new Subject();
|
||||||
(newSettings) => {
|
|
||||||
this.toolbarColor = newSettings.colorClasses.toolbar;
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
collapse()
|
// -----------------------------------------------------------------------------------------------------
|
||||||
|
// @ Lifecycle hooks
|
||||||
|
// -----------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
/**
|
||||||
|
* On init
|
||||||
|
*/
|
||||||
|
ngOnInit(): void
|
||||||
|
{
|
||||||
|
// Subscribe to config changes
|
||||||
|
this._fuseConfigService.config
|
||||||
|
.pipe(takeUntil(this._unsubscribeAll))
|
||||||
|
.subscribe(
|
||||||
|
(config) => {
|
||||||
|
this.fuseConfig = config;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* On destroy
|
||||||
|
*/
|
||||||
|
ngOnDestroy(): void
|
||||||
|
{
|
||||||
|
// Unsubscribe from all subscriptions
|
||||||
|
this._unsubscribeAll.next();
|
||||||
|
this._unsubscribeAll.complete();
|
||||||
|
}
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------------------------------
|
||||||
|
// @ Public methods
|
||||||
|
// -----------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Collapse
|
||||||
|
*/
|
||||||
|
collapse(): void
|
||||||
{
|
{
|
||||||
this.collapsed = true;
|
this.collapsed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
expand()
|
/**
|
||||||
|
* Expand
|
||||||
|
*/
|
||||||
|
expand(): void
|
||||||
{
|
{
|
||||||
this.collapsed = false;
|
this.collapsed = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
search(event)
|
/**
|
||||||
|
* Search
|
||||||
|
*
|
||||||
|
* @param event
|
||||||
|
*/
|
||||||
|
search(event): void
|
||||||
{
|
{
|
||||||
const value = event.target.value;
|
this.input.emit(event.target.value);
|
||||||
|
|
||||||
this.onInput.emit(value);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="shortcuts" fxHide fxShow.gt-sm [ngClass]="toolbarColor">
|
<div class="shortcuts" fxHide fxShow.gt-sm>
|
||||||
|
|
||||||
<div fxLayout="row" fxLayoutAlign="space-between center" fxFlex="0 1 auto">
|
<div fxLayout="row" fxLayoutAlign="space-between center" fxFlex="0 1 auto">
|
||||||
|
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
*ngFor="let shortcutItem of shortcutItems">
|
*ngFor="let shortcutItem of shortcutItems">
|
||||||
|
|
||||||
<a mat-icon-button matTooltip="{{shortcutItem.title}}" [routerLink]="shortcutItem.url">
|
<a mat-icon-button matTooltip="{{shortcutItem.title}}" [routerLink]="shortcutItem.url">
|
||||||
<mat-icon *ngIf="shortcutItem.icon">{{shortcutItem.icon}}</mat-icon>
|
<mat-icon class="secondary-text" *ngIf="shortcutItem.icon">{{shortcutItem.icon}}</mat-icon>
|
||||||
<span *ngIf="!shortcutItem.icon" class="h2 secondary-text text-bold">
|
<span *ngIf="!shortcutItem.icon" class="h2 secondary-text text-bold">
|
||||||
{{shortcutItem.title.substr(0, 1).toUpperCase()}}
|
{{shortcutItem.title.substr(0, 1).toUpperCase()}}
|
||||||
</span>
|
</span>
|
||||||
@@ -42,46 +42,70 @@
|
|||||||
|
|
||||||
<mat-menu #addMenu="matMenu" class="w-240">
|
<mat-menu #addMenu="matMenu" class="w-240">
|
||||||
|
|
||||||
<mat-form-field class="px-16 w-100-p" (click)="$event.stopPropagation()" floatPlaceholder="never">
|
<mat-form-field class="px-16 w-100-p" (click)="$event.stopPropagation()" floatLabel="never">
|
||||||
<input #searchInput matInput placeholder="Search for an app or a page" (input)="search($event)">
|
<input #searchInput matInput placeholder="Search for an app or a page" (input)="search($event)">
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
|
|
||||||
<mat-divider></mat-divider>
|
<mat-divider></mat-divider>
|
||||||
|
|
||||||
<mat-nav-list *ngIf="!searching" style="max-height: 312px; overflow: auto" fusePerfectScrollbar>
|
<mat-nav-list *ngIf="!searching" style="max-height: 312px; overflow: auto" fusePerfectScrollbar>
|
||||||
|
|
||||||
<mat-list-item *ngFor="let shortcutItem of shortcutItems"
|
<mat-list-item *ngFor="let shortcutItem of shortcutItems"
|
||||||
(click)="toggleShortcut($event, shortcutItem)">
|
(click)="toggleShortcut($event, shortcutItem)">
|
||||||
|
|
||||||
<div class="w-100-p" fxLayout="row" fxLayoutAlign="start center">
|
<div class="w-100-p" fxLayout="row" fxLayoutAlign="start center">
|
||||||
<mat-icon mat-list-icon class="mr-8" *ngIf="shortcutItem.icon">{{shortcutItem.icon}}</mat-icon>
|
|
||||||
|
<mat-icon mat-list-icon class="mr-8 secondary-text" *ngIf="shortcutItem.icon">
|
||||||
|
{{shortcutItem.icon}}
|
||||||
|
</mat-icon>
|
||||||
|
|
||||||
<span class="h2 w-32 h-32 p-4 mr-8 secondary-text text-bold" fxLayout="row"
|
<span class="h2 w-32 h-32 p-4 mr-8 secondary-text text-bold" fxLayout="row"
|
||||||
fxLayoutAlign="center center" *ngIf="!shortcutItem.icon">
|
fxLayoutAlign="center center" *ngIf="!shortcutItem.icon">
|
||||||
{{shortcutItem.title.substr(0, 1).toUpperCase()}}
|
{{shortcutItem.title.substr(0, 1).toUpperCase()}}
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
<p matLine fxFlex>{{shortcutItem.title}}</p>
|
<p matLine fxFlex>{{shortcutItem.title}}</p>
|
||||||
<mat-icon class="ml-8">star</mat-icon>
|
|
||||||
|
<mat-icon class="ml-8 amber-fg">star</mat-icon>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</mat-list-item>
|
</mat-list-item>
|
||||||
|
|
||||||
<mat-list-item *ngIf="shortcutItems.length === 0">
|
<mat-list-item *ngIf="shortcutItems.length === 0">
|
||||||
<p>
|
<p>
|
||||||
<small>No shortcuts yet!</small>
|
<small>No shortcuts yet!</small>
|
||||||
</p>
|
</p>
|
||||||
</mat-list-item>
|
</mat-list-item>
|
||||||
|
|
||||||
</mat-nav-list>
|
</mat-nav-list>
|
||||||
|
|
||||||
<mat-nav-list *ngIf="searching" style="max-height: 312px; overflow: auto" fusePerfectScrollbar>
|
<mat-nav-list *ngIf="searching" style="max-height: 312px; overflow: auto" fusePerfectScrollbar>
|
||||||
|
|
||||||
<mat-list-item *ngFor="let navigationItem of filteredNavigationItems"
|
<mat-list-item *ngFor="let navigationItem of filteredNavigationItems"
|
||||||
(click)="toggleShortcut($event, navigationItem)">
|
(click)="toggleShortcut($event, navigationItem)">
|
||||||
|
|
||||||
<div class="w-100-p" fxLayout="row" fxLayoutAlign="start center">
|
<div class="w-100-p" fxLayout="row" fxLayoutAlign="start center">
|
||||||
<mat-icon mat-list-icon class="mr-8" *ngIf="navigationItem.icon">{{navigationItem.icon}}</mat-icon>
|
|
||||||
|
<mat-icon mat-list-icon class="mr-8 secondary-text" *ngIf="navigationItem.icon">
|
||||||
|
{{navigationItem.icon}}
|
||||||
|
</mat-icon>
|
||||||
|
|
||||||
<span class="h2 w-32 h-32 p-4 mr-8 secondary-text text-bold" fxLayout="row"
|
<span class="h2 w-32 h-32 p-4 mr-8 secondary-text text-bold" fxLayout="row"
|
||||||
fxLayoutAlign="center center" *ngIf="!navigationItem.icon">
|
fxLayoutAlign="center center" *ngIf="!navigationItem.icon">
|
||||||
{{navigationItem.title.substr(0, 1).toUpperCase()}}
|
{{navigationItem.title.substr(0, 1).toUpperCase()}}
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
<p matLine fxFlex>{{navigationItem.title}}</p>
|
<p matLine fxFlex>{{navigationItem.title}}</p>
|
||||||
<mat-icon class="ml-8" *ngIf="isInShortcuts(navigationItem)">star</mat-icon>
|
|
||||||
|
<mat-icon class="ml-8 amber-fg" *ngIf="isInShortcuts(navigationItem)">star</mat-icon>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</mat-list-item>
|
</mat-list-item>
|
||||||
|
|
||||||
</mat-nav-list>
|
</mat-nav-list>
|
||||||
|
|
||||||
</mat-menu>
|
</mat-menu>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,13 +1,11 @@
|
|||||||
import { Component, ElementRef, OnDestroy, OnInit, Renderer2, ViewChild } from '@angular/core';
|
import { Component, ElementRef, Input, OnDestroy, OnInit, Renderer2, ViewChild } from '@angular/core';
|
||||||
import { Subscription } from 'rxjs/Subscription';
|
|
||||||
import { ObservableMedia } from '@angular/flex-layout';
|
import { ObservableMedia } from '@angular/flex-layout';
|
||||||
import { CookieService } from 'ngx-cookie-service';
|
import { CookieService } from 'ngx-cookie-service';
|
||||||
|
import { Subject } from 'rxjs';
|
||||||
|
import { takeUntil } from 'rxjs/operators';
|
||||||
|
|
||||||
import { FuseMatchMediaService } from '@fuse/services/match-media.service';
|
import { FuseMatchMediaService } from '@fuse/services/match-media.service';
|
||||||
import { FuseNavigationService } from '@fuse/components/navigation/navigation.service';
|
import { FuseNavigationService } from '@fuse/components/navigation/navigation.service';
|
||||||
import { FuseConfigService } from '@fuse/services/config.service';
|
|
||||||
|
|
||||||
import { navigation } from 'app/navigation/navigation';
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector : 'fuse-shortcuts',
|
selector : 'fuse-shortcuts',
|
||||||
@@ -16,45 +14,67 @@ import { navigation } from 'app/navigation/navigation';
|
|||||||
})
|
})
|
||||||
export class FuseShortcutsComponent implements OnInit, OnDestroy
|
export class FuseShortcutsComponent implements OnInit, OnDestroy
|
||||||
{
|
{
|
||||||
shortcutItems: any[] = [];
|
shortcutItems: any[];
|
||||||
navigationItems: any[];
|
navigationItems: any[];
|
||||||
filteredNavigationItems: any[];
|
filteredNavigationItems: any[];
|
||||||
searching = false;
|
searching: boolean;
|
||||||
mobileShortcutsPanelActive = false;
|
mobileShortcutsPanelActive: boolean;
|
||||||
toolbarColor: string;
|
|
||||||
matchMediaSubscription: Subscription;
|
|
||||||
onConfigChanged: Subscription;
|
|
||||||
|
|
||||||
@ViewChild('searchInput') searchInputField;
|
@Input()
|
||||||
@ViewChild('shortcuts') shortcutsEl: ElementRef;
|
navigation: any;
|
||||||
|
|
||||||
|
@ViewChild('searchInput')
|
||||||
|
searchInputField;
|
||||||
|
|
||||||
|
@ViewChild('shortcuts')
|
||||||
|
shortcutsEl: ElementRef;
|
||||||
|
|
||||||
|
// Private
|
||||||
|
private _unsubscribeAll: Subject<any>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor
|
||||||
|
*
|
||||||
|
* @param {Renderer2} _renderer
|
||||||
|
* @param {CookieService} _cookieService
|
||||||
|
* @param {FuseMatchMediaService} _fuseMatchMediaService
|
||||||
|
* @param {FuseNavigationService} _fuseNavigationService
|
||||||
|
* @param {ObservableMedia} _observableMedia
|
||||||
|
*/
|
||||||
constructor(
|
constructor(
|
||||||
private renderer: Renderer2,
|
private _cookieService: CookieService,
|
||||||
private observableMedia: ObservableMedia,
|
private _fuseMatchMediaService: FuseMatchMediaService,
|
||||||
private fuseMatchMedia: FuseMatchMediaService,
|
private _fuseNavigationService: FuseNavigationService,
|
||||||
private fuseNavigationService: FuseNavigationService,
|
private _observableMedia: ObservableMedia,
|
||||||
private fuseConfig: FuseConfigService,
|
private _renderer: Renderer2
|
||||||
private cookieService: CookieService
|
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
this.filteredNavigationItems = this.navigationItems = this.fuseNavigationService.getFlatNavigation(navigation);
|
// Set the defaults
|
||||||
|
this.shortcutItems = [];
|
||||||
|
this.searching = false;
|
||||||
|
this.mobileShortcutsPanelActive = false;
|
||||||
|
|
||||||
this.onConfigChanged =
|
// Set the private defaults
|
||||||
this.fuseConfig.onConfigChanged
|
this._unsubscribeAll = new Subject();
|
||||||
.subscribe(
|
|
||||||
(newSettings) => {
|
|
||||||
this.toolbarColor = newSettings.colorClasses.toolbar;
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit()
|
// -----------------------------------------------------------------------------------------------------
|
||||||
|
// @ Lifecycle hooks
|
||||||
|
// -----------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
/**
|
||||||
|
* On init
|
||||||
|
*/
|
||||||
|
ngOnInit(): void
|
||||||
{
|
{
|
||||||
const cookieExists = this.cookieService.check('FUSE2.shortcuts');
|
// Get the navigation items and flatten them
|
||||||
|
this.filteredNavigationItems = this.navigationItems = this._fuseNavigationService.getFlatNavigation(this.navigation);
|
||||||
|
|
||||||
|
const cookieExists = this._cookieService.check('FUSE2.shortcuts');
|
||||||
|
|
||||||
if ( cookieExists )
|
if ( cookieExists )
|
||||||
{
|
{
|
||||||
this.shortcutItems = JSON.parse(this.cookieService.get('FUSE2.shortcuts'));
|
this.shortcutItems = JSON.parse(this._cookieService.get('FUSE2.shortcuts'));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -62,46 +82,61 @@ export class FuseShortcutsComponent implements OnInit, OnDestroy
|
|||||||
this.shortcutItems = [
|
this.shortcutItems = [
|
||||||
{
|
{
|
||||||
'title': 'Calendar',
|
'title': 'Calendar',
|
||||||
'type' : 'nav-item',
|
'type' : 'item',
|
||||||
'icon' : 'today',
|
'icon' : 'today',
|
||||||
'url' : '/apps/calendar'
|
'url' : '/apps/calendar'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'title': 'Mail',
|
'title': 'Mail',
|
||||||
'type' : 'nav-item',
|
'type' : 'item',
|
||||||
'icon' : 'email',
|
'icon' : 'email',
|
||||||
'url' : '/apps/mail'
|
'url' : '/apps/mail'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'title': 'Contacts',
|
'title': 'Contacts',
|
||||||
'type' : 'nav-item',
|
'type' : 'item',
|
||||||
'icon' : 'account_box',
|
'icon' : 'account_box',
|
||||||
'url' : '/apps/contacts'
|
'url' : '/apps/contacts'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'title': 'To-Do',
|
'title': 'To-Do',
|
||||||
'type' : 'nav-item',
|
'type' : 'item',
|
||||||
'icon' : 'check_box',
|
'icon' : 'check_box',
|
||||||
'url' : '/apps/todo'
|
'url' : '/apps/todo'
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
this.matchMediaSubscription =
|
this._fuseMatchMediaService.onMediaChange
|
||||||
this.fuseMatchMedia.onMediaChange.subscribe(() => {
|
.pipe(takeUntil(this._unsubscribeAll))
|
||||||
if ( this.observableMedia.isActive('gt-sm') )
|
.subscribe(() => {
|
||||||
|
if ( this._observableMedia.isActive('gt-sm') )
|
||||||
{
|
{
|
||||||
this.hideMobileShortcutsPanel();
|
this.hideMobileShortcutsPanel();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnDestroy()
|
/**
|
||||||
|
* On destroy
|
||||||
|
*/
|
||||||
|
ngOnDestroy(): void
|
||||||
{
|
{
|
||||||
this.matchMediaSubscription.unsubscribe();
|
// Unsubscribe from all subscriptions
|
||||||
|
this._unsubscribeAll.next();
|
||||||
|
this._unsubscribeAll.complete();
|
||||||
}
|
}
|
||||||
|
|
||||||
search(event)
|
// -----------------------------------------------------------------------------------------------------
|
||||||
|
// @ Public methods
|
||||||
|
// -----------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Search
|
||||||
|
*
|
||||||
|
* @param event
|
||||||
|
*/
|
||||||
|
search(event): void
|
||||||
{
|
{
|
||||||
const value = event.target.value.toLowerCase();
|
const value = event.target.value.toLowerCase();
|
||||||
|
|
||||||
@@ -120,7 +155,13 @@ export class FuseShortcutsComponent implements OnInit, OnDestroy
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
toggleShortcut(event, itemToToggle)
|
/**
|
||||||
|
* Toggle shortcut
|
||||||
|
*
|
||||||
|
* @param event
|
||||||
|
* @param itemToToggle
|
||||||
|
*/
|
||||||
|
toggleShortcut(event, itemToToggle): void
|
||||||
{
|
{
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
|
|
||||||
@@ -131,7 +172,7 @@ export class FuseShortcutsComponent implements OnInit, OnDestroy
|
|||||||
this.shortcutItems.splice(i, 1);
|
this.shortcutItems.splice(i, 1);
|
||||||
|
|
||||||
// Save to the cookies
|
// Save to the cookies
|
||||||
this.cookieService.set('FUSE2.shortcuts', JSON.stringify(this.shortcutItems));
|
this._cookieService.set('FUSE2.shortcuts', JSON.stringify(this.shortcutItems));
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -140,32 +181,47 @@ export class FuseShortcutsComponent implements OnInit, OnDestroy
|
|||||||
this.shortcutItems.push(itemToToggle);
|
this.shortcutItems.push(itemToToggle);
|
||||||
|
|
||||||
// Save to the cookies
|
// Save to the cookies
|
||||||
this.cookieService.set('FUSE2.shortcuts', JSON.stringify(this.shortcutItems));
|
this._cookieService.set('FUSE2.shortcuts', JSON.stringify(this.shortcutItems));
|
||||||
}
|
}
|
||||||
|
|
||||||
isInShortcuts(navigationItem)
|
/**
|
||||||
|
* Is in shortcuts?
|
||||||
|
*
|
||||||
|
* @param navigationItem
|
||||||
|
* @returns {any}
|
||||||
|
*/
|
||||||
|
isInShortcuts(navigationItem): any
|
||||||
{
|
{
|
||||||
return this.shortcutItems.find(item => {
|
return this.shortcutItems.find(item => {
|
||||||
return item.url === navigationItem.url;
|
return item.url === navigationItem.url;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
onMenuOpen()
|
/**
|
||||||
|
* On menu open
|
||||||
|
*/
|
||||||
|
onMenuOpen(): void
|
||||||
{
|
{
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.searchInputField.nativeElement.focus();
|
this.searchInputField.nativeElement.focus();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
showMobileShortcutsPanel()
|
/**
|
||||||
|
* Show mobile shortcuts
|
||||||
|
*/
|
||||||
|
showMobileShortcutsPanel(): void
|
||||||
{
|
{
|
||||||
this.mobileShortcutsPanelActive = true;
|
this.mobileShortcutsPanelActive = true;
|
||||||
this.renderer.addClass(this.shortcutsEl.nativeElement, 'show-mobile-panel');
|
this._renderer.addClass(this.shortcutsEl.nativeElement, 'show-mobile-panel');
|
||||||
}
|
}
|
||||||
|
|
||||||
hideMobileShortcutsPanel()
|
/**
|
||||||
|
* Hide mobile shortcuts
|
||||||
|
*/
|
||||||
|
hideMobileShortcutsPanel(): void
|
||||||
{
|
{
|
||||||
this.mobileShortcutsPanelActive = false;
|
this.mobileShortcutsPanelActive = false;
|
||||||
this.renderer.removeClass(this.shortcutsEl.nativeElement, 'show-mobile-panel');
|
this._renderer.removeClass(this.shortcutsEl.nativeElement, 'show-mobile-panel');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
@import "src/@fuse/scss/fuse";
|
||||||
|
|
||||||
fuse-sidebar {
|
fuse-sidebar {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
@@ -5,22 +7,27 @@ fuse-sidebar {
|
|||||||
position: absolute;
|
position: absolute;
|
||||||
top: 0;
|
top: 0;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
overflow: hidden;
|
overflow-x: hidden;
|
||||||
|
overflow-y: auto;
|
||||||
width: 280px;
|
width: 280px;
|
||||||
min-width: 280px;
|
min-width: 280px;
|
||||||
max-width: 280px;
|
max-width: 280px;
|
||||||
z-index: 1000;
|
z-index: 1000;
|
||||||
transition-property: transform, width, min-width, max-width;
|
|
||||||
transition-duration: 150ms;
|
|
||||||
transition-timing-function: ease-in-out;
|
|
||||||
box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.35);
|
box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.35);
|
||||||
|
background: white;
|
||||||
|
|
||||||
&.left-aligned {
|
@include media-breakpoint-down('xs') {
|
||||||
|
min-width: 0 !important;
|
||||||
|
max-width: 80vw !important;
|
||||||
|
width: 80vw !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.left-positioned {
|
||||||
left: 0;
|
left: 0;
|
||||||
transform: translateX(-100%);
|
transform: translateX(-100%);
|
||||||
}
|
}
|
||||||
|
|
||||||
&.right-aligned {
|
&.right-positioned {
|
||||||
right: 0;
|
right: 0;
|
||||||
transform: translateX(100%);
|
transform: translateX(100%);
|
||||||
}
|
}
|
||||||
@@ -38,12 +45,12 @@ fuse-sidebar {
|
|||||||
position: absolute !important;
|
position: absolute !important;
|
||||||
top: 0;
|
top: 0;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
&:not(.unfolded) {
|
&.animations-enabled {
|
||||||
width: 64px;
|
transition-property: transform, width, min-width, max-width;
|
||||||
min-width: 64px;
|
transition-duration: 150ms;
|
||||||
max-width: 64px;
|
transition-timing-function: ease-in-out;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -53,7 +60,11 @@ fuse-sidebar {
|
|||||||
bottom: 0;
|
bottom: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
z-index: 3;
|
z-index: 999;
|
||||||
background-color: rgba(0, 0, 0, 0.6);
|
background-color: rgba(0, 0, 0, 0.6);
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
|
|
||||||
|
&.fuse-sidebar-overlay-invisible {
|
||||||
|
background-color: transparent;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,11 +1,12 @@
|
|||||||
import { Component, ElementRef, HostBinding, HostListener, Inject, Input, OnDestroy, OnInit, Renderer2, ViewEncapsulation } from '@angular/core';
|
import { ChangeDetectorRef, Component, ElementRef, EventEmitter, HostBinding, HostListener, Input, OnDestroy, OnInit, Output, Renderer2, RendererStyleFlags2, ViewEncapsulation } from '@angular/core';
|
||||||
import { animate, AnimationBuilder, AnimationPlayer, style } from '@angular/animations';
|
import { animate, AnimationBuilder, AnimationPlayer, style } from '@angular/animations';
|
||||||
import { ObservableMedia } from '@angular/flex-layout';
|
import { ObservableMedia } from '@angular/flex-layout';
|
||||||
import { Subscription } from 'rxjs/Subscription';
|
import { Subject } from 'rxjs';
|
||||||
|
import { takeUntil } from 'rxjs/operators';
|
||||||
|
|
||||||
import { FuseSidebarService } from './sidebar.service';
|
import { FuseSidebarService } from './sidebar.service';
|
||||||
import { FuseMatchMediaService } from '@fuse/services/match-media.service';
|
import { FuseMatchMediaService } from '@fuse/services/match-media.service';
|
||||||
import { DOCUMENT } from '@angular/common';
|
import { FuseConfigService } from '@fuse/services/config.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector : 'fuse-sidebar',
|
selector : 'fuse-sidebar',
|
||||||
@@ -19,9 +20,13 @@ export class FuseSidebarComponent implements OnInit, OnDestroy
|
|||||||
@Input()
|
@Input()
|
||||||
name: string;
|
name: string;
|
||||||
|
|
||||||
// Align
|
// Key
|
||||||
@Input()
|
@Input()
|
||||||
align: string;
|
key: string;
|
||||||
|
|
||||||
|
// Position
|
||||||
|
@Input()
|
||||||
|
position: 'left' | 'right';
|
||||||
|
|
||||||
// Open
|
// Open
|
||||||
@HostBinding('class.open')
|
@HostBinding('class.open')
|
||||||
@@ -35,79 +40,196 @@ export class FuseSidebarComponent implements OnInit, OnDestroy
|
|||||||
@HostBinding('class.locked-open')
|
@HostBinding('class.locked-open')
|
||||||
isLockedOpen: boolean;
|
isLockedOpen: boolean;
|
||||||
|
|
||||||
// Folded
|
// Folded width
|
||||||
@HostBinding('class.folded')
|
|
||||||
@Input()
|
@Input()
|
||||||
set folded(value)
|
foldedWidth: number;
|
||||||
{
|
|
||||||
this._folded = value;
|
|
||||||
|
|
||||||
if ( value )
|
// Folded auto trigger on hover
|
||||||
{
|
@Input()
|
||||||
this.fold();
|
foldedAutoTriggerOnHover: boolean;
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
this.unfold();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
get folded()
|
|
||||||
{
|
|
||||||
return this._folded;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Folded unfolded
|
// Folded unfolded
|
||||||
@HostBinding('class.unfolded')
|
@HostBinding('class.unfolded')
|
||||||
unfolded: boolean;
|
unfolded: boolean;
|
||||||
|
|
||||||
|
// Invisible overlay
|
||||||
|
@Input()
|
||||||
|
invisibleOverlay: boolean;
|
||||||
|
|
||||||
|
// Folded changed
|
||||||
|
@Output()
|
||||||
|
foldedChanged: EventEmitter<boolean>;
|
||||||
|
|
||||||
|
// Opened changed
|
||||||
|
@Output()
|
||||||
|
openedChanged: EventEmitter<boolean>;
|
||||||
|
|
||||||
// Private
|
// Private
|
||||||
private _folded = false;
|
private _folded: boolean;
|
||||||
|
private _fuseConfig: any;
|
||||||
private _wasActive: boolean;
|
private _wasActive: boolean;
|
||||||
|
private _wasFolded: boolean;
|
||||||
private _backdrop: HTMLElement | null = null;
|
private _backdrop: HTMLElement | null = null;
|
||||||
private _player: AnimationPlayer;
|
private _player: AnimationPlayer;
|
||||||
private _matchMediaWatcher: Subscription;
|
private _unsubscribeAll: Subject<any>;
|
||||||
|
|
||||||
|
@HostBinding('class.animations-enabled')
|
||||||
|
private _animationsEnabled: boolean;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @param renderer
|
* @param {AnimationBuilder} _animationBuilder
|
||||||
* @param elementRef
|
* @param {ChangeDetectorRef} _changeDetectorRef
|
||||||
* @param animationBuilder
|
* @param {ElementRef} _elementRef
|
||||||
* @param sidebarService
|
* @param {FuseConfigService} _fuseConfigService
|
||||||
* @param matchMedia
|
* @param {FuseMatchMediaService} _fuseMatchMediaService
|
||||||
* @param media
|
* @param {FuseSidebarService} _fuseSidebarService
|
||||||
* @param document
|
* @param {ObservableMedia} _observableMedia
|
||||||
|
* @param {Renderer2} _renderer
|
||||||
*/
|
*/
|
||||||
constructor(
|
constructor(
|
||||||
private renderer: Renderer2,
|
private _animationBuilder: AnimationBuilder,
|
||||||
private elementRef: ElementRef,
|
private _changeDetectorRef: ChangeDetectorRef,
|
||||||
private animationBuilder: AnimationBuilder,
|
private _elementRef: ElementRef,
|
||||||
private sidebarService: FuseSidebarService,
|
private _fuseConfigService: FuseConfigService,
|
||||||
private matchMedia: FuseMatchMediaService,
|
private _fuseMatchMediaService: FuseMatchMediaService,
|
||||||
private media: ObservableMedia,
|
private _fuseSidebarService: FuseSidebarService,
|
||||||
@Inject(DOCUMENT) private document: any
|
private _observableMedia: ObservableMedia,
|
||||||
|
private _renderer: Renderer2
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
// Set the defaults
|
// Set the defaults
|
||||||
|
this.foldedAutoTriggerOnHover = true;
|
||||||
|
this.foldedWidth = 64;
|
||||||
|
this.foldedChanged = new EventEmitter();
|
||||||
|
this.openedChanged = new EventEmitter();
|
||||||
this.opened = false;
|
this.opened = false;
|
||||||
this.folded = false;
|
this.position = 'left';
|
||||||
this.align = 'left';
|
this.invisibleOverlay = false;
|
||||||
|
|
||||||
|
// Set the private defaults
|
||||||
|
this._animationsEnabled = false;
|
||||||
|
this._folded = false;
|
||||||
|
this._unsubscribeAll = new Subject();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------------------------------
|
||||||
|
// @ Accessors
|
||||||
|
// -----------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Folded
|
||||||
|
*
|
||||||
|
* @param {boolean} value
|
||||||
|
*/
|
||||||
|
@Input()
|
||||||
|
set folded(value: boolean)
|
||||||
|
{
|
||||||
|
// Set the folded
|
||||||
|
this._folded = value;
|
||||||
|
|
||||||
|
// Return if the sidebar is closed
|
||||||
|
if ( !this.opened )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Programmatically add/remove padding to the element
|
||||||
|
// that comes after or before based on the position
|
||||||
|
let sibling,
|
||||||
|
styleRule;
|
||||||
|
|
||||||
|
const styleValue = this.foldedWidth + 'px';
|
||||||
|
|
||||||
|
// Get the sibling and set the style rule
|
||||||
|
if ( this.position === 'left' )
|
||||||
|
{
|
||||||
|
sibling = this._elementRef.nativeElement.nextElementSibling;
|
||||||
|
styleRule = 'padding-left';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
sibling = this._elementRef.nativeElement.previousElementSibling;
|
||||||
|
styleRule = 'padding-right';
|
||||||
|
}
|
||||||
|
|
||||||
|
// If there is no sibling, return...
|
||||||
|
if ( !sibling )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// If folded...
|
||||||
|
if ( value )
|
||||||
|
{
|
||||||
|
// Fold the sidebar
|
||||||
|
this.fold();
|
||||||
|
|
||||||
|
// Set the folded width
|
||||||
|
this._renderer.setStyle(this._elementRef.nativeElement, 'width', styleValue);
|
||||||
|
this._renderer.setStyle(this._elementRef.nativeElement, 'min-width', styleValue);
|
||||||
|
this._renderer.setStyle(this._elementRef.nativeElement, 'max-width', styleValue);
|
||||||
|
|
||||||
|
// Set the style and class
|
||||||
|
this._renderer.setStyle(sibling, styleRule, styleValue, RendererStyleFlags2.Important + RendererStyleFlags2.DashCase);
|
||||||
|
this._renderer.addClass(this._elementRef.nativeElement, 'folded');
|
||||||
|
}
|
||||||
|
// If unfolded...
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Unfold the sidebar
|
||||||
|
this.unfold();
|
||||||
|
|
||||||
|
// Remove the folded width
|
||||||
|
this._renderer.removeStyle(this._elementRef.nativeElement, 'width');
|
||||||
|
this._renderer.removeStyle(this._elementRef.nativeElement, 'min-width');
|
||||||
|
this._renderer.removeStyle(this._elementRef.nativeElement, 'max-width');
|
||||||
|
|
||||||
|
// Remove the style and class
|
||||||
|
this._renderer.removeStyle(sibling, styleRule);
|
||||||
|
this._renderer.removeClass(this._elementRef.nativeElement, 'folded');
|
||||||
|
}
|
||||||
|
|
||||||
|
// Emit the 'foldedChanged' event
|
||||||
|
this.foldedChanged.emit(this.folded);
|
||||||
|
}
|
||||||
|
|
||||||
|
get folded(): boolean
|
||||||
|
{
|
||||||
|
return this._folded;
|
||||||
|
}
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------------------------------
|
||||||
|
// @ Lifecycle hooks
|
||||||
|
// -----------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* On init
|
* On init
|
||||||
*/
|
*/
|
||||||
ngOnInit(): void
|
ngOnInit(): void
|
||||||
{
|
{
|
||||||
// Register the sidebar
|
// Subscribe to config changes
|
||||||
this.sidebarService.register(this.name, this);
|
this._fuseConfigService.config
|
||||||
|
.pipe(takeUntil(this._unsubscribeAll))
|
||||||
|
.subscribe((config) => {
|
||||||
|
this._fuseConfig = config;
|
||||||
|
});
|
||||||
|
|
||||||
// Setup alignment
|
// Register the sidebar
|
||||||
this._setupAlignment();
|
this._fuseSidebarService.register(this.name, this);
|
||||||
|
|
||||||
|
// Setup visibility
|
||||||
|
this._setupVisibility();
|
||||||
|
|
||||||
|
// Setup position
|
||||||
|
this._setupPosition();
|
||||||
|
|
||||||
// Setup lockedOpen
|
// Setup lockedOpen
|
||||||
this._setupLockedOpen();
|
this._setupLockedOpen();
|
||||||
|
|
||||||
|
// Setup folded
|
||||||
|
this._setupFolded();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -115,27 +237,54 @@ export class FuseSidebarComponent implements OnInit, OnDestroy
|
|||||||
*/
|
*/
|
||||||
ngOnDestroy(): void
|
ngOnDestroy(): void
|
||||||
{
|
{
|
||||||
// Unregister the sidebar
|
// If the sidebar is folded, unfold it to revert modifications
|
||||||
this.sidebarService.unregister(this.name);
|
if ( this.folded )
|
||||||
|
{
|
||||||
|
this.unfold();
|
||||||
|
}
|
||||||
|
|
||||||
// Unregister the media watcher
|
// Unregister the sidebar
|
||||||
this._matchMediaWatcher.unsubscribe();
|
this._fuseSidebarService.unregister(this.name);
|
||||||
|
|
||||||
|
// Unsubscribe from all subscriptions
|
||||||
|
this._unsubscribeAll.next();
|
||||||
|
this._unsubscribeAll.complete();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------------------------------
|
||||||
|
// @ Private methods
|
||||||
|
// -----------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Setup the alignment
|
* Setup the visibility of the sidebar
|
||||||
*
|
*
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
private _setupAlignment(): void
|
private _setupVisibility(): void
|
||||||
{
|
{
|
||||||
if ( this.align === 'left' )
|
// Remove the existing box-shadow
|
||||||
|
this._renderer.setStyle(this._elementRef.nativeElement, 'box-shadow', 'none');
|
||||||
|
|
||||||
|
// Make the sidebar invisible
|
||||||
|
this._renderer.setStyle(this._elementRef.nativeElement, 'visibility', 'hidden');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Setup the sidebar position
|
||||||
|
*
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
private _setupPosition(): void
|
||||||
|
{
|
||||||
|
// Add the correct class name to the sidebar
|
||||||
|
// element depending on the position attribute
|
||||||
|
if ( this.position === 'right' )
|
||||||
{
|
{
|
||||||
this.renderer.addClass(this.elementRef.nativeElement, 'left-aligned');
|
this._renderer.addClass(this._elementRef.nativeElement, 'right-positioned');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
this.renderer.addClass(this.elementRef.nativeElement, 'right-aligned');
|
this._renderer.addClass(this._elementRef.nativeElement, 'left-positioned');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -149,19 +298,26 @@ export class FuseSidebarComponent implements OnInit, OnDestroy
|
|||||||
// Return if the lockedOpen wasn't set
|
// Return if the lockedOpen wasn't set
|
||||||
if ( !this.lockedOpen )
|
if ( !this.lockedOpen )
|
||||||
{
|
{
|
||||||
|
// Return
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set the wasActive for the first time
|
// Set the wasActive for the first time
|
||||||
this._wasActive = false;
|
this._wasActive = false;
|
||||||
|
|
||||||
// Act on every media change
|
// Set the wasFolded
|
||||||
this._matchMediaWatcher =
|
this._wasFolded = this.folded;
|
||||||
|
|
||||||
this.matchMedia.onMediaChange.subscribe(() => {
|
// Show the sidebar
|
||||||
|
this._showSidebar();
|
||||||
|
|
||||||
|
// Act on every media change
|
||||||
|
this._fuseMatchMediaService.onMediaChange
|
||||||
|
.pipe(takeUntil(this._unsubscribeAll))
|
||||||
|
.subscribe(() => {
|
||||||
|
|
||||||
// Get the active status
|
// Get the active status
|
||||||
const isActive = this.media.isActive(this.lockedOpen);
|
const isActive = this._observableMedia.isActive(this.lockedOpen);
|
||||||
|
|
||||||
// If the both status are the same, don't act
|
// If the both status are the same, don't act
|
||||||
if ( this._wasActive === isActive )
|
if ( this._wasActive === isActive )
|
||||||
@@ -169,14 +325,36 @@ export class FuseSidebarComponent implements OnInit, OnDestroy
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Store the new active status
|
|
||||||
this._wasActive = isActive;
|
|
||||||
|
|
||||||
// Activate the lockedOpen
|
// Activate the lockedOpen
|
||||||
if ( isActive )
|
if ( isActive )
|
||||||
{
|
{
|
||||||
// Set the lockedOpen status
|
// Set the lockedOpen status
|
||||||
this.isLockedOpen = true;
|
this.isLockedOpen = true;
|
||||||
|
|
||||||
|
// Show the sidebar
|
||||||
|
this._showSidebar();
|
||||||
|
|
||||||
|
// Force the the opened status to true
|
||||||
|
this.opened = true;
|
||||||
|
|
||||||
|
// Emit the 'openedChanged' event
|
||||||
|
this.openedChanged.emit(this.opened);
|
||||||
|
|
||||||
|
// If the sidebar was folded, forcefully fold it again
|
||||||
|
if ( this._wasFolded )
|
||||||
|
{
|
||||||
|
// Enable the animations
|
||||||
|
this._enableAnimations();
|
||||||
|
|
||||||
|
// Fold
|
||||||
|
this.folded = true;
|
||||||
|
|
||||||
|
// Mark for check
|
||||||
|
this._changeDetectorRef.markForCheck();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Hide the backdrop if any exists
|
||||||
|
this._hideBackdrop();
|
||||||
}
|
}
|
||||||
// De-Activate the lockedOpen
|
// De-Activate the lockedOpen
|
||||||
else
|
else
|
||||||
@@ -186,10 +364,225 @@ export class FuseSidebarComponent implements OnInit, OnDestroy
|
|||||||
|
|
||||||
// Unfold the sidebar in case if it was folded
|
// Unfold the sidebar in case if it was folded
|
||||||
this.unfold();
|
this.unfold();
|
||||||
|
|
||||||
|
// Force the the opened status to close
|
||||||
|
this.opened = false;
|
||||||
|
|
||||||
|
// Emit the 'openedChanged' event
|
||||||
|
this.openedChanged.emit(this.opened);
|
||||||
|
|
||||||
|
// Hide the sidebar
|
||||||
|
this._hideSidebar();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Store the new active status
|
||||||
|
this._wasActive = isActive;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Setup the initial folded status
|
||||||
|
*
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
private _setupFolded(): void
|
||||||
|
{
|
||||||
|
// Return, if sidebar is not folded
|
||||||
|
if ( !this.folded )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Return if the sidebar is closed
|
||||||
|
if ( !this.opened )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Programmatically add/remove padding to the element
|
||||||
|
// that comes after or before based on the position
|
||||||
|
let sibling,
|
||||||
|
styleRule;
|
||||||
|
|
||||||
|
const styleValue = this.foldedWidth + 'px';
|
||||||
|
|
||||||
|
// Get the sibling and set the style rule
|
||||||
|
if ( this.position === 'left' )
|
||||||
|
{
|
||||||
|
sibling = this._elementRef.nativeElement.nextElementSibling;
|
||||||
|
styleRule = 'padding-left';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
sibling = this._elementRef.nativeElement.previousElementSibling;
|
||||||
|
styleRule = 'padding-right';
|
||||||
|
}
|
||||||
|
|
||||||
|
// If there is no sibling, return...
|
||||||
|
if ( !sibling )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Fold the sidebar
|
||||||
|
this.fold();
|
||||||
|
|
||||||
|
// Set the folded width
|
||||||
|
this._renderer.setStyle(this._elementRef.nativeElement, 'width', styleValue);
|
||||||
|
this._renderer.setStyle(this._elementRef.nativeElement, 'min-width', styleValue);
|
||||||
|
this._renderer.setStyle(this._elementRef.nativeElement, 'max-width', styleValue);
|
||||||
|
|
||||||
|
// Set the style and class
|
||||||
|
this._renderer.setStyle(sibling, styleRule, styleValue, RendererStyleFlags2.Important + RendererStyleFlags2.DashCase);
|
||||||
|
this._renderer.addClass(this._elementRef.nativeElement, 'folded');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Show the backdrop
|
||||||
|
*
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
private _showBackdrop(): void
|
||||||
|
{
|
||||||
|
// Create the backdrop element
|
||||||
|
this._backdrop = this._renderer.createElement('div');
|
||||||
|
|
||||||
|
// Add a class to the backdrop element
|
||||||
|
this._backdrop.classList.add('fuse-sidebar-overlay');
|
||||||
|
|
||||||
|
// Add a class depending on the invisibleOverlay option
|
||||||
|
if ( this.invisibleOverlay )
|
||||||
|
{
|
||||||
|
this._backdrop.classList.add('fuse-sidebar-overlay-invisible');
|
||||||
|
}
|
||||||
|
|
||||||
|
// Append the backdrop to the parent of the sidebar
|
||||||
|
this._renderer.appendChild(this._elementRef.nativeElement.parentElement, this._backdrop);
|
||||||
|
|
||||||
|
// Create the enter animation and attach it to the player
|
||||||
|
this._player =
|
||||||
|
this._animationBuilder
|
||||||
|
.build([
|
||||||
|
animate('300ms ease', style({opacity: 1}))
|
||||||
|
]).create(this._backdrop);
|
||||||
|
|
||||||
|
// Play the animation
|
||||||
|
this._player.play();
|
||||||
|
|
||||||
|
// Add an event listener to the overlay
|
||||||
|
this._backdrop.addEventListener('click', () => {
|
||||||
|
this.close();
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
// Mark for check
|
||||||
|
this._changeDetectorRef.markForCheck();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Hide the backdrop
|
||||||
|
*
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
private _hideBackdrop(): void
|
||||||
|
{
|
||||||
|
if ( !this._backdrop )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Create the leave animation and attach it to the player
|
||||||
|
this._player =
|
||||||
|
this._animationBuilder
|
||||||
|
.build([
|
||||||
|
animate('300ms ease', style({opacity: 0}))
|
||||||
|
]).create(this._backdrop);
|
||||||
|
|
||||||
|
// Play the animation
|
||||||
|
this._player.play();
|
||||||
|
|
||||||
|
// Once the animation is done...
|
||||||
|
this._player.onDone(() => {
|
||||||
|
|
||||||
|
// If the backdrop still exists...
|
||||||
|
if ( this._backdrop )
|
||||||
|
{
|
||||||
|
// Remove the backdrop
|
||||||
|
this._backdrop.parentNode.removeChild(this._backdrop);
|
||||||
|
this._backdrop = null;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// Mark for check
|
||||||
|
this._changeDetectorRef.markForCheck();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Change some properties of the sidebar
|
||||||
|
* and make it visible
|
||||||
|
*
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
private _showSidebar(): void
|
||||||
|
{
|
||||||
|
// Remove the box-shadow style
|
||||||
|
this._renderer.removeStyle(this._elementRef.nativeElement, 'box-shadow');
|
||||||
|
|
||||||
|
// Make the sidebar invisible
|
||||||
|
this._renderer.removeStyle(this._elementRef.nativeElement, 'visibility');
|
||||||
|
|
||||||
|
// Mark for check
|
||||||
|
this._changeDetectorRef.markForCheck();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Change some properties of the sidebar
|
||||||
|
* and make it invisible
|
||||||
|
*
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
private _hideSidebar(delay = true): void
|
||||||
|
{
|
||||||
|
const delayAmount = delay ? 300 : 0;
|
||||||
|
|
||||||
|
// Add a delay so close animation can play
|
||||||
|
setTimeout(() => {
|
||||||
|
|
||||||
|
// Remove the box-shadow
|
||||||
|
this._renderer.setStyle(this._elementRef.nativeElement, 'box-shadow', 'none');
|
||||||
|
|
||||||
|
// Make the sidebar invisible
|
||||||
|
this._renderer.setStyle(this._elementRef.nativeElement, 'visibility', 'hidden');
|
||||||
|
}, delayAmount);
|
||||||
|
|
||||||
|
// Mark for check
|
||||||
|
this._changeDetectorRef.markForCheck();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Enable the animations
|
||||||
|
*
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
private _enableAnimations(): void
|
||||||
|
{
|
||||||
|
// Return if animations already enabled
|
||||||
|
if ( this._animationsEnabled )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Enable the animations
|
||||||
|
this._animationsEnabled = true;
|
||||||
|
|
||||||
|
// Mark for check
|
||||||
|
this._changeDetectorRef.markForCheck();
|
||||||
|
}
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------------------------------
|
||||||
|
// @ Public methods
|
||||||
|
// -----------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Open the sidebar
|
* Open the sidebar
|
||||||
*/
|
*/
|
||||||
@@ -200,14 +593,23 @@ export class FuseSidebarComponent implements OnInit, OnDestroy
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Enable the animations
|
||||||
|
this._enableAnimations();
|
||||||
|
|
||||||
|
// Show the sidebar
|
||||||
|
this._showSidebar();
|
||||||
|
|
||||||
// Show the backdrop
|
// Show the backdrop
|
||||||
this.showBackdrop();
|
this._showBackdrop();
|
||||||
|
|
||||||
// Set the opened status
|
// Set the opened status
|
||||||
this.opened = true;
|
this.opened = true;
|
||||||
|
|
||||||
// Add a css class to the body
|
// Emit the 'openedChanged' event
|
||||||
this.renderer.addClass(this.document.body, 'fuse-sidebar-opened');
|
this.openedChanged.emit(this.opened);
|
||||||
|
|
||||||
|
// Mark for check
|
||||||
|
this._changeDetectorRef.markForCheck();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -215,19 +617,28 @@ export class FuseSidebarComponent implements OnInit, OnDestroy
|
|||||||
*/
|
*/
|
||||||
close(): void
|
close(): void
|
||||||
{
|
{
|
||||||
if ( !this.opened )
|
if ( !this.opened || this.isLockedOpen )
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Enable the animations
|
||||||
|
this._enableAnimations();
|
||||||
|
|
||||||
// Hide the backdrop
|
// Hide the backdrop
|
||||||
this.hideBackdrop();
|
this._hideBackdrop();
|
||||||
|
|
||||||
// Set the opened status
|
// Set the opened status
|
||||||
this.opened = false;
|
this.opened = false;
|
||||||
|
|
||||||
// Remove the css class from the body
|
// Emit the 'openedChanged' event
|
||||||
this.renderer.removeClass(this.document.body, 'fuse-sidebar-opened');
|
this.openedChanged.emit(this.opened);
|
||||||
|
|
||||||
|
// Hide the sidebar
|
||||||
|
this._hideSidebar();
|
||||||
|
|
||||||
|
// Mark for check
|
||||||
|
this._changeDetectorRef.markForCheck();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -251,17 +662,13 @@ export class FuseSidebarComponent implements OnInit, OnDestroy
|
|||||||
@HostListener('mouseenter')
|
@HostListener('mouseenter')
|
||||||
onMouseEnter(): void
|
onMouseEnter(): void
|
||||||
{
|
{
|
||||||
// Only work if the sidebar is folded
|
// Only work if the auto trigger is enabled
|
||||||
if ( !this.folded )
|
if ( !this.foldedAutoTriggerOnHover )
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Unfold the sidebar temporarily
|
this.unfoldTemporarily();
|
||||||
this.unfolded = true;
|
|
||||||
|
|
||||||
// Add a css class to the body
|
|
||||||
this.renderer.addClass(this.document.body, 'fuse-sidebar-folded-unfolded');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -270,17 +677,13 @@ export class FuseSidebarComponent implements OnInit, OnDestroy
|
|||||||
@HostListener('mouseleave')
|
@HostListener('mouseleave')
|
||||||
onMouseLeave(): void
|
onMouseLeave(): void
|
||||||
{
|
{
|
||||||
// Only work if the sidebar is folded
|
// Only work if the auto trigger is enabled
|
||||||
if ( !this.folded )
|
if ( !this.foldedAutoTriggerOnHover )
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fold the sidebar back
|
this.foldTemporarily();
|
||||||
this.unfolded = false;
|
|
||||||
|
|
||||||
// Remove the css class from the body
|
|
||||||
this.renderer.removeClass(this.document.body, 'fuse-sidebar-folded-unfolded');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -288,8 +691,20 @@ export class FuseSidebarComponent implements OnInit, OnDestroy
|
|||||||
*/
|
*/
|
||||||
fold(): void
|
fold(): void
|
||||||
{
|
{
|
||||||
// Add a css class to the body
|
// Only work if the sidebar is not folded
|
||||||
this.renderer.addClass(this.document.body, 'fuse-sidebar-folded');
|
if ( this.folded )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Enable the animations
|
||||||
|
this._enableAnimations();
|
||||||
|
|
||||||
|
// Fold
|
||||||
|
this.folded = true;
|
||||||
|
|
||||||
|
// Mark for check
|
||||||
|
this._changeDetectorRef.markForCheck();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -297,8 +712,20 @@ export class FuseSidebarComponent implements OnInit, OnDestroy
|
|||||||
*/
|
*/
|
||||||
unfold(): void
|
unfold(): void
|
||||||
{
|
{
|
||||||
// Remove the css class from the body
|
// Only work if the sidebar is folded
|
||||||
this.renderer.removeClass(this.document.body, 'fuse-sidebar-folded');
|
if ( !this.folded )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Enable the animations
|
||||||
|
this._enableAnimations();
|
||||||
|
|
||||||
|
// Unfold
|
||||||
|
this.folded = false;
|
||||||
|
|
||||||
|
// Mark for check
|
||||||
|
this._changeDetectorRef.markForCheck();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -306,70 +733,67 @@ export class FuseSidebarComponent implements OnInit, OnDestroy
|
|||||||
*/
|
*/
|
||||||
toggleFold(): void
|
toggleFold(): void
|
||||||
{
|
{
|
||||||
this.folded = !this.folded;
|
if ( this.folded )
|
||||||
|
{
|
||||||
|
this.unfold();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
this.fold();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Show the backdrop
|
* Fold the temporarily unfolded sidebar back
|
||||||
*/
|
*/
|
||||||
showBackdrop(): void
|
foldTemporarily(): void
|
||||||
{
|
{
|
||||||
// Create the backdrop element
|
// Only work if the sidebar is folded
|
||||||
this._backdrop = this.renderer.createElement('div');
|
if ( !this.folded )
|
||||||
|
|
||||||
// Add a class to the backdrop element
|
|
||||||
this._backdrop.classList.add('fuse-sidebar-overlay');
|
|
||||||
|
|
||||||
// Append the backdrop to the parent of the sidebar
|
|
||||||
this.renderer.appendChild(this.elementRef.nativeElement.parentElement, this._backdrop);
|
|
||||||
|
|
||||||
// Create the enter animation and attach it to the player
|
|
||||||
this._player =
|
|
||||||
this.animationBuilder
|
|
||||||
.build([
|
|
||||||
animate('300ms ease', style({opacity: 1}))
|
|
||||||
]).create(this._backdrop);
|
|
||||||
|
|
||||||
// Play the animation
|
|
||||||
this._player.play();
|
|
||||||
|
|
||||||
// Add an event listener to the overlay
|
|
||||||
this._backdrop.addEventListener('click', () => {
|
|
||||||
this.close();
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Hide the backdrop
|
|
||||||
*/
|
|
||||||
hideBackdrop(): void
|
|
||||||
{
|
|
||||||
if ( !this._backdrop )
|
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create the leave animation and attach it to the player
|
// Enable the animations
|
||||||
this._player =
|
this._enableAnimations();
|
||||||
this.animationBuilder
|
|
||||||
.build([
|
|
||||||
animate('300ms ease', style({opacity: 0}))
|
|
||||||
]).create(this._backdrop);
|
|
||||||
|
|
||||||
// Play the animation
|
// Fold the sidebar back
|
||||||
this._player.play();
|
this.unfolded = false;
|
||||||
|
|
||||||
// Once the animation is done...
|
// Set the folded width
|
||||||
this._player.onDone(() => {
|
const styleValue = this.foldedWidth + 'px';
|
||||||
|
|
||||||
// If the backdrop still exists...
|
this._renderer.setStyle(this._elementRef.nativeElement, 'width', styleValue);
|
||||||
if ( this._backdrop )
|
this._renderer.setStyle(this._elementRef.nativeElement, 'min-width', styleValue);
|
||||||
{
|
this._renderer.setStyle(this._elementRef.nativeElement, 'max-width', styleValue);
|
||||||
// Remove the backdrop
|
|
||||||
this._backdrop.parentNode.removeChild(this._backdrop);
|
// Mark for check
|
||||||
this._backdrop = null;
|
this._changeDetectorRef.markForCheck();
|
||||||
}
|
}
|
||||||
});
|
|
||||||
|
/**
|
||||||
|
* Unfold the sidebar temporarily
|
||||||
|
*/
|
||||||
|
unfoldTemporarily(): void
|
||||||
|
{
|
||||||
|
// Only work if the sidebar is folded
|
||||||
|
if ( !this.folded )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Enable the animations
|
||||||
|
this._enableAnimations();
|
||||||
|
|
||||||
|
// Unfold the sidebar temporarily
|
||||||
|
this.unfolded = true;
|
||||||
|
|
||||||
|
// Remove the folded width
|
||||||
|
this._renderer.removeStyle(this._elementRef.nativeElement, 'width');
|
||||||
|
this._renderer.removeStyle(this._elementRef.nativeElement, 'min-width');
|
||||||
|
this._renderer.removeStyle(this._elementRef.nativeElement, 'max-width');
|
||||||
|
|
||||||
|
// Mark for check
|
||||||
|
this._changeDetectorRef.markForCheck();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,9 @@ import { Injectable } from '@angular/core';
|
|||||||
|
|
||||||
import { FuseSidebarComponent } from './sidebar.component';
|
import { FuseSidebarComponent } from './sidebar.component';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable({
|
||||||
|
providedIn: 'root'
|
||||||
|
})
|
||||||
export class FuseSidebarService
|
export class FuseSidebarService
|
||||||
{
|
{
|
||||||
// Private
|
// Private
|
||||||
@@ -46,7 +48,7 @@ export class FuseSidebarService
|
|||||||
// Check if the sidebar exists
|
// Check if the sidebar exists
|
||||||
if ( !this._registry[key] )
|
if ( !this._registry[key] )
|
||||||
{
|
{
|
||||||
console.error(`The sidebar with the key '${key}' doesn't exist in the registry.`);
|
console.warn(`The sidebar with the key '${key}' doesn't exist in the registry.`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Unregister the sidebar
|
// Unregister the sidebar
|
||||||
@@ -57,13 +59,14 @@ export class FuseSidebarService
|
|||||||
* Return the sidebar with the given key
|
* Return the sidebar with the given key
|
||||||
*
|
*
|
||||||
* @param key
|
* @param key
|
||||||
|
* @returns {FuseSidebarComponent}
|
||||||
*/
|
*/
|
||||||
getSidebar(key): any
|
getSidebar(key): FuseSidebarComponent
|
||||||
{
|
{
|
||||||
// Check if the sidebar exists
|
// Check if the sidebar exists
|
||||||
if ( !this._registry[key] )
|
if ( !this._registry[key] )
|
||||||
{
|
{
|
||||||
console.error(`The sidebar with the key '${key}' doesn't exist in the registry.`);
|
console.warn(`The sidebar with the key '${key}' doesn't exist in the registry.`);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,105 +1,495 @@
|
|||||||
<button #openButton mat-icon-button class="open-button mat-primary-bg mat-elevation-z2" (click)="openBar()">
|
<div class="theme-options-panel" fusePerfectScrollbar>
|
||||||
<mat-icon>settings</mat-icon>
|
|
||||||
</button>
|
|
||||||
|
|
||||||
<div class="theme-options-panel-overlay" #overlay [fxHide]="barClosed" [@fadeInOut]="!barClosed"></div>
|
<div class="header">
|
||||||
|
|
||||||
<div #panel class="theme-options-panel mat-white-bg mat-elevation-z8">
|
<span class="title">Theme Options</span>
|
||||||
|
|
||||||
<button mat-icon-button class="close-button" (click)="closeBar()">
|
<button mat-icon-button class="close-button" (click)="toggleSidebarOpen('themeOptionsPanel')">
|
||||||
<mat-icon>close</mat-icon>
|
<mat-icon>close</mat-icon>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<div class="theme-options-panel-inner" fxLayout="column" fxLayoutAlign="start start">
|
</div>
|
||||||
|
|
||||||
<h3>Navigation:</h3>
|
<form [formGroup]="form">
|
||||||
<mat-radio-group [(ngModel)]="config.layout.navigation" (ngModelChange)="onSettingsChange()"
|
|
||||||
fxLayout="column" fxLayout.gt-xs="row wrap" fxLayoutAlign="start start">
|
|
||||||
<mat-radio-button class="mr-8 mb-8" value="top">Top</mat-radio-button>
|
|
||||||
<mat-radio-button class="mr-8 mb-8" value="left">Left</mat-radio-button>
|
|
||||||
<mat-radio-button class="mr-8 mb-8" value="right">Right</mat-radio-button>
|
|
||||||
<mat-radio-button class="mr-8 mb-8" value="none">None</mat-radio-button>
|
|
||||||
</mat-radio-group>
|
|
||||||
|
|
||||||
<h3>Navigation Fold (for vertical navigation):</h3>
|
<!-- LAYOUT STYLES -->
|
||||||
<mat-slide-toggle [(ngModel)]="config.layout.navigationFolded"
|
<div class="group" formGroupName="layout">
|
||||||
(change)="onSettingsChange()">
|
|
||||||
Folded
|
|
||||||
</mat-slide-toggle>
|
|
||||||
|
|
||||||
<h3 class="mt-24">Toolbar:</h3>
|
<h2>Layout Styles</h2>
|
||||||
<mat-radio-group [(ngModel)]="config.layout.toolbar" (ngModelChange)="onSettingsChange()"
|
|
||||||
fxLayout="column" fxLayout.gt-xs="row wrap" fxLayoutAlign="start start">
|
|
||||||
<mat-radio-button class="mr-8 mb-8" value="below">Below</mat-radio-button>
|
|
||||||
<mat-radio-button class="mr-8 mb-8" value="above">Above</mat-radio-button>
|
|
||||||
<mat-radio-button class="mr-8 mb-8" value="none">None</mat-radio-button>
|
|
||||||
</mat-radio-group>
|
|
||||||
|
|
||||||
<h3 class="mt-24">Footer:</h3>
|
<mat-radio-group fxLayout="column" fxLayoutAlign="start start" formControlName="style">
|
||||||
<mat-radio-group [(ngModel)]="config.layout.footer" (ngModelChange)="onSettingsChange()"
|
|
||||||
fxLayout="column" fxLayout.gt-xs="row wrap" fxLayoutAlign="start start">
|
|
||||||
<mat-radio-button class="mr-8 mb-8" value="below">Below</mat-radio-button>
|
|
||||||
<mat-radio-button class="mr-8 mb-8" value="above">Above</mat-radio-button>
|
|
||||||
<mat-radio-button class="mr-8 mb-8" value="none">None</mat-radio-button>
|
|
||||||
</mat-radio-group>
|
|
||||||
|
|
||||||
<h3 class="mt-24">Layout Mode:</h3>
|
<mat-radio-button class="mb-12" value="vertical-layout-1">
|
||||||
<mat-radio-group [(ngModel)]="config.layout.mode" (ngModelChange)="onSettingsChange()"
|
Vertical Layout #1
|
||||||
fxLayout="column" fxLayout.gt-xs="row wrap" fxLayoutAlign="start start">
|
</mat-radio-button>
|
||||||
<mat-radio-button class="mr-8 mb-8" value="boxed">Boxed</mat-radio-button>
|
|
||||||
<mat-radio-button class="mr-8 mb-8" value="fullwidth">Fullwidth</mat-radio-button>
|
|
||||||
</mat-radio-group>
|
|
||||||
|
|
||||||
<mat-divider></mat-divider>
|
<mat-radio-button class="mb-12" value="vertical-layout-2">
|
||||||
|
Vertical Layout #2
|
||||||
|
</mat-radio-button>
|
||||||
|
|
||||||
<h3>Colors:</h3>
|
<mat-radio-button class="mb-12" value="vertical-layout-3">
|
||||||
<div class="colors">
|
Vertical Layout #3
|
||||||
|
</mat-radio-button>
|
||||||
|
|
||||||
<div fxFlex fxLayout="row" fxLayoutAlign="space-between center">
|
<mat-radio-button class="mb-12" value="horizontal-layout-1">
|
||||||
<h4 class="mr-8">Toolbar Color</h4>
|
Horizontal Layout #1
|
||||||
<fuse-material-color-picker [(selectedClass)]="config.colorClasses.toolbar"
|
</mat-radio-button>
|
||||||
(onValueChange)="onSettingsChange()"></fuse-material-color-picker>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div fxFlex fxLayout="row" fxLayoutAlign="space-between center">
|
</mat-radio-group>
|
||||||
<h4 class="mr-8">Navigation Bar Color</h4>
|
|
||||||
<fuse-material-color-picker [(selectedClass)]="config.colorClasses.navbar"
|
|
||||||
(onValueChange)="onSettingsChange()"></fuse-material-color-picker>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div fxFlex fxLayout="row" fxLayoutAlign="space-between center">
|
<!-- DIFFERENT FORMS BASED ON LAYOUT STYLES -->
|
||||||
<h4 class="mr-8">Footer Color</h4>
|
<ng-container [ngSwitch]="fuseConfig.layout.style">
|
||||||
<fuse-material-color-picker [(selectedClass)]="config.colorClasses.footer"
|
|
||||||
(onValueChange)="onSettingsChange()"></fuse-material-color-picker>
|
<!-- VERTICAL LAYOUT #1 -->
|
||||||
</div>
|
<ng-container *ngSwitchCase="'vertical-layout-1'">
|
||||||
|
|
||||||
|
<!-- LAYOUT WIDTH -->
|
||||||
|
<div class="group mt-32">
|
||||||
|
|
||||||
|
<h2>Layout Width</h2>
|
||||||
|
<mat-radio-group fxLayout="column" fxLayoutAlign="start start" formControlName="width">
|
||||||
|
<mat-radio-button class="mb-12" value="fullwidth">Fullwidth</mat-radio-button>
|
||||||
|
<mat-radio-button class="mb-12" value="boxed">Boxed</mat-radio-button>
|
||||||
|
</mat-radio-group>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- NAVBAR -->
|
||||||
|
<div class="group" formGroupName="navbar">
|
||||||
|
|
||||||
|
<h2>Navbar</h2>
|
||||||
|
|
||||||
|
<mat-slide-toggle formControlName="hidden">
|
||||||
|
Hide
|
||||||
|
</mat-slide-toggle>
|
||||||
|
|
||||||
|
<mat-slide-toggle class="mt-24" formControlName="folded">
|
||||||
|
Folded
|
||||||
|
</mat-slide-toggle>
|
||||||
|
|
||||||
|
<h3 class="mt-24">Position:</h3>
|
||||||
|
<mat-radio-group fxLayout="column" fxLayoutAlign="start start" formControlName="position">
|
||||||
|
<mat-radio-button class="mb-16" value="left">Left</mat-radio-button>
|
||||||
|
<mat-radio-button class="mb-16" value="right">Right</mat-radio-button>
|
||||||
|
</mat-radio-group>
|
||||||
|
|
||||||
|
<h3 class="mt-8">Variant:</h3>
|
||||||
|
<mat-radio-group fxLayout="column" fxLayoutAlign="start start" formControlName="variant">
|
||||||
|
<mat-radio-button class="mb-16" value="vertical-style-1">Style 1</mat-radio-button>
|
||||||
|
<mat-radio-button class="mb-16" value="vertical-style-2">Style 2</mat-radio-button>
|
||||||
|
</mat-radio-group>
|
||||||
|
|
||||||
|
<h3 class="mt-24 mb-8">Color:</h3>
|
||||||
|
<fuse-material-color-picker class="mb-16"
|
||||||
|
[(selectedClass)]="fuseConfig.layout.navbar.background">
|
||||||
|
</fuse-material-color-picker>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- TOOLBAR -->
|
||||||
|
<div class="group" formGroupName="toolbar">
|
||||||
|
|
||||||
|
<h2>Toolbar</h2>
|
||||||
|
|
||||||
|
<mat-slide-toggle formControlName="hidden">
|
||||||
|
Hide
|
||||||
|
</mat-slide-toggle>
|
||||||
|
|
||||||
|
<h3 class="mt-24">Position:</h3>
|
||||||
|
<mat-radio-group fxLayout="column" fxLayoutAlign="start start" formControlName="position">
|
||||||
|
<mat-radio-button class="mb-12" value="above">Above</mat-radio-button>
|
||||||
|
<mat-radio-button class="mb-12" value="below-static">Below Static</mat-radio-button>
|
||||||
|
<mat-radio-button class="mb-12" value="below-fixed">Below Fixed</mat-radio-button>
|
||||||
|
</mat-radio-group>
|
||||||
|
|
||||||
|
<h3 class="mt-24 mb-8">Color:</h3>
|
||||||
|
<fuse-material-color-picker class="mb-16"
|
||||||
|
[(selectedClass)]="fuseConfig.layout.toolbar.background">
|
||||||
|
</fuse-material-color-picker>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- FOOTER -->
|
||||||
|
<div class="group" formGroupName="footer">
|
||||||
|
|
||||||
|
<h2>Footer</h2>
|
||||||
|
|
||||||
|
<mat-slide-toggle formControlName="hidden">
|
||||||
|
Hide
|
||||||
|
</mat-slide-toggle>
|
||||||
|
|
||||||
|
<h3 class="mt-24">Position:</h3>
|
||||||
|
<mat-radio-group fxLayout="column" fxLayoutAlign="start start" formControlName="position">
|
||||||
|
<mat-radio-button class="mb-12" value="above">Above</mat-radio-button>
|
||||||
|
<mat-radio-button class="mb-12" value="below-static">Below Static</mat-radio-button>
|
||||||
|
<mat-radio-button class="mb-12" value="below-fixed">Below Fixed</mat-radio-button>
|
||||||
|
</mat-radio-group>
|
||||||
|
|
||||||
|
<h3 class="mt-24 mb-8">Color:</h3>
|
||||||
|
<fuse-material-color-picker class="mb-16"
|
||||||
|
[(selectedClass)]="fuseConfig.layout.footer.background">
|
||||||
|
</fuse-material-color-picker>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- SIDE PANEL -->
|
||||||
|
<div class="group" formGroupName="sidepanel">
|
||||||
|
|
||||||
|
<h2>Side Panel</h2>
|
||||||
|
|
||||||
|
<mat-slide-toggle formControlName="hidden">
|
||||||
|
Hide
|
||||||
|
</mat-slide-toggle>
|
||||||
|
|
||||||
|
<h3 class="mt-24">Position:</h3>
|
||||||
|
<mat-radio-group fxLayout="column" fxLayoutAlign="start start" formControlName="position">
|
||||||
|
<mat-radio-button class="mb-12" value="left">Left</mat-radio-button>
|
||||||
|
<mat-radio-button class="mb-12" value="right">Right</mat-radio-button>
|
||||||
|
</mat-radio-group>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</ng-container>
|
||||||
|
|
||||||
|
<!-- VERTICAL LAYOUT #2 -->
|
||||||
|
<ng-container *ngSwitchCase="'vertical-layout-2'">
|
||||||
|
|
||||||
|
<!-- LAYOUT WIDTH -->
|
||||||
|
<div class="group mt-32">
|
||||||
|
|
||||||
|
<h2>Layout Width</h2>
|
||||||
|
<mat-radio-group fxLayout="column" fxLayoutAlign="start start" formControlName="width">
|
||||||
|
<mat-radio-button class="mb-12" value="fullwidth">Fullwidth</mat-radio-button>
|
||||||
|
<mat-radio-button class="mb-12" value="boxed">Boxed</mat-radio-button>
|
||||||
|
</mat-radio-group>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- NAVBAR -->
|
||||||
|
<div class="group" formGroupName="navbar">
|
||||||
|
|
||||||
|
<h2>Navbar</h2>
|
||||||
|
|
||||||
|
<mat-slide-toggle formControlName="hidden">
|
||||||
|
Hide
|
||||||
|
</mat-slide-toggle>
|
||||||
|
|
||||||
|
<mat-slide-toggle class="mt-24" formControlName="folded">
|
||||||
|
Folded
|
||||||
|
</mat-slide-toggle>
|
||||||
|
|
||||||
|
<h3 class="mt-24">Position:</h3>
|
||||||
|
<mat-radio-group fxLayout="column" fxLayoutAlign="start start" formControlName="position">
|
||||||
|
<mat-radio-button class="mb-16" value="left">Left</mat-radio-button>
|
||||||
|
<mat-radio-button class="mb-16" value="right">Right</mat-radio-button>
|
||||||
|
</mat-radio-group>
|
||||||
|
|
||||||
|
<h3 class="mt-8">Variant:</h3>
|
||||||
|
<mat-radio-group fxLayout="column" fxLayoutAlign="start start" formControlName="variant">
|
||||||
|
<mat-radio-button class="mb-16" value="vertical-style-1">Style 1</mat-radio-button>
|
||||||
|
<mat-radio-button class="mb-16" value="vertical-style-2">Style 2</mat-radio-button>
|
||||||
|
</mat-radio-group>
|
||||||
|
|
||||||
|
<h3 class="mt-24 mb-8">Color:</h3>
|
||||||
|
<fuse-material-color-picker class="mb-16"
|
||||||
|
[(selectedClass)]="fuseConfig.layout.navbar.background">
|
||||||
|
</fuse-material-color-picker>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- TOOLBAR -->
|
||||||
|
<div class="group" formGroupName="toolbar">
|
||||||
|
|
||||||
|
<h2>Toolbar</h2>
|
||||||
|
|
||||||
|
<mat-slide-toggle formControlName="hidden">
|
||||||
|
Hide
|
||||||
|
</mat-slide-toggle>
|
||||||
|
|
||||||
|
<h3 class="mt-24">Position:</h3>
|
||||||
|
<mat-radio-group fxLayout="column" fxLayoutAlign="start start" formControlName="position">
|
||||||
|
<mat-radio-button class="mb-12" value="above-static">Above Static</mat-radio-button>
|
||||||
|
<mat-radio-button class="mb-12" value="above-fixed">Above Fixed</mat-radio-button>
|
||||||
|
<mat-radio-button class="mb-12" value="below">Below</mat-radio-button>
|
||||||
|
</mat-radio-group>
|
||||||
|
|
||||||
|
<h3 class="mt-24 mb-8">Color:</h3>
|
||||||
|
<fuse-material-color-picker class="mb-16"
|
||||||
|
[(selectedClass)]="fuseConfig.layout.toolbar.background">
|
||||||
|
</fuse-material-color-picker>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- FOOTER -->
|
||||||
|
<div class="group" formGroupName="footer">
|
||||||
|
|
||||||
|
<h2>Footer</h2>
|
||||||
|
|
||||||
|
<mat-slide-toggle formControlName="hidden">
|
||||||
|
Hide
|
||||||
|
</mat-slide-toggle>
|
||||||
|
|
||||||
|
<h3 class="mt-24">Position:</h3>
|
||||||
|
<mat-radio-group fxLayout="column" fxLayoutAlign="start start" formControlName="position">
|
||||||
|
<mat-radio-button class="mb-12" value="above-static">Above Static</mat-radio-button>
|
||||||
|
<mat-radio-button class="mb-12" value="above-fixed">Above Fixed</mat-radio-button>
|
||||||
|
<mat-radio-button class="mb-12" value="below">Below</mat-radio-button>
|
||||||
|
</mat-radio-group>
|
||||||
|
|
||||||
|
<h3 class="mt-24 mb-8">Color:</h3>
|
||||||
|
<fuse-material-color-picker class="mb-16"
|
||||||
|
[(selectedClass)]="fuseConfig.layout.footer.background">
|
||||||
|
</fuse-material-color-picker>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- SIDE PANEL -->
|
||||||
|
<div class="group" formGroupName="sidepanel">
|
||||||
|
|
||||||
|
<h2>Side Panel</h2>
|
||||||
|
|
||||||
|
<mat-slide-toggle formControlName="hidden">
|
||||||
|
Hide
|
||||||
|
</mat-slide-toggle>
|
||||||
|
|
||||||
|
<h3 class="mt-24">Position:</h3>
|
||||||
|
<mat-radio-group fxLayout="column" fxLayoutAlign="start start" formControlName="position">
|
||||||
|
<mat-radio-button class="mb-12" value="left">Left</mat-radio-button>
|
||||||
|
<mat-radio-button class="mb-12" value="right">Right</mat-radio-button>
|
||||||
|
</mat-radio-group>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</ng-container>
|
||||||
|
|
||||||
|
<!-- VERTICAL LAYOUT #3 -->
|
||||||
|
<ng-container *ngSwitchCase="'vertical-layout-3'">
|
||||||
|
|
||||||
|
<!-- LAYOUT WIDTH -->
|
||||||
|
<div class="group mt-32">
|
||||||
|
|
||||||
|
<h2>Layout Width</h2>
|
||||||
|
<mat-radio-group fxLayout="column" fxLayoutAlign="start start" formControlName="width">
|
||||||
|
<mat-radio-button class="mb-12" value="fullwidth">Fullwidth</mat-radio-button>
|
||||||
|
<mat-radio-button class="mb-12" value="boxed">Boxed</mat-radio-button>
|
||||||
|
</mat-radio-group>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- NAVBAR -->
|
||||||
|
<div class="group" formGroupName="navbar">
|
||||||
|
|
||||||
|
<h2>Navbar</h2>
|
||||||
|
|
||||||
|
<mat-slide-toggle formControlName="hidden">
|
||||||
|
Hide
|
||||||
|
</mat-slide-toggle>
|
||||||
|
|
||||||
|
<mat-slide-toggle class="mt-24" formControlName="folded">
|
||||||
|
Folded
|
||||||
|
</mat-slide-toggle>
|
||||||
|
|
||||||
|
<h3 class="mt-24">Position:</h3>
|
||||||
|
<mat-radio-group fxLayout="column" fxLayoutAlign="start start" formControlName="position">
|
||||||
|
<mat-radio-button class="mb-16" value="left">Left</mat-radio-button>
|
||||||
|
<mat-radio-button class="mb-16" value="right">Right</mat-radio-button>
|
||||||
|
</mat-radio-group>
|
||||||
|
|
||||||
|
<h3 class="mt-8">Variant:</h3>
|
||||||
|
<mat-radio-group fxLayout="column" fxLayoutAlign="start start" formControlName="variant">
|
||||||
|
<mat-radio-button class="mb-16" value="vertical-style-1">Style 1</mat-radio-button>
|
||||||
|
<mat-radio-button class="mb-16" value="vertical-style-2">Style 2</mat-radio-button>
|
||||||
|
</mat-radio-group>
|
||||||
|
|
||||||
|
<h3 class="mt-24 mb-8">Color:</h3>
|
||||||
|
<fuse-material-color-picker class="mb-16"
|
||||||
|
[(selectedClass)]="fuseConfig.layout.navbar.background">
|
||||||
|
</fuse-material-color-picker>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- TOOLBAR -->
|
||||||
|
<div class="group" formGroupName="toolbar">
|
||||||
|
|
||||||
|
<h2>Toolbar</h2>
|
||||||
|
|
||||||
|
<mat-slide-toggle formControlName="hidden">
|
||||||
|
Hide
|
||||||
|
</mat-slide-toggle>
|
||||||
|
|
||||||
|
<h3 class="mt-24">Position:</h3>
|
||||||
|
<mat-radio-group fxLayout="column" fxLayoutAlign="start start" formControlName="position">
|
||||||
|
<mat-radio-button class="mb-12" value="above-static">Above Static</mat-radio-button>
|
||||||
|
<mat-radio-button class="mb-12" value="above-fixed">Above Fixed</mat-radio-button>
|
||||||
|
</mat-radio-group>
|
||||||
|
|
||||||
|
<h3 class="mt-24 mb-8">Color:</h3>
|
||||||
|
<fuse-material-color-picker class="mb-16"
|
||||||
|
[(selectedClass)]="fuseConfig.layout.toolbar.background">
|
||||||
|
</fuse-material-color-picker>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- FOOTER -->
|
||||||
|
<div class="group" formGroupName="footer">
|
||||||
|
|
||||||
|
<h2>Footer</h2>
|
||||||
|
|
||||||
|
<mat-slide-toggle formControlName="hidden">
|
||||||
|
Hide
|
||||||
|
</mat-slide-toggle>
|
||||||
|
|
||||||
|
<h3 class="mt-24">Position:</h3>
|
||||||
|
<mat-radio-group fxLayout="column" fxLayoutAlign="start start" formControlName="position">
|
||||||
|
<mat-radio-button class="mb-12" value="above-static">Above Static</mat-radio-button>
|
||||||
|
<mat-radio-button class="mb-12" value="above-fixed">Above Fixed</mat-radio-button>
|
||||||
|
</mat-radio-group>
|
||||||
|
|
||||||
|
<h3 class="mt-24 mb-8">Color:</h3>
|
||||||
|
<fuse-material-color-picker class="mb-16"
|
||||||
|
[(selectedClass)]="fuseConfig.layout.footer.background">
|
||||||
|
</fuse-material-color-picker>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- SIDE PANEL -->
|
||||||
|
<div class="group" formGroupName="sidepanel">
|
||||||
|
|
||||||
|
<h2>Side Panel</h2>
|
||||||
|
|
||||||
|
<mat-slide-toggle formControlName="hidden">
|
||||||
|
Hide
|
||||||
|
</mat-slide-toggle>
|
||||||
|
|
||||||
|
<h3 class="mt-24">Position:</h3>
|
||||||
|
<mat-radio-group fxLayout="column" fxLayoutAlign="start start" formControlName="position">
|
||||||
|
<mat-radio-button class="mb-12" value="left">Left</mat-radio-button>
|
||||||
|
<mat-radio-button class="mb-12" value="right">Right</mat-radio-button>
|
||||||
|
</mat-radio-group>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</ng-container>
|
||||||
|
|
||||||
|
<!-- HORIZONTAL LAYOUT #1 -->
|
||||||
|
<ng-container *ngSwitchCase="'horizontal-layout-1'">
|
||||||
|
|
||||||
|
<!-- LAYOUT WIDTH -->
|
||||||
|
<div class="group mt-32">
|
||||||
|
|
||||||
|
<h2>Layout Width</h2>
|
||||||
|
<mat-radio-group fxLayout="column" fxLayoutAlign="start start" formControlName="width">
|
||||||
|
<mat-radio-button class="mb-12" value="fullwidth">Fullwidth</mat-radio-button>
|
||||||
|
<mat-radio-button class="mb-12" value="boxed">Boxed</mat-radio-button>
|
||||||
|
</mat-radio-group>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- NAVBAR -->
|
||||||
|
<div class="group" formGroupName="navbar">
|
||||||
|
|
||||||
|
<h2>Navbar</h2>
|
||||||
|
|
||||||
|
<mat-slide-toggle formControlName="hidden">
|
||||||
|
Hide
|
||||||
|
</mat-slide-toggle>
|
||||||
|
|
||||||
|
<h3 class="mt-24">Position:</h3>
|
||||||
|
<mat-radio-group fxLayout="column" fxLayoutAlign="start start" formControlName="position">
|
||||||
|
<mat-radio-button class="mb-16" value="top">Top</mat-radio-button>
|
||||||
|
</mat-radio-group>
|
||||||
|
|
||||||
|
<h3 class="mt-8">Variant (Vertical):</h3>
|
||||||
|
<mat-radio-group fxLayout="column" fxLayoutAlign="start start" formControlName="variant">
|
||||||
|
<mat-radio-button class="mb-16" value="vertical-style-1">Style 1</mat-radio-button>
|
||||||
|
<mat-radio-button class="mb-16" value="vertical-style-2">Style 2</mat-radio-button>
|
||||||
|
</mat-radio-group>
|
||||||
|
|
||||||
|
<h3 class="mt-24 mb-8">Color:</h3>
|
||||||
|
<fuse-material-color-picker class="mb-16"
|
||||||
|
[(selectedClass)]="fuseConfig.layout.navbar.background">
|
||||||
|
</fuse-material-color-picker>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- TOOLBAR -->
|
||||||
|
<div class="group" formGroupName="toolbar">
|
||||||
|
|
||||||
|
<h2>Toolbar</h2>
|
||||||
|
|
||||||
|
<mat-slide-toggle formControlName="hidden">
|
||||||
|
Hide
|
||||||
|
</mat-slide-toggle>
|
||||||
|
|
||||||
|
<h3 class="mt-24">Position:</h3>
|
||||||
|
<mat-radio-group fxLayout="column" fxLayoutAlign="start start" formControlName="position">
|
||||||
|
<mat-radio-button class="mb-12" value="above">Above</mat-radio-button>
|
||||||
|
<mat-radio-button class="mb-12" value="below">Below</mat-radio-button>
|
||||||
|
</mat-radio-group>
|
||||||
|
|
||||||
|
<h3 class="mt-24 mb-8">Color:</h3>
|
||||||
|
<fuse-material-color-picker class="mb-16"
|
||||||
|
[(selectedClass)]="fuseConfig.layout.toolbar.background">
|
||||||
|
</fuse-material-color-picker>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- FOOTER -->
|
||||||
|
<div class="group" formGroupName="footer">
|
||||||
|
|
||||||
|
<h2>Footer</h2>
|
||||||
|
|
||||||
|
<mat-slide-toggle formControlName="hidden">
|
||||||
|
Hide
|
||||||
|
</mat-slide-toggle>
|
||||||
|
|
||||||
|
<h3 class="mt-24">Position:</h3>
|
||||||
|
<mat-radio-group fxLayout="column" fxLayoutAlign="start start" formControlName="position">
|
||||||
|
<mat-radio-button class="mb-12" value="above-fixed">Above Fixed</mat-radio-button>
|
||||||
|
<mat-radio-button class="mb-12" value="above-static">Above Static</mat-radio-button>
|
||||||
|
</mat-radio-group>
|
||||||
|
|
||||||
|
<h3 class="mt-24 mb-8">Color:</h3>
|
||||||
|
<fuse-material-color-picker class="mb-16"
|
||||||
|
[(selectedClass)]="fuseConfig.layout.footer.background">
|
||||||
|
</fuse-material-color-picker>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- SIDE PANEL -->
|
||||||
|
<div class="group" formGroupName="sidepanel">
|
||||||
|
|
||||||
|
<h2>Side Panel</h2>
|
||||||
|
|
||||||
|
<mat-slide-toggle formControlName="hidden">
|
||||||
|
Hide
|
||||||
|
</mat-slide-toggle>
|
||||||
|
|
||||||
|
<h3 class="mt-24">Position:</h3>
|
||||||
|
<mat-radio-group fxLayout="column" fxLayoutAlign="start start" formControlName="position">
|
||||||
|
<mat-radio-button class="mb-12" value="left">Left</mat-radio-button>
|
||||||
|
<mat-radio-button class="mb-12" value="right">Right</mat-radio-button>
|
||||||
|
</mat-radio-group>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</ng-container>
|
||||||
|
|
||||||
|
</ng-container>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<mat-divider></mat-divider>
|
<!-- CUSTOM SCROLLBARS -->
|
||||||
|
<div class="group">
|
||||||
|
|
||||||
<h3>Router Animation:</h3>
|
<h2>Custom scrollbars</h2>
|
||||||
<mat-form-field class="w-100-p">
|
|
||||||
<mat-select class="p-0" [(ngModel)]="config.routerAnimation">
|
<mat-slide-toggle class="mb-12" formControlName="customScrollbars">
|
||||||
<mat-option value="none">
|
Enable custom scrollbars
|
||||||
None
|
</mat-slide-toggle>
|
||||||
</mat-option>
|
|
||||||
<mat-option value="slideUp">
|
</div>
|
||||||
Slide up
|
|
||||||
</mat-option>
|
</form>
|
||||||
<mat-option value="slideDown">
|
|
||||||
Slide down
|
|
||||||
</mat-option>
|
|
||||||
<mat-option value="slideRight">
|
|
||||||
Slide right
|
|
||||||
</mat-option>
|
|
||||||
<mat-option value="slideLeft">
|
|
||||||
Slide left
|
|
||||||
</mat-option>
|
|
||||||
<mat-option value="fadeIn">
|
|
||||||
Fade in
|
|
||||||
</mat-option>
|
|
||||||
</mat-select>
|
|
||||||
</mat-form-field>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -10,106 +10,69 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
:host {
|
:host {
|
||||||
position: fixed;
|
display: flex;
|
||||||
display: block;
|
overflow: hidden;
|
||||||
right: 0;
|
|
||||||
top: 160px;
|
|
||||||
z-index: 998;
|
|
||||||
|
|
||||||
&.bar-closed .theme-options-panel {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.theme-options-panel {
|
.theme-options-panel {
|
||||||
position: absolute;
|
display: flex;
|
||||||
right: 0;
|
flex-direction: column;
|
||||||
top: 0;
|
flex: 1 0 auto;
|
||||||
width: 360px;
|
padding: 40px 24px 24px 24px;
|
||||||
transform: translate3d(100%, 0, 0);
|
|
||||||
z-index: 999;
|
|
||||||
max-height: calc(100vh - 200px);
|
|
||||||
padding: 24px;
|
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
|
|
||||||
@include media-breakpoint-down('xs') {
|
.header {
|
||||||
top: -120px;
|
display: flex;
|
||||||
max-height: calc(100vh - 100px);
|
flex: 0 1 auto;
|
||||||
width: 90vw;
|
margin-bottom: 32px;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
|
||||||
|
.title {
|
||||||
|
font-size: 20px;
|
||||||
|
font-weight: 500;
|
||||||
|
padding-left: 4px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.close-button {
|
form {
|
||||||
position: absolute;
|
display: flex;
|
||||||
top: 8px;
|
flex: 1 1 auto;
|
||||||
right: 8px;
|
flex-direction: column;
|
||||||
}
|
|
||||||
|
|
||||||
h3 {
|
.group {
|
||||||
font-size: 14px;
|
display: flex;
|
||||||
font-weight: 500;
|
flex: 1 0 auto;
|
||||||
color: rgba(0, 0, 0, 0.54);
|
flex-direction: column;
|
||||||
}
|
position: relative;
|
||||||
|
border: 1px solid rgba(0, 0, 0, 0.12);
|
||||||
|
border-radius: 2px;
|
||||||
|
padding: 28px 16px 8px 16px;
|
||||||
|
margin: 16px 0;
|
||||||
|
|
||||||
.mat-divider {
|
h2 {
|
||||||
display: block !important;
|
position: absolute;
|
||||||
width: 100%;
|
top: -11px;
|
||||||
margin: 24px 0 16px 0;
|
left: 8px;
|
||||||
}
|
margin: 0;
|
||||||
|
padding: 0 8px;
|
||||||
|
font-size: 16px;
|
||||||
|
font-weight: 500;
|
||||||
|
background: white;
|
||||||
|
color: rgba(0, 0, 0, 0.54);
|
||||||
|
}
|
||||||
|
|
||||||
.colors {
|
h3 {
|
||||||
display: block !important;
|
font-size: 14px;
|
||||||
width: 100%;
|
font-weight: 500;
|
||||||
|
color: rgba(0, 0, 0, 0.54);
|
||||||
|
margin: 24px 0 16px 0;
|
||||||
|
padding: 0;
|
||||||
|
|
||||||
|
&:first-of-type {
|
||||||
|
margin-top: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.theme-options-panel-overlay {
|
|
||||||
position: fixed;
|
|
||||||
display: block;
|
|
||||||
background: rgba(0, 0, 0, 0);
|
|
||||||
top: 0;
|
|
||||||
right: 0;
|
|
||||||
left: 0;
|
|
||||||
bottom: 0;
|
|
||||||
z-index: 998;
|
|
||||||
|
|
||||||
@include media-breakpoint-down('sm') {
|
|
||||||
background: rgba(0, 0, 0, 0.37);
|
|
||||||
}
|
|
||||||
|
|
||||||
&.hidden {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.mat-list .mat-list-item {
|
|
||||||
font-size: 15px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.mat-divider {
|
|
||||||
margin: 16px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.open-button {
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
left: -48px;
|
|
||||||
width: 48px;
|
|
||||||
height: 48px;
|
|
||||||
line-height: 48px;
|
|
||||||
text-align: center;
|
|
||||||
cursor: pointer;
|
|
||||||
border-radius: 0;
|
|
||||||
margin: 0;
|
|
||||||
pointer-events: auto;
|
|
||||||
opacity: .75;
|
|
||||||
z-index: 998;
|
|
||||||
|
|
||||||
mat-icon {
|
|
||||||
animation: rotating 3s linear infinite;
|
|
||||||
}
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
import { Component, ElementRef, HostBinding, OnDestroy, OnInit, Renderer2, ViewChild } from '@angular/core';
|
import { Component, HostBinding, OnDestroy, OnInit, Renderer2 } from '@angular/core';
|
||||||
import { style, animate, AnimationBuilder, AnimationPlayer } from '@angular/animations';
|
import { FormBuilder, FormControl, FormGroup } from '@angular/forms';
|
||||||
import { Subscription } from 'rxjs/Subscription';
|
import { Subject } from 'rxjs';
|
||||||
|
import { takeUntil } from 'rxjs/operators';
|
||||||
|
|
||||||
import { fuseAnimations } from '@fuse/animations';
|
import { fuseAnimations } from '@fuse/animations';
|
||||||
import { FuseConfigService } from '@fuse/services/config.service';
|
import { FuseConfigService } from '@fuse/services/config.service';
|
||||||
import { FuseNavigationService } from '@fuse/components/navigation/navigation.service';
|
import { FuseNavigationService } from '@fuse/components/navigation/navigation.service';
|
||||||
|
import { FuseSidebarService } from '@fuse/components/sidebar/sidebar.service';
|
||||||
import { navigation } from 'app/navigation/navigation';
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector : 'fuse-theme-options',
|
selector : 'fuse-theme-options',
|
||||||
@@ -16,42 +16,118 @@ import { navigation } from 'app/navigation/navigation';
|
|||||||
})
|
})
|
||||||
export class FuseThemeOptionsComponent implements OnInit, OnDestroy
|
export class FuseThemeOptionsComponent implements OnInit, OnDestroy
|
||||||
{
|
{
|
||||||
@ViewChild('openButton') openButton;
|
fuseConfig: any;
|
||||||
@ViewChild('panel') panel;
|
form: FormGroup;
|
||||||
@ViewChild('overlay') overlay: ElementRef;
|
|
||||||
|
|
||||||
public player: AnimationPlayer;
|
@HostBinding('class.bar-closed')
|
||||||
config: any;
|
barClosed: boolean;
|
||||||
|
|
||||||
onConfigChanged: Subscription;
|
// Private
|
||||||
|
private _unsubscribeAll: Subject<any>;
|
||||||
@HostBinding('class.bar-closed') barClosed: boolean;
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor
|
||||||
|
*
|
||||||
|
* @param {FormBuilder} _formBuilder
|
||||||
|
* @param {FuseConfigService} _fuseConfigService
|
||||||
|
* @param {FuseNavigationService} _fuseNavigationService
|
||||||
|
* @param {FuseSidebarService} _fuseSidebarService
|
||||||
|
* @param {Renderer2} _renderer
|
||||||
|
*/
|
||||||
constructor(
|
constructor(
|
||||||
private animationBuilder: AnimationBuilder,
|
private _formBuilder: FormBuilder,
|
||||||
private fuseConfig: FuseConfigService,
|
private _fuseConfigService: FuseConfigService,
|
||||||
private navigationService: FuseNavigationService,
|
private _fuseNavigationService: FuseNavigationService,
|
||||||
private renderer: Renderer2
|
private _fuseSidebarService: FuseSidebarService,
|
||||||
|
private _renderer: Renderer2
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
// Set the defaults
|
||||||
this.barClosed = true;
|
this.barClosed = true;
|
||||||
|
|
||||||
this.onConfigChanged =
|
// Set the private defaults
|
||||||
this.fuseConfig.onConfigChanged
|
this._unsubscribeAll = new Subject();
|
||||||
.subscribe(
|
}
|
||||||
(newConfig) => {
|
|
||||||
this.config = newConfig;
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
// Get the nav model and add customize nav item
|
// -----------------------------------------------------------------------------------------------------
|
||||||
// that opens the bar programmatically
|
// @ Lifecycle hooks
|
||||||
const nav: any = navigation;
|
// -----------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
nav.push({
|
/**
|
||||||
|
* On init
|
||||||
|
*/
|
||||||
|
ngOnInit(): void
|
||||||
|
{
|
||||||
|
// Build the config form
|
||||||
|
// noinspection TypeScriptValidateTypes
|
||||||
|
this.form = this._formBuilder.group({
|
||||||
|
layout : this._formBuilder.group({
|
||||||
|
style : new FormControl(),
|
||||||
|
width : new FormControl(),
|
||||||
|
navbar : this._formBuilder.group({
|
||||||
|
background: new FormControl(),
|
||||||
|
folded : new FormControl(),
|
||||||
|
hidden : new FormControl(),
|
||||||
|
position : new FormControl(),
|
||||||
|
variant : new FormControl()
|
||||||
|
}),
|
||||||
|
toolbar : this._formBuilder.group({
|
||||||
|
background: new FormControl(),
|
||||||
|
hidden : new FormControl(),
|
||||||
|
position : new FormControl()
|
||||||
|
}),
|
||||||
|
footer : this._formBuilder.group({
|
||||||
|
background: new FormControl(),
|
||||||
|
hidden : new FormControl(),
|
||||||
|
position : new FormControl()
|
||||||
|
}),
|
||||||
|
sidepanel: this._formBuilder.group({
|
||||||
|
hidden: new FormControl(),
|
||||||
|
position : new FormControl()
|
||||||
|
})
|
||||||
|
}),
|
||||||
|
customScrollbars: new FormControl()
|
||||||
|
});
|
||||||
|
|
||||||
|
// Subscribe to the config changes
|
||||||
|
this._fuseConfigService.config
|
||||||
|
.pipe(takeUntil(this._unsubscribeAll))
|
||||||
|
.subscribe((config) => {
|
||||||
|
|
||||||
|
// Update the stored config
|
||||||
|
this.fuseConfig = config;
|
||||||
|
|
||||||
|
// Set the config form values without emitting an event
|
||||||
|
// so that we don't end up with an infinite loop
|
||||||
|
this.form.setValue(config, {emitEvent: false});
|
||||||
|
});
|
||||||
|
|
||||||
|
// Subscribe to the specific form value changes (layout.style)
|
||||||
|
this.form.get('layout.style').valueChanges
|
||||||
|
.pipe(takeUntil(this._unsubscribeAll))
|
||||||
|
.subscribe((value) => {
|
||||||
|
|
||||||
|
// Reset the form values based on the
|
||||||
|
// selected layout style
|
||||||
|
this._resetFormValues(value);
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
// Subscribe to the form value changes
|
||||||
|
this.form.valueChanges
|
||||||
|
.pipe(takeUntil(this._unsubscribeAll))
|
||||||
|
.subscribe((config) => {
|
||||||
|
|
||||||
|
// Update the config
|
||||||
|
this._fuseConfigService.config = config;
|
||||||
|
});
|
||||||
|
|
||||||
|
// Add customize nav item that opens the bar programmatically
|
||||||
|
const customFunctionNavItem = {
|
||||||
'id' : 'custom-function',
|
'id' : 'custom-function',
|
||||||
'title' : 'Custom Function',
|
'title' : 'Custom Function',
|
||||||
'type' : 'group',
|
'type' : 'group',
|
||||||
|
'icon' : 'settings',
|
||||||
'children': [
|
'children': [
|
||||||
{
|
{
|
||||||
'id' : 'customize',
|
'id' : 'customize',
|
||||||
@@ -59,57 +135,173 @@ export class FuseThemeOptionsComponent implements OnInit, OnDestroy
|
|||||||
'type' : 'item',
|
'type' : 'item',
|
||||||
'icon' : 'settings',
|
'icon' : 'settings',
|
||||||
'function': () => {
|
'function': () => {
|
||||||
this.openBar();
|
this.toggleSidebarOpen('themeOptionsPanel');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
});
|
};
|
||||||
|
|
||||||
|
this._fuseNavigationService.addNavigationItem(customFunctionNavItem, 'end');
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit()
|
/**
|
||||||
|
* On destroy
|
||||||
|
*/
|
||||||
|
ngOnDestroy(): void
|
||||||
{
|
{
|
||||||
this.renderer.listen(this.overlay.nativeElement, 'click', () => {
|
// Unsubscribe from all subscriptions
|
||||||
this.closeBar();
|
this._unsubscribeAll.next();
|
||||||
});
|
this._unsubscribeAll.complete();
|
||||||
|
|
||||||
|
// Remove the custom function menu
|
||||||
|
this._fuseNavigationService.removeNavigationItem('custom-function');
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnDestroy()
|
// -----------------------------------------------------------------------------------------------------
|
||||||
|
// @ Private methods
|
||||||
|
// -----------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reset the form values based on the
|
||||||
|
* selected layout style
|
||||||
|
*
|
||||||
|
* @param value
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
private _resetFormValues(value): void
|
||||||
{
|
{
|
||||||
this.onConfigChanged.unsubscribe();
|
switch ( value )
|
||||||
|
{
|
||||||
|
// Vertical Layout #1
|
||||||
|
case 'vertical-layout-1':
|
||||||
|
{
|
||||||
|
this.form.patchValue({
|
||||||
|
layout: {
|
||||||
|
width : 'fullwidth',
|
||||||
|
navbar : {
|
||||||
|
background: 'mat-fuse-dark-700-bg',
|
||||||
|
folded : false,
|
||||||
|
hidden : false,
|
||||||
|
position : 'left',
|
||||||
|
variant : 'vertical-style-1'
|
||||||
|
},
|
||||||
|
toolbar: {
|
||||||
|
background: 'mat-white-500-bg',
|
||||||
|
hidden : false,
|
||||||
|
position : 'below-static'
|
||||||
|
},
|
||||||
|
footer : {
|
||||||
|
background: 'mat-fuse-dark-900-bg',
|
||||||
|
hidden : false,
|
||||||
|
position : 'below-static'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Vertical Layout #2
|
||||||
|
case 'vertical-layout-2':
|
||||||
|
{
|
||||||
|
this.form.patchValue({
|
||||||
|
layout: {
|
||||||
|
width : 'fullwidth',
|
||||||
|
navbar : {
|
||||||
|
background: 'mat-fuse-dark-700-bg',
|
||||||
|
folded : false,
|
||||||
|
hidden : false,
|
||||||
|
position : 'left',
|
||||||
|
variant : 'vertical-style-1'
|
||||||
|
},
|
||||||
|
toolbar: {
|
||||||
|
background: 'mat-white-500-bg',
|
||||||
|
hidden : false,
|
||||||
|
position : 'below'
|
||||||
|
},
|
||||||
|
footer : {
|
||||||
|
background: 'mat-fuse-dark-900-bg',
|
||||||
|
hidden : false,
|
||||||
|
position : 'below'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Vertical Layout #3
|
||||||
|
case 'vertical-layout-3':
|
||||||
|
{
|
||||||
|
this.form.patchValue({
|
||||||
|
layout: {
|
||||||
|
width : 'fullwidth',
|
||||||
|
navbar : {
|
||||||
|
background: 'mat-fuse-dark-700-bg',
|
||||||
|
folded : false,
|
||||||
|
hidden : false,
|
||||||
|
position : 'left',
|
||||||
|
layout : 'vertical-style-1'
|
||||||
|
},
|
||||||
|
toolbar: {
|
||||||
|
background: 'mat-white-500-bg',
|
||||||
|
hidden : false,
|
||||||
|
position : 'above-static'
|
||||||
|
},
|
||||||
|
footer : {
|
||||||
|
background: 'mat-fuse-dark-900-bg',
|
||||||
|
hidden : false,
|
||||||
|
position : 'above-static'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Horizontal Layout #1
|
||||||
|
case 'horizontal-layout-1':
|
||||||
|
{
|
||||||
|
this.form.patchValue({
|
||||||
|
layout: {
|
||||||
|
width : 'fullwidth',
|
||||||
|
navbar : {
|
||||||
|
background: 'mat-fuse-dark-700-bg',
|
||||||
|
folded : false,
|
||||||
|
hidden : false,
|
||||||
|
position : 'top',
|
||||||
|
variant : 'vertical-style-1'
|
||||||
|
},
|
||||||
|
toolbar: {
|
||||||
|
background: 'mat-white-500-bg',
|
||||||
|
hidden : false,
|
||||||
|
position : 'above'
|
||||||
|
},
|
||||||
|
footer : {
|
||||||
|
background: 'mat-fuse-dark-900-bg',
|
||||||
|
hidden : false,
|
||||||
|
position : 'above-fixed'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onSettingsChange()
|
// -----------------------------------------------------------------------------------------------------
|
||||||
|
// @ Public methods
|
||||||
|
// -----------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Toggle sidebar open
|
||||||
|
*
|
||||||
|
* @param key
|
||||||
|
*/
|
||||||
|
toggleSidebarOpen(key): void
|
||||||
{
|
{
|
||||||
this.fuseConfig.setConfig(this.config);
|
this._fuseSidebarService.getSidebar(key).toggleOpen();
|
||||||
}
|
}
|
||||||
|
|
||||||
closeBar()
|
|
||||||
{
|
|
||||||
this.player =
|
|
||||||
this.animationBuilder
|
|
||||||
.build([
|
|
||||||
style({transform: 'translate3d(0,0,0)'}),
|
|
||||||
animate('400ms ease', style({transform: 'translate3d(100%,0,0)'}))
|
|
||||||
]).create(this.panel.nativeElement);
|
|
||||||
|
|
||||||
this.player.play();
|
|
||||||
|
|
||||||
this.player.onDone(() => {
|
|
||||||
this.barClosed = true;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
openBar()
|
|
||||||
{
|
|
||||||
this.barClosed = false;
|
|
||||||
|
|
||||||
this.player =
|
|
||||||
this.animationBuilder
|
|
||||||
.build([
|
|
||||||
style({transform: 'translate3d(100%,0,0)'}),
|
|
||||||
animate('400ms ease', style({transform: 'translate3d(0,0,0)'}))
|
|
||||||
]).create(this.panel.nativeElement);
|
|
||||||
|
|
||||||
this.player.play();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,13 @@
|
|||||||
import { NgModule } from '@angular/core';
|
import { NgModule } from '@angular/core';
|
||||||
import { CommonModule } from '@angular/common';
|
import { CommonModule } from '@angular/common';
|
||||||
import { FormsModule } from '@angular/forms';
|
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
||||||
import { FlexLayoutModule } from '@angular/flex-layout';
|
import { FlexLayoutModule } from '@angular/flex-layout';
|
||||||
import { MatButtonModule, MatDividerModule, MatFormFieldModule, MatIconModule, MatOptionModule, MatRadioModule, MatSelectModule, MatSlideToggleModule } from '@angular/material';
|
import { MatButtonModule, MatDividerModule, MatFormFieldModule, MatIconModule, MatOptionModule, MatRadioModule, MatSelectModule, MatSlideToggleModule } from '@angular/material';
|
||||||
|
|
||||||
|
import { FuseDirectivesModule } from '@fuse/directives/directives';
|
||||||
|
import { FuseSidebarModule } from '@fuse/components/sidebar/sidebar.module';
|
||||||
import { FuseMaterialColorPickerModule } from '@fuse/components/material-color-picker/material-color-picker.module';
|
import { FuseMaterialColorPickerModule } from '@fuse/components/material-color-picker/material-color-picker.module';
|
||||||
|
|
||||||
import { FuseThemeOptionsComponent } from '@fuse/components/theme-options/theme-options.component';
|
import { FuseThemeOptionsComponent } from '@fuse/components/theme-options/theme-options.component';
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
@@ -14,6 +17,7 @@ import { FuseThemeOptionsComponent } from '@fuse/components/theme-options/theme-
|
|||||||
imports : [
|
imports : [
|
||||||
CommonModule,
|
CommonModule,
|
||||||
FormsModule,
|
FormsModule,
|
||||||
|
ReactiveFormsModule,
|
||||||
|
|
||||||
FlexLayoutModule,
|
FlexLayoutModule,
|
||||||
|
|
||||||
@@ -26,7 +30,9 @@ import { FuseThemeOptionsComponent } from '@fuse/components/theme-options/theme-
|
|||||||
MatSelectModule,
|
MatSelectModule,
|
||||||
MatSlideToggleModule,
|
MatSlideToggleModule,
|
||||||
|
|
||||||
FuseMaterialColorPickerModule
|
FuseDirectivesModule,
|
||||||
|
FuseMaterialColorPickerModule,
|
||||||
|
FuseSidebarModule
|
||||||
],
|
],
|
||||||
exports : [
|
exports : [
|
||||||
FuseThemeOptionsComponent
|
FuseThemeOptionsComponent
|
||||||
|
|||||||
@@ -5,7 +5,14 @@ import { Directive, ElementRef } from '@angular/core';
|
|||||||
})
|
})
|
||||||
export class FuseWidgetToggleDirective
|
export class FuseWidgetToggleDirective
|
||||||
{
|
{
|
||||||
constructor(public el: ElementRef)
|
/**
|
||||||
|
* Constructor
|
||||||
|
*
|
||||||
|
* @param {ElementRef} elementRef
|
||||||
|
*/
|
||||||
|
constructor(
|
||||||
|
public elementRef: ElementRef
|
||||||
|
)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -67,16 +67,16 @@ fuse-widget {
|
|||||||
|
|
||||||
&.mat-form-field-type-mat-select {
|
&.mat-form-field-type-mat-select {
|
||||||
|
|
||||||
.mat-input-wrapper {
|
.mat-form-field-wrapper {
|
||||||
padding: 16px 0;
|
padding: 16px 0;
|
||||||
|
|
||||||
.mat-input-infix {
|
.mat-form-field-infix {
|
||||||
border: none;
|
border: none;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.mat-input-underline {
|
.mat-form-field-underline {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,19 +10,38 @@ import { FuseWidgetToggleDirective } from './widget-toggle.directive';
|
|||||||
|
|
||||||
export class FuseWidgetComponent implements AfterContentInit
|
export class FuseWidgetComponent implements AfterContentInit
|
||||||
{
|
{
|
||||||
@HostBinding('class.flipped') flipped = false;
|
@HostBinding('class.flipped')
|
||||||
@ContentChildren(FuseWidgetToggleDirective, {descendants: true}) toggleButtons: QueryList<FuseWidgetToggleDirective>;
|
flipped = false;
|
||||||
|
|
||||||
constructor(private el: ElementRef, private renderer: Renderer2)
|
@ContentChildren(FuseWidgetToggleDirective, {descendants: true})
|
||||||
|
toggleButtons: QueryList<FuseWidgetToggleDirective>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor
|
||||||
|
*
|
||||||
|
* @param {ElementRef} _elementRef
|
||||||
|
* @param {Renderer2} _renderer
|
||||||
|
*/
|
||||||
|
constructor(
|
||||||
|
private _elementRef: ElementRef,
|
||||||
|
private _renderer: Renderer2
|
||||||
|
)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
ngAfterContentInit()
|
// -----------------------------------------------------------------------------------------------------
|
||||||
{
|
// @ Lifecycle hooks
|
||||||
setTimeout(() => {
|
// -----------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
/**
|
||||||
|
* After content init
|
||||||
|
*/
|
||||||
|
ngAfterContentInit(): void
|
||||||
|
{
|
||||||
|
// Listen for the flip button click
|
||||||
|
setTimeout(() => {
|
||||||
this.toggleButtons.forEach(flipButton => {
|
this.toggleButtons.forEach(flipButton => {
|
||||||
this.renderer.listen(flipButton.el.nativeElement, 'click', (event) => {
|
this._renderer.listen(flipButton.elementRef.nativeElement, 'click', (event) => {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
this.toggle();
|
this.toggle();
|
||||||
@@ -31,7 +50,14 @@ export class FuseWidgetComponent implements AfterContentInit
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
toggle()
|
// -----------------------------------------------------------------------------------------------------
|
||||||
|
// @ Public methods
|
||||||
|
// -----------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Toggle the flipped status
|
||||||
|
*/
|
||||||
|
toggle(): void
|
||||||
{
|
{
|
||||||
this.flipped = !this.flipped;
|
this.flipped = !this.flipped;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +1,14 @@
|
|||||||
import { NgModule } from '@angular/core';
|
import { NgModule } from '@angular/core';
|
||||||
|
|
||||||
import { FuseIfOnDomDirective } from '@fuse/directives/fuse-if-on-dom/fuse-if-on-dom.directive';
|
import { FuseIfOnDomDirective } from '@fuse/directives/fuse-if-on-dom/fuse-if-on-dom.directive';
|
||||||
|
import { FuseInnerScrollDirective } from '@fuse/directives/fuse-inner-scroll/fuse-inner-scroll.directive';
|
||||||
import { FusePerfectScrollbarDirective } from '@fuse/directives/fuse-perfect-scrollbar/fuse-perfect-scrollbar.directive';
|
import { FusePerfectScrollbarDirective } from '@fuse/directives/fuse-perfect-scrollbar/fuse-perfect-scrollbar.directive';
|
||||||
import { FuseMatSidenavHelperDirective, FuseMatSidenavTogglerDirective } from '@fuse/directives/fuse-mat-sidenav/fuse-mat-sidenav.directive';
|
import { FuseMatSidenavHelperDirective, FuseMatSidenavTogglerDirective } from '@fuse/directives/fuse-mat-sidenav/fuse-mat-sidenav.directive';
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
declarations: [
|
declarations: [
|
||||||
FuseIfOnDomDirective,
|
FuseIfOnDomDirective,
|
||||||
|
FuseInnerScrollDirective,
|
||||||
FuseMatSidenavHelperDirective,
|
FuseMatSidenavHelperDirective,
|
||||||
FuseMatSidenavTogglerDirective,
|
FuseMatSidenavTogglerDirective,
|
||||||
FusePerfectScrollbarDirective
|
FusePerfectScrollbarDirective
|
||||||
@@ -14,6 +16,7 @@ import { FuseMatSidenavHelperDirective, FuseMatSidenavTogglerDirective } from '@
|
|||||||
imports : [],
|
imports : [],
|
||||||
exports : [
|
exports : [
|
||||||
FuseIfOnDomDirective,
|
FuseIfOnDomDirective,
|
||||||
|
FuseInnerScrollDirective,
|
||||||
FuseMatSidenavHelperDirective,
|
FuseMatSidenavHelperDirective,
|
||||||
FuseMatSidenavTogglerDirective,
|
FuseMatSidenavTogglerDirective,
|
||||||
FusePerfectScrollbarDirective
|
FusePerfectScrollbarDirective
|
||||||
|
|||||||
@@ -5,28 +5,44 @@ import { AfterContentChecked, Directive, ElementRef, TemplateRef, ViewContainerR
|
|||||||
})
|
})
|
||||||
export class FuseIfOnDomDirective implements AfterContentChecked
|
export class FuseIfOnDomDirective implements AfterContentChecked
|
||||||
{
|
{
|
||||||
isCreated = false;
|
isCreated: boolean;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor
|
||||||
|
*
|
||||||
|
* @param {ElementRef} _elementRef
|
||||||
|
* @param {TemplateRef<any>} _templateRef
|
||||||
|
* @param {ViewContainerRef} _viewContainerRef
|
||||||
|
*/
|
||||||
constructor(
|
constructor(
|
||||||
private templateRef: TemplateRef<any>,
|
private _elementRef: ElementRef,
|
||||||
private viewContainer: ViewContainerRef,
|
private _templateRef: TemplateRef<any>,
|
||||||
private element: ElementRef
|
private _viewContainerRef: ViewContainerRef
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
// Set the defaults
|
||||||
|
this.isCreated = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
ngAfterContentChecked()
|
// -----------------------------------------------------------------------------------------------------
|
||||||
|
// @ Lifecycle hooks
|
||||||
|
// -----------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
/**
|
||||||
|
* After content checked
|
||||||
|
*/
|
||||||
|
ngAfterContentChecked(): void
|
||||||
{
|
{
|
||||||
if ( document.body.contains(this.element.nativeElement) && !this.isCreated )
|
if ( document.body.contains(this._elementRef.nativeElement) && !this.isCreated )
|
||||||
{
|
{
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.viewContainer.createEmbeddedView(this.templateRef);
|
this._viewContainerRef.createEmbeddedView(this._templateRef);
|
||||||
}, 300);
|
}, 300);
|
||||||
this.isCreated = true;
|
this.isCreated = true;
|
||||||
}
|
}
|
||||||
else if ( this.isCreated && !document.body.contains(this.element.nativeElement) )
|
else if ( this.isCreated && !document.body.contains(this._elementRef.nativeElement) )
|
||||||
{
|
{
|
||||||
this.viewContainer.clear();
|
this._viewContainerRef.clear();
|
||||||
this.isCreated = false;
|
this.isCreated = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,115 @@
|
|||||||
|
import { Directive, ElementRef, OnDestroy, OnInit, Renderer2 } from '@angular/core';
|
||||||
|
import { Subject } from 'rxjs';
|
||||||
|
import { takeUntil } from 'rxjs/operators';
|
||||||
|
|
||||||
|
import { FuseMatchMediaService } from '@fuse/services/match-media.service';
|
||||||
|
|
||||||
|
@Directive({
|
||||||
|
selector: '.inner-scroll'
|
||||||
|
})
|
||||||
|
export class FuseInnerScrollDirective implements OnInit, OnDestroy
|
||||||
|
{
|
||||||
|
// Private
|
||||||
|
private _parent: any;
|
||||||
|
private _grandParent: any;
|
||||||
|
private _unsubscribeAll: Subject<any>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor
|
||||||
|
*
|
||||||
|
* @param {ElementRef} _elementRef
|
||||||
|
* @param {FuseMatchMediaService} _fuseMediaMatchService
|
||||||
|
* @param {Renderer2} _renderer
|
||||||
|
*/
|
||||||
|
constructor(
|
||||||
|
private _elementRef: ElementRef,
|
||||||
|
private _fuseMediaMatchService: FuseMatchMediaService,
|
||||||
|
private _renderer: Renderer2
|
||||||
|
)
|
||||||
|
{
|
||||||
|
// Set the private defaults
|
||||||
|
this._unsubscribeAll = new Subject();
|
||||||
|
}
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------------------------------
|
||||||
|
// @ Lifecycle hooks
|
||||||
|
// -----------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
/**
|
||||||
|
* On init
|
||||||
|
*/
|
||||||
|
ngOnInit(): void
|
||||||
|
{
|
||||||
|
// Get the parent
|
||||||
|
this._parent = this._renderer.parentNode(this._elementRef.nativeElement);
|
||||||
|
|
||||||
|
// Return, if there is no parent
|
||||||
|
if ( !this._parent )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get the grand parent
|
||||||
|
this._grandParent = this._renderer.parentNode(this._parent);
|
||||||
|
|
||||||
|
// Register to the media query changes
|
||||||
|
this._fuseMediaMatchService.onMediaChange
|
||||||
|
.pipe(takeUntil(this._unsubscribeAll))
|
||||||
|
.subscribe((alias) => {
|
||||||
|
|
||||||
|
if ( alias === 'xs' )
|
||||||
|
{
|
||||||
|
this._removeClass();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
this._addClass();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* On destroy
|
||||||
|
*/
|
||||||
|
ngOnDestroy(): void
|
||||||
|
{
|
||||||
|
// Return, if there is no parent
|
||||||
|
if ( !this._parent )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Remove the class
|
||||||
|
this._removeClass();
|
||||||
|
|
||||||
|
// Unsubscribe from all subscriptions
|
||||||
|
this._unsubscribeAll.next();
|
||||||
|
this._unsubscribeAll.complete();
|
||||||
|
}
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------------------------------
|
||||||
|
// @ Private methods
|
||||||
|
// -----------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add the class name
|
||||||
|
*
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
private _addClass(): void
|
||||||
|
{
|
||||||
|
// Add the inner-scroll class
|
||||||
|
this._renderer.addClass(this._grandParent, 'inner-scroll');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Remove the class name
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
private _removeClass(): void
|
||||||
|
{
|
||||||
|
|
||||||
|
// Remove the inner-scroll class
|
||||||
|
this._renderer.removeClass(this._grandParent, 'inner-scroll');
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,7 +1,8 @@
|
|||||||
import { Directive, Input, OnInit, HostListener, OnDestroy, HostBinding } from '@angular/core';
|
import { Directive, Input, OnInit, HostListener, OnDestroy, HostBinding } from '@angular/core';
|
||||||
import { MatSidenav } from '@angular/material';
|
import { MatSidenav } from '@angular/material';
|
||||||
import { ObservableMedia } from '@angular/flex-layout';
|
import { ObservableMedia } from '@angular/flex-layout';
|
||||||
import { Subscription } from 'rxjs/Subscription';
|
import { Subject } from 'rxjs';
|
||||||
|
import { takeUntil } from 'rxjs/operators';
|
||||||
|
|
||||||
import { FuseMatchMediaService } from '@fuse/services/match-media.service';
|
import { FuseMatchMediaService } from '@fuse/services/match-media.service';
|
||||||
import { FuseMatSidenavHelperService } from '@fuse/directives/fuse-mat-sidenav/fuse-mat-sidenav.service';
|
import { FuseMatSidenavHelperService } from '@fuse/directives/fuse-mat-sidenav/fuse-mat-sidenav.service';
|
||||||
@@ -11,56 +12,91 @@ import { FuseMatSidenavHelperService } from '@fuse/directives/fuse-mat-sidenav/f
|
|||||||
})
|
})
|
||||||
export class FuseMatSidenavHelperDirective implements OnInit, OnDestroy
|
export class FuseMatSidenavHelperDirective implements OnInit, OnDestroy
|
||||||
{
|
{
|
||||||
matchMediaSubscription: Subscription;
|
@HostBinding('class.mat-is-locked-open')
|
||||||
@HostBinding('class.mat-is-locked-open') isLockedOpen = true;
|
isLockedOpen: boolean;
|
||||||
@Input('fuseMatSidenavHelper') id: string;
|
|
||||||
@Input('mat-is-locked-open') matIsLockedOpenBreakpoint: string;
|
|
||||||
|
|
||||||
|
@Input('fuseMatSidenavHelper')
|
||||||
|
id: string;
|
||||||
|
|
||||||
|
@Input('mat-is-locked-open')
|
||||||
|
matIsLockedOpenBreakpoint: string;
|
||||||
|
|
||||||
|
// Private
|
||||||
|
private _unsubscribeAll: Subject<any>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor
|
||||||
|
*
|
||||||
|
* @param {FuseMatchMediaService} _fuseMatchMediaService
|
||||||
|
* @param {FuseMatSidenavHelperService} _fuseMatSidenavHelperService
|
||||||
|
* @param {MatSidenav} _matSidenav
|
||||||
|
* @param {ObservableMedia} _observableMedia
|
||||||
|
*/
|
||||||
constructor(
|
constructor(
|
||||||
private fuseMatSidenavService: FuseMatSidenavHelperService,
|
private _fuseMatchMediaService: FuseMatchMediaService,
|
||||||
private fuseMatchMedia: FuseMatchMediaService,
|
private _fuseMatSidenavHelperService: FuseMatSidenavHelperService,
|
||||||
private observableMedia: ObservableMedia,
|
private _matSidenav: MatSidenav,
|
||||||
private matSidenav: MatSidenav
|
private _observableMedia: ObservableMedia
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
// Set the defaults
|
||||||
|
this.isLockedOpen = true;
|
||||||
|
|
||||||
|
// Set the private defaults
|
||||||
|
this._unsubscribeAll = new Subject();
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit()
|
// -----------------------------------------------------------------------------------------------------
|
||||||
{
|
// @ Lifecycle hooks
|
||||||
this.fuseMatSidenavService.setSidenav(this.id, this.matSidenav);
|
// -----------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
if ( this.observableMedia.isActive(this.matIsLockedOpenBreakpoint) )
|
/**
|
||||||
|
* On init
|
||||||
|
*/
|
||||||
|
ngOnInit(): void
|
||||||
|
{
|
||||||
|
// Register the sidenav to the service
|
||||||
|
this._fuseMatSidenavHelperService.setSidenav(this.id, this._matSidenav);
|
||||||
|
|
||||||
|
if ( this._observableMedia.isActive(this.matIsLockedOpenBreakpoint) )
|
||||||
{
|
{
|
||||||
this.isLockedOpen = true;
|
this.isLockedOpen = true;
|
||||||
this.matSidenav.mode = 'side';
|
this._matSidenav.mode = 'side';
|
||||||
this.matSidenav.toggle(true);
|
this._matSidenav.toggle(true);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
this.isLockedOpen = false;
|
this.isLockedOpen = false;
|
||||||
this.matSidenav.mode = 'over';
|
this._matSidenav.mode = 'over';
|
||||||
this.matSidenav.toggle(false);
|
this._matSidenav.toggle(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.matchMediaSubscription = this.fuseMatchMedia.onMediaChange.subscribe(() => {
|
this._fuseMatchMediaService.onMediaChange
|
||||||
if ( this.observableMedia.isActive(this.matIsLockedOpenBreakpoint) )
|
.pipe(takeUntil(this._unsubscribeAll))
|
||||||
{
|
.subscribe(() => {
|
||||||
this.isLockedOpen = true;
|
if ( this._observableMedia.isActive(this.matIsLockedOpenBreakpoint) )
|
||||||
this.matSidenav.mode = 'side';
|
{
|
||||||
this.matSidenav.toggle(true);
|
this.isLockedOpen = true;
|
||||||
}
|
this._matSidenav.mode = 'side';
|
||||||
else
|
this._matSidenav.toggle(true);
|
||||||
{
|
}
|
||||||
this.isLockedOpen = false;
|
else
|
||||||
this.matSidenav.mode = 'over';
|
{
|
||||||
this.matSidenav.toggle(false);
|
this.isLockedOpen = false;
|
||||||
}
|
this._matSidenav.mode = 'over';
|
||||||
});
|
this._matSidenav.toggle(false);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnDestroy()
|
/**
|
||||||
|
* On destroy
|
||||||
|
*/
|
||||||
|
ngOnDestroy(): void
|
||||||
{
|
{
|
||||||
this.matchMediaSubscription.unsubscribe();
|
// Unsubscribe from all subscriptions
|
||||||
|
this._unsubscribeAll.next();
|
||||||
|
this._unsubscribeAll.complete();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -69,15 +105,29 @@ export class FuseMatSidenavHelperDirective implements OnInit, OnDestroy
|
|||||||
})
|
})
|
||||||
export class FuseMatSidenavTogglerDirective
|
export class FuseMatSidenavTogglerDirective
|
||||||
{
|
{
|
||||||
@Input('fuseMatSidenavToggler') id;
|
@Input('fuseMatSidenavToggler')
|
||||||
|
id;
|
||||||
|
|
||||||
constructor(private fuseMatSidenavService: FuseMatSidenavHelperService)
|
/**
|
||||||
|
* Constructor
|
||||||
|
*
|
||||||
|
* @param {FuseMatSidenavHelperService} _fuseMatSidenavHelperService
|
||||||
|
*/
|
||||||
|
constructor(
|
||||||
|
private _fuseMatSidenavHelperService: FuseMatSidenavHelperService)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------------------------------
|
||||||
|
// @ Public methods
|
||||||
|
// -----------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
/**
|
||||||
|
* On click
|
||||||
|
*/
|
||||||
@HostListener('click')
|
@HostListener('click')
|
||||||
onClick()
|
onClick()
|
||||||
{
|
{
|
||||||
this.fuseMatSidenavService.getSidenav(this.id).toggle();
|
this._fuseMatSidenavHelperService.getSidenav(this.id).toggle();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,22 +1,43 @@
|
|||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { MatSidenav } from '@angular/material';
|
import { MatSidenav } from '@angular/material';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable({
|
||||||
|
providedIn: 'root'
|
||||||
|
})
|
||||||
export class FuseMatSidenavHelperService
|
export class FuseMatSidenavHelperService
|
||||||
{
|
{
|
||||||
sidenavInstances: MatSidenav[];
|
sidenavInstances: MatSidenav[];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor
|
||||||
|
*/
|
||||||
constructor()
|
constructor()
|
||||||
{
|
{
|
||||||
this.sidenavInstances = [];
|
this.sidenavInstances = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
setSidenav(id, instance)
|
// -----------------------------------------------------------------------------------------------------
|
||||||
|
// @ Accessors
|
||||||
|
// -----------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set sidenav
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @param instance
|
||||||
|
*/
|
||||||
|
setSidenav(id, instance): void
|
||||||
{
|
{
|
||||||
this.sidenavInstances[id] = instance;
|
this.sidenavInstances[id] = instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
getSidenav(id)
|
/**
|
||||||
|
* Get sidenav
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @returns {any}
|
||||||
|
*/
|
||||||
|
getSidenav(id): any
|
||||||
{
|
{
|
||||||
return this.sidenavInstances[id];
|
return this.sidenavInstances[id];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,72 +1,247 @@
|
|||||||
import { AfterViewInit, Directive, ElementRef, HostListener, OnDestroy, OnInit } from '@angular/core';
|
import { AfterViewInit, Directive, ElementRef, HostListener, Input, OnDestroy } from '@angular/core';
|
||||||
|
import { NavigationEnd, Router } from '@angular/router';
|
||||||
import { Platform } from '@angular/cdk/platform';
|
import { Platform } from '@angular/cdk/platform';
|
||||||
import { Subscription } from 'rxjs/Subscription';
|
import { Subject } from 'rxjs';
|
||||||
|
import { filter, takeUntil } from 'rxjs/operators';
|
||||||
import PerfectScrollbar from 'perfect-scrollbar';
|
import PerfectScrollbar from 'perfect-scrollbar';
|
||||||
|
import * as _ from 'lodash';
|
||||||
|
|
||||||
import { FuseConfigService } from '@fuse/services/config.service';
|
import { FuseConfigService } from '@fuse/services/config.service';
|
||||||
|
|
||||||
@Directive({
|
@Directive({
|
||||||
selector: '[fusePerfectScrollbar]'
|
selector: '[fusePerfectScrollbar]'
|
||||||
})
|
})
|
||||||
export class FusePerfectScrollbarDirective implements OnInit, AfterViewInit, OnDestroy
|
export class FusePerfectScrollbarDirective implements AfterViewInit, OnDestroy
|
||||||
{
|
{
|
||||||
onConfigChanged: Subscription;
|
isInitialized: boolean;
|
||||||
isDisableCustomScrollbars = false;
|
isMobile: boolean;
|
||||||
isMobile = false;
|
|
||||||
isInitialized = true;
|
|
||||||
ps: PerfectScrollbar;
|
ps: PerfectScrollbar;
|
||||||
|
|
||||||
|
// Private
|
||||||
|
private _enabled: boolean | '';
|
||||||
|
private _debouncedUpdate: any;
|
||||||
|
private _options: any;
|
||||||
|
private _unsubscribeAll: Subject<any>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor
|
||||||
|
*
|
||||||
|
* @param {ElementRef} elementRef
|
||||||
|
* @param {FuseConfigService} _fuseConfigService
|
||||||
|
* @param {Platform} _platform
|
||||||
|
* @param {Router} _router
|
||||||
|
*/
|
||||||
constructor(
|
constructor(
|
||||||
public element: ElementRef,
|
public elementRef: ElementRef,
|
||||||
private fuseConfig: FuseConfigService,
|
private _fuseConfigService: FuseConfigService,
|
||||||
private platform: Platform
|
private _platform: Platform,
|
||||||
|
private _router: Router
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
// Set the defaults
|
||||||
|
this.isInitialized = false;
|
||||||
|
this.isMobile = false;
|
||||||
|
|
||||||
|
// Set the private defaults
|
||||||
|
this._enabled = false;
|
||||||
|
this._debouncedUpdate = _.debounce(this.update, 150);
|
||||||
|
this._options = {
|
||||||
|
updateOnRouteChange: false
|
||||||
|
};
|
||||||
|
this._unsubscribeAll = new Subject();
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit()
|
// -----------------------------------------------------------------------------------------------------
|
||||||
{
|
// @ Accessors
|
||||||
this.onConfigChanged =
|
// -----------------------------------------------------------------------------------------------------
|
||||||
this.fuseConfig.onConfigChanged.subscribe(
|
|
||||||
(settings) => {
|
|
||||||
this.isDisableCustomScrollbars = !settings.customScrollbars;
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
if ( this.platform.ANDROID || this.platform.IOS )
|
/**
|
||||||
|
* Perfect Scrollbar options
|
||||||
|
*
|
||||||
|
* @param value
|
||||||
|
*/
|
||||||
|
@Input()
|
||||||
|
set fusePerfectScrollbarOptions(value)
|
||||||
|
{
|
||||||
|
// Merge the options
|
||||||
|
this._options = _.merge({}, this._options, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
get fusePerfectScrollbarOptions(): any
|
||||||
|
{
|
||||||
|
// Return the options
|
||||||
|
return this._options;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Is enabled
|
||||||
|
*
|
||||||
|
* @param {boolean | ""} value
|
||||||
|
*/
|
||||||
|
@Input('fusePerfectScrollbar')
|
||||||
|
set enabled(value: boolean | '')
|
||||||
|
{
|
||||||
|
// If nothing is provided with the directive (empty string),
|
||||||
|
// we will take that as a true
|
||||||
|
if ( value === '' )
|
||||||
{
|
{
|
||||||
this.isMobile = true;
|
value = true;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
ngAfterViewInit()
|
// Return, if both values are the same
|
||||||
{
|
if ( this.enabled === value )
|
||||||
if ( this.isMobile || this.isDisableCustomScrollbars )
|
|
||||||
{
|
{
|
||||||
this.isInitialized = false;
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Store the value
|
||||||
|
this._enabled = value;
|
||||||
|
|
||||||
|
// If enabled...
|
||||||
|
if ( this.enabled )
|
||||||
|
{
|
||||||
|
// Init the directive
|
||||||
|
this._init();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Otherwise destroy it
|
||||||
|
this._destroy();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
get enabled(): boolean | ''
|
||||||
|
{
|
||||||
|
// Return the enabled status
|
||||||
|
return this._enabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------------------------------
|
||||||
|
// @ Lifecycle hooks
|
||||||
|
// -----------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
/**
|
||||||
|
* After view init
|
||||||
|
*/
|
||||||
|
ngAfterViewInit(): void
|
||||||
|
{
|
||||||
|
// Check if scrollbars enabled or not from the main config
|
||||||
|
this._fuseConfigService.config
|
||||||
|
.pipe(takeUntil(this._unsubscribeAll))
|
||||||
|
.subscribe(
|
||||||
|
(settings) => {
|
||||||
|
this.enabled = settings.customScrollbars;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
// Scroll to the top on every route change
|
||||||
|
if ( this.fusePerfectScrollbarOptions.updateOnRouteChange )
|
||||||
|
{
|
||||||
|
this._router.events
|
||||||
|
.pipe(
|
||||||
|
takeUntil(this._unsubscribeAll),
|
||||||
|
filter(event => event instanceof NavigationEnd)
|
||||||
|
)
|
||||||
|
.subscribe(() => {
|
||||||
|
setTimeout(() => {
|
||||||
|
this.scrollToTop();
|
||||||
|
this.update();
|
||||||
|
}, 0);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* On destroy
|
||||||
|
*/
|
||||||
|
ngOnDestroy(): void
|
||||||
|
{
|
||||||
|
this._destroy();
|
||||||
|
|
||||||
|
// Unsubscribe from all subscriptions
|
||||||
|
this._unsubscribeAll.next();
|
||||||
|
this._unsubscribeAll.complete();
|
||||||
|
}
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------------------------------
|
||||||
|
// @ Private methods
|
||||||
|
// -----------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Initialize
|
||||||
|
*
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
_init(): void
|
||||||
|
{
|
||||||
|
// Return, if already initialized
|
||||||
|
if ( this.isInitialized )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check if is mobile
|
||||||
|
if ( this._platform.ANDROID || this._platform.IOS )
|
||||||
|
{
|
||||||
|
this.isMobile = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Return if it's mobile
|
||||||
|
if ( this.isMobile )
|
||||||
|
{
|
||||||
|
// Return...
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set as initialized
|
||||||
|
this.isInitialized = true;
|
||||||
|
|
||||||
// Initialize the perfect-scrollbar
|
// Initialize the perfect-scrollbar
|
||||||
this.ps = new PerfectScrollbar(this.element.nativeElement, {
|
this.ps = new PerfectScrollbar(this.elementRef.nativeElement, {
|
||||||
wheelPropagation: true
|
...this.fusePerfectScrollbarOptions
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnDestroy()
|
/**
|
||||||
|
* Destroy
|
||||||
|
*
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
_destroy(): void
|
||||||
{
|
{
|
||||||
if ( !this.isInitialized || !this.ps )
|
if ( !this.isInitialized || !this.ps )
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.onConfigChanged.unsubscribe();
|
|
||||||
|
|
||||||
// Destroy the perfect-scrollbar
|
// Destroy the perfect-scrollbar
|
||||||
this.ps.destroy();
|
this.ps.destroy();
|
||||||
|
|
||||||
|
// Clean up
|
||||||
|
this.ps = null;
|
||||||
|
this.isInitialized = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Update scrollbars on window resize
|
||||||
|
*
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
@HostListener('window:resize')
|
||||||
|
_updateOnResize(): void
|
||||||
|
{
|
||||||
|
this._debouncedUpdate();
|
||||||
|
}
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------------------------------
|
||||||
|
// @ Public methods
|
||||||
|
// -----------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Document click
|
||||||
|
*
|
||||||
|
* @param {Event} event
|
||||||
|
*/
|
||||||
@HostListener('document:click', ['$event'])
|
@HostListener('document:click', ['$event'])
|
||||||
documentClick(event: Event): void
|
documentClick(event: Event): void
|
||||||
{
|
{
|
||||||
@@ -82,7 +257,10 @@ export class FusePerfectScrollbarDirective implements OnInit, AfterViewInit, OnD
|
|||||||
this.ps.update();
|
this.ps.update();
|
||||||
}
|
}
|
||||||
|
|
||||||
update()
|
/**
|
||||||
|
* Update the scrollbar
|
||||||
|
*/
|
||||||
|
update(): void
|
||||||
{
|
{
|
||||||
if ( !this.isInitialized )
|
if ( !this.isInitialized )
|
||||||
{
|
{
|
||||||
@@ -93,62 +271,108 @@ export class FusePerfectScrollbarDirective implements OnInit, AfterViewInit, OnD
|
|||||||
this.ps.update();
|
this.ps.update();
|
||||||
}
|
}
|
||||||
|
|
||||||
destroy()
|
/**
|
||||||
|
* Destroy the scrollbar
|
||||||
|
*/
|
||||||
|
destroy(): void
|
||||||
{
|
{
|
||||||
this.ngOnDestroy();
|
this.ngOnDestroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
scrollToX(x: number, speed?: number)
|
/**
|
||||||
|
* Scroll to X
|
||||||
|
*
|
||||||
|
* @param {number} x
|
||||||
|
* @param {number} speed
|
||||||
|
*/
|
||||||
|
scrollToX(x: number, speed?: number): void
|
||||||
{
|
{
|
||||||
this.animateScrolling('scrollLeft', x, speed);
|
this.animateScrolling('scrollLeft', x, speed);
|
||||||
}
|
}
|
||||||
|
|
||||||
scrollToY(y: number, speed?: number)
|
/**
|
||||||
|
* Scroll to Y
|
||||||
|
*
|
||||||
|
* @param {number} y
|
||||||
|
* @param {number} speed
|
||||||
|
*/
|
||||||
|
scrollToY(y: number, speed?: number): void
|
||||||
{
|
{
|
||||||
this.animateScrolling('scrollTop', y, speed);
|
this.animateScrolling('scrollTop', y, speed);
|
||||||
}
|
}
|
||||||
|
|
||||||
scrollToTop(offset?: number, speed?: number)
|
/**
|
||||||
|
* Scroll to top
|
||||||
|
*
|
||||||
|
* @param {number} offset
|
||||||
|
* @param {number} speed
|
||||||
|
*/
|
||||||
|
scrollToTop(offset?: number, speed?: number): void
|
||||||
{
|
{
|
||||||
this.animateScrolling('scrollTop', (offset || 0), speed);
|
this.animateScrolling('scrollTop', (offset || 0), speed);
|
||||||
}
|
}
|
||||||
|
|
||||||
scrollToLeft(offset?: number, speed?: number)
|
/**
|
||||||
|
* Scroll to left
|
||||||
|
*
|
||||||
|
* @param {number} offset
|
||||||
|
* @param {number} speed
|
||||||
|
*/
|
||||||
|
scrollToLeft(offset?: number, speed?: number): void
|
||||||
{
|
{
|
||||||
this.animateScrolling('scrollLeft', (offset || 0), speed);
|
this.animateScrolling('scrollLeft', (offset || 0), speed);
|
||||||
}
|
}
|
||||||
|
|
||||||
scrollToRight(offset?: number, speed?: number)
|
/**
|
||||||
|
* Scroll to right
|
||||||
|
*
|
||||||
|
* @param {number} offset
|
||||||
|
* @param {number} speed
|
||||||
|
*/
|
||||||
|
scrollToRight(offset?: number, speed?: number): void
|
||||||
{
|
{
|
||||||
const width = this.element.nativeElement.scrollWidth;
|
const width = this.elementRef.nativeElement.scrollWidth;
|
||||||
|
|
||||||
this.animateScrolling('scrollLeft', width - (offset || 0), speed);
|
this.animateScrolling('scrollLeft', width - (offset || 0), speed);
|
||||||
}
|
}
|
||||||
|
|
||||||
scrollToBottom(offset?: number, speed?: number)
|
/**
|
||||||
|
* Scroll to bottom
|
||||||
|
*
|
||||||
|
* @param {number} offset
|
||||||
|
* @param {number} speed
|
||||||
|
*/
|
||||||
|
scrollToBottom(offset?: number, speed?: number): void
|
||||||
{
|
{
|
||||||
const height = this.element.nativeElement.scrollHeight;
|
const height = this.elementRef.nativeElement.scrollHeight;
|
||||||
|
|
||||||
this.animateScrolling('scrollTop', height - (offset || 0), speed);
|
this.animateScrolling('scrollTop', height - (offset || 0), speed);
|
||||||
}
|
}
|
||||||
|
|
||||||
animateScrolling(target: string, value: number, speed?: number)
|
/**
|
||||||
|
* Animate scrolling
|
||||||
|
*
|
||||||
|
* @param {string} target
|
||||||
|
* @param {number} value
|
||||||
|
* @param {number} speed
|
||||||
|
*/
|
||||||
|
animateScrolling(target: string, value: number, speed?: number): void
|
||||||
{
|
{
|
||||||
if ( !speed )
|
if ( !speed )
|
||||||
{
|
{
|
||||||
this.element.nativeElement[target] = value;
|
this.elementRef.nativeElement[target] = value;
|
||||||
|
|
||||||
// PS has weird event sending order, this is a workaround for that
|
// PS has weird event sending order, this is a workaround for that
|
||||||
this.update();
|
this.update();
|
||||||
this.update();
|
this.update();
|
||||||
}
|
}
|
||||||
else if ( value !== this.element.nativeElement[target] )
|
else if ( value !== this.elementRef.nativeElement[target] )
|
||||||
{
|
{
|
||||||
let newValue = 0;
|
let newValue = 0;
|
||||||
let scrollCount = 0;
|
let scrollCount = 0;
|
||||||
|
|
||||||
let oldTimestamp = performance.now();
|
let oldTimestamp = performance.now();
|
||||||
let oldValue = this.element.nativeElement[target];
|
let oldValue = this.elementRef.nativeElement[target];
|
||||||
|
|
||||||
const cosParameter = (oldValue - value) / 2;
|
const cosParameter = (oldValue - value) / 2;
|
||||||
|
|
||||||
@@ -158,11 +382,11 @@ export class FusePerfectScrollbarDirective implements OnInit, AfterViewInit, OnD
|
|||||||
newValue = Math.round(value + cosParameter + cosParameter * Math.cos(scrollCount));
|
newValue = Math.round(value + cosParameter + cosParameter * Math.cos(scrollCount));
|
||||||
|
|
||||||
// Only continue animation if scroll position has not changed
|
// Only continue animation if scroll position has not changed
|
||||||
if ( this.element.nativeElement[target] === oldValue )
|
if ( this.elementRef.nativeElement[target] === oldValue )
|
||||||
{
|
{
|
||||||
if ( scrollCount >= Math.PI )
|
if ( scrollCount >= Math.PI )
|
||||||
{
|
{
|
||||||
this.element.nativeElement[target] = value;
|
this.elementRef.nativeElement[target] = value;
|
||||||
|
|
||||||
// PS has weird event sending order, this is a workaround for that
|
// PS has weird event sending order, this is a workaround for that
|
||||||
this.update();
|
this.update();
|
||||||
@@ -171,7 +395,7 @@ export class FusePerfectScrollbarDirective implements OnInit, AfterViewInit, OnD
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
this.element.nativeElement[target] = oldValue = newValue;
|
this.elementRef.nativeElement[target] = oldValue = newValue;
|
||||||
|
|
||||||
oldTimestamp = newTimestamp;
|
oldTimestamp = newTimestamp;
|
||||||
|
|
||||||
|
|||||||
@@ -1,27 +1,8 @@
|
|||||||
import { ModuleWithProviders, NgModule, Optional, SkipSelf } from '@angular/core';
|
import { ModuleWithProviders, NgModule, Optional, SkipSelf } from '@angular/core';
|
||||||
|
|
||||||
import { FUSE_CONFIG, FuseConfigService } from '@fuse/services/config.service';
|
import { FUSE_CONFIG } from '@fuse/services/config.service';
|
||||||
import { FuseCopierService } from '@fuse/services/copier.service';
|
|
||||||
import { FuseMatchMediaService } from '@fuse/services/match-media.service';
|
|
||||||
import { FuseMatSidenavHelperService } from '@fuse/directives/fuse-mat-sidenav/fuse-mat-sidenav.service';
|
|
||||||
import { FuseNavigationService } from '@fuse/components/navigation/navigation.service';
|
|
||||||
import { FuseSidebarService } from '@fuse/components/sidebar/sidebar.service';
|
|
||||||
import { FuseSplashScreenService } from '@fuse/services/splash-screen.service';
|
|
||||||
import { FuseTranslationLoaderService } from '@fuse/services/translation-loader.service';
|
|
||||||
|
|
||||||
@NgModule({
|
@NgModule()
|
||||||
entryComponents: [],
|
|
||||||
providers : [
|
|
||||||
FuseConfigService,
|
|
||||||
FuseCopierService,
|
|
||||||
FuseMatchMediaService,
|
|
||||||
FuseMatSidenavHelperService,
|
|
||||||
FuseNavigationService,
|
|
||||||
FuseSidebarService,
|
|
||||||
FuseSplashScreenService,
|
|
||||||
FuseTranslationLoaderService
|
|
||||||
]
|
|
||||||
})
|
|
||||||
export class FuseModule
|
export class FuseModule
|
||||||
{
|
{
|
||||||
constructor(@Optional() @SkipSelf() parentModule: FuseModule)
|
constructor(@Optional() @SkipSelf() parentModule: FuseModule)
|
||||||
|
|||||||
@@ -3,7 +3,14 @@ import { Pipe, PipeTransform } from '@angular/core';
|
|||||||
@Pipe({name: 'camelCaseToDash'})
|
@Pipe({name: 'camelCaseToDash'})
|
||||||
export class CamelCaseToDashPipe implements PipeTransform
|
export class CamelCaseToDashPipe implements PipeTransform
|
||||||
{
|
{
|
||||||
transform(value: string, args: any[] = [])
|
/**
|
||||||
|
* Transform
|
||||||
|
*
|
||||||
|
* @param {string} value
|
||||||
|
* @param {any[]} args
|
||||||
|
* @returns {string}
|
||||||
|
*/
|
||||||
|
transform(value: string, args: any[] = []): string
|
||||||
{
|
{
|
||||||
return value ? String(value).replace(/([A-Z])/g, (g) => `-${g[0].toLowerCase()}`) : '';
|
return value ? String(value).replace(/([A-Z])/g, (g) => `-${g[0].toLowerCase()}`) : '';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,14 @@ import { FuseUtils } from '@fuse/utils';
|
|||||||
@Pipe({name: 'filter'})
|
@Pipe({name: 'filter'})
|
||||||
export class FilterPipe implements PipeTransform
|
export class FilterPipe implements PipeTransform
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* Transform
|
||||||
|
*
|
||||||
|
* @param {any[]} mainArr
|
||||||
|
* @param {string} searchText
|
||||||
|
* @param {string} property
|
||||||
|
* @returns {any}
|
||||||
|
*/
|
||||||
transform(mainArr: any[], searchText: string, property: string): any
|
transform(mainArr: any[], searchText: string, property: string): any
|
||||||
{
|
{
|
||||||
return FuseUtils.filterArrayByString(mainArr, searchText);
|
return FuseUtils.filterArrayByString(mainArr, searchText);
|
||||||
|
|||||||
@@ -6,6 +6,14 @@ import { Pipe, PipeTransform } from '@angular/core';
|
|||||||
})
|
})
|
||||||
export class GetByIdPipe implements PipeTransform
|
export class GetByIdPipe implements PipeTransform
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* Transform
|
||||||
|
*
|
||||||
|
* @param {any[]} value
|
||||||
|
* @param {number} id
|
||||||
|
* @param {string} property
|
||||||
|
* @returns {any}
|
||||||
|
*/
|
||||||
transform(value: any[], id: number, property: string): any
|
transform(value: any[], id: number, property: string): any
|
||||||
{
|
{
|
||||||
const foundItem = value.find(item => {
|
const foundItem = value.find(item => {
|
||||||
|
|||||||
@@ -3,7 +3,14 @@ import { Pipe, PipeTransform } from '@angular/core';
|
|||||||
@Pipe({name: 'htmlToPlaintext'})
|
@Pipe({name: 'htmlToPlaintext'})
|
||||||
export class HtmlToPlaintextPipe implements PipeTransform
|
export class HtmlToPlaintextPipe implements PipeTransform
|
||||||
{
|
{
|
||||||
transform(value: string, args: any[] = [])
|
/**
|
||||||
|
* Transform
|
||||||
|
*
|
||||||
|
* @param {string} value
|
||||||
|
* @param {any[]} args
|
||||||
|
* @returns {string}
|
||||||
|
*/
|
||||||
|
transform(value: string, args: any[] = []): string
|
||||||
{
|
{
|
||||||
return value ? String(value).replace(/<[^>]+>/gm, '') : '';
|
return value ? String(value).replace(/<[^>]+>/gm, '') : '';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,13 @@ import { Pipe, PipeTransform } from '@angular/core';
|
|||||||
@Pipe({name: 'keys'})
|
@Pipe({name: 'keys'})
|
||||||
export class KeysPipe implements PipeTransform
|
export class KeysPipe implements PipeTransform
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* Transform
|
||||||
|
*
|
||||||
|
* @param value
|
||||||
|
* @param {string[]} args
|
||||||
|
* @returns {any}
|
||||||
|
*/
|
||||||
transform(value: any, args: string[]): any
|
transform(value: any, args: string[]): any
|
||||||
{
|
{
|
||||||
const keys: any[] = [];
|
const keys: any[] = [];
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
// This file meant to be imported only once! Use fuse.scss to access
|
||||||
|
// to the core Fuse and Angular Material mixins
|
||||||
|
|
||||||
// ngx-datatable
|
// ngx-datatable
|
||||||
@import '~@swimlane/ngx-datatable/release/themes/material';
|
@import '~@swimlane/ngx-datatable/release/themes/material';
|
||||||
|
|
||||||
@@ -7,10 +10,13 @@
|
|||||||
// Fuse
|
// Fuse
|
||||||
@import "fuse";
|
@import "fuse";
|
||||||
|
|
||||||
// Theming
|
// Include core Angular Material styles
|
||||||
@include mat-core();
|
@include mat-core();
|
||||||
|
|
||||||
// Include theme styles for core and each component used in your app.
|
// Setup the typography
|
||||||
|
@include angular-material-typography($typography);
|
||||||
|
|
||||||
|
// Create an Angular Material theme from the $theme map
|
||||||
@include angular-material-theme($theme);
|
@include angular-material-theme($theme);
|
||||||
|
|
||||||
// Partials
|
// Partials
|
||||||
@@ -24,6 +30,7 @@
|
|||||||
@import "partials/material";
|
@import "partials/material";
|
||||||
@import "partials/angular-material-fix";
|
@import "partials/angular-material-fix";
|
||||||
@import "partials/typography";
|
@import "partials/typography";
|
||||||
|
@import "partials/docs";
|
||||||
@import "partials/page-layouts";
|
@import "partials/page-layouts";
|
||||||
@import "partials/cards";
|
@import "partials/cards";
|
||||||
@import "partials/navigation";
|
@import "partials/navigation";
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
// Variables
|
// Material theming
|
||||||
@import "variables/theme";
|
@import "theming";
|
||||||
// Mixins
|
|
||||||
|
// Breakpoint mixins
|
||||||
@import "mixins/breakpoints";
|
@import "mixins/breakpoints";
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Fix: "Inconsistent font sizes across elements"
|
// Fix: "Inconsistent font sizes across elements"
|
||||||
.mat-input-wrapper {
|
.mat-form-field-wrapper {
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -34,7 +34,7 @@
|
|||||||
|
|
||||||
&.mat-form-field-type-mat-select {
|
&.mat-form-field-type-mat-select {
|
||||||
|
|
||||||
.mat-input-infix {
|
.mat-form-field-infix {
|
||||||
display: inline-flex;
|
display: inline-flex;
|
||||||
width: auto;
|
width: auto;
|
||||||
|
|
||||||
@@ -57,7 +57,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fix: "Stepper icons are broken due to Fuse's icon helpers"
|
// Fix: Stepper icons are broken due to Fuse's icon helpers
|
||||||
mat-horizontal-stepper,
|
mat-horizontal-stepper,
|
||||||
mat-vertical-stepper {
|
mat-vertical-stepper {
|
||||||
|
|
||||||
@@ -68,11 +68,25 @@ mat-vertical-stepper {
|
|||||||
width: 16px !important;
|
width: 16px !important;
|
||||||
min-width: 0 !important;
|
min-width: 0 !important;
|
||||||
min-height: 0 !important;
|
min-height: 0 !important;
|
||||||
color: rgba(255, 255, 255, 0.87) !important;
|
color: inherit !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
mat-vertical-stepper {
|
mat-vertical-stepper {
|
||||||
padding: 16px 0;
|
padding: 16px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Fix: Chip remove icon is broken due to Fuse's icon helpers
|
||||||
|
mat-chip {
|
||||||
|
|
||||||
|
mat-icon {
|
||||||
|
min-width: 0 !important;
|
||||||
|
min-height: 0 !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Fix: Mat-card-image requires a bigger width than 100%
|
||||||
|
.mat-card-image {
|
||||||
|
max-width: none !important;
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
.secondary-text,
|
.secondary-text,
|
||||||
.mat-icon,
|
.icon,
|
||||||
.icon {
|
i {
|
||||||
color: rgba(0, 0, 0, 0.54);
|
color: rgba(0, 0, 0, 0.54);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -14,7 +14,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Material colors map
|
// Material colors map
|
||||||
$matColorsMap: (
|
$matPalettes: (
|
||||||
primary: $primary,
|
primary: $primary,
|
||||||
accent: $accent,
|
accent: $accent,
|
||||||
warn: $warn,
|
warn: $warn,
|
||||||
@@ -43,75 +43,91 @@ $matColorsMap: (
|
|||||||
);
|
);
|
||||||
|
|
||||||
// Material color hues list
|
// Material color hues list
|
||||||
$matColorHues: 50, 100, 200, 300, 400, 500, 600, 700, 800, 900, A100, A200, A400, A700;
|
$matHues: 50, 100, 200, 300, 400, 500, 600, 700, 800, 900, A100, A200, A400, A700;
|
||||||
|
|
||||||
// Text color levels generator mixin
|
// Text color levels generator mixin
|
||||||
@mixin generateTextColorLevels($baseTextColor) {
|
@mixin generateTextColorLevels($classes, $contrast) {
|
||||||
|
|
||||||
// If the base text color is black...
|
// If the contrast is dark...
|
||||||
@if (rgba(black, 1) == rgba($baseTextColor, 1)) {
|
@if ($contrast == 'dark') {
|
||||||
|
|
||||||
.mat-icon,
|
// Put down the color classes
|
||||||
.icon {
|
#{$classes} {
|
||||||
color: rgba(0, 0, 0, 0.54);
|
|
||||||
}
|
|
||||||
|
|
||||||
&.secondary-text,
|
i,
|
||||||
.secondary-text {
|
.icon {
|
||||||
color: rgba(0, 0, 0, 0.54) !important;
|
color: rgba(0, 0, 0, 0.54);
|
||||||
}
|
}
|
||||||
|
|
||||||
&.hint-text,
|
&.secondary-text,
|
||||||
.hint-text,
|
.secondary-text {
|
||||||
&.disabled-text,
|
color: rgba(0, 0, 0, 0.54) !important;
|
||||||
.disabled-text {
|
}
|
||||||
color: rgba(0, 0, 0, 0.38) !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.divider,
|
&.hint-text,
|
||||||
.divider {
|
.hint-text,
|
||||||
color: rgba(0, 0, 0, 0.12) !important;
|
&.disabled-text,
|
||||||
}
|
.disabled-text {
|
||||||
|
color: rgba(0, 0, 0, 0.38) !important;
|
||||||
|
}
|
||||||
|
|
||||||
.mat-ripple-element {
|
&.divider,
|
||||||
background: rgba(0, 0, 0, 0.1);
|
.divider {
|
||||||
|
color: rgba(0, 0, 0, 0.12) !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mat-ripple-element {
|
||||||
|
background: rgba(0, 0, 0, 0.1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.adaptive-border-color {
|
||||||
|
border-color: rgba(0, 0, 0, 0.12);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
// If the base text color is white...
|
// If the base text color is white...
|
||||||
@else {
|
@else {
|
||||||
|
|
||||||
.mat-icon,
|
// Put down the color classes
|
||||||
.icon {
|
#{$classes} {
|
||||||
color: rgba(255, 255, 255, 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
&.secondary-text,
|
i,
|
||||||
.secondary-text {
|
.icon {
|
||||||
color: rgba(255, 255, 255, 0.70) !important;
|
color: rgba(255, 255, 255, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
&.hint-text,
|
&.secondary-text,
|
||||||
.hint-text,
|
.secondary-text {
|
||||||
&.disabled-text,
|
color: rgba(255, 255, 255, 0.70) !important;
|
||||||
.disabled-text {
|
}
|
||||||
color: rgba(255, 255, 255, 0.50) !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.divider,
|
&.hint-text,
|
||||||
.divider {
|
.hint-text,
|
||||||
color: rgba(255, 255, 255, 0.12) !important;
|
&.disabled-text,
|
||||||
}
|
.disabled-text {
|
||||||
|
color: rgba(255, 255, 255, 0.50) !important;
|
||||||
|
}
|
||||||
|
|
||||||
.mat-ripple-element {
|
&.divider,
|
||||||
background: rgba(255, 255, 255, 0.1);
|
.divider {
|
||||||
|
color: rgba(255, 255, 255, 0.12) !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mat-ripple-element {
|
||||||
|
background: rgba(255, 255, 255, 0.1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.adaptive-border-color {
|
||||||
|
border-color: rgba(255, 255, 255, 0.12);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@mixin generateMaterialElementColors($contrastColor) {
|
@mixin generateMaterialElementColors($classes, $contrast) {
|
||||||
|
|
||||||
// If the contrast color is white...
|
// If the contrast color is light...
|
||||||
$fuseForeground: (
|
$fuseForeground: (
|
||||||
base: white,
|
base: white,
|
||||||
text: white,
|
text: white,
|
||||||
@@ -119,8 +135,8 @@ $matColorHues: 50, 100, 200, 300, 400, 500, 600, 700, 800, 900, A100, A200, A400
|
|||||||
divider: rgba(white, 0.12),
|
divider: rgba(white, 0.12),
|
||||||
);
|
);
|
||||||
|
|
||||||
// If the contrast color is black...
|
// If the contrast color is dark...
|
||||||
@if (rgba(black, 1) == rgba($contrastColor, 1)) {
|
@if ($contrast == 'dark') {
|
||||||
|
|
||||||
$fuseForeground: (
|
$fuseForeground: (
|
||||||
base: black,
|
base: black,
|
||||||
@@ -129,43 +145,47 @@ $matColorHues: 50, 100, 200, 300, 400, 500, 600, 700, 800, 900, A100, A200, A400
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Native Input
|
// Put down the color classes
|
||||||
input[type="text"] {
|
#{$classes} {
|
||||||
color: map_get($fuseForeground, base);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Input
|
// Native Input
|
||||||
.mat-input-placeholder {
|
input[type="text"] {
|
||||||
color: map_get($fuseForeground, hint-text);
|
color: map_get($fuseForeground, base);
|
||||||
}
|
}
|
||||||
|
|
||||||
.mat-input-underline {
|
// Input
|
||||||
background-color: map_get($fuseForeground, divider);
|
.mat-form-field-label {
|
||||||
}
|
color: map_get($fuseForeground, hint-text);
|
||||||
|
}
|
||||||
|
|
||||||
// Select
|
.mat-form-field-underline {
|
||||||
.mat-select-trigger,
|
background-color: map_get($fuseForeground, divider);
|
||||||
.mat-select-arrow {
|
}
|
||||||
color: map_get($fuseForeground, hint-text);
|
|
||||||
}
|
|
||||||
|
|
||||||
.mat-select-underline {
|
// Select
|
||||||
background-color: map_get($fuseForeground, divider);
|
.mat-select-trigger,
|
||||||
}
|
.mat-select-arrow {
|
||||||
|
color: map_get($fuseForeground, hint-text);
|
||||||
|
}
|
||||||
|
|
||||||
.mat-select-disabled .mat-select-value,
|
.mat-select-underline {
|
||||||
.mat-select-arrow,
|
background-color: map_get($fuseForeground, divider);
|
||||||
.mat-select-trigger {
|
}
|
||||||
color: map_get($fuseForeground, hint-text);
|
|
||||||
}
|
|
||||||
|
|
||||||
.mat-select-content,
|
.mat-select-disabled .mat-select-value,
|
||||||
.mat-select-panel-done-animating {
|
.mat-select-arrow,
|
||||||
background: map_get($background, card);
|
.mat-select-trigger {
|
||||||
}
|
color: map_get($fuseForeground, hint-text);
|
||||||
|
}
|
||||||
|
|
||||||
.mat-select-value {
|
.mat-select-content,
|
||||||
color: map_get($fuseForeground, text);
|
.mat-select-panel-done-animating {
|
||||||
|
background: map_get($background, card);
|
||||||
|
}
|
||||||
|
|
||||||
|
.mat-select-value {
|
||||||
|
color: map_get($fuseForeground, text);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -180,14 +200,6 @@ $matColorHues: 50, 100, 200, 300, 400, 500, 600, 700, 800, 900, A100, A200, A400
|
|||||||
background-color: $color !important;
|
background-color: $color !important;
|
||||||
color: $contrastColor !important;
|
color: $contrastColor !important;
|
||||||
|
|
||||||
// Generate text color levels
|
|
||||||
// based on current contrast color
|
|
||||||
@include generateTextColorLevels($contrastColor);
|
|
||||||
|
|
||||||
// Generate material element colors
|
|
||||||
// based on current contrast color
|
|
||||||
@include generateMaterialElementColors($contrastColor);
|
|
||||||
|
|
||||||
&[disabled] {
|
&[disabled] {
|
||||||
background-color: rgba($color, .12) !important;
|
background-color: rgba($color, .12) !important;
|
||||||
color: rgba($contrastColor, .26) !important;
|
color: rgba($contrastColor, .26) !important;
|
||||||
@@ -196,14 +208,6 @@ $matColorHues: 50, 100, 200, 300, 400, 500, 600, 700, 800, 900, A100, A200, A400
|
|||||||
|
|
||||||
.#{$colorName}#{$hue}-fg {
|
.#{$colorName}#{$hue}-fg {
|
||||||
color: $color !important;
|
color: $color !important;
|
||||||
|
|
||||||
// Generate text color levels
|
|
||||||
// based on current contrast color
|
|
||||||
@include generateTextColorLevels($color);
|
|
||||||
|
|
||||||
// Generate material element colors
|
|
||||||
// based on current contrast color
|
|
||||||
@include generateMaterialElementColors($color);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.#{$colorName}#{$hue}-border {
|
.#{$colorName}#{$hue}-border {
|
||||||
@@ -227,22 +231,128 @@ $matColorHues: 50, 100, 200, 300, 400, 500, 600, 700, 800, 900, A100, A200, A400
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@mixin generateFuseColorClasses($primary, $accent, $warn) {
|
||||||
|
|
||||||
|
$palettes: (
|
||||||
|
primary: $primary,
|
||||||
|
accent: $accent,
|
||||||
|
warn: $warn
|
||||||
|
);
|
||||||
|
|
||||||
|
// Define contrast lists
|
||||||
|
$light-contrasting-classes: ();
|
||||||
|
$dark-contrasting-classes: ();
|
||||||
|
|
||||||
|
// Generate the color classes...
|
||||||
|
@each $paletteName, $palette in $palettes {
|
||||||
|
|
||||||
|
// Get the contrasts map
|
||||||
|
$contrasts: map-get($palette, 'contrast');
|
||||||
|
|
||||||
|
@each $hue in $matHues {
|
||||||
|
|
||||||
|
// Get the color and the contrasting color
|
||||||
|
$color: map-get($palette, $hue);
|
||||||
|
$contrast: map-get($contrasts, $hue);
|
||||||
|
|
||||||
|
@if ($color != null and $contrast != null) {
|
||||||
|
|
||||||
|
// Generate color classes
|
||||||
|
@include generateColorClasses($paletteName, $color, $contrast, '-#{$hue}');
|
||||||
|
|
||||||
|
// If the contrast color is dark
|
||||||
|
@if (rgba(black, 1) == rgba($contrast, 1)) {
|
||||||
|
$dark-contrasting-classes: append($dark-contrasting-classes, unquote('.mat-#{$paletteName}-#{$hue}-bg'), 'comma');
|
||||||
|
}
|
||||||
|
// if the contrast color is light
|
||||||
|
@else {
|
||||||
|
$light-contrasting-classes: append($light-contrasting-classes, unquote('.mat-#{$paletteName}-#{$hue}-bg'), 'comma');
|
||||||
|
}
|
||||||
|
|
||||||
|
// Run the generator one more time for default values (500)
|
||||||
|
@if ($hue == 500) {
|
||||||
|
|
||||||
|
// Generate color classes
|
||||||
|
@include generateColorClasses($paletteName, $color, $contrast, '');
|
||||||
|
|
||||||
|
// Add color to the correct list depending on the contrasting color
|
||||||
|
|
||||||
|
// If the contrast color is dark
|
||||||
|
@if (rgba(black, 1) == rgba($contrast, 1)) {
|
||||||
|
$dark-contrasting-classes: append($dark-contrasting-classes, unquote('.mat-#{$paletteName}-bg'), 'comma');
|
||||||
|
}
|
||||||
|
// if the contrast color is light
|
||||||
|
@else {
|
||||||
|
$light-contrasting-classes: append($light-contrasting-classes, unquote('.mat-#{$paletteName}-bg'), 'comma');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Generate contrasting colors
|
||||||
|
@include generateTextColorLevels($dark-contrasting-classes, 'dark');
|
||||||
|
@include generateTextColorLevels($light-contrasting-classes, 'light');
|
||||||
|
@include generateMaterialElementColors($dark-contrasting-classes, 'dark');
|
||||||
|
@include generateMaterialElementColors($light-contrasting-classes, 'light');
|
||||||
|
}
|
||||||
|
|
||||||
// Generate the color classes...
|
// Generate the color classes...
|
||||||
@each $colorName, $colorMap in $matColorsMap {
|
|
||||||
|
|
||||||
@each $hue in $matColorHues {
|
// Define contrast lists
|
||||||
|
$light-contrasting-classes: ();
|
||||||
|
$dark-contrasting-classes: ();
|
||||||
|
|
||||||
$color: map-get($colorMap, $hue);
|
@each $paletteName, $palette in $matPalettes {
|
||||||
$contrastColor: map-get(map-get($colorMap, 'contrast'), $hue);
|
|
||||||
|
|
||||||
@if ($color != null and $contrastColor != null) {
|
// Get the contrasts map
|
||||||
|
$contrasts: map-get($palette, 'contrast');
|
||||||
|
|
||||||
@include generateColorClasses($colorName, $color, $contrastColor, '-#{$hue}');
|
@each $hue in $matHues {
|
||||||
|
|
||||||
|
// Get the color and the contrasting color
|
||||||
|
$color: map-get($palette, $hue);
|
||||||
|
$contrast: map-get($contrasts, $hue);
|
||||||
|
|
||||||
|
@if ($color != null and $contrast != null) {
|
||||||
|
|
||||||
|
// Generate color classes
|
||||||
|
@include generateColorClasses($paletteName, $color, $contrast, '-#{$hue}');
|
||||||
|
|
||||||
|
// Add color to the correct list depending on the contrasting color
|
||||||
|
|
||||||
|
// If the contrast color is dark
|
||||||
|
@if (rgba(black, 1) == rgba($contrast, 1)) {
|
||||||
|
$dark-contrasting-classes: append($dark-contrasting-classes, unquote('.mat-#{$paletteName}-#{$hue}-bg'), 'comma');
|
||||||
|
}
|
||||||
|
// if the contrast color is light
|
||||||
|
@else {
|
||||||
|
$light-contrasting-classes: append($light-contrasting-classes, unquote('.mat-#{$paletteName}-#{$hue}-bg'), 'comma');
|
||||||
|
}
|
||||||
|
|
||||||
// Run the generator one more time for default values (500)
|
// Run the generator one more time for default values (500)
|
||||||
@if ($hue == 500) {
|
@if ($hue == 500) {
|
||||||
@include generateColorClasses($colorName, $color, $contrastColor, '');
|
|
||||||
|
// Generate color classes
|
||||||
|
@include generateColorClasses($paletteName, $color, $contrast, '');
|
||||||
|
|
||||||
|
// Add color to the correct list depending on the contrasting color
|
||||||
|
|
||||||
|
// If the contrast color is dark
|
||||||
|
@if (rgba(black, 1) == rgba($contrast, 1)) {
|
||||||
|
$dark-contrasting-classes: append($dark-contrasting-classes, unquote('.mat-#{$paletteName}-bg'), 'comma');
|
||||||
|
}
|
||||||
|
// if the contrast color is light
|
||||||
|
@else {
|
||||||
|
$light-contrasting-classes: append($light-contrasting-classes, unquote('.mat-#{$paletteName}-bg'), 'comma');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Generate contrasting colors
|
||||||
|
@include generateTextColorLevels($dark-contrasting-classes, 'dark');
|
||||||
|
@include generateTextColorLevels($light-contrasting-classes, 'light');
|
||||||
|
@include generateMaterialElementColors($dark-contrasting-classes, 'dark');
|
||||||
|
@include generateMaterialElementColors($light-contrasting-classes, 'light');
|
||||||
|
|||||||
42
src/@fuse/scss/partials/_docs.scss
Normal file
42
src/@fuse/scss/partials/_docs.scss
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
.docs {
|
||||||
|
font-size: 16px;
|
||||||
|
|
||||||
|
> .content {
|
||||||
|
max-width: 980px;
|
||||||
|
|
||||||
|
> .main-title {
|
||||||
|
|
||||||
|
&:first-child {
|
||||||
|
margin-top: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.main-title {
|
||||||
|
display: flex;
|
||||||
|
margin-top: 72px;
|
||||||
|
font-size: 24px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.section-title {
|
||||||
|
display: inline-flex;
|
||||||
|
font-size: 18px;
|
||||||
|
margin-top: 24px;
|
||||||
|
border-bottom: 1px solid #F44336;
|
||||||
|
color: #F44336;
|
||||||
|
}
|
||||||
|
|
||||||
|
ol,
|
||||||
|
ul {
|
||||||
|
padding-left: 24px;
|
||||||
|
|
||||||
|
li {
|
||||||
|
margin-bottom: 12px;
|
||||||
|
line-height: 1.7;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
p {
|
||||||
|
line-height: 1.7;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,6 +1,13 @@
|
|||||||
|
html,
|
||||||
body {
|
body {
|
||||||
|
display: flex;
|
||||||
> mat-sidenav-container {
|
flex: 1 0 auto;
|
||||||
height: 100%;
|
width: 100%;
|
||||||
}
|
height: 100%;
|
||||||
}
|
max-height: 100%;
|
||||||
|
min-height: 100%;
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
overflow: hidden;
|
||||||
|
background: #F5F5F5;
|
||||||
|
}
|
||||||
@@ -1,6 +1,5 @@
|
|||||||
i,
|
i,
|
||||||
mat-icon {
|
mat-icon {
|
||||||
color: rgba(0, 0, 0, 0.54);
|
|
||||||
font-size: 24px;
|
font-size: 24px;
|
||||||
width: 24px;
|
width: 24px;
|
||||||
height: 24px;
|
height: 24px;
|
||||||
|
|||||||
@@ -42,7 +42,7 @@
|
|||||||
color: currentColor;
|
color: currentColor;
|
||||||
|
|
||||||
> .nav-link-title {
|
> .nav-link-title {
|
||||||
flex: 1;
|
flex: 1 1 auto;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -58,7 +58,7 @@
|
|||||||
transition: opacity 0.2s ease-in-out 0.1s;
|
transition: opacity 0.2s ease-in-out 0.1s;
|
||||||
margin-left: 8px;
|
margin-left: 8px;
|
||||||
|
|
||||||
+ .collapse-arrow {
|
+ .collapsable-arrow {
|
||||||
margin-left: 8px;
|
margin-left: 8px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -72,14 +72,9 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
&.active {
|
&.active {
|
||||||
background-color: mat-color($accent);
|
|
||||||
|
|
||||||
.mat-ripple-element {
|
.nav-link-icon {
|
||||||
background-color: mat-color($accent, default-contrast, 0.1);
|
opacity: 1;
|
||||||
}
|
|
||||||
|
|
||||||
&, .nav-link-icon {
|
|
||||||
color: mat-color($accent, default-contrast);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.nav-link-badge {
|
.nav-link-badge {
|
||||||
@@ -90,10 +85,11 @@
|
|||||||
|
|
||||||
.nav-link-icon {
|
.nav-link-icon {
|
||||||
margin-right: 16px;
|
margin-right: 16px;
|
||||||
|
opacity: 0.7;
|
||||||
}
|
}
|
||||||
|
|
||||||
.nav-link-icon,
|
.nav-link-icon,
|
||||||
.collapse-arrow {
|
.collapsable-arrow {
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
width: 16px;
|
width: 16px;
|
||||||
height: 16px;
|
height: 16px;
|
||||||
@@ -103,7 +99,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&.nav-collapse {
|
&.nav-collapsable {
|
||||||
display: block;
|
display: block;
|
||||||
|
|
||||||
> .children {
|
> .children {
|
||||||
@@ -135,7 +131,7 @@
|
|||||||
|
|
||||||
> .nav-item {
|
> .nav-item {
|
||||||
|
|
||||||
&.nav-collapse {
|
&.nav-collapsable {
|
||||||
background: transparent;
|
background: transparent;
|
||||||
transition: background 200ms ease-in-out;
|
transition: background 200ms ease-in-out;
|
||||||
|
|
||||||
@@ -149,7 +145,7 @@
|
|||||||
|
|
||||||
> .group-items {
|
> .group-items {
|
||||||
|
|
||||||
> .nav-collapse {
|
> .nav-collapsable {
|
||||||
background: transparent;
|
background: transparent;
|
||||||
transition: background 200ms ease-in-out;
|
transition: background 200ms ease-in-out;
|
||||||
|
|
||||||
@@ -176,7 +172,7 @@
|
|||||||
|
|
||||||
.nav-item {
|
.nav-item {
|
||||||
|
|
||||||
&.nav-collapse {
|
&.nav-collapsable {
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
||||||
.children {
|
.children {
|
||||||
@@ -205,13 +201,13 @@
|
|||||||
height: 56px;
|
height: 56px;
|
||||||
}
|
}
|
||||||
|
|
||||||
&.nav-collapse {
|
&.nav-collapsable {
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
||||||
> .nav-link {
|
> .nav-link {
|
||||||
height: 56px;
|
height: 56px;
|
||||||
|
|
||||||
.collapse-arrow {
|
.collapsable-arrow {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -223,4 +219,26 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Material style
|
||||||
|
&.material {
|
||||||
|
|
||||||
|
.nav-subheader {
|
||||||
|
border-top: 1px solid rgba(0, 0, 0, 0.12);
|
||||||
|
|
||||||
|
&:first-child {
|
||||||
|
border-top: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-item {
|
||||||
|
|
||||||
|
.nav-link {
|
||||||
|
height: 40px;
|
||||||
|
padding: 0 16px;
|
||||||
|
margin: 4px 8px;
|
||||||
|
border-radius: 4px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,13 +10,9 @@ $header-height-sm: 100px !default;
|
|||||||
$carded-header-height-without-toolbar: $carded-header-height - $carded-toolbar-height;
|
$carded-header-height-without-toolbar: $carded-header-height - $carded-toolbar-height;
|
||||||
$carded-header-height-without-toolbar-sm: $carded-header-height-sm - $carded-toolbar-height;
|
$carded-header-height-without-toolbar-sm: $carded-header-height-sm - $carded-toolbar-height;
|
||||||
|
|
||||||
// Top bg image
|
|
||||||
$top-bg-image: url('assets/images/backgrounds/header-bg.png');
|
|
||||||
|
|
||||||
.page-layout {
|
.page-layout {
|
||||||
position: relative;
|
position: relative;
|
||||||
overflow-x: hidden;
|
overflow: hidden;
|
||||||
overflow-y: auto;
|
|
||||||
|
|
||||||
// Carded layout
|
// Carded layout
|
||||||
&.carded {
|
&.carded {
|
||||||
@@ -27,15 +23,13 @@ $top-bg-image: url('assets/images/backgrounds/header-bg.png');
|
|||||||
min-width: 100%;
|
min-width: 100%;
|
||||||
|
|
||||||
// Top bg
|
// Top bg
|
||||||
.top-bg {
|
> .top-bg {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
top: 0;
|
top: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
height: $carded-header-height;
|
height: $carded-header-height;
|
||||||
background-image: $top-bg-image;
|
|
||||||
background-size: cover;
|
|
||||||
|
|
||||||
@include media-breakpoint-down('sm') {
|
@include media-breakpoint-down('sm') {
|
||||||
height: $carded-header-height-sm;
|
height: $carded-header-height-sm;
|
||||||
@@ -45,48 +39,39 @@ $top-bg-image: url('assets/images/backgrounds/header-bg.png');
|
|||||||
// Fullwidth
|
// Fullwidth
|
||||||
&.fullwidth {
|
&.fullwidth {
|
||||||
|
|
||||||
// Single scroll
|
|
||||||
&.single-scroll {
|
|
||||||
|
|
||||||
> .center {
|
|
||||||
flex: 1 0 auto;
|
|
||||||
max-height: none;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Center
|
// Center
|
||||||
> .center {
|
> .center {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
flex: 1;
|
flex: 1 0 auto;
|
||||||
position: relative;
|
position: relative;
|
||||||
z-index: 2;
|
z-index: 2;
|
||||||
padding: 0 32px;
|
padding: 0 32px;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
min-width: 100%;
|
min-width: 0;
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
max-height: 100%;
|
max-height: 100%;
|
||||||
|
|
||||||
.header {
|
> .header {
|
||||||
height: $carded-header-height-without-toolbar;
|
height: $carded-header-height-without-toolbar !important;
|
||||||
min-height: $carded-header-height-without-toolbar;
|
min-height: $carded-header-height-without-toolbar !important;
|
||||||
max-height: $carded-header-height-without-toolbar;
|
max-height: $carded-header-height-without-toolbar !important;
|
||||||
|
|
||||||
@include media-breakpoint-down('sm') {
|
@include media-breakpoint-down('sm') {
|
||||||
height: $carded-header-height-without-toolbar-sm;
|
height: $carded-header-height-without-toolbar-sm !important;
|
||||||
min-height: $carded-header-height-without-toolbar-sm;
|
min-height: $carded-header-height-without-toolbar-sm !important;
|
||||||
max-height: $carded-header-height-without-toolbar-sm;
|
max-height: $carded-header-height-without-toolbar-sm !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.content-card {
|
> .content-card {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
flex: 1;
|
flex: 1 0 auto;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
@include mat-elevation(7);
|
@include mat-elevation(7);
|
||||||
|
|
||||||
.toolbar {
|
> .toolbar {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: flex-start;
|
justify-content: flex-start;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@@ -97,128 +82,7 @@ $top-bg-image: url('assets/images/backgrounds/header-bg.png');
|
|||||||
}
|
}
|
||||||
|
|
||||||
> .content {
|
> .content {
|
||||||
display: flex;
|
flex: 1 0 auto;
|
||||||
flex: 1;
|
|
||||||
overflow: auto;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Left sidenav - Right sidenav
|
|
||||||
&.left-sidenav,
|
|
||||||
&.right-sidenav {
|
|
||||||
|
|
||||||
// Single scroll
|
|
||||||
&.single-scroll {
|
|
||||||
|
|
||||||
> mat-sidenav-container {
|
|
||||||
flex: 1 0 auto;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
> mat-sidenav-container {
|
|
||||||
display: flex;
|
|
||||||
flex: 1;
|
|
||||||
background: none;
|
|
||||||
z-index: 2;
|
|
||||||
width: 100%;
|
|
||||||
|
|
||||||
.sidenav {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
flex: 1;
|
|
||||||
width: 240px;
|
|
||||||
min-width: 240px;
|
|
||||||
max-width: 240px;
|
|
||||||
height: auto;
|
|
||||||
z-index: 4;
|
|
||||||
overflow-y: hidden;
|
|
||||||
@include mat-elevation(7);
|
|
||||||
|
|
||||||
&.mat-is-locked-open {
|
|
||||||
background: none;
|
|
||||||
box-shadow: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.header {
|
|
||||||
height: $carded-header-height;
|
|
||||||
min-height: $carded-header-height;
|
|
||||||
max-height: $carded-header-height;
|
|
||||||
|
|
||||||
@include media-breakpoint-down('sm') {
|
|
||||||
height: $carded-header-height-sm;
|
|
||||||
min-height: $carded-header-height-sm;
|
|
||||||
max-height: $carded-header-height-sm;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.content {
|
|
||||||
background: transparent;
|
|
||||||
overflow: auto;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
> .mat-sidenav-content,
|
|
||||||
> .mat-drawer-content {
|
|
||||||
display: flex;
|
|
||||||
flex: 1;
|
|
||||||
height: auto;
|
|
||||||
overflow: visible;
|
|
||||||
|
|
||||||
// Center
|
|
||||||
.center {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
flex: 1;
|
|
||||||
position: relative;
|
|
||||||
z-index: 3;
|
|
||||||
margin-left: 32px;
|
|
||||||
margin-right: 32px;
|
|
||||||
|
|
||||||
.header {
|
|
||||||
display: flex;
|
|
||||||
height: $carded-header-height-without-toolbar;
|
|
||||||
min-height: $carded-header-height-without-toolbar;
|
|
||||||
max-height: $carded-header-height-without-toolbar;
|
|
||||||
|
|
||||||
@include media-breakpoint-down('sm') {
|
|
||||||
height: $carded-header-height-without-toolbar-sm;
|
|
||||||
min-height: $carded-header-height-without-toolbar-sm;
|
|
||||||
max-height: $carded-header-height-without-toolbar-sm;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.content-card {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
flex: 1;
|
|
||||||
overflow: hidden;
|
|
||||||
@include mat-elevation(7);
|
|
||||||
|
|
||||||
.toolbar {
|
|
||||||
display: flex;
|
|
||||||
justify-content: flex-start;
|
|
||||||
align-items: center;
|
|
||||||
flex: 1;
|
|
||||||
border-bottom: 1px solid rgba(0, 0, 0, 0.12);
|
|
||||||
height: $carded-toolbar-height;
|
|
||||||
min-height: $carded-toolbar-height;
|
|
||||||
max-height: $carded-toolbar-height;
|
|
||||||
|
|
||||||
.sidenav-toggle {
|
|
||||||
margin: 0 8px 0 0 !important;
|
|
||||||
padding: 0 !important;
|
|
||||||
border-radius: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.content {
|
|
||||||
display: flex;
|
|
||||||
flex: 1;
|
|
||||||
overflow: auto;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -226,51 +90,82 @@ $top-bg-image: url('assets/images/backgrounds/header-bg.png');
|
|||||||
// Tabbed
|
// Tabbed
|
||||||
&.tabbed {
|
&.tabbed {
|
||||||
|
|
||||||
> mat-sidenav-container {
|
> .center {
|
||||||
|
width: 100%;
|
||||||
|
min-width: 0;
|
||||||
|
|
||||||
> .mat-sidenav-content,
|
> .header {
|
||||||
> .mat-drawer-content {
|
flex: 1 1 auto;
|
||||||
width: calc(100% - 240px);
|
}
|
||||||
min-width: 0;
|
|
||||||
|
|
||||||
.center {
|
> .content-card {
|
||||||
width: calc(100% - 32px);
|
|
||||||
min-width: 0;
|
|
||||||
|
|
||||||
@include media-breakpoint-down('md') {
|
> .content {
|
||||||
width: calc(100% - 64px);
|
display: flex;
|
||||||
}
|
|
||||||
|
|
||||||
.header {
|
> .mat-tab-group {
|
||||||
flex: 1;
|
overflow: hidden;
|
||||||
}
|
|
||||||
|
|
||||||
.content-card {
|
.mat-tab-header {
|
||||||
|
|
||||||
.content {
|
.mat-tab-label {
|
||||||
|
height: 64px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.mat-tab-group {
|
.mat-tab-body {
|
||||||
|
overflow: hidden;
|
||||||
|
|
||||||
|
.mat-tab-body-content {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
|
||||||
.mat-tab-header {
|
.tab-content {
|
||||||
|
position: relative;
|
||||||
.mat-tab-label {
|
width: 100%;
|
||||||
height: 64px;
|
height: 100%;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.mat-tab-body {
|
// Inner scroll
|
||||||
overflow: hidden;
|
&.inner-scroll {
|
||||||
|
flex: 1 1 auto;
|
||||||
|
|
||||||
.mat-tab-body-content {
|
> .center {
|
||||||
overflow: hidden;
|
flex: 1 1 auto;
|
||||||
|
|
||||||
.tab-content {
|
> .content-card {
|
||||||
position: relative;
|
flex: 1 1 auto;
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
> .content {
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
}
|
flex: 1 1 auto;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Tabbed
|
||||||
|
&.tabbed {
|
||||||
|
|
||||||
|
> .center {
|
||||||
|
|
||||||
|
> .content-card {
|
||||||
|
|
||||||
|
> .content {
|
||||||
|
|
||||||
|
> .mat-tab-group {
|
||||||
|
|
||||||
|
.mat-tab-body {
|
||||||
|
|
||||||
|
.mat-tab-body-content {
|
||||||
|
|
||||||
|
.tab-content {
|
||||||
|
overflow: auto;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -282,21 +177,212 @@ $top-bg-image: url('assets/images/backgrounds/header-bg.png');
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Left sidenav
|
// Left / Right sidebar
|
||||||
&.left-sidenav {
|
&.left-sidebar,
|
||||||
|
&.right-sidebar {
|
||||||
|
flex-direction: row;
|
||||||
|
|
||||||
// Sidenav
|
// Sidebar
|
||||||
> mat-sidenav-container {
|
> .sidebar {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
flex: 1 1 auto;
|
||||||
|
width: 240px;
|
||||||
|
min-width: 240px;
|
||||||
|
max-width: 240px;
|
||||||
|
height: auto;
|
||||||
|
overflow: hidden;
|
||||||
|
@include mat-elevation(7);
|
||||||
|
|
||||||
.sidenav {
|
&.locked-open {
|
||||||
|
background: none;
|
||||||
|
box-shadow: none;
|
||||||
|
|
||||||
&.mat-is-locked-open {
|
+ .center {
|
||||||
|
z-index: 1001;
|
||||||
|
}
|
||||||
|
|
||||||
~ .mat-sidenav-content,
|
&.left-positioned {
|
||||||
~ .mat-drawer-content {
|
|
||||||
|
|
||||||
.center {
|
+ .center {
|
||||||
margin-left: 0;
|
margin-left: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&.right-positioned {
|
||||||
|
|
||||||
|
+ .center {
|
||||||
|
margin-right: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.header {
|
||||||
|
height: $carded-header-height;
|
||||||
|
min-height: $carded-header-height;
|
||||||
|
max-height: $carded-header-height;
|
||||||
|
|
||||||
|
@include media-breakpoint-down('sm') {
|
||||||
|
height: $carded-header-height-sm;
|
||||||
|
min-height: $carded-header-height-sm;
|
||||||
|
max-height: $carded-header-height-sm;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.content {
|
||||||
|
background: transparent;
|
||||||
|
flex: 1 1 auto;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Center
|
||||||
|
> .center {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
flex: 1 1 auto;
|
||||||
|
position: relative;
|
||||||
|
z-index: 3;
|
||||||
|
margin-left: 32px;
|
||||||
|
margin-right: 32px;
|
||||||
|
min-width: 0;
|
||||||
|
|
||||||
|
> .header {
|
||||||
|
display: flex;
|
||||||
|
height: $carded-header-height-without-toolbar;
|
||||||
|
min-height: $carded-header-height-without-toolbar;
|
||||||
|
max-height: $carded-header-height-without-toolbar;
|
||||||
|
|
||||||
|
@include media-breakpoint-down('sm') {
|
||||||
|
height: $carded-header-height-without-toolbar-sm;
|
||||||
|
min-height: $carded-header-height-without-toolbar-sm;
|
||||||
|
max-height: $carded-header-height-without-toolbar-sm;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
> .content-card {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
flex: 1 1 auto;
|
||||||
|
overflow: hidden;
|
||||||
|
@include mat-elevation(7);
|
||||||
|
|
||||||
|
> .toolbar {
|
||||||
|
display: flex;
|
||||||
|
justify-content: flex-start;
|
||||||
|
align-items: center;
|
||||||
|
flex: 1 1 auto;
|
||||||
|
border-bottom: 1px solid rgba(0, 0, 0, 0.12);
|
||||||
|
height: $carded-toolbar-height;
|
||||||
|
min-height: $carded-toolbar-height;
|
||||||
|
max-height: $carded-toolbar-height;
|
||||||
|
|
||||||
|
.sidebar-toggle {
|
||||||
|
margin: 0 8px 0 0 !important;
|
||||||
|
padding: 0 !important;
|
||||||
|
border-radius: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
> .content {
|
||||||
|
flex: 1 1 auto;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Tabbed
|
||||||
|
&.tabbed {
|
||||||
|
|
||||||
|
> .center {
|
||||||
|
width: calc(100% - 32px);
|
||||||
|
min-width: 0;
|
||||||
|
|
||||||
|
@include media-breakpoint-down('md') {
|
||||||
|
width: calc(100% - 64px);
|
||||||
|
}
|
||||||
|
|
||||||
|
> .header {
|
||||||
|
flex: 1 1 auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
> .content-card {
|
||||||
|
|
||||||
|
> .content {
|
||||||
|
display: flex;
|
||||||
|
|
||||||
|
> .mat-tab-group {
|
||||||
|
overflow: hidden;
|
||||||
|
|
||||||
|
.mat-tab-header {
|
||||||
|
|
||||||
|
.mat-tab-label {
|
||||||
|
height: 64px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.mat-tab-body {
|
||||||
|
overflow: hidden;
|
||||||
|
|
||||||
|
.mat-tab-body-content {
|
||||||
|
overflow: hidden;
|
||||||
|
|
||||||
|
.tab-content {
|
||||||
|
position: relative;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Inner scroll
|
||||||
|
&.inner-scroll {
|
||||||
|
flex: 1 1 auto;
|
||||||
|
|
||||||
|
> .sidebar {
|
||||||
|
|
||||||
|
.content {
|
||||||
|
overflow: auto;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
> .center {
|
||||||
|
flex: 1 1 auto;
|
||||||
|
|
||||||
|
> .content-card {
|
||||||
|
flex: 1 1 auto;
|
||||||
|
|
||||||
|
> .content {
|
||||||
|
flex: 1 1 auto;
|
||||||
|
overflow: auto;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Tabbed
|
||||||
|
&.tabbed {
|
||||||
|
|
||||||
|
> .center {
|
||||||
|
|
||||||
|
> .content-card {
|
||||||
|
|
||||||
|
> .content {
|
||||||
|
|
||||||
|
> .mat-tab-group {
|
||||||
|
|
||||||
|
.mat-tab-body {
|
||||||
|
|
||||||
|
.mat-tab-body-content {
|
||||||
|
|
||||||
|
.tab-content {
|
||||||
|
overflow: auto;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -304,26 +390,15 @@ $top-bg-image: url('assets/images/backgrounds/header-bg.png');
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Right sidenav
|
// Right sidebar specific
|
||||||
&.right-sidenav {
|
&.right-sidebar {
|
||||||
|
|
||||||
// Sidenav
|
> .sidebar {
|
||||||
> mat-sidenav-container {
|
order: 2;
|
||||||
|
}
|
||||||
|
|
||||||
.sidenav {
|
> .center {
|
||||||
order: 999;
|
order: 1;
|
||||||
|
|
||||||
&.mat-is-locked-open {
|
|
||||||
|
|
||||||
~ .mat-sidenav-content,
|
|
||||||
~ .mat-drawer-content {
|
|
||||||
|
|
||||||
.center {
|
|
||||||
margin-right: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -336,20 +411,17 @@ $top-bg-image: url('assets/images/backgrounds/header-bg.png');
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
min-width: 100%;
|
min-width: 100%;
|
||||||
|
|
||||||
// Top bg
|
|
||||||
> .header {
|
|
||||||
background-image: $top-bg-image;
|
|
||||||
background-size: cover;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Fullwidth
|
// Fullwidth
|
||||||
&.fullwidth {
|
&.fullwidth {
|
||||||
overflow: auto;
|
|
||||||
|
> .content {
|
||||||
|
flex: 1 1 auto;
|
||||||
|
min-width: 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&.fullwidth,
|
&.fullwidth,
|
||||||
&.inner-sidenav {
|
&.inner-sidebar {
|
||||||
min-height: 100%;
|
|
||||||
|
|
||||||
> .header {
|
> .header {
|
||||||
height: $header-height;
|
height: $header-height;
|
||||||
@@ -358,109 +430,138 @@ $top-bg-image: url('assets/images/backgrounds/header-bg.png');
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Left sidenav - Right sidenav
|
// Left / Right sidebar
|
||||||
&.left-sidenav,
|
&.left-sidebar,
|
||||||
&.right-sidenav {
|
&.right-sidebar {
|
||||||
|
flex-direction: row;
|
||||||
|
|
||||||
// Single scroll
|
// Sidebar
|
||||||
&.single-scroll {
|
> .sidebar {
|
||||||
|
width: 240px;
|
||||||
|
min-width: 240px;
|
||||||
|
max-width: 240px;
|
||||||
|
overflow: hidden;
|
||||||
|
@include mat-elevation(7);
|
||||||
|
|
||||||
> mat-sidenav-container {
|
&.locked-open {
|
||||||
flex: 1 0 auto;
|
background: none;
|
||||||
|
box-shadow: none;
|
||||||
|
|
||||||
> .mat-sidenav-content,
|
+ .center {
|
||||||
> .mat-drawer-content {
|
z-index: 1001;
|
||||||
flex: 1 0 auto;
|
|
||||||
max-height: none;
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Inner Sidenav
|
&.left-positioned {
|
||||||
&.inner-sidenav {
|
|
||||||
|
|
||||||
> mat-sidenav-container {
|
+ .center {
|
||||||
flex: 1;
|
margin-left: 0;
|
||||||
|
|
||||||
.sidenav {
|
|
||||||
|
|
||||||
.sidenav-content {
|
|
||||||
height: 100%;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
> .mat-sidenav-content,
|
&.right-positioned {
|
||||||
> .mat-drawer-content {
|
|
||||||
display: flex;
|
|
||||||
height: auto;
|
|
||||||
|
|
||||||
.center {
|
+ .center {
|
||||||
flex: 1;
|
margin-right: 0;
|
||||||
min-height: 100%;
|
|
||||||
@include mat-elevation(0);
|
|
||||||
|
|
||||||
.content {
|
|
||||||
display: flex;
|
|
||||||
flex: 1 0 auto;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.content {
|
||||||
|
flex: 1 1 auto;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
> mat-sidenav-container {
|
// Center
|
||||||
|
> .center {
|
||||||
|
position: relative;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
flex: 1;
|
flex: 1 1 auto;
|
||||||
background: none;
|
z-index: 3;
|
||||||
z-index: 2;
|
min-width: 0;
|
||||||
width: 100%;
|
@include mat-elevation(7);
|
||||||
|
|
||||||
.sidenav {
|
> .header {
|
||||||
width: 240px;
|
height: $header-height;
|
||||||
min-width: 240px;
|
min-height: $header-height;
|
||||||
max-width: 240px;
|
max-height: $header-height;
|
||||||
z-index: 51;
|
}
|
||||||
@include mat-elevation(7);
|
|
||||||
|
|
||||||
&.mat-is-locked-open {
|
> .content {
|
||||||
width: 220px;
|
flex: 1 0 auto;
|
||||||
min-width: 220px;
|
}
|
||||||
max-width: 220px;
|
}
|
||||||
box-shadow: none;
|
|
||||||
background: transparent;
|
|
||||||
}
|
|
||||||
|
|
||||||
.sidenav-content {
|
// Inner scroll
|
||||||
height: 100%;
|
&.inner-scroll {
|
||||||
|
flex: 1 1 auto;
|
||||||
|
|
||||||
|
> .sidebar {
|
||||||
|
|
||||||
|
.content {
|
||||||
|
overflow: auto;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
> .mat-sidenav-content,
|
> .center {
|
||||||
> .mat-drawer-content {
|
flex: 1 1 auto;
|
||||||
|
overflow: auto;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Inner Sidebar
|
||||||
|
&.inner-sidebar {
|
||||||
|
flex-direction: column;
|
||||||
|
overflow: hidden;
|
||||||
|
height: 100%;
|
||||||
|
|
||||||
|
> .content {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex: 1;
|
min-height: 0;
|
||||||
height: auto;
|
|
||||||
overflow: visible;
|
|
||||||
max-height: 100%;
|
|
||||||
|
|
||||||
.header {
|
> .sidebar {
|
||||||
height: $header-height;
|
|
||||||
min-height: $header-height;
|
|
||||||
max-height: $header-height;
|
|
||||||
background-image: $top-bg-image;
|
|
||||||
}
|
|
||||||
|
|
||||||
.center {
|
&.locked-open {
|
||||||
display: flex;
|
background: none;
|
||||||
flex-direction: column;
|
box-shadow: none;
|
||||||
flex: 1;
|
}
|
||||||
overflow: auto;
|
|
||||||
@include mat-elevation(7);
|
|
||||||
|
|
||||||
.content {
|
.content {
|
||||||
|
overflow: auto;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
> .center {
|
||||||
|
flex: 1 1 auto;
|
||||||
|
overflow: auto;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Right sidebar specific
|
||||||
|
&.right-sidebar {
|
||||||
|
|
||||||
|
> .sidebar {
|
||||||
|
order: 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
> .center {
|
||||||
|
order: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Inner sidebar
|
||||||
|
&.inner-sidebar {
|
||||||
|
|
||||||
|
> .content {
|
||||||
|
|
||||||
|
> .sidebar {
|
||||||
|
order: 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
> .center {
|
||||||
|
order: 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -469,7 +570,7 @@ $top-bg-image: url('assets/images/backgrounds/header-bg.png');
|
|||||||
&.tabbed {
|
&.tabbed {
|
||||||
min-height: 100%;
|
min-height: 100%;
|
||||||
|
|
||||||
.header {
|
> .header {
|
||||||
height: $header-height;
|
height: $header-height;
|
||||||
min-height: $header-height;
|
min-height: $header-height;
|
||||||
max-height: $header-height;
|
max-height: $header-height;
|
||||||
@@ -477,7 +578,7 @@ $top-bg-image: url('assets/images/backgrounds/header-bg.png');
|
|||||||
|
|
||||||
> .content {
|
> .content {
|
||||||
|
|
||||||
.mat-tab-group {
|
> .mat-tab-group {
|
||||||
|
|
||||||
.mat-tab-labels {
|
.mat-tab-labels {
|
||||||
padding: 0 24px;
|
padding: 0 24px;
|
||||||
@@ -495,50 +596,6 @@ $top-bg-image: url('assets/images/backgrounds/header-bg.png');
|
|||||||
|
|
||||||
@include media-breakpoint-down('xs') {
|
@include media-breakpoint-down('xs') {
|
||||||
|
|
||||||
// Activate single-scroll
|
|
||||||
&.carded {
|
|
||||||
|
|
||||||
&.fullwidth {
|
|
||||||
|
|
||||||
> .center {
|
|
||||||
flex: 1 0 auto;
|
|
||||||
max-height: none;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&.left-sidenav,
|
|
||||||
&.right-sidenav {
|
|
||||||
|
|
||||||
> mat-sidenav-container {
|
|
||||||
flex: 1 0 auto;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&.simple {
|
|
||||||
|
|
||||||
&.fullwidth {
|
|
||||||
|
|
||||||
> .content {
|
|
||||||
flex: 1 0 auto;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&.left-sidenav,
|
|
||||||
&.right-sidenav {
|
|
||||||
|
|
||||||
> mat-sidenav-container {
|
|
||||||
flex: 1 0 auto !important;
|
|
||||||
|
|
||||||
> .mat-sidenav-content,
|
|
||||||
> .mat-drawer-content {
|
|
||||||
flex: 1 0 auto;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// End - Activate single-scroll
|
|
||||||
|
|
||||||
// Smaller margins
|
// Smaller margins
|
||||||
&.carded {
|
&.carded {
|
||||||
|
|
||||||
@@ -549,18 +606,11 @@ $top-bg-image: url('assets/images/backgrounds/header-bg.png');
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&.left-sidenav,
|
&.left-sidebar,
|
||||||
&.right-sidenav {
|
&.right-sidebar {
|
||||||
|
|
||||||
> mat-sidenav-container {
|
> .center {
|
||||||
|
margin: 0 16px;
|
||||||
> .mat-sidenav-content,
|
|
||||||
> .mat-drawer-content {
|
|
||||||
|
|
||||||
.center {
|
|
||||||
margin: 0 16px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,13 +34,13 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* General styles */
|
/* General styles */
|
||||||
fuse-root {
|
app {
|
||||||
|
|
||||||
fuse-navbar-vertical,
|
fuse-sidebar,
|
||||||
fuse-navbar-horizontal,
|
navbar,
|
||||||
fuse-toolbar,
|
toolbar,
|
||||||
fuse-footer,
|
footer,
|
||||||
fuse-quick-panel,
|
.theme-options-button,
|
||||||
fuse-theme-options,
|
fuse-theme-options,
|
||||||
.ps > .ps__rail-x,
|
.ps > .ps__rail-x,
|
||||||
.ps > .ps__rail-y {
|
.ps > .ps__rail-y {
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ html, body {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Reset non angular-material input's default browser/os styles
|
// Reset non angular-material input's default browser/os styles
|
||||||
*:not(mat-input-container) {
|
*:not(mat-form-field) {
|
||||||
|
|
||||||
> input {
|
> input {
|
||||||
border: none;
|
border: none;
|
||||||
@@ -55,7 +55,7 @@ html, body {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
*:not(mat-input-container) {
|
*:not(mat-form-field) {
|
||||||
|
|
||||||
> input[type="button"],
|
> input[type="button"],
|
||||||
> button,
|
> button,
|
||||||
|
|||||||
@@ -274,4 +274,119 @@ strong {
|
|||||||
// Nowrap
|
// Nowrap
|
||||||
.text-nowrap {
|
.text-nowrap {
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Changelog
|
||||||
|
.changelog {
|
||||||
|
|
||||||
|
.entry {
|
||||||
|
background: white;
|
||||||
|
margin-bottom: 24px;
|
||||||
|
padding: 24px 32px;
|
||||||
|
@include mat-elevation(2);
|
||||||
|
|
||||||
|
> .title {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
margin-bottom: 24px;
|
||||||
|
|
||||||
|
.version {
|
||||||
|
font-size: 24px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.date {
|
||||||
|
margin-left: 8px;
|
||||||
|
font-size: 17px;
|
||||||
|
opacity: 0.54;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.groups {
|
||||||
|
|
||||||
|
div {
|
||||||
|
margin-bottom: 32px;
|
||||||
|
|
||||||
|
&:last-child {
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.title {
|
||||||
|
display: inline-flex;
|
||||||
|
font-size: 13px;
|
||||||
|
color: white;
|
||||||
|
letter-spacing: 0.015em;
|
||||||
|
line-height: 1;
|
||||||
|
padding: 5px 8px;
|
||||||
|
border-radius: 2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.breaking-changes {
|
||||||
|
|
||||||
|
.title {
|
||||||
|
background: #F44336;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.new {
|
||||||
|
|
||||||
|
.title {
|
||||||
|
background: #43A047;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.improved {
|
||||||
|
|
||||||
|
.title {
|
||||||
|
background: #673AB7;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.fixed {
|
||||||
|
|
||||||
|
.title {
|
||||||
|
background: #2196F3;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ul {
|
||||||
|
padding-left: 24px;
|
||||||
|
|
||||||
|
li {
|
||||||
|
margin-bottom: 6px;
|
||||||
|
letter-spacing: 0.015em;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Message boxes
|
||||||
|
.message-box {
|
||||||
|
padding: 16px;
|
||||||
|
background: #607D8B;
|
||||||
|
border-left: 6px solid #37474F;
|
||||||
|
color: rgba(255, 255, 255, 1);
|
||||||
|
|
||||||
|
&.error {
|
||||||
|
background: #EF5350;
|
||||||
|
border-left-color: #B71C1C;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.warning {
|
||||||
|
background: #FFECB3;
|
||||||
|
border-left-color: #FFC107;
|
||||||
|
color: rgba(0, 0, 0, 0.87);
|
||||||
|
}
|
||||||
|
|
||||||
|
&.success {
|
||||||
|
background: #4CAF50;
|
||||||
|
border-left-color: #2E7D32;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.info {
|
||||||
|
background: #B3E5FC;
|
||||||
|
border-left-color: #03A9F4;
|
||||||
|
color: rgba(0, 0, 0, 0.87);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -104,9 +104,9 @@ $code-color-attr-name: #B65611 !default;
|
|||||||
|
|
||||||
// whitespace management
|
// whitespace management
|
||||||
white-space: pre; // fallback
|
white-space: pre; // fallback
|
||||||
white-space: pre-wrap;
|
//white-space: pre-wrap;
|
||||||
word-break: break-all;
|
//word-break: break-all;
|
||||||
word-wrap: break-word;
|
//word-wrap: break-word;
|
||||||
|
|
||||||
font-family: $code-font-family;
|
font-family: $code-font-family;
|
||||||
font-size: $code-font-size;
|
font-size: $code-font-size;
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
@import '~@angular/material/theming';
|
@import '~@angular/material/theming';
|
||||||
|
|
||||||
|
// Custom color maps
|
||||||
$mat-white: (
|
$mat-white: (
|
||||||
500: white,
|
500: white,
|
||||||
contrast: (
|
contrast: (
|
||||||
@@ -47,13 +48,19 @@ $mat-fusedark: (
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
// Palettes
|
// Define the Material palettes
|
||||||
$primary: mat-palette($mat-fusedark);
|
$primary: mat-palette($mat-fusedark);
|
||||||
$accent: mat-palette($mat-light-blue, 600, 400, 700);
|
$accent: mat-palette($mat-light-blue, 600, 400, 700);
|
||||||
$warn: mat-palette($mat-red);
|
$warn: mat-palette($mat-red);
|
||||||
|
|
||||||
// Create the theme object (a Sass map containing all of the palettes).
|
// Create the Material theme object
|
||||||
$theme: mat-light-theme($primary, $accent, $warn);
|
$theme: mat-light-theme($primary, $accent, $warn);
|
||||||
|
|
||||||
|
// Store the background and foreground colors for easier access
|
||||||
$background: map-get($theme, background);
|
$background: map-get($theme, background);
|
||||||
$foreground: map-get($theme, foreground);
|
$foreground: map-get($theme, foreground);
|
||||||
|
|
||||||
|
// Force the input field font sizes to 16px
|
||||||
|
$typography: mat-typography-config(
|
||||||
|
$input: mat-typography-level(16px, 1.125, 400)
|
||||||
|
)
|
||||||
@@ -1,113 +1,157 @@
|
|||||||
import { Inject, Injectable, InjectionToken, Optional } from '@angular/core';
|
import { Inject, Injectable, InjectionToken } from '@angular/core';
|
||||||
import { NavigationStart, Router } from '@angular/router';
|
import { NavigationStart, Router } from '@angular/router';
|
||||||
import { BehaviorSubject } from 'rxjs/BehaviorSubject';
|
|
||||||
import { Platform } from '@angular/cdk/platform';
|
import { Platform } from '@angular/cdk/platform';
|
||||||
|
import { BehaviorSubject, Observable } from 'rxjs';
|
||||||
|
import { filter } from 'rxjs/operators';
|
||||||
|
import * as _ from 'lodash';
|
||||||
|
|
||||||
// Define the default config
|
// Create the injection token for the custom settings
|
||||||
const DEFAULT_CONFIG = {
|
|
||||||
layout : {
|
|
||||||
navigation : 'left', // 'right', 'left', 'top', 'none'
|
|
||||||
navigationFolded: false, // true, false
|
|
||||||
toolbar : 'below', // 'above', 'below', 'none'
|
|
||||||
footer : 'below', // 'above', 'below', 'none'
|
|
||||||
mode : 'fullwidth' // 'boxed', 'fullwidth'
|
|
||||||
},
|
|
||||||
colorClasses : {
|
|
||||||
toolbar: 'mat-white-500-bg',
|
|
||||||
navbar : 'mat-fuse-dark-700-bg',
|
|
||||||
footer : 'mat-fuse-dark-900-bg'
|
|
||||||
},
|
|
||||||
customScrollbars: true,
|
|
||||||
routerAnimation : 'fadeIn' // fadeIn, slideUp, slideDown, slideRight, slideLeft, none
|
|
||||||
};
|
|
||||||
|
|
||||||
// Create the injection token for the custom config
|
|
||||||
export const FUSE_CONFIG = new InjectionToken('fuseCustomConfig');
|
export const FUSE_CONFIG = new InjectionToken('fuseCustomConfig');
|
||||||
|
|
||||||
@Injectable()
|
@Injectable({
|
||||||
|
providedIn: 'root'
|
||||||
|
})
|
||||||
export class FuseConfigService
|
export class FuseConfigService
|
||||||
{
|
{
|
||||||
config: any;
|
// Private
|
||||||
defaultConfig: any;
|
private _configSubject: BehaviorSubject<any>;
|
||||||
|
private readonly _defaultConfig: any;
|
||||||
onConfigChanged: BehaviorSubject<any>;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @param router
|
* @param {Platform} _platform
|
||||||
* @param platform
|
* @param {Router} _router
|
||||||
* @param config
|
* @param _config
|
||||||
*/
|
*/
|
||||||
constructor(
|
constructor(
|
||||||
private router: Router,
|
private _platform: Platform,
|
||||||
public platform: Platform,
|
private _router: Router,
|
||||||
@Inject(FUSE_CONFIG) @Optional() config
|
@Inject(FUSE_CONFIG) private _config
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
// Set the default settings from the constant
|
// Set the default config from the user provided config (from forRoot)
|
||||||
this.defaultConfig = DEFAULT_CONFIG;
|
this._defaultConfig = _config;
|
||||||
|
|
||||||
// If custom config provided with forRoot,
|
// Initialize the service
|
||||||
// use them as default config...
|
this._init();
|
||||||
if ( config )
|
}
|
||||||
{
|
|
||||||
this.defaultConfig = config;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
// -----------------------------------------------------------------------------------------------------
|
||||||
* Disable Custom Scrollbars if Browser is Mobile
|
// @ Accessors
|
||||||
*/
|
// -----------------------------------------------------------------------------------------------------
|
||||||
if ( this.platform.ANDROID || this.platform.IOS )
|
|
||||||
{
|
|
||||||
this.defaultConfig.customScrollbars = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Set the config from the default config
|
/**
|
||||||
this.config = {...this.defaultConfig};
|
* Set and get the config
|
||||||
|
*/
|
||||||
|
set config(value)
|
||||||
|
{
|
||||||
|
// Get the value from the behavior subject
|
||||||
|
let config = this._configSubject.getValue();
|
||||||
|
|
||||||
// Reload the default settings for the
|
// Merge the new config
|
||||||
// layout on every navigation start
|
config = _.merge({}, config, value);
|
||||||
router.events.subscribe(
|
|
||||||
(event) => {
|
|
||||||
if ( event instanceof NavigationStart )
|
|
||||||
{
|
|
||||||
this.setConfig({
|
|
||||||
layout: this.defaultConfig.layout
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
// Create the behavior subject
|
// Notify the observers
|
||||||
this.onConfigChanged = new BehaviorSubject(this.config);
|
this._configSubject.next(config);
|
||||||
|
}
|
||||||
|
|
||||||
|
get config(): any | Observable<any>
|
||||||
|
{
|
||||||
|
return this._configSubject.asObservable();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the new config from given object
|
* Get default config
|
||||||
*
|
*
|
||||||
* @param config
|
* @returns {any}
|
||||||
*/
|
*/
|
||||||
setConfig(config): void
|
get defaultConfig(): any
|
||||||
{
|
{
|
||||||
// Set the config from the given object
|
return this._defaultConfig;
|
||||||
// Ugly, but works for now...
|
}
|
||||||
this.config = {
|
|
||||||
...this.config,
|
|
||||||
...config,
|
|
||||||
layout : {
|
|
||||||
...this.config.layout,
|
|
||||||
...config.layout,
|
|
||||||
},
|
|
||||||
colorClasses: {
|
|
||||||
...this.config.colorClasses,
|
|
||||||
...config.colorClasses
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
// Trigger the event
|
// -----------------------------------------------------------------------------------------------------
|
||||||
this.onConfigChanged.next(this.config);
|
// @ Private methods
|
||||||
|
// -----------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Initialize
|
||||||
|
*
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
private _init(): void
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Disable custom scrollbars if browser is mobile
|
||||||
|
*/
|
||||||
|
if ( this._platform.ANDROID || this._platform.IOS )
|
||||||
|
{
|
||||||
|
this._defaultConfig.customScrollbars = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set the config from the default config
|
||||||
|
this._configSubject = new BehaviorSubject(_.cloneDeep(this._defaultConfig));
|
||||||
|
|
||||||
|
// Reload the default config on every navigation start if
|
||||||
|
// the current config is different from the default one
|
||||||
|
this._router.events
|
||||||
|
.pipe(filter(event => event instanceof NavigationStart))
|
||||||
|
.subscribe(() => {
|
||||||
|
if ( !_.isEqual(this._configSubject.getValue(), this._defaultConfig) )
|
||||||
|
{
|
||||||
|
// Clone the default config
|
||||||
|
const config = _.cloneDeep(this._defaultConfig);
|
||||||
|
|
||||||
|
// Set the config
|
||||||
|
this._configSubject.next(config);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------------------------------
|
||||||
|
// @ Public methods
|
||||||
|
// -----------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set config
|
||||||
|
*
|
||||||
|
* @param value
|
||||||
|
* @param {{emitEvent: boolean}} opts
|
||||||
|
*/
|
||||||
|
setConfig(value, opts = {emitEvent: true}): void
|
||||||
|
{
|
||||||
|
// Get the value from the behavior subject
|
||||||
|
let config = this._configSubject.getValue();
|
||||||
|
|
||||||
|
// Merge the new config
|
||||||
|
config = _.merge({}, config, value);
|
||||||
|
|
||||||
|
// If emitEvent option is true...
|
||||||
|
if ( opts.emitEvent === true )
|
||||||
|
{
|
||||||
|
// Notify the observers
|
||||||
|
this._configSubject.next(config);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get config
|
||||||
|
*
|
||||||
|
* @returns {Observable<any>}
|
||||||
|
*/
|
||||||
|
getConfig(): Observable<any>
|
||||||
|
{
|
||||||
|
return this._configSubject.asObservable();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reset to the default config
|
||||||
|
*/
|
||||||
|
resetToDefaults(): void
|
||||||
|
{
|
||||||
|
// Set the config from the default config
|
||||||
|
this._configSubject.next(_.cloneDeep(this._defaultConfig));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,26 +1,31 @@
|
|||||||
/**
|
/**
|
||||||
* This class is based on the code in the following projects:
|
* This class is based on the code in the following projects:
|
||||||
*
|
* https://github.com/zenorocha/select
|
||||||
* - https://github.com/zenorocha/select
|
* https://github.com/zenorocha/clipboard.js/
|
||||||
* - https://github.com/zenorocha/clipboard.js/
|
|
||||||
*
|
*
|
||||||
* Both released under MIT license - © Zeno Rocha
|
* Both released under MIT license - © Zeno Rocha
|
||||||
*/
|
*/
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable({
|
||||||
|
providedIn: 'root'
|
||||||
|
})
|
||||||
export class FuseCopierService
|
export class FuseCopierService
|
||||||
{
|
{
|
||||||
|
|
||||||
private textarea: HTMLTextAreaElement;
|
private textarea: HTMLTextAreaElement;
|
||||||
|
|
||||||
/** Copy the text value to the clipboard. */
|
/**
|
||||||
|
* Copy the text value to the clipboard
|
||||||
|
*
|
||||||
|
* @param {string} text
|
||||||
|
* @returns {boolean}
|
||||||
|
*/
|
||||||
copyText(text: string): boolean
|
copyText(text: string): boolean
|
||||||
{
|
{
|
||||||
this.createTextareaAndSelect(text);
|
this.createTextareaAndSelect(text);
|
||||||
|
|
||||||
const copySuccessful = document.execCommand('copy');
|
const copySuccessful = document.execCommand('copy');
|
||||||
this.removeFake();
|
this._removeFake();
|
||||||
|
|
||||||
return copySuccessful;
|
return copySuccessful;
|
||||||
}
|
}
|
||||||
@@ -28,8 +33,10 @@ export class FuseCopierService
|
|||||||
/**
|
/**
|
||||||
* Creates a hidden textarea element, sets its value from `text` property,
|
* Creates a hidden textarea element, sets its value from `text` property,
|
||||||
* and makes a selection on it.
|
* and makes a selection on it.
|
||||||
|
*
|
||||||
|
* @param {string} text
|
||||||
*/
|
*/
|
||||||
private createTextareaAndSelect(text: string)
|
private createTextareaAndSelect(text: string): void
|
||||||
{
|
{
|
||||||
// Create a fake element to hold the contents to copy
|
// Create a fake element to hold the contents to copy
|
||||||
this.textarea = document.createElement('textarea');
|
this.textarea = document.createElement('textarea');
|
||||||
@@ -53,8 +60,12 @@ export class FuseCopierService
|
|||||||
this.textarea.setSelectionRange(0, this.textarea.value.length);
|
this.textarea.setSelectionRange(0, this.textarea.value.length);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Remove the text area from the DOM. */
|
/**
|
||||||
private removeFake()
|
* Remove the text area from the DOM
|
||||||
|
*
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
private _removeFake(): void
|
||||||
{
|
{
|
||||||
if ( this.textarea )
|
if ( this.textarea )
|
||||||
{
|
{
|
||||||
|
|||||||
91
src/@fuse/services/loading-bar.service.ts
Normal file
91
src/@fuse/services/loading-bar.service.ts
Normal file
@@ -0,0 +1,91 @@
|
|||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
import { NavigationEnd, NavigationStart, Router } from '@angular/router';
|
||||||
|
import { BehaviorSubject, Observable } from 'rxjs';
|
||||||
|
import { filter } from 'rxjs/operators';
|
||||||
|
|
||||||
|
@Injectable({
|
||||||
|
providedIn: 'root'
|
||||||
|
})
|
||||||
|
export class FuseLoadingBarService
|
||||||
|
{
|
||||||
|
// Private
|
||||||
|
private _visible: BehaviorSubject<boolean>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor
|
||||||
|
*
|
||||||
|
* @param {Router} _router
|
||||||
|
*/
|
||||||
|
constructor(
|
||||||
|
private _router: Router
|
||||||
|
)
|
||||||
|
{
|
||||||
|
// Initialize the service
|
||||||
|
this._init();
|
||||||
|
}
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------------------------------
|
||||||
|
// @ Accessors
|
||||||
|
// -----------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
get visible(): Observable<any>
|
||||||
|
{
|
||||||
|
// Return the _visible as observable
|
||||||
|
return this._visible.asObservable();
|
||||||
|
}
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------------------------------
|
||||||
|
// @ Private methods
|
||||||
|
// -----------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Initialize
|
||||||
|
*
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
private _init(): void
|
||||||
|
{
|
||||||
|
// Initialize the behavior subject
|
||||||
|
this._visible = new BehaviorSubject(false);
|
||||||
|
|
||||||
|
// Subscribe to the router events to show/hide the loading bar
|
||||||
|
this._router.events
|
||||||
|
.pipe(
|
||||||
|
filter((event) => event instanceof NavigationStart)
|
||||||
|
)
|
||||||
|
.subscribe(() => {
|
||||||
|
this.showLoadingBar();
|
||||||
|
});
|
||||||
|
|
||||||
|
this._router.events
|
||||||
|
.pipe(
|
||||||
|
filter((event) => event instanceof NavigationEnd)
|
||||||
|
)
|
||||||
|
.subscribe(() => {
|
||||||
|
this.hideLoadingBar();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------------------------------
|
||||||
|
// @ Public methods
|
||||||
|
// -----------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Show the loading bar
|
||||||
|
*/
|
||||||
|
showLoadingBar(): void
|
||||||
|
{
|
||||||
|
// Show
|
||||||
|
this._visible.next(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Hide the loading bar
|
||||||
|
*/
|
||||||
|
hideLoadingBar(): void
|
||||||
|
{
|
||||||
|
// Hide
|
||||||
|
this._visible.next(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -1,23 +1,51 @@
|
|||||||
import { MediaChange, ObservableMedia } from '@angular/flex-layout';
|
import { MediaChange, ObservableMedia } from '@angular/flex-layout';
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { BehaviorSubject } from 'rxjs/BehaviorSubject';
|
import { BehaviorSubject } from 'rxjs';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable({
|
||||||
|
providedIn: 'root'
|
||||||
|
})
|
||||||
export class FuseMatchMediaService
|
export class FuseMatchMediaService
|
||||||
{
|
{
|
||||||
activeMediaQuery: string;
|
activeMediaQuery: string;
|
||||||
onMediaChange: BehaviorSubject<string> = new BehaviorSubject<string>('');
|
onMediaChange: BehaviorSubject<string> = new BehaviorSubject<string>('');
|
||||||
|
|
||||||
constructor(private observableMedia: ObservableMedia)
|
/**
|
||||||
|
* Constructor
|
||||||
|
*
|
||||||
|
* @param {ObservableMedia} _observableMedia
|
||||||
|
*/
|
||||||
|
constructor(
|
||||||
|
private _observableMedia: ObservableMedia
|
||||||
|
)
|
||||||
{
|
{
|
||||||
|
// Set the defaults
|
||||||
this.activeMediaQuery = '';
|
this.activeMediaQuery = '';
|
||||||
|
|
||||||
this.observableMedia.subscribe((change: MediaChange) => {
|
// Initialize
|
||||||
if ( this.activeMediaQuery !== change.mqAlias )
|
this._init();
|
||||||
{
|
|
||||||
this.activeMediaQuery = change.mqAlias;
|
|
||||||
this.onMediaChange.next(change.mqAlias);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------------------------------
|
||||||
|
// @ Private methods
|
||||||
|
// -----------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Initialize
|
||||||
|
*
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
private _init(): void
|
||||||
|
{
|
||||||
|
this._observableMedia
|
||||||
|
.subscribe((change: MediaChange) => {
|
||||||
|
if ( this.activeMediaQuery !== change.mqAlias )
|
||||||
|
{
|
||||||
|
this.activeMediaQuery = change.mqAlias;
|
||||||
|
this.onMediaChange.next(change.mqAlias);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user