diff --git a/package-lock.json b/package-lock.json index a4ba78d7..9236e029 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1183,7 +1183,6 @@ "resolved": "https://registry.npmjs.org/center-align/-/center-align-0.1.3.tgz", "integrity": "sha1-qg0yYptu6XIgBBHL1EYckHvCt60=", "dev": true, - "optional": true, "requires": { "align-text": "0.1.4", "lazy-cache": "1.0.4" @@ -1193,8 +1192,7 @@ "version": "1.0.4", "resolved": "https://registry.npmjs.org/lazy-cache/-/lazy-cache-1.0.4.tgz", "integrity": "sha1-odePw6UEdMuAhF07O24dpJpEbo4=", - "dev": true, - "optional": true + "dev": true } } }, @@ -6197,6 +6195,11 @@ "resolved": "https://registry.npmjs.org/ngx-color-picker/-/ngx-color-picker-4.3.1.tgz", "integrity": "sha512-/Gn3XvOgaAK/ZnXA0ej9ivYm6uIvHwvZaSzx04ZUtG1Vw5RCKzw84dK0Ru9Ylnnq1xJU4WmdA63REkJb8cvYXg==" }, + "ngx-cookie-service": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/ngx-cookie-service/-/ngx-cookie-service-1.0.7.tgz", + "integrity": "sha1-NdQzt3WloqgIxUl19Pr1AKzFL2g=" + }, "ngx-perfect-scrollbar": { "version": "4.5.6", "resolved": "https://registry.npmjs.org/ngx-perfect-scrollbar/-/ngx-perfect-scrollbar-4.5.6.tgz", @@ -7939,7 +7942,6 @@ "resolved": "https://registry.npmjs.org/right-align/-/right-align-0.1.3.tgz", "integrity": "sha1-YTObci/mo1FWiSENJOFMlhSGE+8=", "dev": true, - "optional": true, "requires": { "align-text": "0.1.4" } @@ -9191,28 +9193,48 @@ "camelcase": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-1.2.1.tgz", - "integrity": "sha1-m7UwTS4LVmmLLHWLCKPqqdqlijk=" + "integrity": "sha1-m7UwTS4LVmmLLHWLCKPqqdqlijk=", + "dev": true }, "cliui": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/cliui/-/cliui-2.1.0.tgz", - "integrity": "sha1-S0dXYP+AJkx2LDoXGQMukcf+oNE=" + "integrity": "sha1-S0dXYP+AJkx2LDoXGQMukcf+oNE=", + "dev": true, + "requires": { + "center-align": "0.1.3", + "right-align": "0.1.3", + "wordwrap": "0.0.2" + } }, "uglify-js": { "version": "2.8.29", "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-2.8.29.tgz", "integrity": "sha1-KcVzMUgFe7Th913zW3qcty5qWd0=", - "dev": true + "dev": true, + "requires": { + "source-map": "0.5.6", + "uglify-to-browserify": "1.0.2", + "yargs": "3.10.0" + } }, "wordwrap": { "version": "0.0.2", "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz", - "integrity": "sha1-t5Zpu0LstAn4PVg8rVLKF+qhZD8=" + "integrity": "sha1-t5Zpu0LstAn4PVg8rVLKF+qhZD8=", + "dev": true }, "yargs": { "version": "3.10.0", "resolved": "https://registry.npmjs.org/yargs/-/yargs-3.10.0.tgz", - "integrity": "sha1-9+572FfdfB0tOMDnTvvWgdFDH9E=" + "integrity": "sha1-9+572FfdfB0tOMDnTvvWgdFDH9E=", + "dev": true, + "requires": { + "camelcase": "1.2.1", + "cliui": "2.1.0", + "decamelize": "1.2.0", + "window-size": "0.1.0" + } } } }, @@ -9925,8 +9947,7 @@ "version": "0.1.0", "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.1.0.tgz", "integrity": "sha1-VDjNLqk7IC76Ohn+iIeu58lPnJ0=", - "dev": true, - "optional": true + "dev": true }, "wordwrap": { "version": "0.0.3", diff --git a/package.json b/package.json index 5a93b00e..fa2258f0 100644 --- a/package.json +++ b/package.json @@ -37,6 +37,7 @@ "intl": "^1.2.5", "moment": "^2.18.1", "ngx-color-picker": "^4.3.1", + "ngx-cookie-service": "^1.0.7", "ngx-perfect-scrollbar": "^4.5.6", "rxjs": "^5.4.3", "web-animations-js": "^2.3.1", diff --git a/src/app/app.module.ts b/src/app/app.module.ts index a7621b15..4550dd78 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -17,6 +17,8 @@ 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 { ComponentsThirdPartyModule } from './main/content/components-third-party/components-third-party.module'; +import { ServicesModule } from './main/content/services/services.module'; const appRoutes: Routes = [ { @@ -71,9 +73,11 @@ const appRoutes: Routes = [ PagesModule, UIModule, - ComponentsModule + ServicesModule, + ComponentsModule, + ComponentsThirdPartyModule ], - providers: [ + providers : [ FuseSplashScreenService, FuseConfigService ], diff --git a/src/app/core/components/countdown/countdown.component.scss b/src/app/core/components/countdown/countdown.component.scss index b09ceb86..96c1e072 100644 --- a/src/app/core/components/countdown/countdown.component.scss +++ b/src/app/core/components/countdown/countdown.component.scss @@ -9,6 +9,7 @@ flex-direction: row; align-items: center; justify-content: center; + text-align: center; .time { display: flex; diff --git a/src/app/core/components/shortcuts/shortcuts.component.ts b/src/app/core/components/shortcuts/shortcuts.component.ts index e44c49ff..fd6f9652 100644 --- a/src/app/core/components/shortcuts/shortcuts.component.ts +++ b/src/app/core/components/shortcuts/shortcuts.component.ts @@ -4,6 +4,7 @@ import { Subscription } from 'rxjs/Subscription'; import { ObservableMedia } from '@angular/flex-layout'; import { FuseMatchMedia } from '../../services/match-media.service'; import { FuseConfigService } from '../../services/config.service'; +import { CookieService } from 'ngx-cookie-service'; @Component({ selector : 'fuse-shortcuts', @@ -29,7 +30,8 @@ export class FuseShortcutsComponent implements OnInit, OnDestroy private observableMedia: ObservableMedia, private fuseMatchMedia: FuseMatchMedia, private fuseNavigationService: FuseNavigationService, - private fuseConfig: FuseConfigService + private fuseConfig: FuseConfigService, + private cookieService: CookieService ) { this.filteredNavigationItems = this.navigationItems = this.fuseNavigationService.getFlatNavigation(); @@ -45,33 +47,42 @@ export class FuseShortcutsComponent implements OnInit, OnDestroy ngOnInit() { - // User's shortcut items - this.shortcutItems = [ - { - 'title': 'Calendar', - 'type' : 'nav-item', - 'icon' : 'today', - 'url' : '/apps/calendar' - }, - { - 'title': 'Mail', - 'type' : 'nav-item', - 'icon' : 'email', - 'url' : '/apps/mail' - }, - { - 'title': 'Contacts', - 'type' : 'nav-item', - 'icon' : 'account_box', - 'url' : '/apps/contacts' - }, - { - 'title': 'To-Do', - 'type' : 'nav-item', - 'icon' : 'check_box', - 'url' : '/apps/todo' - } - ]; + const cookieExists = this.cookieService.check('FUSE2.shortcuts'); + + if ( cookieExists ) + { + this.shortcutItems = JSON.parse(this.cookieService.get('FUSE2.shortcuts')); + } + else + { + // User's shortcut items + this.shortcutItems = [ + { + 'title': 'Calendar', + 'type' : 'nav-item', + 'icon' : 'today', + 'url' : '/apps/calendar' + }, + { + 'title': 'Mail', + 'type' : 'nav-item', + 'icon' : 'email', + 'url' : '/apps/mail' + }, + { + 'title': 'Contacts', + 'type' : 'nav-item', + 'icon' : 'account_box', + 'url' : '/apps/contacts' + }, + { + 'title': 'To-Do', + 'type' : 'nav-item', + 'icon' : 'check_box', + 'url' : '/apps/todo' + } + ]; + } this.matchMediaSubscription = this.fuseMatchMedia.onMediaChange.subscribe(() => { @@ -115,12 +126,18 @@ export class FuseShortcutsComponent implements OnInit, OnDestroy if ( this.shortcutItems[i].url === itemToToggle.url ) { this.shortcutItems.splice(i, 1); + + // Save to the cookies + this.cookieService.set('FUSE2.shortcuts', JSON.stringify(this.shortcutItems)); + return; } - } this.shortcutItems.push(itemToToggle); + + // Save to the cookies + this.cookieService.set('FUSE2.shortcuts', JSON.stringify(this.shortcutItems)); } isInShortcuts(navigationItem) diff --git a/src/app/core/modules/shared.module.ts b/src/app/core/modules/shared.module.ts index f9c6acea..da733728 100644 --- a/src/app/core/modules/shared.module.ts +++ b/src/app/core/modules/shared.module.ts @@ -20,6 +20,7 @@ import { FuseMdSidenavHelperService } from '../directives/md-sidenav-helper/md-s import { FuseHljsComponent } from '../components/hljs/hljs.component'; 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 { CookieService } from 'ngx-cookie-service'; @NgModule({ declarations : [ @@ -65,6 +66,7 @@ import { FuseMaterialColorPickerComponent } from '../components/material-color-p FuseConfirmDialogComponent ], providers : [ + CookieService, FuseNavigationService, FuseMatchMedia, FuseNavbarService, diff --git a/src/app/core/services/config.service.ts b/src/app/core/services/config.service.ts index 795b31dd..7c49fa93 100644 --- a/src/app/core/services/config.service.ts +++ b/src/app/core/services/config.service.ts @@ -12,6 +12,7 @@ export class FuseConfigService /** * @param router + * @param platform */ constructor( private router: Router, diff --git a/src/app/main/content/components-third-party/components-third-party.module.ts b/src/app/main/content/components-third-party/components-third-party.module.ts new file mode 100644 index 00000000..38e20c37 --- /dev/null +++ b/src/app/main/content/components-third-party/components-third-party.module.ts @@ -0,0 +1,24 @@ +import { NgModule } from '@angular/core'; +import { SharedModule } from '../../../core/modules/shared.module'; +import { RouterModule } from '@angular/router'; +import { FuseNgxDatatableComponent } from './datatable/ngx-datatable.component'; + +const routes = [ + { + path : 'components-third-party/datatables/ngx-datatable', + component: FuseNgxDatatableComponent + } +]; + +@NgModule({ + imports : [ + SharedModule, + RouterModule.forChild(routes) + ], + declarations: [ + FuseNgxDatatableComponent + ] +}) +export class ComponentsThirdPartyModule +{ +} diff --git a/src/app/main/content/components/datatable/ngx-datatable.component.html b/src/app/main/content/components-third-party/datatable/ngx-datatable.component.html similarity index 100% rename from src/app/main/content/components/datatable/ngx-datatable.component.html rename to src/app/main/content/components-third-party/datatable/ngx-datatable.component.html diff --git a/src/app/main/content/components/datatable/ngx-datatable.component.scss b/src/app/main/content/components-third-party/datatable/ngx-datatable.component.scss similarity index 100% rename from src/app/main/content/components/datatable/ngx-datatable.component.scss rename to src/app/main/content/components-third-party/datatable/ngx-datatable.component.scss diff --git a/src/app/main/content/components/datatable/ngx-datatable.component.ts b/src/app/main/content/components-third-party/datatable/ngx-datatable.component.ts similarity index 100% rename from src/app/main/content/components/datatable/ngx-datatable.component.ts rename to src/app/main/content/components-third-party/datatable/ngx-datatable.component.ts diff --git a/src/app/main/content/components/components.module.ts b/src/app/main/content/components/components.module.ts index 49d9026b..6b1160fb 100644 --- a/src/app/main/content/components/components.module.ts +++ b/src/app/main/content/components/components.module.ts @@ -1,28 +1,66 @@ import { NgModule } from '@angular/core'; import { SharedModule } from '../../../core/modules/shared.module'; import { RouterModule } from '@angular/router'; -import { FuseNgxDatatableComponent } from './datatable/ngx-datatable.component'; import { FusePriceTablesComponent } from './price-tables/price-tables.component'; +import { FuseCountdownDocsComponent } from './countdown/countdown.component'; +import { FuseHljsDocsComponent } from './hljs/hljs.component'; +import { FuseMaterialColorPickerDocsComponent } from './material-color-picker/material-color-picker.component'; +import { FuseNavigationDocsComponent } from './navigation/navigation.component'; +import { FuseShortcutsDocsComponent } from './shortcuts/shortcuts.component'; +import { FuseSearchBarDocsComponent } from 'app/main/content/components/search-bar/search-bar.component'; +import { FuseWidgetDocsComponent } from './widget/widget.component'; +import { FuseWidgetModule } from '../../../core/components/widget/widget.module'; const routes = [ { - path : 'components/datatables/ngx-datatable', - component: FuseNgxDatatableComponent + path : 'components/countdown', + component: FuseCountdownDocsComponent + }, + { + path : 'components/highlightjs', + component: FuseHljsDocsComponent + }, + { + path : 'components/material-color-picker', + component: FuseMaterialColorPickerDocsComponent + }, + { + path : 'components/navigation', + component: FuseNavigationDocsComponent }, { path : 'components/price-tables', component: FusePriceTablesComponent + }, + { + path : 'components/search-bar', + component: FuseSearchBarDocsComponent + }, + { + path : 'components/shortcuts', + component: FuseShortcutsDocsComponent + }, + { + path : 'components/widget', + component: FuseWidgetDocsComponent } ]; @NgModule({ imports : [ SharedModule, - RouterModule.forChild(routes) + RouterModule.forChild(routes), + FuseWidgetModule ], declarations: [ - FuseNgxDatatableComponent, - FusePriceTablesComponent + FuseCountdownDocsComponent, + FuseHljsDocsComponent, + FuseMaterialColorPickerDocsComponent, + FuseNavigationDocsComponent, + FusePriceTablesComponent, + FuseSearchBarDocsComponent, + FuseShortcutsDocsComponent, + FuseWidgetDocsComponent ] }) export class ComponentsModule diff --git a/src/app/main/content/components/countdown/countdown.component.html b/src/app/main/content/components/countdown/countdown.component.html new file mode 100644 index 00000000..e5bbe156 --- /dev/null +++ b/src/app/main/content/components/countdown/countdown.component.html @@ -0,0 +1,55 @@ +
+ fuse-countdown
is a custom built Fuse component allows you to create a countdowns.
+
+
+
+ eventDate
+
+ The date of the event. Since fuse-countdown uses moment.js to parse the dates, any moment.js
+ compatible date string can be used.
+
+
+ fuse-hljs
is a custom built Fuse component allows to show syntax highlighted codes.
+
+
+
+ lang
+
+ Language of the code to be highlighted. All highlight.js languages can be used.
+
+
+ fuse-material-color-picker
is a custom built Fuse component allows you to add a color picker
+ that allows to choose one of the many Material spec. colors.
+
+
+
+ selectedClass
+
+ The name of the Fuse color class to select, e.g. md-red-500-bg
+
+
+ selectedBg
+
+ The hex code of the color to be selected. It will be only selected if the hex code of the color
+ matches one of the material colors.
+
+
+ onValueChange
+
+ Event that triggered when a color selected. Returns an object that holds palette, hue, class name,
+ background and foreground colors.
+
+
+ fuse-search-bar
is a custom built Fuse component allows you to have a search bar that activates
+ on click.
+
+
+ onInput
+ Triggers every time an input occurs within the search bar. Can be used to trigger the actual
+ search mechanism. The $event is the value from the search input.
+
+ fuse-shortcuts
is a custom built Fuse component allows you to create and save shortcuts from
+ the navigation model.
+
+
+ <fuse-shortcuts></fuse-shortcuts>
uses the same service with navigation
+ component to populate the shortcuts. It can search the navigation items as well as pin and unpin them as
+ shortcuts. It uses browser cookies to store the shortcuts.
+
+ fuse-widget
is a custom built Fuse component allows to create flippable widget boxes.
+
+
+ Config
is a custom built Fuse service allows to have a granule control over the Fuse. It can be
+ used for changing theme options (layout, color etc.) on component basis.
+
+
+ Splash screen
is a custom built Fuse service allows to have a fully controllable splash
+ screen. It also has built state for application loading so it will always be available while the app
+ loads.
+
+