Compare commits

...

73 Commits

Author SHA1 Message Date
Sercan Yemen
895291c37c Updated Fuse version
+ Removed unnecessary dev dependencies and updated couple of them
2017-10-16 10:45:08 +03:00
Sercan Yemen
ac7e6f75bc Added theme options openBar function to the navigation as an example
+ Removed duplicate Black and White tabs from colors
2017-10-16 10:08:40 +03:00
Sercan Yemen
bd8b02c82d Merge branch 'master' of https://github.com/withinpixels/fuse2 2017-10-14 18:44:17 +03:00
Sercan Yemen
6d594d63db Added a way of accessing and updating nav items
+ Added an ability to add custom functions to the nav items
2017-10-14 18:44:11 +03:00
mustafahlvc
6656410696 Calendar, Scrumboard Apps datepicker fixes. 2017-10-13 17:50:59 +03:00
mustafahlvc
470b851eae colors styling fix. 2017-10-13 15:43:22 +03:00
mustafahlvc
fbe9cb83a2 missing destroy function added for Faq page. 2017-10-13 15:39:18 +03:00
mustafahlvc
13a09164ae Faq page added. 2017-10-13 15:37:30 +03:00
Sercan Yemen
56d9830176 Fixed: Lock page layout issues 2017-10-13 14:39:46 +03:00
Sercan Yemen
be820804f2 New mail confirmation page 2017-10-13 14:22:59 +03:00
Sercan Yemen
7615bc1d03 Removed pricing tables from components 2017-10-13 12:24:13 +03:00
Sercan Yemen
3198663430 Merge branch 'master' of https://github.com/withinpixels/fuse2 2017-10-13 12:21:07 +03:00
Sercan Yemen
ad432ca31d New pricing page design
+ Fixed: Some color issues
+ Fixed: Icons and Quick Nav in memory web api related data issues
2017-10-13 12:21:00 +03:00
mustafahlvc
7d26beff3d angular updated to v4.4.5 2017-10-13 12:13:03 +03:00
mustafahlvc
4711a27814 Merge remote-tracking branch 'origin/master' 2017-10-13 11:58:12 +03:00
mustafahlvc
8205a4d5b5 <agm-map> Google Maps component library added,
+ some style refinements on doc pages.
2017-10-13 11:57:54 +03:00
Sercan Yemen
4f451a74e9 fixed custom colors 2017-10-12 17:40:27 +03:00
Sercan Yemen
8518408254 Merge branch 'master' of https://github.com/withinpixels/fuse2 2017-10-12 14:29:13 +03:00
Sercan Yemen
72f968b594 Fix: Auth page v2 styles iOS height issue
+ Fix: Perfect scrollbar causes issues on outside of the zone
+ Fix: Navigation must unsubscribe the nav toggle and clear the timeout
+ Fix: Chat view is not scrollable on mobile
+ Fix: Terms & Conditions checkbox styling issues on Auth forms
+ Fix: Sidenav z-index issue on certain page layouts
+ Fix: Some page layout header heights not correct on small devices
2017-10-12 14:28:58 +03:00
mustafahlvc
688b443ea8 <mat-select> wrapped with <mat-form-field> and fixed relative issues. 2017-10-12 14:05:22 +03:00
mustafahlvc
cb89da4647 angular-in-memory-web-api updated to v0.5.0,
(HTTP response data no longer wrapped in object w/ data property by default.)
2017-10-12 13:05:56 +03:00
Sercan Yemen
cc4a04afcb Removed fxFlexFill from main-content in an attempt to fix iOS scrolling and sizing issues
+ Updated Perfect scrollbar
+ updated various packages like zone-js & core-js
+ small tweak on contacts list item padding
+ removed md2 datepicker color tweak
2017-10-12 12:42:11 +03:00
mustafahlvc
bc239571a1 @angular/material v2.0.0-beta.12 examples updated. 2017-10-10 17:19:07 +03:00
mustafahlvc
c025563145 Merge remote-tracking branch 'origin/master'
# Conflicts:
#	src/app/core/services/config.service.ts
2017-10-10 16:40:29 +03:00
mustafahlvc
c06e99dc97 @angular/material v2.0.0-beta.12 compability update,
Lots of breaking changes,
all "md" prefixes changed with "mat" due to angular material deprecation of "md",
md2 package removed, its not compatible with latest material version, will be replaced with another date picker later.
2017-10-10 16:37:24 +03:00
Sercan Yemen
c0a1dc7c37 Changed default navbar and footer colorsˆ 2017-10-09 14:22:12 +03:00
Sercan Yemen
55e1d8b2bc New Reset and Forgot password styles 2017-10-09 14:17:27 +03:00
Sercan Yemen
533f5f3f3f removed unnecessary console.logs and added possible route animations 2017-10-09 12:32:40 +03:00
Sercan Yemen
4a7b70c874 Fixes #16: Inconsistent font sizes across elements 2017-10-02 10:14:20 +03:00
Sercan Yemen
c101c432dc Fixes #14: Toolbar search bar button collapses on close 2017-10-02 10:01:22 +03:00
Sercan Yemen
04d1b2eff8 Fixes #9: print styles and page breaks 2017-09-29 12:06:47 +03:00
Sercan Yemen
f800dc3286 updated footer links 2017-09-28 12:52:34 +03:00
Sercan Yemen
619433f101 updated version number 2017-09-28 12:43:27 +03:00
mustafahlvc
3e9ae83aae Angular Material reference url fix 2017-09-28 12:26:33 +03:00
mustafahlvc
9400c3d748 Responsive refinement on some doc pages,
Navigation scrool fix on collapse toggled.
2017-09-28 12:22:33 +03:00
mustafahlvc
5e4940fed9 IconSvgExample Component path corrected. 2017-09-28 11:05:11 +03:00
mustafahlvc
8910e6f5dc angular-in-memory-web-api updated,
+ Http changed with HttpClient,
+ Angular Material Element examples added,
+ angular2-markdown Library added
2017-09-27 19:41:01 +03:00
mustafahlvc
52c5e6a18b Nested group vertical navigation indentation fix 2017-09-27 18:45:24 +03:00
mustafahlvc
3d9ded9a44 Nested Group feature added to navigation 2017-09-26 11:58:34 +03:00
mustafahlvc
1be3f0066b Angular Material updated to 2.0.0-beta.11:
Do not change the prefixes md to mat for this release; They don't completely migrate.
2017-09-26 10:04:45 +03:00
mustafahlvc
21c96c76da Merge remote-tracking branch 'origin/master' 2017-09-22 16:18:24 +03:00
mustafahlvc
5e2e2b7d53 Backdrop added to FuseNavBar for mobile 2017-09-22 16:18:05 +03:00
Sercan Yemen
dcff423943 Updated version to 1.1.0 since we have couple breaking changes! 2017-09-22 16:07:05 +03:00
Sercan Yemen
6747610771 Fixed: Fullwidth simple page layout doesn't scroll
+ Added: New logo to the various pages
+ Fixed: Mobile zoom is not disabled
+ Fixed: Profile timeline mobile order is not correct
+ Fixed: Quickpanel focusses to the form elements causing it to scroll on mobile devices when opened
+ Various demo page mobile fixes
2017-09-22 16:04:59 +03:00
Sercan Yemen
e6ee5d017e small tweaks and ng-* cleanups
+ Fixed: todo item action buttons shouldn't trigger "view todo" action
+ Fixed: contacts selected bar mobile issues
2017-09-22 15:02:07 +03:00
Sercan Yemen
cb2b544526 chat, todo & theme options tweaks 2017-09-22 12:11:21 +03:00
mustafahlvc
5ace09f782 Calendar, Contacts, Mail, Scrumboard apps responsive refinements,
+ temporary fix for md-sidenav-locked transition
2017-09-22 12:03:21 +03:00
Sercan Yemen
678dde8c0e calendar, mail and todo tweaks 2017-09-22 11:32:31 +03:00
Sercan Yemen
236cf1eb06 renamed the HMR starting scripts
+ modified the build scripts to use more memory. If you are having `out of memory` issues while building, use these scripts
2017-09-22 11:32:08 +03:00
Sercan Yemen
f4efbe07f7 Merge branch 'master' of https://github.com/withinpixels/fuse2 2017-09-22 09:23:38 +03:00
mustafahlvc
671287b55a Reverting the sidenav fixes.. 2017-09-21 19:03:19 +03:00
Sercan Yemen
19c85c964b updated the version number to 1.0.6 2017-09-21 15:54:25 +03:00
Sercan Yemen
e5cf4fdafb demo component and service page updates 2017-09-21 15:54:11 +03:00
Sercan Yemen
098dacf2a5 removed console warn 2017-09-21 15:13:27 +03:00
mustafahlvc
2f8539e987 Merge remote-tracking branch 'origin/master' 2017-09-21 15:05:36 +03:00
mustafahlvc
f688a58656 Animations enhanced for all apps and some pages. 2017-09-21 15:05:18 +03:00
Sercan Yemen
9cb8c0c96b Added a way to swap navigation model on the fly
Moved the navigation service to the app.module since we need it to be a singleton at all times
2017-09-21 14:56:08 +03:00
Sercan Yemen
05575d3f82 Fixed: Navigation model must be public 2017-09-21 14:08:37 +03:00
Sercan Yemen
b9198e3717 Entirely changed the navigation model structure (sorry!)
+ Fixed: Horizontal and Vertical navigation must be able to use the same model structure
+ Fixed: Collapsable nav item that has the active menu shouldn't be collapsed when other collapsables toggles
2017-09-21 12:08:52 +03:00
Sercan Yemen
769e67c2f3 Added HMR config. Use 'npm run hmr' for HMR enabled environment. This start script disables the sourcemaps to further increase the re-compile performance. If you need HMR with sourcemaps use 'npm run hmrs' 2017-09-21 10:58:19 +03:00
Sercan Yemen
32960abd7c fixed sidenav for fuse https://github.com/angular/material2/issues/7201 2017-09-20 17:38:14 +03:00
Sercan Yemen
126e32d9e7 updated Angular to 4.4.3 2017-09-20 10:06:43 +03:00
Sercan Yemen
d6d74cb998 small tweaks 2017-09-20 10:06:28 +03:00
Sercan Yemen
6d20c1d62d Custom perfect-scrollbar directive for better control (replaced the ngx-perfect-scrollbar with fuse-perfect-scrollbar) 2017-09-18 16:06:15 +03:00
Sercan Yemen
b55bce2de4 fixed: navigation collapsable issue on route change
fixed: footer stays on top of the navigation on mobile
2017-09-18 15:58:47 +03:00
Sercan Yemen
6f4dc36a3d locked dev dependency versions to prevent "npm update" errors! 2017-09-18 10:48:02 +03:00
Sercan Yemen
fe7e6d173b small tweaks and clean-ups 2017-09-18 10:47:35 +03:00
Sercan Yemen
b377d99c66 new fuse logo 2017-09-18 10:47:08 +03:00
Sercan Yemen
d4374e6df0 changed 'perfect-scrollbar' to 'perfectScrollbar' 2017-09-18 10:46:09 +03:00
Sercan Yemen
c74fad84b6 Merge branch 'master' of https://github.com/withinpixels/fuse2 2017-09-18 10:25:04 +03:00
mustafahlvc
e09ef05e02 (ngx-perfect-scroolbar) updated to v.4.6.2 2017-09-15 17:40:38 +03:00
Sercan Yemen
2c0fc76b8a meta tags and description for demo 2017-09-12 14:23:54 +03:00
Sercan Yemen
752660f5dc fix: theme options are not correctly shown on mobile 2017-09-12 10:25:11 +03:00
598 changed files with 16157 additions and 5637 deletions

View File

@@ -9,6 +9,7 @@
"outDir": "dist",
"assets": [
"assets",
"app/main/content/components/angular-material",
"favicon.ico"
],
"index": "index.html",
@@ -25,6 +26,7 @@
"environmentSource": "environments/environment.ts",
"environments": {
"dev": "environments/environment.ts",
"hmr": "environments/environment.hmr.ts",
"prod": "environments/environment.prod.ts"
}
}

1905
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,70 +1,73 @@
{
"name": "fuse2",
"version": "1.0.5",
"version": "1.1.2",
"license": "",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"start-hmr": "ng serve --hmr -e=hmr -sm=false",
"start-hmr-sourcemaps": "ng serve --hmr -e=hmr",
"build": "node --max_old_space_size=4096 ./node_modules/@angular/cli/bin/ng build",
"build-prod": "node --max_old_space_size=4096 ./node_modules/@angular/cli/bin/ng build --prod",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"@angular/animations": "4.3.5",
"@angular/cdk": "2.0.0-beta.10",
"@angular/common": "4.3.5",
"@angular/compiler": "4.3.5",
"@angular/core": "4.3.5",
"@agm/core": "1.0.0-beta.1",
"@angular/animations": "4.4.5",
"@angular/cdk": "2.0.0-beta.12",
"@angular/common": "4.4.5",
"@angular/compiler": "4.4.5",
"@angular/core": "4.4.5",
"@angular/flex-layout": "2.0.0-beta.9",
"@angular/forms": "4.3.5",
"@angular/http": "4.3.5",
"@angular/material": "2.0.0-beta.10",
"@angular/platform-browser": "4.3.5",
"@angular/platform-browser-dynamic": "4.3.5",
"@angular/router": "4.3.5",
"@angular/forms": "4.4.5",
"@angular/http": "4.4.5",
"@angular/material": "2.0.0-beta.12",
"@angular/platform-browser": "4.4.5",
"@angular/platform-browser-dynamic": "4.4.5",
"@angular/router": "4.4.5",
"@swimlane/ngx-charts": "6.0.2",
"@swimlane/ngx-datatable": "9.3.1",
"@swimlane/ngx-dnd": "3.0.0",
"angular-calendar": "0.19.0",
"angular-in-memory-web-api": "0.3.2",
"angular-calendar": "0.21.2",
"angular-in-memory-web-api": "0.5.0",
"angular2-markdown": "1.6.0",
"classlist.js": "1.1.20150312",
"core-js": "2.5.0",
"core-js": "2.5.1",
"d3": "4.10.0",
"hammerjs": "2.0.8",
"highlight.js": "9.12.0",
"intl": "1.2.5",
"md2": "0.0.28",
"moment": "2.18.1",
"ngx-color-picker": "4.3.1",
"ngx-cookie-service": "1.0.7",
"ngx-perfect-scrollbar": "4.5.6",
"moment": "2.19.1",
"ngx-color-picker": "4.4.0",
"ngx-cookie-service": "1.0.9",
"perfect-scrollbar": "1.0.3",
"rxjs": "5.4.3",
"web-animations-js": "2.3.1",
"zone.js": "0.8.17"
"zone.js": "0.8.18"
},
"devDependencies": {
"@angular/cli": "^1.3.2",
"@angular/compiler-cli": "4.3.5",
"@angular/language-service": "4.3.5",
"@ngtools/webpack": "^1.6.2",
"@types/jasmine": "^2.5.54",
"@types/jasminewd2": "^2.0.2",
"@types/node": "^6.0.88",
"codelyzer": "~3.0.1",
"jasmine-core": "~2.6.2",
"jasmine-spec-reporter": "~4.1.0",
"@angular/cli": "1.4.7",
"@angular/compiler-cli": "4.4.5",
"@angular/language-service": "4.4.5",
"@angularclass/hmr": "2.1.3",
"@types/jasmine": "2.6.0",
"@types/jasminewd2": "2.0.2",
"@types/node": "6.0.88",
"codelyzer": "3.2.0",
"jasmine-core": "2.6.2",
"jasmine-spec-reporter": "4.1.0",
"karma": "1.7.1",
"karma-chrome-launcher": "~2.1.1",
"karma-cli": "~1.0.1",
"karma-coverage-istanbul-reporter": "^1.2.1",
"karma-jasmine": "~1.1.0",
"karma-jasmine-html-reporter": "^0.2.2",
"node-sass": "^4.5.3",
"protractor": "~5.1.2",
"ts-node": "~3.0.4",
"tslint": "~5.3.2",
"typescript": "~2.3.3"
"karma-chrome-launcher": "2.1.1",
"karma-cli": "1.0.1",
"karma-coverage-istanbul-reporter": "1.2.1",
"karma-jasmine": "1.1.0",
"karma-jasmine-html-reporter": "0.2.2",
"protractor": "5.1.2",
"ts-node": "3.2.0",
"tslint": "5.7.0",
"typescript": "2.3.3"
}
}

View File

