Compare commits

...

28 Commits

Author SHA1 Message Date
Sercan Yemen
7580176042 Increased the version number 2018-05-09 18:05:55 +03:00
Sercan Yemen
725719317a (Scrumboard) Fix: "Add a list" button is draggable and causing issues 2018-05-09 18:04:32 +03:00
Sercan Yemen
5ce276de8e rxjs 6.0.0 compatibility 2018-05-09 17:55:26 +03:00
Sercan Yemen
d330b42dec Updated @swimlane and couple other packages 2018-05-09 14:58:36 +03:00
Sercan Yemen
6bf2fe0b17 Updated ngrx to 6.0.0-beta.1 2018-05-09 14:50:30 +03:00
Sercan Yemen
a2187e0134 Set the output path 2018-05-06 14:33:17 +03:00
Sercan Yemen
a1cf7dba91 Angular version name 2018-05-06 14:32:10 +03:00
Sercan Yemen
b8039899db Fixed various dialog issues
+ (Shortcuts) Icon colors in shortcuts menu
2018-05-06 14:19:28 +03:00
Sercan Yemen
26e55d7f3d (Navigation) Fixed: Horizontal navigation items don't have 'hidden' and 'custom function' features 2018-05-06 13:44:34 +03:00
Sercan Yemen
1a9229a3ae (Contacts) Fixed: List item cell forces the list item width 2018-05-06 13:38:15 +03:00
Sercan Yemen
ebf865e2c7 Angular and Angular Material 6 compatibility
+ Small adjustments and polishing up in various apps and pages
2018-05-06 13:29:08 +03:00
Sercan Yemen
5fd146b8da Angular and Angular Material 6 compatibility (wip) 2018-05-05 19:54:52 +03:00
Sercan Yemen
3401a67959 intl polyfill is no longer required 2018-05-05 15:31:29 +03:00
Sercan Yemen
10dad46d7c Updated the position attribute of the sidenav
Did some changes on the core styles + forced input font sizes to 16px
2018-05-05 15:28:05 +03:00
Sercan Yemen
1c4983c756 rxjs upgrade 2018-05-05 14:42:18 +03:00
Sercan Yemen
f4636d9a37 Update Angular, Angular Material and Flex Layout to 6
Updated additional project files
Updated Angular Material examples
2018-05-04 19:28:20 +03:00
Sercan Yemen
02df48ab4e Remove the {navigation} import from the ThemeOptions and inject it where we actually use the fuseThemeOptions 2018-04-04 14:41:43 +03:00
Sercan Yemen
831d48f5a3 Remove the {navigation} import from the Shortcuts and inject it from the toolbar where we actually use the fuseShortcuts 2018-04-04 14:36:33 +03:00
Sercan Yemen
ca42f71b0e Added lodash for convenience
+ Removed the default settings from the settings service - this means the user must provide the default settings at all time
2018-04-04 14:30:52 +03:00
Sercan Yemen
ed4a3cb8d7 Move the layout settings reset to the 'NavigationEnd' to make things smoother on lazily loaded components 2018-04-04 14:20:45 +03:00
Sercan Yemen
5c66d95951 Warn the user about the missing sidebars in registry
+ Check if the sidebar exists before trying to close it
2018-04-04 13:37:59 +03:00
Sercan Yemen
44663342f4 Set the correct return type for the 'getSidebar' method
+ Close the navbar on NavigationEnd on mobile devices
2018-04-04 11:36:00 +03:00
Sercan Yemen
4e6207fef5 Fixed: Small issues caused by Flex Layout update
Fixed: Profile page header bg image doesn't correctly cover the header on mobile devices
Fixed: Contacts app form dialog header irregularities
Fixed: Analytics module doesn't import MatButtons
Fixed: Scrumboard card dialog toolbar issues
2018-03-31 13:20:22 +03:00
Sercan Yemen
bd67b660c8 Updated Flex Layout package
+ Fixed: Fuse sidebar doesn't scroll when the custom scrollbars disabled
+ Fixed: Expanded search bar style
2018-03-31 12:03:21 +03:00
Sercan Yemen
174789930d Allow url and function on collapsable nav items
+ Allow url and function to be exist at the same time on collapsable and normal nav items
2018-03-11 18:26:57 +03:00
Sercan Yemen
7af9c57977 Changed the title 2018-03-10 14:35:09 +03:00
Sercan Yemen
874ef26f0b Increase the version number 2018-03-10 14:34:17 +03:00
Sercan Yemen
329fbb5a38 Fix issues with folded navigation 2018-03-10 14:32:37 +03:00
636 changed files with 16352 additions and 12250 deletions

View File

@@ -1,74 +0,0 @@
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"project": {
"name": "fuse"
},
"apps": [
{
"root": "src",
"outDir": "dist",
"assets": [
"assets",
"app/main/content/components/angular-material",
"favicon.ico"
],
"index": "index.html",
"main": "main.ts",
"polyfills": "polyfills.ts",
"test": "test.ts",
"tsconfig": "tsconfig.app.json",
"testTsconfig": "tsconfig.spec.json",
"prefix": "app",
"styles": [
"styles.scss"
],
"scripts": [],
"environmentSource": "environments/environment.ts",
"environments": {
"dev": "environments/environment.ts",
"hmr": "environments/environment.hmr.ts",
"prod": "environments/environment.prod.ts"
}
}
],
"e2e": {
"protractor": {
"config": "./protractor.conf.js"
}
},
"lint": [
{
"project": "src/tsconfig.app.json",
"exclude": [
"**/node_modules/**",
"**/src/app/fuse-fake-db/**/*",
"**/src/assets/angular-material-examples/**/*"
]
},
{
"project": "src/tsconfig.spec.json",
"exclude": [
"**/node_modules/**",
"**/src/app/fuse-fake-db/**/*",
"**/src/assets/angular-material-examples/**/*"
]
},
{
"project": "e2e/tsconfig.e2e.json",
"exclude": [
"**/node_modules/**",
"**/src/app/fuse-fake-db/**/*",
"**/src/assets/angular-material-examples/**/*"
]
}
],
"test": {
"karma": {
"config": "./karma.conf.js"
}
},
"defaults": {
"styleExt": "scss",
"component": {}
}
}

View File

@@ -1,3 +1,4 @@
# Editor configuration, see http://editorconfig.org
root = true
[*]

5
.gitignore vendored
View File

@@ -30,13 +30,10 @@
/coverage
/libpeerconnection.log
npm-debug.log
yarn-error.log
testem.log
/typings
# e2e
/e2e/*.js
/e2e/*.map
# System Files
.DS_Store
Thumbs.db

View File

@@ -1,6 +1,6 @@
# Fuse2
Material Design Admin Template with Angular 5+ and Angular Material 2
Material Design Admin Template with Angular 6+ and Angular Material 2
## The Community
@@ -14,11 +14,11 @@ Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app w
## Code scaffolding
Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|module`.
Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.
## Build
Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `-prod` flag for a production build.
Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `--prod` flag for a production build.
## Running unit tests
@@ -27,4 +27,8 @@ Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.
## Running end-to-end tests
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).

140
angular.json Normal file
View File

@@ -0,0 +1,140 @@
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"projects": {
"fuse": {
"root": "",
"sourceRoot": "src",
"projectType": "application",
"prefix": "app",
"schematics": {
"@schematics/angular:component": {
"styleext": "scss"
}
},
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist",
"index": "src/index.html",
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "src/tsconfig.app.json",
"assets": [
"src/favicon.ico",
"src/assets",
"src/app/main/content/components/angular-material"
],
"styles": [
"src/styles.scss"
],
"scripts": []
},
"configurations": {
"production": {
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
],
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true
}
}
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "fuse:build"
},
"configurations": {
"production": {
"browserTarget": "fuse:build:production"
},
"hmr": {
"hmr": true,
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.hmr.ts"
}
]
}
}
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "fuse:build"
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "src/test.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "src/tsconfig.spec.json",
"karmaConfig": "src/karma.conf.js",
"styles": [
"styles.scss"
],
"scripts": [],
"assets": [
"src/favicon.ico",
"src/assets"
]
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"src/tsconfig.app.json",
"src/tsconfig.spec.json"
],
"exclude": [
"**/node_modules/**",
"**/src/app/fuse-fake-db/**/*",
"**/src/assets/angular-material-examples/**/*"
]
}
}
}
},
"fuse-e2e": {
"root": "e2e/",
"projectType": "application",
"architect": {
"e2e": {
"builder": "@angular-devkit/build-angular:protractor",
"options": {
"protractorConfig": "e2e/protractor.conf.js",
"devServerTarget": "fuse:serve"
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": "e2e/tsconfig.e2e.json",
"exclude": [
"**/node_modules/**",
"**/src/app/fuse-fake-db/**/*",
"**/src/assets/angular-material-examples/**/*"
]
}
}
}
}
},
"defaultProject": "fuse"
}

31
e2e/protractor.conf.js Normal file
View File

@@ -0,0 +1,31 @@
// Protractor configuration file, see link for more information
// https://github.com/angular/protractor/blob/master/lib/config.ts
const {SpecReporter} = require('jasmine-spec-reporter');
exports.config = {
allScriptsTimeout: 11000,
specs : [
'./src/**/*.e2e-spec.ts'
],
capabilities : {
'browserName': 'chrome'
},
directConnect : true,
baseUrl : 'http://localhost:4200/',
framework : 'jasmine',
jasmineNodeOpts : {
showColors : true,
defaultTimeoutInterval: 30000,
print : function ()
{
}
},
onPrepare()
{
require('ts-node').register({
project: require('path').join(__dirname, './tsconfig.e2e.json')
});
jasmine.getEnv().addReporter(new SpecReporter({spec: {displayStacktrace: true}}));
}
};

View File

@@ -9,6 +9,6 @@ describe('Fuse2 App', () => {
it('should display welcome message', () => {
page.navigateTo();
expect(page.getParagraphText()).toEqual('Welcome to app!');
expect(page.getParagraphText()).toEqual('Welcome to Fuse2!');
});
});

View File

@@ -1,8 +1,7 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"outDir": "../out-tsc/e2e",
"baseUrl": "./",
"outDir": "../out-tsc/app",
"module": "commonjs",
"target": "es5",
"types": [
@@ -11,4 +10,4 @@
"node"
]
}
}
}

View File

@@ -1,33 +0,0 @@
// Karma configuration file, see link for more information
// https://karma-runner.github.io/1.0/config/configuration-file.html
module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine', '@angular/cli'],
plugins: [
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-jasmine-html-reporter'),
require('karma-coverage-istanbul-reporter'),
require('@angular/cli/plugins/karma')
],
client:{
clearContext: false // leave Jasmine Spec Runner output visible in browser
},
coverageIstanbulReporter: {
reports: [ 'html', 'lcovonly' ],
fixWebpackSourcePaths: true
},
angularCli: {
environment: 'dev'
},
reporters: ['progress', 'kjhtml'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['Chrome'],
singleRun: false
});
};

14844
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,11 +1,11 @@
{
"name": "fuse",
"version": "5.2.9",
"version": "6.0.1",
"license": "https://themeforest.net/licenses/terms/regular",
"scripts": {
"ng": "ng",
"start": "ng serve --open",
"start-hmr": "ng serve --hmr -e=hmr -sm=false",
"start-hmr": "ng serve --configuration 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-stats": "node --max_old_space_size=6144 ./node_modules/@angular/cli/bin/ng build --dev --stats-json",
@@ -19,67 +19,70 @@
"private": true,
"dependencies": {
"@agm/core": "1.0.0-beta.2",
"@angular/animations": "5.2.8",
"@angular/cdk": "5.2.4",
"@angular/common": "5.2.8",
"@angular/compiler": "5.2.8",
"@angular/core": "5.2.8",
"@angular/flex-layout": "5.0.0-beta.13",
"@angular/forms": "5.2.8",
"@angular/http": "5.2.8",
"@angular/material": "5.2.4",
"@angular/material-moment-adapter": "5.2.4",
"@angular/platform-browser": "5.2.8",
"@angular/platform-browser-dynamic": "5.2.8",
"@angular/router": "5.2.8",
"@ngrx/effects": "5.2.0",
"@ngrx/router-store": "5.2.0",
"@ngrx/store": "5.2.0",
"@ngrx/store-devtools": "5.2.0",
"@ngx-translate/core": "9.1.1",
"@swimlane/ngx-charts": "7.1.1",
"@swimlane/ngx-datatable": "11.2.0",
"@swimlane/ngx-dnd": "3.1.0",
"@angular/animations": "6.0.0",
"@angular/cdk": "6.0.1",
"@angular/common": "6.0.0",
"@angular/compiler": "6.0.0",
"@angular/core": "6.0.0",
"@angular/flex-layout": "6.0.0-beta.15",
"@angular/forms": "6.0.0",
"@angular/http": "6.0.0",
"@angular/material": "6.0.1",
"@angular/material-moment-adapter": "6.0.1",
"@angular/platform-browser": "6.0.0",
"@angular/platform-browser-dynamic": "6.0.0",
"@angular/router": "6.0.0",
"@ngrx/effects": "6.0.0-beta.1",
"@ngrx/router-store": "6.0.0-beta.1",
"@ngrx/store": "6.0.0-beta.1",
"@ngrx/store-devtools": "6.0.0-beta.1",
"@ngx-translate/core": "10.0.1",
"@swimlane/ngx-charts": "8.0.0",
"@swimlane/ngx-datatable": "12.0.0",
"@swimlane/ngx-dnd": "4.0.0",
"@types/prismjs": "1.9.0",
"angular-calendar": "0.23.6",
"angular-in-memory-web-api": "0.5.3",
"angular-calendar": "0.24.0",
"angular-in-memory-web-api": "0.6.0",
"chart.js": "2.7.2",
"classlist.js": "1.1.20150312",
"core-js": "2.5.3",
"d3": "4.13.0",
"core-js": "2.5.6",
"d3": "5.2.0",
"hammerjs": "2.0.8",
"intl": "1.2.5",
"moment": "2.21.0",
"lodash": "4.17.10",
"moment": "2.22.1",
"ng2-charts": "1.6.0",
"ngrx-store-freeze": "0.2.1",
"ngx-color-picker": "5.3.4",
"ngrx-store-freeze": "0.2.2",
"ngx-color-picker": "6.0.0",
"ngx-cookie-service": "1.0.10",
"perfect-scrollbar": "1.3.0",
"prismjs": "1.11.0",
"rxjs": "5.5.6",
"prismjs": "1.14.0",
"rxjs": "6.1.0",
"rxjs-compat": "6.1.0",
"web-animations-js": "2.3.1",
"zone.js": "0.8.20"
"zone.js": "0.8.26"
},
"devDependencies": {
"@angular/cli": "1.7.3",
"@angular/compiler-cli": "5.2.8",
"@angular/language-service": "5.2.8",
"@angular/cli": "6.0.0",
"@angular/compiler-cli": "6.0.0",
"@angular/language-service": "6.0.0",
"@angular-devkit/build-angular": "0.6.0",
"@angularclass/hmr": "2.1.3",
"@types/jasmine": "2.8.6",
"@types/jasmine": "2.8.7",
"@types/jasminewd2": "2.0.3",
"@types/node": "6.0.101",
"@types/lodash": "4.14.108",
"@types/node": "8.9.5",
"codelyzer": "4.2.1",
"jasmine-core": "2.8.0",
"jasmine-core": "2.99.1",
"jasmine-spec-reporter": "4.2.1",
"karma": "2.0.0",
"karma": "1.7.1",
"karma-chrome-launcher": "2.2.0",
"karma-coverage-istanbul-reporter": "1.4.2",
"karma-jasmine": "1.1.1",
"karma-jasmine": "1.1.2",
"karma-jasmine-html-reporter": "0.2.2",
"protractor": "5.1.2",
"ts-node": "4.1.0",
"protractor": "5.3.1",
"ts-node": "5.0.1",
"tslint": "5.9.1",
"typescript": "2.6.2",
"typescript": "2.7.2",
"webpack-bundle-analyzer": "2.11.1"
}
}

View File

@@ -1,28 +0,0 @@
// Protractor configuration file, see link for more information
// https://github.com/angular/protractor/blob/master/lib/config.ts
const { SpecReporter } = require('jasmine-spec-reporter');
exports.config = {
allScriptsTimeout: 11000,
specs: [
'./e2e/**/*.e2e-spec.ts'
],
capabilities: {
'browserName': 'chrome'
},
directConnect: true,
baseUrl: 'http://localhost:4200/',
framework: 'jasmine',
jasmineNodeOpts: {
showColors: true,
defaultTimeoutInterval: 30000,
print: function() {}
},
onPrepare() {
require('ts-node').register({
project: 'e2e/tsconfig.e2e.json'
});
jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }));
}
};

