mirror of
https://github.com/richard-loafle/fuse-angular.git
synced 2025-12-23 22:27:07 +00:00
Compare commits
179 Commits
v1.0.1-ske
...
v1.2.1-ske
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4659da7390 | ||
|
|
2a5d15694c | ||
|
|
a1bec98d44 | ||
|
|
e8449e340d | ||
|
|
4cb8009c69 | ||
|
|
7f357306eb | ||
|
|
8e6024c3ee | ||
|
|
f4c47daadc | ||
|
|
06679343a4 | ||
|
|
381bc6c0fe | ||
|
|
f35d83567e | ||
|
|
b5a139f81d | ||
|
|
c97fd77c13 | ||
|
|
914477da41 | ||
|
|
410802808e | ||
|
|
62904cdb42 | ||
|
|
d9c36cad82 | ||
|
|
d2bfc152a0 | ||
|
|
f013b2b667 | ||
|
|
9fbcc20623 | ||
|
|
0fd8a75f7d | ||
|
|
99d9552813 | ||
|
|
3bca193bcc | ||
|
|
f73ff363a5 | ||
|
|
1bf689f154 | ||
|
|
3499d89098 | ||
|
|
685cd76da2 | ||
|
|
786180958d | ||
|
|
a2f72c92d5 | ||
|
|
6b368d2e79 | ||
|
|
47c2cc721e | ||
|
|
5574e3f729 | ||
|
|
1934bad3eb | ||
|
|
ee29f20304 | ||
|
|
93c2eab584 | ||
|
|
b0f45980be | ||
|
|
56dbc58d5e | ||
|
|
d7c6b2d617 | ||
|
|
7b10b2ad86 | ||
|
|
3fc510469d | ||
|
|
5d56b3bcd6 | ||
|
|
aaa14eb1e9 | ||
|
|
f43608f93b | ||
|
|
9ecd921722 | ||
|
|
98e2ff0e1e | ||
|
|
b7cb09b087 | ||
|
|
fe8b44b14c | ||
|
|
ca8ed939ae | ||
|
|
4469a2c25a | ||
|
|
80627bdde9 | ||
|
|
6595975f2b | ||
|
|
895291c37c | ||
|
|
dcb8032758 | ||
|
|
ac7e6f75bc | ||
|
|
fb214da5fe | ||
|
|
e20687034f | ||
|
|
bd8b02c82d | ||
|
|
6d594d63db | ||
|
|
6656410696 | ||
|
|
470b851eae | ||
|
|
fbe9cb83a2 | ||
|
|
13a09164ae | ||
|
|
56d9830176 | ||
|
|
be820804f2 | ||
|
|
7615bc1d03 | ||
|
|
3198663430 | ||
|
|
ad432ca31d | ||
|
|
7d26beff3d | ||
|
|
4711a27814 | ||
|
|
8205a4d5b5 | ||
|
|
4f451a74e9 | ||
|
|
8518408254 | ||
|
|
72f968b594 | ||
|
|
688b443ea8 | ||
|
|
cb89da4647 | ||
|
|
cc4a04afcb | ||
|
|
bc239571a1 | ||
|
|
c025563145 | ||
|
|
c06e99dc97 | ||
|
|
c0a1dc7c37 | ||
|
|
55e1d8b2bc | ||
|
|
533f5f3f3f | ||
|
|
f9bda99deb | ||
|
|
4a7b70c874 | ||
|
|
c101c432dc | ||
|
|
04d1b2eff8 | ||
|
|
1d81e37a0f | ||
|
|
83f0ed5ec1 | ||
|
|
f800dc3286 | ||
|
|
e486413872 | ||
|
|
576e167ef1 | ||
|
|
619433f101 | ||
|
|
3e9ae83aae | ||
|
|
9400c3d748 | ||
|
|
5e4940fed9 | ||
|
|
8910e6f5dc | ||
|
|
52c5e6a18b | ||
|
|
3d9ded9a44 | ||
|
|
1be3f0066b | ||
|
|
cf9e9fc209 | ||
|
|
ff0f2933d9 | ||
|
|
21c96c76da | ||
|
|
5e2e2b7d53 | ||
|
|
dcff423943 | ||
|
|
6747610771 | ||
|
|
e6ee5d017e | ||
|
|
cb2b544526 | ||
|
|
5ace09f782 | ||
|
|
678dde8c0e | ||
|
|
236cf1eb06 | ||
|
|
f4efbe07f7 | ||
|
|
671287b55a | ||
|
|
19c85c964b | ||
|
|
e5cf4fdafb | ||
|
|
098dacf2a5 | ||
|
|
2f8539e987 | ||
|
|
f688a58656 | ||
|
|
9cb8c0c96b | ||
|
|
05575d3f82 | ||
|
|
b9198e3717 | ||
|
|
769e67c2f3 | ||
|
|
32960abd7c | ||
|
|
126e32d9e7 | ||
|
|
d6d74cb998 | ||
|
|
6d20c1d62d | ||
|
|
b55bce2de4 | ||
|
|
6f4dc36a3d | ||
|
|
fe7e6d173b | ||
|
|
b377d99c66 | ||
|
|
d4374e6df0 | ||
|
|
c74fad84b6 | ||
|
|
e09ef05e02 | ||
|
|
62467c8ddf | ||
|
|
2c0fc76b8a | ||
|
|
752660f5dc | ||
|
|
024ab15b25 | ||
|
|
01f00121ba | ||
|
|
915ad52863 | ||
|
|
dde2333c8a | ||
|
|
97bfaa9979 | ||
|
|
babf6dc47b | ||
|
|
6ae3e154c3 | ||
|
|
55288bbbd4 | ||
|
|
49b6ff7292 | ||
|
|
903688ab43 | ||
|
|
7297a9b4a4 | ||
|
|
4cbbd3a1d6 | ||
|
|
2f4ce6221e | ||
|
|
44cdadaec9 | ||
|
|
19f822cbab | ||
|
|
1d21a14d0e | ||
|
|
d5b6dea1a2 | ||
|
|
4bf2ba73ad | ||
|
|
31087186f7 | ||
|
|
48a47a0876 | ||
|
|
e0a85a19db | ||
|
|
b21526410a | ||
|
|
ce6797a80b | ||
|
|
7d5693421f | ||
|
|
9106fcd066 | ||
|
|
58bdf07da0 | ||
|
|
6a3972fff8 | ||
|
|
58291058ae | ||
|
|
dca16238eb | ||
|
|
9ae746a3ed | ||
|
|
a7549a1770 | ||
|
|
0bf158f8a5 | ||
|
|
a0da9bd81e | ||
|
|
2b91119d00 | ||
|
|
56716653b8 | ||
|
|
a56e9e6d10 | ||
|
|
49af06cdbd | ||
|
|
cd99fbf77a | ||
|
|
041a54731d | ||
|
|
95640f8ffe | ||
|
|
215d1cb78a | ||
|
|
ffa52909e8 | ||
|
|
3a246717a0 | ||
|
|
a650ebac97 |
@@ -25,6 +25,7 @@
|
||||
"environmentSource": "environments/environment.ts",
|
||||
"environments": {
|
||||
"dev": "environments/environment.ts",
|
||||
"hmr": "environments/environment.hmr.ts",
|
||||
"prod": "environments/environment.prod.ts"
|
||||
}
|
||||
}
|
||||
@@ -36,13 +37,16 @@
|
||||
},
|
||||
"lint": [
|
||||
{
|
||||
"project": "src/tsconfig.app.json"
|
||||
"project": "src/tsconfig.app.json",
|
||||
"exclude": "**/node_modules/**"
|
||||
},
|
||||
{
|
||||
"project": "src/tsconfig.spec.json"
|
||||
"project": "src/tsconfig.spec.json",
|
||||
"exclude": "**/node_modules/**"
|
||||
},
|
||||
{
|
||||
"project": "e2e/tsconfig.e2e.json"
|
||||
"project": "e2e/tsconfig.e2e.json",
|
||||
"exclude": "**/node_modules/**"
|
||||
}
|
||||
],
|
||||
"test": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Fuse2
|
||||
|
||||
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 1.1.3.
|
||||
Material Design Admin Template with Angular 5+ and Angular Material 2
|
||||
|
||||
## Development server
|
||||
|
||||
@@ -22,7 +22,3 @@ Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.
|
||||
|
||||
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).
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
import { Fuse2Page } from './app.po';
|
||||
|
||||
describe('fuse2 App', () => {
|
||||
let page: Fuse2Page;
|
||||
describe('Fuse2 App', () => {
|
||||
let page: Fuse2Page;
|
||||
|
||||
beforeEach(() => {
|
||||
page = new Fuse2Page();
|
||||
});
|
||||
beforeEach(() => {
|
||||
page = new Fuse2Page();
|
||||
});
|
||||
|
||||
it('should display welcome message', () => {
|
||||
page.navigateTo();
|
||||
expect(page.getParagraphText()).toEqual('Welcome to app!!');
|
||||
});
|
||||
it('should display welcome message', () => {
|
||||
page.navigateTo();
|
||||
expect(page.getParagraphText()).toEqual('Welcome to app!');
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import { browser, by, element } from 'protractor';
|
||||
|
||||
export class Fuse2Page {
|
||||
navigateTo() {
|
||||
return browser.get('/');
|
||||
}
|
||||
navigateTo() {
|
||||
return browser.get('/');
|
||||
}
|
||||
|
||||
getParagraphText() {
|
||||
return element(by.css('app-root h1')).getText();
|
||||
}
|
||||
getParagraphText() {
|
||||
return element(by.css('app-root h1')).getText();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,10 +2,12 @@
|
||||
"extends": "../tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "../out-tsc/e2e",
|
||||
"baseUrl": "./",
|
||||
"module": "commonjs",
|
||||
"target": "es5",
|
||||
"types": [
|
||||
"jasmine",
|
||||
"jasminewd2",
|
||||
"node"
|
||||
]
|
||||
}
|
||||
|
||||
@@ -1,33 +1,33 @@
|
||||
// Karma configuration file, see link for more information
|
||||
// https://karma-runner.github.io/0.13/config/configuration-file.html
|
||||
// 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
|
||||
});
|
||||
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
|
||||
});
|
||||
};
|
||||
|
||||
3997
package-lock.json
generated
3997
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
110
package.json
110
package.json
@@ -1,68 +1,72 @@
|
||||
{
|
||||
"name": "fuse2",
|
||||
"version": "1.0.1",
|
||||
"license": "MIT",
|
||||
"version": "1.2.1",
|
||||
"license": "",
|
||||
"scripts": {
|
||||
"ng": "ng",
|
||||
"start": "ng serve",
|
||||
"build": "ng build",
|
||||
"start-hmr": "ng serve --hmr -e=hmr -sm=false",
|
||||
"start-hmr-sourcemaps": "ng serve --hmr -e=hmr",
|
||||
"build": "node --max_old_space_size=6144 ./node_modules/@angular/cli/bin/ng build --dev",
|
||||
"build-prod": "node --max_old_space_size=6144 ./node_modules/@angular/cli/bin/ng build --prod",
|
||||
"test": "ng test",
|
||||
"lint": "ng lint",
|
||||
"e2e": "ng e2e"
|
||||
},
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"@angular/animations": "4.3.5",
|
||||
"@angular/cdk": "^2.0.0-beta.8",
|
||||
"@angular/common": "4.3.5",
|
||||
"@angular/compiler": "4.3.5",
|
||||
"@angular/core": "4.3.5",
|
||||
"@angular/flex-layout": "2.0.0-beta.8",
|
||||
"@angular/forms": "4.3.5",
|
||||
"@angular/http": "4.3.5",
|
||||
"@angular/material": "^2.0.0-beta.8",
|
||||
"@angular/platform-browser": "4.3.5",
|
||||
"@angular/platform-browser-dynamic": "4.3.5",
|
||||
"@angular/router": "4.3.5",
|
||||
"@swimlane/ngx-charts": "^6.0.2",
|
||||
"@swimlane/ngx-datatable": "^9.3.1",
|
||||
"@swimlane/ngx-dnd": "^3.0.0",
|
||||
"angular-calendar": "^0.19.0",
|
||||
"angular-in-memory-web-api": "^0.3.2",
|
||||
"classlist.js": "^1.1.20150312",
|
||||
"core-js": "^2.5.0",
|
||||
"d3": "^4.10.0",
|
||||
"hammerjs": "^2.0.8",
|
||||
"highlight.js": "^9.12.0",
|
||||
"intl": "^1.2.5",
|
||||
"moment": "^2.18.1",
|
||||
"ngx-color-picker": "^4.3.1",
|
||||
"ngx-perfect-scrollbar": "^4.5.6",
|
||||
"rxjs": "^5.4.3",
|
||||
"web-animations-js": "^2.3.1",
|
||||
"zone.js": "^0.8.17"
|
||||
"@agm/core": "1.0.0-beta.2",
|
||||
"@angular/animations": "5.0.1",
|
||||
"@angular/cdk": "5.0.0-rc0",
|
||||
"@angular/common": "5.0.1",
|
||||
"@angular/compiler": "5.0.1",
|
||||
"@angular/core": "5.0.1",
|
||||
"@angular/flex-layout": "2.0.0-beta.10",
|
||||
"@angular/forms": "5.0.1",
|
||||
"@angular/http": "5.0.1",
|
||||
"@angular/material": "5.0.0-rc0",
|
||||
"@angular/platform-browser": "5.0.1",
|
||||
"@angular/platform-browser-dynamic": "5.0.1",
|
||||
"@angular/router": "5.0.1",
|
||||
"@ngx-translate/core": "8.0.0",
|
||||
"@swimlane/ngx-charts": "6.1.0",
|
||||
"@swimlane/ngx-datatable": "11.0.3",
|
||||
"@withinpixels/ngx-dnd": "3.1.0",
|
||||
"angular-calendar": "0.21.3",
|
||||
"classlist.js": "1.1.20150312",
|
||||
"core-js": "2.5.1",
|
||||
"d3": "4.11.0",
|
||||
"hammerjs": "2.0.8",
|
||||
"highlight.js": "9.12.0",
|
||||
"intl": "1.2.5",
|
||||
"moment": "2.19.2",
|
||||
"ngx-color-picker": "4.4.0",
|
||||
"ngx-cookie-service": "1.0.9",
|
||||
"perfect-scrollbar": "1.0.3",
|
||||
"rxjs": "5.5.2",
|
||||
"web-animations-js": "2.3.1",
|
||||
"zone.js": "0.8.18"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@angular/cli": "^1.3.2",
|
||||
"@angular/compiler-cli": "4.3.5",
|
||||
"@angular/language-service": "4.3.5",
|
||||
"@ngtools/webpack": "^1.6.2",
|
||||
"@types/jasmine": "^2.5.54",
|
||||
"@types/jasminewd2": "^2.0.2",
|
||||
"@types/node": "^6.0.87",
|
||||
"codelyzer": "~3.0.1",
|
||||
"jasmine-core": "~2.6.2",
|
||||
"jasmine-spec-reporter": "~4.1.0",
|
||||
"karma": "~1.7.0",
|
||||
"karma-chrome-launcher": "~2.1.1",
|
||||
"karma-cli": "~1.0.1",
|
||||
"karma-coverage-istanbul-reporter": "^1.2.1",
|
||||
"karma-jasmine": "~1.1.0",
|
||||
"karma-jasmine-html-reporter": "^0.2.2",
|
||||
"node-sass": "^4.5.3",
|
||||
"protractor": "~5.1.2",
|
||||
"ts-node": "~3.0.4",
|
||||
"tslint": "~5.3.2",
|
||||
"typescript": "~2.3.3"
|
||||
"@angular/cli": "1.5.0",
|
||||
"@angular/compiler-cli": "5.0.1",
|
||||
"@angular/language-service": "5.0.1",
|
||||
"@angularclass/hmr": "2.1.3",
|
||||
"@types/jasmine": "2.5.54",
|
||||
"@types/jasminewd2": "2.0.3",
|
||||
"@types/node": "6.0.90",
|
||||
"codelyzer": "3.2.2",
|
||||
"jasmine-core": "2.6.4",
|
||||
"jasmine-spec-reporter": "4.1.1",
|
||||
"karma": "1.7.1",
|
||||
"karma-chrome-launcher": "2.1.1",
|
||||
"karma-cli": "1.0.1",
|
||||
"karma-coverage-istanbul-reporter": "1.3.0",
|
||||
"karma-jasmine": "1.1.0",
|
||||
"karma-jasmine-html-reporter": "0.2.2",
|
||||
"protractor": "5.1.2",
|
||||
"ts-node": "3.2.2",
|
||||
"tslint": "5.7.0",
|
||||
"typescript": "2.4.2"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,25 +4,25 @@
|
||||
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 } }));
|
||||
}
|
||||
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 } }));
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { FuseSplashScreenService } from './core/services/splash-screen.service';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
|
||||
@Component({
|
||||
selector : 'fuse-root',
|
||||
@@ -8,7 +9,18 @@ import { FuseSplashScreenService } from './core/services/splash-screen.service';
|
||||
})
|
||||
export class AppComponent
|
||||
{
|
||||
constructor(private fuseSplashScreen: FuseSplashScreenService)
|
||||
constructor(
|
||||
private fuseSplashScreen: FuseSplashScreenService,
|
||||
private translate: TranslateService
|
||||
)
|
||||
{
|
||||
// Add languages
|
||||
this.translate.addLangs(['en', 'tr']);
|
||||
|
||||
// Set the default language
|
||||
this.translate.setDefaultLang('en');
|
||||
|
||||
// Use a language
|
||||
this.translate.use('en');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,11 +7,12 @@ import { RouterModule, Routes } from '@angular/router';
|
||||
import 'hammerjs';
|
||||
import { SharedModule } from './core/modules/shared.module';
|
||||
import { AppComponent } from './app.component';
|
||||
import { PerfectScrollbarModule } from 'ngx-perfect-scrollbar';
|
||||
import { FuseMainModule } from './main/main.module';
|
||||
import { FuseSplashScreenService } from './core/services/splash-screen.service';
|
||||
import { FuseConfigService } from './core/services/config.service';
|
||||
import { FuseNavigationService } from './core/components/navigation/navigation.service';
|
||||
import { FuseSampleModule } from './main/content/sample/sample.module';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
|
||||
const appRoutes: Routes = [
|
||||
{
|
||||
@@ -31,13 +32,14 @@ const appRoutes: Routes = [
|
||||
BrowserAnimationsModule,
|
||||
RouterModule.forRoot(appRoutes),
|
||||
SharedModule,
|
||||
PerfectScrollbarModule.forRoot(),
|
||||
TranslateModule.forRoot(),
|
||||
FuseMainModule,
|
||||
FuseSampleModule
|
||||
],
|
||||
providers : [
|
||||
FuseSplashScreenService,
|
||||
FuseConfigService
|
||||
FuseConfigService,
|
||||
FuseNavigationService
|
||||
],
|
||||
bootstrap : [
|
||||
AppComponent
|
||||
|
||||
@@ -1,10 +1,69 @@
|
||||
import { sequence, trigger, stagger, animate, style, group, query, transition, keyframes, animateChild, state } from '@angular/animations';
|
||||
import { sequence, trigger, animate, style, group, query, transition, animateChild, state, animation, useAnimation, stagger } from '@angular/animations';
|
||||
|
||||
// const query = (s, a, o = {optional: true}) => q(s, a, o);
|
||||
const customAnimation = animation([
|
||||
style({
|
||||
opacity : '{{opacity}}',
|
||||
transform: 'scale({{scale}}) translate3d({{x}}, {{y}}, {{z}})'
|
||||
}),
|
||||
animate('{{duration}} {{delay}} cubic-bezier(0.0, 0.0, 0.2, 1)', style('*'))
|
||||
], {
|
||||
params: {
|
||||
duration: '200ms',
|
||||
delay : '0ms',
|
||||
opacity : '0',
|
||||
scale : '1',
|
||||
x : '0',
|
||||
y : '0',
|
||||
z : '0'
|
||||
}
|
||||
});
|
||||
|
||||
export class Animations
|
||||
{
|
||||
public static slideInOut = trigger('slideInOut', [
|
||||
export const fuseAnimations = [
|
||||
|
||||
trigger('animate', [transition('void => *', [useAnimation(customAnimation)])]),
|
||||
|
||||
trigger('animateStagger', [
|
||||
state('50', style('*')),
|
||||
state('100', style('*')),
|
||||
state('200', style('*')),
|
||||
|
||||
transition('void => 50',
|
||||
query('@*',
|
||||
[
|
||||
stagger('50ms', [
|
||||
animateChild()
|
||||
])
|
||||
], {optional: true})),
|
||||
transition('void => 100',
|
||||
query('@*',
|
||||
[
|
||||
stagger('100ms', [
|
||||
animateChild()
|
||||
])
|
||||
], {optional: true})),
|
||||
transition('void => 200',
|
||||
query('@*',
|
||||
[
|
||||
stagger('200ms', [
|
||||
animateChild()
|
||||
])
|
||||
], {optional: true}))
|
||||
]),
|
||||
|
||||
trigger('fadeInOut', [
|
||||
state('0', style({
|
||||
display: 'none',
|
||||
opacity: 0
|
||||
})),
|
||||
state('1', style({
|
||||
display: 'block',
|
||||
opacity: 1
|
||||
})),
|
||||
transition('1 => 0', animate('300ms ease-out')),
|
||||
transition('0 => 1', animate('300ms ease-in'))
|
||||
]),
|
||||
|
||||
trigger('slideInOut', [
|
||||
state('0', style({
|
||||
height : '0px',
|
||||
display: 'none'
|
||||
@@ -15,9 +74,9 @@ export class Animations
|
||||
})),
|
||||
transition('1 => 0', animate('300ms ease-out')),
|
||||
transition('0 => 1', animate('300ms ease-in'))
|
||||
]);
|
||||
]),
|
||||
|
||||
public static slideInLeft = trigger('slideInLeft', [
|
||||
trigger('slideInLeft', [
|
||||
state('void', style({
|
||||
transform: 'translateX(-100%)',
|
||||
display : 'none'
|
||||
@@ -28,9 +87,9 @@ export class Animations
|
||||
})),
|
||||
transition('void => *', animate('300ms')),
|
||||
transition('* => void', animate('300ms'))
|
||||
]);
|
||||
]),
|
||||
|
||||
public static slideInRight = trigger('slideInRight', [
|
||||
trigger('slideInRight', [
|
||||
state('void', style({
|
||||
transform: 'translateX(100%)',
|
||||
display : 'none'
|
||||
@@ -41,9 +100,9 @@ export class Animations
|
||||
})),
|
||||
transition('void => *', animate('300ms')),
|
||||
transition('* => void', animate('300ms'))
|
||||
]);
|
||||
]),
|
||||
|
||||
public static slideInTop = trigger('slideInTop', [
|
||||
trigger('slideInTop', [
|
||||
state('void', style({
|
||||
transform: 'translateY(-100%)',
|
||||
display : 'none'
|
||||
@@ -54,9 +113,9 @@ export class Animations
|
||||
})),
|
||||
transition('void => *', animate('300ms')),
|
||||
transition('* => void', animate('300ms'))
|
||||
]);
|
||||
]),
|
||||
|
||||
public static slideInBottom = trigger('slideInBottom', [
|
||||
trigger('slideInBottom', [
|
||||
state('void',
|
||||
style({
|
||||
transform: 'translateY(100%)',
|
||||
@@ -68,9 +127,20 @@ export class Animations
|
||||
})),
|
||||
transition('void => *', animate('300ms')),
|
||||
transition('* => void', animate('300ms'))
|
||||
]);
|
||||
]),
|
||||
|
||||
public static routerTransitionLeft = trigger('routerTransitionLeft', [
|
||||
trigger('expandCollapse', [
|
||||
state('void', style({
|
||||
height: '0px'
|
||||
})),
|
||||
state('*', style({
|
||||
height: '*'
|
||||
})),
|
||||
transition('void => *', animate('300ms ease-out')),
|
||||
transition('* => void', animate('300ms ease-in'))
|
||||
]),
|
||||
|
||||
trigger('routerTransitionLeft', [
|
||||
|
||||
transition('* => *', [
|
||||
query('fuse-content > :enter, fuse-content > :leave', [
|
||||
@@ -95,7 +165,7 @@ export class Animations
|
||||
transform: 'translateX(0)',
|
||||
opacity : 1
|
||||
}),
|
||||
animate('400ms cubic-bezier(0.250, 0.460, 0.450, 0.940)',
|
||||
animate('600ms cubic-bezier(0.0, 0.0, 0.2, 1)',
|
||||
style({
|
||||
transform: 'translateX(-100%)',
|
||||
opacity : 0
|
||||
@@ -103,7 +173,7 @@ export class Animations
|
||||
], {optional: true}),
|
||||
query('fuse-content > :enter', [
|
||||
style({transform: 'translateX(100%)'}),
|
||||
animate('400ms cubic-bezier(0.250, 0.460, 0.450, 0.940)',
|
||||
animate('600ms cubic-bezier(0.0, 0.0, 0.2, 1)',
|
||||
style({
|
||||
transform: 'translateX(0%)',
|
||||
opacity : 1
|
||||
@@ -114,9 +184,9 @@ export class Animations
|
||||
query('fuse-content > :enter', animateChild(), {optional: true})
|
||||
])
|
||||
])
|
||||
]);
|
||||
]),
|
||||
|
||||
public static routerTransitionRight = trigger('routerTransitionRight', [
|
||||
trigger('routerTransitionRight', [
|
||||
|
||||
transition('* => *', [
|
||||
query('fuse-content > :enter, fuse-content > :leave', [
|
||||
@@ -141,7 +211,7 @@ export class Animations
|
||||
transform: 'translateX(0)',
|
||||
opacity : 1
|
||||
}),
|
||||
animate('400ms cubic-bezier(0.250, 0.460, 0.450, 0.940)',
|
||||
animate('600ms cubic-bezier(0.0, 0.0, 0.2, 1)',
|
||||
style({
|
||||
transform: 'translateX(100%)',
|
||||
opacity : 0
|
||||
@@ -149,7 +219,7 @@ export class Animations
|
||||
], {optional: true}),
|
||||
query('fuse-content > :enter', [
|
||||
style({transform: 'translateX(-100%)'}),
|
||||
animate('400ms cubic-bezier(0.250, 0.460, 0.450, 0.940)',
|
||||
animate('600ms cubic-bezier(0.0, 0.0, 0.2, 1)',
|
||||
style({
|
||||
transform: 'translateX(0%)',
|
||||
opacity : 1
|
||||
@@ -160,9 +230,9 @@ export class Animations
|
||||
query('fuse-content > :enter', animateChild(), {optional: true})
|
||||
])
|
||||
])
|
||||
]);
|
||||
]),
|
||||
|
||||
public static routerTransitionUp = trigger('routerTransitionUp', [
|
||||
trigger('routerTransitionUp', [
|
||||
|
||||
transition('* => *', [
|
||||
query('fuse-content > :enter, fuse-content > :leave', [
|
||||
@@ -180,35 +250,33 @@ export class Animations
|
||||
opacity : 0
|
||||
})
|
||||
], {optional: true}),
|
||||
sequence([
|
||||
group([
|
||||
query('fuse-content > :leave', [
|
||||
group([
|
||||
query('fuse-content > :leave', [
|
||||
style({
|
||||
transform: 'translateY(0)',
|
||||
opacity : 1
|
||||
}),
|
||||
animate('600ms cubic-bezier(0.0, 0.0, 0.2, 1)',
|
||||
style({
|
||||
transform: 'translateY(0)',
|
||||
transform: 'translateY(-100%)',
|
||||
opacity : 0
|
||||
}))
|
||||
], {optional: true}),
|
||||
query('fuse-content > :enter', [
|
||||
style({transform: 'translateY(100%)'}),
|
||||
animate('600ms cubic-bezier(0.0, 0.0, 0.2, 1)',
|
||||
style({
|
||||
transform: 'translateY(0%)',
|
||||
opacity : 1
|
||||
}),
|
||||
animate('400ms cubic-bezier(0.250, 0.460, 0.450, 0.940)',
|
||||
style({
|
||||
transform: 'translateY(-100%)',
|
||||
opacity : 0
|
||||
}))
|
||||
], {optional: true}),
|
||||
query('fuse-content > :enter', [
|
||||
style({transform: 'translateY(100%)'}),
|
||||
animate('400ms cubic-bezier(0.250, 0.460, 0.450, 0.940)',
|
||||
style({
|
||||
transform: 'translateY(0%)',
|
||||
opacity : 1
|
||||
}))
|
||||
], {optional: true})
|
||||
]),
|
||||
query('fuse-content > :leave', animateChild(), {optional: true}),
|
||||
query('fuse-content > :enter', animateChild(), {optional: true})
|
||||
])
|
||||
}))
|
||||
], {optional: true})
|
||||
]),
|
||||
query('fuse-content > :leave', animateChild(), {optional: true}),
|
||||
query('fuse-content > :enter', animateChild(), {optional: true})
|
||||
])
|
||||
]);
|
||||
]),
|
||||
|
||||
public static routerTransitionDown = trigger('routerTransitionDown', [
|
||||
trigger('routerTransitionDown', [
|
||||
|
||||
transition('* => *', [
|
||||
query('fuse-content > :enter, fuse-content > :leave', [
|
||||
@@ -233,7 +301,7 @@ export class Animations
|
||||
transform: 'translateY(0)',
|
||||
opacity : 1
|
||||
}),
|
||||
animate('400ms cubic-bezier(0.250, 0.460, 0.450, 0.940)',
|
||||
animate('600ms cubic-bezier(0.0, 0.0, 0.2, 1)',
|
||||
style({
|
||||
transform: 'translateY(100%)',
|
||||
opacity : 0
|
||||
@@ -241,7 +309,7 @@ export class Animations
|
||||
], {optional: true}),
|
||||
query('fuse-content > :enter', [
|
||||
style({transform: 'translateY(-100%)'}),
|
||||
animate('400ms cubic-bezier(0.250, 0.460, 0.450, 0.940)',
|
||||
animate('600ms cubic-bezier(0.0, 0.0, 0.2, 1)',
|
||||
style({
|
||||
transform: 'translateY(0%)',
|
||||
opacity : 1
|
||||
@@ -252,11 +320,11 @@ export class Animations
|
||||
query('fuse-content > :enter', animateChild(), {optional: true})
|
||||
])
|
||||
])
|
||||
]);
|
||||
]),
|
||||
|
||||
public static routerTransitionFade = trigger('routerTransitionFade', [
|
||||
trigger('routerTransitionFade', [
|
||||
|
||||
transition('* => *', [
|
||||
transition('* => *', group([
|
||||
|
||||
query('fuse-content > :enter, fuse-content > :leave ', [
|
||||
style({
|
||||
@@ -267,33 +335,32 @@ export class Animations
|
||||
right : 0
|
||||
})
|
||||
], {optional: true}),
|
||||
|
||||
query('fuse-content > :enter', [
|
||||
style({
|
||||
opacity: 0
|
||||
})
|
||||
], {optional: true}),
|
||||
// sequence([
|
||||
query('fuse-content > :leave', [
|
||||
style({
|
||||
opacity: 1
|
||||
}),
|
||||
animate('300ms cubic-bezier(0.250, 0.460, 0.450, 0.940)',
|
||||
style({
|
||||
opacity: 0
|
||||
}))
|
||||
], {optional: true}),
|
||||
query('fuse-content > :enter', [
|
||||
query('fuse-content > :leave', [
|
||||
style({
|
||||
opacity: 1
|
||||
}),
|
||||
animate('300ms cubic-bezier(0.0, 0.0, 0.2, 1)',
|
||||
style({
|
||||
opacity: 0
|
||||
}),
|
||||
animate('300ms cubic-bezier(0.250, 0.460, 0.450, 0.940)',
|
||||
style({
|
||||
opacity: 1
|
||||
}))
|
||||
], {optional: true}),
|
||||
// ]),
|
||||
}))
|
||||
], {optional: true}),
|
||||
query('fuse-content > :enter', [
|
||||
style({
|
||||
opacity: 0
|
||||
}),
|
||||
animate('300ms cubic-bezier(0.0, 0.0, 0.2, 1)',
|
||||
style({
|
||||
opacity: 1
|
||||
}))
|
||||
], {optional: true}),
|
||||
query('fuse-content > :enter', animateChild(), {optional: true}),
|
||||
query('fuse-content > :leave', animateChild(), {optional: true})
|
||||
])
|
||||
]);
|
||||
}
|
||||
]))
|
||||
])
|
||||
];
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<h1 md-dialog-title>Confirm</h1>
|
||||
<div md-dialog-content>{{confirmMessage}}</div>
|
||||
<div md-dialog-actions class="pt-24">
|
||||
<button md-raised-button class="mat-accent mr-16" (click)="dialogRef.close(true)">Confirm</button>
|
||||
<button md-button (click)="dialogRef.close(false)">Cancel</button>
|
||||
<h1 matDialogTitle>Confirm</h1>
|
||||
<div mat-dialog-content>{{confirmMessage}}</div>
|
||||
<div mat-dialog-actions class="pt-24">
|
||||
<button mat-raised-button class="mat-accent mr-16" (click)="dialogRef.close(true)">Confirm</button>
|
||||
<button mat-button (click)="dialogRef.close(false)">Cancel</button>
|
||||
</div>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { MdDialogRef } from '@angular/material';
|
||||
import { MatDialogRef } from '@angular/material';
|
||||
|
||||
@Component({
|
||||
selector : 'fuse-confirm-dialog',
|
||||
@@ -10,7 +10,7 @@ export class FuseConfirmDialogComponent implements OnInit
|
||||
{
|
||||
public confirmMessage: string;
|
||||
|
||||
constructor(public dialogRef: MdDialogRef<FuseConfirmDialogComponent>)
|
||||
constructor(public dialogRef: MatDialogRef<FuseConfirmDialogComponent>)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
65
src/app/core/components/copier/copier.service.ts
Normal file
65
src/app/core/components/copier/copier.service.ts
Normal file
@@ -0,0 +1,65 @@
|
||||
/**
|
||||
* This class is based on the code in the following projects:
|
||||
*
|
||||
* - https://github.com/zenorocha/select
|
||||
* - https://github.com/zenorocha/clipboard.js/
|
||||
*
|
||||
* Both released under MIT license - © Zeno Rocha
|
||||
*/
|
||||
import { Injectable } from '@angular/core';
|
||||
|
||||
@Injectable()
|
||||
export class CopierService
|
||||
{
|
||||
|
||||
private textarea: HTMLTextAreaElement;
|
||||
|
||||
/** Copy the text value to the clipboard. */
|
||||
copyText(text: string): boolean
|
||||
{
|
||||
this.createTextareaAndSelect(text);
|
||||
|
||||
const copySuccessful = document.execCommand('copy');
|
||||
this.removeFake();
|
||||
|
||||
return copySuccessful;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a hidden textarea element, sets its value from `text` property,
|
||||
* and makes a selection on it.
|
||||
*/
|
||||
private createTextareaAndSelect(text: string)
|
||||
{
|
||||
// Create a fake element to hold the contents to copy
|
||||
this.textarea = document.createElement('textarea');
|
||||
|
||||
// Prevent zooming on iOS
|
||||
this.textarea.style.fontSize = '12pt';
|
||||
|
||||
// Hide the element
|
||||
this.textarea.classList.add('cdk-visually-hidden');
|
||||
|
||||
// Move element to the same position vertically
|
||||
const yPosition = window.pageYOffset || document.documentElement.scrollTop;
|
||||
this.textarea.style.top = yPosition + 'px';
|
||||
|
||||
this.textarea.setAttribute('readonly', '');
|
||||
this.textarea.value = text;
|
||||
|
||||
document.body.appendChild(this.textarea);
|
||||
|
||||
this.textarea.select();
|
||||
this.textarea.setSelectionRange(0, this.textarea.value.length);
|
||||
}
|
||||
|
||||
/** Remove the text area from the DOM. */
|
||||
private removeFake()
|
||||
{
|
||||
if ( this.textarea )
|
||||
{
|
||||
document.body.removeChild(this.textarea);
|
||||
this.textarea = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -9,6 +9,7 @@
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
text-align: center;
|
||||
|
||||
.time {
|
||||
display: flex;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { Component, Input, OnInit } from '@angular/core';
|
||||
import * as moment from 'moment';
|
||||
import { Observable } from 'rxjs/Rx';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
import 'rxjs/add/observable/interval';
|
||||
|
||||
@Component({
|
||||
selector : 'fuse-countdown',
|
||||
|
||||
@@ -1,100 +1,100 @@
|
||||
<div class="demo-sidenav">
|
||||
<md-list>
|
||||
<h3 md-subheader>Sidenav Demo</h3>
|
||||
<mat-list>
|
||||
<h3 matSubheader>Sidenav Demo</h3>
|
||||
|
||||
<md-list-item>
|
||||
<mat-list-item>
|
||||
<span>Sidenav Item 1</span>
|
||||
</md-list-item>
|
||||
</mat-list-item>
|
||||
|
||||
<md-divider></md-divider>
|
||||
<mat-divider></mat-divider>
|
||||
|
||||
<md-list-item>
|
||||
<mat-list-item>
|
||||
<span>Sidenav Item 2</span>
|
||||
</md-list-item>
|
||||
</mat-list-item>
|
||||
|
||||
<md-divider></md-divider>
|
||||
<mat-divider></mat-divider>
|
||||
|
||||
<md-list-item>
|
||||
<mat-list-item>
|
||||
<span>Sidenav Item 3</span>
|
||||
</md-list-item>
|
||||
</mat-list-item>
|
||||
|
||||
<md-divider></md-divider>
|
||||
<mat-divider></mat-divider>
|
||||
|
||||
<md-list-item>
|
||||
<mat-list-item>
|
||||
<span>Sidenav Item 4</span>
|
||||
</md-list-item>
|
||||
</mat-list-item>
|
||||
|
||||
<md-divider></md-divider>
|
||||
<mat-divider></mat-divider>
|
||||
|
||||
<md-list-item>
|
||||
<mat-list-item>
|
||||
<span>Sidenav Item 5</span>
|
||||
</md-list-item>
|
||||
</mat-list-item>
|
||||
|
||||
<md-divider></md-divider>
|
||||
<mat-divider></mat-divider>
|
||||
|
||||
<md-list-item>
|
||||
<mat-list-item>
|
||||
<span>Sidenav Item 6</span>
|
||||
</md-list-item>
|
||||
</mat-list-item>
|
||||
|
||||
<md-divider></md-divider>
|
||||
<mat-divider></mat-divider>
|
||||
|
||||
<md-list-item>
|
||||
<mat-list-item>
|
||||
<span>Sidenav Item 7</span>
|
||||
</md-list-item>
|
||||
</mat-list-item>
|
||||
|
||||
<md-divider></md-divider>
|
||||
<mat-divider></mat-divider>
|
||||
|
||||
<md-list-item>
|
||||
<mat-list-item>
|
||||
<span>Sidenav Item 8</span>
|
||||
</md-list-item>
|
||||
</mat-list-item>
|
||||
|
||||
<md-divider></md-divider>
|
||||
<mat-divider></mat-divider>
|
||||
|
||||
<md-list-item>
|
||||
<mat-list-item>
|
||||
<span>Sidenav Item 9</span>
|
||||
</md-list-item>
|
||||
</mat-list-item>
|
||||
|
||||
<md-divider></md-divider>
|
||||
<mat-divider></mat-divider>
|
||||
|
||||
<md-list-item>
|
||||
<mat-list-item>
|
||||
<span>Sidenav Item 10</span>
|
||||
</md-list-item>
|
||||
</mat-list-item>
|
||||
|
||||
<md-divider></md-divider>
|
||||
<mat-divider></mat-divider>
|
||||
|
||||
<md-list-item>
|
||||
<mat-list-item>
|
||||
<span>Sidenav Item 11</span>
|
||||
</md-list-item>
|
||||
</mat-list-item>
|
||||
|
||||
<md-divider></md-divider>
|
||||
<mat-divider></mat-divider>
|
||||
|
||||
<md-list-item>
|
||||
<mat-list-item>
|
||||
<span>Sidenav Item 12</span>
|
||||
</md-list-item>
|
||||
</mat-list-item>
|
||||
|
||||
<md-divider></md-divider>
|
||||
<mat-divider></mat-divider>
|
||||
|
||||
<md-list-item>
|
||||
<mat-list-item>
|
||||
<span>Sidenav Item 13</span>
|
||||
</md-list-item>
|
||||
</mat-list-item>
|
||||
|
||||
<md-divider></md-divider>
|
||||
<mat-divider></mat-divider>
|
||||
|
||||
<md-list-item>
|
||||
<mat-list-item>
|
||||
<span>Sidenav Item 14</span>
|
||||
</md-list-item>
|
||||
</mat-list-item>
|
||||
|
||||
<md-divider></md-divider>
|
||||
<mat-divider></mat-divider>
|
||||
|
||||
<md-list-item>
|
||||
<mat-list-item>
|
||||
<span>Sidenav Item 15</span>
|
||||
</md-list-item>
|
||||
</mat-list-item>
|
||||
|
||||
<md-divider></md-divider>
|
||||
<mat-divider></mat-divider>
|
||||
|
||||
<md-list-item>
|
||||
<mat-list-item>
|
||||
<span>Sidenav Item 16</span>
|
||||
</md-list-item>
|
||||
</mat-list-item>
|
||||
|
||||
</md-list>
|
||||
</mat-list>
|
||||
</div>
|
||||
|
||||
@@ -1,22 +1,23 @@
|
||||
<button md-icon-button
|
||||
<button mat-icon-button
|
||||
type="button"
|
||||
class="mat-elevation-z1"
|
||||
[mdMenuTriggerFor]="colorMenu"
|
||||
(onMenuOpen)="onMenuOpen()"
|
||||
[ngClass]="'md-'+selectedPalette+'-'+selectedHue+'-bg'">
|
||||
<md-icon>palette</md-icon>
|
||||
[matMenuTriggerFor]="colorMenu"
|
||||
(menuOpened)="onMenuOpen()"
|
||||
[ngClass]="'mat-'+selectedPalette+'-'+selectedHue+'-bg'">
|
||||
<mat-icon>palette</mat-icon>
|
||||
</button>
|
||||
|
||||
<md-menu #colorMenu="mdMenu" class="fuse-material-color-picker-menu">
|
||||
<mat-menu #colorMenu="matMenu" class="fuse-material-color-picker-menu">
|
||||
|
||||
<header [ngClass]="selectedColor?.class || 'md-accent-bg'"
|
||||
<header [ngClass]="selectedColor?.class || 'mat-accent-bg'"
|
||||
class="mat-elevation-z4"
|
||||
fxLayout="row"
|
||||
fxLayoutAlign="space-between center">
|
||||
|
||||
<button md-icon-button
|
||||
<button mat-icon-button
|
||||
[style.visibility]="view==='hues'?'visible':'hidden'"
|
||||
(click)="$event.stopPropagation();backToPaletteSelection()" aria-label="Palette">
|
||||
<md-icon class="s-20">arrow_back</md-icon>
|
||||
<mat-icon class="s-20">arrow_back</mat-icon>
|
||||
</button>
|
||||
|
||||
<span *ngIf="selectedColor?.palette">
|
||||
@@ -27,11 +28,11 @@
|
||||
Select Color
|
||||
</span>
|
||||
|
||||
<button md-icon-button
|
||||
<button mat-icon-button
|
||||
class="remove-color-button"
|
||||
(click)="removeColor()"
|
||||
aria-label="Remove Color">
|
||||
<md-icon class="s-20">delete</md-icon>
|
||||
<mat-icon class="s-20">delete</mat-icon>
|
||||
</button>
|
||||
</header>
|
||||
|
||||
@@ -44,12 +45,12 @@
|
||||
|
||||
<div fxLayout="row" fxLayoutWrap
|
||||
fxLayoutAlign="start start"
|
||||
class="colors" perfect-scrollbar>
|
||||
class="colors" fusePerfectScrollbar>
|
||||
<div class="color"
|
||||
[ngClass]="'md-'+color.key+'-bg'"
|
||||
[ngClass]="'mat-'+color.key+'-bg'"
|
||||
*ngFor="let color of (colors | keys)"
|
||||
(click)="$event.stopPropagation();selectPalette(color.key)"
|
||||
fxLayout="row" fxLayoutAlign="start end" md-ink-ripple>
|
||||
fxLayout="row" fxLayoutAlign="start end" mat-ink-ripple>
|
||||
<span class="label">
|
||||
{{color.key}}
|
||||
</span>
|
||||
@@ -62,20 +63,20 @@
|
||||
[@slideInRight]>
|
||||
<div fxLayout="row" fxLayoutWrap
|
||||
fxLayoutAlign="start start"
|
||||
class="colors" perfect-scrollbar>
|
||||
class="colors" fusePerfectScrollbar>
|
||||
<div class="color"
|
||||
*ngFor="let hue of hues"
|
||||
[fxHide]="selectedPalette === 'white' && hue !== '500'|| selectedPalette === 'black' && hue !== '500'"
|
||||
[ngClass]="'md-'+selectedPalette+'-'+hue+'-bg'"
|
||||
[ngClass]="'mat-'+selectedPalette+'-'+hue+'-bg'"
|
||||
(click)="selectHue(hue)"
|
||||
fxLayout="row" fxLayoutAlign="start end" md-ink-ripple>
|
||||
fxLayout="row" fxLayoutAlign="start end" mat-ink-ripple>
|
||||
<span class="label">
|
||||
{{hue}}
|
||||
</span>
|
||||
<md-icon *ngIf="selectedHue === hue" class="s-16">check</md-icon>
|
||||
<mat-icon *ngIf="selectedHue === hue" class="s-16">check</mat-icon>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</md-menu>
|
||||
</mat-menu>
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
overflow: hidden;
|
||||
min-height: 258px;
|
||||
height: 308px;
|
||||
background-color: #f7f7f7;
|
||||
background-color: #F7F7F7;
|
||||
|
||||
.view {
|
||||
position: absolute;
|
||||
@@ -39,7 +39,7 @@
|
||||
font-size: 10px;
|
||||
}
|
||||
|
||||
md-icon {
|
||||
mat-icon {
|
||||
position: absolute;
|
||||
top: 2px;
|
||||
right: 2px;
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import { Component, EventEmitter, Input, OnChanges, OnInit, Output, ViewEncapsulation } from '@angular/core';
|
||||
import { MatColors } from '../../matColors';
|
||||
import { Animations } from '../../animations';
|
||||
import { fuseAnimations } from '../../animations';
|
||||
|
||||
@Component({
|
||||
selector : 'fuse-material-color-picker',
|
||||
templateUrl : './material-color-picker.component.html',
|
||||
styleUrls : ['./material-color-picker.component.scss'],
|
||||
animations : [Animations.slideInLeft, Animations.slideInRight],
|
||||
animations : fuseAnimations,
|
||||
encapsulation: ViewEncapsulation.None
|
||||
})
|
||||
export class FuseMaterialColorPickerComponent implements OnInit, OnChanges
|
||||
@@ -129,7 +129,7 @@ export class FuseMaterialColorPickerComponent implements OnInit, OnChanges
|
||||
{
|
||||
this.selectedBg = MatColors.getColor(this.selectedPalette)[this.selectedHue];
|
||||
this.selectedFg = MatColors.getColor(this.selectedPalette).contrast[this.selectedHue];
|
||||
this.selectedClass = 'md-' + this.selectedPalette + '-' + this.selectedHue + '-bg';
|
||||
this.selectedClass = 'mat-' + this.selectedPalette + '-' + this.selectedHue + '-bg';
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
<a class="nav-link" matRipple>
|
||||
<mat-icon class="nav-link-icon" *ngIf="item.icon">{{item.icon}}</mat-icon>
|
||||
<span class="nav-link-title">{{item.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>
|
||||
@@ -0,0 +1,3 @@
|
||||
:host {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
import { Component, HostBinding, HostListener, Input, OnDestroy } from '@angular/core';
|
||||
import { fuseAnimations } from '../../../../animations';
|
||||
import { FuseConfigService } from '../../../../services/config.service';
|
||||
import { Subscription } from 'rxjs/Subscription';
|
||||
|
||||
@Component({
|
||||
selector : 'fuse-nav-horizontal-collapse',
|
||||
templateUrl: './nav-horizontal-collapse.component.html',
|
||||
styleUrls : ['./nav-horizontal-collapse.component.scss'],
|
||||
animations : fuseAnimations
|
||||
})
|
||||
export class FuseNavHorizontalCollapseComponent implements OnDestroy
|
||||
{
|
||||
onSettingsChanged: Subscription;
|
||||
fuseSettings: any;
|
||||
isOpen = false;
|
||||
|
||||
@HostBinding('class') classes = 'nav-item nav-collapse';
|
||||
@Input() item: any;
|
||||
|
||||
@HostListener('mouseenter')
|
||||
open()
|
||||
{
|
||||
this.isOpen = true;
|
||||
}
|
||||
|
||||
@HostListener('mouseleave')
|
||||
close()
|
||||
{
|
||||
this.isOpen = false;
|
||||
}
|
||||
|
||||
constructor(
|
||||
private fuseConfig: FuseConfigService
|
||||
)
|
||||
{
|
||||
this.onSettingsChanged =
|
||||
this.fuseConfig.onSettingsChanged
|
||||
.subscribe(
|
||||
(newSettings) => {
|
||||
this.fuseSettings = newSettings;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
ngOnDestroy()
|
||||
{
|
||||
this.onSettingsChanged.unsubscribe();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
<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">{{item.title}}</span>
|
||||
<span class="nav-link-badge" *ngIf="item.badge"
|
||||
[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">{{item.title}}</span>
|
||||
<span class="nav-link-badge" *ngIf="item.badge"
|
||||
[ngStyle]="{'background-color': item.badge.bg,'color': item.badge.fg}">
|
||||
{{item.badge.title}}
|
||||
</span>
|
||||
</span>
|
||||
@@ -0,0 +1,3 @@
|
||||
:host {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
import { Component, HostBinding, Input } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector : 'fuse-nav-horizontal-item',
|
||||
templateUrl: './nav-horizontal-item.component.html',
|
||||
styleUrls : ['./nav-horizontal-item.component.scss']
|
||||
})
|
||||
export class FuseNavHorizontalItemComponent
|
||||
{
|
||||
@HostBinding('class') classes = 'nav-item';
|
||||
@Input() item: any;
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
<a class="nav-link" md-ripple (click)="toggleOpen($event)">
|
||||
<md-icon class="nav-link-icon" *ngIf="item.icon">{{item.icon}}</md-icon>
|
||||
<span class="nav-link-title">{{item.title}}</span>
|
||||
<md-icon class="collapse-arrow">keyboard_arrow_right</md-icon>
|
||||
</a>
|
||||
<div class="children" [@slideInOut]="isOpen">
|
||||
<ng-container *ngFor="let item of item.children">
|
||||
<fuse-nav-item *ngIf="item.type=='nav-item'" [item]="item"></fuse-nav-item>
|
||||
<fuse-nav-collapse *ngIf="item.type=='nav-collapse'" [item]="item"></fuse-nav-collapse>
|
||||
</ng-container>
|
||||
</div>
|
||||
@@ -1,147 +0,0 @@
|
||||
import { Component, HostBinding, Input, OnInit } from '@angular/core';
|
||||
import { FuseNavigationService } from '../navigation.service';
|
||||
import { NavigationEnd, Router } from '@angular/router';
|
||||
import { Animations } from '../../../animations';
|
||||
|
||||
@Component({
|
||||
selector : 'fuse-nav-collapse',
|
||||
templateUrl: './nav-collapse.component.html',
|
||||
styleUrls : ['./nav-collapse.component.scss'],
|
||||
animations : [Animations.slideInOut]
|
||||
})
|
||||
export class FuseNavCollapseComponent implements OnInit
|
||||
{
|
||||
@Input() item: any;
|
||||
@HostBinding('class') classes = 'nav-collapse nav-item';
|
||||
@HostBinding('class.open') public isOpen = false;
|
||||
|
||||
constructor(private navigationService: FuseNavigationService, private router: Router)
|
||||
{
|
||||
/**
|
||||
* When navigation changed
|
||||
*/
|
||||
router.events.subscribe(
|
||||
(event) => {
|
||||
if ( event instanceof NavigationEnd )
|
||||
{
|
||||
/**
|
||||
* Check if the url is child of the collapse
|
||||
*/
|
||||
if ( this.isUrlInChildren(this.item, event.urlAfterRedirects) )
|
||||
{
|
||||
// console.log(this.item);
|
||||
this.expand();
|
||||
}
|
||||
else
|
||||
{
|
||||
this.collapse();
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
/**
|
||||
* Whenever a navigation collapse item toggled
|
||||
*/
|
||||
this.navigationService.onNavCollapseToggled.subscribe(
|
||||
(clickedItem) => {
|
||||
if ( clickedItem.children )
|
||||
{
|
||||
/**
|
||||
* if clicked collapse is child of this collapse
|
||||
* return
|
||||
*/
|
||||
if ( this.item.children.indexOf(clickedItem) !== -1 )
|
||||
{
|
||||
return;
|
||||
}
|
||||
/**
|
||||
* If collapsed item is not related with this collapse
|
||||
* collapse
|
||||
*/
|
||||
if ( this.item !== clickedItem )
|
||||
{
|
||||
this.collapse();
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Toggle Collapse
|
||||
* @param ev
|
||||
*/
|
||||
toggleOpen(ev)
|
||||
{
|
||||
ev.preventDefault();
|
||||
this.isOpen = !this.isOpen;
|
||||
this.navigationService.onNavCollapseToggled.emit(this.item);
|
||||
}
|
||||
|
||||
/**
|
||||
* Expand
|
||||
*/
|
||||
expand()
|
||||
{
|
||||
if ( this.isOpen )
|
||||
{
|
||||
return;
|
||||
}
|
||||
this.isOpen = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Collapse
|
||||
*/
|
||||
collapse()
|
||||
{
|
||||
if ( !this.isOpen )
|
||||
{
|
||||
return;
|
||||
}
|
||||
this.isOpen = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checking the url is in children
|
||||
* @param arr
|
||||
* @param url
|
||||
* @returns {any}
|
||||
*/
|
||||
isUrlInChildren(arr, url)
|
||||
{
|
||||
if ( !arr.children )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
for ( let i = 0; i < arr.children.length; i++ )
|
||||
{
|
||||
if ( arr.children[i].children )
|
||||
{
|
||||
if ( this.isUrlInChildren(arr.children[i], url) )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if ( arr.children[i].url === url )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public isCollapsed(): boolean
|
||||
{
|
||||
return this.isOpen;
|
||||
}
|
||||
|
||||
ngOnInit()
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
<a class="nav-link" md-ripple
|
||||
[routerLink]="[item.url]" routerLinkActive="active">
|
||||
<md-icon class="nav-link-icon" *ngIf="item.icon">{{item.icon}}</md-icon>
|
||||
<span class="nav-link-title">{{item.title}}</span>
|
||||
<span class="nav-link-badge" *ngIf="item.badge" [ngStyle]="{'background-color': item.badge.bg,'color': item.badge.fg}">{{item.badge.title}}</span>
|
||||
</a>
|
||||
@@ -1 +0,0 @@
|
||||
<span class="hint-text">{{ item.title }}</span>
|
||||
@@ -1,20 +0,0 @@
|
||||
|
||||
:host {
|
||||
|
||||
.folded:not(.folded-open) & {
|
||||
|
||||
&:before {
|
||||
content: '';
|
||||
display: block;
|
||||
position: absolute;
|
||||
min-width: 1.6rem;
|
||||
border-top: 2px solid;
|
||||
opacity: 0.2;
|
||||
}
|
||||
|
||||
> span {
|
||||
opacity: 0;
|
||||
transition: opacity 200ms ease;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
import { Component, HostBinding, Input, OnInit } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector : 'fuse-nav-subheader',
|
||||
templateUrl: './nav-subheader.component.html',
|
||||
styleUrls : ['./nav-subheader.component.scss']
|
||||
})
|
||||
export class FuseNavSubheaderComponent implements OnInit
|
||||
{
|
||||
@HostBinding('class') classes = 'nav-subheader';
|
||||
@Input() item: any;
|
||||
|
||||
constructor()
|
||||
{
|
||||
}
|
||||
|
||||
ngOnInit()
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,11 +1,32 @@
|
||||
<div id="main-navigation" class="nav">
|
||||
<ng-container *ngFor="let item of navigation">
|
||||
<div id="main-navigation" class="nav"
|
||||
[ngClass]="{'horizontal':layout === 'horizontal', 'vertical':layout === 'vertical'}">
|
||||
|
||||
<fuse-nav-subheader *ngIf="item.type=='subheader'" [item]="item"></fuse-nav-subheader>
|
||||
<!-- Vertical Navigation Layout -->
|
||||
<ng-container *ngIf="layout === 'vertical'">
|
||||
|
||||
<fuse-nav-item *ngIf="item.type=='nav-item'" [item]="item"></fuse-nav-item>
|
||||
<ng-container *ngFor="let item of navigationModel">
|
||||
|
||||
<fuse-nav-collapse *ngIf="item.type=='nav-collapse'" [item]="item"></fuse-nav-collapse>
|
||||
<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-item *ngIf="item.type=='item'" [item]="item"></fuse-nav-vertical-item>
|
||||
|
||||
</ng-container>
|
||||
|
||||
</ng-container>
|
||||
<!-- / Vertical Navigation Layout -->
|
||||
|
||||
<!-- Horizontal Navigation Layout -->
|
||||
<ng-container *ngIf="layout === 'horizontal'">
|
||||
|
||||
<ng-container *ngFor="let item of navigationModel">
|
||||
|
||||
<fuse-nav-horizontal-collapse *ngIf="item.type=='group'" [item]="item"></fuse-nav-horizontal-collapse>
|
||||
<fuse-nav-horizontal-collapse *ngIf="item.type=='collapse'" [item]="item"></fuse-nav-horizontal-collapse>
|
||||
<fuse-nav-horizontal-item *ngIf="item.type=='item'" [item]="item"></fuse-nav-horizontal-item>
|
||||
|
||||
</ng-container>
|
||||
|
||||
</ng-container>
|
||||
<!-- / Horizontal Navigation Layout -->
|
||||
|
||||
</div>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { Component, ViewEncapsulation } from '@angular/core';
|
||||
import { Component, Input, OnDestroy, ViewEncapsulation } from '@angular/core';
|
||||
import { FuseNavigationService } from './navigation.service';
|
||||
import { Subscription } from 'rxjs/Subscription';
|
||||
|
||||
@Component({
|
||||
selector : 'fuse-navigation',
|
||||
@@ -7,13 +8,25 @@ import { FuseNavigationService } from './navigation.service';
|
||||
styleUrls : ['./navigation.component.scss'],
|
||||
encapsulation: ViewEncapsulation.None
|
||||
})
|
||||
export class FuseNavigationComponent
|
||||
export class FuseNavigationComponent implements OnDestroy
|
||||
{
|
||||
navigation: any[];
|
||||
navigationModel: any[];
|
||||
navigationModelChangeSubscription: Subscription;
|
||||
|
||||
constructor(private navigationService: FuseNavigationService)
|
||||
@Input('layout') layout = 'vertical';
|
||||
|
||||
constructor(private fuseNavigationService: FuseNavigationService)
|
||||
{
|
||||
this.navigation = navigationService.getNavigation();
|
||||
this.navigationModelChangeSubscription =
|
||||
this.fuseNavigationService.onNavigationModelChange
|
||||
.subscribe((navigationModel) => {
|
||||
this.navigationModel = navigationModel;
|
||||
});
|
||||
}
|
||||
|
||||
ngOnDestroy()
|
||||
{
|
||||
this.navigationModelChangeSubscription.unsubscribe();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { SharedModule } from '../../modules/shared.module';
|
||||
import { RouterModule } from '@angular/router';
|
||||
import { FuseNavSubheaderComponent } from './nav-subheader/nav-subheader.component';
|
||||
import { FuseNavigationComponent } from './navigation.component';
|
||||
import { FuseNavItemComponent } from './nav-item/nav-item.component';
|
||||
import { FuseNavCollapseComponent } from './nav-collapse/nav-collapse.component';
|
||||
import { FuseNavVerticalItemComponent } from './vertical/nav-item/nav-vertical-item.component';
|
||||
import { FuseNavVerticalCollapseComponent } from './vertical/nav-collapse/nav-vertical-collapse.component';
|
||||
import { FuseNavVerticalGroupComponent } from './vertical/nav-group/nav-vertical-group.component';
|
||||
import { FuseNavHorizontalItemComponent } from './horizontal/nav-item/nav-horizontal-item.component';
|
||||
import { FuseNavHorizontalCollapseComponent } from './horizontal/nav-collapse/nav-horizontal-collapse.component';
|
||||
|
||||
@NgModule({
|
||||
imports : [
|
||||
@@ -16,9 +18,11 @@ import { FuseNavCollapseComponent } from './nav-collapse/nav-collapse.component'
|
||||
],
|
||||
declarations: [
|
||||
FuseNavigationComponent,
|
||||
FuseNavSubheaderComponent,
|
||||
FuseNavItemComponent,
|
||||
FuseNavCollapseComponent
|
||||
FuseNavVerticalGroupComponent,
|
||||
FuseNavVerticalItemComponent,
|
||||
FuseNavVerticalCollapseComponent,
|
||||
FuseNavHorizontalItemComponent,
|
||||
FuseNavHorizontalCollapseComponent
|
||||
]
|
||||
})
|
||||
export class FuseNavigationModule
|
||||
|
||||
@@ -1,25 +1,151 @@
|
||||
import { EventEmitter, Injectable } from '@angular/core';
|
||||
import { FuseNavigation } from '../../../navigation.model';
|
||||
import { NavigationModel } from '../../../navigation.model';
|
||||
import { BehaviorSubject } from 'rxjs/BehaviorSubject';
|
||||
|
||||
@Injectable()
|
||||
export class FuseNavigationService
|
||||
{
|
||||
onNavCollapseToggle = new EventEmitter<any>();
|
||||
onNavCollapseToggled = new EventEmitter<any>();
|
||||
navigation: any[];
|
||||
onNavigationModelChange: BehaviorSubject<any> = new BehaviorSubject({});
|
||||
navigationModel: NavigationModel;
|
||||
flatNavigation: any[] = [];
|
||||
|
||||
constructor()
|
||||
{
|
||||
this.navigation = new FuseNavigation().items;
|
||||
this.navigationModel = new NavigationModel();
|
||||
this.onNavigationModelChange.next(this.navigationModel.model);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get navigation array
|
||||
* Get navigation model
|
||||
*
|
||||
* @returns {any[]}
|
||||
*/
|
||||
getNavigation()
|
||||
getNavigationModel()
|
||||
{
|
||||
return this.navigation;
|
||||
return this.navigationModel.model;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the navigation model
|
||||
*
|
||||
* @param model
|
||||
*/
|
||||
setNavigationModel(model)
|
||||
{
|
||||
this.navigationModel = model;
|
||||
this.onNavigationModelChange.next(this.navigationModel.model);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add new navigation item
|
||||
* to the given location
|
||||
*/
|
||||
addNavigationItem(location, item)
|
||||
{
|
||||
// Parse the location
|
||||
const locationArr = location.split('.');
|
||||
|
||||
if ( locationArr.length === 0 )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// Find the navigation item
|
||||
const navItem = this.findNavigationItemById(locationArr);
|
||||
|
||||
// Act according to the item type
|
||||
switch ( navItem.type )
|
||||
{
|
||||
case 'item':
|
||||
|
||||
// Create a children array
|
||||
navItem.children = [];
|
||||
|
||||
// Push the item
|
||||
navItem.children.push(item);
|
||||
|
||||
// Change the item type to collapsable
|
||||
navItem.type = 'collapse';
|
||||
|
||||
break;
|
||||
|
||||
case 'collapse':
|
||||
|
||||
// Push the item
|
||||
navItem.children.push(item);
|
||||
|
||||
break;
|
||||
|
||||
case 'group':
|
||||
|
||||
// Push the item
|
||||
navItem.children.push(item);
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get navigation item from
|
||||
* given location
|
||||
*
|
||||
* @param location
|
||||
*/
|
||||
getNavigationItem(location)
|
||||
{
|
||||
// Parse the location
|
||||
const locationArr = location.split('.');
|
||||
|
||||
if ( locationArr.length === 0 )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// Find and return the navigation item
|
||||
return this.findNavigationItemById(locationArr);
|
||||
}
|
||||
|
||||
/**
|
||||
* Find navigation item by location
|
||||
*
|
||||
* @param location
|
||||
* @param navigation
|
||||
*/
|
||||
findNavigationItemById(location, navigation?)
|
||||
{
|
||||
if ( !navigation )
|
||||
{
|
||||
navigation = this.navigationModel.model;
|
||||
}
|
||||
|
||||
// Iterate through the given navigation
|
||||
for ( const navItem of navigation )
|
||||
{
|
||||
// If the nav item id equals the first location...
|
||||
if ( navItem.id === location[0] )
|
||||
{
|
||||
// If there is more location to look at...
|
||||
if ( location.length > 1 )
|
||||
{
|
||||
// Remove the first item of the location
|
||||
location.splice(0, 1);
|
||||
|
||||
// Go nested...
|
||||
return this.findNavigationItemById(location, navItem.children);
|
||||
}
|
||||
|
||||
// Otherwise just return the nav item
|
||||
else
|
||||
{
|
||||
return navItem;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -31,7 +157,7 @@ export class FuseNavigationService
|
||||
{
|
||||
if ( !navigationItems )
|
||||
{
|
||||
navigationItems = this.navigation;
|
||||
navigationItems = this.navigationModel.model;
|
||||
}
|
||||
|
||||
for ( const navItem of navigationItems )
|
||||
@@ -41,7 +167,7 @@ export class FuseNavigationService
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( navItem.type === 'nav-item' )
|
||||
if ( navItem.type === 'item' )
|
||||
{
|
||||
this.flatNavigation.push({
|
||||
title: navItem.title,
|
||||
@@ -53,7 +179,7 @@ export class FuseNavigationService
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( navItem.type === 'nav-collapse' )
|
||||
if ( navItem.type === 'collapse' || navItem.type === 'group' )
|
||||
{
|
||||
this.getFlatNavigation(navItem.children);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
<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">{{item.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>
|
||||
@@ -0,0 +1,182 @@
|
||||
import { Component, HostBinding, Input, OnInit } from '@angular/core';
|
||||
import { FuseNavigationService } from '../../navigation.service';
|
||||
import { NavigationEnd, Router } from '@angular/router';
|
||||
import { fuseAnimations } from '../../../../animations';
|
||||
|
||||
@Component({
|
||||
selector : 'fuse-nav-vertical-collapse',
|
||||
templateUrl: './nav-vertical-collapse.component.html',
|
||||
styleUrls : ['./nav-vertical-collapse.component.scss'],
|
||||
animations : fuseAnimations
|
||||
})
|
||||
export class FuseNavVerticalCollapseComponent implements OnInit
|
||||
{
|
||||
@Input() item: any;
|
||||
@HostBinding('class') classes = 'nav-collapse nav-item';
|
||||
@HostBinding('class.open') public isOpen = false;
|
||||
|
||||
constructor(
|
||||
private navigationService: FuseNavigationService,
|
||||
private router: Router
|
||||
)
|
||||
{
|
||||
// Listen for route changes
|
||||
router.events.subscribe(
|
||||
(event) => {
|
||||
if ( event instanceof NavigationEnd )
|
||||
{
|
||||
// Check if the url can be found in
|
||||
// one of the children of this item
|
||||
if ( this.isUrlInChildren(this.item, event.urlAfterRedirects) )
|
||||
{
|
||||
this.expand();
|
||||
}
|
||||
else
|
||||
{
|
||||
this.collapse();
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
// Listen for collapsing of any navigation item
|
||||
this.navigationService.onNavCollapseToggled
|
||||
.subscribe(
|
||||
(clickedItem) => {
|
||||
if ( clickedItem && clickedItem.children )
|
||||
{
|
||||
// Check if the clicked item is one
|
||||
// of the children of this item
|
||||
if ( this.isChildrenOf(this.item, clickedItem) )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// Check if the url can be found in
|
||||
// one of the children of this item
|
||||
if ( this.isUrlInChildren(this.item, this.router.url) )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// If the clicked item is not this item, collapse...
|
||||
if ( this.item !== clickedItem )
|
||||
{
|
||||
this.collapse();
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Toggle collapse
|
||||
*
|
||||
* @param ev
|
||||
*/
|
||||
toggleOpen(ev)
|
||||
{
|
||||
ev.preventDefault();
|
||||
|
||||
this.isOpen = !this.isOpen;
|
||||
|
||||
// Navigation collapse toggled...
|
||||
this.navigationService.onNavCollapseToggled.emit(this.item);
|
||||
this.navigationService.onNavCollapseToggle.emit();
|
||||
}
|
||||
|
||||
/**
|
||||
* Expand the collapsable navigation
|
||||
*/
|
||||
expand()
|
||||
{
|
||||
if ( this.isOpen )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
this.isOpen = true;
|
||||
this.navigationService.onNavCollapseToggle.emit();
|
||||
}
|
||||
|
||||
/**
|
||||
* Collapse the collapsable navigation
|
||||
*/
|
||||
collapse()
|
||||
{
|
||||
if ( !this.isOpen )
|
||||
{
|
||||
return;
|
||||
}
|
||||
this.isOpen = false;
|
||||
this.navigationService.onNavCollapseToggle.emit();
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the given parent has the
|
||||
* given item in one of its children
|
||||
*
|
||||
* @param parent
|
||||
* @param item
|
||||
* @return {any}
|
||||
*/
|
||||
isChildrenOf(parent, item)
|
||||
{
|
||||
if ( !parent.children )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( parent.children.indexOf(item) !== -1 )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
for ( const children of parent.children )
|
||||
{
|
||||
if ( children.children )
|
||||
{
|
||||
return this.isChildrenOf(children, item);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the given url can be found
|
||||
* in one of the given parent's children
|
||||
*
|
||||
* @param parent
|
||||
* @param url
|
||||
* @returns {any}
|
||||
*/
|
||||
isUrlInChildren(parent, url)
|
||||
{
|
||||
if ( !parent.children )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
for ( let i = 0; i < parent.children.length; i++ )
|
||||
{
|
||||
if ( parent.children[i].children )
|
||||
{
|
||||
if ( this.isUrlInChildren(parent.children[i], url) )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if ( parent.children[i].url === url || url.includes(parent.children[i].url) )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
ngOnInit()
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
<div class="group-title">
|
||||
<span class="hint-text">{{ item.title }}</span>
|
||||
</div>
|
||||
<div class="group-items">
|
||||
<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-collapse *ngIf="item.type=='collapse'" [item]="item"></fuse-nav-vertical-collapse>
|
||||
<fuse-nav-vertical-item *ngIf="item.type=='item'" [item]="item"></fuse-nav-vertical-item>
|
||||
</ng-container>
|
||||
</div>
|
||||
@@ -0,0 +1,23 @@
|
||||
:host {
|
||||
|
||||
.folded:not(.folded-open) & {
|
||||
|
||||
> .group-title {
|
||||
align-items: center;
|
||||
|
||||
> span {
|
||||
opacity: 0;
|
||||
transition: opacity 200ms ease;
|
||||
}
|
||||
|
||||
&:before {
|
||||
content: '';
|
||||
display: block;
|
||||
position: absolute;
|
||||
min-width: 1.6rem;
|
||||
border-top: 2px solid;
|
||||
opacity: 0.2;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
import { Component, HostBinding, Input, OnInit } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector : 'fuse-nav-vertical-group',
|
||||
templateUrl: './nav-vertical-group.component.html',
|
||||
styleUrls : ['./nav-vertical-group.component.scss']
|
||||
})
|
||||
export class FuseNavVerticalGroupComponent implements OnInit
|
||||
{
|
||||
@HostBinding('class') classes = 'nav-group nav-item';
|
||||
@Input() item: any;
|
||||
|
||||
constructor()
|
||||
{
|
||||
}
|
||||
|
||||
ngOnInit()
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
<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">{{item.title}}</span>
|
||||
<span class="nav-link-badge" *ngIf="item.badge"
|
||||
[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">{{item.title}}</span>
|
||||
<span class="nav-link-badge" *ngIf="item.badge"
|
||||
[ngStyle]="{'background-color': item.badge.bg,'color': item.badge.fg}">
|
||||
{{item.badge.title}}
|
||||
</span>
|
||||
</span>
|
||||
@@ -1,11 +1,11 @@
|
||||
import { Component, HostBinding, Input, OnInit } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector : 'fuse-nav-item',
|
||||
templateUrl: './nav-item.component.html',
|
||||
styleUrls : ['./nav-item.component.scss']
|
||||
selector : 'fuse-nav-vertical-item',
|
||||
templateUrl: './nav-vertical-item.component.html',
|
||||
styleUrls : ['./nav-vertical-item.component.scss']
|
||||
})
|
||||
export class FuseNavItemComponent implements OnInit
|
||||
export class FuseNavVerticalItemComponent implements OnInit
|
||||
{
|
||||
@HostBinding('class') classes = 'nav-item';
|
||||
@Input() item: any;
|
||||
@@ -1,20 +1,20 @@
|
||||
<div class="fuse-search-bar" [ngClass]="{'expanded':!collapsed}" fxFlex="0 1 auto">
|
||||
<div [ngClass]="toolbarColor" fxLayout="row" fxLayoutAlign="start center" fxFlex>
|
||||
<label for="fuse-search-bar-input">
|
||||
<button md-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">
|
||||
<md-icon class="s-24">search</md-icon>
|
||||
<mat-icon class="s-24">search</mat-icon>
|
||||
</button>
|
||||
<!--<span class="fuse-search-bar-loader" fxLayout="row" fxLayoutAlign="center center" *ngIf="!collapsed">
|
||||
<md-progress-spinner color="md-accent" mode="indeterminate"></md-progress-spinner>
|
||||
<mat-progress-spinner color="mat-accent" mode="indeterminate"></mat-progress-spinner>
|
||||
</span>-->
|
||||
</label>
|
||||
|
||||
<input id="fuse-search-bar-input" class="ml-24" type="text" placeholder="Search" (input)="search($event)" fxFlex>
|
||||
|
||||
<button md-icon-button class="fuse-search-bar-collapser md-icon-button" (click)="collapse()"
|
||||
<button mat-icon-button class="fuse-search-bar-collapser mat-icon-button" (click)="collapse()"
|
||||
aria-label="Collapse Search Bar">
|
||||
<md-icon class="s-24">close</md-icon>
|
||||
<mat-icon class="s-24">close</mat-icon>
|
||||
</button>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -3,11 +3,14 @@
|
||||
:host {
|
||||
|
||||
.fuse-search-bar {
|
||||
min-width: 64px;
|
||||
height: 64px;
|
||||
font-size: 13px;
|
||||
@include media-breakpoint-down('xs') {
|
||||
|
||||
@include media-breakpoint-down('sm') {
|
||||
height: 56px;
|
||||
}
|
||||
|
||||
.fuse-search-bar-expander,
|
||||
.fuse-search-bar-collapser {
|
||||
cursor: pointer;
|
||||
@@ -16,7 +19,8 @@
|
||||
width: 64px !important;
|
||||
height: 64px !important;
|
||||
line-height: 64px !important;
|
||||
@include media-breakpoint-down('xs') {
|
||||
|
||||
@include media-breakpoint-down('sm') {
|
||||
height: 56px !important;
|
||||
line-height: 56px !important;
|
||||
}
|
||||
@@ -26,7 +30,7 @@
|
||||
width: 64px !important;
|
||||
height: 64px !important;
|
||||
line-height: 64px !important;
|
||||
@include media-breakpoint-down('xs') {
|
||||
@include media-breakpoint-down('sm') {
|
||||
height: 56px !important;
|
||||
line-height: 56px !important;
|
||||
}
|
||||
@@ -70,4 +74,4 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,22 +2,22 @@
|
||||
|
||||
<div class="shortcuts-mobile-toggle" *ngIf="!mobileShortcutsPanelActive" fxLayout="row" fxLayoutAlign="start center"
|
||||
fxHide fxShow.lt-md>
|
||||
<button md-icon-button (click)="showMobileShortcutsPanel()">
|
||||
<md-icon class="amber-600-fg">star</md-icon>
|
||||
<button mat-icon-button (click)="showMobileShortcutsPanel()">
|
||||
<mat-icon class="amber-600-fg">star</mat-icon>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="shortcuts" fxHide fxShow.gt-sm [ngClass]="toolbarColor">
|
||||
|
||||
<div fxLayout="row" fxLayoutAlign="space-between center" fxFlex>
|
||||
<div fxLayout="row" fxLayoutAlign="space-between center" fxFlex="0 1 auto">
|
||||
|
||||
<div fxLayout="row" fxLayoutAlign="start center">
|
||||
|
||||
<div class="w-40 h-40 p-4" fxLayout="row" fxLayoutAlign="center center"
|
||||
*ngFor="let shortcutItem of shortcutItems">
|
||||
|
||||
<a md-icon-button mdTooltip="{{shortcutItem.title}}" [routerLink]="shortcutItem.url">
|
||||
<md-icon *ngIf="shortcutItem.icon">{{shortcutItem.icon}}</md-icon>
|
||||
<a mat-icon-button matTooltip="{{shortcutItem.title}}" [routerLink]="shortcutItem.url">
|
||||
<mat-icon *ngIf="shortcutItem.icon">{{shortcutItem.icon}}</mat-icon>
|
||||
<span *ngIf="!shortcutItem.icon" class="h2 secondary-text text-bold">
|
||||
{{shortcutItem.title.substr(0, 1).toUpperCase()}}
|
||||
</span>
|
||||
@@ -25,64 +25,64 @@
|
||||
|
||||
</div>
|
||||
|
||||
<button md-icon-button [mdMenuTriggerFor]="addMenu" md-tooltip="Click to add/remove shortcut"
|
||||
(onMenuOpen)="onMenuOpen()">
|
||||
<md-icon class="amber-600-fg">star</md-icon>
|
||||
<button mat-icon-button [matMenuTriggerFor]="addMenu" matTooltip="Click to add/remove shortcut"
|
||||
(menuOpened)="onMenuOpen()">
|
||||
<mat-icon class="amber-600-fg">star</mat-icon>
|
||||
</button>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="shortcuts-mobile-close" fxLayout="row" fxLayoutAlign="start center" fxHide fxShow.lt-md>
|
||||
<button md-icon-button (click)="hideMobileShortcutsPanel()">
|
||||
<md-icon>close</md-icon>
|
||||
<button mat-icon-button (click)="hideMobileShortcutsPanel()">
|
||||
<mat-icon>close</mat-icon>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<md-menu #addMenu="mdMenu" class="w-240">
|
||||
<mat-menu #addMenu="matMenu" class="w-240">
|
||||
|
||||
<md-input-container class="px-16 w-100-p" (click)="$event.stopPropagation()" floatPlaceholder="never">
|
||||
<input #searchInput mdInput placeholder="Search for an app or a page" (input)="search($event)">
|
||||
</md-input-container>
|
||||
<mat-form-field class="px-16 w-100-p" (click)="$event.stopPropagation()" floatPlaceholder="never">
|
||||
<input #searchInput matInput placeholder="Search for an app or a page" (input)="search($event)">
|
||||
</mat-form-field>
|
||||
|
||||
<md-divider></md-divider>
|
||||
<md-nav-list *ngIf="!searching" style="max-height: 312px; overflow: auto" perfect-scrollbar>
|
||||
<mat-divider></mat-divider>
|
||||
<mat-nav-list *ngIf="!searching" style="max-height: 312px; overflow: auto" fusePerfectScrollbar>
|
||||
|
||||
<md-list-item *ngFor="let shortcutItem of shortcutItems"
|
||||
(click)="toggleShortcut($event, shortcutItem)">
|
||||
<mat-list-item *ngFor="let shortcutItem of shortcutItems"
|
||||
(click)="toggleShortcut($event, shortcutItem)">
|
||||
<div class="w-100-p" fxLayout="row" fxLayoutAlign="start center">
|
||||
<md-icon md-list-icon class="mr-8" *ngIf="shortcutItem.icon">{{shortcutItem.icon}}</md-icon>
|
||||
<mat-icon mat-list-icon class="mr-8" *ngIf="shortcutItem.icon">{{shortcutItem.icon}}</mat-icon>
|
||||
<span class="h2 w-32 h-32 p-4 mr-8 secondary-text text-bold" fxLayout="row"
|
||||
fxLayoutAlign="center center" *ngIf="!shortcutItem.icon">
|
||||
{{shortcutItem.title.substr(0, 1).toUpperCase()}}
|
||||
</span>
|
||||
<p md-line fxFlex>{{shortcutItem.title}}</p>
|
||||
<md-icon class="ml-8">star</md-icon>
|
||||
<p matLine fxFlex>{{shortcutItem.title}}</p>
|
||||
<mat-icon class="ml-8">star</mat-icon>
|
||||
</div>
|
||||
</md-list-item>
|
||||
<md-list-item *ngIf="shortcutItems.length === 0">
|
||||
</mat-list-item>
|
||||
<mat-list-item *ngIf="shortcutItems.length === 0">
|
||||
<p>
|
||||
<small>No shortcuts yet!</small>
|
||||
</p>
|
||||
</md-list-item>
|
||||
</md-nav-list>
|
||||
</mat-list-item>
|
||||
</mat-nav-list>
|
||||
|
||||
<md-nav-list *ngIf="searching" style="max-height: 312px; overflow: auto" perfect-scrollbar>
|
||||
<md-list-item *ngFor="let navigationItem of filteredNavigationItems"
|
||||
(click)="toggleShortcut($event, navigationItem)">
|
||||
<mat-nav-list *ngIf="searching" style="max-height: 312px; overflow: auto" fusePerfectScrollbar>
|
||||
<mat-list-item *ngFor="let navigationItem of filteredNavigationItems"
|
||||
(click)="toggleShortcut($event, navigationItem)">
|
||||
<div class="w-100-p" fxLayout="row" fxLayoutAlign="start center">
|
||||
<md-icon md-list-icon class="mr-8" *ngIf="navigationItem.icon">{{navigationItem.icon}}</md-icon>
|
||||
<mat-icon mat-list-icon class="mr-8" *ngIf="navigationItem.icon">{{navigationItem.icon}}</mat-icon>
|
||||
<span class="h2 w-32 h-32 p-4 mr-8 secondary-text text-bold" fxLayout="row"
|
||||
fxLayoutAlign="center center" *ngIf="!navigationItem.icon">
|
||||
{{navigationItem.title.substr(0, 1).toUpperCase()}}
|
||||
</span>
|
||||
<p md-line fxFlex>{{navigationItem.title}}</p>
|
||||
<md-icon class="ml-8" *ngIf="isInShortcuts(navigationItem)">star</md-icon>
|
||||
<p matLine fxFlex>{{navigationItem.title}}</p>
|
||||
<mat-icon class="ml-8" *ngIf="isInShortcuts(navigationItem)">star</mat-icon>
|
||||
</div>
|
||||
</md-list-item>
|
||||
</md-nav-list>
|
||||
</md-menu>
|
||||
</mat-list-item>
|
||||
</mat-nav-list>
|
||||
</mat-menu>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ import { Subscription } from 'rxjs/Subscription';
|
||||
import { ObservableMedia } from '@angular/flex-layout';
|
||||
import { FuseMatchMedia } from '../../services/match-media.service';
|
||||
import { FuseConfigService } from '../../services/config.service';
|
||||
import { CookieService } from 'ngx-cookie-service';
|
||||
|
||||
@Component({
|
||||
selector : 'fuse-shortcuts',
|
||||
@@ -29,7 +30,8 @@ export class FuseShortcutsComponent implements OnInit, OnDestroy
|
||||
private observableMedia: ObservableMedia,
|
||||
private fuseMatchMedia: FuseMatchMedia,
|
||||
private fuseNavigationService: FuseNavigationService,
|
||||
private fuseConfig: FuseConfigService
|
||||
private fuseConfig: FuseConfigService,
|
||||
private cookieService: CookieService
|
||||
)
|
||||
{
|
||||
this.filteredNavigationItems = this.navigationItems = this.fuseNavigationService.getFlatNavigation();
|
||||
@@ -45,33 +47,42 @@ export class FuseShortcutsComponent implements OnInit, OnDestroy
|
||||
|
||||
ngOnInit()
|
||||
{
|
||||
// User's shortcut items
|
||||
this.shortcutItems = [
|
||||
{
|
||||
'title': 'Calendar',
|
||||
'type' : 'nav-item',
|
||||
'icon' : 'today',
|
||||
'url' : '/apps/calendar'
|
||||
},
|
||||
{
|
||||
'title': 'Mail',
|
||||
'type' : 'nav-item',
|
||||
'icon' : 'email',
|
||||
'url' : '/apps/mail'
|
||||
},
|
||||
{
|
||||
'title': 'Contacts',
|
||||
'type' : 'nav-item',
|
||||
'icon' : 'account_box',
|
||||
'url' : '/apps/contacts'
|
||||
},
|
||||
{
|
||||
'title': 'To-Do',
|
||||
'type' : 'nav-item',
|
||||
'icon' : 'check_box',
|
||||
'url' : '/apps/todo'
|
||||
}
|
||||
];
|
||||
const cookieExists = this.cookieService.check('FUSE2.shortcuts');
|
||||
|
||||
if ( cookieExists )
|
||||
{
|
||||
this.shortcutItems = JSON.parse(this.cookieService.get('FUSE2.shortcuts'));
|
||||
}
|
||||
else
|
||||
{
|
||||
// User's shortcut items
|
||||
this.shortcutItems = [
|
||||
{
|
||||
'title': 'Calendar',
|
||||
'type' : 'nav-item',
|
||||
'icon' : 'today',
|
||||
'url' : '/apps/calendar'
|
||||
},
|
||||
{
|
||||
'title': 'Mail',
|
||||
'type' : 'nav-item',
|
||||
'icon' : 'email',
|
||||
'url' : '/apps/mail'
|
||||
},
|
||||
{
|
||||
'title': 'Contacts',
|
||||
'type' : 'nav-item',
|
||||
'icon' : 'account_box',
|
||||
'url' : '/apps/contacts'
|
||||
},
|
||||
{
|
||||
'title': 'To-Do',
|
||||
'type' : 'nav-item',
|
||||
'icon' : 'check_box',
|
||||
'url' : '/apps/todo'
|
||||
}
|
||||
];
|
||||
}
|
||||
|
||||
this.matchMediaSubscription =
|
||||
this.fuseMatchMedia.onMediaChange.subscribe(() => {
|
||||
@@ -115,12 +126,18 @@ export class FuseShortcutsComponent implements OnInit, OnDestroy
|
||||
if ( this.shortcutItems[i].url === itemToToggle.url )
|
||||
{
|
||||
this.shortcutItems.splice(i, 1);
|
||||
|
||||
// Save to the cookies
|
||||
this.cookieService.set('FUSE2.shortcuts', JSON.stringify(this.shortcutItems));
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
this.shortcutItems.push(itemToToggle);
|
||||
|
||||
// Save to the cookies
|
||||
this.cookieService.set('FUSE2.shortcuts', JSON.stringify(this.shortcutItems));
|
||||
}
|
||||
|
||||
isInShortcuts(navigationItem)
|
||||
@@ -132,7 +149,9 @@ export class FuseShortcutsComponent implements OnInit, OnDestroy
|
||||
|
||||
onMenuOpen()
|
||||
{
|
||||
this.searchInputField.nativeElement.focus();
|
||||
setTimeout(() => {
|
||||
this.searchInputField.nativeElement.focus();
|
||||
});
|
||||
}
|
||||
|
||||
showMobileShortcutsPanel()
|
||||
|
||||
@@ -1,95 +1,105 @@
|
||||
<button #openButton md-icon-button class="open-button md-primary-bg mat-elevation-z2" (click)="openBar()">
|
||||
<md-icon>settings</md-icon>
|
||||
<button #openButton mat-icon-button class="open-button mat-primary-bg mat-elevation-z2" (click)="openBar()">
|
||||
<mat-icon>settings</mat-icon>
|
||||
</button>
|
||||
|
||||
<div #panel class="theme-options-panel md-white-bg mat-elevation-z2 pb-16">
|
||||
<div class="theme-options-panel-overlay" #overlay [fxHide]="barClosed" [@fadeInOut]="!barClosed"></div>
|
||||
|
||||
<button md-icon-button class="close-button" (click)="closeBar()">
|
||||
<md-icon>close</md-icon>
|
||||
<div #panel class="theme-options-panel mat-white-bg mat-elevation-z8">
|
||||
|
||||
<button mat-icon-button class="close-button" (click)="closeBar()">
|
||||
<mat-icon>close</mat-icon>
|
||||
</button>
|
||||
|
||||
<md-list>
|
||||
<h3 md-subheader>Navigation:</h3>
|
||||
<md-list-item>
|
||||
<md-radio-group [(ngModel)]="fuseSettings.layout.navigation" (ngModelChange)="onSettingsChange()">
|
||||
<md-radio-button class="mr-8" value="left">Left</md-radio-button>
|
||||
<md-radio-button class="mr-8" value="right">Right</md-radio-button>
|
||||
<md-radio-button class="mr-8" value="none">None</md-radio-button>
|
||||
</md-radio-group>
|
||||
</md-list-item>
|
||||
<div class="theme-options-panel-inner" fxLayout="column" fxLayoutAlign="start start">
|
||||
|
||||
<h3 md-subheader>Toolbar:</h3>
|
||||
<md-list-item>
|
||||
<md-radio-group [(ngModel)]="fuseSettings.layout.toolbar" (ngModelChange)="onSettingsChange()">
|
||||
<md-radio-button class="mr-8" value="below">Below</md-radio-button>
|
||||
<md-radio-button class="mr-8" value="above">Above</md-radio-button>
|
||||
<md-radio-button class="mr-8" value="none">None</md-radio-button>
|
||||
</md-radio-group>
|
||||
</md-list-item>
|
||||
<h3>Navigation:</h3>
|
||||
<mat-radio-group [(ngModel)]="fuseSettings.layout.navigation" (ngModelChange)="onSettingsChange()"
|
||||
fxLayout="column" fxLayout.gt-xs="row" fxLayoutAlign="start start" fxLayoutWrap>
|
||||
<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 md-subheader>Footer:</h3>
|
||||
<md-list-item>
|
||||
<md-radio-group [(ngModel)]="fuseSettings.layout.footer" (ngModelChange)="onSettingsChange()">
|
||||
<md-radio-button class="mr-8" value="below">Below</md-radio-button>
|
||||
<md-radio-button class="mr-8" value="above">Above</md-radio-button>
|
||||
<md-radio-button class="mr-8" value="none">None</md-radio-button>
|
||||
</md-radio-group>
|
||||
</md-list-item>
|
||||
<h3>Navigation Fold (for vertical navigation):</h3>
|
||||
<mat-slide-toggle [(ngModel)]="fuseSettings.layout.navigationFolded"
|
||||
(change)="onSettingsChange()">
|
||||
Folded
|
||||
</mat-slide-toggle>
|
||||
|
||||
<md-divider></md-divider>
|
||||
<h3 class="mt-24">Toolbar:</h3>
|
||||
<mat-radio-group [(ngModel)]="fuseSettings.layout.toolbar" (ngModelChange)="onSettingsChange()"
|
||||
fxLayout="column" fxLayout.gt-xs="row" fxLayoutAlign="start start" fxLayoutWrap>
|
||||
<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 md-subheader>Colors:</h3>
|
||||
<h3 class="mt-24">Footer:</h3>
|
||||
<mat-radio-group [(ngModel)]="fuseSettings.layout.footer" (ngModelChange)="onSettingsChange()"
|
||||
fxLayout="column" fxLayout.gt-xs="row" fxLayoutAlign="start start" fxLayoutWrap>
|
||||
<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-group [(ngModel)]="fuseSettings.layout.mode" (ngModelChange)="onSettingsChange()"
|
||||
fxLayout="column" fxLayout.gt-xs="row" fxLayoutAlign="start start" fxLayoutWrap>
|
||||
<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>
|
||||
|
||||
<h3>Colors:</h3>
|
||||
<div class="colors">
|
||||
|
||||
<md-list-item>
|
||||
<div fxFlex fxLayout="row" fxLayoutAlign="space-between center">
|
||||
<h4>Toolbar Color</h4>
|
||||
<fuse-material-color-picker [(selectedClass)]="fuseSettings.colorClasses.toolbar" (onValueChange)="onSettingsChange()"></fuse-material-color-picker>
|
||||
<h4 class="mr-8">Toolbar Color</h4>
|
||||
<fuse-material-color-picker [(selectedClass)]="fuseSettings.colorClasses.toolbar"
|
||||
(onValueChange)="onSettingsChange()"></fuse-material-color-picker>
|
||||
</div>
|
||||
</md-list-item>
|
||||
|
||||
<md-list-item>
|
||||
<div fxFlex fxLayout="row" fxLayoutAlign="space-between center">
|
||||
<h4>Navigation Bar Color</h4>
|
||||
<fuse-material-color-picker [(selectedClass)]="fuseSettings.colorClasses.navbar" (onValueChange)="onSettingsChange()"></fuse-material-color-picker>
|
||||
<h4 class="mr-8">Navigation Bar Color</h4>
|
||||
<fuse-material-color-picker [(selectedClass)]="fuseSettings.colorClasses.navbar"
|
||||
(onValueChange)="onSettingsChange()"></fuse-material-color-picker>
|
||||
</div>
|
||||
</md-list-item>
|
||||
|
||||
<md-list-item>
|
||||
<div fxFlex fxLayout="row" fxLayoutAlign="space-between center">
|
||||
<h4>Footer Color</h4>
|
||||
<fuse-material-color-picker [(selectedClass)]="fuseSettings.colorClasses.footer" (onValueChange)="onSettingsChange()"></fuse-material-color-picker>
|
||||
<h4 class="mr-8">Footer Color</h4>
|
||||
<fuse-material-color-picker [(selectedClass)]="fuseSettings.colorClasses.footer"
|
||||
(onValueChange)="onSettingsChange()"></fuse-material-color-picker>
|
||||
</div>
|
||||
</md-list-item>
|
||||
|
||||
<md-divider></md-divider>
|
||||
</div>
|
||||
|
||||
<h3 md-subheader>Animation:</h3>
|
||||
<mat-divider></mat-divider>
|
||||
|
||||
<md-list-item>
|
||||
<div fxFlex fxLayout="row" fxLayoutAlign="space-between center">
|
||||
<h4>Router Animation</h4>
|
||||
<md-select [(ngModel)]="fuseSettings.routerAnimation">
|
||||
<md-option value="none">
|
||||
None
|
||||
</md-option>
|
||||
<md-option value="slideUp">
|
||||
Slide up
|
||||
</md-option>
|
||||
<md-option value="slideDown">
|
||||
Slide down
|
||||
</md-option>
|
||||
<md-option value="slideRight">
|
||||
Slide right
|
||||
</md-option>
|
||||
<md-option value="slideLeft">
|
||||
Slide left
|
||||
</md-option>
|
||||
<md-option value="fadeIn">
|
||||
Fade in
|
||||
</md-option>
|
||||
</md-select>
|
||||
</div>
|
||||
</md-list-item>
|
||||
<h3>Router Animation:</h3>
|
||||
<mat-form-field class="w-100-p">
|
||||
<mat-select class="p-0" [(ngModel)]="fuseSettings.routerAnimation">
|
||||
<mat-option value="none">
|
||||
None
|
||||
</mat-option>
|
||||
<mat-option value="slideUp">
|
||||
Slide up
|
||||
</mat-option>
|
||||
<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>
|
||||
|
||||
</md-list>
|
||||
</div>
|
||||
|
||||
@@ -14,19 +14,69 @@
|
||||
display: block;
|
||||
right: 0;
|
||||
top: 160px;
|
||||
z-index: 998;
|
||||
|
||||
&.bar-closed .theme-options-panel {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.theme-options-panel {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 0;
|
||||
width: 320px;
|
||||
width: 360px;
|
||||
transform: translate3d(100%, 0, 0);
|
||||
z-index: 999;
|
||||
max-height: calc(100vh - 200px);
|
||||
padding: 24px;
|
||||
overflow: auto;
|
||||
|
||||
@include media-breakpoint-down('xs') {
|
||||
top: -120px;
|
||||
max-height: calc(100vh - 100px);
|
||||
width: 90vw;
|
||||
}
|
||||
|
||||
.close-button {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
top: 8px;
|
||||
right: 8px;
|
||||
}
|
||||
|
||||
h3 {
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
color: rgba(0, 0, 0, 0.54);
|
||||
}
|
||||
|
||||
.mat-divider {
|
||||
display: block !important;
|
||||
width: 100%;
|
||||
margin: 24px 0 16px 0;
|
||||
}
|
||||
|
||||
.colors {
|
||||
display: block !important;
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,6 +84,10 @@
|
||||
font-size: 15px;
|
||||
}
|
||||
|
||||
.mat-divider {
|
||||
margin: 16px;
|
||||
}
|
||||
|
||||
.open-button {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
@@ -49,7 +103,7 @@
|
||||
opacity: .75;
|
||||
z-index: 998;
|
||||
|
||||
md-icon {
|
||||
mat-icon {
|
||||
animation: rotating 3s linear infinite;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,28 +1,38 @@
|
||||
import { Component, OnDestroy, OnInit, ViewChild } from '@angular/core';
|
||||
import { Component, ElementRef, HostBinding, OnDestroy, OnInit, Renderer2, ViewChild } from '@angular/core';
|
||||
import { style, animate, AnimationBuilder, AnimationPlayer } from '@angular/animations';
|
||||
import { Subscription } from 'rxjs/Subscription';
|
||||
import { FuseConfigService } from '../../services/config.service';
|
||||
import { fuseAnimations } from '../../animations';
|
||||
import { FuseNavigationService } from '../navigation/navigation.service';
|
||||
|
||||
@Component({
|
||||
selector : 'fuse-theme-options',
|
||||
templateUrl: './theme-options.component.html',
|
||||
styleUrls : ['./theme-options.component.scss']
|
||||
styleUrls : ['./theme-options.component.scss'],
|
||||
animations : fuseAnimations
|
||||
})
|
||||
export class FuseThemeOptionsComponent implements OnInit, OnDestroy
|
||||
{
|
||||
@ViewChild('openButton') openButton;
|
||||
@ViewChild('panel') panel;
|
||||
@ViewChild('overlay') overlay: ElementRef;
|
||||
|
||||
public player: AnimationPlayer;
|
||||
fuseSettings: any;
|
||||
|
||||
onSettingsChanged: Subscription;
|
||||
|
||||
@HostBinding('class.bar-closed') barClosed: boolean;
|
||||
|
||||
constructor(
|
||||
private animationBuilder: AnimationBuilder,
|
||||
private fuseConfig: FuseConfigService
|
||||
private fuseConfig: FuseConfigService,
|
||||
private navigationService: FuseNavigationService,
|
||||
private renderer: Renderer2
|
||||
)
|
||||
{
|
||||
this.barClosed = true;
|
||||
|
||||
this.onSettingsChanged =
|
||||
this.fuseConfig.onSettingsChanged
|
||||
.subscribe(
|
||||
@@ -30,10 +40,34 @@ export class FuseThemeOptionsComponent implements OnInit, OnDestroy
|
||||
this.fuseSettings = newSettings;
|
||||
}
|
||||
);
|
||||
|
||||
// Get the nav model and add customize nav item
|
||||
// that opens the bar programmatically
|
||||
const navModel = this.navigationService.getNavigationModel();
|
||||
|
||||
navModel.push({
|
||||
'id' : 'custom-function',
|
||||
'title' : 'Custom Function',
|
||||
'type' : 'group',
|
||||
'children': [
|
||||
{
|
||||
'id' : 'customize',
|
||||
'title' : 'Customize',
|
||||
'type' : 'item',
|
||||
'icon' : 'settings',
|
||||
'function': () => {
|
||||
this.openBar();
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
ngOnInit()
|
||||
{
|
||||
this.renderer.listen(this.overlay.nativeElement, 'click', () => {
|
||||
this.closeBar();
|
||||
});
|
||||
}
|
||||
|
||||
onSettingsChange()
|
||||
@@ -49,17 +83,25 @@ export class FuseThemeOptionsComponent implements OnInit, OnDestroy
|
||||
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();
|
||||
}
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ export class FuseIfOnDomDirective implements AfterContentChecked
|
||||
{
|
||||
setTimeout(() => {
|
||||
this.viewContainer.createEmbeddedView(this.templateRef);
|
||||
}, 0);
|
||||
}, 300);
|
||||
this.isCreated = true;
|
||||
}
|
||||
else if ( this.isCreated && !document.body.contains(this.element.nativeElement) )
|
||||
|
||||
@@ -0,0 +1,99 @@
|
||||
import { Directive, Input, OnInit, HostListener, OnDestroy, HostBinding } from '@angular/core';
|
||||
import { MatSidenav } from '@angular/material';
|
||||
import { ObservableMedia } from '@angular/flex-layout';
|
||||
import { Subscription } from 'rxjs/Subscription';
|
||||
import { FuseMatchMedia } from '../../services/match-media.service';
|
||||
import { FuseMatSidenavHelperService } from './fuse-mat-sidenav-helper.service';
|
||||
|
||||
@Directive({
|
||||
selector: '[fuseMatSidenavHelper]'
|
||||
})
|
||||
export class FuseMatSidenavHelperDirective implements OnInit, OnDestroy
|
||||
{
|
||||
matchMediaSubscription: Subscription;
|
||||
|
||||
@HostBinding('class.mat-is-locked-open') isLockedOpen = true;
|
||||
@HostBinding('class.mat-stop-transition') stopTransition = true;
|
||||
|
||||
@Input('fuseMatSidenavHelper') id: string;
|
||||
@Input('mat-is-locked-open') matIsLockedOpenBreakpoint: string;
|
||||
|
||||
constructor(
|
||||
private fuseMatSidenavService: FuseMatSidenavHelperService,
|
||||
private fuseMatchMedia: FuseMatchMedia,
|
||||
private observableMedia: ObservableMedia,
|
||||
private matSidenav: MatSidenav
|
||||
)
|
||||
{
|
||||
}
|
||||
|
||||
ngOnInit()
|
||||
{
|
||||
this.fuseMatSidenavService.setSidenav(this.id, this.matSidenav);
|
||||
|
||||
if ( this.observableMedia.isActive(this.matIsLockedOpenBreakpoint) )
|
||||
{
|
||||
setTimeout(() => {
|
||||
this.isLockedOpen = true;
|
||||
this.matSidenav.mode = 'side';
|
||||
this.matSidenav.open();
|
||||
});
|
||||
this.stopTransition = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
setTimeout(() => {
|
||||
this.isLockedOpen = false;
|
||||
this.matSidenav.mode = 'over';
|
||||
this.matSidenav.close();
|
||||
});
|
||||
|
||||
setTimeout(() => {
|
||||
this.stopTransition = false;
|
||||
}, 3000);
|
||||
}
|
||||
|
||||
this.matchMediaSubscription = this.fuseMatchMedia.onMediaChange.subscribe(() => {
|
||||
if ( this.observableMedia.isActive(this.matIsLockedOpenBreakpoint) )
|
||||
{
|
||||
setTimeout(() => {
|
||||
this.isLockedOpen = true;
|
||||
this.matSidenav.mode = 'side';
|
||||
this.matSidenav.open();
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
setTimeout(() => {
|
||||
this.isLockedOpen = false;
|
||||
this.matSidenav.mode = 'over';
|
||||
this.matSidenav.close();
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
ngOnDestroy()
|
||||
{
|
||||
this.matchMediaSubscription.unsubscribe();
|
||||
}
|
||||
}
|
||||
|
||||
@Directive({
|
||||
selector: '[fuseMatSidenavToggler]'
|
||||
})
|
||||
export class FuseMatSidenavTogglerDirective
|
||||
{
|
||||
@Input('fuseMatSidenavToggler') id;
|
||||
|
||||
constructor(private fuseMatSidenavService: FuseMatSidenavHelperService)
|
||||
{
|
||||
}
|
||||
|
||||
@HostListener('click')
|
||||
onClick()
|
||||
{
|
||||
this.fuseMatSidenavService.getSidenav(this.id).toggle();
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,10 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { MdSidenav } from '@angular/material';
|
||||
import { MatSidenav } from '@angular/material';
|
||||
|
||||
@Injectable()
|
||||
export class FuseMdSidenavHelperService
|
||||
export class FuseMatSidenavHelperService
|
||||
{
|
||||
sidenavInstances: MdSidenav[];
|
||||
sidenavInstances: MatSidenav[];
|
||||
|
||||
constructor()
|
||||
{
|
||||
@@ -0,0 +1,169 @@
|
||||
import { AfterViewInit, Directive, ElementRef, OnDestroy, OnInit } from '@angular/core';
|
||||
import PerfectScrollbar from 'perfect-scrollbar';
|
||||
import { FuseConfigService } from '../../services/config.service';
|
||||
import { Subscription } from 'rxjs/Subscription';
|
||||
import { Platform } from '@angular/cdk/platform';
|
||||
|
||||
@Directive({
|
||||
selector: '[fusePerfectScrollbar]'
|
||||
})
|
||||
export class FusePerfectScrollbarDirective implements OnInit, AfterViewInit, OnDestroy
|
||||
{
|
||||
onSettingsChanged: Subscription;
|
||||
isDisableCustomScrollbars = false;
|
||||
isMobile = false;
|
||||
isInitialized = true;
|
||||
ps;
|
||||
|
||||
constructor(
|
||||
private element: ElementRef,
|
||||
private fuseConfig: FuseConfigService,
|
||||
private platform: Platform
|
||||
)
|
||||
{
|
||||
this.onSettingsChanged =
|
||||
this.fuseConfig.onSettingsChanged
|
||||
.subscribe(
|
||||
(settings) => {
|
||||
this.isDisableCustomScrollbars = !settings.customScrollbars;
|
||||
}
|
||||
);
|
||||
|
||||
if ( this.platform.ANDROID || this.platform.IOS )
|
||||
{
|
||||
this.isMobile = true;
|
||||
}
|
||||
}
|
||||
|
||||
ngOnInit()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
ngAfterViewInit()
|
||||
{
|
||||
if ( this.isMobile || this.isDisableCustomScrollbars )
|
||||
{
|
||||
this.isInitialized = false;
|
||||
return;
|
||||
}
|
||||
|
||||
// Initialize the perfect-scrollbar
|
||||
this.ps = new PerfectScrollbar(this.element.nativeElement);
|
||||
}
|
||||
|
||||
ngOnDestroy()
|
||||
{
|
||||
if ( !this.isInitialized )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
this.onSettingsChanged.unsubscribe();
|
||||
|
||||
// Destroy the perfect-scrollbar
|
||||
this.ps.destroy();
|
||||
}
|
||||
|
||||
update()
|
||||
{
|
||||
if ( !this.isInitialized )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// Update the perfect-scrollbar
|
||||
this.ps.update();
|
||||
}
|
||||
|
||||
destroy()
|
||||
{
|
||||
this.ngOnDestroy();
|
||||
}
|
||||
|
||||
scrollToX(x: number, speed?: number)
|
||||
{
|
||||
this.animateScrolling('scrollLeft', x, speed);
|
||||
}
|
||||
|
||||
scrollToY(y: number, speed?: number)
|
||||
{
|
||||
this.animateScrolling('scrollTop', y, speed);
|
||||
}
|
||||
|
||||
scrollToTop(offset?: number, speed?: number)
|
||||
{
|
||||
this.animateScrolling('scrollTop', (offset || 0), speed);
|
||||
}
|
||||
|
||||
scrollToLeft(offset?: number, speed?: number)
|
||||
{
|
||||
this.animateScrolling('scrollLeft', (offset || 0), speed);
|
||||
}
|
||||
|
||||
scrollToRight(offset?: number, speed?: number)
|
||||
{
|
||||
const width = this.element.nativeElement.scrollWidth;
|
||||
|
||||
this.animateScrolling('scrollLeft', width - (offset || 0), speed);
|
||||
}
|
||||
|
||||
scrollToBottom(offset?: number, speed?: number)
|
||||
{
|
||||
const height = this.element.nativeElement.scrollHeight;
|
||||
|
||||
this.animateScrolling('scrollTop', height - (offset || 0), speed);
|
||||
}
|
||||
|
||||
animateScrolling(target: string, value: number, speed?: number)
|
||||
{
|
||||
if ( !speed )
|
||||
{
|
||||
this.element.nativeElement[target] = value;
|
||||
|
||||
// PS has weird event sending order, this is a workaround for that
|
||||
this.update();
|
||||
this.update();
|
||||
}
|
||||
else if ( value !== this.element.nativeElement[target] )
|
||||
{
|
||||
let newValue = 0;
|
||||
let scrollCount = 0;
|
||||
|
||||
let oldTimestamp = performance.now();
|
||||
let oldValue = this.element.nativeElement[target];
|
||||
|
||||
const cosParameter = (oldValue - value) / 2;
|
||||
|
||||
const step = (newTimestamp) => {
|
||||
scrollCount += Math.PI / (speed / (newTimestamp - oldTimestamp));
|
||||
|
||||
newValue = Math.round(value + cosParameter + cosParameter * Math.cos(scrollCount));
|
||||
|
||||
// Only continue animation if scroll position has not changed
|
||||
if ( this.element.nativeElement[target] === oldValue )
|
||||
{
|
||||
if ( scrollCount >= Math.PI )
|
||||
{
|
||||
this.element.nativeElement[target] = value;
|
||||
|
||||
// PS has weird event sending order, this is a workaround for that
|
||||
this.update();
|
||||
|
||||
this.update();
|
||||
}
|
||||
else
|
||||
{
|
||||
this.element.nativeElement[target] = oldValue = newValue;
|
||||
|
||||
oldTimestamp = newTimestamp;
|
||||
|
||||
window.requestAnimationFrame(step);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
window.requestAnimationFrame(step);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,93 +0,0 @@
|
||||
import { Directive, Input, OnInit, HostListener, OnDestroy, HostBinding, AfterViewInit } from '@angular/core';
|
||||
import { MdSidenav } from '@angular/material';
|
||||
import { FuseMdSidenavHelperService } from 'app/core/directives/md-sidenav-helper/md-sidenav-helper.service';
|
||||
import { FuseMatchMedia } from '../../services/match-media.service';
|
||||
import { ObservableMedia } from '@angular/flex-layout';
|
||||
import { Subscription } from 'rxjs/Subscription';
|
||||
|
||||
@Directive({
|
||||
selector: '[fuseMdSidenavHelper]'
|
||||
})
|
||||
export class FuseMdSidenavHelperDirective implements OnInit, AfterViewInit, OnDestroy
|
||||
{
|
||||
matchMediaSubscription: Subscription;
|
||||
|
||||
@HostBinding('class.md-is-locked-open') isLockedOpen = true;
|
||||
@HostBinding('class.md-stop-transition') stopTransition = true;
|
||||
|
||||
@Input('fuseMdSidenavHelper') id: string;
|
||||
@Input('md-is-locked-open') mdIsLockedOpenBreakpoint: string;
|
||||
|
||||
constructor(
|
||||
private fuseMdSidenavService: FuseMdSidenavHelperService,
|
||||
private fuseMatchMedia: FuseMatchMedia,
|
||||
private observableMedia: ObservableMedia,
|
||||
private mdSidenav: MdSidenav
|
||||
)
|
||||
{
|
||||
}
|
||||
|
||||
ngOnInit()
|
||||
{
|
||||
this.fuseMdSidenavService.setSidenav(this.id, this.mdSidenav);
|
||||
|
||||
if ( this.observableMedia.isActive(this.mdIsLockedOpenBreakpoint) )
|
||||
{
|
||||
this.isLockedOpen = true;
|
||||
this.mdSidenav.mode = 'side';
|
||||
this.mdSidenav.open();
|
||||
}
|
||||
else
|
||||
{
|
||||
this.isLockedOpen = false;
|
||||
this.mdSidenav.mode = 'over';
|
||||
this.mdSidenav.close();
|
||||
}
|
||||
|
||||
this.matchMediaSubscription = this.fuseMatchMedia.onMediaChange.subscribe(() => {
|
||||
if ( this.observableMedia.isActive(this.mdIsLockedOpenBreakpoint) )
|
||||
{
|
||||
this.isLockedOpen = true;
|
||||
this.mdSidenav.mode = 'side';
|
||||
this.mdSidenav.open();
|
||||
}
|
||||
else
|
||||
{
|
||||
this.isLockedOpen = false;
|
||||
this.mdSidenav.mode = 'over';
|
||||
this.mdSidenav.close();
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
ngAfterViewInit()
|
||||
{
|
||||
setTimeout(() => {
|
||||
this.stopTransition = false;
|
||||
}, 0);
|
||||
}
|
||||
|
||||
ngOnDestroy()
|
||||
{
|
||||
this.matchMediaSubscription.unsubscribe();
|
||||
}
|
||||
}
|
||||
|
||||
@Directive({
|
||||
selector: '[fuseMdSidenavToggler]'
|
||||
})
|
||||
export class FuseMdSidenavTogglerDirective
|
||||
{
|
||||
@Input('fuseMdSidenavToggler') id;
|
||||
|
||||
constructor(private fuseMdSidenavService: FuseMdSidenavHelperService)
|
||||
{
|
||||
}
|
||||
|
||||
@HostListener('click')
|
||||
onClick()
|
||||
{
|
||||
this.fuseMdSidenavService.getSidenav(this.id).toggle();
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
export class FuseUtils
|
||||
{
|
||||
|
||||
public static filterArrayByString(mainArr, searchText)
|
||||
{
|
||||
if ( searchText === '' )
|
||||
@@ -17,7 +16,6 @@ export class FuseUtils
|
||||
|
||||
public static searchInObj(itemObj, searchText)
|
||||
{
|
||||
|
||||
for ( const prop in itemObj )
|
||||
{
|
||||
if ( !itemObj.hasOwnProperty(prop) )
|
||||
@@ -29,7 +27,7 @@ export class FuseUtils
|
||||
|
||||
if ( typeof value === 'string' )
|
||||
{
|
||||
if ( this.searchInSting(value, searchText) )
|
||||
if ( this.searchInString(value, searchText) )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -41,7 +39,6 @@ export class FuseUtils
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if ( typeof value === 'object' )
|
||||
@@ -60,7 +57,7 @@ export class FuseUtils
|
||||
{
|
||||
if ( typeof value === 'string' )
|
||||
{
|
||||
if ( this.searchInSting(value, searchText) )
|
||||
if ( this.searchInString(value, searchText) )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -76,7 +73,7 @@ export class FuseUtils
|
||||
}
|
||||
}
|
||||
|
||||
public static searchInSting(value, searchText)
|
||||
public static searchInString(value, searchText)
|
||||
{
|
||||
return value.toLowerCase().includes(searchText);
|
||||
}
|
||||
@@ -85,9 +82,33 @@ export class FuseUtils
|
||||
{
|
||||
function S4()
|
||||
{
|
||||
return (((1 + Math.random()) * 0x10000) || 0).toString(16).substring(1);
|
||||
return Math.floor((1 + Math.random()) * 0x10000)
|
||||
.toString(16)
|
||||
.substring(1);
|
||||
}
|
||||
|
||||
return (S4() + S4());
|
||||
return S4() + S4();
|
||||
}
|
||||
|
||||
public static toggleInArray(item, array)
|
||||
{
|
||||
if ( array.indexOf(item) === -1 )
|
||||
{
|
||||
array.push(item);
|
||||
}
|
||||
else
|
||||
{
|
||||
array.splice(array.indexOf(item), 1);
|
||||
}
|
||||
}
|
||||
|
||||
public static handleize(text)
|
||||
{
|
||||
return text.toString().toLowerCase()
|
||||
.replace(/\s+/g, '-') // Replace spaces with -
|
||||
.replace(/[^\w\-]+/g, '') // Remove all non-word chars
|
||||
.replace(/\-\-+/g, '-') // Replace multiple - with single -
|
||||
.replace(/^-+/, '') // Trim - from start of text
|
||||
.replace(/-+$/, ''); // Trim - from end of text
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,106 +1,108 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import {
|
||||
MdAutocompleteModule,
|
||||
MdButtonModule,
|
||||
MdButtonToggleModule,
|
||||
MdCheckboxModule,
|
||||
MdToolbarModule,
|
||||
MdTooltipModule,
|
||||
MdCardModule,
|
||||
MdChipsModule,
|
||||
MdCoreModule,
|
||||
MdDatepickerModule,
|
||||
MdDialogModule,
|
||||
MdExpansionModule,
|
||||
MdGridListModule,
|
||||
MdIconModule,
|
||||
MdInputModule,
|
||||
MdListModule,
|
||||
MdMenuModule,
|
||||
MdNativeDateModule,
|
||||
MdPaginatorModule,
|
||||
MdProgressBarModule,
|
||||
MdProgressSpinnerModule,
|
||||
MdRadioModule,
|
||||
MdRippleModule,
|
||||
MdSelectModule,
|
||||
MdSidenavModule,
|
||||
MdSliderModule,
|
||||
MdSlideToggleModule,
|
||||
MdSnackBarModule,
|
||||
MdSortModule,
|
||||
MdTableModule,
|
||||
MdTabsModule
|
||||
MatAutocompleteModule,
|
||||
MatButtonModule,
|
||||
MatButtonToggleModule,
|
||||
MatCheckboxModule,
|
||||
MatToolbarModule,
|
||||
MatTooltipModule,
|
||||
MatCardModule,
|
||||
MatChipsModule,
|
||||
MatDatepickerModule,
|
||||
MatDialogModule,
|
||||
MatExpansionModule,
|
||||
MatFormFieldModule,
|
||||
MatGridListModule,
|
||||
MatIconModule,
|
||||
MatInputModule,
|
||||
MatListModule,
|
||||
MatMenuModule,
|
||||
MatNativeDateModule,
|
||||
MatPaginatorModule,
|
||||
MatProgressBarModule,
|
||||
MatProgressSpinnerModule,
|
||||
MatRadioModule,
|
||||
MatRippleModule,
|
||||
MatSelectModule,
|
||||
MatSidenavModule,
|
||||
MatSliderModule,
|
||||
MatSlideToggleModule,
|
||||
MatSnackBarModule,
|
||||
MatSortModule,
|
||||
MatTableModule,
|
||||
MatTabsModule,
|
||||
MatStepperModule
|
||||
} from '@angular/material';
|
||||
import { CdkTableModule } from '@angular/cdk';
|
||||
import { CdkTableModule } from '@angular/cdk/table';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
MdAutocompleteModule,
|
||||
MdButtonModule,
|
||||
MdButtonToggleModule,
|
||||
MdCardModule,
|
||||
MdCheckboxModule,
|
||||
MdChipsModule,
|
||||
MdCoreModule,
|
||||
MdDatepickerModule,
|
||||
MdDialogModule,
|
||||
MdExpansionModule,
|
||||
MdGridListModule,
|
||||
MdIconModule,
|
||||
MdInputModule,
|
||||
MdListModule,
|
||||
MdMenuModule,
|
||||
MdNativeDateModule,
|
||||
MdPaginatorModule,
|
||||
MdProgressBarModule,
|
||||
MdProgressSpinnerModule,
|
||||
MdRadioModule,
|
||||
MdRippleModule,
|
||||
MdSelectModule,
|
||||
MdSidenavModule,
|
||||
MdSliderModule,
|
||||
MdSlideToggleModule,
|
||||
MdSnackBarModule,
|
||||
MdSortModule,
|
||||
MdTableModule,
|
||||
MdTabsModule,
|
||||
MdToolbarModule,
|
||||
MdTooltipModule,
|
||||
MatAutocompleteModule,
|
||||
MatButtonModule,
|
||||
MatButtonToggleModule,
|
||||
MatCardModule,
|
||||
MatCheckboxModule,
|
||||
MatChipsModule,
|
||||
MatDatepickerModule,
|
||||
MatDialogModule,
|
||||
MatExpansionModule,
|
||||
MatFormFieldModule,
|
||||
MatGridListModule,
|
||||
MatIconModule,
|
||||
MatInputModule,
|
||||
MatListModule,
|
||||
MatMenuModule,
|
||||
MatNativeDateModule,
|
||||
MatPaginatorModule,
|
||||
MatProgressBarModule,
|
||||
MatProgressSpinnerModule,
|
||||
MatRadioModule,
|
||||
MatRippleModule,
|
||||
MatSelectModule,
|
||||
MatSidenavModule,
|
||||
MatSliderModule,
|
||||
MatSlideToggleModule,
|
||||
MatSnackBarModule,
|
||||
MatStepperModule,
|
||||
MatSortModule,
|
||||
MatTableModule,
|
||||
MatTabsModule,
|
||||
MatToolbarModule,
|
||||
MatTooltipModule,
|
||||
CdkTableModule
|
||||
],
|
||||
exports: [
|
||||
MdAutocompleteModule,
|
||||
MdButtonModule,
|
||||
MdButtonToggleModule,
|
||||
MdCardModule,
|
||||
MdCheckboxModule,
|
||||
MdChipsModule,
|
||||
MdCoreModule,
|
||||
MdDatepickerModule,
|
||||
MdDialogModule,
|
||||
MdExpansionModule,
|
||||
MdGridListModule,
|
||||
MdIconModule,
|
||||
MdInputModule,
|
||||
MdListModule,
|
||||
MdMenuModule,
|
||||
MdNativeDateModule,
|
||||
MdPaginatorModule,
|
||||
MdProgressBarModule,
|
||||
MdProgressSpinnerModule,
|
||||
MdRadioModule,
|
||||
MdRippleModule,
|
||||
MdSelectModule,
|
||||
MdSidenavModule,
|
||||
MdSliderModule,
|
||||
MdSlideToggleModule,
|
||||
MdSnackBarModule,
|
||||
MdSortModule,
|
||||
MdTableModule,
|
||||
MdTabsModule,
|
||||
MdToolbarModule,
|
||||
MdTooltipModule,
|
||||
MatAutocompleteModule,
|
||||
MatButtonModule,
|
||||
MatButtonToggleModule,
|
||||
MatCardModule,
|
||||
MatCheckboxModule,
|
||||
MatChipsModule,
|
||||
MatDatepickerModule,
|
||||
MatDialogModule,
|
||||
MatExpansionModule,
|
||||
MatGridListModule,
|
||||
MatIconModule,
|
||||
MatInputModule,
|
||||
MatListModule,
|
||||
MatMenuModule,
|
||||
MatNativeDateModule,
|
||||
MatPaginatorModule,
|
||||
MatProgressBarModule,
|
||||
MatProgressSpinnerModule,
|
||||
MatRadioModule,
|
||||
MatRippleModule,
|
||||
MatSelectModule,
|
||||
MatSidenavModule,
|
||||
MatSliderModule,
|
||||
MatSlideToggleModule,
|
||||
MatSnackBarModule,
|
||||
MatStepperModule,
|
||||
MatSortModule,
|
||||
MatTableModule,
|
||||
MatTabsModule,
|
||||
MatToolbarModule,
|
||||
MatTooltipModule,
|
||||
CdkTableModule
|
||||
]
|
||||
})
|
||||
|
||||
@@ -4,31 +4,34 @@ import { CommonModule } from '@angular/common';
|
||||
|
||||
import { MaterialModule } from './material.module';
|
||||
import { FlexLayoutModule } from '@angular/flex-layout';
|
||||
import { PerfectScrollbarModule } from 'ngx-perfect-scrollbar';
|
||||
import { ColorPickerModule } from 'ngx-color-picker';
|
||||
import { NgxDnDModule } from '@swimlane/ngx-dnd';
|
||||
import { NgxDnDModule } from '@withinpixels/ngx-dnd';
|
||||
import { NgxDatatableModule } from '@swimlane/ngx-datatable';
|
||||
|
||||
import { FuseMdSidenavHelperDirective, FuseMdSidenavTogglerDirective } from '../directives/md-sidenav-helper/md-sidenav-helper.directive';
|
||||
import { FuseMatSidenavHelperDirective, FuseMatSidenavTogglerDirective } from '../directives/fuse-mat-sidenav-helper/fuse-mat-sidenav-helper.directive';
|
||||
import { FuseMatSidenavHelperService } from '../directives/fuse-mat-sidenav-helper/fuse-mat-sidenav-helper.service';
|
||||
import { FusePipesModule } from '../pipes/pipes.module';
|
||||
import { FuseConfirmDialogComponent } from '../components/confirm-dialog/confirm-dialog.component';
|
||||
import { FuseCountdownComponent } from '../components/countdown/countdown.component';
|
||||
import { FuseNavigationService } from '../components/navigation/navigation.service';
|
||||
import { FuseMatchMedia } from '../services/match-media.service';
|
||||
import { FuseNavbarService } from '../../main/navbar/navbar.service';
|
||||
import { FuseMdSidenavHelperService } from '../directives/md-sidenav-helper/md-sidenav-helper.service';
|
||||
import { FuseNavbarVerticalService } from '../../main/navbar/vertical/navbar-vertical.service';
|
||||
import { FuseHljsComponent } from '../components/hljs/hljs.component';
|
||||
import { FusePerfectScrollbarDirective } from '../directives/fuse-perfect-scrollbar/fuse-perfect-scrollbar.directive';
|
||||
import { FuseIfOnDomDirective } from '../directives/fuse-if-on-dom/fuse-if-on-dom.directive';
|
||||
import { FuseMaterialColorPickerComponent } from '../components/material-color-picker/material-color-picker.component';
|
||||
import { FuseTranslationLoaderService } from '../services/translation-loader.service';
|
||||
import { CookieService } from 'ngx-cookie-service';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
|
||||
@NgModule({
|
||||
declarations : [
|
||||
FuseMdSidenavHelperDirective,
|
||||
FuseMdSidenavTogglerDirective,
|
||||
FuseMatSidenavHelperDirective,
|
||||
FuseMatSidenavTogglerDirective,
|
||||
FuseConfirmDialogComponent,
|
||||
FuseCountdownComponent,
|
||||
FuseHljsComponent,
|
||||
FuseIfOnDomDirective,
|
||||
FusePerfectScrollbarDirective,
|
||||
FuseMaterialColorPickerComponent
|
||||
],
|
||||
imports : [
|
||||
@@ -37,7 +40,6 @@ import { FuseMaterialColorPickerComponent } from '../components/material-color-p
|
||||
CommonModule,
|
||||
FormsModule,
|
||||
FusePipesModule,
|
||||
PerfectScrollbarModule,
|
||||
ReactiveFormsModule,
|
||||
ColorPickerModule,
|
||||
NgxDnDModule,
|
||||
@@ -48,27 +50,29 @@ import { FuseMaterialColorPickerComponent } from '../components/material-color-p
|
||||
MaterialModule,
|
||||
CommonModule,
|
||||
FormsModule,
|
||||
FuseMdSidenavHelperDirective,
|
||||
FuseMdSidenavTogglerDirective,
|
||||
FuseMatSidenavHelperDirective,
|
||||
FuseMatSidenavTogglerDirective,
|
||||
FusePipesModule,
|
||||
FuseCountdownComponent,
|
||||
FuseHljsComponent,
|
||||
PerfectScrollbarModule,
|
||||
FusePerfectScrollbarDirective,
|
||||
ReactiveFormsModule,
|
||||
ColorPickerModule,
|
||||
NgxDnDModule,
|
||||
NgxDatatableModule,
|
||||
FuseIfOnDomDirective,
|
||||
FuseMaterialColorPickerComponent
|
||||
FuseMaterialColorPickerComponent,
|
||||
TranslateModule
|
||||
],
|
||||
entryComponents: [
|
||||
FuseConfirmDialogComponent
|
||||
],
|
||||
providers : [
|
||||
FuseNavigationService,
|
||||
CookieService,
|
||||
FuseMatchMedia,
|
||||
FuseNavbarService,
|
||||
FuseMdSidenavHelperService
|
||||
FuseNavbarVerticalService,
|
||||
FuseMatSidenavHelperService,
|
||||
FuseTranslationLoaderService
|
||||
]
|
||||
})
|
||||
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
import { Pipe, PipeTransform } from '@angular/core';
|
||||
|
||||
@Pipe({name: 'getById'})
|
||||
@Pipe({
|
||||
name: 'getById',
|
||||
pure: false
|
||||
})
|
||||
export class GetByIdPipe implements PipeTransform
|
||||
{
|
||||
transform(value: any[], id: number, property: string): any
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
@import '~@swimlane/ngx-datatable/release/index.css';
|
||||
@import '~@swimlane/ngx-datatable/release/themes/material.css';
|
||||
@import '~@swimlane/ngx-datatable/release/assets/icons.css';
|
||||
// Perfect Scrollbar
|
||||
@import "~perfect-scrollbar/src/css/main";
|
||||
// Perfect scrollbar
|
||||
@import '~perfect-scrollbar/css/perfect-scrollbar.css';
|
||||
// Fuse
|
||||
@import "fuse";
|
||||
|
||||
@@ -25,9 +25,11 @@
|
||||
@import "partials/angular-material-fix";
|
||||
@import "partials/typography";
|
||||
@import "partials/page-layouts";
|
||||
@import "partials/cards";
|
||||
@import "partials/navigation";
|
||||
@import "partials/forms";
|
||||
@import "partials/toolbar";
|
||||
@import "partials/print";
|
||||
|
||||
// Plugins
|
||||
@import "partials/plugins/plugins";
|
||||
|
||||
@@ -1,6 +1,66 @@
|
||||
// Fix: "Icon button ripple radius is not correct on Edge & Safari"
|
||||
.mat-icon-button {
|
||||
|
||||
.mat-button-ripple {
|
||||
border-radius: 50%;
|
||||
}
|
||||
}
|
||||
|
||||
// Fix: "Sidenav opening with animations for the first time"
|
||||
mat-sidenav-container {
|
||||
|
||||
mat-sidenav {
|
||||
|
||||
&[mat-is-locked-open].mat-stop-transition {
|
||||
transition: none !important;
|
||||
transform: translate3d(0, 0, 0) !important;
|
||||
opacity: 0;
|
||||
|
||||
~ .mat-sidenav-content,
|
||||
~ .mat-drawer-content {
|
||||
transition: none !important;
|
||||
}
|
||||
}
|
||||
|
||||
&.mat-sidenav-opened {
|
||||
|
||||
&.mat-drawer-side {
|
||||
|
||||
~ .mat-sidenav-content,
|
||||
~ .mat-drawer-content {
|
||||
transition: none !important;
|
||||
transform: translate3d(0, 0, 0) !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&.mat-drawer-end {
|
||||
}
|
||||
}
|
||||
|
||||
.mat-drawer-content {
|
||||
}
|
||||
}
|
||||
|
||||
// Fix: "Inconsistent font sizes across elements"
|
||||
.mat-input-wrapper {
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.mat-checkbox {
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.mat-radio-button {
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.mat-pseudo-checkbox-checked:after {
|
||||
width: 14px;
|
||||
height: 7px;
|
||||
}
|
||||
|
||||
// Fix: "Input underlines has wrong color opacity value"
|
||||
.mat-form-field-underline {
|
||||
background-color: rgba(0, 0, 0, 0.12);
|
||||
}
|
||||
|
||||
154
src/app/core/scss/partials/_cards.scss
Normal file
154
src/app/core/scss/partials/_cards.scss
Normal file
@@ -0,0 +1,154 @@
|
||||
.fuse-card {
|
||||
max-width: 320px;
|
||||
min-width: 320px;
|
||||
background: white;
|
||||
border-radius: 2px;
|
||||
@include mat-elevation(2);
|
||||
|
||||
&.variable-width {
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.card-rich-media {
|
||||
position: relative;
|
||||
|
||||
.card-title {
|
||||
position: absolute;
|
||||
right: 16px;
|
||||
bottom: 16px;
|
||||
left: 16px;
|
||||
font-size: 20px;
|
||||
color: white;
|
||||
}
|
||||
}
|
||||
|
||||
.card-media-header {
|
||||
display: flex;
|
||||
padding: 16px;
|
||||
align-items: center;
|
||||
|
||||
&.medium {
|
||||
align-items: flex-start;
|
||||
|
||||
.card-rich-media {
|
||||
width: 120px;
|
||||
height: 120px;
|
||||
}
|
||||
}
|
||||
|
||||
&.large {
|
||||
align-items: flex-start;
|
||||
|
||||
.card-rich-media {
|
||||
width: 160px;
|
||||
height: 160px;
|
||||
}
|
||||
}
|
||||
|
||||
.card-primary-title {
|
||||
padding: 0 16px 0 0;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.card-rich-media {
|
||||
width: 80px;
|
||||
height: 80px;
|
||||
}
|
||||
|
||||
+ div {
|
||||
padding-top: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.card-avatar-header {
|
||||
display: flex;
|
||||
padding: 16px;
|
||||
align-items: center;
|
||||
|
||||
.card-avatar {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
border-radius: 100%;
|
||||
margin-right: 16px;
|
||||
}
|
||||
|
||||
.card-avatar-title {
|
||||
|
||||
.card-title {
|
||||
font-size: 14px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.card-subtitle {
|
||||
font-size: 13px;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.card-primary-title {
|
||||
padding: 16px;
|
||||
|
||||
.card-title {
|
||||
font-size: 24px;
|
||||
}
|
||||
|
||||
.card-subtitle {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
+ div {
|
||||
padding-top: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.card-supporting-text {
|
||||
padding: 16px;
|
||||
font-size: 14px;
|
||||
line-height: 1.75;
|
||||
|
||||
+ div {
|
||||
padding-top: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.card-actions {
|
||||
display: flex;
|
||||
padding: 8px;
|
||||
|
||||
&.icon-buttons {
|
||||
padding: 0 8px;
|
||||
}
|
||||
|
||||
&.align-center {
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
&.align-right {
|
||||
justify-content: flex-end;
|
||||
}
|
||||
|
||||
.mat-button {
|
||||
min-width: 0 !important;
|
||||
padding: 0 8px !important;
|
||||
}
|
||||
|
||||
.card-expander {
|
||||
margin-left: auto;
|
||||
}
|
||||
|
||||
+ div {
|
||||
padding-top: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.card-expand-area {
|
||||
overflow: hidden;
|
||||
|
||||
.card-expanded-supporting-text {
|
||||
padding: 8px 16px 16px 16px;
|
||||
font-size: 14px;
|
||||
line-height: 1.75;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -51,13 +51,16 @@ $matColorHues: 50, 100, 200, 300, 400, 500, 600, 700, 800, 900, A100, A200, A400
|
||||
// If the base text color is black...
|
||||
@if (rgba(black, 1) == rgba($baseTextColor, 1)) {
|
||||
|
||||
&.secondary-text,
|
||||
.secondary-text,
|
||||
.mat-icon,
|
||||
.icon {
|
||||
color: rgba(0, 0, 0, 0.54);
|
||||
}
|
||||
|
||||
&.secondary-text,
|
||||
.secondary-text {
|
||||
color: rgba(0, 0, 0, 0.54) !important;
|
||||
}
|
||||
|
||||
&.hint-text,
|
||||
.hint-text,
|
||||
&.disabled-text,
|
||||
@@ -109,49 +112,60 @@ $matColorHues: 50, 100, 200, 300, 400, 500, 600, 700, 800, 900, A100, A200, A400
|
||||
@mixin generateMaterialElementColors($contrastColor) {
|
||||
|
||||
// If the contrast color is white...
|
||||
$foreground: $mat-dark-theme-foreground;
|
||||
$fuseForeground: (
|
||||
base: white,
|
||||
text: white,
|
||||
hint-text: rgba(white, 0.5),
|
||||
divider: rgba(white, 0.12),
|
||||
);
|
||||
|
||||
// If the contrast color is black...
|
||||
@if (rgba(black, 1) == rgba($contrastColor, 1)) {
|
||||
$foreground: $mat-light-theme-foreground;
|
||||
|
||||
$fuseForeground: (
|
||||
base: black,
|
||||
hint-text: rgba(black, 0.38),
|
||||
divider: rgba(black, 0.12),
|
||||
);
|
||||
}
|
||||
|
||||
// Native Input
|
||||
input[type="text"] {
|
||||
color: mat-color($foreground, base);
|
||||
color: map_get($fuseForeground, base);
|
||||
}
|
||||
|
||||
// Input
|
||||
.mat-input-placeholder {
|
||||
color: mat-color($foreground, hint-text);
|
||||
color: map_get($fuseForeground, hint-text);
|
||||
}
|
||||
|
||||
.mat-input-underline {
|
||||
background-color: mat-color($foreground, divider);
|
||||
background-color: map_get($fuseForeground, divider);
|
||||
}
|
||||
|
||||
// Select
|
||||
.mat-select-trigger,
|
||||
.mat-select-arrow {
|
||||
color: mat-color($foreground, hint-text);
|
||||
color: map_get($fuseForeground, hint-text);
|
||||
}
|
||||
|
||||
.mat-select-underline {
|
||||
background-color: mat-color($foreground, divider);
|
||||
background-color: map_get($fuseForeground, divider);
|
||||
}
|
||||
|
||||
.mat-select-disabled .mat-select-value,
|
||||
.mat-select-arrow,
|
||||
.mat-select-trigger {
|
||||
color: mat-color($foreground, hint-text);
|
||||
color: map_get($fuseForeground, hint-text);
|
||||
}
|
||||
|
||||
.mat-select-content, .mat-select-panel-done-animating {
|
||||
background: mat-color($background, card);
|
||||
.mat-select-content,
|
||||
.mat-select-panel-done-animating {
|
||||
background: map_get($background, card);
|
||||
}
|
||||
|
||||
.mat-select-value {
|
||||
color: mat-color($foreground, text);
|
||||
color: map_get($fuseForeground, text);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -162,7 +176,7 @@ $matColorHues: 50, 100, 200, 300, 400, 500, 600, 700, 800, 900, A100, A200, A400
|
||||
background-color: $color !important;
|
||||
}
|
||||
|
||||
.md-#{$colorName}#{$hue}-bg {
|
||||
.mat-#{$colorName}#{$hue}-bg {
|
||||
background-color: $color !important;
|
||||
color: $contrastColor !important;
|
||||
|
||||
@@ -173,6 +187,11 @@ $matColorHues: 50, 100, 200, 300, 400, 500, 600, 700, 800, 900, A100, A200, A400
|
||||
// Generate material element colors
|
||||
// based on current contrast color
|
||||
@include generateMaterialElementColors($contrastColor);
|
||||
|
||||
&[disabled] {
|
||||
background-color: rgba($color, .12) !important;
|
||||
color: rgba($contrastColor, .26) !important;
|
||||
}
|
||||
}
|
||||
|
||||
.#{$colorName}#{$hue}-fg {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
body {
|
||||
|
||||
> md-sidenav-container {
|
||||
> mat-sidenav-container {
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
i,
|
||||
md-icon {
|
||||
mat-icon {
|
||||
color: rgba(0, 0, 0, 0.54);
|
||||
font-size: 24px;
|
||||
width: 24px;
|
||||
|
||||
@@ -46,14 +46,14 @@
|
||||
margin-top: 0;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
md-icon.status {
|
||||
mat-icon.status {
|
||||
position: absolute;
|
||||
top: 28px;
|
||||
left: 28px;
|
||||
}
|
||||
}
|
||||
|
||||
md-icon.status {
|
||||
mat-icon.status {
|
||||
border-radius: 50%;
|
||||
|
||||
&.online {
|
||||
@@ -116,7 +116,7 @@ md-icon.status {
|
||||
max-height: 48px;
|
||||
height: 48px;
|
||||
|
||||
md-icon {
|
||||
mat-icon {
|
||||
margin: 0 16px 0 0;
|
||||
}
|
||||
|
||||
@@ -142,7 +142,7 @@ md-icon.status {
|
||||
}
|
||||
}
|
||||
|
||||
md-divider {
|
||||
mat-divider {
|
||||
margin: 8px 0;
|
||||
}
|
||||
}
|
||||
@@ -196,7 +196,7 @@ md-icon.status {
|
||||
background-color: #FFFFFF;
|
||||
width: 280px;
|
||||
border-radius: 2px;
|
||||
margin: 24px 24px 0 0;
|
||||
margin: 12px;
|
||||
overflow: hidden;
|
||||
|
||||
&.style-1 {
|
||||
@@ -234,7 +234,7 @@ md-icon.status {
|
||||
}
|
||||
}
|
||||
|
||||
md-divider {
|
||||
mat-divider {
|
||||
margin: 16px 32px;
|
||||
}
|
||||
|
||||
|
||||
@@ -11,6 +11,22 @@
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.nav-group {
|
||||
display: block;
|
||||
|
||||
> .group-title {
|
||||
position: relative;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
height: 48px;
|
||||
font-weight: 500;
|
||||
padding-left: 24px;
|
||||
margin-top: 8px;
|
||||
font-size: 12px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
}
|
||||
|
||||
.nav-item {
|
||||
|
||||
.nav-link {
|
||||
@@ -88,7 +104,9 @@
|
||||
|
||||
> .nav-item {
|
||||
|
||||
> .nav-link {
|
||||
> .nav-link,
|
||||
&.nav-group > .group-title,
|
||||
&.nav-group > .group-items > .nav-item > .nav-link {
|
||||
padding-left: 56px;
|
||||
}
|
||||
|
||||
@@ -96,7 +114,9 @@
|
||||
|
||||
> .nav-item {
|
||||
|
||||
> .nav-link {
|
||||
> .nav-link,
|
||||
&.nav-group > .group-title,
|
||||
&.nav-group > .group-items > .nav-item > .nav-link {
|
||||
padding-left: 72px;
|
||||
}
|
||||
}
|
||||
@@ -118,4 +138,83 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
> .nav-group {
|
||||
|
||||
> .group-items {
|
||||
|
||||
> .nav-collapse {
|
||||
background: transparent;
|
||||
transition: background 200ms ease-in-out;
|
||||
|
||||
&.open {
|
||||
background: rgba(0, 0, 0, 0.12);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&.vertical {
|
||||
|
||||
.nav-group {
|
||||
|
||||
.group-title {
|
||||
text-transform: uppercase;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&.horizontal {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
|
||||
.nav-item {
|
||||
|
||||
&.nav-collapse {
|
||||
position: relative;
|
||||
|
||||
.children {
|
||||
display: none;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 100%;
|
||||
z-index: 999;
|
||||
min-width: 200px;
|
||||
box-shadow: 0 5px 5px -3px rgba(0, 0, 0, .2), 0 8px 10px 1px rgba(0, 0, 0, .14), 0 3px 14px 2px rgba(0, 0, 0, .12);
|
||||
|
||||
&.open {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.nav-link {
|
||||
padding-left: 24px !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
> .nav-item {
|
||||
|
||||
> .nav-link {
|
||||
height: 56px;
|
||||
}
|
||||
|
||||
&.nav-collapse {
|
||||
position: relative;
|
||||
|
||||
> .nav-link {
|
||||
height: 56px;
|
||||
|
||||
.collapse-arrow {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
> .children {
|
||||
top: 100%;
|
||||
left: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -96,7 +96,7 @@ $top-bg-image: url('assets/images/backgrounds/header-bg.png');
|
||||
max-height: $carded-toolbar-height;
|
||||
}
|
||||
|
||||
.content {
|
||||
> .content {
|
||||
display: flex;
|
||||
flex: 1;
|
||||
overflow: auto;
|
||||
@@ -112,12 +112,12 @@ $top-bg-image: url('assets/images/backgrounds/header-bg.png');
|
||||
// Single scroll
|
||||
&.single-scroll {
|
||||
|
||||
> md-sidenav-container {
|
||||
> mat-sidenav-container {
|
||||
flex: 1 0 auto;
|
||||
}
|
||||
}
|
||||
|
||||
> md-sidenav-container {
|
||||
> mat-sidenav-container {
|
||||
display: flex;
|
||||
flex: 1;
|
||||
background: none;
|
||||
@@ -132,27 +132,25 @@ $top-bg-image: url('assets/images/backgrounds/header-bg.png');
|
||||
min-width: 240px;
|
||||
max-width: 240px;
|
||||
height: auto;
|
||||
z-index: 2;
|
||||
z-index: 4;
|
||||
overflow-y: hidden;
|
||||
@include mat-elevation(7);
|
||||
|
||||
&.md-is-locked-open {
|
||||
position: relative;
|
||||
&.mat-is-locked-open {
|
||||
background: none;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
&.md-stop-transition {
|
||||
|
||||
~ .mat-sidenav-content {
|
||||
transition: 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 {
|
||||
@@ -161,7 +159,8 @@ $top-bg-image: url('assets/images/backgrounds/header-bg.png');
|
||||
}
|
||||
}
|
||||
|
||||
> .mat-sidenav-content {
|
||||
> .mat-sidenav-content,
|
||||
> .mat-drawer-content {
|
||||
display: flex;
|
||||
flex: 1;
|
||||
height: auto;
|
||||
@@ -182,6 +181,12 @@ $top-bg-image: url('assets/images/backgrounds/header-bg.png');
|
||||
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 {
|
||||
@@ -217,20 +222,76 @@ $top-bg-image: url('assets/images/backgrounds/header-bg.png');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Tabbed
|
||||
&.tabbed {
|
||||
|
||||
> mat-sidenav-container {
|
||||
|
||||
> .mat-sidenav-content,
|
||||
> .mat-drawer-content {
|
||||
width: calc(100% - 240px);
|
||||
|
||||
.center {
|
||||
width: calc(100% - 32px);
|
||||
|
||||
@include media-breakpoint-down('md') {
|
||||
width: calc(100% - 64px);
|
||||
}
|
||||
|
||||
.header {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.content-card {
|
||||
|
||||
.content {
|
||||
|
||||
.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%;
|
||||
overflow: auto;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Left sidenav
|
||||
&.left-sidenav {
|
||||
|
||||
// Sidenav
|
||||
> md-sidenav-container {
|
||||
> mat-sidenav-container {
|
||||
|
||||
.sidenav {
|
||||
|
||||
&.md-is-locked-open {
|
||||
&.mat-is-locked-open {
|
||||
|
||||
~ .mat-sidenav-content {
|
||||
margin-left: 0 !important;
|
||||
~ .mat-sidenav-content,
|
||||
~ .mat-drawer-content {
|
||||
|
||||
.center {
|
||||
margin-left: 0;
|
||||
@@ -245,15 +306,15 @@ $top-bg-image: url('assets/images/backgrounds/header-bg.png');
|
||||
&.right-sidenav {
|
||||
|
||||
// Sidenav
|
||||
> md-sidenav-container {
|
||||
> mat-sidenav-container {
|
||||
|
||||
.sidenav {
|
||||
order: 999;
|
||||
|
||||
&.md-is-locked-open {
|
||||
&.mat-is-locked-open {
|
||||
|
||||
~ .mat-sidenav-content {
|
||||
margin-right: 0 !important;
|
||||
~ .mat-sidenav-content,
|
||||
~ .mat-drawer-content {
|
||||
|
||||
.center {
|
||||
margin-right: 0;
|
||||
@@ -280,6 +341,10 @@ $top-bg-image: url('assets/images/backgrounds/header-bg.png');
|
||||
}
|
||||
|
||||
// Fullwidth
|
||||
&.fullwidth {
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
&.fullwidth,
|
||||
&.inner-sidenav {
|
||||
min-height: 100%;
|
||||
@@ -298,16 +363,13 @@ $top-bg-image: url('assets/images/backgrounds/header-bg.png');
|
||||
// Single scroll
|
||||
&.single-scroll {
|
||||
|
||||
> md-sidenav-container {
|
||||
> mat-sidenav-container {
|
||||
flex: 1 0 auto;
|
||||
|
||||
> .mat-sidenav-content {
|
||||
> .mat-sidenav-content,
|
||||
> .mat-drawer-content {
|
||||
flex: 1 0 auto;
|
||||
max-height: none;
|
||||
|
||||
> .center {
|
||||
overflow: hidden;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -315,7 +377,7 @@ $top-bg-image: url('assets/images/backgrounds/header-bg.png');
|
||||
// Inner Sidenav
|
||||
&.inner-sidenav {
|
||||
|
||||
> md-sidenav-container {
|
||||
> mat-sidenav-container {
|
||||
flex: 1;
|
||||
|
||||
.sidenav {
|
||||
@@ -325,7 +387,8 @@ $top-bg-image: url('assets/images/backgrounds/header-bg.png');
|
||||
}
|
||||
}
|
||||
|
||||
> .mat-sidenav-content {
|
||||
> .mat-sidenav-content,
|
||||
> .mat-drawer-content {
|
||||
display: flex;
|
||||
height: auto;
|
||||
|
||||
@@ -343,7 +406,7 @@ $top-bg-image: url('assets/images/backgrounds/header-bg.png');
|
||||
}
|
||||
}
|
||||
|
||||
> md-sidenav-container {
|
||||
> mat-sidenav-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
flex: 1;
|
||||
@@ -358,7 +421,7 @@ $top-bg-image: url('assets/images/backgrounds/header-bg.png');
|
||||
z-index: 51;
|
||||
@include mat-elevation(7);
|
||||
|
||||
&.md-is-locked-open {
|
||||
&.mat-is-locked-open {
|
||||
width: 220px;
|
||||
min-width: 220px;
|
||||
max-width: 220px;
|
||||
@@ -366,19 +429,13 @@ $top-bg-image: url('assets/images/backgrounds/header-bg.png');
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
&.md-stop-transition {
|
||||
|
||||
~ .mat-sidenav-content {
|
||||
transition: none;
|
||||
}
|
||||
}
|
||||
|
||||
.sidenav-content {
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
> .mat-sidenav-content {
|
||||
> .mat-sidenav-content,
|
||||
> .mat-drawer-content {
|
||||
display: flex;
|
||||
flex: 1;
|
||||
height: auto;
|
||||
@@ -450,7 +507,7 @@ $top-bg-image: url('assets/images/backgrounds/header-bg.png');
|
||||
&.left-sidenav,
|
||||
&.right-sidenav {
|
||||
|
||||
> md-sidenav-container {
|
||||
> mat-sidenav-container {
|
||||
flex: 1 0 auto;
|
||||
}
|
||||
}
|
||||
@@ -459,7 +516,6 @@ $top-bg-image: url('assets/images/backgrounds/header-bg.png');
|
||||
&.simple {
|
||||
|
||||
&.fullwidth {
|
||||
overflow: visible;
|
||||
|
||||
> .content {
|
||||
flex: 1 0 auto;
|
||||
@@ -469,15 +525,12 @@ $top-bg-image: url('assets/images/backgrounds/header-bg.png');
|
||||
&.left-sidenav,
|
||||
&.right-sidenav {
|
||||
|
||||
> md-sidenav-container {
|
||||
> mat-sidenav-container {
|
||||
flex: 1 0 auto !important;
|
||||
|
||||
> .mat-sidenav-content {
|
||||
> .mat-sidenav-content,
|
||||
> .mat-drawer-content {
|
||||
flex: 1 0 auto;
|
||||
|
||||
> .center {
|
||||
overflow: hidden;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -497,9 +550,10 @@ $top-bg-image: url('assets/images/backgrounds/header-bg.png');
|
||||
&.left-sidenav,
|
||||
&.right-sidenav {
|
||||
|
||||
> md-sidenav-container {
|
||||
> mat-sidenav-container {
|
||||
|
||||
> .mat-sidenav-content {
|
||||
> .mat-sidenav-content,
|
||||
> .mat-drawer-content {
|
||||
|
||||
.center {
|
||||
margin: 0 16px;
|
||||
|
||||
65
src/app/core/scss/partials/_print.scss
Normal file
65
src/app/core/scss/partials/_print.scss
Normal file
@@ -0,0 +1,65 @@
|
||||
/*----------------------------------------------------------------*/
|
||||
/* Print
|
||||
/*----------------------------------------------------------------*/
|
||||
|
||||
@media all {
|
||||
|
||||
/* Never show page breaks in normal view */
|
||||
.page-break-after,
|
||||
.page-break-before {
|
||||
display: none;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@media print {
|
||||
|
||||
/* html and body tweaks */
|
||||
html, body {
|
||||
height: auto !important;
|
||||
overflow: initial !important;
|
||||
}
|
||||
|
||||
/* Page breaks */
|
||||
.page-break-after {
|
||||
display: block;
|
||||
page-break-after: always;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.page-break-before {
|
||||
display: block;
|
||||
page-break-before: always;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
/* General styles */
|
||||
fuse-root {
|
||||
|
||||
fuse-navbar-vertical,
|
||||
fuse-navbar-horizontal,
|
||||
fuse-toolbar,
|
||||
fuse-footer,
|
||||
fuse-quick-panel,
|
||||
fuse-theme-options,
|
||||
.ps > .ps__scrollbar-x-rail,
|
||||
.ps > .ps__scrollbar-y-rail {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.ps {
|
||||
overflow: visible !important;
|
||||
}
|
||||
|
||||
.mat-drawer-container,
|
||||
.mat-sidenav-container {
|
||||
background-color: white !important;
|
||||
|
||||
.mat-drawer-content,
|
||||
.mat-sidenav-content {
|
||||
overflow: initial !important;
|
||||
height: auto !important
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -28,7 +28,7 @@ html, body {
|
||||
}
|
||||
|
||||
// Reset non angular-material input's default browser/os styles
|
||||
*:not(md-input-container) {
|
||||
*:not(mat-input-container) {
|
||||
|
||||
> input {
|
||||
border: none;
|
||||
@@ -55,7 +55,7 @@ html, body {
|
||||
}
|
||||
}
|
||||
|
||||
*:not(md-input-container) {
|
||||
*:not(mat-input-container) {
|
||||
|
||||
> input[type="button"],
|
||||
> button,
|
||||
|
||||
@@ -1,20 +1,23 @@
|
||||
::-webkit-scrollbar {
|
||||
width: 12px;
|
||||
height: 12px;
|
||||
background-color: rgba(0, 0, 0, 0);
|
||||
}
|
||||
body:not(.is-mobile) {
|
||||
|
||||
::-webkit-scrollbar:hover {
|
||||
background-color: rgba(0, 0, 0, 0.12);
|
||||
}
|
||||
::-webkit-scrollbar {
|
||||
width: 12px;
|
||||
height: 12px;
|
||||
background-color: rgba(0, 0, 0, 0);
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-thumb {
|
||||
border: 2px solid transparent;
|
||||
box-shadow: inset 0 0 0 24px rgba(0, 0, 0, 0.37);
|
||||
border-radius: 24px;
|
||||
}
|
||||
::-webkit-scrollbar:hover {
|
||||
background-color: rgba(0, 0, 0, 0.12);
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-thumb:active {
|
||||
box-shadow: inset 0 0 0 24px rgba(0, 0, 0, 0.54);
|
||||
border-radius: 24px;
|
||||
::-webkit-scrollbar-thumb {
|
||||
border: 2px solid transparent;
|
||||
box-shadow: inset 0 0 0 24px rgba(0, 0, 0, 0.37);
|
||||
border-radius: 24px;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-thumb:active {
|
||||
box-shadow: inset 0 0 0 24px rgba(0, 0, 0, 0.54);
|
||||
border-radius: 24px;
|
||||
}
|
||||
}
|
||||
360
src/app/core/scss/partials/plugins/_ng-pick-datetime.scss
Normal file
360
src/app/core/scss/partials/plugins/_ng-pick-datetime.scss
Normal file
@@ -0,0 +1,360 @@
|
||||
/*@font-face {
|
||||
font-family: 'fontello';
|
||||
src: url('../font/fontello.eot?81091010');
|
||||
src: url('../font/fontello.eot?81091010#iefix') format('embedded-opentype'),
|
||||
url('../font/fontello.woff2?81091010') format('woff2'),
|
||||
url('../font/fontello.woff?81091010') format('woff'),
|
||||
url('../font/fontello.ttf?81091010') format('truetype'),
|
||||
url('../font/fontello.svg?81091010#fontello') format('svg');
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
}*/
|
||||
|
||||
owl-date-time {
|
||||
|
||||
[class^="icon-"]:before, [class*=" icon-"]:before {
|
||||
font-family: "Material Icons";
|
||||
font-style: normal;
|
||||
font-weight: normal;
|
||||
speak: none;
|
||||
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
/* For safety - reset parent styles, that can break glyph codes*/
|
||||
font-variant: normal;
|
||||
text-transform: none;
|
||||
|
||||
/* Font smoothing. That was taken from TWBS */
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
|
||||
.icon-cancel:before {
|
||||
content: 'close';
|
||||
}
|
||||
|
||||
.icon-up-open:before {
|
||||
content: 'keyboard_arrow_up';
|
||||
}
|
||||
|
||||
.icon-down-open:before {
|
||||
content: 'keyboard_arrow_down';
|
||||
}
|
||||
|
||||
.icon-left-open:before {
|
||||
content: 'chevron_left';
|
||||
}
|
||||
|
||||
.icon-right-open:before {
|
||||
content: 'chevron_right';
|
||||
}
|
||||
|
||||
$white: #FFFFFF;
|
||||
$black: #000000;
|
||||
$grey: #DDDDDD;
|
||||
$blue: #0070BA;
|
||||
|
||||
.owl-widget,
|
||||
.owl-widget * {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.owl-widget {
|
||||
font-size: 1em;
|
||||
}
|
||||
|
||||
.owl-state-focus {
|
||||
|
||||
}
|
||||
|
||||
.owl-corner-all {
|
||||
border-radius: 2px;
|
||||
}
|
||||
|
||||
.owl-corner-top {
|
||||
border-top-left-radius: 2px;
|
||||
border-top-right-radius: 2px;
|
||||
}
|
||||
|
||||
.owl-state-default {
|
||||
background: #FFFFFF;
|
||||
color: rgba(0, 0, 0, 0.87);
|
||||
}
|
||||
|
||||
.owl-dateTime-inputWrapper {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
|
||||
.owl-dateTime-input {
|
||||
background: none !important;
|
||||
padding: 0 !important;
|
||||
cursor: pointer;
|
||||
|
||||
.owl-inputtext {
|
||||
margin: 0;
|
||||
padding: 8px;
|
||||
background: none !important;
|
||||
color: rgba(0, 0, 0, 0.87);
|
||||
}
|
||||
}
|
||||
|
||||
.owl-dateTime-cancel {
|
||||
position: relative !important;
|
||||
right: 0 !important;
|
||||
top: 0 !important;
|
||||
transform: none !important;
|
||||
font-size: 16px !important;
|
||||
width: 16px !important;
|
||||
height: 16px !important;
|
||||
min-width: 16px !important;
|
||||
min-height: 16px !important;
|
||||
line-height: 16px !important;
|
||||
color: rgba(0, 0, 0, 0.54) !important;
|
||||
}
|
||||
}
|
||||
|
||||
.owl-dateTime {
|
||||
position: relative;
|
||||
width: 140px;
|
||||
|
||||
&.owl-dateTime-inline {
|
||||
width: auto;
|
||||
|
||||
.owl-dateTime-dialog {
|
||||
position: relative;
|
||||
z-index: auto;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.owl-dateTime-dialog {
|
||||
width: 256px;
|
||||
user-select: none;
|
||||
z-index: 99999;
|
||||
top: 24px !important;
|
||||
right: 0 !important;
|
||||
left: auto !important;
|
||||
@include mat-elevation(4);
|
||||
}
|
||||
|
||||
.owl-dateTime-dialogHeader {
|
||||
height: 2.5em;
|
||||
padding: .25em;
|
||||
background-color: rgba(0, 0, 0, .1);
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.owl-calendar-wrapper {
|
||||
padding: 16px !important;
|
||||
}
|
||||
|
||||
.owl-calendar-control {
|
||||
|
||||
.owl-calendar-controlNav {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
.nav-prev,
|
||||
.nav-next {
|
||||
display: flex;
|
||||
|
||||
&:before {
|
||||
font-family: "Material Icons";
|
||||
position: relative !important;
|
||||
right: 0 !important;
|
||||
top: 0 !important;
|
||||
transform: none !important;
|
||||
font-size: 20px !important;
|
||||
width: 20px !important;
|
||||
height: 20px !important;
|
||||
min-width: 20px !important;
|
||||
min-height: 20px !important;
|
||||
line-height: 20px !important;
|
||||
content: "chevron_left";
|
||||
color: rgba(0, 0, 0, 0.54);
|
||||
}
|
||||
}
|
||||
|
||||
.nav-next:before {
|
||||
content: "chevron_right";
|
||||
}
|
||||
}
|
||||
|
||||
.owl-calendar-controlContent {
|
||||
|
||||
.month-control,
|
||||
.year-control {
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.month-control {
|
||||
margin-right: 8px;
|
||||
}
|
||||
|
||||
.year-control {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.owl-calendar {
|
||||
|
||||
table {
|
||||
border-spacing: 0 !important;
|
||||
}
|
||||
|
||||
tbody td {
|
||||
|
||||
&.owl-calendar-selected {
|
||||
background-color: $blue;
|
||||
color: $white;
|
||||
}
|
||||
|
||||
&.owl-calendar-invalid {
|
||||
color: #ACACAC;
|
||||
}
|
||||
|
||||
&.owl-calendar-outFocus {
|
||||
color: $grey;
|
||||
}
|
||||
|
||||
&.owl-calendar-hidden {
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
&:not(.owl-calendar-selected):not(.owl-calendar-invalid):hover {
|
||||
background-color: lighten($blue, 50%);
|
||||
color: $black;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.owl-years,
|
||||
.owl-months {
|
||||
|
||||
td.owl-year,
|
||||
td.owl-month {
|
||||
padding: 0;
|
||||
font-size: 16px;
|
||||
width: 72px;
|
||||
height: 48px;
|
||||
line-height: 48px;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
|
||||
.owl-calendar-yearArrow {
|
||||
width: 24px !important;
|
||||
height: 24px !important;
|
||||
|
||||
&.left {
|
||||
left: -16px !important;
|
||||
}
|
||||
|
||||
&.right {
|
||||
right: -16px !important;
|
||||
}
|
||||
}
|
||||
|
||||
.owl-weekdays {
|
||||
|
||||
th.owl-weekday {
|
||||
height: 32px;
|
||||
line-height: 32px;
|
||||
text-align: center;
|
||||
font-size: 12px;
|
||||
padding: 0;
|
||||
color: rgba(0, 0, 0, 0.37);
|
||||
}
|
||||
}
|
||||
|
||||
.owl-days {
|
||||
|
||||
td.owl-day {
|
||||
height: 32px;
|
||||
width: 32px;
|
||||
line-height: 32px;
|
||||
cursor: pointer;
|
||||
border-radius: 100%;
|
||||
padding: 0;
|
||||
|
||||
&.owl-day-today:before {
|
||||
content: '';
|
||||
display: block;
|
||||
position: absolute;
|
||||
right: 2px;
|
||||
top: 2px;
|
||||
border-top: .5em solid lighten($blue, 20%);
|
||||
border-left: .5em solid transparent;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.owl-timer-wrapper {
|
||||
height: 88px;
|
||||
padding: 8px !important;
|
||||
background-color: rgba(0, 0, 0, 0.06);
|
||||
|
||||
.owl-timer-input {
|
||||
background: none;
|
||||
width: 100% !important;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.owl-timer-text {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
height: 40%;
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
.owl-meridian-btn {
|
||||
font-size: .8em;
|
||||
color: $blue;
|
||||
background-image: none;
|
||||
background-color: transparent;
|
||||
border-color: $blue;
|
||||
|
||||
&:hover {
|
||||
color: $white;
|
||||
background-color: $blue;
|
||||
border-color: $blue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.owl-timer-divider {
|
||||
display: inline-block;
|
||||
position: absolute;
|
||||
width: 8px;
|
||||
height: 100%;
|
||||
left: -2px;
|
||||
|
||||
.owl-timer-dot {
|
||||
display: block;
|
||||
background: rgba(0, 0, 0, 0.37);
|
||||
width: 3px;
|
||||
height: 3px;
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
border-radius: 100%;
|
||||
transform: translateX(-50%);
|
||||
|
||||
&.dot-top {
|
||||
top: 40%;
|
||||
}
|
||||
|
||||
&.dot-bottom {
|
||||
bottom: 40%;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -55,6 +55,7 @@
|
||||
min-height: 48px;
|
||||
transition: none;
|
||||
padding: 0 24px;
|
||||
overflow: hidden;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -82,6 +83,16 @@
|
||||
|
||||
.datatable-pager {
|
||||
margin: 0 0 0 24px;
|
||||
|
||||
.pager {
|
||||
|
||||
li {
|
||||
|
||||
a {
|
||||
text-decoration: none !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
.ps {
|
||||
position: relative;
|
||||
|
||||
> .ps__scrollbar-y-rail {
|
||||
> .ps__rail-x {
|
||||
z-index: 99999;
|
||||
}
|
||||
|
||||
> .ps__scrollbar-y-rail {
|
||||
> .ps__rail-y {
|
||||
z-index: 99999;
|
||||
left: auto !important;
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { BehaviorSubject } from 'rxjs/BehaviorSubject';
|
||||
import { NavigationStart, Router } from '@angular/router';
|
||||
import { Platform } from '@angular/cdk';
|
||||
import { Platform } from '@angular/cdk/platform';
|
||||
|
||||
@Injectable()
|
||||
export class FuseConfigService
|
||||
@@ -12,6 +12,7 @@ export class FuseConfigService
|
||||
|
||||
/**
|
||||
* @param router
|
||||
* @param platform
|
||||
*/
|
||||
constructor(
|
||||
private router: Router,
|
||||
@@ -21,17 +22,19 @@ export class FuseConfigService
|
||||
// Set the default settings
|
||||
this.defaultSettings = {
|
||||
layout : {
|
||||
navigation: 'left', // 'right', 'left', 'top', none
|
||||
toolbar : 'below', // 'above', 'below', none
|
||||
footer : 'none' // 'above', 'below', none
|
||||
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: 'md-white-500-bg',
|
||||
navbar : 'md-fuse-dark-500-bg',
|
||||
footer : 'md-fuse-dark-800-bg'
|
||||
toolbar: 'mat-white-500-bg',
|
||||
navbar : 'mat-fuse-dark-700-bg',
|
||||
footer : 'mat-fuse-dark-900-bg'
|
||||
},
|
||||
customScrollbars: true,
|
||||
routerAnimation : 'fadeIn'
|
||||
routerAnimation : 'fadeIn' // fadeIn, slideUp, slideDown, slideRight, slideLeft
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -42,6 +45,7 @@ export class FuseConfigService
|
||||
this.defaultSettings.customScrollbars = false;
|
||||
}
|
||||
|
||||
// Set the settings from the default settings
|
||||
this.settings = Object.assign({}, this.defaultSettings);
|
||||
|
||||
// Reload the default settings on every navigation start
|
||||
@@ -56,7 +60,6 @@ export class FuseConfigService
|
||||
|
||||
// Create the behavior subject
|
||||
this.onSettingsChanged = new BehaviorSubject(this.settings);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -65,7 +68,10 @@ export class FuseConfigService
|
||||
*/
|
||||
setSettings(settings)
|
||||
{
|
||||
// Set the settings from the given object
|
||||
this.settings = Object.assign({}, this.settings, settings);
|
||||
|
||||
// Trigger the event
|
||||
this.onSettingsChanged.next(this.settings);
|
||||
}
|
||||
}
|
||||
|
||||
27
src/app/core/services/translation-loader.service.ts
Normal file
27
src/app/core/services/translation-loader.service.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
|
||||
export interface Locale
|
||||
{
|
||||
lang: string;
|
||||
data: Object;
|
||||
}
|
||||
|
||||
@Injectable()
|
||||
export class FuseTranslationLoaderService
|
||||
{
|
||||
constructor(private translate: TranslateService)
|
||||
{
|
||||
}
|
||||
|
||||
public loadTranslations(...args: Locale[]): void
|
||||
{
|
||||
const locales = [...args];
|
||||
|
||||
locales.forEach((locale) => {
|
||||
// use setTranslation() with the third argument set to true
|
||||
// to append translations instead of replacing them
|
||||
this.translate.setTranslation(locale.lang, locale.data, true);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -1,20 +1,16 @@
|
||||
import { Component, HostBinding, OnInit, OnDestroy } from '@angular/core';
|
||||
import { ActivatedRoute, NavigationEnd, Router } from '@angular/router';
|
||||
import { Animations } from '../../core/animations';
|
||||
import { fuseAnimations } from '../../core/animations';
|
||||
import { FuseConfigService } from '../../core/services/config.service';
|
||||
import { Subscription } from 'rxjs/Subscription';
|
||||
import 'rxjs/add/operator/filter';
|
||||
import 'rxjs/add/operator/map';
|
||||
|
||||
@Component({
|
||||
selector : 'fuse-content',
|
||||
templateUrl: './content.component.html',
|
||||
styleUrls : ['./content.component.scss'],
|
||||
animations : [
|
||||
Animations.routerTransitionUp,
|
||||
Animations.routerTransitionDown,
|
||||
Animations.routerTransitionRight,
|
||||
Animations.routerTransitionLeft,
|
||||
Animations.routerTransitionFade
|
||||
]
|
||||
animations : fuseAnimations
|
||||
})
|
||||
export class FuseContentComponent implements OnInit, OnDestroy
|
||||
{
|
||||
|
||||
8
src/app/main/content/sample/i18n/en.ts
Normal file
8
src/app/main/content/sample/i18n/en.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
export const locale = {
|
||||
lang: 'en',
|
||||
data: {
|
||||
'SAMPLE': {
|
||||
'HELLO': 'Hello, World!'
|
||||
}
|
||||
}
|
||||
};
|
||||
8
src/app/main/content/sample/i18n/tr.ts
Normal file
8
src/app/main/content/sample/i18n/tr.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
export const locale = {
|
||||
lang: 'tr',
|
||||
data: {
|
||||
'SAMPLE': {
|
||||
'HELLO': 'Merhaba Dünya!'
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -1,5 +1,5 @@
|
||||
<div class="page-layout blank p-24" perfect-scrollbar>
|
||||
<div class="page-layout blank p-24" fusePerfectScrollbar>
|
||||
|
||||
<h2>Sample Page</h2>
|
||||
<h2>{{'SAMPLE.HELLO' | translate}}</h2>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { FuseTranslationLoaderService } from '../../../core/services/translation-loader.service';
|
||||
|
||||
import { locale as english } from './i18n/en';
|
||||
import { locale as turkish } from './i18n/tr';
|
||||
|
||||
@Component({
|
||||
selector : 'fuse-sample',
|
||||
@@ -7,7 +11,8 @@ import { Component } from '@angular/core';
|
||||
})
|
||||
export class FuseSampleComponent
|
||||
{
|
||||
constructor()
|
||||
constructor(private translationLoader: FuseTranslationLoaderService)
|
||||
{
|
||||
this.translationLoader.loadTranslations(english, turkish);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,20 @@
|
||||
<md-toolbar class="mat-elevation-z1">
|
||||
<span>Footer</span>
|
||||
</md-toolbar>
|
||||
<mat-toolbar>
|
||||
|
||||
<div fxLayout="row" fxLayoutAlign="center center" fxLayoutAlign.gt-xs="space-between center" fxFlex>
|
||||
|
||||
<a href="http://themeforest.net/item/fuse-angularjs-material-design-admin-template/12931855?ref=srcn"
|
||||
target="_blank" mat-button class="mat-pink-bg" fxFlex="0 0 auto" fxLayout="row"
|
||||
fxLayoutAlign="start center">
|
||||
<mat-icon class="s-16 mr-sm-4">shopping_cart</mat-icon>
|
||||
<span>Purchase FUSE (Angular5+)</span>
|
||||
</a>
|
||||
|
||||
<div fxLayout="row" fxLayoutAlign="start center" fxHide fxShow.gt-xs>
|
||||
<a mat-button href="http://fusetheme.com/angular/docs" target="_blank">Documentation</a>
|
||||
<span>•</span>
|
||||
<a mat-button href="http://fusetheme.com/angular/changelog" target="_blank">Changelog</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</mat-toolbar>
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
.mat-toolbar {
|
||||
background: inherit;
|
||||
color: inherit;
|
||||
box-shadow: 0px -1px 1px -1px rgba(0, 0, 0, 0.2), 0px 0px 1px 0px rgba(0, 0, 0, 0.14), 0px -1px 3px 0px rgba(0, 0, 0, 0.12);
|
||||
}
|
||||
|
||||
&.above {
|
||||
|
||||
@@ -1,26 +1,35 @@
|
||||
<md-sidenav-container>
|
||||
<mat-sidenav-container>
|
||||
|
||||
<div id="fuse-main-content" fxFlexFill>
|
||||
<div id="fuse-main-content">
|
||||
|
||||
<!-- TOOLBAR: Above -->
|
||||
<ng-container *ngIf="fuseSettings.layout.toolbar === 'above'">
|
||||
<fuse-toolbar class="above" [class]="fuseSettings.colorClasses.toolbar"></fuse-toolbar>
|
||||
<fuse-toolbar class="above" [ngClass]="fuseSettings.colorClasses.toolbar"></fuse-toolbar>
|
||||
</ng-container>
|
||||
<!-- / TOOLBAR: Above -->
|
||||
|
||||
<!-- NAVBAR: Top -->
|
||||
<fuse-navbar-horizontal class="top-navbar" fxHide fxShow.gt-md
|
||||
[ngClass]="fuseSettings.colorClasses.navbar"
|
||||
*ngIf="fuseSettings.layout.navigation === 'top'">
|
||||
</fuse-navbar-horizontal>
|
||||
<!-- / NAVBAR: Top -->
|
||||
|
||||
<div id="wrapper">
|
||||
|
||||
<fuse-navbar [folded]="false"
|
||||
class="left-navbar"
|
||||
*ngIf="fuseSettings.layout.navigation === 'left'"
|
||||
[class]="fuseSettings.colorClasses.navbar">
|
||||
</fuse-navbar>
|
||||
<!-- NAVBAR: Left -->
|
||||
<fuse-navbar-vertical [folded]="fuseSettings.layout.navigationFolded"
|
||||
class="left-navbar"
|
||||
[ngClass]="fuseSettings.colorClasses.navbar"
|
||||
*ngIf="fuseSettings.layout.navigation === 'left' || fuseSettings.layout.navigation === 'top'">
|
||||
</fuse-navbar-vertical>
|
||||
<!-- / NAVBAR: Left -->
|
||||
|
||||
<div class="content-wrapper">
|
||||
|
||||
<!-- TOOLBAR: Below -->
|
||||
<ng-container *ngIf="fuseSettings.layout.toolbar === 'below'">
|
||||
<fuse-toolbar class="below" [class]="fuseSettings.colorClasses.toolbar"></fuse-toolbar>
|
||||
<fuse-toolbar class="below" [ngClass]="fuseSettings.colorClasses.toolbar"></fuse-toolbar>
|
||||
</ng-container>
|
||||
<!-- / TOOLBAR: Below -->
|
||||
|
||||
@@ -28,30 +37,36 @@
|
||||
|
||||
<!-- FOOTER: Below -->
|
||||
<ng-container *ngIf="fuseSettings.layout.footer === 'below'">
|
||||
<fuse-footer class="below" [class]="fuseSettings.colorClasses.footer"></fuse-footer>
|
||||
<fuse-footer class="below" [ngClass]="fuseSettings.colorClasses.footer"></fuse-footer>
|
||||
</ng-container>
|
||||
<!-- / FOOTER: Below -->
|
||||
|
||||
</div>
|
||||
|
||||
<fuse-navbar [folded]="false" class="md-primary-700-bg right-navbar" *ngIf="fuseSettings.layout.navigation === 'right'"></fuse-navbar>
|
||||
<!-- NAVBAR: Right -->
|
||||
<fuse-navbar-vertical [folded]="fuseSettings.layout.navigationFolded"
|
||||
class="right-navbar"
|
||||
[ngClass]="fuseSettings.colorClasses.navbar"
|
||||
*ngIf="fuseSettings.layout.navigation === 'right'">
|
||||
</fuse-navbar-vertical>
|
||||
<!-- / NAVBAR: Right -->
|
||||
|
||||
</div>
|
||||
|
||||
<!-- FOOTER: Above -->
|
||||
<ng-container *ngIf="fuseSettings.layout.footer === 'above'">
|
||||
<fuse-footer class="above" [class]="fuseSettings.colorClasses.footer"></fuse-footer>
|
||||
<fuse-footer class="above" [ngClass]="fuseSettings.colorClasses.footer"></fuse-footer>
|
||||
</ng-container>
|
||||
<!-- FOOTER: Above -->
|
||||
|
||||
</div>
|
||||
|
||||
<!-- QUICK PANEL -->
|
||||
<md-sidenav fuseMdSidenavHelper="quick-panel" align="end">
|
||||
<mat-sidenav fuseMatSidenavHelper="quick-panel" align="end">
|
||||
<fuse-quick-panel></fuse-quick-panel>
|
||||
</md-sidenav>
|
||||
</mat-sidenav>
|
||||
<!-- / QUICK PANEL -->
|
||||
|
||||
</md-sidenav-container>
|
||||
</mat-sidenav-container>
|
||||
|
||||
<fuse-theme-options></fuse-theme-options>
|
||||
|
||||
@@ -6,24 +6,12 @@ fuse-main {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
||||
&.disable-perfect-scrollbar {
|
||||
|
||||
.ps {
|
||||
-webkit-overflow-scrolling: touch !important;
|
||||
overflow: auto !important;
|
||||
}
|
||||
|
||||
.ps__scrollbar-x-rail,
|
||||
.ps__scrollbar-y-rail {
|
||||
display: none !important;
|
||||
}
|
||||
}
|
||||
|
||||
> .mat-sidenav-container {
|
||||
display: flex;
|
||||
flex: 1;
|
||||
|
||||
> .mat-sidenav-content {
|
||||
> .mat-sidenav-content,
|
||||
> .mat-drawer-content {
|
||||
display: flex;
|
||||
flex: 1;
|
||||
overflow: hidden;
|
||||
@@ -57,6 +45,7 @@ fuse-main {
|
||||
flex: 1;
|
||||
flex-direction: row;
|
||||
width: 100%;
|
||||
overflow: hidden;
|
||||
|
||||
> *:not(router-outlet):not(.ps__scrollbar-x-rail):not(.ps__scrollbar-y-rail) {
|
||||
display: flex;
|
||||
@@ -77,4 +66,10 @@ fuse-main {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&[fuse-layout-mode="boxed"] {
|
||||
max-width: 1200px;
|
||||
margin: 0 auto;
|
||||
@include mat-elevation(8);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import { Component, ElementRef, HostBinding, OnDestroy, OnInit, Renderer2, ViewEncapsulation } from '@angular/core';
|
||||
import { Component, ElementRef, HostBinding, Inject, OnDestroy, OnInit, Renderer2, ViewEncapsulation } from '@angular/core';
|
||||
import { Subscription } from 'rxjs/Subscription';
|
||||
import { FuseConfigService } from '../core/services/config.service';
|
||||
import { Platform } from '@angular/cdk/platform';
|
||||
import { DOCUMENT } from '@angular/common';
|
||||
|
||||
@Component({
|
||||
selector : 'fuse-main',
|
||||
@@ -12,12 +14,14 @@ export class FuseMainComponent implements OnInit, OnDestroy
|
||||
{
|
||||
onSettingsChanged: Subscription;
|
||||
fuseSettings: any;
|
||||
@HostBinding('class.disable-perfect-scrollbar') disableCustomScrollbars;
|
||||
@HostBinding('attr.fuse-layout-mode') layoutMode;
|
||||
|
||||
constructor(
|
||||
private _renderer: Renderer2,
|
||||
private _elementRef: ElementRef,
|
||||
private fuseConfig: FuseConfigService
|
||||
private fuseConfig: FuseConfigService,
|
||||
private platform: Platform,
|
||||
@Inject(DOCUMENT) private document: any
|
||||
)
|
||||
{
|
||||
this.onSettingsChanged =
|
||||
@@ -25,9 +29,14 @@ export class FuseMainComponent implements OnInit, OnDestroy
|
||||
.subscribe(
|
||||
(newSettings) => {
|
||||
this.fuseSettings = newSettings;
|
||||
this.disableCustomScrollbars = !this.fuseSettings.customScrollbars;
|
||||
this.layoutMode = this.fuseSettings.layout.mode;
|
||||
}
|
||||
);
|
||||
|
||||
if ( this.platform.ANDROID || this.platform.IOS )
|
||||
{
|
||||
this.document.body.className += ' is-mobile';
|
||||
}
|
||||
}
|
||||
|
||||
ngOnInit()
|
||||
|
||||
@@ -6,10 +6,11 @@ import { SharedModule } from '../core/modules/shared.module';
|
||||
import { FuseMainComponent } from './main.component';
|
||||
import { FuseContentComponent } from './content/content.component';
|
||||
import { FuseFooterComponent } from './footer/footer.component';
|
||||
import { FuseNavbarComponent } from './navbar/navbar.component';
|
||||
import { FuseNavbarVerticalComponent } from './navbar/vertical/navbar-vertical.component';
|
||||
import { FuseToolbarComponent } from './toolbar/toolbar.component';
|
||||
import { FuseNavigationModule } from '../core/components/navigation/navigation.module';
|
||||
import { FuseNavbarToggleDirective } from './navbar/navbar-toggle.directive';
|
||||
import { FuseNavbarVerticalToggleDirective } from './navbar/vertical/navbar-vertical-toggle.directive';
|
||||
import { FuseNavbarHorizontalComponent } from './navbar/horizontal/navbar-horizontal.component';
|
||||
import { FuseQuickPanelComponent } from './quick-panel/quick-panel.component';
|
||||
import { FuseThemeOptionsComponent } from '../core/components/theme-options/theme-options.component';
|
||||
import { FuseShortcutsModule } from '../core/components/shortcuts/shortcuts.module';
|
||||
@@ -20,9 +21,10 @@ import { FuseSearchBarModule } from '../core/components/search-bar/search-bar.mo
|
||||
FuseContentComponent,
|
||||
FuseFooterComponent,
|
||||
FuseMainComponent,
|
||||
FuseNavbarComponent,
|
||||
FuseNavbarVerticalComponent,
|
||||
FuseNavbarHorizontalComponent,
|
||||
FuseToolbarComponent,
|
||||
FuseNavbarToggleDirective,
|
||||
FuseNavbarVerticalToggleDirective,
|
||||
FuseThemeOptionsComponent,
|
||||
FuseQuickPanelComponent
|
||||
],
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
<fuse-navigation layout="horizontal"></fuse-navigation>
|
||||
@@ -0,0 +1 @@
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
import { Component, OnInit, ViewEncapsulation } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector : 'fuse-navbar-horizontal',
|
||||
templateUrl : './navbar-horizontal.component.html',
|
||||
styleUrls : ['./navbar-horizontal.component.scss'],
|
||||
encapsulation: ViewEncapsulation.None
|
||||
})
|
||||
export class FuseNavbarHorizontalComponent implements OnInit
|
||||
{
|
||||
constructor()
|
||||
{
|
||||
}
|
||||
|
||||
ngOnInit()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
import { Directive, HostListener, Input } from '@angular/core';
|
||||
import { FuseNavbarService } from './navbar.service';
|
||||
import { FuseNavbarComponent } from './navbar.component';
|
||||
|
||||
@Directive({
|
||||
selector: '[fuseNavbar]'
|
||||
})
|
||||
export class FuseNavbarToggleDirective
|
||||
{
|
||||
@Input() fuseNavbar: string;
|
||||
navbar: FuseNavbarComponent;
|
||||
|
||||
constructor(private navbarService: FuseNavbarService)
|
||||
{
|
||||
}
|
||||
|
||||
@HostListener('click')
|
||||
onClick()
|
||||
{
|
||||
this.navbar = this.navbarService.getNavBar();
|
||||
|
||||
if ( !this.navbar[this.fuseNavbar] )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
this.navbar[this.fuseNavbar]();
|
||||
}
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
<div class="navbar-header">
|
||||
|
||||
<div class="logo">
|
||||
<span class="logo-icon">F</span>
|
||||
<span class="logo-text">FUSE</span>
|
||||
</div>
|
||||
|
||||
<button md-button class="toggle-button-navbar mat-icon-button" fuseNavbar="toggleFold" fxHide.lt-lg>
|
||||
<md-icon>menu</md-icon>
|
||||
</button>
|
||||
|
||||
<button md-button class="toggle-button-navbar mat-icon-button" fuseNavbar="closeBar" fxHide.gt-md>
|
||||
<md-icon>arrow_back</md-icon>
|
||||
</button>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="navbar-content" perfect-scrollbar>
|
||||
<fuse-navigation></fuse-navigation>
|
||||
</div>
|
||||
@@ -1,188 +0,0 @@
|
||||
import { Component, HostBinding, HostListener, Input, OnDestroy, OnInit, ViewChild, ViewEncapsulation } from '@angular/core';
|
||||
import { Subscription } from 'rxjs/Subscription';
|
||||
import { FuseMatchMedia } from '../../core/services/match-media.service';
|
||||
import { FuseNavbarService } from './navbar.service';
|
||||
import { ObservableMedia } from '@angular/flex-layout';
|
||||
import { FuseMainComponent } from '../main.component';
|
||||
import { NavigationEnd, Router } from '@angular/router';
|
||||
import { PerfectScrollbarDirective } from 'ngx-perfect-scrollbar';
|
||||
import { FuseNavigationService } from '../../core/components/navigation/navigation.service';
|
||||
|
||||
@Component({
|
||||
selector : 'fuse-navbar',
|
||||
templateUrl : './navbar.component.html',
|
||||
styleUrls : ['./navbar.component.scss'],
|
||||
encapsulation: ViewEncapsulation.None
|
||||
})
|
||||
export class FuseNavbarComponent implements OnInit, OnDestroy
|
||||
{
|
||||
@HostBinding('class.close') isClosed: boolean;
|
||||
@HostBinding('class.folded') isFoldedActive: boolean;
|
||||
@HostBinding('class.folded-open') isFoldedOpen: boolean;
|
||||
@HostBinding('class.initialized') initialized: boolean;
|
||||
@Input('folded') foldedByDefault = false;
|
||||
@ViewChild(PerfectScrollbarDirective) perfectScrollbarDirective;
|
||||
|
||||
matchMediaWatcher: Subscription;
|
||||
|
||||
constructor(
|
||||
private fuseMainComponentEl: FuseMainComponent,
|
||||
private fuseMatchMedia: FuseMatchMedia,
|
||||
private fuseNavigationService: FuseNavigationService,
|
||||
private navBarService: FuseNavbarService,
|
||||
public media: ObservableMedia,
|
||||
private router: Router
|
||||
)
|
||||
{
|
||||
navBarService.setNavBar(this);
|
||||
|
||||
this.fuseNavigationService.onNavCollapseToggled.subscribe(() => {
|
||||
|
||||
setTimeout(() => {
|
||||
this.perfectScrollbarDirective.update();
|
||||
}, 310);
|
||||
});
|
||||
|
||||
this.matchMediaWatcher =
|
||||
this.fuseMatchMedia.onMediaChange
|
||||
.subscribe((mediaStep) => {
|
||||
setTimeout(() => {
|
||||
|
||||
if ( this.media.isActive('lt-lg') )
|
||||
{
|
||||
this.closeBar();
|
||||
this.deActivateFolded();
|
||||
}
|
||||
else
|
||||
{
|
||||
this.openBar();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
router.events.subscribe(
|
||||
(event) => {
|
||||
if ( event instanceof NavigationEnd )
|
||||
{
|
||||
if ( this.media.isActive('lt-lg') )
|
||||
{
|
||||
setTimeout(() => {
|
||||
this.closeBar();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
ngOnInit()
|
||||
{
|
||||
this.isClosed = false;
|
||||
this.isFoldedActive = this.foldedByDefault;
|
||||
this.isFoldedOpen = false;
|
||||
this.initialized = false;
|
||||
this.updateCssClasses();
|
||||
|
||||
setTimeout(() => {
|
||||
this.initialized = true;
|
||||
});
|
||||
|
||||
if ( this.media.isActive('lt-lg') )
|
||||
{
|
||||
this.closeBar();
|
||||
this.deActivateFolded();
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( !this.foldedByDefault )
|
||||
{
|
||||
this.deActivateFolded();
|
||||
}
|
||||
else
|
||||
{
|
||||
this.activateFolded();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
openBar()
|
||||
{
|
||||
this.isClosed = false;
|
||||
this.updateCssClasses();
|
||||
}
|
||||
|
||||
closeBar()
|
||||
{
|
||||
this.isClosed = true;
|
||||
this.updateCssClasses();
|
||||
}
|
||||
|
||||
toggleBar()
|
||||
{
|
||||
if ( this.isClosed )
|
||||
{
|
||||
this.openBar();
|
||||
}
|
||||
else
|
||||
{
|
||||
this.closeBar();
|
||||
}
|
||||
}
|
||||
|
||||
toggleFold()
|
||||
{
|
||||
if ( !this.isFoldedActive )
|
||||
{
|
||||
this.activateFolded();
|
||||
}
|
||||
else
|
||||
{
|
||||
this.deActivateFolded();
|
||||
}
|
||||
}
|
||||
|
||||
activateFolded()
|
||||
{
|
||||
this.isFoldedActive = true;
|
||||
this.fuseMainComponentEl.addClass('fuse-nav-bar-folded');
|
||||
this.isFoldedOpen = false;
|
||||
}
|
||||
|
||||
deActivateFolded()
|
||||
{
|
||||
this.isFoldedActive = false;
|
||||
this.fuseMainComponentEl.removeClass('fuse-nav-bar-folded');
|
||||
this.isFoldedOpen = false;
|
||||
}
|
||||
|
||||
@HostListener('mouseenter')
|
||||
onMouseEnter()
|
||||
{
|
||||
this.isFoldedOpen = true;
|
||||
}
|
||||
|
||||
@HostListener('mouseleave')
|
||||
onMouseLeave()
|
||||
{
|
||||
this.isFoldedOpen = false;
|
||||
}
|
||||
|
||||
updateCssClasses()
|
||||
{
|
||||
if ( this.isClosed )
|
||||
{
|
||||
this.fuseMainComponentEl.addClass('fuse-nav-bar-opened');
|
||||
this.fuseMainComponentEl.removeClass('fuse-nav-bar-closed');
|
||||
}
|
||||
else
|
||||
{
|
||||
this.fuseMainComponentEl.addClass('fuse-nav-bar-closed');
|
||||
this.fuseMainComponentEl.removeClass('fuse-nav-bar-opened');
|
||||
}
|
||||
}
|
||||
|
||||
ngOnDestroy()
|
||||
{
|
||||
this.matchMediaWatcher.unsubscribe();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
import { Directive, HostListener, Input } from '@angular/core';
|
||||
import { FuseNavbarVerticalService } from './navbar-vertical.service';
|
||||
import { FuseNavbarVerticalComponent } from './navbar-vertical.component';
|
||||
|
||||
@Directive({
|
||||
selector: '[fuseNavbarVertical]'
|
||||
})
|
||||
export class FuseNavbarVerticalToggleDirective
|
||||
{
|
||||
@Input() fuseNavbarVertical: string;
|
||||
navbar: FuseNavbarVerticalComponent;
|
||||
|
||||
constructor(private navbarService: FuseNavbarVerticalService)
|
||||
{
|
||||
}
|
||||
|
||||
@HostListener('click')
|
||||
onClick()
|
||||
{
|
||||
this.navbar = this.navbarService.getNavBar();
|
||||
|
||||
if ( !this.navbar[this.fuseNavbarVertical] )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
this.navbar[this.fuseNavbarVertical]();
|
||||
}
|
||||
}
|
||||
20
src/app/main/navbar/vertical/navbar-vertical.component.html
Normal file
20
src/app/main/navbar/vertical/navbar-vertical.component.html
Normal file
@@ -0,0 +1,20 @@
|
||||
<div class="navbar-header">
|
||||
|
||||
<div class="logo">
|
||||
<img class="logo-icon" src="assets/images/logos/fuse.svg">
|
||||
<span class="logo-text">FUSE</span>
|
||||
</div>
|
||||
|
||||
<button mat-button class="toggle-button-navbar mat-icon-button" fuseNavbarVertical="toggleFold" fxHide.lt-lg>
|
||||
<mat-icon>menu</mat-icon>
|
||||
</button>
|
||||
|
||||
<button mat-button class="toggle-button-navbar mat-icon-button" fuseNavbarVertical="closeBar" fxHide.gt-md>
|
||||
<mat-icon>arrow_back</mat-icon>
|
||||
</button>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="navbar-content" fusePerfectScrollbar>
|
||||
<fuse-navigation layout="vertical"></fuse-navigation>
|
||||
</div>
|
||||
@@ -1,4 +1,4 @@
|
||||
@import "../../core/scss/fuse";
|
||||
@import "../../../core/scss/fuse";
|
||||
|
||||
fuse-main {
|
||||
|
||||
@@ -23,7 +23,7 @@ fuse-main {
|
||||
}
|
||||
}
|
||||
|
||||
fuse-navbar {
|
||||
fuse-navbar-vertical {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
width: 256px;
|
||||
@@ -32,7 +32,7 @@ fuse-navbar {
|
||||
background-color: #FFFFFF;
|
||||
overflow-y: auto;
|
||||
overflow-x: hidden;
|
||||
z-index: 3;
|
||||
z-index: 4;
|
||||
box-shadow: 0 5px 5px -3px rgba(0, 0, 0, .2), 0 8px 10px 1px rgba(0, 0, 0, .14), 0 3px 14px 2px rgba(0, 0, 0, .12);
|
||||
transition: all .3s cubic-bezier(.55, 0, .55, .2), width .1s linear, min-width .1s linear, max-width .1s linear;
|
||||
transform: translateX(0);
|
||||
@@ -45,6 +45,7 @@ fuse-navbar {
|
||||
&.left-navbar {
|
||||
left: 0;
|
||||
}
|
||||
|
||||
&.right-navbar {
|
||||
right: 0;
|
||||
}
|
||||
@@ -55,40 +56,50 @@ fuse-navbar {
|
||||
max-width: 64px;
|
||||
|
||||
.navbar-header {
|
||||
padding: 0 16px 0 16px;
|
||||
padding: 0 13px;
|
||||
|
||||
.logo {
|
||||
|
||||
.logo-text {
|
||||
opacity: 0;
|
||||
transition: opacity 200ms ease;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&.folded-open {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
&.close {
|
||||
box-shadow: none;
|
||||
|
||||
&.left-navbar {
|
||||
transform: translateX(-100%) !important;
|
||||
}
|
||||
|
||||
&.right-navbar {
|
||||
transform: translateX(100%) !important;
|
||||
}
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
@include media-breakpoint('lt-lg') {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
|
||||
&.left-navbar {
|
||||
left: 0;
|
||||
}
|
||||
|
||||
&.right-navbar {
|
||||
right: 0;
|
||||
}
|
||||
|
||||
&:not(.initialized) {
|
||||
|
||||
&.left-navbar {
|
||||
transform: translateX(-100%);
|
||||
}
|
||||
|
||||
&.right-navbar {
|
||||
transform: translateX(100%);
|
||||
}
|
||||
@@ -111,27 +122,37 @@ fuse-navbar {
|
||||
align-items: center;
|
||||
|
||||
.logo-icon {
|
||||
display: block;
|
||||
background: #039BE5;
|
||||
width: 32px;
|
||||
min-width: 32px;
|
||||
height: 32px;
|
||||
line-height: 32px;
|
||||
text-align: center;
|
||||
font-size: 16px;
|
||||
font-weight: 500;
|
||||
color: #FFF;
|
||||
border-radius: 2px;
|
||||
width: 38px;
|
||||
}
|
||||
|
||||
.logo-text {
|
||||
margin-left: 16px;
|
||||
font-size: 16px;
|
||||
margin-left: 8px;
|
||||
font-size: 20px;
|
||||
font-weight: 300;
|
||||
letter-spacing: 0.4px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.nav-bar-content {
|
||||
.navbar-content {
|
||||
flex: 1;
|
||||
}
|
||||
}
|
||||
|
||||
fuse-navbar-horizontal + #wrapper > fuse-navbar-vertical {
|
||||
display: none;
|
||||
@include media-breakpoint-down(md) {
|
||||
display: flex;
|
||||
}
|
||||
}
|
||||
|
||||
.fuse-navbar-backdrop {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
z-index: 3;
|
||||
background-color: rgba(0, 0, 0, 0.6);
|
||||
opacity: 0;
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user