@@ -9,7 +9,6 @@ import 'hammerjs';
import { SharedModule } from './core/modules/shared.module';
import { AppComponent } from './app.component';
import { ProjectModule } from './main/content/apps/dashboards/project/project.module';
import { PerfectScrollbarModule } from 'ngx-perfect-scrollbar';
import { FuseFakeDbService } from './fuse-fake-db/fuse-fake-db.service';
import { FuseMainModule } from './main/main.module';
import { PagesModule } from './main/content/pages/pages.module';
@@ -17,8 +16,11 @@ import { UIModule } from './main/content/ui/ui.module';
import { ComponentsModule } from './main/content/components/components.module';
import { FuseSplashScreenService } from './core/services/splash-screen.service';
import { FuseConfigService } from './core/services/config.service';
import { FuseNavigationService } from './core/components/navigation/navigation.service';
import { ComponentsThirdPartyModule } from './main/content/components-third-party/components-third-party.module';
import { ServicesModule } from './main/content/services/services.module';
import { FuseAngularMaterialModule } from './main/content/components/angular-material/angular-material.module';
import { MarkdownModule } from 'angular2-markdown';
const appRoutes: Routes = [
{
@@ -66,10 +68,12 @@ const appRoutes: Routes = [
BrowserAnimationsModule,
RouterModule.forRoot(appRoutes),
SharedModule,
MarkdownModule.forRoot(),
InMemoryWebApiModule.forRoot(FuseFakeDbService, {delay: 0}),
PerfectScrollbarModule.forRoot(),
InMemoryWebApiModule.forRoot(FuseFakeDbService, {
delay : 0,
passThruUnknownUrl: true
}),
FuseMainModule,
@@ -79,11 +83,13 @@ const appRoutes: Routes = [
UIModule,
ServicesModule,
ComponentsModule,
FuseAngularMaterialModule,
ComponentsThirdPartyModule
],
providers : [
FuseSplashScreenService,
FuseConfigService
FuseConfigService,
FuseNavigationService
],
bootstrap : [
AppComponent

View File

@@ -1,10 +1,56 @@
import { sequence, trigger, stagger, animate, style, group, query, transition, keyframes, animateChild, state } from '@angular/animations';
import { sequence, trigger, animate, style, group, query, transition, animateChild, state, animation, useAnimation, stagger } from '@angular/animations';
// const query = (s, a, o = {optional: true}) => q(s, a, o);
const customAnimation = animation([
style({
opacity : '{{opacity}}',
transform: 'scale({{scale}}) translate3d({{x}}, {{y}}, {{z}})'
}),
animate('{{duration}} {{delay}} cubic-bezier(0.0, 0.0, 0.2, 1)', style('*'))
], {
params: {
duration: '200ms',
delay : '0ms',
opacity : '0',
scale : '1',
x : '0',
y : '0',
z : '0'
}
});
export class Animations
{
public static fadeInOut = trigger('fadeInOut', [
export const fuseAnimations = [
trigger('animate', [transition('void => *', [useAnimation(customAnimation)])]),
trigger('animateStagger', [
state('50', style('*')),
state('100', style('*')),
state('200', style('*')),
transition('void => 50',
query('@*',
[
stagger('50ms', [
animateChild()
])
])),
transition('void => 100',
query('@*',
[
stagger('100ms', [
animateChild()
])
])),
transition('void => 200',
query('@*',
[
stagger('200ms', [
animateChild()
])
]))
]),
trigger('fadeInOut', [
state('0', style({
display: 'none',
opacity: 0
@@ -15,9 +61,9 @@ export class Animations
})),
transition('1 => 0', animate('300ms ease-out')),
transition('0 => 1', animate('300ms ease-in'))
]);
]),
public static slideInOut = trigger('slideInOut', [
trigger('slideInOut', [
state('0', style({
height : '0px',
display: 'none'
@@ -28,9 +74,9 @@ export class Animations
})),
transition('1 => 0', animate('300ms ease-out')),
transition('0 => 1', animate('300ms ease-in'))
]);
]),
public static slideInLeft = trigger('slideInLeft', [
trigger('slideInLeft', [
state('void', style({
transform: 'translateX(-100%)',
display : 'none'
@@ -41,9 +87,9 @@ export class Animations
})),
transition('void => *', animate('300ms')),
transition('* => void', animate('300ms'))
]);
]),
public static slideInRight = trigger('slideInRight', [
trigger('slideInRight', [
state('void', style({
transform: 'translateX(100%)',
display : 'none'
@@ -54,9 +100,9 @@ export class Animations
})),
transition('void => *', animate('300ms')),
transition('* => void', animate('300ms'))
]);
]),
public static slideInTop = trigger('slideInTop', [
trigger('slideInTop', [
state('void', style({
transform: 'translateY(-100%)',
display : 'none'
@@ -67,9 +113,9 @@ export class Animations
})),
transition('void => *', animate('300ms')),
transition('* => void', animate('300ms'))
]);
]),
public static slideInBottom = trigger('slideInBottom', [
trigger('slideInBottom', [
state('void',
style({
transform: 'translateY(100%)',
@@ -81,9 +127,9 @@ export class Animations
})),
transition('void => *', animate('300ms')),
transition('* => void', animate('300ms'))
]);
]),
public static routerTransitionLeft = trigger('routerTransitionLeft', [
trigger('routerTransitionLeft', [
transition('* => *', [
query('fuse-content > :enter, fuse-content > :leave', [
@@ -108,7 +154,7 @@ export class Animations
transform: 'translateX(0)',
opacity : 1
}),
animate('400ms cubic-bezier(0.250, 0.460, 0.450, 0.940)',
animate('600ms cubic-bezier(0.0, 0.0, 0.2, 1)',
style({
transform: 'translateX(-100%)',
opacity : 0
@@ -116,7 +162,7 @@ export class Animations
], {optional: true}),
query('fuse-content > :enter', [
style({transform: 'translateX(100%)'}),
animate('400ms cubic-bezier(0.250, 0.460, 0.450, 0.940)',
animate('600ms cubic-bezier(0.0, 0.0, 0.2, 1)',
style({
transform: 'translateX(0%)',
opacity : 1
@@ -127,9 +173,9 @@ export class Animations
query('fuse-content > :enter', animateChild(), {optional: true})
])
])
]);
]),
public static routerTransitionRight = trigger('routerTransitionRight', [
trigger('routerTransitionRight', [
transition('* => *', [
query('fuse-content > :enter, fuse-content > :leave', [
@@ -154,7 +200,7 @@ export class Animations
transform: 'translateX(0)',
opacity : 1
}),
animate('400ms cubic-bezier(0.250, 0.460, 0.450, 0.940)',
animate('600ms cubic-bezier(0.0, 0.0, 0.2, 1)',
style({
transform: 'translateX(100%)',
opacity : 0
@@ -162,7 +208,7 @@ export class Animations
], {optional: true}),
query('fuse-content > :enter', [
style({transform: 'translateX(-100%)'}),
animate('400ms cubic-bezier(0.250, 0.460, 0.450, 0.940)',
animate('600ms cubic-bezier(0.0, 0.0, 0.2, 1)',
style({
transform: 'translateX(0%)',
opacity : 1
@@ -173,9 +219,9 @@ export class Animations
query('fuse-content > :enter', animateChild(), {optional: true})
])
])
]);
]),
public static routerTransitionUp = trigger('routerTransitionUp', [
trigger('routerTransitionUp', [
transition('* => *', [
query('fuse-content > :enter, fuse-content > :leave', [
@@ -193,35 +239,33 @@ export class Animations
opacity : 0
})
], {optional: true}),
sequence([
group([
query('fuse-content > :leave', [
group([
query('fuse-content > :leave', [
style({
transform: 'translateY(0)',
opacity : 1
}),
animate('600ms cubic-bezier(0.0, 0.0, 0.2, 1)',
style({
transform: 'translateY(0)',
transform: 'translateY(-100%)',
opacity : 0
}))
], {optional: true}),
query('fuse-content > :enter', [
style({transform: 'translateY(100%)'}),
animate('600ms cubic-bezier(0.0, 0.0, 0.2, 1)',
style({
transform: 'translateY(0%)',
opacity : 1
}),
animate('400ms cubic-bezier(0.250, 0.460, 0.450, 0.940)',
style({
transform: 'translateY(-100%)',
opacity : 0
}))
], {optional: true}),
query('fuse-content > :enter', [
style({transform: 'translateY(100%)'}),
animate('400ms cubic-bezier(0.250, 0.460, 0.450, 0.940)',
style({
transform: 'translateY(0%)',
opacity : 1
}))
], {optional: true})
]),
query('fuse-content > :leave', animateChild(), {optional: true}),
query('fuse-content > :enter', animateChild(), {optional: true})
])
}))
], {optional: true})
]),
query('fuse-content > :leave', animateChild(), {optional: true}),
query('fuse-content > :enter', animateChild(), {optional: true})
])
]);
]),
public static routerTransitionDown = trigger('routerTransitionDown', [
trigger('routerTransitionDown', [
transition('* => *', [
query('fuse-content > :enter, fuse-content > :leave', [
@@ -246,7 +290,7 @@ export class Animations
transform: 'translateY(0)',
opacity : 1
}),
animate('400ms cubic-bezier(0.250, 0.460, 0.450, 0.940)',
animate('600ms cubic-bezier(0.0, 0.0, 0.2, 1)',
style({
transform: 'translateY(100%)',
opacity : 0
@@ -254,7 +298,7 @@ export class Animations
], {optional: true}),
query('fuse-content > :enter', [
style({transform: 'translateY(-100%)'}),
animate('400ms cubic-bezier(0.250, 0.460, 0.450, 0.940)',
animate('600ms cubic-bezier(0.0, 0.0, 0.2, 1)',
style({
transform: 'translateY(0%)',
opacity : 1
@@ -265,11 +309,11 @@ export class Animations
query('fuse-content > :enter', animateChild(), {optional: true})
])
])
]);
]),
public static routerTransitionFade = trigger('routerTransitionFade', [
trigger('routerTransitionFade', [
transition('* => *', [
transition('* => *', group([
query('fuse-content > :enter, fuse-content > :leave ', [
style({
@@ -280,33 +324,32 @@ export class Animations
right : 0
})
], {optional: true}),
query('fuse-content > :enter', [
style({
opacity: 0
})
], {optional: true}),
// sequence([
query('fuse-content > :leave', [
style({
opacity: 1
}),
animate('300ms cubic-bezier(0.250, 0.460, 0.450, 0.940)',
style({
opacity: 0
}))
], {optional: true}),
query('fuse-content > :enter', [
query('fuse-content > :leave', [
style({
opacity: 1
}),
animate('300ms cubic-bezier(0.0, 0.0, 0.2, 1)',
style({
opacity: 0
}),
animate('300ms cubic-bezier(0.250, 0.460, 0.450, 0.940)',
style({
opacity: 1
}))
], {optional: true}),
// ]),
}))
], {optional: true}),
query('fuse-content > :enter', [
style({
opacity: 0
}),
animate('300ms cubic-bezier(0.0, 0.0, 0.2, 1)',
style({
opacity: 1
}))
], {optional: true}),
query('fuse-content > :enter', animateChild(), {optional: true}),
query('fuse-content > :leave', animateChild(), {optional: true})
])
]);
}
]))
])
];

View File

@@ -1,6 +1,6 @@
<h1 md-dialog-title>Confirm</h1>
<div md-dialog-content>{{confirmMessage}}</div>
<div md-dialog-actions class="pt-24">
<button md-raised-button class="mat-accent mr-16" (click)="dialogRef.close(true)">Confirm</button>
<button md-button (click)="dialogRef.close(false)">Cancel</button>
<h1 matDialogTitle>Confirm</h1>
<div mat-dialog-content>{{confirmMessage}}</div>
<div mat-dialog-actions class="pt-24">
<button mat-raised-button class="mat-accent mr-16" (click)="dialogRef.close(true)">Confirm</button>
<button mat-button (click)="dialogRef.close(false)">Cancel</button>
</div>

View File

@@ -1,5 +1,5 @@
import { Component, OnInit } from '@angular/core';
import { MdDialogRef } from '@angular/material';
import { MatDialogRef } from '@angular/material';
@Component({
selector : 'fuse-confirm-dialog',
@@ -10,7 +10,7 @@ export class FuseConfirmDialogComponent implements OnInit
{
public confirmMessage: string;
constructor(public dialogRef: MdDialogRef<FuseConfirmDialogComponent>)
constructor(public dialogRef: MatDialogRef<FuseConfirmDialogComponent>)
{
}

View File

@@ -0,0 +1,65 @@
/**
* This class is based on the code in the following projects:
*
* - https://github.com/zenorocha/select
* - https://github.com/zenorocha/clipboard.js/
*
* Both released under MIT license - © Zeno Rocha
*/
import { Injectable } from '@angular/core';
@Injectable()
export class CopierService
{
private textarea: HTMLTextAreaElement;
/** Copy the text value to the clipboard. */
copyText(text: string): boolean
{
this.createTextareaAndSelect(text);
const copySuccessful = document.execCommand('copy');
this.removeFake();
return copySuccessful;
}
/**
* Creates a hidden textarea element, sets its value from `text` property,
* and makes a selection on it.
*/
private createTextareaAndSelect(text: string)
{
// Create a fake element to hold the contents to copy
this.textarea = document.createElement('textarea');
// Prevent zooming on iOS
this.textarea.style.fontSize = '12pt';
// Hide the element
this.textarea.classList.add('cdk-visually-hidden');
// Move element to the same position vertically
const yPosition = window.pageYOffset || document.documentElement.scrollTop;
this.textarea.style.top = yPosition + 'px';
this.textarea.setAttribute('readonly', '');
this.textarea.value = text;
document.body.appendChild(this.textarea);
this.textarea.select();
this.textarea.setSelectionRange(0, this.textarea.value.length);
}
/** Remove the text area from the DOM. */
private removeFake()
{
if ( this.textarea )
{
document.body.removeChild(this.textarea);
this.textarea = null;
}
}
}

View File

@@ -1,100 +1,100 @@
<div class="demo-sidenav">
<md-list>
<h3 md-subheader>Sidenav Demo</h3>
<mat-list>
<h3 matSubheader>Sidenav Demo</h3>
<md-list-item>
<mat-list-item>
<span>Sidenav Item 1</span>
</md-list-item>
</mat-list-item>
<md-divider></md-divider>
<mat-divider></mat-divider>
<md-list-item>
<mat-list-item>
<span>Sidenav Item 2</span>
</md-list-item>
</mat-list-item>
<md-divider></md-divider>
<mat-divider></mat-divider>
<md-list-item>
<mat-list-item>
<span>Sidenav Item 3</span>
</md-list-item>
</mat-list-item>
<md-divider></md-divider>
<mat-divider></mat-divider>
<md-list-item>
<mat-list-item>
<span>Sidenav Item 4</span>
</md-list-item>
</mat-list-item>
<md-divider></md-divider>
<mat-divider></mat-divider>
<md-list-item>
<mat-list-item>
<span>Sidenav Item 5</span>
</md-list-item>
</mat-list-item>
<md-divider></md-divider>
<mat-divider></mat-divider>
<md-list-item>
<mat-list-item>
<span>Sidenav Item 6</span>
</md-list-item>
</mat-list-item>
<md-divider></md-divider>
<mat-divider></mat-divider>
<md-list-item>
<mat-list-item>
<span>Sidenav Item 7</span>
</md-list-item>
</mat-list-item>
<md-divider></md-divider>
<mat-divider></mat-divider>
<md-list-item>
<mat-list-item>
<span>Sidenav Item 8</span>
</md-list-item>
</mat-list-item>
<md-divider></md-divider>
<mat-divider></mat-divider>
<md-list-item>
<mat-list-item>
<span>Sidenav Item 9</span>
</md-list-item>
</mat-list-item>
<md-divider></md-divider>
<mat-divider></mat-divider>
<md-list-item>
<mat-list-item>
<span>Sidenav Item 10</span>
</md-list-item>
</mat-list-item>
<md-divider></md-divider>
<mat-divider></mat-divider>
<md-list-item>
<mat-list-item>
<span>Sidenav Item 11</span>
</md-list-item>
</mat-list-item>
<md-divider></md-divider>
<mat-divider></mat-divider>
<md-list-item>
<mat-list-item>
<span>Sidenav Item 12</span>
</md-list-item>
</mat-list-item>
<md-divider></md-divider>
<mat-divider></mat-divider>
<md-list-item>
<mat-list-item>
<span>Sidenav Item 13</span>
</md-list-item>
</mat-list-item>
<md-divider></md-divider>
<mat-divider></mat-divider>
<md-list-item>
<mat-list-item>
<span>Sidenav Item 14</span>
</md-list-item>
</mat-list-item>
<md-divider></md-divider>
<mat-divider></mat-divider>
<md-list-item>
<mat-list-item>
<span>Sidenav Item 15</span>
</md-list-item>
</mat-list-item>
<md-divider></md-divider>
<mat-divider></mat-divider>
<md-list-item>
<mat-list-item>
<span>Sidenav Item 16</span>
</md-list-item>
</mat-list-item>
</md-list>
</mat-list>
</div>

View File

@@ -1,23 +1,23 @@
<button md-icon-button
<button mat-icon-button
type="button"
class="mat-elevation-z1"
[mdMenuTriggerFor]="colorMenu"
[matMenuTriggerFor]="colorMenu"
(onMenuOpen)="onMenuOpen()"
[ngClass]="'md-'+selectedPalette+'-'+selectedHue+'-bg'">
<md-icon>palette</md-icon>
[ngClass]="'mat-'+selectedPalette+'-'+selectedHue+'-bg'">
<mat-icon>palette</mat-icon>
</button>
<md-menu #colorMenu="mdMenu" class="fuse-material-color-picker-menu">
<mat-menu #colorMenu="matMenu" class="fuse-material-color-picker-menu">
<header [ngClass]="selectedColor?.class || 'md-accent-bg'"
<header [ngClass]="selectedColor?.class || 'mat-accent-bg'"
class="mat-elevation-z4"
fxLayout="row"
fxLayoutAlign="space-between center">
<button md-icon-button
<button mat-icon-button
[style.visibility]="view==='hues'?'visible':'hidden'"
(click)="$event.stopPropagation();backToPaletteSelection()" aria-label="Palette">
<md-icon class="s-20">arrow_back</md-icon>
<mat-icon class="s-20">arrow_back</mat-icon>
</button>
<span *ngIf="selectedColor?.palette">
@@ -28,11 +28,11 @@
Select Color
</span>
<button md-icon-button
<button mat-icon-button
class="remove-color-button"
(click)="removeColor()"
aria-label="Remove Color">
<md-icon class="s-20">delete</md-icon>
<mat-icon class="s-20">delete</mat-icon>
</button>
</header>
@@ -45,12 +45,12 @@
<div fxLayout="row" fxLayoutWrap
fxLayoutAlign="start start"
class="colors" perfect-scrollbar>
class="colors" fusePerfectScrollbar>
<div class="color"
[ngClass]="'md-'+color.key+'-bg'"
[ngClass]="'mat-'+color.key+'-bg'"
*ngFor="let color of (colors | keys)"
(click)="$event.stopPropagation();selectPalette(color.key)"
fxLayout="row" fxLayoutAlign="start end" md-ink-ripple>
fxLayout="row" fxLayoutAlign="start end" mat-ink-ripple>
<span class="label">
{{color.key}}
</span>
@@ -63,20 +63,20 @@
[@slideInRight]>
<div fxLayout="row" fxLayoutWrap
fxLayoutAlign="start start"
class="colors" perfect-scrollbar>
class="colors" fusePerfectScrollbar>
<div class="color"
*ngFor="let hue of hues"
[fxHide]="selectedPalette === 'white' && hue !== '500'|| selectedPalette === 'black' && hue !== '500'"
[ngClass]="'md-'+selectedPalette+'-'+hue+'-bg'"
[ngClass]="'mat-'+selectedPalette+'-'+hue+'-bg'"
(click)="selectHue(hue)"
fxLayout="row" fxLayoutAlign="start end" md-ink-ripple>
fxLayout="row" fxLayoutAlign="start end" mat-ink-ripple>
<span class="label">
{{hue}}
</span>
<md-icon *ngIf="selectedHue === hue" class="s-16">check</md-icon>
<mat-icon *ngIf="selectedHue === hue" class="s-16">check</mat-icon>
</div>
</div>
</div>
</div>
</md-menu>
</mat-menu>

View File

@@ -11,7 +11,7 @@
overflow: hidden;
min-height: 258px;
height: 308px;
background-color: #f7f7f7;
background-color: #F7F7F7;
.view {
position: absolute;
@@ -39,7 +39,7 @@
font-size: 10px;
}
md-icon {
mat-icon {
position: absolute;
top: 2px;
right: 2px;

View File

@@ -1,12 +1,12 @@
import { Component, EventEmitter, Input, OnChanges, OnInit, Output, ViewEncapsulation } from '@angular/core';
import { MatColors } from '../../matColors';
import { Animations } from '../../animations';
import { fuseAnimations } from '../../animations';
@Component({
selector : 'fuse-material-color-picker',
templateUrl : './material-color-picker.component.html',
styleUrls : ['./material-color-picker.component.scss'],
animations : [Animations.slideInLeft, Animations.slideInRight],
animations : fuseAnimations,
encapsulation: ViewEncapsulation.None
})
export class FuseMaterialColorPickerComponent implements OnInit, OnChanges
@@ -129,7 +129,7 @@ export class FuseMaterialColorPickerComponent implements OnInit, OnChanges
{
this.selectedBg = MatColors.getColor(this.selectedPalette)[this.selectedHue];
this.selectedFg = MatColors.getColor(this.selectedPalette).contrast[this.selectedHue];
this.selectedClass = 'md-' + this.selectedPalette + '-' + this.selectedHue + '-bg';
this.selectedClass = 'mat-' + this.selectedPalette + '-' + this.selectedHue + '-bg';
}
else
{

View File

@@ -1,7 +1,7 @@
<a class="nav-link" md-ripple>
<md-icon class="nav-link-icon" *ngIf="item.icon">{{item.icon}}</md-icon>
<a class="nav-link" matRipple>
<mat-icon class="nav-link-icon" *ngIf="item.icon">{{item.icon}}</mat-icon>
<span class="nav-link-title">{{item.title}}</span>
<md-icon class="collapse-arrow">keyboard_arrow_right</md-icon>
<mat-icon class="collapse-arrow">keyboard_arrow_right</mat-icon>
</a>
<div class="children" [ngClass]="{'open': isOpen}">
@@ -9,9 +9,9 @@
<div class="{{fuseSettings.colorClasses.navbar}}">
<ng-container *ngFor="let item of item.children">
<fuse-nav-horizontal-item *ngIf="item.type=='nav-item'" [item]="item"></fuse-nav-horizontal-item>
<fuse-nav-horizontal-collapse *ngIf="item.type=='nav-collapse'"
[item]="item"></fuse-nav-horizontal-collapse>
<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>

View File

@@ -1,5 +1,5 @@
import { Component, HostBinding, HostListener, Input, OnDestroy } from '@angular/core';
import { Animations } from '../../../../animations';
import { fuseAnimations } from '../../../../animations';
import { FuseConfigService } from '../../../../services/config.service';
import { Subscription } from 'rxjs/Subscription';
@@ -7,7 +7,7 @@ import { Subscription } from 'rxjs/Subscription';
selector : 'fuse-nav-horizontal-collapse',
templateUrl: './nav-horizontal-collapse.component.html',
styleUrls : ['./nav-horizontal-collapse.component.scss'],
animations : [Animations.slideInOut]
animations : fuseAnimations
})
export class FuseNavHorizontalCollapseComponent implements OnDestroy
{

View File

@@ -1,6 +1,17 @@
<a class="nav-link" md-ripple
[routerLink]="[item.url]" routerLinkActive="active">
<md-icon class="nav-link-icon" *ngIf="item.icon">{{item.icon}}</md-icon>
<a class="nav-link" *ngIf="item.url" [routerLink]="[item.url]" routerLinkActive="active" matRipple>
<mat-icon class="nav-link-icon" *ngIf="item.icon">{{item.icon}}</mat-icon>
<span class="nav-link-title">{{item.title}}</span>
<span class="nav-link-badge" *ngIf="item.badge" [ngStyle]="{'background-color': item.badge.bg,'color': item.badge.fg}">{{item.badge.title}}</span>
</a>
<span class="nav-link-badge" *ngIf="item.badge"
[ngStyle]="{'background-color': item.badge.bg,'color': item.badge.fg}">
{{item.badge.title}}
</span>
</a>
<span class="nav-link" *ngIf="item.function" (click)="item.function()" matRipple>
<mat-icon class="nav-link-icon" *ngIf="item.icon">{{item.icon}}</mat-icon>
<span class="nav-link-title">{{item.title}}</span>
<span class="nav-link-badge" *ngIf="item.badge"
[ngStyle]="{'background-color': item.badge.bg,'color': item.badge.fg}">
{{item.badge.title}}
</span>
</span>

View File

@@ -1,27 +1,32 @@
<div id="main-navigation" class="nav" [ngClass]="{'horizontal':layout === 'horizontal'}">
<div id="main-navigation" class="nav"
[ngClass]="{'horizontal':layout === 'horizontal', 'vertical':layout === 'vertical'}">
<!-- Vertical Navigation Layout -->
<ng-container *ngIf="layout === 'vertical'">
<ng-container *ngFor="let item of verticalNavigation">
<ng-container *ngFor="let item of navigationModel">
<fuse-nav-vertical-subheader *ngIf="item.type=='subheader'" [item]="item"></fuse-nav-vertical-subheader>
<fuse-nav-vertical-item *ngIf="item.type=='nav-item'" [item]="item"></fuse-nav-vertical-item>
<fuse-nav-vertical-collapse *ngIf="item.type=='nav-collapse'" [item]="item"></fuse-nav-vertical-collapse>
<fuse-nav-vertical-group *ngIf="item.type=='group'" [item]="item"></fuse-nav-vertical-group>
<fuse-nav-vertical-collapse *ngIf="item.type=='collapse'" [item]="item"></fuse-nav-vertical-collapse>
<fuse-nav-vertical-item *ngIf="item.type=='item'" [item]="item"></fuse-nav-vertical-item>
</ng-container>
</ng-container>
<!-- / Vertical Navigation Layout -->
<!-- Horizontal Navigation Layout -->
<ng-container *ngIf="layout === 'horizontal'">
<ng-container *ngFor="let item of horizontalNavigation">
<ng-container *ngFor="let item of navigationModel">
<fuse-nav-horizontal-collapse *ngIf="item.type=='group'" [item]="item"></fuse-nav-horizontal-collapse>
<fuse-nav-horizontal-collapse *ngIf="item.type=='collapse'" [item]="item"></fuse-nav-horizontal-collapse>
<fuse-nav-horizontal-item *ngIf="item.type=='nav-item'" [item]="item"></fuse-nav-horizontal-item>
<fuse-nav-horizontal-collapse *ngIf="item.type=='nav-collapse'"
[item]="item"></fuse-nav-horizontal-collapse>
</ng-container>
</ng-container>
<!-- / Horizontal Navigation Layout -->
</div>

View File

@@ -1,5 +1,6 @@
import { Component, Input, ViewEncapsulation } from '@angular/core';
import { Component, Input, OnDestroy, ViewEncapsulation } from '@angular/core';
import { FuseNavigationService } from './navigation.service';
import { Subscription } from 'rxjs/Subscription';
@Component({
selector : 'fuse-navigation',
@@ -7,17 +8,25 @@ import { FuseNavigationService } from './navigation.service';
styleUrls : ['./navigation.component.scss'],
encapsulation: ViewEncapsulation.None
})
export class FuseNavigationComponent
export class FuseNavigationComponent implements OnDestroy
{
verticalNavigation: any[];
horizontalNavigation: any[];
navigationModel: any[];
navigationModelChangeSubscription: Subscription;
@Input('layout') layout = 'vertical';
constructor(private navigationService: FuseNavigationService)
constructor(private fuseNavigationService: FuseNavigationService)
{
this.verticalNavigation = navigationService.getNavigation('verticalNavItems');
this.horizontalNavigation = navigationService.getNavigation('horizontalNavItems');
this.navigationModelChangeSubscription =
this.fuseNavigationService.onNavigationModelChange
.subscribe((navigationModel) => {
this.navigationModel = navigationModel;
});
}
ngOnDestroy()
{
this.navigationModelChangeSubscription.unsubscribe();
}
}

View File

@@ -4,7 +4,7 @@ import { RouterModule } from '@angular/router';
import { FuseNavigationComponent } from './navigation.component';
import { FuseNavVerticalItemComponent } from './vertical/nav-item/nav-vertical-item.component';
import { FuseNavVerticalCollapseComponent } from './vertical/nav-collapse/nav-vertical-collapse.component';
import { FuseNavVerticalSubheaderComponent } from './vertical/nav-subheader/nav-vertical-subheader.component';
import { FuseNavVerticalGroupComponent } from './vertical/nav-group/nav-vertical-group.component';
import { FuseNavHorizontalItemComponent } from './horizontal/nav-item/nav-horizontal-item.component';
import { FuseNavHorizontalCollapseComponent } from './horizontal/nav-collapse/nav-horizontal-collapse.component';
@@ -18,7 +18,7 @@ import { FuseNavHorizontalCollapseComponent } from './horizontal/nav-collapse/na
],
declarations: [
FuseNavigationComponent,
FuseNavVerticalSubheaderComponent,
FuseNavVerticalGroupComponent,
FuseNavVerticalItemComponent,
FuseNavVerticalCollapseComponent,
FuseNavHorizontalItemComponent,

View File

@@ -1,25 +1,151 @@
import { EventEmitter, Injectable } from '@angular/core';
import { FuseNavigation } from '../../../navigation.model';
import { NavigationModel } from '../../../navigation.model';
import { BehaviorSubject } from 'rxjs/BehaviorSubject';
@Injectable()
export class FuseNavigationService
{
onNavCollapseToggle = new EventEmitter<any>();
onNavCollapseToggled = new EventEmitter<any>();
navigation: FuseNavigation;
onNavigationModelChange: BehaviorSubject<any> = new BehaviorSubject({});
navigationModel: NavigationModel;
flatNavigation: any[] = [];
constructor()
{
this.navigation = new FuseNavigation();
this.navigationModel = new NavigationModel();
this.onNavigationModelChange.next(this.navigationModel.model);
}
/**
* Get navigation array
* Get navigation model
*
* @returns {any[]}
*/
getNavigation(item)
getNavigationModel()
{
return this.navigation[item];
return this.navigationModel.model;
}
/**
* Set the navigation model
*
* @param model
*/
setNavigationModel(model)
{
this.navigationModel = model;
this.onNavigationModelChange.next(this.navigationModel.model);
}
/**
* Add new navigation item
* to the given location
*/
addNavigationItem(location, item)
{
// Parse the location
const locationArr = location.split('.');
if ( locationArr.length === 0 )
{
return;
}
// Find the navigation item
const navItem = this.findNavigationItemById(locationArr);
// Act according to the item type
switch ( navItem.type )
{
case 'item':
// Create a children array
navItem.children = [];
// Push the item
navItem.children.push(item);
// Change the item type to collapsable
navItem.type = 'collapse';
break;
case 'collapse':
// Push the item
navItem.children.push(item);
break;
case 'group':
// Push the item
navItem.children.push(item);
break;
default:
break;
}
}
/**
* Get navigation item from
* given location
*
* @param location
*/
getNavigationItem(location)
{
// Parse the location
const locationArr = location.split('.');
if ( locationArr.length === 0 )
{
return;
}
// Find and return the navigation item
return this.findNavigationItemById(locationArr);
}
/**
* Find navigation item by location
*
* @param location
* @param navigation
*/
findNavigationItemById(location, navigation?)
{
if ( !navigation )
{
navigation = this.navigationModel.model;
}
// Iterate through the given navigation
for ( const navItem of navigation )
{
// If the nav item id equals the first location...
if ( navItem.id === location[0] )
{
// If there is more location to look at...
if ( location.length > 1 )
{
// Remove the first item of the location
location.splice(0, 1);
// Go nested...
return this.findNavigationItemById(location, navItem.children);
}
// Otherwise just return the nav item
else
{
return navItem;
}
}
}
}
/**
@@ -31,7 +157,7 @@ export class FuseNavigationService
{
if ( !navigationItems )
{
navigationItems = this.navigation;
navigationItems = this.navigationModel.model;
}
for ( const navItem of navigationItems )
@@ -41,7 +167,7 @@ export class FuseNavigationService
continue;
}
if ( navItem.type === 'nav-item' )
if ( navItem.type === 'item' )
{
this.flatNavigation.push({
title: navItem.title,
@@ -53,7 +179,7 @@ export class FuseNavigationService
continue;
}
if ( navItem.type === 'nav-collapse' )
if ( navItem.type === 'collapse' || navItem.type === 'group' )
{
this.getFlatNavigation(navItem.children);
}

View File

@@ -1,11 +1,12 @@
<a class="nav-link" md-ripple (click)="toggleOpen($event)">
<md-icon class="nav-link-icon" *ngIf="item.icon">{{item.icon}}</md-icon>
<a class="nav-link" matRipple (click)="toggleOpen($event)">
<mat-icon class="nav-link-icon" *ngIf="item.icon">{{item.icon}}</mat-icon>
<span class="nav-link-title">{{item.title}}</span>
<md-icon class="collapse-arrow">keyboard_arrow_right</md-icon>
<mat-icon class="collapse-arrow">keyboard_arrow_right</mat-icon>
</a>
<div class="children" [@slideInOut]="isOpen">
<ng-container *ngFor="let item of item.children">
<fuse-nav-vertical-item *ngIf="item.type=='nav-item'" [item]="item"></fuse-nav-vertical-item>
<fuse-nav-vertical-collapse *ngIf="item.type=='nav-collapse'" [item]="item"></fuse-nav-vertical-collapse>
<fuse-nav-vertical-item *ngIf="item.type=='item'" [item]="item"></fuse-nav-vertical-item>
<fuse-nav-vertical-collapse *ngIf="item.type=='collapse'" [item]="item"></fuse-nav-vertical-collapse>
<fuse-nav-vertical-group *ngIf="item.type=='group'" [item]="item"></fuse-nav-vertical-group>
</ng-container>
</div>

View File

@@ -1,13 +1,13 @@
import { Component, HostBinding, Input, OnInit } from '@angular/core';
import { FuseNavigationService } from '../../navigation.service';
import { NavigationEnd, Router } from '@angular/router';
import { Animations } from '../../../../animations';
import { fuseAnimations } from '../../../../animations';
@Component({
selector : 'fuse-nav-vertical-collapse',
templateUrl: './nav-vertical-collapse.component.html',
styleUrls : ['./nav-vertical-collapse.component.scss'],
animations : [Animations.slideInOut]
animations : fuseAnimations
})
export class FuseNavVerticalCollapseComponent implements OnInit
{
@@ -15,21 +15,20 @@ export class FuseNavVerticalCollapseComponent implements OnInit
@HostBinding('class') classes = 'nav-collapse nav-item';
@HostBinding('class.open') public isOpen = false;
constructor(private navigationService: FuseNavigationService, private router: Router)
constructor(
private navigationService: FuseNavigationService,
private router: Router
)
{
/**
* When navigation changed
*/
// Listen for route changes
router.events.subscribe(
(event) => {
if ( event instanceof NavigationEnd )
{
/**
* Check if the url is child of the collapse
*/
// Check if the url can be found in
// one of the children of this item
if ( this.isUrlInChildren(this.item, event.urlAfterRedirects) )
{
// console.log(this.item);
this.expand();
}
else
@@ -40,47 +39,54 @@ export class FuseNavVerticalCollapseComponent implements OnInit
}
);
/**
* Whenever a navigation collapse item toggled
*/
this.navigationService.onNavCollapseToggled.subscribe(
(clickedItem) => {
if ( clickedItem.children )
{
/**
* if clicked collapse is child of this collapse
* return
*/
if ( this.item.children.indexOf(clickedItem) !== -1 )
// Listen for collapsing of any navigation item
this.navigationService.onNavCollapseToggled
.subscribe(
(clickedItem) => {
if ( clickedItem && clickedItem.children )
{
return;
}
/**
* If collapsed item is not related with this collapse
* collapse
*/
if ( this.item !== clickedItem )
{
this.collapse();
// Check if the clicked item is one
// of the children of this item
if ( this.isChildrenOf(this.item, clickedItem) )
{
return;
}
// Check if the url can be found in
// one of the children of this item
if ( this.isUrlInChildren(this.item, this.router.url) )
{
return;
}
// If the clicked item is not this item, collapse...
if ( this.item !== clickedItem )
{
this.collapse();
}
}
}
}
);
);
}
/**
* Toggle Collapse
* Toggle collapse
*
* @param ev
*/
toggleOpen(ev)
{
ev.preventDefault();
this.isOpen = !this.isOpen;
// Navigation collapse toggled...
this.navigationService.onNavCollapseToggled.emit(this.item);
this.navigationService.onNavCollapseToggle.emit();
}
/**
* Expand
* Expand the collapsable navigation
*/
expand()
{
@@ -88,11 +94,13 @@ export class FuseNavVerticalCollapseComponent implements OnInit
{
return;
}
this.isOpen = true;
this.navigationService.onNavCollapseToggle.emit();
}
/**
* Collapse
* Collapse the collapsable navigation
*/
collapse()
{
@@ -101,32 +109,64 @@ export class FuseNavVerticalCollapseComponent implements OnInit
return;
}
this.isOpen = false;
this.navigationService.onNavCollapseToggle.emit();
}
/**
* Checking the url is in children
* @param arr
* @param url
* @returns {any}
* Check if the given parent has the
* given item in one of its children
*
* @param parent
* @param item
* @return {any}
*/
isUrlInChildren(arr, url)
isChildrenOf(parent, item)
{
if ( !arr.children )
if ( !parent.children )
{
return false;
}
for ( let i = 0; i < arr.children.length; i++ )
if ( parent.children.indexOf(item) !== -1 )
{
if ( arr.children[i].children )
return true;
}
for ( const children of parent.children )
{
if ( children.children )
{
if ( this.isUrlInChildren(arr.children[i], url) )
return this.isChildrenOf(children, item);
}
}
}
/**
* Check if the given url can be found
* in one of the given parent's children
*
* @param parent
* @param url
* @returns {any}
*/
isUrlInChildren(parent, url)
{
if ( !parent.children )
{
return false;
}
for ( let i = 0; i < parent.children.length; i++ )
{
if ( parent.children[i].children )
{
if ( this.isUrlInChildren(parent.children[i], url) )
{
return true;
}
}
if ( arr.children[i].url === url )
if ( parent.children[i].url === url )
{
return true;
}
@@ -135,11 +175,6 @@ export class FuseNavVerticalCollapseComponent implements OnInit
return false;
}
public isCollapsed(): boolean
{
return this.isOpen;
}
ngOnInit()
{
}

View File

@@ -0,0 +1,10 @@
<div class="group-title">
<span class="hint-text">{{ item.title }}</span>
</div>
<div class="group-items">
<ng-container *ngFor="let item of item.children">
<fuse-nav-vertical-group *ngIf="item.type=='group'" [item]="item"></fuse-nav-vertical-group>
<fuse-nav-vertical-collapse *ngIf="item.type=='collapse'" [item]="item"></fuse-nav-vertical-collapse>
<fuse-nav-vertical-item *ngIf="item.type=='item'" [item]="item"></fuse-nav-vertical-item>
</ng-container>
</div>

View File

@@ -0,0 +1,23 @@
:host {
.folded:not(.folded-open) & {
> .group-title {
align-items: center;
> span {
opacity: 0;
transition: opacity 200ms ease;
}
&:before {
content: '';
display: block;
position: absolute;
min-width: 1.6rem;
border-top: 2px solid;
opacity: 0.2;
}
}
}
}

View File

@@ -0,0 +1,21 @@
import { Component, HostBinding, Input, OnInit } from '@angular/core';
@Component({
selector : 'fuse-nav-vertical-group',
templateUrl: './nav-vertical-group.component.html',
styleUrls : ['./nav-vertical-group.component.scss']
})
export class FuseNavVerticalGroupComponent implements OnInit
{
@HostBinding('class') classes = 'nav-group nav-item';
@Input() item: any;
constructor()
{
}
ngOnInit()
{
}
}

View File

@@ -1,6 +1,17 @@
<a class="nav-link" md-ripple
[routerLink]="[item.url]" routerLinkActive="active">
<md-icon class="nav-link-icon" *ngIf="item.icon">{{item.icon}}</md-icon>
<a class="nav-link" *ngIf="item.url" [routerLink]="[item.url]" routerLinkActive="active" matRipple>
<mat-icon class="nav-link-icon" *ngIf="item.icon">{{item.icon}}</mat-icon>
<span class="nav-link-title">{{item.title}}</span>
<span class="nav-link-badge" *ngIf="item.badge" [ngStyle]="{'background-color': item.badge.bg,'color': item.badge.fg}">{{item.badge.title}}</span>
<span class="nav-link-badge" *ngIf="item.badge"
[ngStyle]="{'background-color': item.badge.bg,'color': item.badge.fg}">
{{item.badge.title}}
</span>
</a>
<span class="nav-link" *ngIf="item.function" (click)="item.function()" matRipple>
<mat-icon class="nav-link-icon" *ngIf="item.icon">{{item.icon}}</mat-icon>
<span class="nav-link-title">{{item.title}}</span>
<span class="nav-link-badge" *ngIf="item.badge"
[ngStyle]="{'background-color': item.badge.bg,'color': item.badge.fg}">
{{item.badge.title}}
</span>
</span>

View File

@@ -1 +0,0 @@
<span class="hint-text">{{ item.title }}</span>

View File

@@ -1,20 +0,0 @@
:host {
.folded:not(.folded-open) & {
&:before {
content: '';
display: block;
position: absolute;
min-width: 1.6rem;
border-top: 2px solid;
opacity: 0.2;
}
> span {
opacity: 0;
transition: opacity 200ms ease;
}
}
}

View File

@@ -1,21 +0,0 @@
import { Component, HostBinding, Input, OnInit } from '@angular/core';
@Component({
selector : 'fuse-nav-vertical-subheader',
templateUrl: './nav-vertical-subheader.component.html',
styleUrls : ['./nav-vertical-subheader.component.scss']
})
export class FuseNavVerticalSubheaderComponent implements OnInit
{
@HostBinding('class') classes = 'nav-subheader';
@Input() item: any;
constructor()
{
}
ngOnInit()
{
}
}

View File

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

View File

@@ -2,8 +2,8 @@
<div class="shortcuts-mobile-toggle" *ngIf="!mobileShortcutsPanelActive" fxLayout="row" fxLayoutAlign="start center"
fxHide fxShow.lt-md>
<button md-icon-button (click)="showMobileShortcutsPanel()">
<md-icon class="amber-600-fg">star</md-icon>
<button mat-icon-button (click)="showMobileShortcutsPanel()">
<mat-icon class="amber-600-fg">star</mat-icon>
</button>
</div>
@@ -16,8 +16,8 @@
<div class="w-40 h-40 p-4" fxLayout="row" fxLayoutAlign="center center"
*ngFor="let shortcutItem of shortcutItems">
<a md-icon-button mdTooltip="{{shortcutItem.title}}" [routerLink]="shortcutItem.url">
<md-icon *ngIf="shortcutItem.icon">{{shortcutItem.icon}}</md-icon>
<a mat-icon-button matTooltip="{{shortcutItem.title}}" [routerLink]="shortcutItem.url">
<mat-icon *ngIf="shortcutItem.icon">{{shortcutItem.icon}}</mat-icon>
<span *ngIf="!shortcutItem.icon" class="h2 secondary-text text-bold">
{{shortcutItem.title.substr(0, 1).toUpperCase()}}
</span>
@@ -25,64 +25,64 @@
</div>
<button md-icon-button [mdMenuTriggerFor]="addMenu" md-tooltip="Click to add/remove shortcut"
<button mat-icon-button [matMenuTriggerFor]="addMenu" matTooltip="Click to add/remove shortcut"
(onMenuOpen)="onMenuOpen()">
<md-icon class="amber-600-fg">star</md-icon>
<mat-icon class="amber-600-fg">star</mat-icon>
</button>
</div>
<div class="shortcuts-mobile-close" fxLayout="row" fxLayoutAlign="start center" fxHide fxShow.lt-md>
<button md-icon-button (click)="hideMobileShortcutsPanel()">
<md-icon>close</md-icon>
<button mat-icon-button (click)="hideMobileShortcutsPanel()">
<mat-icon>close</mat-icon>
</button>
</div>
</div>
<md-menu #addMenu="mdMenu" class="w-240">
<mat-menu #addMenu="matMenu" class="w-240">
<md-input-container class="px-16 w-100-p" (click)="$event.stopPropagation()" floatPlaceholder="never">
<input #searchInput mdInput placeholder="Search for an app or a page" (input)="search($event)">
</md-input-container>
<mat-form-field class="px-16 w-100-p" (click)="$event.stopPropagation()" floatPlaceholder="never">
<input #searchInput matInput placeholder="Search for an app or a page" (input)="search($event)">
</mat-form-field>
<md-divider></md-divider>
<md-nav-list *ngIf="!searching" style="max-height: 312px; overflow: auto" perfect-scrollbar>
<mat-divider></mat-divider>
<mat-nav-list *ngIf="!searching" style="max-height: 312px; overflow: auto" fusePerfectScrollbar>
<md-list-item *ngFor="let shortcutItem of shortcutItems"
(click)="toggleShortcut($event, shortcutItem)">
<mat-list-item *ngFor="let shortcutItem of shortcutItems"
(click)="toggleShortcut($event, shortcutItem)">
<div class="w-100-p" fxLayout="row" fxLayoutAlign="start center">
<md-icon md-list-icon class="mr-8" *ngIf="shortcutItem.icon">{{shortcutItem.icon}}</md-icon>
<mat-icon mat-list-icon class="mr-8" *ngIf="shortcutItem.icon">{{shortcutItem.icon}}</mat-icon>
<span class="h2 w-32 h-32 p-4 mr-8 secondary-text text-bold" fxLayout="row"
fxLayoutAlign="center center" *ngIf="!shortcutItem.icon">
{{shortcutItem.title.substr(0, 1).toUpperCase()}}
</span>
<p md-line fxFlex>{{shortcutItem.title}}</p>
<md-icon class="ml-8">star</md-icon>
<p matLine fxFlex>{{shortcutItem.title}}</p>
<mat-icon class="ml-8">star</mat-icon>
</div>
</md-list-item>
<md-list-item *ngIf="shortcutItems.length === 0">
</mat-list-item>
<mat-list-item *ngIf="shortcutItems.length === 0">
<p>
<small>No shortcuts yet!</small>
</p>
</md-list-item>
</md-nav-list>
</mat-list-item>
</mat-nav-list>
<md-nav-list *ngIf="searching" style="max-height: 312px; overflow: auto" perfect-scrollbar>
<md-list-item *ngFor="let navigationItem of filteredNavigationItems"
(click)="toggleShortcut($event, navigationItem)">
<mat-nav-list *ngIf="searching" style="max-height: 312px; overflow: auto" fusePerfectScrollbar>
<mat-list-item *ngFor="let navigationItem of filteredNavigationItems"
(click)="toggleShortcut($event, navigationItem)">
<div class="w-100-p" fxLayout="row" fxLayoutAlign="start center">
<md-icon md-list-icon class="mr-8" *ngIf="navigationItem.icon">{{navigationItem.icon}}</md-icon>
<mat-icon mat-list-icon class="mr-8" *ngIf="navigationItem.icon">{{navigationItem.icon}}</mat-icon>
<span class="h2 w-32 h-32 p-4 mr-8 secondary-text text-bold" fxLayout="row"
fxLayoutAlign="center center" *ngIf="!navigationItem.icon">
{{navigationItem.title.substr(0, 1).toUpperCase()}}
</span>
<p md-line fxFlex>{{navigationItem.title}}</p>
<md-icon class="ml-8" *ngIf="isInShortcuts(navigationItem)">star</md-icon>
<p matLine fxFlex>{{navigationItem.title}}</p>
<mat-icon class="ml-8" *ngIf="isInShortcuts(navigationItem)">star</mat-icon>
</div>
</md-list-item>
</md-nav-list>
</md-menu>
</mat-list-item>
</mat-nav-list>
</mat-menu>
</div>

View File

@@ -1,106 +1,99 @@
<button #openButton md-icon-button class="open-button md-primary-bg mat-elevation-z2" (click)="openBar()">
<md-icon>settings</md-icon>
<button #openButton mat-icon-button class="open-button mat-primary-bg mat-elevation-z2" (click)="openBar()">
<mat-icon>settings</mat-icon>
</button>
<div class="theme-options-panel-overlay" #overlay [fxHide]="barClosed" [@fadeInOut]="!barClosed"></div>
<div #panel class="theme-options-panel md-white-bg mat-elevation-z8 p-16">
<div #panel class="theme-options-panel mat-white-bg mat-elevation-z8">
<button md-icon-button class="close-button" (click)="closeBar()">
<md-icon>close</md-icon>
<button mat-icon-button class="close-button" (click)="closeBar()">
<mat-icon>close</mat-icon>
</button>
<md-list>
<h3 md-subheader>Navigation:</h3>
<md-list-item>
<md-radio-group [(ngModel)]="fuseSettings.layout.navigation" (ngModelChange)="onSettingsChange()">
<md-radio-button class="mr-8" value="top">Top</md-radio-button>
<md-radio-button class="mr-8" value="left">Left</md-radio-button>
<md-radio-button class="mr-8" value="right">Right</md-radio-button>
<md-radio-button class="mr-8" value="none">None</md-radio-button>
</md-radio-group>
</md-list-item>
<div class="theme-options-panel-inner" fxLayout="column" fxLayoutAlign="start start">
<h3 md-subheader>Toolbar:</h3>
<md-list-item>
<md-radio-group [(ngModel)]="fuseSettings.layout.toolbar" (ngModelChange)="onSettingsChange()">
<md-radio-button class="mr-8" value="below">Below</md-radio-button>
<md-radio-button class="mr-8" value="above">Above</md-radio-button>
<md-radio-button class="mr-8" value="none">None</md-radio-button>
</md-radio-group>
</md-list-item>
<h3>Navigation:</h3>
<mat-radio-group [(ngModel)]="fuseSettings.layout.navigation" (ngModelChange)="onSettingsChange()"
fxLayout="column" fxLayout.gt-xs="row" fxLayoutAlign="start start" fxLayoutWrap>
<mat-radio-button class="mr-8 mb-8" value="top">Top</mat-radio-button>
<mat-radio-button class="mr-8 mb-8" value="left">Left</mat-radio-button>
<mat-radio-button class="mr-8 mb-8" value="right">Right</mat-radio-button>
<mat-radio-button class="mr-8 mb-8" value="none">None</mat-radio-button>
</mat-radio-group>
<h3 md-subheader>Footer:</h3>
<md-list-item>
<md-radio-group [(ngModel)]="fuseSettings.layout.footer" (ngModelChange)="onSettingsChange()">
<md-radio-button class="mr-8" value="below">Below</md-radio-button>
<md-radio-button class="mr-8" value="above">Above</md-radio-button>
<md-radio-button class="mr-8" value="none">None</md-radio-button>
</md-radio-group>
</md-list-item>
<h3 class="mt-24">Toolbar:</h3>
<mat-radio-group [(ngModel)]="fuseSettings.layout.toolbar" (ngModelChange)="onSettingsChange()"
fxLayout="column" fxLayout.gt-xs="row" fxLayoutAlign="start start" fxLayoutWrap>
<mat-radio-button class="mr-8 mb-8" value="below">Below</mat-radio-button>
<mat-radio-button class="mr-8 mb-8" value="above">Above</mat-radio-button>
<mat-radio-button class="mr-8 mb-8" value="none">None</mat-radio-button>
</mat-radio-group>
<h3 md-subheader>Layout Mode:</h3>
<md-list-item>
<md-radio-group [(ngModel)]="fuseSettings.layout.mode" (ngModelChange)="onSettingsChange()">
<md-radio-button class="mr-8" value="boxed">Boxed</md-radio-button>
<md-radio-button class="mr-8" value="fullwidth">Fullwidth</md-radio-button>
</md-radio-group>
</md-list-item>
<h3 class="mt-24">Footer:</h3>
<mat-radio-group [(ngModel)]="fuseSettings.layout.footer" (ngModelChange)="onSettingsChange()"
fxLayout="column" fxLayout.gt-xs="row" fxLayoutAlign="start start" fxLayoutWrap>
<mat-radio-button class="mr-8 mb-8" value="below">Below</mat-radio-button>
<mat-radio-button class="mr-8 mb-8" value="above">Above</mat-radio-button>
<mat-radio-button class="mr-8 mb-8" value="none">None</mat-radio-button>
</mat-radio-group>
<md-divider></md-divider>
<h3 class="mt-24">Layout Mode:</h3>
<mat-radio-group [(ngModel)]="fuseSettings.layout.mode" (ngModelChange)="onSettingsChange()"
fxLayout="column" fxLayout.gt-xs="row" fxLayoutAlign="start start" fxLayoutWrap>
<mat-radio-button class="mr-8 mb-8" value="boxed">Boxed</mat-radio-button>
<mat-radio-button class="mr-8 mb-8" value="fullwidth">Fullwidth</mat-radio-button>
</mat-radio-group>
<h3 md-subheader>Colors:</h3>
<mat-divider></mat-divider>
<h3>Colors:</h3>
<div class="colors">
<md-list-item class="mb-8">
<div fxFlex fxLayout="row" fxLayoutAlign="space-between center">
<h4>Toolbar Color</h4>
<fuse-material-color-picker [(selectedClass)]="fuseSettings.colorClasses.toolbar" (onValueChange)="onSettingsChange()"></fuse-material-color-picker>
<h4 class="mr-8">Toolbar Color</h4>
<fuse-material-color-picker [(selectedClass)]="fuseSettings.colorClasses.toolbar"
(onValueChange)="onSettingsChange()"></fuse-material-color-picker>
</div>
</md-list-item>
<md-list-item class="mb-8">
<div fxFlex fxLayout="row" fxLayoutAlign="space-between center">
<h4>Navigation Bar Color</h4>
<fuse-material-color-picker [(selectedClass)]="fuseSettings.colorClasses.navbar" (onValueChange)="onSettingsChange()"></fuse-material-color-picker>
<h4 class="mr-8">Navigation Bar Color</h4>
<fuse-material-color-picker [(selectedClass)]="fuseSettings.colorClasses.navbar"
(onValueChange)="onSettingsChange()"></fuse-material-color-picker>
</div>
</md-list-item>
<md-list-item class="mb-8">
<div fxFlex fxLayout="row" fxLayoutAlign="space-between center">
<h4>Footer Color</h4>
<fuse-material-color-picker [(selectedClass)]="fuseSettings.colorClasses.footer" (onValueChange)="onSettingsChange()"></fuse-material-color-picker>
<h4 class="mr-8">Footer Color</h4>
<fuse-material-color-picker [(selectedClass)]="fuseSettings.colorClasses.footer"
(onValueChange)="onSettingsChange()"></fuse-material-color-picker>
</div>
</md-list-item>
<md-divider></md-divider>
</div>
<h3 md-subheader>Animation:</h3>
<mat-divider></mat-divider>
<md-list-item>
<div fxFlex fxLayout="row" fxLayoutAlign="space-between center">
<h4>Router Animation</h4>
<md-select class="p-0" [(ngModel)]="fuseSettings.routerAnimation">
<md-option value="none">
None
</md-option>
<md-option value="slideUp">
Slide up
</md-option>
<md-option value="slideDown">
Slide down
</md-option>
<md-option value="slideRight">
Slide right
</md-option>
<md-option value="slideLeft">
Slide left
</md-option>
<md-option value="fadeIn">
Fade in
</md-option>
</md-select>
</div>
</md-list-item>
<h3>Router Animation:</h3>
<mat-form-field class="w-100-p">
<mat-select class="p-0" [(ngModel)]="fuseSettings.routerAnimation">
<mat-option value="none">
None
</mat-option>
<mat-option value="slideUp">
Slide up
</mat-option>
<mat-option value="slideDown">
Slide down
</mat-option>
<mat-option value="slideRight">
Slide right
</mat-option>
<mat-option value="slideLeft">
Slide left
</mat-option>
<mat-option value="fadeIn">
Fade in
</mat-option>
</mat-select>
</mat-form-field>
</div>
</md-list>
</div>

View File

@@ -14,6 +14,11 @@
display: block;
right: 0;
top: 160px;
z-index: 998;
&.bar-closed .theme-options-panel {
display: none;
}
.theme-options-panel {
position: absolute;
@@ -22,12 +27,38 @@
width: 360px;
transform: translate3d(100%, 0, 0);
z-index: 999;
max-height: calc(100vh - 200px);
padding: 24px;
overflow: auto;
@include media-breakpoint-down('xs') {
top: -120px;
max-height: calc(100vh - 100px);
width: 90vw;
}
.close-button {
position: absolute;
top: 8px;
right: 8px;
}
h3 {
font-size: 14px;
font-weight: 500;
color: rgba(0, 0, 0, 0.54);
}
.mat-divider {
display: block !important;
width: 100%;
margin: 24px 0 16px 0;
}
.colors {
display: block !important;
width: 100%;
}
}
.theme-options-panel-overlay {
@@ -40,6 +71,10 @@
bottom: 0;
z-index: 998;
@include media-breakpoint-down('sm') {
background: rgba(0, 0, 0, 0.37);
}
&.hidden {
display: none;
}
@@ -68,7 +103,7 @@
opacity: .75;
z-index: 998;
md-icon {
mat-icon {
animation: rotating 3s linear infinite;
}

View File

@@ -1,14 +1,15 @@
import { Component, ElementRef, OnDestroy, OnInit, Renderer2, ViewChild } from '@angular/core';
import { Component, ElementRef, HostBinding, OnDestroy, OnInit, Renderer2, ViewChild } from '@angular/core';
import { style, animate, AnimationBuilder, AnimationPlayer } from '@angular/animations';
import { Subscription } from 'rxjs/Subscription';
import { FuseConfigService } from '../../services/config.service';
import { Animations } from '../../animations';
import { fuseAnimations } from '../../animations';
import { FuseNavigationService } from '../navigation/navigation.service';
@Component({
selector : 'fuse-theme-options',
templateUrl: './theme-options.component.html',
styleUrls : ['./theme-options.component.scss'],
animations : [Animations.fadeInOut]
animations : fuseAnimations
})
export class FuseThemeOptionsComponent implements OnInit, OnDestroy
{
@@ -18,13 +19,15 @@ export class FuseThemeOptionsComponent implements OnInit, OnDestroy
public player: AnimationPlayer;
fuseSettings: any;
barClosed: boolean;
onSettingsChanged: Subscription;
@HostBinding('class.bar-closed') barClosed: boolean;
constructor(
private animationBuilder: AnimationBuilder,
private fuseConfig: FuseConfigService,
private navigationService: FuseNavigationService,
private renderer: Renderer2
)
{
@@ -37,6 +40,27 @@ export class FuseThemeOptionsComponent implements OnInit, OnDestroy
this.fuseSettings = newSettings;
}
);
// Get the nav model and add customize nav item
// that opens the bar programmatically
const navModel = this.navigationService.getNavigationModel();
navModel.push({
'id' : 'custom-function',
'title' : 'Custom Function',
'type' : 'group',
'children': [
{
'id' : 'customize',
'title' : 'Customize',
'type' : 'item',
'icon' : 'settings',
'function': () => {
this.openBar();
}
}
]
});
}
ngOnInit()
@@ -53,8 +77,6 @@ export class FuseThemeOptionsComponent implements OnInit, OnDestroy
closeBar()
{
this.barClosed = true;
this.player =
this.animationBuilder
.build([
@@ -63,6 +85,10 @@ export class FuseThemeOptionsComponent implements OnInit, OnDestroy
]).create(this.panel.nativeElement);
this.player.play();
this.player.onDone(() => {
this.barClosed = true;
});
}
openBar()

View File

@@ -21,7 +21,7 @@ export class FuseIfOnDomDirective implements AfterContentChecked
{
setTimeout(() => {
this.viewContainer.createEmbeddedView(this.templateRef);
}, 0);
}, 300);
this.isCreated = true;
}
else if ( this.isCreated && !document.body.contains(this.element.nativeElement) )

View File

@@ -0,0 +1,169 @@
import { AfterViewInit, Directive, ElementRef, OnDestroy, OnInit } from '@angular/core';
import PerfectScrollbar from 'perfect-scrollbar';
import { FuseConfigService } from '../../services/config.service';
import { Subscription } from 'rxjs/Subscription';
import { Platform } from '@angular/cdk/platform';
@Directive({
selector: '[fusePerfectScrollbar]'
})
export class FusePerfectScrollbarDirective implements OnInit, AfterViewInit, OnDestroy
{
onSettingsChanged: Subscription;
isDisableCustomScrollbars = false;
isMobile = false;
isInitialized = true;
ps;
constructor(
private element: ElementRef,
private fuseConfig: FuseConfigService,
private platform: Platform
)
{
this.onSettingsChanged =
this.fuseConfig.onSettingsChanged
.subscribe(
(settings) => {
this.isDisableCustomScrollbars = !settings.customScrollbars;
}
);
if ( this.platform.ANDROID || this.platform.IOS )
{
this.isMobile = true;
}
}
ngOnInit()
{
}
ngAfterViewInit()
{
if ( this.isMobile || this.isDisableCustomScrollbars )
{
this.isInitialized = false;
return;
}
// Initialize the perfect-scrollbar
this.ps = new PerfectScrollbar(this.element.nativeElement);
}
ngOnDestroy()
{
if ( !this.isInitialized )
{
return;
}
this.onSettingsChanged.unsubscribe();
// Destroy the perfect-scrollbar
this.ps.destroy();
}
update()
{
if ( !this.isInitialized )
{
return;
}
// Update the perfect-scrollbar
this.ps.update();
}
destroy()
{
this.ngOnDestroy();
}
scrollToX(x: number, speed?: number)
{
this.animateScrolling('scrollLeft', x, speed);
}
scrollToY(y: number, speed?: number)
{
this.animateScrolling('scrollTop', y, speed);
}
scrollToTop(offset?: number, speed?: number)
{
this.animateScrolling('scrollTop', (offset || 0), speed);
}
scrollToLeft(offset?: number, speed?: number)
{
this.animateScrolling('scrollLeft', (offset || 0), speed);
}
scrollToRight(offset?: number, speed?: number)
{
const width = this.element.nativeElement.scrollWidth;
this.animateScrolling('scrollLeft', width - (offset || 0), speed);
}
scrollToBottom(offset?: number, speed?: number)
{
const height = this.element.nativeElement.scrollHeight;
this.animateScrolling('scrollTop', height - (offset || 0), speed);
}
animateScrolling(target: string, value: number, speed?: number)
{
if ( !speed )
{
this.element.nativeElement[target] = value;
// PS has weird event sending order, this is a workaround for that
this.update();
this.update();
}
else if ( value !== this.element.nativeElement[target] )
{
let newValue = 0;
let scrollCount = 0;
let oldTimestamp = performance.now();
let oldValue = this.element.nativeElement[target];
const cosParameter = (oldValue - value) / 2;
const step = (newTimestamp) => {
scrollCount += Math.PI / (speed / (newTimestamp - oldTimestamp));
newValue = Math.round(value + cosParameter + cosParameter * Math.cos(scrollCount));
// Only continue animation if scroll position has not changed
if ( this.element.nativeElement[target] === oldValue )
{
if ( scrollCount >= Math.PI )
{
this.element.nativeElement[target] = value;
// PS has weird event sending order, this is a workaround for that
this.update();
this.update();
}
else
{
this.element.nativeElement[target] = oldValue = newValue;
oldTimestamp = newTimestamp;
window.requestAnimationFrame(step);
}
}
};
window.requestAnimationFrame(step);
}
}
}

View File

@@ -0,0 +1,99 @@
import { Directive, Input, OnInit, HostListener, OnDestroy, HostBinding } from '@angular/core';
import { MatSidenav } from '@angular/material';
import { FuseMatSidenavHelperService } from 'app/core/directives/mat-sidenav-helper/mat-sidenav-helper.service';
import { FuseMatchMedia } from '../../services/match-media.service';
import { ObservableMedia } from '@angular/flex-layout';
import { Subscription } from 'rxjs/Subscription';
@Directive({
selector: '[fuseMatSidenavHelper]'
})
export class FuseMatSidenavHelperDirective implements OnInit, OnDestroy
{
matchMediaSubscription: Subscription;
@HostBinding('class.mat-is-locked-open') isLockedOpen = true;
@HostBinding('class.mat-stop-transition') stopTransition = true;
@Input('fuseMatSidenavHelper') id: string;
@Input('mat-is-locked-open') matIsLockedOpenBreakpoint: string;
constructor(
private fuseMatSidenavService: FuseMatSidenavHelperService,
private fuseMatchMedia: FuseMatchMedia,
private observableMedia: ObservableMedia,
private matSidenav: MatSidenav
)
{
}
ngOnInit()
{
this.fuseMatSidenavService.setSidenav(this.id, this.matSidenav);
if ( this.observableMedia.isActive(this.matIsLockedOpenBreakpoint) )
{
setTimeout(() => {
this.isLockedOpen = true;
this.matSidenav.mode = 'side';
this.matSidenav.open();
});
this.stopTransition = false;
}
else
{
setTimeout(() => {
this.isLockedOpen = false;
this.matSidenav.mode = 'over';
this.matSidenav.close();
});
setTimeout(() => {
this.stopTransition = false;
}, 3000);
}
this.matchMediaSubscription = this.fuseMatchMedia.onMediaChange.subscribe(() => {
if ( this.observableMedia.isActive(this.matIsLockedOpenBreakpoint) )
{
setTimeout(() => {
this.isLockedOpen = true;
this.matSidenav.mode = 'side';
this.matSidenav.open();
});
}
else
{
setTimeout(() => {
this.isLockedOpen = false;
this.matSidenav.mode = 'over';
this.matSidenav.close();
});
}
});
}
ngOnDestroy()
{
this.matchMediaSubscription.unsubscribe();
}
}
@Directive({
selector: '[fuseMatSidenavToggler]'
})
export class FuseMatSidenavTogglerDirective
{
@Input('fuseMatSidenavToggler') id;
constructor(private fuseMatSidenavService: FuseMatSidenavHelperService)
{
}
@HostListener('click')
onClick()
{
this.fuseMatSidenavService.getSidenav(this.id).toggle();
}
}

View File

@@ -1,10 +1,10 @@
import { Injectable } from '@angular/core';
import { MdSidenav } from '@angular/material';
import { MatSidenav } from '@angular/material';
@Injectable()
export class FuseMdSidenavHelperService
export class FuseMatSidenavHelperService
{
sidenavInstances: MdSidenav[];
sidenavInstances: MatSidenav[];
constructor()
{

View File

@@ -1,101 +0,0 @@
import { Directive, Input, OnInit, HostListener, OnDestroy, HostBinding, AfterViewInit } from '@angular/core';
import { MdSidenav } from '@angular/material';
import { FuseMdSidenavHelperService } from 'app/core/directives/md-sidenav-helper/md-sidenav-helper.service';
import { FuseMatchMedia } from '../../services/match-media.service';
import { ObservableMedia } from '@angular/flex-layout';
import { Subscription } from 'rxjs/Subscription';
@Directive({
selector: '[fuseMdSidenavHelper]'
})
export class FuseMdSidenavHelperDirective implements OnInit, AfterViewInit, OnDestroy
{
matchMediaSubscription: Subscription;
@HostBinding('class.md-is-locked-open') isLockedOpen = true;
@HostBinding('class.md-stop-transition') stopTransition = true;
@Input('fuseMdSidenavHelper') id: string;
@Input('md-is-locked-open') mdIsLockedOpenBreakpoint: string;
constructor(
private fuseMdSidenavService: FuseMdSidenavHelperService,
private fuseMatchMedia: FuseMatchMedia,
private observableMedia: ObservableMedia,
private mdSidenav: MdSidenav
)
{
}
ngOnInit()
{
this.fuseMdSidenavService.setSidenav(this.id, this.mdSidenav);
if ( this.observableMedia.isActive(this.mdIsLockedOpenBreakpoint) )
{
setTimeout(() => {
this.isLockedOpen = true;
this.mdSidenav.mode = 'side';
this.mdSidenav.open();
});
}
else
{
setTimeout(() => {
this.isLockedOpen = false;
this.mdSidenav.mode = 'over';
this.mdSidenav.close();
});
}
this.matchMediaSubscription = this.fuseMatchMedia.onMediaChange.subscribe(() => {
if ( this.observableMedia.isActive(this.mdIsLockedOpenBreakpoint) )
{
setTimeout(() => {
this.isLockedOpen = true;
this.mdSidenav.mode = 'side';
this.mdSidenav.open();
});
}
else
{
setTimeout(() => {
this.isLockedOpen = false;
this.mdSidenav.mode = 'over';
this.mdSidenav.close();
});
}
});
}
ngAfterViewInit()
{
setTimeout(() => {
this.stopTransition = false;
}, 0);
}
ngOnDestroy()
{
this.matchMediaSubscription.unsubscribe();
}
}
@Directive({
selector: '[fuseMdSidenavToggler]'
})
export class FuseMdSidenavTogglerDirective
{
@Input('fuseMdSidenavToggler') id;
constructor(private fuseMdSidenavService: FuseMdSidenavHelperService)
{
}
@HostListener('click')
onClick()
{
this.fuseMdSidenavService.getSidenav(this.id).toggle();
}
}

View File

@@ -1,6 +1,5 @@
export class FuseUtils
{
public static filterArrayByString(mainArr, searchText)
{
if ( searchText === '' )
@@ -17,7 +16,6 @@ export class FuseUtils
public static searchInObj(itemObj, searchText)
{
for ( const prop in itemObj )
{
if ( !itemObj.hasOwnProperty(prop) )
@@ -29,7 +27,7 @@ export class FuseUtils
if ( typeof value === 'string' )
{
if ( this.searchInSting(value, searchText) )
if ( this.searchInString(value, searchText) )
{
return true;
}
@@ -41,7 +39,6 @@ export class FuseUtils
{
return true;
}
}
if ( typeof value === 'object' )
@@ -60,7 +57,7 @@ export class FuseUtils
{
if ( typeof value === 'string' )
{
if ( this.searchInSting(value, searchText) )
if ( this.searchInString(value, searchText) )
{
return true;
}
@@ -76,7 +73,7 @@ export class FuseUtils
}
}
public static searchInSting(value, searchText)
public static searchInString(value, searchText)
{
return value.toLowerCase().includes(searchText);
}

View File

@@ -1,106 +1,108 @@
import { NgModule } from '@angular/core';
import {
MdAutocompleteModule,
MdButtonModule,
MdButtonToggleModule,
MdCheckboxModule,
MdToolbarModule,
MdTooltipModule,
MdCardModule,
MdChipsModule,
MdCoreModule,
MdDatepickerModule,
MdDialogModule,
MdExpansionModule,
MdGridListModule,
MdIconModule,
MdInputModule,
MdListModule,
MdMenuModule,
MdNativeDateModule,
MdPaginatorModule,
MdProgressBarModule,
MdProgressSpinnerModule,
MdRadioModule,
MdRippleModule,
MdSelectModule,
MdSidenavModule,
MdSliderModule,
MdSlideToggleModule,
MdSnackBarModule,
MdSortModule,
MdTableModule,
MdTabsModule
MatAutocompleteModule,
MatButtonModule,
MatButtonToggleModule,
MatCheckboxModule,
MatToolbarModule,
MatTooltipModule,
MatCardModule,
MatChipsModule,
MatDatepickerModule,
MatDialogModule,
MatExpansionModule,
MatFormFieldModule,
MatGridListModule,
MatIconModule,
MatInputModule,
MatListModule,
MatMenuModule,
MatNativeDateModule,
MatPaginatorModule,
MatProgressBarModule,
MatProgressSpinnerModule,
MatRadioModule,
MatRippleModule,
MatSelectModule,
MatSidenavModule,
MatSliderModule,
MatSlideToggleModule,
MatSnackBarModule,
MatSortModule,
MatTableModule,
MatTabsModule,
MatStepperModule
} from '@angular/material';
import { CdkTableModule } from '@angular/cdk/table';
@NgModule({
imports: [
MdAutocompleteModule,
MdButtonModule,
MdButtonToggleModule,
MdCardModule,
MdCheckboxModule,
MdChipsModule,
MdCoreModule,
MdDatepickerModule,
MdDialogModule,
MdExpansionModule,
MdGridListModule,
MdIconModule,
MdInputModule,
MdListModule,
MdMenuModule,
MdNativeDateModule,
MdPaginatorModule,
MdProgressBarModule,
MdProgressSpinnerModule,
MdRadioModule,
MdRippleModule,
MdSelectModule,
MdSidenavModule,
MdSliderModule,
MdSlideToggleModule,
MdSnackBarModule,
MdSortModule,
MdTableModule,
MdTabsModule,
MdToolbarModule,
MdTooltipModule,
MatAutocompleteModule,
MatButtonModule,
MatButtonToggleModule,
MatCardModule,
MatCheckboxModule,
MatChipsModule,
MatDatepickerModule,
MatDialogModule,
MatExpansionModule,
MatFormFieldModule,
MatGridListModule,
MatIconModule,
MatInputModule,
MatListModule,
MatMenuModule,
MatNativeDateModule,
MatPaginatorModule,
MatProgressBarModule,
MatProgressSpinnerModule,
MatRadioModule,
MatRippleModule,
MatSelectModule,
MatSidenavModule,
MatSliderModule,
MatSlideToggleModule,
MatSnackBarModule,
MatStepperModule,
MatSortModule,
MatTableModule,
MatTabsModule,
MatToolbarModule,
MatTooltipModule,
CdkTableModule
],
exports: [
MdAutocompleteModule,
MdButtonModule,
MdButtonToggleModule,
MdCardModule,
MdCheckboxModule,
MdChipsModule,
MdCoreModule,
MdDatepickerModule,
MdDialogModule,
MdExpansionModule,
MdGridListModule,
MdIconModule,
MdInputModule,
MdListModule,
MdMenuModule,
MdNativeDateModule,
MdPaginatorModule,
MdProgressBarModule,
MdProgressSpinnerModule,
MdRadioModule,
MdRippleModule,
MdSelectModule,
MdSidenavModule,
MdSliderModule,
MdSlideToggleModule,
MdSnackBarModule,
MdSortModule,
MdTableModule,
MdTabsModule,
MdToolbarModule,
MdTooltipModule,
MatAutocompleteModule,
MatButtonModule,
MatButtonToggleModule,
MatCardModule,
MatCheckboxModule,
MatChipsModule,
MatDatepickerModule,
MatDialogModule,
MatExpansionModule,
MatGridListModule,
MatIconModule,
MatInputModule,
MatListModule,
MatMenuModule,
MatNativeDateModule,
MatPaginatorModule,
MatProgressBarModule,
MatProgressSpinnerModule,
MatRadioModule,
MatRippleModule,
MatSelectModule,
MatSidenavModule,
MatSliderModule,
MatSlideToggleModule,
MatSnackBarModule,
MatStepperModule,
MatSortModule,
MatTableModule,
MatTabsModule,
MatToolbarModule,
MatTooltipModule,
CdkTableModule
]
})

View File

@@ -4,33 +4,33 @@ import { CommonModule } from '@angular/common';
import { MaterialModule } from './material.module';
import { FlexLayoutModule } from '@angular/flex-layout';
import { PerfectScrollbarModule } from 'ngx-perfect-scrollbar';
import { ColorPickerModule } from 'ngx-color-picker';
import { NgxDnDModule } from '@swimlane/ngx-dnd';
import { NgxDatatableModule } from '@swimlane/ngx-datatable';
import { FuseMdSidenavHelperDirective, FuseMdSidenavTogglerDirective } from '../directives/md-sidenav-helper/md-sidenav-helper.directive';
import { FuseMatSidenavHelperDirective, FuseMatSidenavTogglerDirective } from '../directives/mat-sidenav-helper/mat-sidenav-helper.directive';
import { FusePipesModule } from '../pipes/pipes.module';
import { FuseConfirmDialogComponent } from '../components/confirm-dialog/confirm-dialog.component';
import { FuseCountdownComponent } from '../components/countdown/countdown.component';
import { FuseNavigationService } from '../components/navigation/navigation.service';
import { FuseMatchMedia } from '../services/match-media.service';
import { FuseNavbarVerticalService } from '../../main/navbar/vertical/navbar-vertical.service';
import { FuseMdSidenavHelperService } from '../directives/md-sidenav-helper/md-sidenav-helper.service';
import { FuseMatSidenavHelperService } from '../directives/mat-sidenav-helper/mat-sidenav-helper.service';
import { FuseHljsComponent } from '../components/hljs/hljs.component';
import { FusePerfectScrollbarDirective } from '../directives/fuse-perfect-scrollbar/fuse-perfect-scrollbar.directive';
import { FuseIfOnDomDirective } from '../directives/fuse-if-on-dom/fuse-if-on-dom.directive';
import { FuseMaterialColorPickerComponent } from '../components/material-color-picker/material-color-picker.component';
import { Md2Module } from 'md2';
import { CookieService } from 'ngx-cookie-service';
import { MarkdownModule } from 'angular2-markdown';
@NgModule({
declarations : [
FuseMdSidenavHelperDirective,
FuseMdSidenavTogglerDirective,
FuseMatSidenavHelperDirective,
FuseMatSidenavTogglerDirective,
FuseConfirmDialogComponent,
FuseCountdownComponent,
FuseHljsComponent,
FuseIfOnDomDirective,
FusePerfectScrollbarDirective,
FuseMaterialColorPickerComponent
],
imports : [
@@ -39,41 +39,39 @@ import { CookieService } from 'ngx-cookie-service';
CommonModule,
FormsModule,
FusePipesModule,
PerfectScrollbarModule,
ReactiveFormsModule,
ColorPickerModule,
NgxDnDModule,
NgxDatatableModule,
Md2Module
MarkdownModule
],
exports : [
FlexLayoutModule,
MaterialModule,
CommonModule,
FormsModule,
FuseMdSidenavHelperDirective,
FuseMdSidenavTogglerDirective,
FuseMatSidenavHelperDirective,
FuseMatSidenavTogglerDirective,
FusePipesModule,
FuseCountdownComponent,
FuseHljsComponent,
PerfectScrollbarModule,
FusePerfectScrollbarDirective,
ReactiveFormsModule,
ColorPickerModule,
NgxDnDModule,
NgxDatatableModule,
FuseIfOnDomDirective,
FuseMaterialColorPickerComponent,
Md2Module
MarkdownModule
],
entryComponents: [
FuseConfirmDialogComponent
],
providers : [
CookieService,
FuseNavigationService,
FuseMatchMedia,
FuseNavbarVerticalService,
FuseMdSidenavHelperService
FuseMatSidenavHelperService
]
})

View File

@@ -2,8 +2,8 @@
@import '~@swimlane/ngx-datatable/release/index.css';
@import '~@swimlane/ngx-datatable/release/themes/material.css';
@import '~@swimlane/ngx-datatable/release/assets/icons.css';
// Perfect Scrollbar
@import "~perfect-scrollbar/src/css/main";
// Perfect scrollbar
@import '~perfect-scrollbar/css/perfect-scrollbar.css';
// Fuse
@import "fuse";

View File

@@ -1,6 +1,61 @@
// Fix: "Icon button ripple radius is not correct on Edge & Safari"
.mat-icon-button {
.mat-button-ripple {
border-radius: 50%;
}
}
// Fix: "Sidenav opening with animations for the first time"
mat-sidenav-container {
mat-sidenav {
&[mat-is-locked-open].mat-stop-transition {
transition: none !important;
transform: translate3d(0, 0, 0) !important;
opacity: 0;
~ .mat-sidenav-content,
~ .mat-drawer-content {
transition: none !important;
}
}
&.mat-sidenav-opened {
&.mat-drawer-side {
~ .mat-sidenav-content,
~ .mat-drawer-content {
transition: none !important;
transform: translate3d(0, 0, 0) !important;
}
}
}
&.mat-drawer-end {
}
}
.mat-drawer-content {
}
}
// Fix: "Inconsistent font sizes across elements"
.mat-input-wrapper {
font-size: 16px;
}
.mat-checkbox {
font-size: 16px;
}
.mat-radio-button {
font-size: 16px;
}
.mat-pseudo-checkbox-checked:after {
width: 14px;
height: 7px;
}

View File

@@ -51,14 +51,16 @@ $matColorHues: 50, 100, 200, 300, 400, 500, 600, 700, 800, 900, A100, A200, A400
// If the base text color is black...
@if (rgba(black, 1) == rgba($baseTextColor, 1)) {
&.secondary-text,
.secondary-text,
.mat-icon,
.icon,
.md2-datepicker-button {
.icon {
color: rgba(0, 0, 0, 0.54);
}
&.secondary-text,
.secondary-text {
color: rgba(0, 0, 0, 0.54) !important;
}
&.hint-text,
.hint-text,
&.disabled-text,
@@ -80,8 +82,7 @@ $matColorHues: 50, 100, 200, 300, 400, 500, 600, 700, 800, 900, A100, A200, A400
@else {
.mat-icon,
.icon,
.md2-datepicker-button {
.icon {
color: rgba(255, 255, 255, 1);
}
@@ -111,49 +112,60 @@ $matColorHues: 50, 100, 200, 300, 400, 500, 600, 700, 800, 900, A100, A200, A400
@mixin generateMaterialElementColors($contrastColor) {
// If the contrast color is white...
$foreground: $mat-dark-theme-foreground;
$fuseForeground: (
base: white,
text: white,
hint-text: rgba(white, 0.5),
divider: rgba(white, 0.12),
);
// If the contrast color is black...
@if (rgba(black, 1) == rgba($contrastColor, 1)) {
$foreground: $mat-light-theme-foreground;
$fuseForeground: (
base: black,
hint-text: rgba(black, 0.38),
divider: rgba(black, 0.12),
);
}
// Native Input
input[type="text"] {
color: mat-color($foreground, base);
color: map_get($fuseForeground, base);
}
// Input
.mat-input-placeholder {
color: mat-color($foreground, hint-text);
color: map_get($fuseForeground, hint-text);
}
.mat-input-underline {
background-color: mat-color($foreground, divider);
background-color: map_get($fuseForeground, divider);
}
// Select
.mat-select-trigger,
.mat-select-arrow {
color: mat-color($foreground, hint-text);
color: map_get($fuseForeground, hint-text);
}
.mat-select-underline {
background-color: mat-color($foreground, divider);
background-color: map_get($fuseForeground, divider);
}
.mat-select-disabled .mat-select-value,
.mat-select-arrow,
.mat-select-trigger {
color: mat-color($foreground, hint-text);
color: map_get($fuseForeground, hint-text);
}
.mat-select-content, .mat-select-panel-done-animating {
background: mat-color($background, card);
.mat-select-content,
.mat-select-panel-done-animating {
background: map_get($background, card);
}
.mat-select-value {
color: mat-color($foreground, text);
color: map_get($fuseForeground, text);
}
}
@@ -164,7 +176,7 @@ $matColorHues: 50, 100, 200, 300, 400, 500, 600, 700, 800, 900, A100, A200, A400
background-color: $color !important;
}
.md-#{$colorName}#{$hue}-bg {
.mat-#{$colorName}#{$hue}-bg {
background-color: $color !important;
color: $contrastColor !important;

View File

@@ -1,6 +1,6 @@
body {
> md-sidenav-container {
> mat-sidenav-container {
height: 100%;
}
}

View File

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

View File

@@ -46,14 +46,14 @@
margin-top: 0;
margin-bottom: 0;
}
md-icon.status {
mat-icon.status {
position: absolute;
top: 28px;
left: 28px;
}
}
md-icon.status {
mat-icon.status {
border-radius: 50%;
&.online {
@@ -116,7 +116,7 @@ md-icon.status {
max-height: 48px;
height: 48px;
md-icon {
mat-icon {
margin: 0 16px 0 0;
}
@@ -142,7 +142,7 @@ md-icon.status {
}
}
md-divider {
mat-divider {
margin: 8px 0;
}
}
@@ -196,7 +196,7 @@ md-icon.status {
background-color: #FFFFFF;
width: 280px;
border-radius: 2px;
margin: 24px 24px 0 0;
margin: 12px;
overflow: hidden;
&.style-1 {
@@ -234,7 +234,7 @@ md-icon.status {
}
}
md-divider {
mat-divider {
margin: 16px 32px;
}

View File

@@ -11,6 +11,22 @@
white-space: nowrap;
}
.nav-group {
display: block;
> .group-title {
position: relative;
display: flex;
align-items: center;
height: 48px;
font-weight: 500;
padding-left: 24px;
margin-top: 8px;
font-size: 12px;
white-space: nowrap;
}
}
.nav-item {
.nav-link {
@@ -88,7 +104,9 @@
> .nav-item {
> .nav-link {
> .nav-link,
&.nav-group > .group-title,
&.nav-group > .group-items > .nav-item > .nav-link {
padding-left: 56px;
}
@@ -96,7 +114,9 @@
> .nav-item {
> .nav-link {
> .nav-link,
&.nav-group > .group-title,
&.nav-group > .group-items > .nav-item > .nav-link {
padding-left: 72px;
}
}
@@ -119,6 +139,31 @@
}
}
> .nav-group {
> .group-items {
> .nav-collapse {
background: transparent;
transition: background 200ms ease-in-out;
&.open {
background: rgba(0, 0, 0, 0.12);
}
}
}
}
&.vertical {
.nav-group {
.group-title {
text-transform: uppercase;
}
}
}
&.horizontal {
display: flex;
flex-direction: row;

View File

@@ -112,12 +112,12 @@ $top-bg-image: url('assets/images/backgrounds/header-bg.png');
// Single scroll
&.single-scroll {
> md-sidenav-container {
> mat-sidenav-container {
flex: 1 0 auto;
}
}
> md-sidenav-container {
> mat-sidenav-container {
display: flex;
flex: 1;
background: none;
@@ -132,28 +132,25 @@ $top-bg-image: url('assets/images/backgrounds/header-bg.png');
min-width: 240px;
max-width: 240px;
height: auto;
z-index: 2;
z-index: 4;
overflow-y: hidden;
@include mat-elevation(7);
&.md-is-locked-open {
position: relative;
&.mat-is-locked-open {
background: none;
box-shadow: none;
}
&.md-stop-transition {
~ .mat-sidenav-content,
~ .mat-drawer-content {
transition: none;
}
}
.header {
height: $carded-header-height;
min-height: $carded-header-height;
max-height: $carded-header-height;
@include media-breakpoint-down('sm') {
height: $carded-header-height-sm;
min-height: $carded-header-height-sm;
max-height: $carded-header-height-sm;
}
}
.content {
@@ -184,6 +181,12 @@ $top-bg-image: url('assets/images/backgrounds/header-bg.png');
height: $carded-header-height-without-toolbar;
min-height: $carded-header-height-without-toolbar;
max-height: $carded-header-height-without-toolbar;
@include media-breakpoint-down('sm') {
height: $carded-header-height-without-toolbar-sm;
min-height: $carded-header-height-without-toolbar-sm;
max-height: $carded-header-height-without-toolbar-sm;
}
}
.content-card {
@@ -225,15 +228,14 @@ $top-bg-image: url('assets/images/backgrounds/header-bg.png');
&.left-sidenav {
// Sidenav
> md-sidenav-container {
> mat-sidenav-container {
.sidenav {
&.md-is-locked-open {
&.mat-is-locked-open {
~ .mat-sidenav-content,
~ .mat-drawer-content {
margin-left: 0 !important;
.center {
margin-left: 0;
@@ -248,16 +250,15 @@ $top-bg-image: url('assets/images/backgrounds/header-bg.png');
&.right-sidenav {
// Sidenav
> md-sidenav-container {
> mat-sidenav-container {
.sidenav {
order: 999;
&.md-is-locked-open {
&.mat-is-locked-open {
~ .mat-sidenav-content,
~ .mat-drawer-content {
margin-right: 0 !important;
.center {
margin-right: 0;
@@ -284,6 +285,10 @@ $top-bg-image: url('assets/images/backgrounds/header-bg.png');
}
// Fullwidth
&.fullwidth {
overflow: auto;
}
&.fullwidth,
&.inner-sidenav {
min-height: 100%;
@@ -302,17 +307,13 @@ $top-bg-image: url('assets/images/backgrounds/header-bg.png');
// Single scroll
&.single-scroll {
> md-sidenav-container {
> mat-sidenav-container {
flex: 1 0 auto;
> .mat-sidenav-content,
> .mat-drawer-content {
flex: 1 0 auto;
max-height: none;
> .center {
overflow: hidden;
}
}
}
}
@@ -320,7 +321,7 @@ $top-bg-image: url('assets/images/backgrounds/header-bg.png');
// Inner Sidenav
&.inner-sidenav {
> md-sidenav-container {
> mat-sidenav-container {
flex: 1;
.sidenav {
@@ -349,7 +350,7 @@ $top-bg-image: url('assets/images/backgrounds/header-bg.png');
}
}
> md-sidenav-container {
> mat-sidenav-container {
display: flex;
flex-direction: column;
flex: 1;
@@ -364,7 +365,7 @@ $top-bg-image: url('assets/images/backgrounds/header-bg.png');
z-index: 51;
@include mat-elevation(7);
&.md-is-locked-open {
&.mat-is-locked-open {
width: 220px;
min-width: 220px;
max-width: 220px;
@@ -372,14 +373,6 @@ $top-bg-image: url('assets/images/backgrounds/header-bg.png');
background: transparent;
}
&.md-stop-transition {
~ .mat-sidenav-content,
~ .mat-drawer-content {
transition: none;
}
}
.sidenav-content {
height: 100%;
}
@@ -458,7 +451,7 @@ $top-bg-image: url('assets/images/backgrounds/header-bg.png');
&.left-sidenav,
&.right-sidenav {
> md-sidenav-container {
> mat-sidenav-container {
flex: 1 0 auto;
}
}
@@ -467,7 +460,6 @@ $top-bg-image: url('assets/images/backgrounds/header-bg.png');
&.simple {
&.fullwidth {
overflow: visible;
> .content {
flex: 1 0 auto;
@@ -477,16 +469,12 @@ $top-bg-image: url('assets/images/backgrounds/header-bg.png');
&.left-sidenav,
&.right-sidenav {
> md-sidenav-container {
> mat-sidenav-container {
flex: 1 0 auto !important;
> .mat-sidenav-content,
> .mat-drawer-content {
flex: 1 0 auto;
> .center {
overflow: hidden;
}
}
}
}
@@ -506,7 +494,7 @@ $top-bg-image: url('assets/images/backgrounds/header-bg.png');
&.left-sidenav,
&.right-sidenav {
> md-sidenav-container {
> mat-sidenav-container {
> .mat-sidenav-content,
> .mat-drawer-content {

View File

@@ -4,8 +4,9 @@
@media all {
/* Never show page break in normal view */
.page-break {
/* Never show page breaks in normal view */
.page-break-after,
.page-break-before {
display: none;
}
@@ -13,22 +14,30 @@
@media print {
/* Page Styles */
@page {
//margin: 0.5cm;
/* html and body tweaks */
html, body {
height: auto !important;
overflow: initial !important;
}
/* Page break */
.page-break {
/* Page breaks */
.page-break-after {
display: block;
break-after: always;
page-break-after: always;
position: relative;
}
.page-break-before {
display: block;
page-break-before: always;
position: relative;
}
/* General styles */
fuse-root {
fuse-navbar,
fuse-navbar-vertical,
fuse-navbar-horizontal,
fuse-toolbar,
fuse-footer,
fuse-quick-panel,
@@ -41,11 +50,16 @@
.ps {
overflow: visible !important;
}
}
/* Printable page specific styles */
.printable {
overflow: visible !important;
height: auto !important;
.mat-drawer-container,
.mat-sidenav-container {
background-color: white !important;
.mat-drawer-content,
.mat-sidenav-content {
overflow: initial !important;
height: auto !important
}
}
}
}

View File

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

View File

@@ -1,20 +1,23 @@
::-webkit-scrollbar {
width: 12px;
height: 12px;
background-color: rgba(0, 0, 0, 0);
}
body:not(.is-mobile) {
::-webkit-scrollbar:hover {
background-color: rgba(0, 0, 0, 0.12);
}
::-webkit-scrollbar {
width: 12px;
height: 12px;
background-color: rgba(0, 0, 0, 0);
}
::-webkit-scrollbar-thumb {
border: 2px solid transparent;
box-shadow: inset 0 0 0 24px rgba(0, 0, 0, 0.37);
border-radius: 24px;
}
::-webkit-scrollbar:hover {
background-color: rgba(0, 0, 0, 0.12);
}
::-webkit-scrollbar-thumb:active {
box-shadow: inset 0 0 0 24px rgba(0, 0, 0, 0.54);
border-radius: 24px;
::-webkit-scrollbar-thumb {
border: 2px solid transparent;
box-shadow: inset 0 0 0 24px rgba(0, 0, 0, 0.37);
border-radius: 24px;
}
::-webkit-scrollbar-thumb:active {
box-shadow: inset 0 0 0 24px rgba(0, 0, 0, 0.54);
border-radius: 24px;
}
}

View File

@@ -1,10 +1,12 @@
.ps {
position: relative;
> .ps__scrollbar-y-rail {
> .ps__rail-x {
z-index: 99999;
}
> .ps__scrollbar-y-rail {
> .ps__rail-y {
z-index: 99999;
left: auto !important;
}
}

View File

@@ -1,4 +1,5 @@
@import "highlight";
@import "prism";
@import "perfect-scrollbar";
@import "ngx-datatable";
@import "ngx-color-picker";

View File

@@ -0,0 +1,269 @@
// Edit the sixteen color-value variables, and create your own syntax highlighter colorscheme
$base00: #263238;
$base01: #2C393F;
$base02: #37474F;
$base03: #707880;
$base04: #C9CCD3;
$base05: #CDD3DE;
$base06: #D5DBE5;
$base07: #FFFFFF;
$base08: #EC5F67;
$base09: #EA9560;
$base0A: #FFCC00;
$base0B: #8BD649;
$base0C: #80CBC4;
$base0D: #89DDFF;
$base0E: #82AAFF;
$base0F: #EC5F67;
$red: $base08;
$orange: $base09;
$yellow: $base0A;
$green: $base0B;
$cyan: $base0C;
$blue: $base0D;
$violet: $base0E;
$magenta: $base0F;
$code-font-family: Consolas, Menlo, Monaco, "Andale Mono WT", "Andale Mono", "Lucida Console", "Lucida Sans Typewriter", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Liberation Mono", "Nimbus Mono L", "Courier New", Courier, monospace;
$code-font-size: 14px;
$code-line-height: 1.6;
$code-background: $base00;
$code-color: $base05;
$code-color-fade: $base05;
// $code-text-shadow: none;
$code-color-comment: $base02;
$code-color-keyword: $base0B;
$code-color-value: $base0C;
$code-color-attr-name: $base09;
$code-color-string: $base0C;
$code-color-name: $base0A;
$code-color-number: $base09;
$code-color-variable: $base0D;
$code-color-selector: $base0E;
$code-color-property: $base0A;
$code-color-important: $base08;
$code-color-tag: $base0D;
$code-color-atrule: $base0C;
// @import "../partials/prism";
/**
* Prism base code highlighter theme using Sass
*
* @author @MoOx
* https://github.com/MoOx/sass-prism-theme-base/blob/master/_prism.scss
* slightly adapted by me, Bram de Haan
*/
// prism selector
$code-selector: "code[class*=\"language-\"], pre[class*=\"language-\"]";
$code-selector-block: "pre[class*=\"language-\"]";
$code-selector-inline: ":not(pre) > code[class*=\"language-\"]";
// generic stuff
$code-font-family: Menlo, Monaco, "Courier New", monospace !default;
$code-font-size: 14px !default;
$code-line-height: 1.6 !default;
$code-tab-size: 4 !default;
$code-hyphens: none !default;
$code-block-padding: 12px !default;
$code-inline-padding: 2px 6px !default;
$code-border-radius: 0 !default;
$code-border: none !default;
$code-background: #2A2A2A !default;
$code-color: #FFF !default;
$code-color-fade: #BEBEC5 !default;
// $code-text-shadow: 0 1px 0 #000 !default;
$code-box-shadow: none !default;
$code-color-property: #B58900 !default;
$code-color-important: #CB4B16 !default;
$code-color-tag: #268BD2 !default;
$code-color-atrule: #2AA198 !default;
$code-color-attr-name: #B65611 !default;
// $code-linenums-padding: 7px !default;
// $code-linenums-width: 40px !default;
// $code-linenums-background: #444 !default;
// $code-linenums-border-color: #555 !default;
// $code-linenums-border-width: 1px !default;
@if $code-selector != null {
#{$code-selector} {
-moz-tab-size: $code-tab-size;
-o-tab-size: $code-tab-size;
tab-size: $code-tab-size;
-webkit-hyphens: $code-hyphens;
-moz-hyphens: $code-hyphens;
-ms-hyphens: $code-hyphens;
hyphens: $code-hyphens;
// whitespace management
white-space: pre; // fallback
white-space: pre-wrap;
word-break: break-all;
word-wrap: break-word;
font-family: $code-font-family;
font-size: $code-font-size;
line-height: $code-line-height;
color: $code-color;
// text-shadow: $code-text-shadow;
background: $code-background;
}
}
%code-background {
border-radius: $code-border-radius;
border: $code-border;
box-shadow: $code-box-shadow;
}
@if $code-selector-block != null {
#{$code-selector-block} {
@extend %code-background;
padding: $code-block-padding;
}
}
@if $code-selector-inline != null {
#{$code-selector-inline} {
@extend %code-background;
padding: $code-inline-padding;
}
}
// pre[class*="language-"],
// :not(pre) > code[class*="language-"] {
// background: $code-background;
// }
// prism tokens
//
$code-color-comment: null !default;
$code-color-keyword: null !default;
$code-color-value: null !default;
$code-color-string: null !default;
$code-color-name: null !default;
$code-color-number: null !default;
$code-color-variable: null !default;
$code-color-selector: null !default;
$code-color-punctuation: $code-color-fade !default;
#{$code-selector} {
.namespace {
opacity: .7;
}
.token {
&.comment,
&.prolog,
&.doctype,
&.cdata {
color: $code-color-comment;
}
&.null,
&.operator,
&.boolean,
&.number {
color: $code-color-number;
}
&.string {
color: $code-color-string;
}
&.attr-name {
color: $code-color-attr-name;
}
&.entity,
&.url,
.language-css &.string,
.style &.string {
color: $code-color-string;
}
&.selector {
color: $code-color-selector;
}
&.attr-value,
&.keyword,
&.control,
&.directive,
&.unit {
color: $code-color-keyword;
}
&.important {
color: $code-color-important;
}
&.atrule {
color: $code-color-atrule;
}
&.regex,
&.statement {
color: $code-color-value;
}
&.placeholder,
&.variable {
color: $code-color-variable;
}
&.property,
&.tag {
// font-style: italic;
}
&.property {
color: $code-color-property;
}
&.tag {
color: $code-color-tag;
}
&.important,
&.statement {
font-weight: bold;
}
// todo ?
// &.mixin
// &.gradient
// &.abslength
// &.easing
// &.time
// &.angle
// &.fontfamily
// ruby/vim https://github.com/LeaVerou/prism/pull/18
// &.inst-var
// &.builtin
// &.const
// &.symbol
//
// php https://github.com/LeaVerou/prism/pull/20
// &.deliminator
// &.function
&.punctuation {
color: $code-color-punctuation;
}
&.entity {
cursor: help;
}
// for dev :)
&.debug {
color: red
}
}
}

View File

@@ -28,12 +28,12 @@ export class FuseConfigService
mode : 'fullwidth' // 'boxed', 'fullwidth'
},
colorClasses : {
toolbar: 'md-white-500-bg',
navbar : 'md-fuse-dark-500-bg',
footer : 'md-fuse-dark-800-bg'
toolbar: 'mat-white-500-bg',
navbar : 'mat-fuse-dark-700-bg',
footer : 'mat-fuse-dark-900-bg'
},
customScrollbars: true,
routerAnimation : 'fadeIn'
routerAnimation : 'fadeIn' // fadeIn, slideUp, slideDown, slideRight, slideLeft
};
/**

View File

@@ -0,0 +1,61 @@
export class FaqFakeDb
{
public static data = [
{
'question': 'Proident tempor est nulla irure ad est?',
'answer': 'Id nulla nulla proident deserunt deserunt proident in quis. Cillum reprehenderit labore id anim laborum.'
},
{
'question': 'Ullamco duis commodo sint ad aliqua aute?',
'answer': 'Sunt laborum enim nostrud ea fugiat cillum mollit aliqua exercitation ad elit.'
},
{
'question': 'Eiusmod non occaecat pariatur Lorem in ex?',
'answer': 'Nostrud anim mollit incididunt qui qui sit commodo duis. Anim amet irure aliquip duis nostrud sit quis fugiat ullamco non dolor labore. Lorem sunt voluptate laboris culpa proident. Aute eiusmod aliqua exercitation irure exercitation qui laboris mollit occaecat eu occaecat fugiat.'
},
{
'question': 'Lorem magna cillum consequat consequat mollit?',
'answer': 'Velit ipsum proident ea incididunt et. Consectetur eiusmod laborum voluptate duis occaecat ullamco sint enim proident.'
},
{
'question': 'Quis irure cupidatat ad consequat reprehenderit excepteur?',
'answer': 'Esse nisi mollit aliquip mollit aute consequat adipisicing. Do excepteur dolore proident cupidatat pariatur irure consequat incididunt.'
},
{
'question': 'Officia voluptate tempor ut mollit ea cillum?',
'answer': 'Deserunt veniam reprehenderit do elit magna ut.'
},
{
'question': 'Sunt fugiat officia nisi minim sunt duis?',
'answer': 'Eiusmod eiusmod sint aliquip exercitation cillum. Magna nulla officia ex consectetur ea ad excepteur in qui.'
},
{
'question': 'Non cupidatat enim quis aliquip minim laborum?',
'answer': 'Qui cillum eiusmod nostrud sunt dolore velit nostrud labore voluptate ad dolore. Eu Lorem anim pariatur aliqua. Ullamco ut dolor velit esse occaecat dolore eu cillum commodo qui. Nulla dolor consequat voluptate magna ut commodo magna consectetur non aute proident.'
},
{
'question': 'Dolor ex occaecat magna labore laboris qui?',
'answer': 'Incididunt qui excepteur eiusmod elit cillum occaecat voluptate cillum nostrud. Dolor ullamco ullamco eiusmod do sunt adipisicing pariatur. In esse esse labore id reprehenderit sint do. Pariatur culpa dolor tempor qui excepteur duis do anim minim ipsum.'
},
{
'question': 'Nisi et ullamco minim ea proident tempor?',
'answer': 'Dolor veniam dolor cillum Lorem magna nisi in occaecat nulla dolor ea eiusmod.'
},
{
'question': 'Amet sunt et quis amet commodo quis?',
'answer': 'Nulla dolore consequat aliqua sint consequat elit qui occaecat et.'
},
{
'question': 'Ut eiusmod ex ea eiusmod culpa incididunt?',
'answer': 'Fugiat non incididunt officia ex incididunt occaecat. Voluptate nostrud culpa aliquip mollit incididunt non dolore.'
},
{
'question': 'Proident reprehenderit laboris pariatur ut et nisi?',
'answer': 'Reprehenderit proident ut ad cillum quis velit quis aliqua ut aliquip tempor ullamco.'
},
{
'question': 'Aliqua aliquip aliquip aliquip et exercitation aute?',
'answer': 'Adipisicing Lorem tempor ex anim. Labore tempor laboris nostrud dolore voluptate ullamco. Fugiat ex deserunt anim minim esse velit laboris aute ea duis incididunt. Elit irure id Lorem incididunt laborum aliquip consectetur est irure sunt. Ut labore anim nisi aliqua tempor laborum nulla cillum. Duis irure consequat cillum magna cillum eiusmod ut. Et exercitation voluptate quis deserunt elit quis dolor deserunt ex ex esse ex.'
}
];
}

View File

@@ -13,6 +13,7 @@ import { QuickPanelFakeDb } from './quick-panel';
import { IconsFakeDb } from './icons';
import { ProjectsDashboardDb } from './projects-dashboard';
import { ScrumboardFakeDb } from './scrumboard';
import { FaqFakeDb } from './faq';
export class FuseFakeDbService implements InMemoryDbService
{
@@ -44,7 +45,8 @@ export class FuseFakeDbService implements InMemoryDbService
'icons' : IconsFakeDb.icons,
'projects-dashboard-projects': ProjectsDashboardDb.projects,
'projects-dashboard-widgets' : ProjectsDashboardDb.widgets,
'scrumboard-boards' : ScrumboardFakeDb.boards
'scrumboard-boards' : ScrumboardFakeDb.boards,
'faq' : FaqFakeDb.data
};
}
}

View File

@@ -1622,7 +1622,7 @@ export class ProjectsDashboardDb
[
{
'value' : 'Wireframing',
'classes': 'md-primary-bg',
'classes': 'mat-primary-bg',
'icon' : ''
},
{
@@ -1654,7 +1654,7 @@ export class ProjectsDashboardDb
[
{
'value' : 'Design',
'classes': 'md-green-bg',
'classes': 'mat-green-bg',
'icon' : ''
},
{
@@ -1686,7 +1686,7 @@ export class ProjectsDashboardDb
[
{
'value' : 'Coding',
'classes': 'md-red-bg',
'classes': 'mat-red-bg',
'icon' : ''
},
{
@@ -1718,7 +1718,7 @@ export class ProjectsDashboardDb
[
{
'value' : 'Marketing',
'classes': 'md-accent-bg',
'classes': 'mat-accent-bg',
'icon' : ''
},
{
@@ -1750,7 +1750,7 @@ export class ProjectsDashboardDb
[
{
'value' : 'Extra',
'classes': 'md-orange-bg',
'classes': 'mat-orange-bg',
'icon' : ''
},
{

View File

@@ -181,7 +181,7 @@ export class ScrumboardFakeDb
'time' : '45 mins. ago'
}
],
'due' : 'Tue Aug 29 2017 13:16:34 GMT+0300 (Turkey Standard Time)'
'due' : '2017-08-29T10:16:34.000Z'
},
{
'id' : '5637273da9b93bb84743a0f9',
@@ -274,7 +274,7 @@ export class ScrumboardFakeDb
}
],
'activities' : [],
'due' : 'Fri Sep 07 2018 15:00:00 GMT+0300 (Turkey Standard Time)'
'due' : '2018-09-07T12:00:00.000Z'
},
{
'id' : 'f6b9d7a9247e5d794a081927',
@@ -365,7 +365,7 @@ export class ScrumboardFakeDb
'checkItemsChecked': 0,
'comments' : [],
'activities' : [],
'due' : 'Wed Mar 08 2017 12:00:00 GMT+0300 (Turkey Standard Time)'
'due' : '2017-03-08T09:00:00.000Z'
},
{
'id' : '80ed.24ad3b18e2668.f28fbbceeeff9.5a834620a42f1.5909be19a2bf2.6c4a54947ce2d.da356b0c1',
@@ -536,7 +536,7 @@ export class ScrumboardFakeDb
'checkItemsChecked': 3,
'comments' : [],
'activities' : [],
'due' : 'Fri Feb 02 2017 14:20:34 GMT+0300 (Turkey Standard Time)'
'due' : '2017-02-02T11:20:34.000Z'
}
],
'members' : [
@@ -565,22 +565,22 @@ export class ScrumboardFakeDb
{
'id' : '26022e4129ad3a5sc28b36cd',
'name' : 'High Priority',
'color': 'md-red-500-bg'
'color': 'mat-red-500-bg'
},
{
'id' : '56027e4119ad3a5dc28b36cd',
'name' : 'Design',
'color': 'md-orange-400-bg'
'color': 'mat-orange-400-bg'
},
{
'id' : '5640635e19ad3a5dc21416b2',
'name' : 'App',
'color': 'md-blue-600-bg'
'color': 'mat-blue-600-bg'
},
{
'id' : '6540635g19ad3s5dc31412b2',
'name' : 'Feature',
'color': 'md-green-400-bg'
'color': 'mat-green-400-bg'
}
]
},
@@ -769,17 +769,17 @@ export class ScrumboardFakeDb
{
'id' : '56027e4119ad3a5dc28b36cd',
'name' : 'Design',
'color': 'md-red-500-bg'
'color': 'mat-red-500-bg'
},
{
'id' : '5640635e19ad3a5dc21416b2',
'name' : 'App',
'color': 'md-blue-500-bg'
'color': 'mat-blue-500-bg'
},
{
'id' : '6540635g19ad3s5dc31412b2',
'name' : 'Feature',
'color': 'md-green-400-bg'
'color': 'mat-green-400-bg'
}
]
}

View File

@@ -1,7 +1,7 @@
<div id="calendar" class="page-layout simple fullwidth" perfect-scrollbar>
<div id="calendar" class="page-layout simple fullwidth" fusePerfectScrollbar>
<!-- HEADER -->
<div class="header" [ngClass]="viewDate | date:'MMM'">
<div class="header p-16 p-sm-24" [ngClass]="viewDate | date:'MMM'">
<div class="header-content" fxLayout="column" fxLayoutAlign="space-between">
@@ -9,84 +9,86 @@
<div class="logo mb-16 mb-sm-0" fxLayout="row" fxLayoutAlign="start center">
<md-icon class="logo-icon">today</md-icon>
<mat-icon class="logo-icon" *fuseIfOnDom [@animate]="{value:'*',params:{delay:'50ms',scale:'0.2'}}">today</mat-icon>
<span class="logo-text">Calendar</span>
<span class="logo-text" *fuseIfOnDom [@animate]="{value:'*',params:{delay:'100ms',x:'-25px'}}">Calendar</span>
</div>
<!-- TOOLBAR -->
<div class="toolbar" fxLayout="row" fxLayoutAlign="start center">
<button md-button class="mat-icon-button" aria-label="Search" md-tooltip="Search">
<md-icon>search</md-icon>
<button mat-button class="mat-icon-button" aria-label="Search" matTooltip="Search">
<mat-icon>search</mat-icon>
</button>
<button md-button class="mat-icon-button"
<button mat-button class="mat-icon-button"
mwlCalendarToday
[(viewDate)]="viewDate"
(viewDateChange)="selectedDay = {date:$event}"
aria-label="Today" md-tooltip="Today">
aria-label="Today" matTooltip="Today">
<!--(click)="selectedDay = viewDate"-->
<md-icon>today</md-icon>
<mat-icon>today</mat-icon>
</button>
<button md-button class="mat-icon-button" (click)="view='day'"
aria-label="Day" md-tooltip="Day">
<md-icon>view_day</md-icon>
<button mat-button class="mat-icon-button" (click)="view='day'"
aria-label="Day" matTooltip="Day">
<mat-icon>view_day</mat-icon>
</button>
<button md-button class="mat-icon-button" (click)="view='week'"
aria-label="Week" md-tooltip="Week">
<md-icon>view_week</md-icon>
<button mat-button class="mat-icon-button" (click)="view='week'"
aria-label="Week" matTooltip="Week">
<mat-icon>view_week</mat-icon>
</button>
<button md-button class="mat-icon-button" (click)="view='month'"
aria-label="Month" md-tooltip="Month">
<md-icon>view_module</md-icon>
<button mat-button class="mat-icon-button" (click)="view='month'"
aria-label="Month" matTooltip="Month">
<mat-icon>view_module</mat-icon>
</button>
</div>
</div>
<!-- / TOOLBAR -->
<!-- HEADER BOTTOM -->
<div class="header-bottom" fxLayout="row" fxLayoutAlign="center center">
<div class="header-bottom" fxLayout="row" fxLayoutAlign="center center"
*fuseIfOnDom [@animate]="{value:'*',params:{delay:'150ms'}}">
<button md-button class="mat-icon-button arrow"
<button mat-button class="mat-icon-button arrow"
mwlCalendarPreviousView
[view]="view"
[(viewDate)]="viewDate"
(viewDateChange)="selectedDay = {date:$event}"
aria-label="Previous">
<md-icon>chevron_left</md-icon>
<mat-icon>chevron_left</mat-icon>
</button>
<div class="title">
{{ viewDate | calendarDate:(view + 'ViewTitle'):'en' }}
</div>
<button md-button class="mat-icon-button arrow"
<button mat-button class="mat-icon-button arrow"
mwlCalendarNextView
[view]="view"
[(viewDate)]="viewDate"
(viewDateChange)="selectedDay = {date:$event}"
aria-label="Next">
<md-icon>chevron_right</md-icon>
<mat-icon>chevron_right</mat-icon>
</button>
</div>
<!-- / HEADER BOTTOM -->
</div>
<!-- ADD EVENT BUTTON -->
<button md-fab class="add-event-button mat-warn" (click)="addEvent()" aria-label="Add event">
<md-icon>add</md-icon>
<button mat-fab class="add-event-button mat-warn" (click)="addEvent()" aria-label="Add event"
*fuseIfOnDom [@animate]="{value:'*',params:{delay:'300ms',scale:'0.2'}}">
<mat-icon>add</mat-icon>
</button>
<!-- / ADD EVENT BUTTON -->
</div>
<!-- / HEADER -->
<!-- CONTENT -->
<div class="content" perfect-scrollbar>
<div class="content" fusePerfectScrollbar *fuseIfOnDom [@animate]="{value:'*',params:{delay:'200ms',y:'50px'}}">
<div [ngSwitch]="view">
<mwl-calendar-month-view
*ngSwitchCase="'month'"

View File

@@ -26,8 +26,8 @@
}
.cal-open-day-events {
background: whitesmoke;
box-shadow: inset 0 0 15px 0 rgba(0, 0, 0, 0.13);
background: #455A64;
box-shadow: inset 0 0 12px 0 rgba(0, 0, 0, 0.54);
padding: 0;
display: flex;
flex-direction: column;
@@ -44,11 +44,11 @@
transition: box-shadow 300ms ease;
&:first-of-type {
margin-top: 24px;
margin-top: 16px;
}
&:last-of-type {
margin-bottom: 24px;
margin-bottom: 16px;
}
&:hover {
@@ -184,12 +184,13 @@
#calendar {
background: #FFFFFF;
overflow-x: hidden;
overflow-y: auto;
.header {
height: 200px;
min-height: 200px;
max-height: 200px;
padding: 24px;
position: relative;
background-size: 100% auto;
background-position: 0 50%;
@@ -197,6 +198,12 @@
background-color: #FAFAFA;
color: #FFFFFF;
@include media-breakpoint(xs) {
height: 164px;
min-height: 164px;
max-height: 164px;
}
&:before {
content: '';
position: absolute;
@@ -296,7 +303,7 @@
z-index: 10;
}
md-icon {
mat-icon {
color: #FFFFFF;
}
}

View File

@@ -1,7 +1,7 @@
import { startOfDay, endOfDay, subDays, addDays, endOfMonth, isSameDay, isSameMonth, addHours } from 'date-fns';
import { ChangeDetectionStrategy, Component, OnInit, ViewEncapsulation } from '@angular/core';
import { Component, OnInit, ViewEncapsulation } from '@angular/core';
import { Subject } from 'rxjs/Subject';
import { MdDialog, MdDialogRef } from '@angular/material';
import { MatDialog, MatDialogRef } from '@angular/material';
import { FuseCalendarEventFormDialogComponent } from './event-form/event-form.component';
import { FormGroup } from '@angular/forms';
import { CalendarEventModel } from './event.model';
@@ -13,13 +13,14 @@ import {
CalendarMonthViewDay
} from 'angular-calendar';
import { FuseConfirmDialogComponent } from '../../../../core/components/confirm-dialog/confirm-dialog.component';
import { fuseAnimations } from '../../../../core/animations';
@Component({
selector : 'fuse-calendar',
changeDetection: ChangeDetectionStrategy.OnPush,
templateUrl : './calendar.component.html',
styleUrls : ['./calendar.component.scss'],
encapsulation : ViewEncapsulation.None
selector : 'fuse-calendar',
templateUrl : './calendar.component.html',
styleUrls : ['./calendar.component.scss'],
encapsulation: ViewEncapsulation.None,
animations : fuseAnimations
})
export class FuseCalendarComponent implements OnInit
{
@@ -37,12 +38,12 @@ export class FuseCalendarComponent implements OnInit
dialogRef: any;
confirmDialogRef: MdDialogRef<FuseConfirmDialogComponent>;
confirmDialogRef: MatDialogRef<FuseConfirmDialogComponent>;
selectedDay: any;
constructor(
public dialog: MdDialog,
public dialog: MatDialog,
public calendarService: CalendarService
)
{

View File

@@ -1,8 +1,8 @@
import { Injectable } from '@angular/core';
import { ActivatedRouteSnapshot, Resolve, RouterStateSnapshot } from '@angular/router';
import { Observable } from 'rxjs/Observable';
import { Http } from '@angular/http';
import { Subject } from 'rxjs/Subject';
import { HttpClient } from '@angular/common/http';
@Injectable()
export class CalendarService implements Resolve<any>
@@ -10,7 +10,7 @@ export class CalendarService implements Resolve<any>
events: any;
onEventsUpdated = new Subject<any>();
constructor(private http: Http)
constructor(private http: HttpClient)
{
}
@@ -34,8 +34,8 @@ export class CalendarService implements Resolve<any>
return new Promise((resolve, reject) => {
this.http.get('api/calendar/events')
.subscribe(response => {
this.events = response.json().data.data;
.subscribe((response: any) => {
this.events = response.data;
this.onEventsUpdated.next(this.events);
resolve(this.events);
}, reject);
@@ -49,7 +49,7 @@ export class CalendarService implements Resolve<any>
id : 'events',
data: [...events]
})
.subscribe(response => {
.subscribe((response: any) => {
this.getEvents();
}, reject);
});

View File

@@ -1,135 +1,142 @@
<md-toolbar md-dialog-title class="mat-accent m-0">
<div fxFlex fxLayout="row" fxLayoutAlign="space-between center">
<span class="title dialog-title">{{dialogTitle}}</span>
<button md-button class="mat-icon-button"
(click)="dialogRef.close()"
aria-label="Close dialog">
<md-icon>close</md-icon>
</button>
</div>
</md-toolbar>
<div md-dialog-content class="p-24 m-0" perfect-scrollbar>
<form name="eventForm" [formGroup]="eventForm" class="event-form" fxLayout="column" fxFlex>
<md-input-container>
<input mdInput
name="title"
formControlName="title"
placeholder="Title"
required>
</md-input-container>
<div class="py-16" fxFlex="1 0 auto" fxLayout="row">
<md-slide-toggle
name="allDay"
formControlName="allDay"
class="mr-24"
aria-label="All day">
All Day
</md-slide-toggle>
<div class="dialog-content-wrapper">
<mat-toolbar matDialogTitle class="mat-accent m-0">
<div 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">
<mat-icon>close</mat-icon>
</button>
</div>
</mat-toolbar>
<div class="py-16" fxFlex="1 0 auto" fxLayout="row" formGroupName="color">
<md-input-container class="mr-24">
<input mdInput
name="primary color"
formControlName="primary"
placeholder="Primary color"
[(colorPicker)]="event.color.primary"
cpWidth="290px"
[cpPresetColors]="presetColors"
[style.background]="event.color.primary"
(colorPickerChange)="event.color.primary = $event; eventForm.patchValue({color:{primary:$event}})"/>
</md-input-container>
<md-input-container>
<input mdInput
name="secondary color"
formControlName="secondary"
placeholder="Secondary color"
[(colorPicker)]="event.color.secondary"
cpWidth="290px"
[cpPresetColors]="presetColors"
[style.background]="event.color.secondary"
(colorPickerChange)="event.color.secondary = $event; eventForm.patchValue({color:{secondary:$event}})"/>
</md-input-container>
</div>
<div mat-dialog-content class="p-24 m-0" fusePerfectScrollbar>
<div fxFlex="1 0 auto" fxLayout="row">
<form name="eventForm" [formGroup]="eventForm" class="event-form w-100-p" fxLayout="column" fxFlex>
<md-form-field class="mr-24">
<input mdInput [mdDatepicker]="startDatePicker" placeholder="Start Date">
<md-datepicker-toggle mdSuffix [for]="startDatePicker"></md-datepicker-toggle>
<md-datepicker #startDatePicker></md-datepicker>
</md-form-field>
<mat-form-field class="w-100-p">
<input matInput
name="title"
formControlName="title"
placeholder="Title"
required>
</mat-form-field>
<md-datepicker #startDatePicker></md-datepicker>
<div class="py-16" fxFlex="1 0 auto" fxLayout="row">
<mat-slide-toggle
name="allDay"
formControlName="allDay"
class="mr-24"
aria-label="All day">
All Day
</mat-slide-toggle>
</div>
</div>
<div class="py-16" fxFlex="1 0 auto" fxLayout="row" formGroupName="color">
<mat-form-field class="mr-24" fxFlex>
<input matInput
name="primary color"
formControlName="primary"
placeholder="Primary color"
[(colorPicker)]="event.color.primary"
cpWidth="290px"
[cpPresetColors]="presetColors"
[style.background]="event.color.primary"
(colorPickerChange)="event.color.primary = $event; eventForm.patchValue({color:{primary:$event}})"/>
</mat-form-field>
<mat-form-field fxFlex>
<input matInput
name="secondary color"
formControlName="secondary"
placeholder="Secondary color"
[(colorPicker)]="event.color.secondary"
cpWidth="290px"
[cpPresetColors]="presetColors"
[style.background]="event.color.secondary"
(colorPickerChange)="event.color.secondary = $event; eventForm.patchValue({color:{secondary:$event}})"/>
</mat-form-field>
</div>
<div fxFlex="1 0 auto" fxLayout="row">
<div fxFlex="1 0 auto" fxLayout="row">
<md-form-field class="mr-24">
<input mdInput [mdDatepicker]="endDatePicker" placeholder="End Date">
<md-datepicker-toggle mdSuffix [for]="endDatePicker"></md-datepicker-toggle>
<md-datepicker #endDatePicker></md-datepicker>
</md-form-field>
<mat-form-field class="mr-24" fxFlex>
<input matInput [matDatepicker]="startDatePicker" placeholder="Start Date"
name="start"
formControlName="start">
<mat-datepicker-toggle matSuffix [for]="startDatePicker"></mat-datepicker-toggle>
<mat-datepicker #startDatePicker></mat-datepicker>
</mat-form-field>
<md-input-container class="no-errors-spacer" flex md-no-float>
<input mdInput ng-model="calendarEvent.endTime" placeholder="End Time">
</md-input-container>
<mat-form-field class="no-errors-spacer" fxFlex mat-no-float>
<input matInput placeholder="Start Time">
</mat-form-field>
</div>
</div>
<md-input-container formGroupName="meta">
<input mdInput
name="location"
formControlName="location"
placeholder="Location">
</md-input-container>
<div fxFlex="1 0 auto" fxLayout="row">
<md-input-container formGroupName="meta">
<mat-form-field class="mr-24" fxFlex>
<input matInput [matDatepicker]="endDatePicker" placeholder="End Date"
name="end"
formControlName="end">
<mat-datepicker-toggle matSuffix [for]="endDatePicker"></mat-datepicker-toggle>
<mat-datepicker #endDatePicker></mat-datepicker>
</mat-form-field>
<textarea mdInput
<mat-form-field class="no-errors-spacer" fxFlex mat-no-float>
<input matInput placeholder="End Time">
</mat-form-field>
</div>
<mat-form-field formGroupName="meta" class="w-100-p">
<input matInput
name="location"
formControlName="location"
placeholder="Location">
</mat-form-field>
<mat-form-field formGroupName="meta" class="w-100-p">
<textarea matInput
formControlName="notes"
placeholder="Notes"
md-maxlength="250"
mat-maxlength="250"
max-rows="4">
</textarea>
</md-input-container>
</mat-form-field>
</form>
</div>
<div md-dialog-actions class="m-0 p-16" fxLayout="row" fxLayoutAlign="space-between center">
<button *ngIf="action !=='edit'"
md-raised-button
(click)="dialogRef.close(eventForm)"
class="save-button mat-accent"
[disabled]="eventForm.invalid"
aria-label="SAVE">
SAVE
</button>
<button *ngIf="action ==='edit'"
md-raised-button
(click)="dialogRef.close(['save',eventForm])"
class="save-button mat-accent"
[disabled]="eventForm.invalid"
aria-label="SAVE">
SAVE
</button>
<button *ngIf="action ==='edit'"
md-button
class="mat-icon-button"
(click)="dialogRef.close(['delete',eventForm])"
aria-label="Delete"
md-tooltip="Delete">
<md-icon>delete</md-icon>
</button>
</form>
</div>
<div mat-dialog-actions class="m-0 p-16" fxLayout="row" fxLayoutAlign="space-between center">
<button *ngIf="action !=='edit'"
mat-raised-button
(click)="dialogRef.close(eventForm)"
class="save-button mat-accent"
[disabled]="eventForm.invalid"
aria-label="SAVE">
SAVE
</button>
<button *ngIf="action ==='edit'"
mat-raised-button
(click)="dialogRef.close(['save',eventForm])"
class="save-button mat-accent"
[disabled]="eventForm.invalid"
aria-label="SAVE">
SAVE
</button>
<button *ngIf="action ==='edit'"
mat-button
class="mat-icon-button"
(click)="dialogRef.close(['delete',eventForm])"
aria-label="Delete"
matTooltip="Delete">
<mat-icon>delete</mat-icon>
</button>
</div>
</div>

View File

@@ -2,11 +2,12 @@
.mat-dialog-container {
padding: 0;
width: 720px;
width: 480px;
}
.dialog-content-wrapper {
max-height: 85vh;
display: flex;
flex-direction: column;
}
}
:host {
display: flex;
flex-direction: column;
}

View File

@@ -1,5 +1,5 @@
import { Component, Inject, OnInit, ViewEncapsulation } from '@angular/core';
import { MD_DIALOG_DATA, MdDialogRef } from '@angular/material';
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material';
import { CalendarEvent } from 'angular-calendar';
import { FormBuilder, FormControl, FormGroup } from '@angular/forms';
import { CalendarEventModel } from '../event.model';
@@ -22,8 +22,8 @@ export class FuseCalendarEventFormDialogComponent implements OnInit
presetColors = MatColors.presets;
constructor(
public dialogRef: MdDialogRef<FuseCalendarEventFormDialogComponent>,
@Inject(MD_DIALOG_DATA) private data: any,
public dialogRef: MatDialogRef<FuseCalendarEventFormDialogComponent>,
@Inject(MAT_DIALOG_DATA) private data: any,
private formBuilder: FormBuilder
)
{

View File

@@ -1,16 +1,17 @@
<div fxFlex fxLayout="column" fxLayoutAlign="center center">
<div class="big-circle mat-elevation-z1" fxLayout="column" fxLayoutAlign="center center">
<div class="big-circle mat-elevation-z1 app-logo" fxLayout="column" fxLayoutAlign="center center"
*fuseIfOnDom [@animate]="{value:'*',params:{delay:'50ms',scale:'0.2'}}">
<md-icon class="s-64 s-md-128">chat</md-icon>
<mat-icon class="s-64 s-mat-128">chat</mat-icon>
</div>
<span class="app-title my-24">Chat App</span>
<span class="app-title my-24" *fuseIfOnDom [@animate]="{value:'*',params:{delay:'100ms',y:'25px'}}">Chat App</span>
<span fxHide fxShow.gt-md class="app-message">Select contact to start the chat!..</span>
<span fxHide fxShow.gt-md class="app-message" *fuseIfOnDom [@animate]="{value:'*',params:{delay:'200ms',y:'50px'}}">Select contact to start the chat!..</span>
<button md-raised-button fxHide.gt-md class="" fuseMdSidenavToggler="chat-left-sidenav">
<button mat-raised-button fxHide.gt-md class="" fuseMatSidenavToggler="chat-left-sidenav">
Select contact to start the chat!..
</button>

View File

@@ -19,7 +19,7 @@
line-height: 160px;
}
md-icon {
mat-icon {
color: mat-color($accent);
}
}

View File

@@ -1,9 +1,11 @@
import { Component, OnInit } from '@angular/core';
import { fuseAnimations } from '../../../../../core/animations';
@Component({
selector : 'fuse-chat-start',
templateUrl: './chat-start.component.html',
styleUrls : ['./chat-start.component.scss']
styleUrls : ['./chat-start.component.scss'],
animations : fuseAnimations
})
export class FuseChatStartComponent implements OnInit
{

View File

@@ -2,23 +2,23 @@
<div class="chat" fxFlex fxLayout="column">
<!-- CHAT TOOLBAR -->
<md-toolbar class="chat-toolbar">
<mat-toolbar class="chat-toolbar">
<div fxFlex fxLayout="row" fxLayoutAlign="space-between center">
<div fxLayout="row" fxLayoutAlign="start center">
<!-- RESPONSIVE CHATS BUTTON-->
<div md-button fxHide.gt-md class="responsive-chats-button mat-icon-button mr-16"
fuseMdSidenavToggler="chat-left-sidenav"
<div mat-button fxHide.gt-md class="responsive-chats-button mat-icon-button mr-16"
fuseMatSidenavToggler="chat-left-sidenav"
aria-label="chats button">
<md-icon class="s-36">chat</md-icon>
<mat-icon class="s-36">chat</mat-icon>
</div>
<!-- / RESPONSIVE CHATS BUTTON-->
<!-- CHAT CONTACT-->
<div class="chat-contact" fxLayout="row" fxLayoutAlign="start center"
fuseMdSidenavToggler="chat-right-sidenav" (click)="selectContact()">
fuseMatSidenavToggler="chat-right-sidenav" (click)="selectContact()">
<div class="avatar-wrapper">
@@ -26,9 +26,9 @@
class="avatar"
alt="{{contact.name}}"/>
<md-icon class="s-16 status"
[ngClass]="contact.status">
</md-icon>
<mat-icon class="s-16 status"
[ngClass]="contact.status">
</mat-icon>
</div>
<div class="chat-contact-name">
@@ -40,24 +40,24 @@
</div>
<div>
<button md-button class="mat-icon-button" [mdMenuTriggerFor]="contactMenu"
<button mat-button class="mat-icon-button" [matMenuTriggerFor]="contactMenu"
aria-label="more">
<md-icon>more_vert</md-icon>
<mat-icon>more_vert</mat-icon>
</button>
<md-menu #contactMenu="mdMenu">
<button md-menu-item fuseMdSidenavToggler="chat-right-sidenav" (click)="selectContact()">
<mat-menu #contactMenu="matMenu">
<button mat-menu-item fuseMatSidenavToggler="chat-right-sidenav" (click)="selectContact()">
Contact Info
</button>
</md-menu>
</mat-menu>
</div>
</div>
</md-toolbar>
</mat-toolbar>
<!-- / CHAT TOOLBAR -->
<!-- CHAT CONTENT -->
<div id="chat-content" fxFlex perfect-scrollbar>
<div id="chat-content" fxFlex fusePerfectScrollbar>
<!-- CHAT MESSAGES -->
<div class="chat-messages">
@@ -98,13 +98,13 @@
fxLayout="row"
fxLayoutAlign="start center">
<md-input-container class="" fxFlex floatPlaceholder="never">
<textarea mdInput #replyInput placeholder="Type and hit enter to send message"
<mat-form-field class="" fxFlex floatPlaceholder="never">
<textarea matInput #replyInput placeholder="Type and hit enter to send message"
ngModel name="message"></textarea>
</md-input-container>
</mat-form-field>
<button md-fab class="" type="submit" aria-label="Send message">
<md-icon>send</md-icon>
<button mat-fab class="" type="submit" aria-label="Send message">
<mat-icon>send</mat-icon>
</button>
</form>

View File

@@ -32,6 +32,7 @@
#chat-content {
background: transparent;
overflow: auto;
.message-row {
padding: 16px;
@@ -107,7 +108,7 @@
.reply-form {
md-input-container {
mat-form-field {
margin: 0;
padding-right: 16px;
@@ -120,12 +121,12 @@
}
}
.md-errors-spacer {
.mat-errors-spacer {
display: none;
}
}
.md-button {
.mat-button {
margin: 0;
}
}

View File

@@ -1,7 +1,7 @@
import { AfterViewInit, Component, OnInit, ViewChild, ViewChildren } from '@angular/core';
import { ChatService } from '../chat.service';
import { NgForm } from '@angular/forms';
import { PerfectScrollbarDirective } from 'ngx-perfect-scrollbar';
import { FusePerfectScrollbarDirective } from '../../../../../core/directives/fuse-perfect-scrollbar/fuse-perfect-scrollbar.directive';
@Component({
selector : 'fuse-chat-view',
@@ -16,7 +16,7 @@ export class FuseChatViewComponent implements OnInit, AfterViewInit
contact: any;
replyInput: any;
selectedChat: any;
@ViewChild(PerfectScrollbarDirective) directiveScroll: PerfectScrollbarDirective;
@ViewChild(FusePerfectScrollbarDirective) directiveScroll: FusePerfectScrollbarDirective;
@ViewChildren('replyInput') replyInputField;
@ViewChild('replyForm') replyForm: NgForm;
@@ -72,11 +72,12 @@ export class FuseChatViewComponent implements OnInit, AfterViewInit
speed = speed || 400;
if ( this.directiveScroll )
{
this.directiveScroll.update();
setTimeout(() => {
this.directiveScroll.scrollToBottom(0, speed);
});
}
}
reply(event)

View File

@@ -1,7 +1,7 @@
<div id="chat" class="page-layout carded fullwidth">
<!-- TOP BACKGROUND -->
<div class="top-bg md-accent-bg"></div>
<div class="top-bg mat-accent-bg"></div>
<!-- / TOP BACKGROUND -->
<!-- CENTER -->
@@ -10,13 +10,13 @@
<!-- CONTENT CARD -->
<div class="content-card">
<md-sidenav-container>
<mat-sidenav-container>
<!-- LEFT SIDENAV -->
<md-sidenav class="sidenav mat-sidenav-opened" align="start" opened="true" mode="side"
fuseMdSidenavHelper="chat-left-sidenav" md-is-locked-open="gt-md">
<mat-sidenav class="sidenav mat-sidenav-opened" align="start" opened="true" mode="side"
fuseMatSidenavHelper="chat-left-sidenav" mat-is-locked-open="gt-md">
<fuse-chat-left-sidenav></fuse-chat-left-sidenav>
</md-sidenav>
</mat-sidenav>
<!-- / LEFT SIDENAV -->
<!-- CONTENT -->
@@ -26,13 +26,13 @@
<!-- / CONTENT -->
<!-- RIGHT SIDENAV -->
<md-sidenav class="sidenav mat-sidenav-opened" align="end" opened="false" mode="over"
fuseMdSidenavHelper="chat-right-sidenav">
<mat-sidenav class="sidenav mat-sidenav-opened" align="end" opened="false" mode="over"
fuseMatSidenavHelper="chat-right-sidenav">
<fuse-chat-right-sidenav></fuse-chat-right-sidenav>
</md-sidenav>
</mat-sidenav>
<!-- / RIGHT SIDENAV -->
</md-sidenav-container>
</mat-sidenav-container>
</div>
<!-- / CONTENT CARD -->

View File

@@ -28,7 +28,7 @@
> .mat-sidenav-content,
> .mat-drawer-content {
display: flex;
flex: 1 0 auto;
flex: 1 1 auto;
min-height: 100%;
height: auto;
}
@@ -37,7 +37,7 @@
max-width: 100%;
}
md-sidenav {
mat-sidenav {
display: flex;
flex-direction: column;
width: 400px;

View File

@@ -1,11 +1,13 @@
import { Component, OnInit, ViewEncapsulation } from '@angular/core';
import { ChatService } from './chat.service';
import { fuseAnimations } from '../../../../core/animations';
@Component({
selector : 'fuse-chat',
templateUrl : './chat.component.html',
styleUrls : ['./chat.component.scss'],
encapsulation: ViewEncapsulation.None
encapsulation: ViewEncapsulation.None,
animations : fuseAnimations
})
export class FuseChatComponent implements OnInit
{

View File

@@ -1,7 +1,7 @@
import { Injectable } from '@angular/core';
import { ActivatedRouteSnapshot, Resolve, RouterStateSnapshot } from '@angular/router';
import { Observable } from 'rxjs/Observable';
import { Http } from '@angular/http';
import { HttpClient } from '@angular/common/http';
import { Subject } from 'rxjs/Subject';
import { BehaviorSubject } from 'rxjs/BehaviorSubject';
import { FuseUtils } from '../../../../core/fuseUtils';
@@ -19,7 +19,7 @@ export class ChatService implements Resolve<any>
onLeftSidenavViewChanged = new Subject<any>();
onRightSidenavViewChanged = new Subject<any>();
constructor(private http: Http)
constructor(private http: HttpClient)
{
}
@@ -47,8 +47,8 @@ export class ChatService implements Resolve<any>
return new Promise((resolve, reject) => {
this.http.get('api/chat-chats/' + chatItem.id)
.subscribe(response => {
const chat = response.json().data;
.subscribe((response: any) => {
const chat = response;
const chatContact = this.contacts.find((contact) => {
return contact.id === contactId;
@@ -105,7 +105,7 @@ export class ChatService implements Resolve<any>
* Post the created chat
*/
this.http.post('api/chat-chats', {...chat})
.subscribe(response => {
.subscribe((response: any) => {
/**
* Post the new the user data
@@ -150,7 +150,7 @@ export class ChatService implements Resolve<any>
updateUserData(userData)
{
this.http.post('api/chat-user/' + this.user.id, userData)
.subscribe(response => {
.subscribe((response: any) => {
this.user = userData;
}
);
@@ -211,8 +211,8 @@ export class ChatService implements Resolve<any>
{
return new Promise((resolve, reject) => {
this.http.get('api/chat-contacts')
.subscribe(response => {
resolve(response.json().data);
.subscribe((response: any) => {
resolve(response);
}, reject);
});
}
@@ -225,8 +225,8 @@ export class ChatService implements Resolve<any>
{
return new Promise((resolve, reject) => {
this.http.get('api/chat-chats')
.subscribe(response => {
resolve(response.json().data);
.subscribe((response: any) => {
resolve(response);
}, reject);
});
}
@@ -239,8 +239,8 @@ export class ChatService implements Resolve<any>
{
return new Promise((resolve, reject) => {
this.http.get('api/chat-user')
.subscribe(response => {
resolve(response.json().data[0]);
.subscribe((response: any) => {
resolve(response[0]);
}, reject);
});
}

View File

@@ -1,7 +1,7 @@
<!-- SIDENAV HEADER -->
<div class="sidenav-header">
<!-- CHATS TOOLBAR -->
<md-toolbar>
<mat-toolbar>
<!-- TOOLBAR TOP -->
<div fxFlex fxLayout="row" fxLayoutAlign="space-between center">
@@ -12,75 +12,75 @@
<!-- USER AVATAR -->
<img (click)="changeLeftSidenavView('user')"
src="{{user.avatar}}"
class="md-avatar avatar"
class="mat-avatar avatar"
alt="{{user.name}}"/>
<!-- / USER AVATAR -->
<md-icon class="s-16 status" [ngClass]="user.status" [mdMenuTriggerFor]="userStatusMenu"></md-icon>
<mat-icon class="s-16 status" [ngClass]="user.status" [matMenuTriggerFor]="userStatusMenu"></mat-icon>
<!-- USER STATUS -->
<md-menu id="user-status-menu" #userStatusMenu="mdMenu">
<mat-menu id="user-status-menu" #userStatusMenu="matMenu">
<button md-menu-item (click)="setUserStatus('online')">
<button mat-menu-item (click)="setUserStatus('online')">
<div fxLayout="row" fxLayoutAlign="start center">
<md-icon class="s-16 status online"></md-icon>
<mat-icon class="s-16 status online"></mat-icon>
<span>Online</span>
</div>
</button>
<button md-menu-item (click)="setUserStatus('away')">
<button mat-menu-item (click)="setUserStatus('away')">
<div fxLayout="row" fxLayoutAlign="start center">
<md-icon class="s-16 status away"></md-icon>
<mat-icon class="s-16 status away"></mat-icon>
<span>Away</span>
</div>
</button>
<button md-menu-item (click)="setUserStatus('do-not-disturb')">
<button mat-menu-item (click)="setUserStatus('do-not-disturb')">
<div fxLayout="row" fxLayoutAlign="start center">
<md-icon class="s-16 status do-not-disturb"></md-icon>
<mat-icon class="s-16 status do-not-disturb"></mat-icon>
<span>Do not disturb</span>
</div>
</button>
<button md-menu-item (click)="setUserStatus('offline')">
<button mat-menu-item (click)="setUserStatus('offline')">
<div fxLayout="row" fxLayoutAlign="start center">
<md-icon class="s-16 status offline"></md-icon>
<mat-icon class="s-16 status offline"></mat-icon>
<span>Offline</span>
</div>
</button>
</md-menu>
</mat-menu>
<!-- / USER STATUS -->
</div>
<!-- / USER AVATAR -->
<div>
<button md-button class="mat-icon-button"
[mdMenuTriggerFor]="userMenu"
<button mat-button class="mat-icon-button"
[matMenuTriggerFor]="userMenu"
aria-label="more">
<md-icon>more_vert</md-icon>
<mat-icon>more_vert</mat-icon>
</button>
<md-menu #userMenu="mdMenu">
<button md-menu-item (click)="changeLeftSidenavView('user')">
<mat-menu #userMenu="matMenu">
<button mat-menu-item (click)="changeLeftSidenavView('user')">
Profile
</button>
<button md-menu-item (click)="logout()">
<button mat-menu-item (click)="logout()">
Logout
</button>
</md-menu>
</mat-menu>
</div>
</div>
<!-- / TOOLBAR TOP -->
<!-- TOOLBAR BOTTOM -->
<md-toolbar-row>
<mat-toolbar-row>
<!-- SEARCH -->
<div class="search-wrapper" fxFlex fxLayout="row" fxLayoutAlign="start center">
<div class="search" fxFlex fxLayout="row" fxLayoutAlign="start center">
<md-icon>search</md-icon>
<mat-icon>search</mat-icon>
<input [(ngModel)]="searchText" type="text" placeholder="Search or start new chat" fxFlex>
@@ -88,31 +88,32 @@
</div>
<!-- / SEARCH -->
</md-toolbar-row>
</mat-toolbar-row>
<!-- / TOOLBAR BOTTOM -->
</md-toolbar>
</mat-toolbar>
<!-- / CHATS TOOLBAR -->
</div>
<!-- / SIDENAV HEADER -->
<!-- SIDENAV CONTENT -->
<div class="sidenav-content" perfect-scrollbar fxFlex>
<div class="sidenav-content" fusePerfectScrollbar fxFlex>
<!-- CHATS CONTENT -->
<div>
<div *fuseIfOnDom [@animateStagger]="{value:'50'}">
<!-- CHATS LIST-->
<div class="chat-list" fxLayout="column">
<div md-subheader *ngIf="(user.chatList | filter: searchText).length > 0">
<div matSubheader *ngIf="(user.chatList | filter: searchText).length > 0">
Chats
</div>
<button md-button class="contact"
<button mat-button class="contact"
*ngFor="let chat of user.chatList | filter: searchText"
(click)="getChat(chat.contactId)" ngClass="{'unread':contact.unread}">
(click)="getChat(chat.contactId)" ngClass="{'unread':contact.unread}"
[@animate]="{value:'*',params:{y:'100%'}}">
<div fxLayout="row" fxLayoutAlign="start center">
@@ -120,7 +121,7 @@
<img [src]="contacts |getById:chat.contactId:'avatar'"
class="avatar"
alt="{{contacts |getById:chat.contactId:'name'}}"/>
<md-icon class="s-16 status" [ngClass]="contacts |getById:chat.contactId:'status'"></md-icon>
<mat-icon class="s-16 status" [ngClass]="contacts |getById:chat.contactId:'status'"></mat-icon>
</div>
<div fxLayout="row" fxFlex>
@@ -145,19 +146,19 @@
<!-- CONTACTS LIST-->
<div class="contact-list" fxLayout="column">
<div md-subheader *ngIf="(contacts| filter: searchText).length > 0">
<div matSubheader *ngIf="(contacts| filter: searchText).length > 0">
Contacts
</div>
<button md-button class="contact"
ng-show="chatSearch"
<button mat-button class="contact"
*ngFor="let contact of contacts| filter: searchText"
(click)="getChat(contact.id)">
(click)="getChat(contact.id)"
[@animate]="{value:'*',params:{y:'100%'}}">
<div fxLayout="row" fxLayoutAlign="start center">
<div class="avatar-wrapper" fxFlex="0 1 auto">
<img src="{{contact.avatar}}" class="md-avatar avatar" alt="{{contact.name}}"/>
<md-icon class="s-16 status" [ngClass]="contact.status"></md-icon>
<img src="{{contact.avatar}}" class="mat-avatar avatar" alt="{{contact.name}}"/>
<mat-icon class="s-16 status" [ngClass]="contact.status"></mat-icon>
</div>
<div class="" fxLayout="column" fxLayoutAlign="center start">

View File

@@ -7,7 +7,7 @@
.sidenav-header {
md-toolbar {
mat-toolbar {
border-bottom: 1px solid rgba(0, 0, 0, .08);
.avatar-wrapper {

View File

@@ -1,12 +1,14 @@
import { Component, OnInit } from '@angular/core';
import { ChatService } from '../../../chat.service';
import { FuseMdSidenavHelperService } from '../../../../../../../core/directives/md-sidenav-helper/md-sidenav-helper.service';
import { FuseMatSidenavHelperService } from '../../../../../../../core/directives/mat-sidenav-helper/mat-sidenav-helper.service';
import { ObservableMedia } from '@angular/flex-layout';
import { fuseAnimations } from '../../../../../../../core/animations';
@Component({
selector : 'fuse-chat-chats-sidenav',
templateUrl: './chats.component.html',
styleUrls : ['./chats.component.scss']
styleUrls : ['./chats.component.scss'],
animations : fuseAnimations
})
export class FuseChatChatsSidenavComponent implements OnInit
{
@@ -18,7 +20,7 @@ export class FuseChatChatsSidenavComponent implements OnInit
constructor(
private chatService: ChatService,
private fuseMdSidenavService: FuseMdSidenavHelperService,
private fuseMatSidenavService: FuseMatSidenavHelperService,
public media: ObservableMedia
)
{
@@ -48,7 +50,7 @@ export class FuseChatChatsSidenavComponent implements OnInit
if ( !this.media.isActive('gt-md') )
{
this.fuseMdSidenavService.getSidenav('chat-left-sidenav').toggle();
this.fuseMatSidenavService.getSidenav('chat-left-sidenav').toggle();
}
}

View File

@@ -1,12 +1,12 @@
import { Component, OnInit } from '@angular/core';
import { Animations } from '../../../../../../core/animations';
import { fuseAnimations } from '../../../../../../core/animations';
import { ChatService } from '../../chat.service';
@Component({
selector : 'fuse-chat-left-sidenav',
templateUrl: './left.component.html',
styleUrls : ['./left.component.scss'],
animations : [Animations.slideInLeft, Animations.slideInRight]
animations : fuseAnimations
})
export class FuseChatLeftSidenavComponent implements OnInit
{

View File

@@ -2,77 +2,77 @@
<div class="sidenav-header">
<!-- USER TOOLBAR -->
<md-toolbar>
<mat-toolbar>
<!-- TOOLBAR TOP -->
<div fxFlex fxLayout="row" fxLayoutAlign="space-between center">
<button md-button class="mat-icon-button" (click)="changeLeftSidenavView('chats')" aria-label="back">
<md-icon>arrow_back</md-icon>
<button mat-button class="mat-icon-button" (click)="changeLeftSidenavView('chats')" aria-label="back">
<mat-icon>arrow_back</mat-icon>
</button>
</div>
<!-- / TOOLBAR TOP -->
<!-- TOOLBAR BOTTOM -->
<md-toolbar-row class="toolbar-bottom" fxLayout="column" fxLayoutAlign="center center">
<mat-toolbar-row class="toolbar-bottom" fxLayout="column" fxLayoutAlign="center center">
<img [src]="user.avatar" class="avatar user-avatar huge" alt="{{user.name}}"/>
<div class="user-name my-8">{{user.name}}</div>
</md-toolbar-row>
</mat-toolbar-row>
<!-- / TOOLBAR BOTTOM -->
</md-toolbar>
</mat-toolbar>
<!-- / USER TOOLBAR -->
</div>
<!-- SIDENAV CONTENT -->
<div class="sidenav-content p-16" perfect-scrollbar fxFlex>
<div class="sidenav-content p-16" fusePerfectScrollbar fxFlex>
<!-- USER MOOD -->
<md-card>
<mat-card>
<form [formGroup]="userForm" fxLayout="column">
<md-input-container class="mb-24" fxFlex="0 1 auto">
<textarea mdInput placeholder="Mood" name="mood"
<mat-form-field class="mb-24" fxFlex="0 1 auto">
<textarea matInput placeholder="Mood" name="mood"
formControlName="mood" rows="3"></textarea>
</md-input-container>
</mat-form-field>
<md-radio-group formControlName="status" fxLayout="column">
<mat-radio-group formControlName="status" fxLayout="column">
<md-radio-button value="online" class="py-8">
<mat-radio-button value="online" class="py-8">
<div fxLayout="row" fxLayoutAlign="start center">
<md-icon class="status online mr-8"></md-icon>
<mat-icon class="status online mr-8"></mat-icon>
<span class="mat-h4 m-0">Online</span>
</div>
</md-radio-button>
</mat-radio-button>
<md-radio-button value="away" class="py-8">
<mat-radio-button value="away" class="py-8">
<div fxLayout="row" fxLayoutAlign="start center">
<md-icon class="status away mr-8"></md-icon>
<mat-icon class="status away mr-8"></mat-icon>
<span class="mat-h4 m-0">Away</span>
</div>
</md-radio-button>
</mat-radio-button>
<md-radio-button value="do-not-disturb" class="py-8">
<mat-radio-button value="do-not-disturb" class="py-8">
<div fxLayout="row" fxLayoutAlign="start center">
<md-icon class="status do-not-disturb mr-8"></md-icon>
<mat-icon class="status do-not-disturb mr-8"></mat-icon>
<span class="mat-h4 m-0">Do not disturb</span>
</div>
</md-radio-button>
</mat-radio-button>
<md-radio-button value="offline" class="py-8">
<mat-radio-button value="offline" class="py-8">
<div fxLayout="row" fxLayoutAlign="start center">
<md-icon class="status offline mr-8"></md-icon>
<mat-icon class="status offline mr-8"></mat-icon>
<span class="mat-h4 m-0">Offline</span>
</div>
</md-radio-button>
</md-radio-group>
</mat-radio-button>
</mat-radio-group>
</form>
</md-card>
</mat-card>
<!-- / USER MOOD -->
</div>

View File

@@ -5,7 +5,7 @@
flex: 1;
flex-direction: column;
md-toolbar {
mat-toolbar {
background-color: mat-color($accent);
color: map-get($accent, default-contrast);

View File

@@ -2,46 +2,46 @@
<div class="sidenav-header" *ngIf="contact">
<!-- CONTACT TOOLBAR -->
<md-toolbar>
<mat-toolbar>
<!-- TOOLBAR TOP -->
<div fxFlex fxLayout="row" fxLayoutAlign="space-between center">
<div>Contact Info</div>
<button md-button class="mat-icon-button" fuseMdSidenavToggler="chat-right-sidenav" aria-label="close">
<md-icon>close</md-icon>
<button mat-button class="mat-icon-button" fuseMatSidenavToggler="chat-right-sidenav" aria-label="close">
<mat-icon>close</mat-icon>
</button>
</div>
<!-- / TOOLBAR TOP -->
<!-- TOOLBAR BOTTOM -->
<md-toolbar-row class="toolbar-bottom" fxLayout="column" fxLayoutAlign="center center">
<mat-toolbar-row class="toolbar-bottom" fxLayout="column" fxLayoutAlign="center center">
<img [src]="contact.avatar" class="avatar contact-avatar huge" alt="{{contact.name}}"/>
<div class="contact-name my-8">{{contact.name}}</div>
</md-toolbar-row>
</mat-toolbar-row>
<!-- / TOOLBAR BOTTOM -->
</md-toolbar>
</mat-toolbar>
<!-- / CONTACT TOOLBAR -->
</div>
<!-- SIDENAV CONTENT -->
<div class="sidenav-content p-16" perfect-scrollbar fxFlex *ngIf="contact">
<div class="sidenav-content p-16" fusePerfectScrollbar fxFlex *ngIf="contact">
<!-- CONTACT MOOD -->
<md-card>
<mat-card>
<md-input-container fxFlex>
<textarea mdInput placeholder="Mood" name="mood"
<mat-form-field fxFlex>
<textarea matInput placeholder="Mood" name="mood"
[value]="contact.mood" rows="3" disabled>
</textarea>
</md-input-container>
</mat-form-field>
</md-card>
</mat-card>
<!-- / CONTACT MOOD -->
</div>

View File

@@ -5,7 +5,7 @@
flex: 1;
flex-direction: column;
md-toolbar {
mat-toolbar {
background-color: mat-color($accent);
color: map-get($accent, default-contrast);

View File

@@ -1,12 +1,12 @@
import { Component, OnInit } from '@angular/core';
import { Animations } from '../../../../../../core/animations';
import { fuseAnimations } from '../../../../../../core/animations';
import { ChatService } from '../../chat.service';
@Component({
selector : 'fuse-chat-right-sidenav',
templateUrl: './right.component.html',
styleUrls : ['./right.component.scss'],
animations : [Animations.slideInLeft, Animations.slideInRight]
animations : fuseAnimations
})
export class FuseChatRightSidenavComponent implements OnInit
{

View File

@@ -1,126 +1,128 @@
<md-toolbar md-dialog-title class="mat-accent m-0">
<div fxFlex fxLayout="row" fxLayoutAlign="space-between center">
<span class="title dialog-title">{{dialogTitle}}</span>
<button md-button class="mat-icon-button"
(click)="dialogRef.close()"
aria-label="Close dialog">
<md-icon>close</md-icon>
</button>
<div class="dialog-content-wrapper">
<mat-toolbar matDialogTitle class="mat-accent m-0">
<div 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">
<mat-icon>close</mat-icon>
</button>
</div>
<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"
[alt]="contact.name"/>
<div class="contact-name">{{contact.name}}</div>
</mat-toolbar-row>
</mat-toolbar>
<div mat-dialog-content class="p-24 m-0" fusePerfectScrollbar>
<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>
<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>
<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>
<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>
<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>
<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>
<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>
<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>
<input matInput [matDatepicker]="birthdayDatePicker" placeholder="Birthday">
<mat-datepicker-toggle matSuffix [for]="birthdayDatePicker"></mat-datepicker-toggle>
<mat-datepicker #birthdayDatePicker></mat-datepicker>
</mat-form-field>
</div>
<div class="mb-24" fxLayout="row" fxLayoutAlign="start start">
<mat-icon class="mr-12 mt-12">home</mat-icon>
<mat-form-field fxFlex>
<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>
</mat-form-field>
</div>
</form>
</div>
<md-toolbar-row class="toolbar-bottom" fxLayout="column" fxLayoutAlign="center center">
<img [src]="contact.avatar" class=" avatar contact-avatar huge"
[alt]="contact.name"/>
<div class="contact-name">{{contact.name}}</div>
</md-toolbar-row>
</md-toolbar>
<div mat-dialog-actions class="m-0 p-16" fxLayout="row" fxLayoutAlign="space-between center">
<div md-dialog-content class="p-24 m-0" perfect-scrollbar>
<button *ngIf="action !=='edit'"
mat-raised-button
(click)="dialogRef.close(contactForm)"
class="save-button mat-accent"
[disabled]="contactForm.invalid"
aria-label="SAVE">
SAVE
</button>
<form [formGroup]="contactForm">
<button *ngIf="action ==='edit'"
mat-raised-button
(click)="dialogRef.close(['save',contactForm])"
class="save-button mat-accent"
[disabled]="contactForm.invalid"
aria-label="SAVE">
SAVE
</button>
<div class="mb-24" fxLayout="row" fxLayoutAlign="start start">
<md-icon class="mr-12 mt-12">account_circle</md-icon>
<md-input-container fxFlex>
<input name="name" formControlName="name" placeholder="Name" mdInput required>
</md-input-container>
</div>
<div class="mb-24" fxLayout="row" fxLayoutAlign="start start">
<md-icon class="mr-12 mt-12"></md-icon>
<md-input-container fxFlex>
<input name="lastName" formControlName="lastName" placeholder="Lastname" mdInput>
</md-input-container>
</div>
<div class="mb-24" fxLayout="row" fxLayoutAlign="start start">
<md-icon class="mr-12 mt-12">star</md-icon>
<md-input-container fxFlex>
<input name="nickname" formControlName="nickname" mdInput placeholder="Nickname">
</md-input-container>
</div>
<div class="mb-24" fxLayout="row" fxLayoutAlign="start start">
<md-icon class="mr-12 mt-12">phone</md-icon>
<md-input-container fxFlex>
<input formControlName="phone" mdInput placeholder="Phone number">
</md-input-container>
</div>
<div class="mb-24" fxLayout="row" fxLayoutAlign="start start">
<md-icon class="mr-12 mt-12">email</md-icon>
<md-input-container fxFlex>
<input name="email" formControlName="email" mdInput type="email" placeholder="Email">
</md-input-container>
</div>
<div class="mb-24" fxLayout="row" fxLayoutAlign="start start">
<md-icon class="mr-12 mt-12">domain</md-icon>
<md-input-container fxFlex>
<input name="company" formControlName="company" mdInput placeholder="Company">
</md-input-container>
</div>
<div class="mb-24" fxLayout="row" fxLayoutAlign="start start">
<md-icon class="mr-12 mt-12">work</md-icon>
<md-input-container fxFlex>
<input name="jobTitle" formControlName="jobTitle" mdInput placeholder="Job title">
</md-input-container>
</div>
<div class="mb-24" fxLayout="row" fxLayoutAlign="start start">
<md-form-field class="mr-24" fxFlex>
<input mdInput [mdDatepicker]="birthdayDatePicker" placeholder="Birthday">
<md-datepicker-toggle mdSuffix [for]="birthdayDatePicker"></md-datepicker-toggle>
<md-datepicker #birthdayDatePicker></md-datepicker>
</md-form-field>
</div>
<div class="mb-24" fxLayout="row" fxLayoutAlign="start start">
<md-icon class="mr-12 mt-12">home</md-icon>
<md-input-container fxFlex>
<input name="address" formControlName="address" mdInput placeholder="Address">
</md-input-container>
</div>
<div fxLayout="row" class="textarea-wrapper" fxLayoutAlign="start start">
<md-icon class="mr-12 mt-12">note</md-icon>
<md-input-container fxFlex>
<textarea name="notes" formControlName="notes" placeholder="Notes" mdInput type="text" max-rows="4"></textarea>
</md-input-container>
</div>
</form>
</div>
<div md-dialog-actions class="m-0 p-16" fxLayout="row" fxLayoutAlign="space-between center">
<button *ngIf="action !=='edit'"
md-raised-button
(click)="dialogRef.close(contactForm)"
class="save-button mat-accent"
[disabled]="contactForm.invalid"
aria-label="SAVE">
SAVE
</button>
<button *ngIf="action ==='edit'"
md-raised-button
(click)="dialogRef.close(['save',contactForm])"
class="save-button mat-accent"
[disabled]="contactForm.invalid"
aria-label="SAVE">
SAVE
</button>
<button *ngIf="action ==='edit'"
md-button
class="mat-icon-button"
(click)="dialogRef.close(['delete',contactForm])"
aria-label="Delete"
md-tooltip="Delete">
<md-icon>delete</md-icon>
</button>
<button *ngIf="action ==='edit'"
mat-button
class="mat-icon-button"
(click)="dialogRef.close(['delete',contactForm])"
aria-label="Delete"
matTooltip="Delete">
<mat-icon>delete</mat-icon>
</button>
</div>
</div>

View File

@@ -3,14 +3,20 @@
.mat-dialog-container {
padding: 0;
width: 400px;
overflow: hidden;
.mat-toolbar {
min-height: initial;
}
.toolbar-bottom {
height: 200px;
height: auto;
}
}
}
:host {
display: flex;
flex-direction: column;
.dialog-content-wrapper {
max-height: 85vh;
display: flex;
flex-direction: column;
}
}

View File

@@ -1,5 +1,5 @@
import { Component, Inject, OnInit, ViewEncapsulation } from '@angular/core';
import { MD_DIALOG_DATA, MdDialogRef } from '@angular/material';
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material';
import { CalendarEvent } from 'angular-calendar';
import { FormBuilder, FormGroup } from '@angular/forms';
import 'rxjs/Rx';
@@ -21,8 +21,8 @@ export class FuseContactsContactFormDialogComponent implements OnInit
contact: Contact;
constructor(
public dialogRef: MdDialogRef<FuseContactsContactFormDialogComponent>,
@Inject(MD_DIALOG_DATA) private data: any,
public dialogRef: MatDialogRef<FuseContactsContactFormDialogComponent>,
@Inject(MAT_DIALOG_DATA) private data: any,
private formBuilder: FormBuilder
)
{

View File

@@ -1,109 +1,106 @@
<md-table #table [dataSource]="dataSource">
<mat-table #table [dataSource]="dataSource"
[@animateStagger]="{value:'50'}">
<!-- Checkbox Column -->
<ng-container cdkColumnDef="checkbox">
<md-header-cell *cdkHeaderCellDef></md-header-cell>
<md-cell *cdkCellDef="let contact">
<md-checkbox [(ngModel)]="checkboxes[contact.id]" (ngModelChange)="onSelectedChange(contact.id)"
(click)="$event.stopPropagation()">
</md-checkbox>
</md-cell>
<mat-header-cell *cdkHeaderCellDef></mat-header-cell>
<mat-cell *cdkCellDef="let contact">
<mat-checkbox [(ngModel)]="checkboxes[contact.id]" (ngModelChange)="onSelectedChange(contact.id)"
(click)="$event.stopPropagation()">
</mat-checkbox>
</mat-cell>
</ng-container>
<!-- Avatar Column -->
<ng-container cdkColumnDef="avatar">
<md-header-cell *cdkHeaderCellDef></md-header-cell>
<md-cell *cdkCellDef="let contact">
<mat-header-cell *cdkHeaderCellDef></mat-header-cell>
<mat-cell *cdkCellDef="let contact">
<img class="avatar" *ngIf="contact.avatar" [alt]="contact.name"
[src]="contact.avatar"/>
</md-cell>
</mat-cell>
</ng-container>
<!-- Name Column -->
<ng-container cdkColumnDef="name">
<md-header-cell *cdkHeaderCellDef>Name</md-header-cell>
<md-cell *cdkCellDef="let contact">
<mat-header-cell *cdkHeaderCellDef>Name</mat-header-cell>
<mat-cell *cdkCellDef="let contact">
<p class="text-truncate font-weight-600">{{contact.name}} {{contact.lastName}}</p>
</md-cell>
</mat-cell>
</ng-container>
<!-- Email Column -->
<ng-container cdkColumnDef="email">
<md-header-cell *cdkHeaderCellDef fxHide fxShow.gt-sm>Email</md-header-cell>
<md-cell *cdkCellDef="let contact" fxHide fxShow.gt-sm>
<mat-header-cell *cdkHeaderCellDef fxHide fxShow.gt-sm>Email</mat-header-cell>
<mat-cell *cdkCellDef="let contact" fxHide fxShow.gt-sm>
<p class="email text-truncate">
{{contact.email}}
</p>
</md-cell>
</mat-cell>
</ng-container>
<!-- Phone Column -->
<ng-container cdkColumnDef="phone">
<md-header-cell *cdkHeaderCellDef fxHide fxShow.gt-md>Phone</md-header-cell>
<md-cell *cdkCellDef="let contact" fxHide fxShow.gt-md>
<mat-header-cell *cdkHeaderCellDef fxHide fxShow.gt-md>Phone</mat-header-cell>
<mat-cell *cdkCellDef="let contact" fxHide fxShow.gt-md>
<p class="phone text-truncate">
{{contact.phone}}
</p>
</md-cell>
</mat-cell>
</ng-container>
<!-- Job Title Column -->
<ng-container cdkColumnDef="jobTitle">
<md-header-cell *cdkHeaderCellDef fxHide fxShow.gt-lg>Job title</md-header-cell>
<md-cell *cdkCellDef="let contact" fxHide fxShow.gt-lg>
<mat-header-cell *cdkHeaderCellDef fxHide fxShow.gt-lg>Job title</mat-header-cell>
<mat-cell *cdkCellDef="let contact" fxHide fxShow.gt-lg>
<p class="job-title text-truncate">
{{contact.jobTitle}}
</p>
</md-cell>
</mat-cell>
</ng-container>
<!-- Company Column -->
<ng-container cdkColumnDef="company">
<md-header-cell *cdkHeaderCellDef fxHide fxShow.gt-lg>Company</md-header-cell>
<md-cell *cdkCellDef="let contact" fxHide fxShow.gt-lg>
<mat-header-cell *cdkHeaderCellDef fxHide fxShow.gt-lg>Company</mat-header-cell>
<mat-cell *cdkCellDef="let contact" fxHide fxShow.gt-lg>
<p class="company text-truncate">
{{contact.company}}
</p>
</md-cell>
</mat-cell>
</ng-container>
<!-- Buttons Column -->
<ng-container cdkColumnDef="buttons">
<md-header-cell *cdkHeaderCellDef></md-header-cell>
<md-cell *cdkCellDef="let contact">
<mat-header-cell *cdkHeaderCellDef></mat-header-cell>
<mat-cell *cdkCellDef="let contact">
<div fxFlex="row" fxLayoutAlign="end center">
<button md-icon-button (click)="$event.stopPropagation();toggleStar(contact.id)" aria-label="Toggle star">
<md-icon *ngIf="user.starred.includes(contact.id)">star</md-icon>
<md-icon *ngIf="!user.starred.includes(contact.id)">star_outline</md-icon>
<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>
</button>
<button md-icon-button [mdMenuTriggerFor]="moreMenu" aria-label="More"
<button mat-icon-button [matMenuTriggerFor]="moreMenu" aria-label="More"
(click)="$event.stopPropagation();">
<md-icon>more_vert</md-icon>
<mat-icon>more_vert</mat-icon>
</button>
<md-menu #moreMenu="mdMenu">
<button md-menu-item aria-label="remove" (click)="deleteContact(contact)">
<md-icon>delete</md-icon>
<mat-menu #moreMenu="matMenu">
<button mat-menu-item aria-label="remove" (click)="deleteContact(contact)">
<mat-icon>delete</mat-icon>
<span>Remove</span>
</button>
</md-menu>
</mat-menu>
</div>
</md-cell>
</mat-cell>
</ng-container>
<md-header-row *cdkHeaderRowDef="displayedColumns"></md-header-row>
<md-row *cdkRowDef="let contact; columns: displayedColumns;"
(click)="editContact(contact)"
[ngClass]="{'md-light-blue-50-bg':checkboxes[contact.id]}"
md-ripple>
</md-row>
</md-table>
<mat-header-row *cdkHeaderRowDef="displayedColumns"></mat-header-row>
<mat-row *cdkRowDef="let contact; columns: displayedColumns;"
class="contact"
(click)="editContact(contact)"
[ngClass]="{'mat-light-blue-50-bg':checkboxes[contact.id]}"
matRipple
[@animate]="{value:'*',params:{y:'100%'}}">
</mat-row>
</mat-table>
<!-- ADD CONTACT BUTTON -->
<button md-fab class="md-accent-bg" id="add-contact-button" (click)="newContact()" aria-label="add contact">
<md-icon>person_add</md-icon>
</button>
<!-- / ADD CONTACT BUTTON -->

View File

@@ -8,7 +8,7 @@
box-shadow: none;
.mat-column-checkbox {
flex: 0 1 64px;
flex: 0 1 48px;
}
.mat-column-avatar {
@@ -22,6 +22,7 @@
.mat-row {
position: relative;
cursor: pointer;
padding: 8px 8px 8px 24px;
.mat-cell {
min-width: 0;

View File

@@ -2,15 +2,17 @@ import { Component, OnInit, TemplateRef, ViewChild } from '@angular/core';
import { ContactsService } from '../contacts.service';
import { Observable } from 'rxjs/Observable';
import { FuseContactsContactFormDialogComponent } from '../contact-form/contact-form.component';
import { MdDialog, MdDialogRef } from '@angular/material';
import { MatDialog, MatDialogRef } from '@angular/material';
import { FuseConfirmDialogComponent } from '../../../../../core/components/confirm-dialog/confirm-dialog.component';
import { FormGroup } from '@angular/forms';
import { DataSource } from '@angular/cdk/collections';
import { fuseAnimations } from '../../../../../core/animations';
@Component({
selector : 'fuse-contacts-contact-list',
templateUrl: './contact-list.component.html',
styleUrls : ['./contact-list.component.scss']
styleUrls : ['./contact-list.component.scss'],
animations : fuseAnimations
})
export class FuseContactsContactListComponent implements OnInit
{
@@ -25,11 +27,11 @@ export class FuseContactsContactListComponent implements OnInit
dialogRef: any;
confirmDialogRef: MdDialogRef<FuseConfirmDialogComponent>;
confirmDialogRef: MatDialogRef<FuseConfirmDialogComponent>;
constructor(
private contactsService: ContactsService,
public dialog: MdDialog
public dialog: MatDialog
)
{
this.contactsService.onContactsChanged.subscribe(contacts => {
@@ -61,28 +63,6 @@ export class FuseContactsContactListComponent implements OnInit
this.dataSource = new FilesDataSource(this.contactsService);
}
newContact()
{
this.dialogRef = this.dialog.open(FuseContactsContactFormDialogComponent, {
panelClass: 'contact-form-dialog',
data : {
action: 'new'
}
});
this.dialogRef.afterClosed()
.subscribe((response: FormGroup) => {
if ( !response )
{
return;
}
this.contactsService.updateContact(response.getRawValue());
});
}
editContact(contact)
{
this.dialogRef = this.dialog.open(FuseContactsContactFormDialogComponent, {

View File

@@ -1,21 +1,21 @@
<div id="contacts" class="page-layout simple left-sidenav inner-sidenav" perfect-scrollbar>
<div id="contacts" class="page-layout simple left-sidenav inner-sidenav">
<!-- HEADER -->
<div class="header md-accent-bg p-24" fxLayout="column" fxLayoutAlign="start start"
<div class="header mat-accent-bg p-16 p-sm-24" fxLayout="column" fxLayoutAlign="start start"
fxLayout.gt-xs="row" fxLayoutAlign.gt-xs="space-between center">
<!-- APP TITLE -->
<div fxLayout="row" fxLayoutAlign="start center">
<button md-button class="mat-icon-button sidenav-toggle mr-12"
fuseMdSidenavToggler="contacts-main-sidenav"
<button mat-button class="mat-icon-button sidenav-toggle mr-12"
fuseMatSidenavToggler="contacts-main-sidenav"
fxHide.gt-md>
<md-icon>menu</md-icon>
<mat-icon>menu</mat-icon>
</button>
<div class="logo" fxLayout="row" fxLayoutAlign="start center">
<md-icon class="logo-icon mr-16">account_box</md-icon>
<span class="logo-text h1">Contacts</span>
<mat-icon class="logo-icon mr-16" *fuseIfOnDom [@animate]="{value:'*',params:{delay:'50ms',scale:'0.2'}}">account_box</mat-icon>
<span class="logo-text h1" *fuseIfOnDom [@animate]="{value:'*',params:{delay:'100ms',x:'-25px'}}">Contacts</span>
</div>
</div>
@@ -24,11 +24,11 @@
<!-- SEARCH -->
<div class="search-input-wrapper mt-16 ml-8 m-sm-0" fxLayout="row" fxLayoutAlign="start center">
<label for="search" class="mr-8">
<md-icon>search</md-icon>
<mat-icon>search</mat-icon>
</label>
<md-input-container md-no-float class="m-0" floatPlaceholder="never">
<input mdInput [formControl]="searchInput" id="search" placeholder="Search for anything">
</md-input-container>
<mat-form-field mat-no-float class="m-0" floatPlaceholder="never">
<input matInput [formControl]="searchInput" id="search" placeholder="Search for anything">
</mat-form-field>
</div>
<!-- / SEARCH -->
@@ -36,25 +36,25 @@
<!-- / HEADER -->
<!-- SELECTED BAR -->
<fuse-selected-bar class="md-accent-600-bg" *ngIf="hasSelectedContacts" [@slideInTop]></fuse-selected-bar>
<fuse-selected-bar class="mat-accent-600-bg" *ngIf="hasSelectedContacts" [@slideInTop]></fuse-selected-bar>
<!-- / SELECTED BAR -->
<md-sidenav-container>
<mat-sidenav-container>
<!-- SIDENAV -->
<md-sidenav class="sidenav mat-sidenav-opened" align="start" opened="true" mode="side"
fuseMdSidenavHelper="contacts-main-sidenav" md-is-locked-open="gt-md">
<mat-sidenav class="sidenav mat-sidenav-opened" align="start" opened="true" mode="side"
fuseMatSidenavHelper="contacts-main-sidenav" mat-is-locked-open="gt-sm">
<fuse-contacts-main-sidenav></fuse-contacts-main-sidenav>
<fuse-contacts-main-sidenav *fuseIfOnDom [@animate]="{value:'*'}"></fuse-contacts-main-sidenav>
</md-sidenav>
</mat-sidenav>
<!-- / SIDENAV -->
<!-- CENTER -->
<div class="center p-24 pr-sm-92" perfect-scrollbar>
<div class="center p-24 pb-56 pr-sm-92" fusePerfectScrollbar>
<!-- CONTENT -->
<div class="content md-white-bg mat-elevation-z4">
<div class="content mat-white-bg mat-elevation-z4">
<fuse-contacts-contact-list></fuse-contacts-contact-list>
@@ -64,6 +64,13 @@
</div>
<!-- / CENTER -->
</md-sidenav-container>
</mat-sidenav-container>
</div>
<!-- ADD CONTACT BUTTON -->
<button mat-fab class="mat-accent-bg" id="add-contact-button" (click)="newContact()" aria-label="add contact"
*fuseIfOnDom [@animate]="{value:'*', params:{delay:'300ms',scale:'.2'}}">
<mat-icon>person_add</mat-icon>
</button>
<!-- / ADD CONTACT BUTTON -->

View File

@@ -4,3 +4,11 @@
overflow: hidden;
}
}
#add-contact-button {
position: absolute;
bottom: 12px;
right: 12px;
padding: 0;
z-index: 99;
}

View File

@@ -1,25 +1,53 @@
import { Component, OnInit, ViewEncapsulation } from '@angular/core';
import { ContactsService } from './contacts.service';
import { Animations } from '../../../../core/animations';
import { FormControl } from '@angular/forms';
import { fuseAnimations } from '../../../../core/animations';
import { FormControl, FormGroup } from '@angular/forms';
import { FuseContactsContactFormDialogComponent } from './contact-form/contact-form.component';
import { MatDialog } from '@angular/material';
@Component({
selector : 'fuse-contacts',
templateUrl : './contacts.component.html',
styleUrls : ['./contacts.component.scss'],
encapsulation: ViewEncapsulation.None,
animations : [Animations.slideInTop]
animations : fuseAnimations
})
export class FuseContactsComponent implements OnInit
{
hasSelectedContacts: boolean;
searchInput: FormControl;
dialogRef: any;
constructor(private contactsService: ContactsService)
constructor(
private contactsService: ContactsService,
public dialog: MatDialog
)
{
this.searchInput = new FormControl('');
}
newContact()
{
this.dialogRef = this.dialog.open(FuseContactsContactFormDialogComponent, {
panelClass: 'contact-form-dialog',
data : {
action: 'new'
}
});
this.dialogRef.afterClosed()
.subscribe((response: FormGroup) => {
if ( !response )
{
return;
}
this.contactsService.updateContact(response.getRawValue());
});
}
ngOnInit()
{

View File

@@ -1,7 +1,7 @@
import { Injectable } from '@angular/core';
import { ActivatedRouteSnapshot, Resolve, RouterStateSnapshot } from '@angular/router';
import { Observable } from 'rxjs/Observable';
import { Http } from '@angular/http';
import { HttpClient } from '@angular/common/http';
import { BehaviorSubject } from 'rxjs/BehaviorSubject';
import { Contact } from './contact.model';
import { FuseUtils } from '../../../../core/fuseUtils';
@@ -23,7 +23,7 @@ export class ContactsService implements Resolve<any>
searchText: string;
filterBy: string;
constructor(private http: Http)
constructor(private http: HttpClient)
{
}
@@ -65,9 +65,9 @@ export class ContactsService implements Resolve<any>
{
return new Promise((resolve, reject) => {
this.http.get('api/contacts-contacts')
.subscribe(response => {
.subscribe((response: any) => {
this.contacts = response.json().data;
this.contacts = response;
if ( this.filterBy === 'starred' )
{
@@ -103,8 +103,8 @@ export class ContactsService implements Resolve<any>
{
return new Promise((resolve, reject) => {
this.http.get('api/contacts-user/5725a6802d10e277a0f35724')
.subscribe(response => {
this.user = response.json().data;
.subscribe((response: any) => {
this.user = response;
this.onUserDataChanged.next(this.user);
resolve(this.user);
}, reject);

View File

@@ -1,13 +1,13 @@
<div fxFlex fxLayout="row" fxLayoutAlign="start center" class="p-24">
<div class="close-button-wrapper" fxFlex="220px" (click)="deselectAll()">
<button class="p-8" md-button fxLayout="row" fxLayoutAlign="start center">
<md-icon class="mr-8">arrow_back</md-icon>
<div class="close-button-wrapper" fxFlex="0 1 auto" fxFlex.gt-sm="220px" (click)="deselectAll()">
<button class="p-8" mat-button fxLayout="row" fxLayoutAlign="start center">
<mat-icon class="mr-8">arrow_back</mat-icon>
<span class="text-uppercase">Back</span>
</button>
</div>
<div fxFlex fxLayout="row" fxLayoutAlign="space-between center">
<div fxFlex fxLayout="row" fxLayoutAlign="end center" fxLayoutAlign.gt-sm="space-between center">
<div>
<span class="selected-contacts-count">
@@ -15,19 +15,19 @@
<span>selected</span>
</span>
<button md-icon-button [mdMenuTriggerFor]="selectMenu">
<md-icon>arrow_drop_down</md-icon>
<button mat-icon-button [matMenuTriggerFor]="selectMenu">
<mat-icon>arrow_drop_down</mat-icon>
</button>
<md-menu #selectMenu="mdMenu">
<button md-menu-item (click)="selectAll()">Select all</button>
<button md-menu-item (click)="deselectAll()">Deselect all</button>
</md-menu>
<mat-menu #selectMenu="matMenu">
<button mat-menu-item (click)="selectAll()">Select all</button>
<button mat-menu-item (click)="deselectAll()">Deselect all</button>
</mat-menu>
</div>
<div class="multi-select-actions">
<button md-icon-button (click)="deleteSelectedContacts()" aria-label="delete selected">
<md-icon>delete</md-icon>
<button mat-icon-button (click)="deleteSelectedContacts()" aria-label="delete selected">
<mat-icon>delete</mat-icon>
</button>
</div>

View File

@@ -1,6 +1,6 @@
import { Component, OnInit } from '@angular/core';
import { ContactsService } from '../contacts.service';
import { MdDialog, MdDialogRef } from '@angular/material';
import { MatDialog, MatDialogRef } from '@angular/material';
import { FuseConfirmDialogComponent } from '../../../../../core/components/confirm-dialog/confirm-dialog.component';
@Component({
@@ -13,11 +13,11 @@ export class FuseContactsSelectedBarComponent implements OnInit
selectedContacts: string[];
hasSelectedContacts: boolean;
isIndeterminate: boolean;
confirmDialogRef: MdDialogRef<FuseConfirmDialogComponent>;
confirmDialogRef: MatDialogRef<FuseConfirmDialogComponent>;
constructor(
private contactsService: ContactsService,
public dialog: MdDialog
public dialog: MatDialog
)
{
this.contactsService.onSelectedContactsChanged

View File

@@ -1,6 +1,6 @@
<div class="sidenav-content">
<div class="card md-white-bg">
<div class="card mat-white-bg">
<!-- SIDENAV HEADER -->
<div class="header p-24" fxLayout="row" fxLayoutAlign="start center">
@@ -13,24 +13,24 @@
<!-- / SIDENAV HEADER -->
<!-- SIDENAV CONTENT -->
<div class="content py-16" perfect-scrollbar>
<div class="content py-16" fusePerfectScrollbar>
<div class="nav">
<div class="nav-item" aria-label="inbox">
<a class="nav-link" md-ripple (click)="changeFilter('all')" [ngClass]="{'active':filterBy ==='all'}">
<a class="nav-link" matRipple (click)="changeFilter('all')" [ngClass]="{'active':filterBy ==='all'}">
<span class="title">All Contacts</span>
</a>
</div>
<div class="nav-item" aria-label="frequently contacted" (click)="changeFilter('frequent')">
<a class="nav-link" md-ripple [ngClass]="{'active':filterBy ==='frequent'}">
<a class="nav-link" matRipple [ngClass]="{'active':filterBy ==='frequent'}">
<div class="title">Freequently contacted</div>
</a>
</div>
<div class="nav-item" aria-label="starred" (click)="changeFilter('starred')">
<a class="nav-link" md-ripple [ngClass]="{'active':filterBy ==='starred'}">
<a class="nav-link" matRipple [ngClass]="{'active':filterBy ==='starred'}">
<div class="title">Starred Contacts</div>
</a>
</div>

View File

@@ -11,7 +11,7 @@
flex-direction: column;
padding: 0;
@include media-breakpoint(gt-md) {
@include media-breakpoint(gt-sm) {
padding: 24px 4px 24px 24px;
}
@@ -21,7 +21,7 @@
flex: 0 1 auto;
padding: 0;
@include media-breakpoint(gt-md) {
@include media-breakpoint(gt-sm) {
@include mat-elevation(4);
}

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