View File

@@ -1,6 +1,7 @@
import { Component, Input, OnInit } from '@angular/core';
import { Observable } from 'rxjs/Observable';
import 'rxjs/add/observable/interval';
import { interval } from 'rxjs';
import { map } from 'rxjs/operators';
import * as moment from 'moment';
@@ -31,22 +32,21 @@ export class FuseCountdownComponent implements OnInit
let diff = eventDate.diff(currDate, 'seconds');
const countDown =
Observable
.interval(1000)
.map(value => {
return diff = diff - 1;
})
.map(value => {
const timeLeft = moment.duration(value, 'seconds');
const countDown = interval(1000).pipe(
map(value => {
return diff = diff - 1;
}),
map(value => {
const timeLeft = moment.duration(value, 'seconds');
return {
days : timeLeft.asDays().toFixed(0),
hours : timeLeft.hours(),
minutes: timeLeft.minutes(),
seconds: timeLeft.seconds()
};
});
return {
days : timeLeft.asDays().toFixed(0),
hours : timeLeft.hours(),
minutes: timeLeft.minutes(),
seconds: timeLeft.seconds()
};
})
);
countDown.subscribe(value => {
this.countdown = value;

View File

@@ -5,6 +5,7 @@ import 'prismjs/components/prism-csharp';
import 'prismjs/components/prism-css';
import 'prismjs/components/prism-diff';
import 'prismjs/components/prism-markup';
import 'prismjs/components/prism-markup-templating';
import 'prismjs/components/prism-java';
import 'prismjs/components/prism-javascript';
import 'prismjs/components/prism-json';

View File

@@ -1,23 +1,52 @@
<a class="nav-link" matRipple>
<mat-icon class="nav-link-icon" *ngIf="item.icon">{{item.icon}}</mat-icon>
<span class="nav-link-title" [translate]="item.translate">{{item.title}}</span>
<span class="nav-link-badge" *ngIf="item.badge" [translate]="item.badge.translate"
[ngStyle]="{'background-color': item.badge.bg,'color': item.badge.fg}">
{{item.badge.title}}
<ng-container *ngIf="!item.hidden">
<!-- normal collapse -->
<a class="nav-link" *ngIf="!item.url && !item.function" matRipple>
<ng-container *ngTemplateOutlet="itemContent"></ng-container>
</a>
<!-- item.url -->
<a class="nav-link" *ngIf="item.url && !item.function"
[routerLink]="[item.url]" routerLinkActive="active"
[routerLinkActiveOptions]="{exact: item.exactMatch || false}" matRipple>
<ng-container *ngTemplateOutlet="itemContent"></ng-container>
</a>
<!-- item.function -->
<span class="nav-link" *ngIf="!item.url && item.function" (click)="item.function()" matRipple>
<ng-container *ngTemplateOutlet="itemContent"></ng-container>
</span>
<mat-icon class="collapse-arrow">keyboard_arrow_right</mat-icon>
</a>
<div class="children" [ngClass]="{'open': isOpen}">
<!-- item.url && item.function -->
<a class="nav-link" *ngIf="item.url && item.function" (click)="item.function()"
[routerLink]="[item.url]" routerLinkActive="active"
[routerLinkActiveOptions]="{exact: item.exactMatch || false}" matRipple>
<ng-container *ngTemplateOutlet="itemContent"></ng-container>
</a>
<div class="{{fuseSettings.colorClasses.navbar}}">
<ng-template #itemContent>
<mat-icon class="nav-link-icon" *ngIf="item.icon">{{item.icon}}</mat-icon>
<span class="nav-link-title" [translate]="item.translate">{{item.title}}</span>
<span class="nav-link-badge" *ngIf="item.badge" [translate]="item.badge.translate"
[ngStyle]="{'background-color': item.badge.bg,'color': item.badge.fg}">
{{item.badge.title}}
</span>
<mat-icon class="collapse-arrow">keyboard_arrow_right</mat-icon>
</ng-template>
<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 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>
</div>
</ng-container>

View File

@@ -1,7 +1,8 @@
import { Component, HostBinding, HostListener, Input, OnDestroy } from '@angular/core';
import { Subscription } from 'rxjs';
import { fuseAnimations } from '../../../../animations/index';
import { FuseConfigService } from '../../../../services/config.service';
import { Subscription } from 'rxjs/Subscription';
@Component({
selector : 'fuse-nav-horizontal-collapse',

View File

@@ -1,18 +1,30 @@
<a class="nav-link" *ngIf="item.url" [routerLink]="[item.url]" routerLinkActive="active"
[routerLinkActiveOptions]="{exact: item.exactMatch || false}" matRipple>
<mat-icon class="nav-link-icon" *ngIf="item.icon">{{item.icon}}</mat-icon>
<span class="nav-link-title" [translate]="item.translate">{{item.title}}</span>
<span class="nav-link-badge" *ngIf="item.badge" [translate]="item.badge.translate"
[ngStyle]="{'background-color': item.badge.bg,'color': item.badge.fg}">
{{item.badge.title}}
</span>
</a>
<ng-container *ngIf="!item.hidden">
<span class="nav-link" *ngIf="item.function" (click)="item.function()" matRipple>
<mat-icon class="nav-link-icon" *ngIf="item.icon">{{item.icon}}</mat-icon>
<span class="nav-link-title" [translate]="item.translate">{{item.title}}</span>
<span class="nav-link-badge" *ngIf="item.badge" [translate]="item.badge.translate"
[ngStyle]="{'background-color': item.badge.bg,'color': item.badge.fg}">
{{item.badge.title}}
<!-- item.url -->
<a class="nav-link" *ngIf="item.url" [routerLink]="[item.url]" routerLinkActive="active"
[routerLinkActiveOptions]="{exact: item.exactMatch || false}" matRipple>
<ng-container *ngTemplateOutlet="itemContent"></ng-container>
</a>
<!-- item.function -->
<span class="nav-link" *ngIf="item.function" (click)="item.function()" matRipple>
<ng-container *ngTemplateOutlet="itemContent"></ng-container>
</span>
</span>
<!-- item.url && item.function -->
<a class="nav-link" *ngIf="item.url && item.function" (click)="item.function()"
[routerLink]="[item.url]" routerLinkActive="active"
[routerLinkActiveOptions]="{exact: item.exactMatch || false}" matRipple>
<ng-container *ngTemplateOutlet="itemContent"></ng-container>
</a>
<ng-template #itemContent>
<mat-icon class="nav-link-icon" *ngIf="item.icon">{{item.icon}}</mat-icon>
<span class="nav-link-title" [translate]="item.translate">{{item.title}}</span>
<span class="nav-link-badge" *ngIf="item.badge" [translate]="item.badge.translate"
[ngStyle]="{'background-color': item.badge.bg,'color': item.badge.fg}">
{{item.badge.title}}
</span>
</ng-template>
</ng-container>

View File

@@ -1,5 +1,5 @@
import { EventEmitter, Injectable } from '@angular/core';
import { Subject } from 'rxjs/Subject';
import { Injectable } from '@angular/core';
import { Subject } from 'rxjs';
@Injectable()
export class FuseNavigationService

View File

@@ -1,6 +1,30 @@
<ng-container *ngIf="!item.hidden">
<a class="nav-link" matRipple (click)="toggleOpen($event)">
<!-- normal collapse -->
<a class="nav-link" *ngIf="!item.url && !item.function" (click)="toggleOpen($event)" matRipple>
<ng-container *ngTemplateOutlet="itemContent"></ng-container>
</a>
<!-- item.url -->
<a class="nav-link" *ngIf="item.url && !item.function" (click)="toggleOpen($event)"
[routerLink]="[item.url]" routerLinkActive="active"
[routerLinkActiveOptions]="{exact: item.exactMatch || false}" matRipple>
<ng-container *ngTemplateOutlet="itemContent"></ng-container>
</a>
<!-- item.function -->
<span class="nav-link" *ngIf="!item.url && item.function" (click)="toggleOpen($event);item.function()" matRipple>
<ng-container *ngTemplateOutlet="itemContent"></ng-container>
</span>
<!-- item.url && item.function -->
<a class="nav-link" *ngIf="item.url && item.function" (click)="toggleOpen($event);item.function()"
[routerLink]="[item.url]" routerLinkActive="active"
[routerLinkActiveOptions]="{exact: item.exactMatch || false}" matRipple>
<ng-container *ngTemplateOutlet="itemContent"></ng-container>
</a>
<ng-template #itemContent>
<mat-icon class="nav-link-icon" *ngIf="item.icon">{{item.icon}}</mat-icon>
<span class="nav-link-title" [translate]="item.translate">{{item.title}}</span>
<span class="nav-link-badge" *ngIf="item.badge" [translate]="item.badge.translate"
@@ -8,7 +32,7 @@
{{item.badge.title}}
</span>
<mat-icon class="collapse-arrow">keyboard_arrow_right</mat-icon>
</a>
</ng-template>
<div class="children" [@slideInOut]="isOpen">
<ng-container *ngFor="let item of item.children">

View File

@@ -1,22 +1,31 @@
<ng-container *ngIf="!item.hidden">
<a class="nav-link" *ngIf="item.url" [routerLink]="[item.url]" routerLinkActive="active"
<!-- item.url -->
<a class="nav-link" *ngIf="item.url && !item.function"
[routerLink]="[item.url]" routerLinkActive="active"
[routerLinkActiveOptions]="{exact: item.exactMatch || false}" matRipple>
<mat-icon class="nav-link-icon" *ngIf="item.icon">{{item.icon}}</mat-icon>
<span class="nav-link-title" [translate]="item.translate">{{item.title}}</span>
<span class="nav-link-badge" *ngIf="item.badge" [translate]="item.badge.translate"
[ngStyle]="{'background-color': item.badge.bg,'color': item.badge.fg}">
{{item.badge.title}}
</span>
<ng-container *ngTemplateOutlet="itemContent"></ng-container>
</a>
<span class="nav-link" *ngIf="item.function" (click)="item.function()" matRipple>
<!-- item.function -->
<span class="nav-link" *ngIf="!item.url && item.function" (click)="item.function()" matRipple>
<ng-container *ngTemplateOutlet="itemContent"></ng-container>
</span>
<!-- item.url && item.function -->
<a class="nav-link" *ngIf="item.url && item.function" (click)="item.function()"
[routerLink]="[item.url]" routerLinkActive="active"
[routerLinkActiveOptions]="{exact: item.exactMatch || false}" matRipple>
<ng-container *ngTemplateOutlet="itemContent"></ng-container>
</a>
<ng-template #itemContent>
<mat-icon class="nav-link-icon" *ngIf="item.icon">{{item.icon}}</mat-icon>
<span class="nav-link-title" [translate]="item.translate">{{item.title}}</span>
<span class="nav-link-badge" *ngIf="item.badge" [translate]="item.badge.translate"
[ngStyle]="{'background-color': item.badge.bg,'color': item.badge.fg}">
{{item.badge.title}}
</span>
</span>
</ng-template>
</ng-container>

View File

@@ -1,5 +1,7 @@
<div class="fuse-search-bar" [ngClass]="{'expanded':!collapsed}" fxFlex="0 1 auto">
<div [ngClass]="toolbarColor" fxLayout="row" fxLayoutAlign="start center" fxFlex>
<div class="fuse-search-bar" [ngClass]="{'expanded':!collapsed}">
<div class="fuse-search-bar-content" [ngClass]="toolbarColor">
<label for="fuse-search-bar-input">
<button mat-icon-button class="fuse-search-bar-expander" aria-label="Expand Search Bar" (click)="expand()"
*ngIf="collapsed">
@@ -10,12 +12,14 @@
</span>-->
</label>
<input id="fuse-search-bar-input" class="ml-24" type="text" placeholder="Search" (input)="search($event)" fxFlex>
<input id="fuse-search-bar-input" class="ml-24" type="text" placeholder="Search" (input)="search($event)"
fxFlex>
<button mat-icon-button class="fuse-search-bar-collapser mat-icon-button" (click)="collapse()"
<button mat-icon-button class="fuse-search-bar-collapser" (click)="collapse()"
aria-label="Collapse Search Bar">
<mat-icon class="s-24">close</mat-icon>
</button>
</div>
</div>

View File

@@ -3,6 +3,8 @@
:host {
.fuse-search-bar {
display: flex;
flex: 0 1 auto;
min-width: 64px;
height: 64px;
font-size: 13px;
@@ -11,40 +13,49 @@
height: 56px;
}
.fuse-search-bar-expander,
.fuse-search-bar-collapser {
cursor: pointer;
padding: 0 20px;
margin: 0;
width: 64px !important;
height: 64px !important;
line-height: 64px !important;
.fuse-search-bar-content {
display: flex;
flex: 1 1 auto;
align-items: center;
justify-content: flex-start;
@include media-breakpoint-down('sm') {
height: 56px !important;
line-height: 56px !important;
.fuse-search-bar-expander,
.fuse-search-bar-collapser {
cursor: pointer;
padding: 0 20px;
margin: 0;
width: 64px !important;
height: 64px !important;
line-height: 64px !important;
@include media-breakpoint-down('sm') {
height: 56px !important;
line-height: 56px !important;
}
}
}
.fuse-search-bar-loader {
width: 64px !important;
height: 64px !important;
line-height: 64px !important;
@include media-breakpoint-down('sm') {
height: 56px !important;
line-height: 56px !important;
.fuse-search-bar-loader {
width: 64px !important;
height: 64px !important;
line-height: 64px !important;
@include media-breakpoint-down('sm') {
height: 56px !important;
line-height: 56px !important;
}
}
}
.fuse-search-bar-collapser {
display: none;
}
.fuse-search-bar-collapser {
display: none;
}
#fuse-search-bar-input {
display: none;
min-height: 64px;
background-color: transparent;
font-size: 16px;
#fuse-search-bar-input {
display: none;
flex: 1 0 auto;
min-height: 64px;
background-color: transparent;
font-size: 16px;
}
}
&.expanded {
@@ -55,12 +66,15 @@
left: 0;
z-index: 10;
#fuse-search-bar-input {
display: block;
}
.fuse-search-bar-content {
.fuse-search-bar-collapser {
display: block;
#fuse-search-bar-input {
display: flex;
}
.fuse-search-bar-collapser {
display: flex;
}
}
}
}

View File

@@ -1,5 +1,5 @@
import { Component, EventEmitter, Output } from '@angular/core';
import { Subscription } from 'rxjs/Subscription';
import { Subscription } from 'rxjs';
import { FuseConfigService } from '@fuse/services/config.service';

View File

@@ -17,7 +17,7 @@
*ngFor="let shortcutItem of shortcutItems">
<a mat-icon-button matTooltip="{{shortcutItem.title}}" [routerLink]="shortcutItem.url">
<mat-icon *ngIf="shortcutItem.icon">{{shortcutItem.icon}}</mat-icon>
<mat-icon class="secondary-text" *ngIf="shortcutItem.icon">{{shortcutItem.icon}}</mat-icon>
<span *ngIf="!shortcutItem.icon" class="h2 secondary-text text-bold">
{{shortcutItem.title.substr(0, 1).toUpperCase()}}
</span>
@@ -42,46 +42,70 @@
<mat-menu #addMenu="matMenu" class="w-240">
<mat-form-field class="px-16 w-100-p" (click)="$event.stopPropagation()" floatPlaceholder="never">
<mat-form-field class="px-16 w-100-p" (click)="$event.stopPropagation()" floatLabel="never">
<input #searchInput matInput placeholder="Search for an app or a page" (input)="search($event)">
</mat-form-field>
<mat-divider></mat-divider>
<mat-nav-list *ngIf="!searching" style="max-height: 312px; overflow: auto" fusePerfectScrollbar>
<mat-list-item *ngFor="let shortcutItem of shortcutItems"
(click)="toggleShortcut($event, shortcutItem)">
<div class="w-100-p" fxLayout="row" fxLayoutAlign="start center">
<mat-icon mat-list-icon class="mr-8" *ngIf="shortcutItem.icon">{{shortcutItem.icon}}</mat-icon>
<mat-icon mat-list-icon class="mr-8 secondary-text" *ngIf="shortcutItem.icon">
{{shortcutItem.icon}}
</mat-icon>
<span class="h2 w-32 h-32 p-4 mr-8 secondary-text text-bold" fxLayout="row"
fxLayoutAlign="center center" *ngIf="!shortcutItem.icon">
{{shortcutItem.title.substr(0, 1).toUpperCase()}}
</span>
<p matLine fxFlex>{{shortcutItem.title}}</p>
<mat-icon class="ml-8">star</mat-icon>
<mat-icon class="ml-8 amber-fg">star</mat-icon>
</div>
</mat-list-item>
<mat-list-item *ngIf="shortcutItems.length === 0">
<p>
<small>No shortcuts yet!</small>
</p>
</mat-list-item>
</mat-nav-list>
<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">
<mat-icon mat-list-icon class="mr-8" *ngIf="navigationItem.icon">{{navigationItem.icon}}</mat-icon>
<mat-icon mat-list-icon class="mr-8 secondary-text" *ngIf="navigationItem.icon">
{{navigationItem.icon}}
</mat-icon>
<span class="h2 w-32 h-32 p-4 mr-8 secondary-text text-bold" fxLayout="row"
fxLayoutAlign="center center" *ngIf="!navigationItem.icon">
{{navigationItem.title.substr(0, 1).toUpperCase()}}
</span>
<p matLine fxFlex>{{navigationItem.title}}</p>
<mat-icon class="ml-8" *ngIf="isInShortcuts(navigationItem)">star</mat-icon>
<mat-icon class="ml-8 amber-fg" *ngIf="isInShortcuts(navigationItem)">star</mat-icon>
</div>
</mat-list-item>
</mat-nav-list>
</mat-menu>
</div>

View File

@@ -1,14 +1,13 @@
import { Component, ElementRef, OnDestroy, OnInit, Renderer2, ViewChild } from '@angular/core';
import { Subscription } from 'rxjs/Subscription';
import { Component, ElementRef, Input, OnDestroy, OnInit, Renderer2, ViewChild } from '@angular/core';
import { ObservableMedia } from '@angular/flex-layout';
import { Subscription } from 'rxjs';
import { CookieService } from 'ngx-cookie-service';
import { FuseMatchMediaService } from '@fuse/services/match-media.service';
import { FuseNavigationService } from '@fuse/components/navigation/navigation.service';
import { FuseConfigService } from '@fuse/services/config.service';
import { navigation } from 'app/navigation/navigation';
@Component({
selector : 'fuse-shortcuts',
templateUrl: './shortcuts.component.html',
@@ -25,6 +24,8 @@ export class FuseShortcutsComponent implements OnInit, OnDestroy
matchMediaSubscription: Subscription;
onConfigChanged: Subscription;
@Input() navigation: any;
@ViewChild('searchInput') searchInputField;
@ViewChild('shortcuts') shortcutsEl: ElementRef;
@@ -37,8 +38,6 @@ export class FuseShortcutsComponent implements OnInit, OnDestroy
private cookieService: CookieService
)
{
this.filteredNavigationItems = this.navigationItems = this.fuseNavigationService.getFlatNavigation(navigation);
this.onConfigChanged =
this.fuseConfig.onConfigChanged
.subscribe(
@@ -50,6 +49,9 @@ export class FuseShortcutsComponent implements OnInit, OnDestroy
ngOnInit()
{
// Get the navigation items and flatten them
this.filteredNavigationItems = this.navigationItems = this.fuseNavigationService.getFlatNavigation(this.navigation);
const cookieExists = this.cookieService.check('FUSE2.shortcuts');
if ( cookieExists )

View File

@@ -5,7 +5,8 @@ fuse-sidebar {
position: absolute;
top: 0;
bottom: 0;
overflow: hidden;
overflow-x: hidden;
overflow-y: auto;
width: 280px;
min-width: 280px;
max-width: 280px;

View File

@@ -1,11 +1,11 @@
import { Component, ElementRef, HostBinding, HostListener, Inject, Input, OnDestroy, OnInit, Renderer2, ViewEncapsulation } from '@angular/core';
import { Component, ElementRef, HostBinding, HostListener, Input, OnDestroy, OnInit, Renderer2, ViewEncapsulation } from '@angular/core';
import { animate, AnimationBuilder, AnimationPlayer, style } from '@angular/animations';
import { ObservableMedia } from '@angular/flex-layout';
import { Subscription } from 'rxjs/Subscription';
import { Subscription } from 'rxjs';
import { FuseSidebarService } from './sidebar.service';
import { FuseMatchMediaService } from '@fuse/services/match-media.service';
import { DOCUMENT } from '@angular/common';
import { FuseConfigService } from '@fuse/services/config.service';
@Component({
selector : 'fuse-sidebar',
@@ -21,7 +21,7 @@ export class FuseSidebarComponent implements OnInit, OnDestroy
// Align
@Input()
align: string;
align: 'left' | 'right';
// Open
@HostBinding('class.open')
@@ -38,21 +38,57 @@ export class FuseSidebarComponent implements OnInit, OnDestroy
// Folded
@HostBinding('class.folded')
@Input()
set folded(value)
set folded(value: boolean)
{
// Only work if the sidebar is not closed
if ( !this.opened )
{
return;
}
// Set the folded
this._folded = value;
if ( value )
// Programmatically add/remove margin to the element
// that comes after or before based on the alignment
let sibling,
styleRule;
const styleValue = '64px';
// Get the sibling and set the style rule
if ( this.align === 'left' )
{
this.fold();
sibling = this.elementRef.nativeElement.nextElementSibling;
styleRule = 'marginLeft';
}
else
{
this.unfold();
sibling = this.elementRef.nativeElement.previousElementSibling;
styleRule = 'marginRight';
}
// If there is no sibling, return...
if ( !sibling )
{
return;
}
// If folded...
if ( value )
{
// Set the style
this.renderer.setStyle(sibling, styleRule, styleValue);
}
// If unfolded...
else
{
// Remove the style
this.renderer.removeStyle(sibling, styleRule);
}
}
get folded()
get folded(): boolean
{
return this._folded;
}
@@ -62,31 +98,31 @@ export class FuseSidebarComponent implements OnInit, OnDestroy
unfolded: boolean;
// Private
private _folded = false;
private _folded: boolean;
private _wasActive: boolean;
private _backdrop: HTMLElement | null = null;
private _player: AnimationPlayer;
private _matchMediaWatcher: Subscription;
private _onMediaChangeSubscription: Subscription;
/**
* Constructor
*
* @param renderer
* @param elementRef
* @param animationBuilder
* @param sidebarService
* @param matchMedia
* @param media
* @param document
* @param {Renderer2} renderer
* @param {ElementRef} elementRef
* @param {AnimationBuilder} animationBuilder
* @param {ObservableMedia} observableMedia
* @param {FuseConfigService} fuseConfigService
* @param {FuseSidebarService} fuseSidebarService
* @param {FuseMatchMediaService} fuseMatchMediaService
*/
constructor(
private renderer: Renderer2,
private elementRef: ElementRef,
private animationBuilder: AnimationBuilder,
private sidebarService: FuseSidebarService,
private matchMedia: FuseMatchMediaService,
private media: ObservableMedia,
@Inject(DOCUMENT) private document: any
private observableMedia: ObservableMedia,
private fuseConfigService: FuseConfigService,
private fuseSidebarService: FuseSidebarService,
private fuseMatchMediaService: FuseMatchMediaService
)
{
// Set the defaults
@@ -101,7 +137,7 @@ export class FuseSidebarComponent implements OnInit, OnDestroy
ngOnInit(): void
{
// Register the sidebar
this.sidebarService.register(this.name, this);
this.fuseSidebarService.register(this.name, this);
// Setup alignment
this._setupAlignment();
@@ -115,27 +151,35 @@ export class FuseSidebarComponent implements OnInit, OnDestroy
*/
ngOnDestroy(): void
{
// Unregister the sidebar
this.sidebarService.unregister(this.name);
// If the sidebar is folded, unfold it to revert modifications
if ( this.folded )
{
this.unfold();
}
// Unregister the media watcher
this._matchMediaWatcher.unsubscribe();
// Unregister the sidebar
this.fuseSidebarService.unregister(this.name);
// Unsubscribe from the media watcher subscription
this._onMediaChangeSubscription.unsubscribe();
}
/**
* Setup the alignment
* Set the sidebar alignment
*
* @private
*/
private _setupAlignment(): void
{
if ( this.align === 'left' )
// Add the correct class name to the sidebar
// element depending on the align attribute
if ( this.align === 'right' )
{
this.renderer.addClass(this.elementRef.nativeElement, 'left-aligned');
this.renderer.addClass(this.elementRef.nativeElement, 'right-aligned');
}
else
{
this.renderer.addClass(this.elementRef.nativeElement, 'right-aligned');
this.renderer.addClass(this.elementRef.nativeElement, 'left-aligned');
}
}
@@ -156,12 +200,12 @@ export class FuseSidebarComponent implements OnInit, OnDestroy
this._wasActive = false;
// Act on every media change
this._matchMediaWatcher =
this._onMediaChangeSubscription =
this.matchMedia.onMediaChange.subscribe(() => {
this.fuseMatchMediaService.onMediaChange.subscribe(() => {
// Get the active status
const isActive = this.media.isActive(this.lockedOpen);
const isActive = this.observableMedia.isActive(this.lockedOpen);
// If the both status are the same, don't act
if ( this._wasActive === isActive )
@@ -169,14 +213,24 @@ export class FuseSidebarComponent implements OnInit, OnDestroy
return;
}
// Store the new active status
this._wasActive = isActive;
// Activate the lockedOpen
if ( isActive )
{
// Set the lockedOpen status
this.isLockedOpen = true;
// Force the the opened status to true
this.opened = true;
// Read the folded setting from the config
// and fold the sidebar if it's true
if ( this.fuseConfigService.config.layout.navigationFolded )
{
this.fold();
}
// Hide the backdrop if any exists
this.hideBackdrop();
}
// De-Activate the lockedOpen
else
@@ -186,7 +240,13 @@ export class FuseSidebarComponent implements OnInit, OnDestroy
// Unfold the sidebar in case if it was folded
this.unfold();
// Force the the opened status to close
this.opened = false;
}
// Store the new active status
this._wasActive = isActive;
});
}
@@ -205,9 +265,6 @@ export class FuseSidebarComponent implements OnInit, OnDestroy
// Set the opened status
this.opened = true;
// Add a css class to the body
this.renderer.addClass(this.document.body, 'fuse-sidebar-opened');
}
/**
@@ -215,7 +272,7 @@ export class FuseSidebarComponent implements OnInit, OnDestroy
*/
close(): void
{
if ( !this.opened )
if ( !this.opened || this.isLockedOpen )
{
return;
}
@@ -225,9 +282,6 @@ export class FuseSidebarComponent implements OnInit, OnDestroy
// Set the opened status
this.opened = false;
// Remove the css class from the body
this.renderer.removeClass(this.document.body, 'fuse-sidebar-opened');
}
/**
@@ -259,9 +313,6 @@ export class FuseSidebarComponent implements OnInit, OnDestroy
// Unfold the sidebar temporarily
this.unfolded = true;
// Add a css class to the body
this.renderer.addClass(this.document.body, 'fuse-sidebar-folded-unfolded');
}
/**
@@ -278,9 +329,6 @@ export class FuseSidebarComponent implements OnInit, OnDestroy
// Fold the sidebar back
this.unfolded = false;
// Remove the css class from the body
this.renderer.removeClass(this.document.body, 'fuse-sidebar-folded-unfolded');
}
/**
@@ -288,8 +336,14 @@ export class FuseSidebarComponent implements OnInit, OnDestroy
*/
fold(): void
{
// Add a css class to the body
this.renderer.addClass(this.document.body, 'fuse-sidebar-folded');
// Only work if the sidebar is not folded
if ( this.folded )
{
return;
}
// Fold
this.folded = true;
}
/**
@@ -297,8 +351,14 @@ export class FuseSidebarComponent implements OnInit, OnDestroy
*/
unfold(): void
{
// Remove the css class from the body
this.renderer.removeClass(this.document.body, 'fuse-sidebar-folded');
// Only work if the sidebar is folded
if ( !this.folded )
{
return;
}
// Unfold
this.folded = false;
}
/**
@@ -306,7 +366,14 @@ export class FuseSidebarComponent implements OnInit, OnDestroy
*/
toggleFold(): void
{
this.folded = !this.folded;
if ( this.folded )
{
this.unfold();
}
else
{
this.fold();
}
}
/**

View File

@@ -46,7 +46,7 @@ export class FuseSidebarService
// Check if the sidebar exists
if ( !this._registry[key] )
{
console.error(`The sidebar with the key '${key}' doesn't exist in the registry.`);
console.warn(`The sidebar with the key '${key}' doesn't exist in the registry.`);
}
// Unregister the sidebar
@@ -57,13 +57,14 @@ export class FuseSidebarService
* Return the sidebar with the given key
*
* @param key
* @returns {FuseSidebarComponent}
*/
getSidebar(key): any
getSidebar(key): FuseSidebarComponent
{
// Check if the sidebar exists
if ( !this._registry[key] )
{
console.error(`The sidebar with the key '${key}' doesn't exist in the registry.`);
console.warn(`The sidebar with the key '${key}' doesn't exist in the registry.`);
return;
}

View File

@@ -1,13 +1,11 @@
import { Component, ElementRef, HostBinding, OnDestroy, OnInit, Renderer2, ViewChild } from '@angular/core';
import { Component, ElementRef, HostBinding, Input, OnDestroy, OnInit, Renderer2, ViewChild } from '@angular/core';
import { style, animate, AnimationBuilder, AnimationPlayer } from '@angular/animations';
import { Subscription } from 'rxjs/Subscription';
import { Subscription } from 'rxjs';
import { fuseAnimations } from '@fuse/animations';
import { FuseConfigService } from '@fuse/services/config.service';
import { FuseNavigationService } from '@fuse/components/navigation/navigation.service';
import { navigation } from 'app/navigation/navigation';
@Component({
selector : 'fuse-theme-options',
templateUrl: './theme-options.component.html',
@@ -16,6 +14,7 @@ import { navigation } from 'app/navigation/navigation';
})
export class FuseThemeOptionsComponent implements OnInit, OnDestroy
{
@Input() navigation;
@ViewChild('openButton') openButton;
@ViewChild('panel') panel;
@ViewChild('overlay') overlay: ElementRef;
@@ -43,10 +42,17 @@ export class FuseThemeOptionsComponent implements OnInit, OnDestroy
this.config = newConfig;
}
);
}
ngOnInit()
{
this.renderer.listen(this.overlay.nativeElement, 'click', () => {
this.closeBar();
});
// Get the nav model and add customize nav item
// that opens the bar programmatically
const nav: any = navigation;
const nav: any = this.navigation;
nav.push({
'id' : 'custom-function',
@@ -66,13 +72,6 @@ export class FuseThemeOptionsComponent implements OnInit, OnDestroy
});
}
ngOnInit()
{
this.renderer.listen(this.overlay.nativeElement, 'click', () => {
this.closeBar();
});
}
ngOnDestroy()
{
this.onConfigChanged.unsubscribe();

View File

@@ -67,16 +67,16 @@ fuse-widget {
&.mat-form-field-type-mat-select {
.mat-input-wrapper {
.mat-form-field-wrapper {
padding: 16px 0;
.mat-input-infix {
.mat-form-field-infix {
border: none;
padding: 0;
}
}
.mat-input-underline {
.mat-form-field-underline {
display: none;
}
}

View File

@@ -1,7 +1,7 @@
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 { Subscription } from 'rxjs';
import { FuseMatchMediaService } from '@fuse/services/match-media.service';
import { FuseMatSidenavHelperService } from '@fuse/directives/fuse-mat-sidenav/fuse-mat-sidenav.service';

View File

@@ -1,6 +1,6 @@
import { AfterViewInit, Directive, ElementRef, HostListener, OnDestroy, OnInit } from '@angular/core';
import { Platform } from '@angular/cdk/platform';
import { Subscription } from 'rxjs/Subscription';
import { Subscription } from 'rxjs';
import PerfectScrollbar from 'perfect-scrollbar';

View File

@@ -1,3 +1,6 @@
// This file meant to be imported only once! Use fuse.scss to access
// to the core Fuse and Angular Material mixins
// ngx-datatable
@import '~@swimlane/ngx-datatable/release/themes/material';
@@ -7,10 +10,13 @@
// Fuse
@import "fuse";
// Theming
// Include core Angular Material styles
@include mat-core();
// Include theme styles for core and each component used in your app.
// Setup the typography
@include angular-material-typography($typography);
// Create an Angular Material theme from the $theme map
@include angular-material-theme($theme);
// Partials

View File

@@ -1,4 +1,5 @@
// Variables
@import "variables/theme";
// Mixins
// Material theming
@import "theming";
// Breakpoint mixins
@import "mixins/breakpoints";

View File

@@ -7,7 +7,7 @@
}
// Fix: "Inconsistent font sizes across elements"
.mat-input-wrapper {
.mat-form-field-wrapper {
font-size: 16px;
}
@@ -34,7 +34,7 @@
&.mat-form-field-type-mat-select {
.mat-input-infix {
.mat-form-field-infix {
display: inline-flex;
width: auto;
@@ -57,7 +57,7 @@
}
}
// Fix: "Stepper icons are broken due to Fuse's icon helpers"
// Fix: Stepper icons are broken due to Fuse's icon helpers
mat-horizontal-stepper,
mat-vertical-stepper {
@@ -68,11 +68,20 @@ mat-vertical-stepper {
width: 16px !important;
min-width: 0 !important;
min-height: 0 !important;
color: rgba(255, 255, 255, 0.87) !important;
color: inherit !important;
}
}
}
mat-vertical-stepper {
padding: 16px 0;
}
// Fix: Chip remove icon is broken due to Fuse's icon helpers
mat-chip {
mat-icon {
min-width: 0 !important;
min-height: 0 !important;
}
}

View File

@@ -1,6 +1,6 @@
.secondary-text,
.mat-icon,
.icon {
.icon,
i {
color: rgba(0, 0, 0, 0.54);
}
@@ -51,7 +51,7 @@ $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)) {
.mat-icon,
i,
.icon {
color: rgba(0, 0, 0, 0.54);
}
@@ -81,7 +81,7 @@ $matColorHues: 50, 100, 200, 300, 400, 500, 600, 700, 800, 900, A100, A200, A400
// If the base text color is white...
@else {
.mat-icon,
i,
.icon {
color: rgba(255, 255, 255, 1);
}
@@ -135,11 +135,11 @@ $matColorHues: 50, 100, 200, 300, 400, 500, 600, 700, 800, 900, A100, A200, A400
}
// Input
.mat-input-placeholder {
.mat-form-field-label {
color: map_get($fuseForeground, hint-text);
}
.mat-input-underline {
.mat-form-field-underline {
background-color: map_get($fuseForeground, divider);
}

View File

@@ -1,6 +1,5 @@
i,
mat-icon {
color: rgba(0, 0, 0, 0.54);
font-size: 24px;
width: 24px;
height: 24px;

View File

@@ -28,7 +28,7 @@ html, body {
}
// Reset non angular-material input's default browser/os styles
*:not(mat-input-container) {
*:not(mat-form-field) {
> input {
border: none;
@@ -55,7 +55,7 @@ html, body {
}
}
*:not(mat-input-container) {
*:not(mat-form-field) {
> input[type="button"],
> button,

View File

@@ -1,5 +1,6 @@
@import '~@angular/material/theming';
// Custom color maps
$mat-white: (
500: white,
contrast: (
@@ -47,13 +48,19 @@ $mat-fusedark: (
)
);
// Palettes
// Define the Material palettes
$primary: mat-palette($mat-fusedark);
$accent: mat-palette($mat-light-blue, 600, 400, 700);
$warn: mat-palette($mat-red);
// Create the theme object (a Sass map containing all of the palettes).
// Create the Material theme object
$theme: mat-light-theme($primary, $accent, $warn);
// Store the background and foreground colors for easier access
$background: map-get($theme, background);
$foreground: map-get($theme, foreground);
// Force the input field font sizes to 16px
$typography: mat-typography-config(
$input: mat-typography-level(16px, 1.125, 400)
)

View File

@@ -1,25 +1,9 @@
import { Inject, Injectable, InjectionToken, Optional } from '@angular/core';
import { NavigationStart, Router } from '@angular/router';
import { BehaviorSubject } from 'rxjs/BehaviorSubject';
import { Inject, Injectable, InjectionToken } from '@angular/core';
import { NavigationEnd, NavigationStart, Router } from '@angular/router';
import { Platform } from '@angular/cdk/platform';
import { BehaviorSubject } from 'rxjs';
// Define the default config
const DEFAULT_CONFIG = {
layout : {
navigation : 'left', // 'right', 'left', 'top', 'none'
navigationFolded: false, // true, false
toolbar : 'below', // 'above', 'below', 'none'
footer : 'below', // 'above', 'below', 'none'
mode : 'fullwidth' // 'boxed', 'fullwidth'
},
colorClasses : {
toolbar: 'mat-white-500-bg',
navbar : 'mat-fuse-dark-700-bg',
footer : 'mat-fuse-dark-900-bg'
},
customScrollbars: true,
routerAnimation : 'fadeIn' // fadeIn, slideUp, slideDown, slideRight, slideLeft, none
};
import * as _ from 'lodash';
// Create the injection token for the custom config
export const FUSE_CONFIG = new InjectionToken('fuseCustomConfig');
@@ -29,6 +13,7 @@ export class FuseConfigService
{
config: any;
defaultConfig: any;
isSetConfigRan = false;
onConfigChanged: BehaviorSubject<any>;
@@ -42,18 +27,11 @@ export class FuseConfigService
constructor(
private router: Router,
public platform: Platform,
@Inject(FUSE_CONFIG) @Optional() config
@Inject(FUSE_CONFIG) config
)
{
// Set the default settings from the constant
this.defaultConfig = DEFAULT_CONFIG;
// If custom config provided with forRoot,
// use them as default config...
if ( config )
{
this.defaultConfig = config;
}
// Set the default config from the user provided one (forRoot)
this.defaultConfig = config;
/**
* Disable Custom Scrollbars if Browser is Mobile
@@ -64,14 +42,25 @@ export class FuseConfigService
}
// Set the config from the default config
this.config = {...this.defaultConfig};
this.config = _.cloneDeep(this.defaultConfig);
// Reload the default settings for the
// layout on every navigation start
router.events.subscribe(
(event) => {
if ( event instanceof NavigationStart )
{
this.isSetConfigRan = false;
}
if ( event instanceof NavigationEnd )
{
if ( this.isSetConfigRan )
{
return;
}
this.setConfig({
layout: this.defaultConfig.layout
}
@@ -91,20 +80,11 @@ export class FuseConfigService
*/
setConfig(config): void
{
// Set the config from the given object
// Ugly, but works for now...
this.config = {
...this.config,
...config,
layout : {
...this.config.layout,
...config.layout,
},
colorClasses: {
...this.config.colorClasses,
...config.colorClasses
}
};
// Set the SetConfigRan true
this.isSetConfigRan = true;
// Merge the config
this.config = _.merge({}, this.config, config);
// Trigger the event
this.onConfigChanged.next(this.config);

View File

@@ -1,6 +1,6 @@
import { MediaChange, ObservableMedia } from '@angular/flex-layout';
import { Injectable } from '@angular/core';
import { BehaviorSubject } from 'rxjs/BehaviorSubject';
import { BehaviorSubject } from 'rxjs';
@Injectable()
export class FuseMatchMediaService

View File

@@ -442,13 +442,15 @@ export class MailFakeDb
'id' : 0,
'handle': 'starred',
'title' : 'Starred',
'icon' : 'star'
'icon' : 'star',
'color' : 'amber-fg'
},
{
'id' : 1,
'handle': 'important',
'title' : 'Important',
'icon' : 'label'
'icon' : 'label',
'color' : 'red-fg'
}
];

View File

@@ -1,9 +1,7 @@
import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { ActivatedRouteSnapshot, Resolve, RouterStateSnapshot } from '@angular/router';
import { Observable } from 'rxjs/Observable';
import { BehaviorSubject } from 'rxjs/BehaviorSubject';
import { BehaviorSubject, Observable } from 'rxjs';
@Injectable()
export class AcademyCourseService implements Resolve<any>

View File

@@ -3,7 +3,7 @@
<mat-sidenav-container>
<!-- SIDENAV -->
<mat-sidenav class="sidenav" align="start" opened="true" mode="side"
<mat-sidenav class="sidenav" position="start" opened="true" mode="side"
fuseMatSidenavHelper="academy-left-sidenav" mat-is-locked-open="gt-md">
<div class="sidenav-content" fusePerfectScrollbar>
@@ -33,12 +33,12 @@
<!-- HEADER -->
<div class="header mat-accent-bg p-24" fxLayout="row" fxLayoutAlign="start center">
<button mat-button class="mat-icon-button mr-16 sidenav-toggle"
<button mat-icon-button class="mr-16 sidenav-toggle"
fuseMatSidenavToggler="academy-left-sidenav" fxHide.gt-md>
<mat-icon>menu</mat-icon>
</button>
<button mat-button class="mat-icon-button mr-16" [routerLink]="'/apps/academy/courses'">
<button mat-icon-button class="mr-16" [routerLink]="'/apps/academy/courses'">
<mat-icon>arrow_back</mat-icon>
</button>

View File

@@ -1,5 +1,5 @@
import { AfterViewInit, ChangeDetectorRef, Component, OnDestroy, OnInit, QueryList, ViewChildren, ViewEncapsulation } from '@angular/core';
import { Subscription } from 'rxjs/Subscription';
import { Subscription } from 'rxjs';
import { FusePerfectScrollbarDirective } from '@fuse/directives/fuse-perfect-scrollbar/fuse-perfect-scrollbar.directive';
import { fuseAnimations } from '@fuse/animations';

View File

@@ -1,9 +1,7 @@
import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { ActivatedRouteSnapshot, Resolve, RouterStateSnapshot } from '@angular/router';
import { Observable } from 'rxjs/Observable';
import { BehaviorSubject } from 'rxjs/BehaviorSubject';
import { BehaviorSubject, Observable } from 'rxjs';
@Injectable()
export class AcademyCoursesService implements Resolve<any>

View File

@@ -33,7 +33,7 @@
<mat-form-field class="category-selector">
<mat-select placeholder="Select Category" [(ngModel)]="currentCategory"
(change)="filterCoursesByCategory()">
(selectionChange)="filterCoursesByCategory()">
<mat-option [value]="'all'">
All
</mat-option>
@@ -46,10 +46,11 @@
</div>
<div class="courses" fxLayout="row wrap" fxLayoutAlign="center">
<div class="courses" fxLayout="row wrap" fxLayoutAlign="center" [@animateStagger]="{value:'50'}"
*fuseIfOnDom>
<div class="course" *ngFor="let course of filteredCourses" fxFlex="100" fxFlex.gt-xs="50"
fxFlex.gt-sm="33" [ngClass]="course.category">
fxFlex.gt-sm="33" [ngClass]="course.category" [@animate]="{value:'*',params:{y:'100%'}}">
<div class="course-content" fxLayout="column">

View File

@@ -1,12 +1,15 @@
import { Component, OnDestroy, OnInit } from '@angular/core';
import { Subscription } from 'rxjs/Subscription';
import { Subscription } from 'rxjs';
import { fuseAnimations } from '@fuse/animations';
import { AcademyCoursesService } from '../courses.service';
@Component({
selector : 'fuse-academy-courses',
templateUrl: './courses.component.html',
styleUrls : ['./courses.component.scss']
styleUrls : ['./courses.component.scss'],
animations : fuseAnimations
})
export class FuseAcademyCoursesComponent implements OnInit, OnDestroy
{

View File

@@ -15,31 +15,27 @@
<!-- TOOLBAR -->
<div class="toolbar" fxLayout="row" fxLayoutAlign="start center">
<button mat-button class="mat-icon-button" aria-label="Search" matTooltip="Search">
<button mat-icon-button aria-label="Search" matTooltip="Search">
<mat-icon>search</mat-icon>
</button>
<button mat-button class="mat-icon-button"
<button mat-icon-button
mwlCalendarToday
[(viewDate)]="viewDate"
(viewDateChange)="selectedDay = {date:$event}"
aria-label="Today" matTooltip="Today">
<!--(click)="selectedDay = viewDate"-->
<mat-icon>today</mat-icon>
</button>
<button mat-button class="mat-icon-button" (click)="view='day'"
aria-label="Day" matTooltip="Day">
<button mat-icon-button (click)="view='day'" aria-label="Day" matTooltip="Day">
<mat-icon>view_day</mat-icon>
</button>
<button mat-button class="mat-icon-button" (click)="view='week'"
aria-label="Week" matTooltip="Week">
<button mat-icon-button (click)="view='week'" aria-label="Week" matTooltip="Week">
<mat-icon>view_week</mat-icon>
</button>
<button mat-button class="mat-icon-button" (click)="view='month'"
aria-label="Month" matTooltip="Month">
<button mat-icon-button (click)="view='month'" aria-label="Month" matTooltip="Month">
<mat-icon>view_module</mat-icon>
</button>
</div>
@@ -50,7 +46,7 @@
<div class="header-bottom" fxLayout="row" fxLayoutAlign="center center"
*fuseIfOnDom [@animate]="{value:'*',params:{delay:'150ms'}}">
<button mat-button class="mat-icon-button arrow"
<button mat-icon-button class="arrow"
mwlCalendarPreviousView
[view]="view"
[(viewDate)]="viewDate"
@@ -63,7 +59,7 @@
{{ viewDate | calendarDate:(view + 'ViewTitle'):'en' }}
</div>
<button mat-button class="mat-icon-button arrow"
<button mat-icon-button class="arrow"
mwlCalendarNextView
[view]="view"
[(viewDate)]="viewDate"

View File

@@ -1,9 +1,8 @@
import { Component, OnInit, ViewEncapsulation } from '@angular/core';
import { FormGroup } from '@angular/forms';
import { Subject } from 'rxjs/Subject';
import { MatDialog, MatDialogRef } from '@angular/material';
import { Subject } from 'rxjs';
import { startOfDay, isSameDay, isSameMonth } from 'date-fns';
import { CalendarEvent, CalendarEventAction, CalendarEventTimesChangedEvent, CalendarMonthViewDay } from 'angular-calendar';
import { FuseConfirmDialogComponent } from '@fuse/components/confirm-dialog/confirm-dialog.component';

View File

@@ -1,9 +1,7 @@
import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { ActivatedRouteSnapshot, Resolve, RouterStateSnapshot } from '@angular/router';
import { Observable } from 'rxjs/Observable';
import { Subject } from 'rxjs/Subject';
import { Observable, Subject } from 'rxjs';
@Injectable()
export class CalendarService implements Resolve<any>

View File

@@ -1,13 +1,11 @@
<div class="dialog-content-wrapper">
<mat-toolbar matDialogTitle class="mat-accent m-0">
<div fxFlex fxLayout="row" fxLayoutAlign="space-between center">
<mat-toolbar class="mat-accent m-0">
<mat-toolbar-row fxFlex fxLayout="row" fxLayoutAlign="space-between center">
<span class="title dialog-title">{{dialogTitle}}</span>
<button mat-button class="mat-icon-button"
(click)="dialogRef.close()"
aria-label="Close dialog">
<button mat-icon-button (click)="dialogRef.close()" aria-label="Close dialog">
<mat-icon>close</mat-icon>
</button>
</div>
</mat-toolbar-row>
</mat-toolbar>
<div mat-dialog-content class="p-24 m-0" fusePerfectScrollbar>
@@ -136,8 +134,7 @@
</button>
<button *ngIf="action ==='edit'"
mat-button
class="mat-icon-button"
mat-icon-button
(click)="dialogRef.close(['delete',eventForm])"
aria-label="Delete"
matTooltip="Delete">

View File

@@ -9,11 +9,11 @@
<div fxLayout="row" fxLayoutAlign="start center">
<!-- RESPONSIVE CHATS BUTTON-->
<div mat-button fxHide.gt-md class="responsive-chats-button mat-icon-button mr-16"
fuseMatSidenavToggler="chat-left-sidenav"
aria-label="chats button">
<mat-icon class="s-36">chat</mat-icon>
</div>
<button mat-icon-button fxHide.gt-md class="responsive-chats-button mr-16"
fuseMatSidenavToggler="chat-left-sidenav"
aria-label="chats button">
<mat-icon>chat</mat-icon>
</button>
<!-- / RESPONSIVE CHATS BUTTON-->
<!-- CHAT CONTACT-->
@@ -40,8 +40,7 @@
</div>
<div>
<button mat-button class="mat-icon-button" [matMenuTriggerFor]="contactMenu"
aria-label="more">
<button mat-icon-button [matMenuTriggerFor]="contactMenu" aria-label="more">
<mat-icon>more_vert</mat-icon>
</button>
@@ -98,7 +97,7 @@
fxLayout="row"
fxLayoutAlign="start center">
<mat-form-field class="" fxFlex floatPlaceholder="never">
<mat-form-field class="" fxFlex floatLabel="never">
<textarea matInput #replyInput placeholder="Type and hit enter to send message"
ngModel name="message"></textarea>
</mat-form-field>

View File

@@ -13,7 +13,7 @@
<mat-sidenav-container>
<!-- LEFT SIDENAV -->
<mat-sidenav class="sidenav" align="start" opened="true" mode="side"
<mat-sidenav class="sidenav" position="start" opened="true" mode="side"
fuseMatSidenavHelper="chat-left-sidenav" mat-is-locked-open="gt-md">
<fuse-chat-left-sidenav></fuse-chat-left-sidenav>
</mat-sidenav>
@@ -26,7 +26,7 @@
<!-- / CONTENT -->
<!-- RIGHT SIDENAV -->
<mat-sidenav class="sidenav" align="end" opened="false" mode="over"
<mat-sidenav class="sidenav" position="end" opened="false" mode="over"
fuseMatSidenavHelper="chat-right-sidenav">
<fuse-chat-right-sidenav></fuse-chat-right-sidenav>
</mat-sidenav>

View File

@@ -1,10 +1,7 @@
import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { ActivatedRouteSnapshot, Resolve, RouterStateSnapshot } from '@angular/router';
import { Observable } from 'rxjs/Observable';
import { Subject } from 'rxjs/Subject';
import { BehaviorSubject } from 'rxjs/BehaviorSubject';
import { BehaviorSubject, Observable, Subject } from 'rxjs';
import { FuseUtils } from '@fuse/utils';

View File

@@ -56,7 +56,7 @@
<!-- / USER AVATAR -->
<div>
<button mat-button class="mat-icon-button"
<button mat-icon-button
[matMenuTriggerFor]="userMenu"
aria-label="more">
<mat-icon>more_vert</mat-icon>

View File

@@ -7,7 +7,7 @@
<!-- TOOLBAR TOP -->
<mat-toolbar-row fxLayout="row" fxLayoutAlign="space-between center">
<button mat-button class="mat-icon-button" (click)="changeLeftSidenavView('chats')" aria-label="back">
<button mat-icon-button (click)="changeLeftSidenavView('chats')" aria-label="back">
<mat-icon>arrow_back</mat-icon>
</button>

View File

@@ -1,7 +1,6 @@
import { Component, OnDestroy, OnInit } from '@angular/core';
import { FormControl, FormGroup } from '@angular/forms';
import 'rxjs/add/operator/debounceTime';
import 'rxjs/add/operator/distinctUntilChanged';
import { debounceTime, distinctUntilChanged } from 'rxjs/operators';
import { ChatService } from '../../../chat.service';
@@ -27,14 +26,14 @@ export class FuseChatUserSidenavComponent implements OnInit, OnDestroy
ngOnInit()
{
this.onFormChange = this.userForm.valueChanges
.debounceTime(500)
.distinctUntilChanged()
.subscribe(data => {
this.user.mood = data.mood;
this.user.status = data.status;
this.chatService.updateUserData(this.user);
});
this.onFormChange = this.userForm.valueChanges.pipe(
debounceTime(500),
distinctUntilChanged()
).subscribe(data => {
this.user.mood = data.mood;
this.user.status = data.status;
this.chatService.updateUserData(this.user);
});
}
changeLeftSidenavView(view)

View File

@@ -9,7 +9,7 @@
<div>Contact Info</div>
<button mat-button class="mat-icon-button" fuseMatSidenavToggler="chat-right-sidenav" aria-label="close">
<button mat-icon-button fuseMatSidenavToggler="chat-right-sidenav" aria-label="close">
<mat-icon>close</mat-icon>
</button>
@@ -36,7 +36,7 @@
<!-- CONTACT MOOD -->
<mat-card>
<mat-form-field fxFlex>
<mat-form-field class="w-100-p">
<textarea matInput placeholder="Mood" name="mood"
[value]="contact.mood" rows="3" disabled>
</textarea>

View File

@@ -2,17 +2,15 @@
<mat-toolbar matDialogTitle class="mat-accent m-0">
<mat-toolbar-row fxLayout="row" fxLayoutAlign="space-between center">
<span class="title dialog-title">{{dialogTitle}}</span>
<button mat-button class="mat-icon-button"
(click)="dialogRef.close()"
aria-label="Close dialog">
<button mat-icon-button (click)="dialogRef.close()" aria-label="Close dialog">
<mat-icon>close</mat-icon>
</button>
</mat-toolbar-row>
<mat-toolbar-row class="toolbar-bottom py-8 py-sm-16" fxLayout="column" fxLayoutAlign="center center">
<img [src]="contact.avatar" class=" avatar contact-avatar huge"
<mat-toolbar-row class="toolbar-bottom py-16" fxLayout="column" fxLayoutAlign="center center">
<img [src]="contact.avatar" class="avatar contact-avatar huge m-0"
[alt]="contact.name"/>
<div class="contact-name">{{contact.name}}</div>
<div class="contact-name mt-8">{{contact.name}} {{contact.lastName}}</div>
</mat-toolbar-row>
</mat-toolbar>
@@ -21,56 +19,57 @@
<form [formGroup]="contactForm">
<div class="mb-24" fxLayout="row" fxLayoutAlign="start start">
<mat-icon class="mr-12 mt-12">account_circle</mat-icon>
<mat-form-field fxFlex>
<mat-icon matPrefix class="mr-12 s-20 secondary-text">account_circle</mat-icon>
<input name="name" formControlName="name" placeholder="Name" matInput required>
</mat-form-field>
</div>
<div class="mb-24" fxLayout="row" fxLayoutAlign="start start">
<mat-icon class="mr-12 mt-12"></mat-icon>
<mat-form-field fxFlex>
<mat-icon matPrefix class="mr-12 s-20 secondary-text">account_circle</mat-icon>
<input name="lastName" formControlName="lastName" placeholder="Lastname" matInput>
</mat-form-field>
</div>
<div class="mb-24" fxLayout="row" fxLayoutAlign="start start">
<mat-icon class="mr-12 mt-12">star</mat-icon>
<mat-form-field fxFlex>
<mat-icon matPrefix class="mr-12 s-20 secondary-text">star</mat-icon>
<input name="nickname" formControlName="nickname" matInput placeholder="Nickname">
</mat-form-field>
</div>
<div class="mb-24" fxLayout="row" fxLayoutAlign="start start">
<mat-icon class="mr-12 mt-12">phone</mat-icon>
<mat-form-field fxFlex>
<mat-icon matPrefix class="mr-12 s-20 secondary-text">phone</mat-icon>
<input formControlName="phone" matInput placeholder="Phone number">
</mat-form-field>
</div>
<div class="mb-24" fxLayout="row" fxLayoutAlign="start start">
<mat-icon class="mr-12 mt-12">email</mat-icon>
<mat-form-field fxFlex>
<mat-icon matPrefix class="mr-12 s-20 secondary-text">email</mat-icon>
<input name="email" formControlName="email" matInput type="email" placeholder="Email">
</mat-form-field>
</div>
<div class="mb-24" fxLayout="row" fxLayoutAlign="start start">
<mat-icon class="mr-12 mt-12">domain</mat-icon>
<mat-form-field fxFlex>
<mat-icon matPrefix class="mr-12 s-20 secondary-text">domain</mat-icon>
<input name="company" formControlName="company" matInput placeholder="Company">
</mat-form-field>
</div>
<div class="mb-24" fxLayout="row" fxLayoutAlign="start start">
<mat-icon class="mr-12 mt-12">work</mat-icon>
<mat-form-field fxFlex>
<mat-icon matPrefix class="mr-12 s-20 secondary-text">work</mat-icon>
<input name="jobTitle" formControlName="jobTitle" matInput placeholder="Job title">
</mat-form-field>
</div>
<div class="mb-24" fxLayout="row" fxLayoutAlign="start start">
<mat-form-field class="mr-24" fxFlex>
<mat-icon matPrefix class="mr-12 s-20 secondary-text">cake</mat-icon>
<input matInput [matDatepicker]="birthdayDatePicker" placeholder="Birthday">
<mat-datepicker-toggle matSuffix [for]="birthdayDatePicker"></mat-datepicker-toggle>
<mat-datepicker #birthdayDatePicker></mat-datepicker>
@@ -78,16 +77,16 @@
</div>
<div class="mb-24" fxLayout="row" fxLayoutAlign="start start">
<mat-icon class="mr-12 mt-12">home</mat-icon>
<mat-form-field fxFlex>
<mat-icon matPrefix class="mr-12 s-20 secondary-text">home</mat-icon>
<input name="address" formControlName="address" matInput placeholder="Address">
</mat-form-field>
</div>
<div fxLayout="row" class="textarea-wrapper" fxLayoutAlign="start start">
<mat-icon class="mr-12 mt-12">note</mat-icon>
<mat-form-field fxFlex>
<textarea name="notes" formControlName="notes" placeholder="Notes" matInput type="text" max-rows="4"></textarea>
<textarea name="notes" formControlName="notes" placeholder="Notes" matInput type="text"
max-rows="4"></textarea>
</mat-form-field>
</div>
@@ -116,8 +115,7 @@
</button>
<button *ngIf="action ==='edit'"
mat-button
class="mat-icon-button"
mat-icon-button
(click)="dialogRef.close(['delete',contactForm])"
aria-label="Delete"
matTooltip="Delete">

View File

@@ -12,9 +12,9 @@
.mat-dialog-container {
padding: 0;
overflow: hidden;
.mat-toolbar {
flex: 1 0 auto;
min-height: initial;
}

View File

@@ -73,13 +73,13 @@
<mat-cell *cdkCellDef="let contact">
<div fxFlex="row" fxLayoutAlign="end center">
<button mat-icon-button (click)="$event.stopPropagation();toggleStar(contact.id)" aria-label="Toggle star">
<mat-icon *ngIf="user.starred.includes(contact.id)">star</mat-icon>
<mat-icon *ngIf="!user.starred.includes(contact.id)">star_outline</mat-icon>
<mat-icon class="amber-fg" *ngIf="user.starred.includes(contact.id)">star</mat-icon>
<mat-icon class="secondary-text" *ngIf="!user.starred.includes(contact.id)">star_outline</mat-icon>
</button>
<button mat-icon-button [matMenuTriggerFor]="moreMenu" aria-label="More"
(click)="$event.stopPropagation();">
<mat-icon>more_vert</mat-icon>
<mat-icon class="secondary-text">more_vert</mat-icon>
</button>
<mat-menu #moreMenu="matMenu">

View File

@@ -1,18 +1,18 @@
@import "src/@fuse/scss/fuse";
fuse-contacts-contact-list {
flex: 1;
display: flex;
flex: 1 1 auto;
width: 100%;
.mat-table {
width: 100%;
background: transparent;
box-shadow: none;
.mat-column-checkbox {
flex: 0 1 48px;
.mat-checkbox-ripple {
display: none !important; //fix for broken rendering
}
flex: 0 1 64px;
padding-left: 18px;
}
.mat-column-avatar {
@@ -26,7 +26,7 @@ fuse-contacts-contact-list {
.mat-row {
position: relative;
cursor: pointer;
padding: 8px 8px 8px 24px;
padding: 8px;
.mat-cell {
min-width: 0;
@@ -34,6 +34,7 @@ fuse-contacts-contact-list {
&.mat-column-detail-button {
flex: 0 1 auto;
padding: 0 24px 0 0;
@include media-breakpoint('gt-md') {
display: none;
}

View File

@@ -2,8 +2,7 @@ import { Component, OnDestroy, OnInit, TemplateRef, ViewChild, ViewEncapsulation
import { FormGroup } from '@angular/forms';
import { MatDialog, MatDialogRef } from '@angular/material';
import { DataSource } from '@angular/cdk/collections';
import { Subscription } from 'rxjs/Subscription';
import { Observable } from 'rxjs/Observable';
import { Observable, Subscription } from 'rxjs';
import { fuseAnimations } from '@fuse/animations';
import { FuseConfirmDialogComponent } from '@fuse/components/confirm-dialog/confirm-dialog.component';
@@ -30,6 +29,7 @@ export class FuseContactsContactListComponent implements OnInit, OnDestroy
checkboxes: {};
onContactsChangedSubscription: Subscription;
onFilterChangedSubscription: Subscription;
onSelectedContactsChangedSubscription: Subscription;
onUserDataChangedSubscription: Subscription;
@@ -72,6 +72,10 @@ export class FuseContactsContactListComponent implements OnInit, OnDestroy
this.user = user;
});
this.onFilterChangedSubscription =
this.contactsService.onFilterChanged.subscribe(() => {
this.contactsService.deselectContacts();
});
}
ngOnInit()
@@ -82,6 +86,7 @@ export class FuseContactsContactListComponent implements OnInit, OnDestroy
ngOnDestroy()
{
this.onContactsChangedSubscription.unsubscribe();
this.onFilterChangedSubscription.unsubscribe();
this.onSelectedContactsChangedSubscription.unsubscribe();
this.onUserDataChangedSubscription.unsubscribe();
}

View File

@@ -7,7 +7,7 @@
<!-- APP TITLE -->
<div fxLayout="row" fxLayoutAlign="start center">
<button mat-button class="mat-icon-button sidenav-toggle mr-12"
<button mat-icon-button class="sidenav-toggle mr-12"
fuseMatSidenavToggler="contacts-main-sidenav"
fxHide.gt-md>
<mat-icon>menu</mat-icon>
@@ -26,7 +26,7 @@
<label for="search" class="mr-8">
<mat-icon>search</mat-icon>
</label>
<mat-form-field mat-no-float class="m-0" floatPlaceholder="never">
<mat-form-field mat-no-float class="m-0" floatLabel="never">
<input matInput [formControl]="searchInput" id="search" placeholder="Search for anything">
</mat-form-field>
</div>
@@ -42,7 +42,7 @@
<mat-sidenav-container>
<!-- SIDENAV -->
<mat-sidenav class="sidenav" align="start" opened="true" mode="side"
<mat-sidenav class="sidenav" position="start" opened="true" mode="side"
fuseMatSidenavHelper="contacts-main-sidenav" mat-is-locked-open="gt-sm">
<fuse-contacts-main-sidenav *fuseIfOnDom [@animate]="{value:'*'}"></fuse-contacts-main-sidenav>

View File

@@ -1,10 +1,10 @@
import { Component, OnDestroy, OnInit, ViewEncapsulation } from '@angular/core';
import { FormControl, FormGroup } from '@angular/forms';
import 'rxjs/add/operator/debounceTime';
import 'rxjs/add/operator/distinctUntilChanged';
import { Subscription } from 'rxjs/Subscription';
import { MatDialog } from '@angular/material';
import { Subscription } from 'rxjs';
import { debounceTime, distinctUntilChanged } from 'rxjs/operators';
import { fuseAnimations } from '@fuse/animations';
import { FuseContactsContactFormDialogComponent } from './contact-form/contact-form.component';
@@ -63,8 +63,10 @@ export class FuseContactsComponent implements OnInit, OnDestroy
});
this.searchInput.valueChanges
.debounceTime(300)
.distinctUntilChanged()
.pipe(
debounceTime(300),
distinctUntilChanged()
)
.subscribe(searchText => {
this.contactsService.onSearchTextChanged.next(searchText);
});

View File

@@ -1,9 +1,7 @@
import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { ActivatedRouteSnapshot, Resolve, RouterStateSnapshot } from '@angular/router';
import { Observable } from 'rxjs/Observable';
import { BehaviorSubject } from 'rxjs/BehaviorSubject';
import { Subject } from 'rxjs/Subject';
import { BehaviorSubject, Observable, Subject } from 'rxjs';
import { FuseUtils } from '@fuse/utils';
@@ -120,7 +118,7 @@ export class ContactsService implements Resolve<any>
*/
toggleSelectedContact(id)
{
// First, check if we already have that todo as selected...
// First, check if we already have that contact as selected...
if ( this.selectedContacts.length > 0 )
{
const index = this.selectedContacts.indexOf(id);

View File

@@ -11,7 +11,7 @@
<div>
<span class="selected-contacts-count">
<span>{{selectedContacts.length}}</span>
<span class="mr-4">{{selectedContacts.length}}</span>
<span>selected</span>
</span>

View File

@@ -1,5 +1,5 @@
import { Component, OnDestroy } from '@angular/core';
import { Subscription } from 'rxjs/Subscription';
import { Subscription } from 'rxjs';
import { ContactsService } from '../../contacts.service';

View File

@@ -41,7 +41,7 @@
<div class="content">
<div class="left mr-32">
<div class="left mr-lg-32">
<div class="pb-24 font-size-18 font-weight-300">
How are your active users trending over time?
@@ -265,7 +265,7 @@
<div fxLayout="row wrap" fxLayout.gt-md="column">
<!-- Widget 7 -->
<div class="mb-48" [ngClass.lt-lg]="'mr-32'">
<div class="mb-48" [ngClass.lt-lg]="'mr-32'" [ngClass.xs]="'mr-0'">
<div class="pb-24 font-size-18 font-weight-300">
What are your top devices?
@@ -337,7 +337,7 @@
<!-- / Widget 7 -->
<!-- Widget 8 -->
<div class="mb-48" [ngClass.lt-lg]="'mr-32'">
<div class="mb-48" [ngClass.lt-lg]="'mr-32'" [ngClass.xs]="'mr-0'">
<div class="pb-24 font-size-18 font-weight-300">
How are your sales?
@@ -439,7 +439,7 @@
<!-- / Widget 8 -->
<!-- Widget 9 -->
<div class="mb-48" [ngClass.lt-lg]="'mr-32'">
<div class="mb-48" [ngClass.lt-lg]="'mr-32'" [ngClass.xs]="'mr-0'">
<div class="pb-24 font-size-18 font-weight-300" [ngClass.lt-lg]="'pt-0'">
What are your top campaigns?

View File

@@ -43,6 +43,15 @@
min-width: 0;
max-width: none;
}
.fuse-card {
@include media-breakpoint-down('md') {
width: 100%;
min-width: 0;
max-width: none;
}
}
}
}

View File

@@ -1,7 +1,7 @@
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { MatFormFieldModule, MatIconModule, MatMenuModule, MatSelectModule, MatTabsModule } from '@angular/material';
import { MatButtonModule, MatFormFieldModule, MatIconModule, MatMenuModule, MatSelectModule, MatTabsModule } from '@angular/material';
import { AgmCoreModule } from '@agm/core';
import { ChartsModule } from 'ng2-charts';
@@ -31,6 +31,7 @@ const routes: Routes = [
imports : [
RouterModule.forChild(routes),
MatButtonModule,
MatFormFieldModule,
MatIconModule,
MatMenuModule,

View File

@@ -1,8 +1,7 @@
import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { ActivatedRouteSnapshot, Resolve, RouterStateSnapshot } from '@angular/router';
import { Observable } from 'rxjs/Observable';
import { Observable } from 'rxjs';
@Injectable()
export class AnalyticsDashboardService implements Resolve<any>

View File

@@ -666,8 +666,8 @@
<!-- Avatar Column -->
<ng-container cdkColumnDef="avatar">
<mat-header-cell fxFlex="64px" *cdkHeaderCellDef></mat-header-cell>
<mat-cell fxFlex="64px" *cdkCellDef="let contact">
<mat-header-cell fxFlex="96px" *cdkHeaderCellDef></mat-header-cell>
<mat-cell fxFlex="96px" *cdkCellDef="let contact">
<img class="avatar" *ngIf="contact.avatar" [alt]="contact.name"
[src]="contact.avatar"/>
</mat-cell>
@@ -750,7 +750,7 @@
<!-- / CENTER -->
<!-- SIDENAV -->
<mat-sidenav class="sidenav" align="end" mode="side" opened="true"
<mat-sidenav class="sidenav" position="end" mode="side" opened="true"
fuseMatSidenavHelper="dashboards-right-sidenav" mat-is-locked-open="gt-md">
<div class="sidenav-content" fusePerfectScrollbar>

View File

@@ -1,7 +1,7 @@
import { Component, OnInit, ViewEncapsulation } from '@angular/core';
import { DataSource } from '@angular/cdk/collections';
import { BehaviorSubject } from 'rxjs/BehaviorSubject';
import { Observable } from 'rxjs/Observable';
import { BehaviorSubject, Observable } from 'rxjs';
import * as shape from 'd3-shape';
import { fuseAnimations } from '@fuse/animations';

View File

@@ -1,8 +1,7 @@
import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { ActivatedRouteSnapshot, Resolve, RouterStateSnapshot } from '@angular/router';
import { Observable } from 'rxjs/Observable';
import { Observable } from 'rxjs';
@Injectable()
export class ProjectDashboardService implements Resolve<any>

View File

@@ -1,8 +1,7 @@
import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { ActivatedRouteSnapshot, Resolve, RouterStateSnapshot } from '@angular/router';
import { Observable } from 'rxjs/Observable';
import { Observable } from 'rxjs';
@Injectable()
export class EcommerceDashboardService implements Resolve<any>

View File

@@ -14,7 +14,7 @@
<!-- APP TITLE -->
<div fxLayout="row" fxLayoutAlign="start center">
<button class="mr-16" mat-icon-button [routerLink]="'/apps/e-commerce/orders'">
<button mat-icon-button class="mr-16" [routerLink]="'/apps/e-commerce/orders'">
<mat-icon>arrow_back</mat-icon>
</button>
@@ -49,7 +49,7 @@
<div class="section pb-48">
<div class="pb-16" fxLayout="row" fxLayoutAlign="start center">
<mat-icon class="m-0 mr-16">account_circle</mat-icon>
<mat-icon class="m-0 mr-16 secondary-text">account_circle</mat-icon>
<div class="h2 secondary-text">Customer</div>
</div>
@@ -88,7 +88,7 @@
<mat-tab-group class="addresses">
<mat-tab label="Shipping Address">
<div fxFlex fxLayout="column" *fuseIfOnDom>
<div fxFlex fxLayout="column">
<div class="address h4 py-24">{{order.customer.shippingAddress.address}}</div>
<agm-map class="w-100-p h-400" [zoom]="15"
[latitude]="order.customer.shippingAddress.lat"
@@ -101,7 +101,7 @@
</mat-tab>
<mat-tab label="Invoice Address" fxLayout="column">
<div fxFlex fxLayout="column" *fuseIfOnDom>
<div fxFlex fxLayout="column">
<div class="address h4 py-24">{{order.customer.invoiceAddress.address}}</div>
<agm-map class="w-100-p h-400" [zoom]="15"
[latitude]="order.customer.invoiceAddress.lat"
@@ -118,7 +118,7 @@
<div class="section pb-48">
<div class="pb-16" fxLayout="row" fxLayoutAlign="start center">
<mat-icon class="m-0 mr-16">access_time</mat-icon>
<mat-icon class="m-0 mr-16 secondary-text">access_time</mat-icon>
<div class="h2 secondary-text">Order Status</div>
</div>
@@ -172,7 +172,7 @@
<div class="section pb-48">
<div class="pb-16" fxLayout="row" fxLayoutAlign="start center">
<mat-icon class="m-0 mr-16">attach_money</mat-icon>
<mat-icon class="m-0 mr-16 secondary-text">attach_money</mat-icon>
<div class="h2 secondary-text">Payment</div>
</div>
@@ -216,7 +216,7 @@
<div class="section pb-48">
<div class="pb-16" fxLayout="row" fxLayoutAlign="start center">
<mat-icon class="m-0 mr-16">local_shipping</mat-icon>
<mat-icon class="m-0 mr-16 secondary-text">local_shipping</mat-icon>
<div class="h2 secondary-text">Shipping</div>
</div>

View File

@@ -1,12 +1,6 @@
import { Component, OnDestroy, OnInit, ViewEncapsulation } from '@angular/core';
import { FormBuilder, FormGroup } from '@angular/forms';
import 'rxjs/add/operator/startWith';
import 'rxjs/add/observable/merge';
import 'rxjs/add/operator/map';
import 'rxjs/add/operator/debounceTime';
import 'rxjs/add/operator/distinctUntilChanged';
import 'rxjs/add/observable/fromEvent';
import { Subscription } from 'rxjs/Subscription';
import { Subscription } from 'rxjs';
import { fuseAnimations } from '@fuse/animations';

View File

@@ -1,9 +1,7 @@
import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { ActivatedRouteSnapshot, Resolve, RouterStateSnapshot } from '@angular/router';
import { Observable } from 'rxjs/Observable';
import { BehaviorSubject } from 'rxjs/BehaviorSubject';
import { BehaviorSubject, Observable } from 'rxjs';
@Injectable()
export class EcommerceOrderService implements Resolve<any>

View File

@@ -21,12 +21,12 @@
<!-- / APP TITLE -->
<!-- SEARCH -->
<div class="search-input-wrapper ml-8 m-sm-0"
<div class="search-input-wrapper ml-sm-16"
fxFlex="1 0 auto" fxLayout="row" fxLayoutAlign="start center">
<label for="search" class="mr-8">
<mat-icon class="secondary-text">search</mat-icon>
</label>
<mat-form-field floatPlaceholder="never" fxFlex="1 0 auto">
<mat-form-field floatLabel="never" fxFlex="1 0 auto">
<input id="search" matInput #filter placeholder="Search">
</mat-form-field>
</div>

View File

@@ -1,3 +1,5 @@
@import "src/@fuse/scss/fuse";
:host {
.header {
@@ -5,6 +7,13 @@
.search-input-wrapper {
max-width: 480px;
}
@include media-breakpoint-down(xs) {
margin: 24px 0;
height: 128px !important;
min-height: 128px !important;
max-height: 128px !important;
}
}
.mat-tab-group,

View File

@@ -1,14 +1,9 @@
import { Component, ElementRef, OnInit, ViewChild } from '@angular/core';
import { MatPaginator, MatSort } from '@angular/material';
import { DataSource } from '@angular/cdk/collections';
import { Observable } from 'rxjs/Observable';
import { BehaviorSubject } from 'rxjs/BehaviorSubject';
import 'rxjs/add/operator/startWith';
import 'rxjs/add/observable/merge';
import 'rxjs/add/operator/map';
import 'rxjs/add/operator/debounceTime';
import 'rxjs/add/operator/distinctUntilChanged';
import 'rxjs/add/observable/fromEvent';
import { merge, Observable, BehaviorSubject, fromEvent } from 'rxjs';
import { debounceTime, distinctUntilChanged, map } from 'rxjs/operators';
import { fuseAnimations } from '@fuse/animations';
import { FuseUtils } from '@fuse/utils';
@@ -40,16 +35,16 @@ export class FuseEcommerceOrdersComponent implements OnInit
{
this.dataSource = new FilesDataSource(this.ordersService, this.paginator, this.sort);
Observable.fromEvent(this.filter.nativeElement, 'keyup')
.debounceTime(150)
.distinctUntilChanged()
.subscribe(() => {
if ( !this.dataSource )
{
return;
}
this.dataSource.filter = this.filter.nativeElement.value;
});
fromEvent(this.filter.nativeElement, 'keyup').pipe(
debounceTime(150),
distinctUntilChanged()
).subscribe(() => {
if ( !this.dataSource )
{
return;
}
this.dataSource.filter = this.filter.nativeElement.value;
});
}
}
@@ -97,19 +92,22 @@ export class FilesDataSource extends DataSource<any>
this._filterChange,
this._sort.sortChange
];
return Observable.merge(...displayDataChanges).map(() => {
let data = this.ordersService.orders.slice();
data = this.filterData(data);
return merge(...displayDataChanges).pipe(map(() => {
this.filteredData = [...data];
let data = this.ordersService.orders.slice();
data = this.sortData(data);
data = this.filterData(data);
// Grab the page's slice of data.
const startIndex = this._paginator.pageIndex * this._paginator.pageSize;
return data.splice(startIndex, this._paginator.pageSize);
});
this.filteredData = [...data];
data = this.sortData(data);
// Grab the page's slice of data.
const startIndex = this._paginator.pageIndex * this._paginator.pageSize;
return data.splice(startIndex, this._paginator.pageSize);
})
);
}

View File

@@ -1,9 +1,7 @@
import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { ActivatedRouteSnapshot, Resolve, RouterStateSnapshot } from '@angular/router';
import { Observable } from 'rxjs/Observable';
import { BehaviorSubject } from 'rxjs/BehaviorSubject';
import { BehaviorSubject, Observable } from 'rxjs';
@Injectable()
export class EcommerceOrdersService implements Resolve<any>

View File

@@ -13,11 +13,12 @@
<!-- APP TITLE -->
<div fxLayout="row" fxLayoutAlign="start center">
<button class="mr-0 mr-sm-16" mat-icon-button [routerLink]="'/apps/e-commerce/products'">
<button mat-icon-button class="mr-0 mr-sm-16" [routerLink]="'/apps/e-commerce/products'">
<mat-icon>arrow_back</mat-icon>
</button>
<div class="product-image mr-8 mr-sm-16" *fuseIfOnDom [@animate]="{value:'*',params:{delay:'50ms',scale:'0.2'}}">
<div class="product-image mr-8 mr-sm-16" *fuseIfOnDom
[@animate]="{value:'*',params:{delay:'50ms',scale:'0.2'}}">
<img *ngIf="product.images[0]" [src]="product.images[0].url">
<img *ngIf="!product.images[0]" [src]="'assets/images/ecommerce/product-image-placeholder.png'">
</div>
@@ -38,14 +39,14 @@
<!-- / APP TITLE -->
<button mat-raised-button
class="save-product-button mat-white-bg mt-16 mt-sm-0"
class="save-product-button mat-white-bg"
[disabled]="productForm.invalid"
*ngIf="pageType ==='new'" (click)="addProduct()">
<span>ADD</span>
</button>
<button mat-raised-button
class="save-product-button mat-white-bg mt-16 mt-sm-0"
class="save-product-button mat-white-bg"
[disabled]="productForm.invalid || productForm.pristine"
*ngIf="pageType ==='edit'" (click)="saveProduct()">
<span>SAVE</span>
@@ -64,6 +65,7 @@
<mat-tab-group>
<mat-tab label="Basic Info">
<div class="tab-content p-24" fusePerfectScrollbar>
<mat-form-field class="w-100-p">
@@ -83,44 +85,46 @@
</textarea>
</mat-form-field>
<h3 class="mb-0">Categories</h3>
<mat-form-field class="w-100-p" floatPlaceholder="never">
<mat-chip-list matPrefix #categoryList
name="categories"
formControlName="categories">
<mat-form-field class="w-100-p">
<mat-chip-list #categoryList name="categories" formControlName="categories">
<mat-chip *ngFor="let category of product.categories"
removable="true" (removed)="product.removeCategory(category)">
[removable]="true" (removed)="product.removeCategory(category)">
{{category}}
<mat-icon matChipRemove>cancel</mat-icon>
</mat-chip>
<input placeholder="Categories"
[matChipInputFor]="categoryList"
[matChipInputAddOnBlur]="true"
(matChipInputTokenEnd)="product.addCategory($event)"/>
</mat-chip-list>
<input matInput
matChipInputAddOnBlur="true"
(matChipInputTokenEnd)="product.addCategory($event)"
placeholder="Add category..."
[matChipInputFor]="categoryList"/>
</mat-form-field>
<h3 class="mb-0">Tags</h3>
<mat-form-field class="w-100-p" floatPlaceholder="never">
<mat-chip-list matPrefix #tagList
name="tags"
formControlName="tags">
<mat-form-field class="w-100-p">
<mat-chip-list #tagList name="tags" formControlName="tags">
<mat-chip *ngFor="let tag of product.tags"
removable="true" (removed)="product.removeTag(tag)">
[removable]="true" (removed)="product.removeTag(tag)">
{{tag}}
<mat-icon matChipRemove>cancel</mat-icon>
</mat-chip>
<input placeholder="Tags"
[matChipInputFor]="tagList"
[matChipInputAddOnBlur]="true"
(matChipInputTokenEnd)="product.addTag($event)"/>
</mat-chip-list>
<input matInput
matChipInputAddOnBlur="true"
(matChipInputTokenEnd)="product.addTag($event)"
placeholder="Add tag..."
[matChipInputFor]="tagList"/>
</mat-form-field>
</div>
</mat-tab>
<mat-tab label="Product Images">
@@ -129,7 +133,8 @@
<div *ngIf="product.images.length === 0"
class="product-image" fxlayout="row" fxLayoutAlign="center center">
<img class="media" [src]="'assets/images/ecommerce/product-image-placeholder.png'">
<img class="media"
[src]="'assets/images/ecommerce/product-image-placeholder.png'">
</div>
<div *ngFor="let image of product.images">
@@ -175,7 +180,8 @@
formControlName="comparedPrice"
placeholder="Compared Price" type="number">
<span matPrefix>$&nbsp;</span>
<mat-hint align="start">Add a compare price to show next to the real price</mat-hint>
<mat-hint align="start">Add a compare price to show next to the real price
</mat-hint>
</mat-form-field>
</div>

View File

@@ -1,14 +1,7 @@
import { Component, OnDestroy, OnInit, ViewEncapsulation } from '@angular/core';
import { FormBuilder, FormGroup } from '@angular/forms';
import { MatSnackBar } from '@angular/material';
import 'rxjs/add/operator/startWith';
import 'rxjs/add/observable/merge';
import 'rxjs/add/operator/map';
import 'rxjs/add/operator/debounceTime';
import 'rxjs/add/operator/distinctUntilChanged';
import 'rxjs/add/observable/fromEvent';
import { Subscription } from 'rxjs/Subscription';
import { Subscription } from 'rxjs';
import { fuseAnimations } from '@fuse/animations';
import { FuseUtils } from '@fuse/utils';

View File

@@ -1,9 +1,7 @@
import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { ActivatedRouteSnapshot, Resolve, RouterStateSnapshot } from '@angular/router';
import { Observable } from 'rxjs/Observable';
import { BehaviorSubject } from 'rxjs/BehaviorSubject';
import { BehaviorSubject, Observable } from 'rxjs';
@Injectable()
export class EcommerceProductService implements Resolve<any>

View File

@@ -15,18 +15,23 @@
<!-- APP TITLE -->
<div class="logo my-12 m-sm-0"
fxLayout="row" fxLayoutAlign="start center">
<mat-icon class="logo-icon mr-16" *fuseIfOnDom [@animate]="{value:'*',params:{delay:'50ms',scale:'0.2'}}">shopping_basket</mat-icon>
<span class="logo-text h1" *fuseIfOnDom [@animate]="{value:'*',params:{delay:'100ms',x:'-25px'}}">Products</span>
<mat-icon class="logo-icon mr-16" *fuseIfOnDom
[@animate]="{value:'*',params:{delay:'50ms',scale:'0.2'}}">
shopping_basket
</mat-icon>
<span class="logo-text h1" *fuseIfOnDom [@animate]="{value:'*',params:{delay:'100ms',x:'-25px'}}">
Products
</span>
</div>
<!-- / APP TITLE -->
<!-- SEARCH -->
<div class="search-input-wrapper mx-12 m-md-0"
<div class="search-input-wrapper mx-24 m-md-0"
fxFlex="1 0 auto" fxLayout="row" fxLayoutAlign="start center">
<label for="search" class="mr-8">
<mat-icon class="secondary-text">search</mat-icon>
</label>
<mat-form-field floatPlaceholder="never" fxFlex="1 0 auto">
<mat-form-field floatLabel="never" fxFlex="1 0 auto">
<input id="search" matInput #filter placeholder="Search">
</mat-form-field>
</div>

View File

@@ -9,9 +9,10 @@
}
@include media-breakpoint-down(xs) {
height: 176px !important;
min-height: 176px !important;
max-height: 176px !important;
margin: 8px 0;
height: 192px !important;
min-height: 192px !important;
max-height: 192px !important;
}
}

View File

@@ -2,14 +2,8 @@ import { Component, ElementRef, OnInit, ViewChild } from '@angular/core';
import { MatPaginator, MatSort } from '@angular/material';
import { DataSource } from '@angular/cdk/collections';
import 'rxjs/add/operator/startWith';
import 'rxjs/add/observable/merge';
import 'rxjs/add/operator/map';
import 'rxjs/add/operator/debounceTime';
import 'rxjs/add/operator/distinctUntilChanged';
import 'rxjs/add/observable/fromEvent';
import { Observable } from 'rxjs/Observable';
import { BehaviorSubject } from 'rxjs/BehaviorSubject';
import { merge, Observable, BehaviorSubject, fromEvent } from 'rxjs';
import { debounceTime, distinctUntilChanged, map } from 'rxjs/operators';
import { fuseAnimations } from '@fuse/animations';
import { FuseUtils } from '@fuse/utils';
@@ -40,16 +34,18 @@ export class FuseEcommerceProductsComponent implements OnInit
ngOnInit()
{
this.dataSource = new FilesDataSource(this.productsService, this.paginator, this.sort);
Observable.fromEvent(this.filter.nativeElement, 'keyup')
.debounceTime(150)
.distinctUntilChanged()
.subscribe(() => {
if ( !this.dataSource )
{
return;
}
this.dataSource.filter = this.filter.nativeElement.value;
});
fromEvent(this.filter.nativeElement, 'keyup').pipe(
debounceTime(150),
distinctUntilChanged()
).subscribe(() => {
if ( !this.dataSource )
{
return;
}
this.dataSource.filter = this.filter.nativeElement.value;
});
}
}
@@ -98,19 +94,21 @@ export class FilesDataSource extends DataSource<any>
this._sort.sortChange
];
return Observable.merge(...displayDataChanges).map(() => {
let data = this.productsService.products.slice();
return merge(...displayDataChanges).pipe(map(() => {
data = this.filterData(data);
let data = this.productsService.products.slice();
this.filteredData = [...data];
data = this.filterData(data);
data = this.sortData(data);
this.filteredData = [...data];
// Grab the page's slice of data.
const startIndex = this._paginator.pageIndex * this._paginator.pageSize;
return data.splice(startIndex, this._paginator.pageSize);
});
data = this.sortData(data);
// Grab the page's slice of data.
const startIndex = this._paginator.pageIndex * this._paginator.pageSize;
return data.splice(startIndex, this._paginator.pageSize);
}
));
}
filterData(data)
@@ -122,7 +120,9 @@ export class FilesDataSource extends DataSource<any>
return FuseUtils.filterArrayByString(data, this.filter);
}
sortData(data): any[]
sortData(data)
:
any[]
{
if ( !this._sort.active || this._sort.direction === '' )
{

View File

@@ -1,8 +1,7 @@
import { Injectable } from '@angular/core';
import { ActivatedRouteSnapshot, Resolve, RouterStateSnapshot } from '@angular/router';
import { Observable } from 'rxjs/Observable';
import { HttpClient } from '@angular/common/http';
import { BehaviorSubject } from 'rxjs/BehaviorSubject';
import { BehaviorSubject, Observable } from 'rxjs';
@Injectable()
export class EcommerceProductsService implements Resolve<any>

View File

@@ -44,7 +44,7 @@
<mat-cell *cdkCellDef="let row" fxFlex="48px" fxHide.gt-md>
<button mat-icon-button class="sidenav-toggle"
fuseMatSidenavToggler="file-manager-right-sidenav">
<mat-icon>info</mat-icon>
<mat-icon class="secondary-text">info</mat-icon>
</button>
</mat-cell>
</ng-container>

View File

@@ -1,6 +1,6 @@
import { Component, OnInit } from '@angular/core';
import { DataSource } from '@angular/cdk/collections';
import { Observable } from 'rxjs/Observable';
import { Observable } from 'rxjs';
import { FileManagerService } from '../file-manager.service';
import { fuseAnimations } from '@fuse/animations/index';

View File

@@ -3,7 +3,7 @@
<mat-sidenav-container>
<!-- SIDENAV -->
<mat-sidenav class="sidenav left-sidenav" align="start" opened="false" mode="over"
<mat-sidenav class="sidenav left-sidenav" position="start" opened="false" mode="over"
fuseMatSidenavHelper="file-manager-left-sidenav">
<fuse-file-manager-main-sidenav></fuse-file-manager-main-sidenav>
</mat-sidenav>
@@ -26,7 +26,7 @@
</div>
<div class="right-side" fxLayout="row">
<button mat-button class="mat-icon-button" aria-label="Search" matTooltip="Search">
<button mat-icon-button aria-label="Search" matTooltip="Search">
<mat-icon>search</mat-icon>
</button>
</div>
@@ -69,7 +69,7 @@
<!-- / CENTER -->
<!-- SIDENAV -->
<mat-sidenav class="sidenav right-sidenav " align="end" opened="true" mode="side"
<mat-sidenav class="sidenav right-sidenav " position="end" opened="true" mode="side"
fuseMatSidenavHelper="file-manager-right-sidenav" mat-is-locked-open="gt-md">
<fuse-file-manager-details-sidenav></fuse-file-manager-details-sidenav>
</mat-sidenav>

View File

@@ -1,9 +1,7 @@
import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { ActivatedRouteSnapshot, Resolve, RouterStateSnapshot } from '@angular/router';
import { Observable } from 'rxjs/Observable';
import { BehaviorSubject } from 'rxjs/BehaviorSubject';
import { Observable, BehaviorSubject } from 'rxjs';
@Injectable()
export class FileManagerService implements Resolve<any>

View File

@@ -3,7 +3,7 @@
<div class="toolbar" fxLayout="row" fxLayoutAlign="end center">
<button mat-icon-button class="mat-icon-button" matTooltip="Delete">
<button mat-icon-button matTooltip="Delete">
<mat-icon>delete</mat-icon>
</button>
@@ -11,7 +11,7 @@
<mat-icon>file_download</mat-icon>
</button>
<button mat-icon-button class="mat-icon-button" aria-label="More" matTooltip="More">
<button mat-icon-button aria-label="More" matTooltip="More">
<mat-icon>more_vert</mat-icon>
</button>
</div>

View File

@@ -1,13 +1,11 @@
<div class="dialog-content-wrapper">
<mat-toolbar matDialogTitle class="mat-accent m-0">
<div fxFlex fxLayout="row" fxLayoutAlign="space-between center">
<mat-toolbar class="mat-accent m-0">
<mat-toolbar-row fxFlex fxLayout="row" fxLayoutAlign="space-between center">
<span class="title dialog-title">New Message</span>
<button mat-button class="mat-icon-button"
(click)="dialogRef.close()"
aria-label="Close dialog">
<button mat-icon-button (click)="dialogRef.close()" aria-label="Close dialog">
<mat-icon>close</mat-icon>
</button>
</div>
</mat-toolbar-row>
</mat-toolbar>
<div mat-dialog-content class="p-24 m-0" fusePerfectScrollbar>
@@ -100,10 +98,7 @@
</button>
</div>
<button mat-button
class="mat-icon-button"
(click)="dialogRef.close(['delete',composeForm])"
aria-label="Delete"
<button mat-icon-button (click)="dialogRef.close(['delete',composeForm])" aria-label="Delete"
matTooltip="Delete">
<mat-icon>delete</mat-icon>
</button>

View File

@@ -1,5 +1,5 @@
<div *ngIf="!mail" fxLayout="column" fxLayoutAlign="center center" fxFlex>
<mat-icon class="s-128 mb-16 select-message-icon">
<mat-icon class="s-128 mb-16 select-message-icon hint-text">
email
</mat-icon>
<span class="select-message-text hint-text">
@@ -24,14 +24,14 @@
</div>
<div class="actions" fxLayout="row" fxLayoutAlign="start center">
<button mat-button class="mat-icon-button" (click)="toggleStar($event)" aria-label="Toggle star">
<mat-icon *ngIf="mail.starred">star</mat-icon>
<mat-icon *ngIf="!mail.starred">star_outline</mat-icon>
<button mat-icon-button (click)="toggleStar($event)" aria-label="Toggle star">
<mat-icon class="amber-fg" *ngIf="mail.starred">star</mat-icon>
<mat-icon class="secondary-text" *ngIf="!mail.starred">star_outline</mat-icon>
</button>
<button mat-button class="mat-icon-button" (click)="toggleImportant($event)" aria-label="Toggle important">
<mat-icon *ngIf="mail.important">label</mat-icon>
<mat-icon *ngIf="!mail.important">label_outline</mat-icon>
<button mat-icon-button (click)="toggleImportant($event)" aria-label="Toggle important">
<mat-icon class="red-fg" *ngIf="mail.important">label</mat-icon>
<mat-icon class="secondary-text" *ngIf="!mail.important">label_outline</mat-icon>
</button>
</div>
</div>
@@ -87,8 +87,7 @@
</div>
</div>
<button mat-button [matMenuTriggerFor]="moreMenu" aria-label="More" class="mat-icon-button"
(click)="$event.stopPropagation()">
<button mat-icon-button [matMenuTriggerFor]="moreMenu" aria-label="More" (click)="$event.stopPropagation()">
<mat-icon>more_vert</mat-icon>
</button>

View File

@@ -1,6 +1,6 @@
import { ChangeDetectionStrategy, Component, Input, OnChanges } from '@angular/core';
import { Store } from '@ngrx/store';
import { Observable } from 'rxjs/Observable';
import { Observable } from 'rxjs';
import { Mail } from '../mail.model';
import * as fromStore from '../store';

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